WO2012090962A1 - Image decoding device, image encoding device, data structure of encoded data, arithmetic decoding device, and arithmetic encoding device - Google Patents

Image decoding device, image encoding device, data structure of encoded data, arithmetic decoding device, and arithmetic encoding device Download PDF

Info

Publication number
WO2012090962A1
WO2012090962A1 PCT/JP2011/080126 JP2011080126W WO2012090962A1 WO 2012090962 A1 WO2012090962 A1 WO 2012090962A1 JP 2011080126 W JP2011080126 W JP 2011080126W WO 2012090962 A1 WO2012090962 A1 WO 2012090962A1
Authority
WO
WIPO (PCT)
Prior art keywords
coefficient
decoding
encoding
unit
syntax
Prior art date
Application number
PCT/JP2011/080126
Other languages
French (fr)
Japanese (ja)
Inventor
知宏 猪飼
将伸 八杉
Original Assignee
シャープ株式会社
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by シャープ株式会社 filed Critical シャープ株式会社
Publication of WO2012090962A1 publication Critical patent/WO2012090962A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/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/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/12Selection from among a plurality of transforms or standards, e.g. selection between discrete cosine transform [DCT] and sub-band transform or selection between H.263 and H.264
    • H04N19/122Selection of transform size, e.g. 8x8 or 2x4x8 DCT; Selection of sub-band transforms of varying structure or type
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/136Incoming video signal characteristics or properties
    • H04N19/14Coding unit complexity, e.g. amount of activity or edge presence estimation
    • 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/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/18Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being a set of transform coefficients
    • 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/189Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the adaptation method, adaptation tool or adaptation type used for the adaptive coding
    • H04N19/192Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the adaptation method, adaptation tool or adaptation type used for the adaptive coding the adaptation method, adaptation tool or adaptation type being iterative or recursive
    • H04N19/194Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the adaptation method, adaptation tool or adaptation type used for the adaptive coding the adaptation method, adaptation tool or adaptation type being iterative or recursive involving only two passes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/46Embedding additional information in the video signal during the compression process
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/60Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding
    • H04N19/61Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding in combination with predictive coding
    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/90Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using coding techniques not provided for in groups H04N19/10-H04N19/85, e.g. fractals
    • H04N19/91Entropy coding, e.g. variable length coding [VLC] or arithmetic coding

Definitions

  • the present invention relates to an image decoding apparatus for decoding a coefficient matrix, an image encoding apparatus for encoding a coefficient matrix, and a data structure of encoded data obtained by encoding the coefficient matrix.
  • the present invention also relates to an arithmetic decoding device that decodes encoded data that has been arithmetically encoded, and an image decoding device that includes such an arithmetic decoding device.
  • the present invention also relates to an arithmetic encoding device that generates encoded data that has been arithmetically encoded, and an image encoding device that includes such an arithmetic encoding device.
  • a moving image encoding device that generates encoded data by encoding the moving image, and a moving image that generates a decoded image by decoding the encoded data
  • An image decoding device is used.
  • Non-Patent Document 3 A method adopted in KTA software which is a codec for joint development in AVC (Non-patent Documents 1 and 2) and VCEG (Video Coding Expert Group), and TMuC (Test Model Under Consationation) software which is a successor codec (Non-Patent Document 3).
  • a prediction residual obtained by subtracting a prediction image from an original image is converted, and further, quantized conversion coefficients are encoded to generate encoded data.
  • the conversion coefficient of this prediction residual occupies most of the encoded data. More specifically, although it depends on encoding settings and image characteristics, it is said that 50 to 80% of the encoded data is information related to the transform coefficient. For this reason, it is desired to efficiently encode the transform coefficient.
  • the conversion coefficient is expressed in the form of a two-dimensional matrix of a predetermined size. Each element of this matrix is scanned in a predetermined order and stored in a one-dimensional array, and then transform coefficients are encoded.
  • H. In H.264 / AVC the scan order is taken into consideration so that the correlation between the values of transform coefficients can be used effectively, and the transform coefficients are stored in a one-dimensional array by so-called zigzag scanning (Non-Patent Documents 1 and 2). .
  • CAVLC Context-Adaptive Variable Length Coding
  • H. In H.264 / AVC a variable length coding method called CABAC (Context-AdaptiveAdBinary Arithmetic Coding) is also employed.
  • variable length coding is performed based on a series (0 run; zero run) of absolute values (level), positive / negative (sign), and coefficient 0 (also referred to as non-zero coefficient) of each transform coefficient.
  • VLC Very Length Coding tables corresponding to the run and level encoding are used.
  • TotalCoeff the number of non-zero coefficients
  • TrailingOnes the number of coefficients having the last consecutive absolute value 1
  • TMuC Test Model Consideration
  • VLC VLC encoding method
  • Non-Patent Document 3 a procedure for the VLC encoding method
  • the position and value of the last coefficient are encoded.
  • a run mode a set of zero runs and coefficients is encoded. This run mode is executed until a predetermined condition such as the appearance of a coefficient having a large level is satisfied.
  • the run mode ends, the procedure for sequentially encoding the remaining coefficients is executed, and the encoding process ends when all the coefficients are encoded.
  • an image (picture) constituting a moving image is a slice obtained by dividing the image, and a maximum coding unit (LCU: Largegest Coding Unit) obtained by dividing the slice.
  • LCU Largegest Coding Unit
  • the coding unit (CU: Coding Unit) obtained by dividing the maximum coding unit and the hierarchical structure consisting of blocks and partitions obtained by dividing the coding unit are often used. Is encoded as a minimum unit.
  • a prediction image is usually generated based on a locally decoded image obtained by encoding / decoding an input image, and the difference between the prediction image and the input image is determined.
  • a transform coefficient obtained by DCT (Discrete Cosine Transform) transform of an image (sometimes referred to as “residual image” or “predictive residual”) is encoded.
  • transform coefficients include context-adaptive variable-length coding (CALVC) and context-adaptive binary arithmetic coding (CABAC).
  • CALVC context-adaptive variable-length coding
  • CABAC context-adaptive binary arithmetic coding
  • each transform coefficient is zigzag scanned into a one-dimensional vector, and then the syntax indicating the value of each transform coefficient and the length of consecutive zeros (also called a run) are used. Representing syntax and the like are encoded.
  • CABAC CABAC
  • binarization processing is performed on various syntaxes representing transform coefficients, and binary data obtained by the binarization processing is arithmetically encoded.
  • examples of the various syntaxes include a flag sig_flag indicating whether or not the conversion coefficient is 0, a flag last_flag indicating whether or not the conversion coefficient is the last conversion coefficient in the processing order, and the like.
  • CABAC CABAC
  • the context index assigned to the frequency domain to be processed is referred to, and the context variable specified by the context index is used. Is subjected to arithmetic coding according to the occurrence probability indicated by the probability state index included in. The occurrence probability specified by the probability state index is updated every time one symbol is encoded.
  • Non-Patent Document 3 discloses a technique for assigning a context index corresponding to the position of each transform coefficient in the frequency domain to the syntax representing each transform coefficient in the frequency domain corresponding to the block to be processed. .
  • variable length coding of transform coefficients by VLC may be inefficient for the following reasons.
  • the conventional coefficient scanning method for the matrix of transform coefficients is constant regardless of the coefficient distribution on the matrix.
  • a typical scanning method is the above-described zigzag scan, but the conventional technique uses only this zigzag scan regardless of the coefficient distribution on the matrix. For this reason, only a VLC table dedicated to zigzag scanning has been defined.
  • FIG. 35 shows an example in which transform coefficients represented by a two-dimensional matrix are stored in a one-dimensional array by zigzag scanning.
  • a of the figure shows an example of scanning the matrix MX100 of 4 ⁇ 4 size conversion coefficients
  • (b) of the figure shows the one-dimensional array ARR100 in which the conversion coefficients are stored by scanning. An example is shown.
  • the numbers shown in the matrix MX100 shown in (a) of FIG. 35 represent the conversion coefficient values.
  • non-zero coefficients are distributed in the first column.
  • the zero coefficients are concentrated and distributed in the right three columns of the matrix MX100.
  • the dotted line arrows shown in (a) of the figure represent the scan order of the matrix MX100. That is, scans are executed in the scan order indicated by the dotted arrows from the upper left of the matrix MX100, and the conversion coefficients are stored in the one-dimensional array ARR100 shown in FIG.
  • the conversion coefficients are concentrated on the upper end or the left end of the matrix, such as the first column or the first row of the conversion coefficient matrix, the concentrated zero coefficients are obtained by scanning in a plan view. There is a problem that the one-dimensional array is divided.
  • the present invention has been made in view of the above-described problems, and an object of the present invention is to realize an image decoding apparatus or the like that can improve the encoding efficiency when the distribution of transform coefficients is biased. is there.
  • the technical scope of the present invention is not limited to the case where VLC is applied to the encoding method, but extends to the case where CABAC is applied. Details thereof will be described later.
  • an image decoding apparatus decodes a coefficient matrix by decoding and inverse scanning encoded quantized transform coefficients included in encoded data obtained by encoding image data.
  • the last coefficient position detecting means for detecting the position of the last non-zero coefficient in the reverse scan order in the coefficient matrix, and the position of the last non-zero coefficient in the coefficient matrix
  • a position determination means for determining whether or not a position determination range from a row or column including a coefficient of a direct current component to a predetermined row or column and the position of the last non-zero coefficient are in the position determination range 2 steps of decoding the coefficient matrix in a first decoding target range including the position of the last non-zero coefficient and a second decoding target range other than the first decoding target range, respectively. Characterized in that it comprises a No. means.
  • the quantized transform coefficient is obtained by orthogonally transforming and quantizing the prediction residual obtained by subtracting the predicted image from the image data in the image data encoding process. Also, the quantized transform coefficient in the block to be encoded can be expressed in the form of a coefficient matrix.
  • the encoded quantized transform coefficient is obtained by scanning and encoding a coefficient matrix composed of quantized transform coefficients. Scanning the coefficient matrix means storing the coefficients included in the coefficient matrix in a one-dimensional array.
  • reverse scanning is to rearrange the decoded coefficients at corresponding positions on the coefficient matrix.
  • the reverse scan order is a predetermined order in which reverse scan is performed.
  • a zigzag scan can be employed in the reverse scan order.
  • the DC component coefficient in the coefficient matrix is specifically the coefficient in the first row and the first column. Furthermore, it is a coefficient that makes the reverse scan order first in the zigzag scan.
  • the coefficient tends to be a non-zero coefficient whose value is not zero in the low frequency component near the DC component.
  • the coefficient tends to be a zero coefficient whose value becomes zero as it becomes a high frequency component.
  • the low frequency component coefficients are processed in the order in which they are processed before the high frequency component coefficients.
  • the last non-zero coefficient is the last non-zero coefficient in reverse scan order when viewed from the DC component coefficient. Furthermore, all coefficients in order after the last non-zero coefficient are all zero coefficients.
  • the position of the last non-zero coefficient is (1) the position from the first row to the predetermined row or (2) the position from the first column to the predetermined column of the coefficient matrix. Determine if it exists.
  • the above (1) and (2) are collectively referred to as a position determination range.
  • the position determination range can also be said to be an end portion including a coefficient of a direct current component in the coefficient matrix.
  • the coefficient matrix includes the first decoding target range including the position of the last non-zero coefficient
  • the first Decoding processing is performed in two stages with a second decoding target range other than the one decoding target range.
  • the first decoding target range may include the position of the DC component coefficient. Therefore, the decoding process can be performed as follows based on the position of the last non-zero coefficient, for example. First, the first non-zero coefficient to the DC component coefficient are decoded in the first decoding target range. Thereafter, in the second decoding target range, decoding is performed from the last non-zero coefficient in the scanning order in the second decoding target range to the first coefficient in the scanning order. The zigzag scan described above can be applied to the scan order in the second decoding target range.
  • non-zero coefficients tend to be biased to horizontal or vertical components when the residual is relatively small and the total number of coefficients is small. For example, in the case of coding of an inter prediction block, such a tendency is seen.
  • the coding efficiency is better when the lengths of continuous non-zero coefficients (hereinafter referred to as “runs”) are collected as much as possible, that is, when coding is performed without dividing.
  • the first decoding target range is decoded separately from the second decoding target range. For this reason, when non-zero coefficients are concentrated in the first decoding target range, the code amount of the code data to be decoded can be suppressed.
  • the run is encoded without being divided by the coefficients in the first decoding target range, and the encoding is efficiently performed. Therefore, the code amount to be decoded can be suppressed.
  • An image encoding apparatus outputs encoded data by performing orthogonal transform on a prediction residual obtained by subtracting a predicted image from image data and scanning and encoding a coefficient matrix composed of quantized transform coefficients.
  • the last coefficient position detecting means for detecting the position of the last non-zero coefficient in the scan order in the coefficient matrix, and the position of the last non-zero coefficient are the DC component in the coefficient matrix.
  • Position determination means for determining whether or not a position determination range from a row or column including the coefficient to a predetermined row or column and the position of the last non-zero coefficient are in the position determination range,
  • a two-stage code for encoding a coefficient matrix in each of a first encoding target range including the position of the last non-zero coefficient and a second encoding target range other than the first encoding target range. Characterized in that it and a means.
  • the data structure of the encoded data according to the present invention is a code generated by performing orthogonal transform on a prediction residual obtained by subtracting a predicted image from image data and scanning and coding a coefficient matrix composed of quantized transform coefficients.
  • the position information indicating the position of the last non-zero coefficient in the scan order in the coefficient matrix and the last non-zero coefficient are included in the coefficient matrix, and the coefficient matrix includes the DC component coefficient.
  • the first coefficient encoded data in which the coefficients in the first encoding target range from the column to the predetermined row or column are sequentially encoded, and the second encoding target other than the first encoding target range
  • second coefficient encoded data in which the coefficients in the range are sequentially encoded.
  • the same effects as those of the image decoding device according to the present invention can be obtained.
  • the image encoding device includes position information indicating the position of the last non-zero coefficient in the scan order in the coefficient matrix and the last non-zero coefficient, and includes a coefficient of a DC component in the coefficient matrix.
  • First coefficient encoded data obtained by sequentially encoding coefficients in a first range from a row or column to a predetermined row or column, and coefficients in a second range other than the first range are sequentially encoded.
  • the encoded second coefficient encoded data may be included in the data structure of the encoded data.
  • the image encoding device may encode the information in, for example, side information.
  • the above problem can be expressed as follows from another viewpoint. That is, when CABAC is applied to the encoding method, when the distribution of transform coefficients in the frequency domain varies from block to block, for example, the directions of edges in a plurality of adjacent blocks are greatly different from each other. In this case, even if the technique disclosed in Non-Patent Document 3 is used, an appropriate generation probability cannot be used for each transform coefficient, which causes a problem that the encoding efficiency is lowered.
  • the present invention can be expressed as follows from another viewpoint. That is, the present invention has been made in view of the above problems, and its purpose is to provide an arithmetic code with high coding efficiency even when the distribution of transform coefficients in the frequency domain varies from block to block. And an arithmetic decoding device.
  • the arithmetic decoding apparatus arithmetically calculates one or a plurality of types of syntax representing transform coefficients for each transform coefficient obtained by subjecting a target image to frequency conversion for each unit region.
  • An arithmetic decoding device that decodes encoded data obtained by encoding, wherein each syntax in a target frequency domain corresponding to a unit area to be processed has a type of syntax and a syntax of the syntax Context index assigning means for assigning a context index determined according to a position in the target frequency domain, and each syntax in the target frequency domain based on a probability state specified by the context index assigned to the syntax Syntax decoding means for sequential arithmetic decoding, and the above Transform coefficient restoring means for restoring each transform coefficient from each syntax decoded by the syntax decoding means, and undecoding in the target frequency domain according to the bias of the distribution of the restored non-zero transform coefficients in the target frequency domain And a context index changing means for changing a context index assigned to the syntax.
  • the context index allocating unit is responsive to each syntax in the target frequency domain according to the type of syntax and the position of the syntax in the target frequency domain. Assign a context index.
  • the context index changing means changes a context index assigned to an undecoded syntax in the target frequency domain according to a bias of a distribution of decoded non-zero transform coefficients in the target frequency domain, and
  • the decoding means decodes the undecoded syntax based on the probability state specified by the changed context index assigned to the undecoded syntax.
  • each syntax representing a transform coefficient can be coded based on an appropriate probability state. Even in a different case, encoded data having high encoding efficiency can be generated.
  • the unit area corresponds to, for example, a TU (conversion unit) in TMuC (Test (under Consideration) or a block obtained by dividing the TU.
  • the arithmetic coding apparatus encodes each transform coefficient obtained by frequency-transforming the target image for each unit region by arithmetically coding one or more kinds of syntax representing the transform coefficient.
  • An arithmetic coding apparatus for generating coded data wherein each syntax representing each transform coefficient in a target frequency region corresponding to a unit region to be processed has a syntax type and a target frequency of the syntax Context index allocating means for allocating a context index determined according to a position in a region, and each syntax in the target frequency region is sequentially arithmetic code based on a probability state specified by the context index allocated to the syntax
  • syntax encoding means for generating the target circumference Context index changing means for changing a context index to be assigned to an uncoded syntax in the target frequency domain according to a bias in the distribution of encoded non-zero transform coefficients in a number domain.
  • the context index allocating unit determines, for each syntax in the target frequency domain, the type of syntax and the position of the syntax in the target frequency domain. Assign a context index that is determined accordingly.
  • the context index changing means changes a context index assigned to an uncoded syntax in the target frequency domain according to a bias in a distribution of encoded non-zero transform coefficients in the target frequency domain, and
  • the tax encoding means encodes the uncoded syntax based on the probability state specified by the changed context index assigned to the undecoded syntax.
  • the arithmetic coding apparatus configured as described above, it is possible to appropriately encode an uncoded syntax in accordance with the distribution of the distribution of coded non-zero transform coefficients in the target frequency domain.
  • a random state can be specified and the uncoded syntax can be encoded based on the appropriate probability state.
  • encoded data having high encoding efficiency can be generated.
  • the data structure of the encoded data according to the present invention is such that, for each transform coefficient obtained by frequency transforming the original image for each unit region, one or more kinds of syntax representing the transform coefficient are arithmetically encoded.
  • the one or more types of syntax includes a flag indicating whether or not a transform coefficient is 0, and arithmetic decoding is performed to decode the encoded data.
  • the apparatus assigns, to each syntax in the target frequency domain corresponding to the unit area to be processed, a context index determined according to the type of the syntax and the position of the syntax in the target frequency domain, and the target frequency Each syntax in the region is indicated by the context index assigned to that syntax. Sequentially performing arithmetic decoding based on the probability state to be performed, and changing a context index assigned to an undecoded syntax in the target frequency domain according to a bias in the distribution of the restored flag in the target frequency domain It is characterized by.
  • the image decoding apparatus includes a last coefficient position detecting unit that detects the position of the last non-zero coefficient in the reverse scan order in the coefficient matrix, and the position of the last non-zero coefficient is the coefficient matrix
  • the position determination means for determining whether or not the position determination range from the row or column including the coefficient of the DC component to the predetermined row or column is within the position determination range.
  • the coefficient matrix is decoded in a first decoding target range including the position of the last non-zero coefficient and a second decoding target range other than the first decoding target range, respectively. Means.
  • the image coding apparatus includes a last coefficient position detecting unit that detects a position of the last non-zero coefficient in the scan order in the coefficient matrix, and a position of the last non-zero coefficient in the coefficient matrix.
  • a position determination means for determining whether or not a position determination range from a row or column including a coefficient of a direct current component to a predetermined row or column and the position of the last non-zero coefficient are in the position determination range
  • the coefficient matrix is encoded by a first encoding target range including the position of the last non-zero coefficient and a second encoding target range other than the first encoding target range, respectively. 2
  • a stage encoding means for determining whether or not a position determination range from a row or column including a coefficient of a direct current component to a predetermined row or column and the position of the last non-zero coefficient are in the position determination range
  • the coefficient matrix is encoded by a first encoding target range including the position of the last non-zero coefficient and a
  • the data structure of the encoded data according to the present invention includes position information indicating the position of the last non-zero coefficient in the scan order in the coefficient matrix and the last non-zero coefficient.
  • the coefficient matrix the coefficient of the DC component First coefficient encoded data obtained by sequentially encoding the coefficients in the first encoding target range from the row or column including the predetermined row or column, and the second coefficient other than the first encoding target range.
  • This is a data structure including second coefficient encoded data in which coefficients in the encoding target range are sequentially encoded.
  • the arithmetic decoding device is obtained by arithmetically encoding one or a plurality of types of syntax representing the transform coefficient for each transform coefficient obtained by frequency transforming the target image for each unit region.
  • An arithmetic decoding apparatus for decoding encoded data wherein each syntax in a target frequency domain corresponding to a unit area to be processed has a type of syntax and a position of the syntax in the target frequency domain.
  • Context index allocating means for allocating a context index determined in accordance with the syntax decoding, and sequentially decoding each syntax in the target frequency domain based on a probability state specified by the context index allocated to the syntax Means and the syntax decoding means Therefore, the transform coefficient restoring means for restoring each transform coefficient from each decoded syntax, and the undecoded syntax in the target frequency domain according to the distribution of the restored non-zero transform coefficient in the target frequency domain And a context index changing means for changing a context index to be allocated.
  • the arithmetic coding apparatus encodes each transform coefficient obtained by frequency-transforming the target image for each unit region by arithmetically coding one or more kinds of syntax representing the transform coefficient.
  • An arithmetic coding apparatus for generating coded data wherein each syntax representing each transform coefficient in a target frequency region corresponding to a unit region to be processed has a syntax type and a target frequency of the syntax Context index allocating means for allocating a context index determined according to a position in a region, and each syntax in the target frequency region is sequentially arithmetic code based on a probability state specified by the context index allocated to the syntax
  • Syntax encoding means for generating the target circumference Depending on the deviation of the distribution of coded nonzero transform coefficients in several regions, and a, a context index changing means for changing a context index allocated to uncoded syntax in the subject frequency range.
  • the data structure of the encoded data according to the present invention is such that, for each transform coefficient obtained by frequency transforming the original image for each unit region, one or more kinds of syntax representing the transform coefficient are arithmetically encoded.
  • the data structure of the encoded data obtained by The one or more types of syntax include a flag indicating whether or not the conversion coefficient is 0,
  • the arithmetic decoding apparatus that decodes the encoded data, for each syntax in the target frequency domain corresponding to the unit area to be processed, according to the type of syntax and the position of the syntax in the target frequency domain A fixed context index is allocated, and each syntax in the target frequency domain is sequentially arithmetically decoded based on the probability state specified by the context index allocated to the syntax, and the restored in the target frequency domain
  • the context index assigned to the undecoded syntax in the target frequency domain is changed according to the distribution of the flag.
  • FIG. 4 is a diagram for explaining a coefficient matrix scan, where (a) shows an example of 8 ⁇ 8 coefficient matrix scan, and (b) shows a one-dimensional array obtained from the scan result.
  • FIG. It is a functional block diagram shown about the structural example of the TU information decoding part which concerns on other embodiment of this invention.
  • Another example of the syntax of the coefficient encoding process in the TU information encoding unit will be described.
  • Another example of the syntax of the coefficient encoding process in the TU information encoding unit will be described. It is a figure explaining the coefficient encoding process and coefficient decoding process in the case of omitting the second stage flag. It is the flowchart shown about the flow of the coefficient encoding process in the TU information encoding part which concerns on a modification. It is the flowchart shown about the flow of the coefficient decoding process in the TU information decoding part which concerns on a modification. Another example of the syntax of the coefficient encoding process in the TU information encoding unit according to the modification will be described.
  • FIG. 1 It is a block diagram which shows the structure of the quantization residual information decoding part with which the moving image decoding apparatus which concerns on another embodiment of this invention is provided. It is a figure which shows the data structure of the coding data which concern on embodiment.
  • A shows the configuration of the picture layer of the encoded data
  • (b) shows the configuration of the slice layer included in the picture layer
  • (c) shows the LCU layer included in the slice layer.
  • D shows the configuration of the leaf CU included in the CU layer
  • (e) shows the configuration of the inter prediction information for the leaf CU
  • ( f) shows the configuration of the intra prediction information for the leaf CU
  • (g) shows the configuration of the filter parameter included in the slice header.
  • FIG. 11 It is a block diagram which shows the structure of the variable length code decoding part 11 with which the moving image decoding apparatus which concerns on embodiment is provided. It is a figure for demonstrating operation
  • FIG. 6 is a diagram for explaining an adaptive scan performed by the transform coefficient decoding unit according to the embodiment, in which (a) shows a region for counting a variable scanTopRight indicating the appearance frequency of non-zero transform coefficients; (B) shows an area in which a variable scanBottomLeft representing the frequency of appearance of non-zero conversion coefficients is counted. It is a figure for demonstrating the 1st specific example of the context index change process by the context index change part with which the quantization residual information decoding part which concerns on embodiment is provided, Comprising: (a) is distribution of non-zero conversion coefficient (B) illustrates a context index that has not been changed by the context index changing unit, and (c) illustrates a context index changing unit.
  • the context index by which change by (2) was performed is illustrated. It is a flowchart which shows the flow of a process of a context index change part about the 1st specific example of a context index change process. It is a sequence diagram which shows an example of cooperation operation
  • (B) illustrates a context index that has not been changed by the context index changing unit, and (c) shows a change that has been made by the context index changing unit.
  • the context index is illustrated. It is a figure for demonstrating the 2nd specific example of a context index change process, Comprising: (a) is referred in order to calculate the variable coeffBottomLeft and coeffTopRight when the frequency domain of a process target is an 8x8 component. (B) illustrates a context index that has not been changed by the context index changing unit, and (c) shows a change that has been made by the context index changing unit. The context index is illustrated.
  • FIG. 10 is a diagram for explaining a fourth modification of the embodiment, in which (a) shows the context index determined by the context index changing unit when there is almost no bias in the decoded non-zero transform coefficients.
  • FIG. 11 is a diagram for explaining a fifth modification of the embodiment, in which (a) shows the context index determined by the context index changing unit when there is almost no bias in the decoded non-zero transform coefficients. (B) shows the context index determined by the context index changing unit when the decoded non-zero transform coefficients are biased in the horizontal direction, and (c) shows the decoded When the non-zero transform coefficient is biased in the vertical direction, the context index determined by the context index changing unit is shown.
  • (A) shows a transmitting apparatus equipped with a moving picture coding apparatus, and (b) shows a receiving apparatus equipped with a moving picture decoding apparatus. It is the figure shown about the structure of the recording device which mounts the said moving image encoder, and the reproducing
  • (A) shows a recording apparatus equipped with a moving picture coding apparatus, and (b) shows a reproduction apparatus equipped with a moving picture decoding apparatus.
  • Embodiment 1 An embodiment of a decoding apparatus and an encoding apparatus according to the present invention will be described below with reference to the drawings.
  • Embodiment 1-1 An embodiment of the present invention will be described with reference to FIGS. First, an overview of the moving picture decoding apparatus (image decoding apparatus) 1 and the moving picture encoding apparatus (image encoding apparatus) 2 will be described with reference to FIG.
  • FIG. 2 is a functional block diagram showing a schematic configuration of the moving picture decoding apparatus 1.
  • VCEG Video Coding Expert Group
  • KTA software which is a joint development codec
  • TMuC successor Codec
  • the moving image decoding apparatus 1 receives encoded data (data structure of encoded data) # 1 obtained by encoding a moving image by the moving image encoding apparatus 2.
  • the video decoding device 1 decodes the input encoded data # 1 and outputs the video # 2 to the outside.
  • the configuration of the encoded data # 1 will be described below.
  • the configuration of encoded data # 1 that is generated by the video encoding device 2 and decoded by the video decoding device 1 will be described with reference to FIG.
  • the encoded data # 1 has a hierarchical structure including a sequence layer, a GOP (Group Of Pictures) layer, a picture layer, a slice layer, and a maximum coding unit (LCU: Large Coding Unit) layer.
  • GOP Group Of Pictures
  • LCU Large Coding Unit
  • FIG. 3 shows the hierarchical structure below the picture layer in the encoded data # 1.
  • FIGS. 3A to 3D are diagrams showing the structures of leaf CUs (denoted as CUL in FIG. 3D) included in the picture layer PICT, slice layer S, LCU layer LCU, and LCU, respectively. is there.
  • the picture layer PICT is a set of data referred to by the video decoding device 1 in order to decode a target picture that is a processing target picture.
  • the picture layer PICT includes a picture header PH and slice layers S 1 to S NS (NS is the total number of slice layers included in the picture layer PICT).
  • NS is the total number of slice layers included in the picture layer PICT.
  • the reference numerals may be omitted. The same applies to other configurations included in the encoded data # 1.
  • the picture header PH includes a coding parameter group referred to by the video decoding device 1 in order to determine a decoding method of the target picture.
  • the encoding mode information (entoropy_coding_mode_flag) indicating the variable length encoding mode used in encoding by the moving image encoding device 2 is an example of an encoding parameter included in the picture header PH.
  • entorpy_coding_mode_flag When entorpy_coding_mode_flag is 0, the picture is encoded by CAVLC (Context-based Adaptive Variable Length Coding). It has become.
  • Each slice layer S included in the picture layer PICT is a set of data referred to by the video decoding device 1 in order to decode a target slice that is a processing target slice.
  • the slice layer S includes a slice header SH and LCU layers LCU 1 to LCU NC (NC is the total number of LCUs included in the slice S).
  • the slice header SH includes a coding parameter group that the moving image decoding apparatus 1 refers to in order to determine a decoding method of the target slice.
  • Slice type designation information (slice_type) for designating a slice type is an example of an encoding parameter included in the slice header SH.
  • the slice header SH includes a filter parameter FP that is referred to by a loop filter (not shown) included in the video decoding device 1.
  • slice types that can be specified by the slice type specification information, (1) I slice using only intra prediction at the time of encoding, and (2) P using unidirectional prediction or intra prediction at the time of encoding. Slice, (3) B-slice using unidirectional prediction, bidirectional prediction, or intra prediction at the time of encoding.
  • Each LCU layer LCU included in the slice layer S is a set of data that the video decoding device 1 refers to in order to decode the target LCU that is the processing target LCU.
  • LCU layer LCU as shown in (c) of FIG. 3, LCU header LCUH, and a plurality of coding units obtained by the quadtree dividing the LCU: the (CU Coding Unit) CU 1 ⁇ CU NL Contains.
  • the size that each CU can take depends on the LCU size and the hierarchical depth included in the sequence parameter set SPS of the encoded data # 1. For example, when the size of the LCU is 128 ⁇ 128 pixels and the maximum hierarchical depth is 5, the CU included in the LCU has five types of sizes, that is, 128 ⁇ 128 pixels, 64 ⁇ 64 pixels, Any of 32 ⁇ 32 pixels, 16 ⁇ 16 pixels, and 8 ⁇ 8 pixels can be taken. A CU that is not further divided is called a leaf CU.
  • the LCU header LCUH includes an encoding parameter referred to by the video decoding device 1 in order to determine a decoding method of the target LCU. Specifically, as shown in FIG. 3C, CU partition information SP_CU that specifies a partition pattern for each leaf CU of the target LCU, and a quantization parameter difference ⁇ qp that specifies the size of the quantization step. (Mb_qp_delta) is included.
  • CU division information SP_CU is information that specifies the shape and size of each CU (and leaf CU) included in the target LCU, and the position in the target LCU.
  • the CU partition information SP_CU does not necessarily need to explicitly include the shape and size of the leaf CU.
  • the CU partition information SP_CU may be a set of flags (split_coding_unit_flag) indicating whether or not the entire LCU or a partial region of the LCU is divided into four. In that case, the shape and size of each leaf CU can be specified by using the shape and size of the LCU together.
  • the quantization parameter difference ⁇ qp is a difference qp ⁇ qp ′ between the quantization parameter qp in the target LCU and the quantization parameter qp ′ in the LCU encoded immediately before the LCU.
  • Leaf CU A CU (leaf CU) that cannot be further divided is treated as a prediction unit (PU: Prediction Unit) and a transform unit (TU: Transform Unit).
  • PU Prediction Unit
  • TU Transform Unit
  • the leaf CU (denoted as CUL in (d) of FIG. 3) is (1) PU information PUI that is referred to when the moving image decoding apparatus 1 generates a predicted image. And (2) the TU information TUI that is referred to when the moving image decoding apparatus 1 decodes the residual data.
  • the PU information PUI may include a skip flag SKIP. When the value of the skip flag SKIP is 1, the TU information is omitted.
  • the PU information PUI includes prediction type information PT and prediction information PI, as shown in FIG.
  • the prediction type information PT is information that specifies whether intra prediction or inter prediction is used as a predicted image generation method for the target leaf CU (target PU).
  • the prediction information PI is composed of intra prediction information or inter prediction information depending on which prediction method the prediction type information PT designates.
  • a PU to which intra prediction is applied is also referred to as an intra PU
  • a PU to which inter prediction is applied is also referred to as an inter PU.
  • the PU information PUI includes information specifying the shape and size of each partition included in the target PU and the position in the target PU.
  • the partition is one or a plurality of non-overlapping areas constituting the target leaf CU, and the generation of the predicted image is performed in units of partitions.
  • the TU information TUI includes TU partition information SP_TU that specifies a partition pattern for each block of the target leaf CU (target TU), and quantized prediction residuals QD 1 to QD NT.
  • target TU the target leaf CU
  • QD 1 to QD NT the total number of blocks included in the target TU
  • TU partition information SP_TU is information that specifies the shape and size of each block included in the target TU and the position in the target TU.
  • Each TU can be, for example, a size from 64 ⁇ 64 pixels to 2 ⁇ 2 pixels.
  • the block is one or a plurality of non-overlapping areas constituting the target leaf CU, and prediction residual encoding / decoding is performed in units of TUs or blocks obtained by dividing TUs.
  • Each quantized prediction residual QD is encoded data generated by the moving image encoding apparatus 2 performing the following processes 1 to 3 on a target block that is a processing target block.
  • Process 1 DCT transform (Discrete Cosine Transform) is performed on the prediction residual obtained by subtracting the prediction image from the encoding target image.
  • Process 2 The transform coefficient obtained in Process 1 is quantized.
  • Process 3 The transform coefficient quantized in Process 2 is variable-length encoded.
  • prediction information PI As described above, there are two types of prediction information PI: inter prediction information and intra prediction information.
  • the inter prediction information includes an encoding parameter that is referred to when the video decoding device 1 generates an inter predicted image by inter prediction. More specifically, the inter prediction information includes inter PU partition information that specifies a partition pattern of the target PU (inter PU) into each partition, and inter prediction parameters for each partition.
  • the inter prediction parameters include a reference image index, an estimated motion vector index, and a motion vector residual.
  • the intra prediction information includes an encoding parameter that is referred to when the video decoding device 1 generates an intra predicted image by intra prediction. More specifically, the intra prediction information includes intra PU partition information for specifying a partition pattern of the target PU (intra PU) into each partition, and intra prediction parameters for each partition.
  • the intra prediction parameter is a parameter for designating an intra prediction method (prediction mode) for each partition.
  • the video decoding device 1 generates a predicted image for each partition, generates a decoded image # 2 by adding the generated predicted image and the prediction residual decoded from the data # 1, and is generated
  • the decoded image # 2 is output to the outside.
  • the generation of the predicted image is performed with reference to the encoding parameter obtained by decoding the encoded data # 1.
  • the encoding parameter is a parameter referred to in order to generate a prediction image, and in addition to a prediction parameter such as a motion vector referred to in inter-screen prediction and a prediction mode referred to in intra-screen prediction. Partition size and shape, block size and shape, and residual data between the original image and the predicted image.
  • side information a set of all information excluding the residual data among the information included in the encoding parameter is referred to as side information.
  • the prediction unit is a partition constituting the LCU
  • the present embodiment is not limited to this, and the prediction unit is a unit larger than the partition.
  • the present invention can also be applied to the case where the prediction unit is a unit smaller than the partition.
  • a frame (picture), a slice, an LCU, a block, and a partition to be decoded are referred to as a target frame, a target slice, a target LCU, a target block, and a target partition, respectively.
  • the LCU size is, for example, 64 ⁇ 64 pixels
  • the partition size is, for example, 64 ⁇ 64 pixels, 32 ⁇ 32 pixels, 16 ⁇ 16 pixels, 8 ⁇ 8 pixels, 4 ⁇ 4 pixels, or the like. These sizes do not limit the present embodiment, and the size and partition of the LCU may be other sizes.
  • FIG. 2 is a functional block diagram showing a schematic configuration of the moving picture decoding apparatus 1.
  • the moving picture decoding apparatus 1 includes a variable length code demultiplexing unit 11, a TU information decoding unit 12, an inverse quantization / inverse conversion unit 13, a predicted image generation unit (channel decoding unit) 14, and an adder. (Channel decoding means) 15 and a frame memory 16 are provided.
  • variable-length code demultiplexing unit 11 demultiplexes the encoded data # 1 for one frame input to the video decoding device 1 to obtain various kinds of information included in the hierarchical structure shown in FIG. To separate.
  • the variable length code demultiplexing unit 11 refers to information included in various headers, and sequentially separates the encoded data # 1 into slices and LCUs.
  • the various headers include (1) information on the method of dividing the target frame into slices, and (2) information on the size, shape, and position of the LCU belonging to the target slice.
  • variable length code demultiplexer 11 refers to the CU partition information SP_CU included in the encoded LCU header LCUH and divides the target LCU into leaf CUs. In addition, the variable-length code demultiplexing unit 11 acquires the TU information TUI and the PU information PUI for the target leaf CU: CUL.
  • variable length code demultiplexing unit 11 supplies the TU information TUI obtained for the target leaf CU to the TU information decoding unit 12. In addition, the variable length code demultiplexing unit 11 supplies the PU information PUI obtained for the target leaf CU to the predicted image generation unit 14.
  • the TU information decoding unit 12 decodes the TU information TUI supplied from the variable length code demultiplexing unit 11.
  • the TU information decoding unit 12 first decodes the TU partition information SP_TU from the TU information TUI for the target leaf CU supplied from the variable length code demultiplexing unit 11.
  • the TU information decoding unit 12 divides the target leaf CU into one or a plurality of blocks according to the decoded TU division information SP_TU.
  • the TU information decoding unit 12 decodes the TU partition information SP_TU and the quantized prediction residual QD from the TU information TUI for each block.
  • the quantized prediction residual QD for each block can be expressed in a format in which quantized transform coefficients are arranged in a two-dimensional matrix.
  • a two-dimensional matrix representation of quantized transform coefficients is referred to as a coefficient matrix. Details of the configuration for obtaining the coefficient matrix from the TU information TUI in the TU information decoding unit 12 will be described later.
  • the TU information decoding unit 12 supplies the decoded TU information TUI ′ including the decoded TU partition information SP_TU ′ and the quantized prediction residual QD ′ to the inverse quantization / inverse conversion unit 13.
  • the inverse quantization / inverse transform unit 13 performs inverse quantization / inverse transformation of the quantization prediction residual for each block on the target leaf CU based on the decoded TU information TUI ′ supplied from the TU information decoding unit 12. Do.
  • the inverse quantization / inverse transform unit 13 performs inverse quantization and inverse DCT transform (Inverse Discrete Cosine Transform) on the quantized prediction residual QD ′ included in the decoded TU information TUI ′, so that a pixel is obtained for each target partition.
  • the prediction residual D for each is restored.
  • the inverse quantization / inverse transform unit 13 supplies the restored prediction residual D to the adder 14.
  • the predicted image generation unit 14 For each partition included in the target leaf CU, the predicted image generation unit 14 refers to a local decoded image P ′ that is a decoded image around the partition, and generates a predicted image Pred by intra prediction or inter prediction.
  • the predicted image generation unit 14 operates as follows. First, the predicted image generation unit 14 decodes the PU information PUI for the target leaf CU supplied from the variable length code demultiplexing unit 11. Subsequently, the predicted image generation unit 14 determines a division pattern for each partition of the target leaf CU according to the PU information PUI. Further, the predicted image generation unit 14 selects a prediction mode of each partition according to the PU information PUI, and assigns each selected prediction mode to each partition.
  • the predicted image generation unit 14 generates a predicted image Pred for each partition included in the target leaf CU with reference to the selected prediction mode and the pixel values of the local decoded image P ′ around the partition.
  • the predicted image generation unit 14 supplies the predicted image Pred generated for the target leaf CU to the adder 15.
  • the adder 15 adds the predicted image Pred supplied from the predicted image generation unit 14 and the prediction residual D supplied from the inverse quantization / inverse transform unit 13, thereby decoding the decoded image P for the target leaf CU. Is generated.
  • the decoded image P that has been decoded is sequentially recorded in the frame memory 16.
  • decoded images corresponding to all the LCUs decoded before the target LCU are recorded. .
  • the moving image decoding apparatus 1 one frame of encoded data # 1 input to the moving image decoding apparatus 1 at the time when the decoded image generation processing for each LCU is completed for all the LCUs in the image.
  • the decoded image # 2 corresponding to is output to the outside.
  • FIG. 4 is a diagram illustrating scanning of quantized transform coefficients.
  • 4A shows a scan example of the 8 ⁇ 8 coefficient matrix MX10
  • FIG. 4B shows the one-dimensional array ARR10 obtained from the scan result.
  • the quantized transform coefficients (hereinafter simply referred to as coefficients) can be expressed in the form of an 8 ⁇ 8 coefficient matrix MX10 as shown in FIG.
  • the numbers shown in FIG. 4A are the scan order.
  • the coefficient matrix MX10 is scanned in the scan order (also the order of dotted arrows) shown in FIG. Scanning is a process of converting the coordinates in the coefficient matrix MX10 into a one-dimensional scan order index.
  • the coefficients are stored in the one-dimensional array ARR10.
  • the DC component coefficient (hereinafter referred to as DC coefficient) DC is scanned first. Subsequently, the coefficient is scanned in a zigzag manner from the position “2” on the right side of the DC coefficient DC. Then, in order, the coefficients are scanned up to the last coefficient FIN of the coefficient matrix at the position “64”.
  • the DC coefficient DC is a coordinate (0, 0) in the coefficient matrix.
  • the scan order index is obtained by subtracting 1 from the number shown in FIG. 4A, and the scan order index of the DC coefficient DC is 0.
  • the zigzag scan has a scan order in which the low-frequency component coefficients are scanned quickly.
  • the encoding process is performed in the reverse order of the scan. That is, the encoding process is performed from “64” to “1”. Hereinafter, this processing order is also referred to as reverse zigzag scanning.
  • the coefficient at a position close to “64” is a high-frequency component, and is often “0”. Therefore, in the encoding process, encoding of such zero coefficients is omitted, and the process is performed based on the last non-zero coefficient as viewed from the DC coefficient.
  • the non-zero coefficient that appears last from the viewpoint of the DC coefficient is referred to as the last coefficient. Details of the coefficient encoding process will be described separately.
  • the moving picture decoding apparatus 1 performs the coefficient encoding process in two stages.
  • a first-stage coefficient encoding process in which the first row or first column with the last coefficient is the first target range of encoding, and other than the first row or first column
  • This is a two-stage process with a second-stage coefficient encoding process in which the second row or column is the second target range of encoding.
  • the last coefficient to the DC coefficient are sequentially scanned and encoded in order in the first target range.
  • the second non-zero coefficient in the second target range to the first coefficient in the scan order are scanned zigzag in the second target range in order. It becomes.
  • the last coefficient is encoded with the position of the last coefficient last_pos, the level of the last coefficient level, and the sign of the last coefficient sign.
  • the coefficient level means the absolute value of the coefficient.
  • last_pos takes a value in the form of a scan order index. The case where the last coefficient is the 10th in the scanning order (the DC coefficient is the first) and the value is “ ⁇ 1” is as follows.
  • last_pos 9 level: 1, sign: 1
  • the last coefficient is detected and encoded in the target range in each stage. For example, if it is the first stage, it is the last coefficient itself of the entire coefficient matrix, and if it is the second stage, it is the last non-zero coefficient in the scan order in the second target range.
  • the run mode is a mode for encoding the number of consecutive zero coefficients (0 run). In the run mode, for each coefficient, a 0 run, a coefficient level, and a coefficient sign sign are encoded. The next case where the non-zero coefficient to be encoded is one 0 between the previous non-zero coefficient and the value is “1” is as follows.
  • Non-Patent Document 3 a case where a coefficient having a level of 2 or more appears is used as one of the end conditions of the run mode.
  • Non-run mode is a mode that encodes one by one even with zero coefficients.
  • the coefficient level level and the coefficient sign sign are encoded.
  • the case where the value of the coefficient to be encoded is “ ⁇ 6” and the case where the coefficient to be encoded is a zero coefficient are as follows.
  • the encoded data shown above is merely an example, and the syntax element may be encoded with a name or definition different from the above.
  • the level level of the coefficient of the run mode is a thin level of isLevelOne (level is 1) and additionally, level_magnitude_minus2 (when the coefficient value is 2 or more, encoding is a level obtained by subtracting 2). It may be encoded as a tax element (see “level_magnitude_minus2” in Non-Patent Document 3).
  • the level may be encoded as a syntax element of the last_pos_level for the last coefficient.
  • the level of the non-run mode may be encoded as a syntax element of the level_magnitude.
  • FIG. 1 is a block diagram showing the configuration of the TU information decoding unit 12.
  • the TU information decoding unit 12 decodes the encoded quantized prediction residual QD, that is, the coefficient encoded data C10 among the encoded data included in the TU information TUI.
  • the TU information decoding unit 12 is not limited to this, and can decode data other than the coefficient encoded data C10 included in the encoded data, for example, side information.
  • the size of the coefficient matrix MX10 obtained by decoding the coefficient encoded data C10 is, for example, 8 ⁇ 8.
  • the TU information decoding unit 12 includes a last coefficient decoding unit (last coefficient position detection unit) 121, a position determination unit (position determination unit, distance determination unit) 122, a two-stage decoding unit 123, and a batch.
  • a decoding unit 124, a linear scanning VLC table TBL11, and a zigzag scanning VLC table TBL12 are provided.
  • the last coefficient decoding unit 121 decodes the last coefficient from the coefficient encoded data C10. Specifically, the last coefficient decoding unit 121 decodes the last coefficient position last_pos, the last coefficient level level, and the last coefficient sign sign included in the coefficient coded data C10.
  • the position determination unit 122 determines the last coefficient position last_pos decoded by the last coefficient decoding unit 121. The position determination unit 122 determines whether to perform the coefficient decoding process in the two-stage decoding unit 123 or the collective decoding unit 124 according to the position of the last coefficient.
  • LastX 1 scanX (LastIdx 1 )
  • LastY 1 scanY (LastIdx 1 )
  • scanX is a function that converts a scan order index into an x coordinate
  • scanY is a function that converts a scan order index into a y coordinate.
  • the position determination part 122 calculates the truth of the following determination formula (1).
  • Second, it is determined whether or not the last coefficient position LastX 1 is more than a predetermined distance from the DC coefficient position (X, Y) (0, 0) (“LastY 1 ⁇ ThY 1 ” and “LastX 1 ⁇ ThX 1 ”).
  • the thresholds ThX 1 and ThY 1 can be set to about “3”, respectively.
  • the position determination unit 122 determines to perform a two-stage coefficient decoding process. In this case, the position determination unit 122 notifies the determination result to the two-stage decoding unit 123.
  • the position determination unit 122 determines to perform the coefficient decoding process collectively. In this case, the position determination unit 122 notifies the determination result to the batch decoding unit 124.
  • the two-stage decoding unit 123 receives the notification from the position determination unit 122 and performs a two-stage coefficient decoding process.
  • the two-stage decoding unit 123 refers to the linear scan VLC table TBL11 and the zigzag scan VLC table TBL12, and performs a two-stage coefficient decoding process on the target block. Details of the two-stage decoding unit 123 will be described later.
  • the two-stage decoding unit 123 outputs the decoded coefficient matrix MX10.
  • the collective decoding unit 124 receives the notification from the position determination unit 122 and performs a coefficient decoding process in a batch.
  • the collective decoding unit 124 refers to the zigzag scan VLC table TBL12 and performs coefficient decoding processing on the target block in a batch.
  • the collective decoding unit 124 outputs the decoded coefficient matrix MX10.
  • the linear scan VLC table TBL11 is a table in which a bit string of encoded data is associated with each parameter.
  • the linear scanning VLC table TBL11 is used in the first-stage coefficient decoding process of the two-stage decoding unit 123.
  • a plurality of linear scan VLC tables TBL11 are defined according to the context.
  • the context refers to the status of the target block and its surrounding blocks.
  • the status of the target block and its surrounding blocks refers to various parameters of each block and values that can be derived from the various parameters.
  • the zigzag scan VLC table TBL12 is a table in which a bit string of encoded data is associated with each parameter.
  • the zigzag scan VLC table TBL12 is used in both the second-stage coefficient decoding process of the two-stage decoding unit 123 and the coefficient decoding process of the collective decoding unit 124.
  • a plurality of zigzag scan VLC tables TBL12 are defined according to the context.
  • the batch decoding unit 124 includes a batch coefficient decoding unit 241 and a batch reverse scanning unit 242. In the following description, it is assumed that the position determination unit 122 has decided to perform the coefficient decoding process all at once.
  • the collective coefficient decoding unit 241 outputs a one-dimensional array of coefficients by decoding the encoded coefficients with the coefficient encoded data C10 as input for the target block. That is, the collective coefficient decoding unit 241 reproduces a one-dimensional array having the 64 coefficients of the target block as elements.
  • the collective coefficient decoding unit 241 illustratively performs coefficient decoding as follows. First, the batch coefficient decoding unit 241 performs decoding in the run mode. That is, the collective coefficient decoding unit 241 decodes 0 run, coefficient level, and coefficient sign sign for each coefficient under predetermined conditions. Examples of the predetermined condition include whether or not the coefficient value exceeds a threshold value, or whether or not a predetermined number of coefficients are decoded.
  • the batch coefficient decoding unit 241 When the run mode ends, the batch coefficient decoding unit 241 performs decoding in the non-run mode. In other words, the collective coefficient decoding unit 241 decodes the coefficient level level and the coefficient sign sign. The collective coefficient decoding unit 241 reproduces a one-dimensional array by decoding the coefficients in this way.
  • the collective inverse scan unit 242 reproduces the 8 ⁇ 8 coefficient matrix MX10 by performing inverse scan on the one-dimensional array output by the collective coefficient decoding unit 241.
  • Inverse scanning refers to a process of sequentially reading elements stored in a one-dimensional array and rearranging them in a two-dimensional coefficient matrix. Further, the technique of Non-Patent Document 3 can be adopted for the reverse scan of the collective reverse scan unit 242.
  • FIG. 5 is a diagram showing the relationship between the process in the two-stage decoding unit 123 and the input / output data related to the process.
  • the two-stage decoding unit 123 receives the coefficient encoded data C10 included in the TU information TUI as input, performs a decoding process, and outputs a two-dimensional coefficient matrix MX10. That is, the two-stage decoding unit 123 outputs an 8 ⁇ 8 coefficient matrix MX10 including quantized coefficients as elements by decoding processing.
  • the coefficient encoded data C10 includes first coefficient encoded data C11, a second stage flag F1, and second coefficient encoded data C12.
  • the second stage flag F1 indicates whether or not the second stage decoding process needs to be executed.
  • the first-stage coefficient decoding process is executed as follows. That is, first, the first coefficient encoded data C11 and the second stage flag F1 are input, and the coefficients are decoded in the first stage while referring to the linear scan VLC table TBL11. As a result, a one-dimensional array ARR1 is output. The size of the one-dimensional array ARR1 is “8”.
  • the second-stage decoding unit 123 performs the second-stage coefficient decoding process. That is, the coefficient decoding in the second stage is performed with the second coefficient encoded data C12 as input and referring to the zigzag scan VLC table TBL12. As a result, a one-dimensional array ARR2 is output.
  • the coefficient matrix MX12 (8 ⁇ 7) including the remaining coefficients is reproduced from the 8 ⁇ 8 coefficient matrix MX10.
  • the eighth row is empty, but apparently, the coefficient encoding process can be performed as an 8 ⁇ 8 coefficient matrix.
  • the processing order of the coefficient encoding processing in a batch is applicable.
  • the technique of nonpatent literature 3 is employable for this reverse scan.
  • a coefficient matrix MX13 in which the coefficient of the coefficient matrix MX12 is copied is generated with the first line open.
  • the coefficient matrix MX11 and the coefficient matrix MX13 obtained by the first-stage and second-stage coefficient decoding processes are merged and output as a coefficient matrix MX10.
  • the two-stage decoding unit 123 includes a first coefficient decoding unit 231, a first inverse scanning unit 232, a flag determining unit 233, a second coefficient decoding unit 234, and a second inverse scanning unit 235.
  • the first coefficient decoding unit 231 receives the first coefficient encoded data C11 as input, and decodes the coefficient included in the row or column including the last coefficient in the coefficient matrix. That is, the first coefficient decoding unit 231 decodes the coefficient included in the first row or the first column of the coefficient matrix.
  • the first coefficient decoding unit 231 supplies the decoded one-dimensional array ARR1 to the first reverse scanning unit 232.
  • the first reverse scanning unit 232 performs reverse scanning on the one-dimensional array ARR1 and rearranges it in the two-dimensional array MX11.
  • the flag determination unit 233 determines whether or not the second-stage decoding process is performed by determining the flag of the second-stage flag F1.
  • the second coefficient decoding unit 234 receives the second coefficient encoded data C12 as input, and decodes a coefficient included in a row or column other than the row or column including the last coefficient in the coefficient matrix. That is, the second coefficient decoding unit 234 decodes the coefficients included in the rows or columns other than the first row or the first column of the coefficient matrix.
  • the first coefficient decoding unit 231 supplies the decoded one-dimensional array ARR1 to the first inverse scanning unit 232.
  • the second reverse scanning unit 235 performs reverse scanning on the one-dimensional array ARR2 and rearranges it in the two-dimensional array MX12.
  • FIG. 6 is a diagram illustrating a two-stage coefficient encoding process or coefficient decoding process of the coefficient matrix MX10. (A) of the figure shows the first stage, and (b) of the figure shows the second stage.
  • the last coefficient LT is at a dark shaded position.
  • the last coefficient LT is located in the seventh column of the first row of the coefficient matrix MX10. For this reason, the last coefficient LT is at a position away from the DC coefficient DC by a predetermined distance or more in the first row. In the first line, the non-zero coefficient is shaded.
  • a processing target range (hereinafter referred to as a first target range) R10 is the first row.
  • a range to be processed (hereinafter referred to as a second target range) R20 is a line other than the first line.
  • the positions that have been processed (encoding / decoding) in the first stage are indicated by hatching.
  • the first-stage coefficient decoding process is executed as follows. That is, first, the first coefficient decoding unit 231 decodes from the last coefficient LT to the DC coefficient DC in the first target range R10.
  • the coefficients decoded by the first coefficient decoding unit 231 are continuous from the coefficient next to the last coefficient LT to the DC coefficient DC in the first target range R10. This is a coefficient included in the region R11. As described above, the first coefficient decoding unit 231 actually sets a region R11 in which a non-zero coefficient may exist as a decoding target.
  • the eighth column of the first row is a position that appears after the last coefficient LT in the scan order of the entire coefficient matrix, and therefore, the value of the coefficient at this position is treated as “0”.
  • the first reverse scanning unit 232 performs reverse scanning on the coefficients decoded by the first coefficient decoding unit 231. Specifically, the first reverse scanning unit 232 performs reverse scanning as follows.
  • scanX is a function that converts the scan order index idx into X of the x coordinate
  • scanY is a function that converts the scan order index into Y of the y coordinate.
  • scanX and scanY can be realized by a table that defines the correspondence between idx and (X, Y).
  • the first inverse scan unit 123 performs the inverse scan in this way to restore the first row of the coefficient matrix.
  • the second-stage coefficient decoding process is started according to the flag determination of the flag determination unit 233.
  • the second stage coefficient decoding process is executed as follows.
  • the second coefficient decoding unit 234 starts with the first coefficient in the scan order in the second target range R20 from the last coefficient K1 in the scan order in the second target range R20 in the second target range R20. Decode up to ST.
  • the second reverse scanning unit 235 performs reverse scanning on the coefficients decoded by the second coefficient decoding unit 234. Specifically, the second reverse scanning unit 235 performs reverse scanning as follows.
  • the second reverse scanning unit 235 applies the scan order in the case where the coefficient decoding process is performed collectively for the second target range R20.
  • the second reverse scanning unit 235 actually sets a region R21 from the coefficient K1 to the coefficient ST as a reverse scan target. At this time, the last coefficient in the region R21 is the coefficient K1. The second reverse scanning unit 235 sequentially performs reverse scanning from the coefficient ST to the coefficient K1.
  • the second reverse scanning unit 235 performs the reverse scanning in this manner to reproduce the second to eighth rows of the coefficient matrix.
  • the two-stage decoding unit 123 reproduces the first to eighth rows of the coefficient matrix, includes the reproduced coefficient matrix in the decoded TU information TUI, and transmits it to the encoded data multiplexing unit 34. Supply.
  • FIG. 7 is a flowchart showing the flow of coefficient decoding processing in the TU information decoding unit 12.
  • the position determination unit 122 determines whether or not the position of the last coefficient LT satisfies a predetermined condition (S12).
  • the batch decoding unit 124 performs batch coefficient decoding processing (S13).
  • the collective coefficient decoding unit 241 first decodes the coefficients in order from the coefficient next to the last coefficient (S131). Then, the collective inverse scan unit 242 performs inverse scan on the one-dimensional array in which the decoded coefficients are stored to reproduce the coefficient matrix (S132). The collective decoding unit 124 outputs the two-dimensional coefficient matrix obtained in this way, and the process ends.
  • the two-stage decoding unit 123 performs a two-stage coefficient decoding process as follows.
  • the first coefficient decoding unit 231 decodes from the coefficient next to the last coefficient to the DC coefficient (S14).
  • the first inverse scanning unit 232 performs inverse scanning on the coefficients decoded in S14 (S15). Thereby, the first row or the first column of the coefficient matrix is reproduced.
  • the flag determination unit 233 decodes the second stage flag (S16), and determines whether or not the second stage flag is “1” (S17). If the second stage flag is not “1” (NO in S17), since there is no non-zero coefficient in the region to be decoded in the second stage, the second stage coefficient decoding process is not performed. The coefficient decoding process ends.
  • the second stage coefficient decoding process is executed. That is, the second coefficient decoding unit 234 decodes the remaining coefficients (S18). Then, the second inverse scanning unit 235 performs inverse scanning on the coefficients decoded in S18, thereby reproducing the coefficient matrix for the remaining coefficients (S19).
  • the first-stage and second-stage coefficient decoding processes are performed, so that the entire coefficient matrix is reproduced, and the process ends.
  • the moving picture decoding apparatus 1 reproduces the coefficient matrix MX10 by decoding and inverse scanning the coefficient encoded data C10 included in the encoded data # 1 obtained by encoding the image data.
  • the last coefficient decoding unit 121 that detects the position of the last coefficient LT in the reverse scan order in the coefficient matrix MX10, and the position of the last coefficient LT in the coefficient matrix MX10
  • the position determination unit 122 that determines whether or not the first target range R10 in the first row or the first column including the coefficient DC and the position of the last coefficient LT are in the first target range R10.
  • the coefficient matrix MX10 includes a two-stage decoding unit 123 that performs a decoding process on each of the first target range R10 and the second target range R20 other than the first target range R10. It is a configuration.
  • the second target range R20 is further divided into a new first target range and a new second target range, and the above processing is recursively performed. You can go.
  • the moving image encoding device 2 is a device that generates and outputs encoded data # 1 by encoding the input image # 10.
  • FIG. 8 is a functional block diagram showing the configuration of the moving picture coding apparatus 2.
  • the moving image encoding device 2 includes an encoding setting unit 21, an inverse quantization / inverse conversion unit 22, a predicted image generation unit 23, an adder 24, a frame memory 25, a subtractor 26, A quantization unit 27 and a variable length coding unit 28 are provided.
  • the encoding setting unit 21 generates image data related to encoding and various setting information based on the input image # 10.
  • the encoding setting unit 21 generates the next image data and setting information.
  • the encoding setting unit 21 generates the leaf CU image # 100 for the target leaf CU by sequentially dividing the input image # 10 into slice units and LCU units.
  • the encoding setting unit 21 generates header setting information H ′ based on the result of the division process.
  • the header information H ′ includes (1) information about the size, shape and position of the LCU belonging to the target slice, and (2) the size, shape and shape of the leaf CU belonging to each LCU. It includes CU information CU ′ about the position.
  • the encoding setting unit 21 refers to the leaf CU image # 100 and the CU information CU 'to generate PU setting information PUI'.
  • the PU setting information PUI ' includes information on all combinations of (1) possible division patterns for each partition of the target leaf CU and (2) prediction modes that can be assigned to each partition.
  • the encoding setting unit 21 supplies the leaf CU image # 100 to the subtractor 26.
  • the encoding setting unit 21 supplies the header information H ′ to the variable length encoding unit 28. Also, the encoding setting unit 21 supplies the PU setting information PUI ′ to the predicted image generation unit 23.
  • the inverse quantization / inverse transform unit 22 performs inverse quantization and inverse DCT transform (Inverse Discrete Cosine Transform) on the quantization prediction residual for each block supplied from the transform / quantization unit 27, Restore the prediction residual for each block. Further, the inverse quantization / inverse transform unit 22 integrates the prediction residual for each block according to the division pattern specified by the TU partition information, and generates a prediction residual D for the target leaf CU. The inverse quantization / inverse transform unit 22 supplies the prediction residual D for the generated target leaf CU to the adder 24.
  • inverse quantization / inverse transform unit 22 supplies the prediction residual D for the generated target leaf CU to the adder 24.
  • the predicted image generation unit 23 refers to the locally decoded image P ′ recorded in the frame memory 25 and the PU setting information PUI ′, and generates a predicted image Pred for the target leaf CU.
  • the prediction image generation unit 23 refers to the luminance decoded image P Y.
  • the predicted image generation unit 23 sets the prediction parameter obtained by the predicted image generation process in the PU setting information PUI ′, and transfers the set PU setting information PUI ′ to the variable length encoding unit 28. Note that the predicted image generation process performed by the predicted image generation unit 23 is the same as that performed by the predicted image generation unit 13 included in the video decoding device 1, and thus description thereof is omitted here.
  • the adder 24 adds the predicted image Pred supplied from the predicted image generation unit 23 and the prediction residual D supplied from the inverse quantization / inverse transform unit 22 to add a decoded image P for the target leaf CU. Is generated.
  • Decoded decoded image P is sequentially recorded in the frame memory 25.
  • decoded images corresponding to all the LCUs decoded before the target LCU for example, all the LCUs preceding in the raster scan order) at the time of decoding the target LCU are recorded. .
  • the subtracter 26 generates a prediction residual D for the target leaf CU by subtracting the prediction image Pred from the leaf CU image # 100.
  • the subtractor 26 supplies the generated prediction residual D to the transform / quantization unit 27.
  • the transform / quantization unit 27 performs a DCT transform (Discrete Cosine Transform) and quantization on the prediction residual D to generate a quantized prediction residual.
  • DCT transform Discrete Cosine Transform
  • the transform / quantization unit 27 refers to the leaf CU image # 100 and the CU information CU ', and determines the division pattern of the target leaf CU into one or a plurality of blocks. Further, according to the determined division pattern, the prediction residual D is divided into prediction residuals for each block.
  • the transform / quantization unit 27 generates a prediction residual in the frequency domain by performing DCT transform (DiscretecreCosine Transform) on the prediction residual for each block, and then quantizes the prediction residual in the frequency domain. Thus, a quantized prediction residual for each block is generated.
  • DCT transform DiscretecreCosine Transform
  • the transform / quantization unit 27 relates to the generated quantization prediction residual for each block, TU partition information that specifies the partition pattern of the target leaf CU, and all possible partition patterns for each block of the target leaf CU.
  • TU setting information TUI ′ including the information is generated.
  • the transform / quantization unit 27 supplies the generated TU setting information TUI 'to the inverse quantization / inverse transform unit 22 and the variable length coding unit 28.
  • variable length encoding unit 28 generates and outputs encoded data # 1 based on the TU setting information TUI ′, the PU setting information PUI ′, and the header information H ′. Details of the variable length coding unit 28 will be described below.
  • FIG. 9 is a block diagram illustrating a configuration example of the variable length coding unit 28.
  • variable length coding unit 28 includes a TU information coding unit 31, a header information coding unit 32, a PUI information coding unit 33, and a coded data multiplexing unit 34.
  • the TU information encoding unit 31 encodes the TU setting information TUI ′ and supplies it to the encoded data multiplexing unit 34.
  • the header information encoding unit 32 encodes the header information H ′ and supplies the encoded header information H ′ to the encoded data multiplexing unit 34.
  • the PUI information encoding unit 33 encodes the PUI information PUI ′ and supplies the encoded PUI information PUI ′ to the encoded data multiplexing unit 34.
  • the encoded data multiplexing unit 34 multiplexes the TU setting information TUI ', header information H', and PUI information PUI 'to generate encoded data # 1, and outputs it.
  • the configuration of the TU information encoding unit 31 will be described in more detail as follows.
  • a configuration for encoding a quantized prediction residual that is, a coefficient matrix included in the TU setting information TUI ′ will be described.
  • the TU information encoding unit 31 includes a final coefficient detection unit (last coefficient position detection unit) 310, a position determination unit (position determination unit) 320, a two-stage encoding unit 330, a batch encoding unit 340, and a linear scan VLC.
  • a table TBL21 and a zigzag scanning VLC table TBL22 are provided.
  • the last coefficient detection unit 310 performs a reverse zigzag scan on the coefficient matrix to detect the last coefficient.
  • the last coefficient detection unit 310 can employ, for example, the technique of Non-Patent Document 3 as the last coefficient detection method.
  • the last coefficient detection unit 310 encodes the last coefficient position last_pos of the detected coefficient, the last coefficient level level, and the last coefficient positive / negative sign sign and includes them in the coefficient encoded data.
  • the position determination unit 320 determines whether or not the last coefficient position last_pos detected by the last coefficient detection unit 310 satisfies a predetermined condition. Specifically, the position determination unit 320 determines the authenticity of the above-described determination formula (1).
  • the position determination unit 320 determines to perform a two-stage coefficient decoding process. In this case, the position determination unit 320 notifies the determination result to the two-stage encoding unit 330.
  • the position determination unit 320 determines to perform the coefficient decoding process collectively. In this case, the position determination unit 320 notifies the determination result to the batch encoding unit 340.
  • the two-stage encoding unit 330 receives the notification from the position determination unit 320 and performs a two-stage coefficient decoding process.
  • the two-stage encoding unit 330 refers to the linear scan VLC table TBL21 and the zigzag scan VLC table TBL22, and performs a two-stage coefficient decoding process on the target block. Details of the two-stage encoding unit 330 will be described later.
  • the two-stage encoding unit 330 outputs the encoded coefficient matrix MX10.
  • the batch encoding unit 340 receives the notification from the position determination unit 320 and performs a coefficient encoding process in a batch.
  • the batch encoding unit 340 refers to the zigzag scan VLC table TBL22 and performs a coefficient decoding process on the target block in a batch.
  • the batch encoding unit 340 outputs the encoded coefficient matrix MX10.
  • the linear scan VLC table TBL21 is a table in which the correspondence between each parameter and a bit string of encoded data is defined.
  • the linear scanning VLC table TBL21 is used in the first-stage coefficient encoding process of the two-stage encoding unit 330.
  • a plurality of linear scan VLC tables TBL21 are defined according to the context. More specifically, the linear scanning VLC table TBL11 in the moving picture decoding apparatus 1 is such that the definition of the linear scanning VLC table TBL21 can be reversed.
  • the zigzag scan VLC table TBL22 is a table in which the correspondence between each parameter and a bit string of encoded data is defined.
  • the zigzag scan VLC table TBL22 is used in both the second-stage coefficient encoding process of the two-stage encoding unit 330 and the coefficient encoding process in the batch encoding unit 340.
  • a plurality of zigzag scan VLC tables TBL22 are defined in accordance with the context.
  • the zigzag scan VLC table TBL12 in the moving picture decoding apparatus 1 is a table in which the definition of the zigzag scan VLC table TBL22 can be reversed.
  • the batch encoding unit 340 includes a batch scan unit 341 and a batch coefficient encoding unit 342. In the following description, it is assumed that the position determination unit 320 determines to perform the coefficient decoding process all at once.
  • the collective scanning unit 341 sequentially stores the coefficients read by performing the zigzag scan on the two-dimensional coefficient matrix MX10 in a one-dimensional array.
  • the collective scanning unit 341 supplies the one-dimensional array obtained by scanning to the collective coefficient encoding unit 342.
  • the collective coefficient encoding unit 342 encodes the one-dimensional array supplied from the collective scan unit 341 with reference to the zigzag scan VLC table TBL22, and outputs coefficient encoded data.
  • the batch coefficient encoding unit 342 illustratively encodes coefficients as follows. First, the batch coefficient encoding unit 342 performs encoding in the run mode. That is, the collective coefficient encoding unit 342 encodes 0 run, the coefficient level level, and the coefficient sign sign for each coefficient under a predetermined condition. Examples of the predetermined condition include whether or not the coefficient value exceeds a threshold value, or whether or not a predetermined number of coefficients are encoded.
  • the batch coefficient encoding unit 342 When the run mode ends, the batch coefficient encoding unit 342 performs encoding in the non-run mode. In other words, the collective coefficient encoding unit 342 encodes the coefficient level level and the coefficient sign sign. The collective coefficient encoding unit 342 generates coefficient encoded data by encoding the coefficients in this way.
  • FIG. 10 is a diagram showing the relationship between the process in the two-stage encoding unit 330 and the input / output data related to the process.
  • the two-stage encoding unit 330 performs an encoding process with a two-dimensional coefficient matrix MX10 as an input, and outputs coefficient encoded data C10. It is assumed that the position determination unit 320 has decided to perform a two-stage coefficient decoding process.
  • the coefficient encoded data C10 includes first coefficient encoded data C11, a second stage flag F1, and second coefficient encoded data C12.
  • the second stage flag F1 indicates whether or not the second stage decoding process needs to be executed.
  • the first-stage encoding process is executed as follows. That is, first, a scan process is performed on the coefficient matrix MX11 (8 ⁇ 1) in the first row of the coefficient matrix MX10. This scanning process is performed linearly from the DC coefficient included in the first row to the last coefficient. In addition, a one-dimensional array ARR1 is output by this scanning process. The size of the one-dimensional array ARR1 is “8” at the maximum.
  • the second-stage coefficient encoding process is executed as follows. That is, first, of the coefficient matrix MX11, the coefficient matrix MX12 (8 ⁇ 7) including the remaining coefficients is copied for position adjustment. That is, an 8 ⁇ 8 coefficient matrix MX13 storing the coefficients of the coefficient matrix MX12 (8 ⁇ 7) from the first row is generated. By performing copying in this way, it is possible to apply the processing order of coefficient encoding processing in a lump.
  • a one-dimensional array ARR22 is generated by performing a zigzag scan on the coefficient matrix MX13.
  • the second stage flag F1 is set.
  • the coefficient stored in the one-dimensional array ARR22 is encoded by referring to the zigzag scan VLC table TBL22. Thereby, coefficient encoded data C12 is generated.
  • the coefficient encoded data C11, the second-stage flag F1, and the coefficient encoded data C12 obtained by the first-stage and second-stage coefficient encoding processes are merged to generate coefficient encoded data.
  • the two-stage encoding unit 330 includes a first scanning unit 331, a first coefficient encoding unit 332, a second scanning unit 333, a flag setting unit 334, and a second coefficient encoding unit 335. .
  • the first scan unit 331 performs a linear scan on the first row or the first column in the 8 ⁇ 8 coefficient matrix MX10 and stores the scanned coefficients in the one-dimensional array ARR1.
  • the linear scan is to perform a linear scan from the DC coefficient to the last coefficient for the first row or the first column in the 8 ⁇ 8 coefficient matrix MX10.
  • the first coefficient encoding unit 332 encodes the coefficients stored in the one-dimensional array ARR1 generated by the first scanning unit 331 while referring to the linear scan VLC table TBL21 to thereby generate first coefficient encoded data C11. Is generated.
  • the coefficient encoding process in the first coefficient encoding unit 332 is the same as the coefficient encoding process in the collective coefficient encoding unit 342 except that the scan order is a straight line and the number of coefficients is different.
  • the number of coefficients encoded by the first coefficient encoding unit 332 is at most (LastX 1 +1) or (LastY 1 +1).
  • the second scan unit 333 performs a zigzag scan on the remaining part other than the first row or the first column in the 8 ⁇ 8 coefficient matrix MX10, and stores the scanned coefficients in the one-dimensional array ARR2.
  • the flag setting unit 334 determines whether or not the one-dimensional array ARR2 has a non-zero coefficient, and sets a second stage flag indicating the determination result. That is, the second stage flag indicates whether or not the second stage decoding process needs to be executed.
  • the second coefficient encoding unit 335 generates the second coefficient encoded data C12 by encoding the non-zero coefficient stored in the one-dimensional array ARR2 while referring to the zigzag scan VLC table TBL12.
  • the coefficient encoding process in the second coefficient encoding unit 335 is the same as the coefficient encoding process in the collective coefficient encoding unit 342 except that the position of the target coefficient is shifted by one row or one column.
  • the first target range R10 is a coefficient code. To be processed.
  • the first-stage coefficient encoding process is executed as follows. That is, first, the first scanning unit 331 linearly scans the first target range R10 from the coefficient next to the last coefficient LT to the DC coefficient DC, and stores the scanned coefficients in the one-dimensional array ARR1.
  • the first coefficient encoding unit 332 encodes the coefficient stored in the one-dimensional array ARR1 from the coefficient next to the last coefficient LT to the DC coefficient DC while referring to the linear scan VLC table TBL21. .
  • the order in which the first coefficient encoding unit 332 encodes the coefficients is indicated by solid line arrows in FIG.
  • the second target range R20 is a processing target.
  • the second-stage coefficient decoding process is executed as follows. That is, first, the second coefficient scanning unit 333 performs a zigzag scan on the target range R20 with the coefficient ST as a base point. That is, the zigzag scan is performed in the reverse order of the solid line arrows shown in FIG. The second coefficient scanning unit 333 stores the scanned coefficients in order in the one-dimensional array ARR2.
  • the second coefficient encoding unit 335 encodes the coefficients stored in the one-dimensional array ARR2.
  • the region R21 from the coefficient K1 to the coefficient ST is actually the target of the encoding process.
  • the order in which the second coefficient encoding unit 335 encodes the coefficients is indicated by solid line arrows in FIG. That is, the second coefficient encoding unit 335 performs encoding from the last coefficient K1 in the second stage to the first coefficient ST in the second stage, and generates second coefficient encoded data C12.
  • the two-stage encoding unit 330 performs coefficient encoding processing to generate coefficient encoded data C10 including the first coefficient encoded data C11, the first-stage flag F1, and the second coefficient encoded data C12. To do.
  • FIG. 11 is a flowchart showing the flow of coefficient encoding processing in the TU information encoding unit 31.
  • the position determination unit 320 determines whether the position of the last coefficient LT satisfies a predetermined condition. (S22).
  • the batch encoding unit 340 When the position of the last coefficient LT does not satisfy the predetermined condition (NO in S22), the batch encoding unit 340 performs the coefficient encoding process in a batch (S23).
  • the collective scanning unit 341 first scans the coefficient matrix MX10 and stores the scanned coefficients in a one-dimensional array (S231). Then, the collective coefficient encoding unit 342 sequentially encodes the coefficients stored in the one-dimensional array (S232). The batch encoding unit 340 outputs the coefficient encoded data C10 obtained in this way, and the process ends.
  • the batch coefficient encoding unit 342 first encodes the coefficient in the run mode, and when the predetermined condition is satisfied, switches to the non-run mode and encodes the coefficient.
  • the two-stage encoding unit 330 performs a two-stage coefficient encoding process as follows.
  • the first scanning unit 331 scans the coefficient from the coefficient next to the last coefficient to the DC coefficient to store the coefficient in the one-dimensional array ARR1 (S24).
  • the first coefficient encoding unit 332 encodes the coefficient of the one-dimensional array ARR1 obtained in S24 from the coefficient next to the last coefficient to the DC coefficient (S25).
  • the first coefficient encoding unit 332 outputs first coefficient encoded data C11 generated by encoding.
  • the second scanning unit 333 scans the remaining coefficients (S26). That is, the second scanning unit 333 performs scanning on the region R21. As a result, the coefficients in the region R21 are stored in the one-dimensional array ARR2.
  • the flag setting unit 334 determines whether there is a remaining coefficient (S27). That is, the flag setting unit 334 determines whether or not a non-zero coefficient exists in the one-dimensional array ARR2.
  • the flag setting unit 334 sets “0 (no remaining coefficient)” to the second stage flag F1 (S28). Then, in the second stage, the processing ends without encoding the coefficients.
  • the flag setting unit 334 sets “1 (with remaining coefficient)” to the second stage flag F1 (S29).
  • the second coefficient encoding unit 335 encodes the remaining coefficients in the region R21 (S30).
  • the second coefficient encoding unit 335 outputs the second coefficient encoded data C12 generated by encoding, and the process ends.
  • the second coefficient encoding unit 335 may first encode the coefficient in the run mode, and may encode the coefficient by switching to the non-run mode when a predetermined condition is satisfied. Further, the second coefficient encoding unit 335 may encode the coefficient only in the non-run mode.
  • the video encoding device 2 scans the coefficient matrix MX10 including the quantized prediction residual QD obtained by orthogonally transforming the prediction residual D obtained by subtracting the prediction image Pred from the input image # 10 and quantizing the prediction residual D.
  • the last coefficient detection unit 310 that detects the position of the last coefficient LT in the scan order in the coefficient matrix MX10
  • the last A position determination unit 320 that determines whether or not the position of the coefficient LT is within the first stage target range R10 of the first row or first column including the DC coefficient DC in the coefficient matrix MX10;
  • the coefficient matrix MX10 is converted into the first stage target range R10 and the first stage target range R2 other than the first stage target range R10.
  • Characterized in that it comprises a two step encoding unit 330 for encoding in two stages with.
  • FIGS. 12 and 13 show an example of the syntax of the coefficient encoding process in the TU information encoding unit 31 of the moving image encoding apparatus 2. It should be noted that switching between performing the coefficient encoding process all at once or in two stages is performed in the upper syntax. In other words, the determination of the position of the last coefficient LT is performed using the upper syntax.
  • “More_coeff_flag” of SYN 12 is a syntax element indicating whether or not to perform the second-stage coefficient encoding process.
  • the syntax shown in FIG. 13 indicates the coefficient encoding process in “residual_block_vlc_1a”. As shown in FIG. 13, in the SYN 21, the last coefficient is encoded. More specifically, first, “last_pos_table_idx” is encoded. “Last_pos_table_idx” is a syntax element indicating a combination of a flag (levelMagnitudeGreaterThanOneFlag) indicating whether or not the last coefficient is 1 and the position (last_pos) of the last coefficient. This combination is defined in the table, and the combination is specified by an index.
  • a flag levelMagnitudeGreaterThanOneFlag
  • the run mode and the non-run mode are executed. More specifically, first, the loop of the run mode is executed in SYN 220 under a predetermined condition.
  • isLevelOne_run of SYN 221 is a syntax element indicating a combination of a flag (isLevelOne) indicating whether or not the next coefficient is 1 and the length (run) of 0 run. Also, in SYN 222, processing for the run that continues with 0 is skipped.
  • the initial value of “i” is “63-last_pos”.
  • I_max is “63 ⁇ last_pos + scanX (last_pos)” in the first stage, and “63” in the second stage.
  • runMode becomes 0 when a predetermined condition is satisfied in the loop of SYN220.
  • target block is 8 ⁇ 8, it is a condition that two coefficients of level 2 or higher appear or “i_max-i” is equal to or less than a threshold value.
  • the non-run mode includes a “level_magnitude” syntax element and a “level_sign” syntax element.
  • Level_magnitude is a coefficient level. When this level is not 0, “level_sign” that is a positive / negative sign is encoded.
  • the syntax of the coefficient encoding process in the first stage and the second stage can be made common if the level of detail is the above level.
  • the difference between the first and second stage coefficient encoding processes includes the scan order, the number of target coefficients, the VLC table to be used, the coefficient indicated by “last_pos_table_idx”, and the like.
  • VLC table referenced by the batch coefficient encoding unit [VLC table referenced by the batch coefficient encoding unit]
  • zigzag scan VLC table TBL22 referred to by the collective coefficient encoding unit 342 in the moving image encoding device 2 will be described with reference to FIGS. 14, 15, and 16.
  • FIG. 14 shows a table defining the correspondence of code numbers (CodeNum) corresponding to combinations of “run” and “isLevelOne” when the maximum value of run is 5.
  • FIG. 15 shows an example of the zigzag scan VLC table TBL22 when the maximum value of the run is 5.
  • the zigzag scan VLC table TBL22 shown in the figure is an example of the definition when the maximum value of run is “5”, P slice, and 8 ⁇ 8 conversion.
  • the code number corresponding to the combination of “run” and “isLevelOne” is read from the table shown in FIG. 14, and the code corresponding to the read code number is read in the zigzag scan VLC table TBL22 shown in FIG. It is done by referring to.
  • the zigzag scan VLC table TBL22 is referred to based on the combination of “run” and “isLevelOne”.
  • the zigzag scan VLC table TBL22 is determined based on the maximum value of “run” at the position of the coefficient to be encoded.
  • coefficient T1 the coefficient at the position of T1 (hereinafter referred to as coefficient T1) is the object of encoding.
  • encoding is performed in the order of solid line arrows shown in FIG. 16 after the coefficient T1.
  • Encoding after the coefficient T1 is performed up to the DC coefficient DC. That is, the number of coefficients from the coefficient processed next to the coefficient T1 to the DC coefficient DC is the maximum value of run. In other words, the maximum value of run is determined from the number of unprocessed coefficients among the coefficients to be encoded. In the example shown in FIG. 16, the maximum value of run is “5”.
  • run When the coefficient T2 at the lower left of the coefficient T1 is a non-zero coefficient, run is “0”, and when the DC coefficient DC is a non-zero coefficient that appears next to the coefficient T1, run is “4”. When run is “5”, it means that there is no non-zero coefficient after coefficient T1.
  • the numbers shown at each position in FIG. 16 indicate the code numbers obtained when the next non-zero coefficient appears at that position.
  • the code number does not become smaller as the run is shorter. This is because the code number is determined based on the planar positional relationship between the coefficients.
  • a plurality of zigzag scan VLC tables TBL22 as exemplified above are defined in accordance with the context such as the maximum value of the run mode and the attribute of the block.
  • the batch coefficient encoding unit 342 refers to the zigzag scan VLC table TBL22 by appropriately switching according to the context.
  • FIG. 17 shows a table defining the correspondence of code numbers (CodeNum) corresponding to combinations of “run” and “isLevelOne” when the maximum value of run is 5.
  • FIG. 18 shows the VLC table TBL21 for linear scanning when the maximum value of run is 5.
  • the first coefficient encoding unit 332 acquires a corresponding code number by referring to the table shown in FIG. 17 based on the combination of “run” and “isLevelOne”. Then, the first coefficient encoding unit 332 is based on the acquired code number. The coefficient is encoded by obtaining the corresponding code with reference to the linear scanning VLC table TBL21 shown in FIG.
  • the linear scan VLC table TBL21 is not defined in consideration of the planar positional relationship like the zigzag scan VLC table TBL22. It doesn't matter.
  • Embodiment 1-2 Another embodiment of the present invention will be described with reference to FIGS. 19 to 26 as follows. For convenience of explanation, members having the same functions as those in the drawings described in the embodiment 1-1 are denoted by the same reference numerals and description thereof is omitted.
  • FIG. 19 is a functional block diagram illustrating another example of the configuration of the TU information decoding unit 12A.
  • the TU information decoding unit 12A determines the position of the last coefficient and the second nonzero coefficient from the last (hereinafter referred to as the second coefficient from the last), and based on this determination, performs two-stage coefficient decoding. Process.
  • the last coefficient and the second coefficient from the last are collectively referred to as the last two coefficients.
  • the TU information decoding unit 12A is different from the TU information decoding unit 12 shown in FIG. 1 in the following points. That is, in the TU information decoding unit 12A, the last coefficient decoding unit 121, the position determination unit 122, the two-stage decoding unit 123, and the collective decoding unit 124 are respectively replaced with the last two coefficient decoding units 125, the position determination units 122A, 2A, and 2B. The stage decoding unit 123A and the batch decoding unit 124A are changed.
  • the last two coefficient decoding units 125 decode the last coefficient and the second coefficient from the last from the coefficient encoded data C10.
  • the position determination unit 122A determines the position of the last coefficient decoded by the last coefficient decoding unit 125 and the position of the last coefficient obtained by the last coefficient decoding unit 125.
  • the position determination unit 122A uses the scanX and scanY functions as described above, from the last coefficient position LastIdx 1a and the last coefficient position LastIdx 1b , respectively, to the coordinates of the last coefficient position ( LastX 1a , LastY 1a ) and coordinates (LastX 1b , LastY 1b ) of the second coefficient from the last are obtained.
  • the position determination unit 122A calculates true / false of the following determination formula (2).
  • the position of the second coefficient from the last is determined. That is, it is determined whether or not the position of the second coefficient from the end is in the first row or the first column and is more than the threshold value from the position of the DC coefficient.
  • the position determination unit 122A determines to perform a two-stage coefficient decoding process. In this case, the position determination unit 122A notifies the determination result to the two-stage decoding unit 123A.
  • the position determination unit 122A determines to perform the coefficient decoding process collectively. In this case, the position determination unit 122A and the determination result are notified to the collective decoding unit 124A.
  • the two-stage decoding unit 123A receives the notification from the position determination unit 320A and performs a two-stage coefficient decoding process.
  • the function of the two-stage decoding unit 123A is the same as that of the two-stage decoding unit 123A except that the decoding range is from the second coefficient from the last to the DC coefficient.
  • the collective decoding unit 124A receives the notification from the position determination unit 320 and performs coefficient coding processing in a batch.
  • the function of the collective decoding unit 124A is the same as that of the collective decoding unit 124A except that the decoding range is from the second coefficient from the last to the DC coefficient.
  • FIG. 20 is a diagram illustrating the coefficient encoding process or the coefficient decoding process for the last coefficient and the second coefficient from the end of the coefficient matrix MX10.
  • 21A shows the first stage
  • FIG. 21B shows the second stage.
  • the dark shading indicates the last coefficient LT1.
  • thin shading indicates a non-zero coefficient.
  • positions that have been processed (encoded / decoded) up to the first stage are indicated by hatching.
  • FIG. 21B positions that have been processed (encoding / decoding) in the first stage are indicated by hatching.
  • the last two coefficient decoding units 125 decode the position of the last coefficient LT1 and the second coefficient LT2 from the last. Between the position of the last coefficient LT1 and the second coefficient LT2 from the end, there is a run of length 11. In other words, the last two coefficient decoding units 125 decode the region R41 between the position of the last coefficient LT1 and the second coefficient LT2 from the last shown in FIG.
  • the last two coefficient decoding units 125 obtain the position of the last coefficient LT1 and the position of the second coefficient LT2 from the last.
  • Position coordinates of the last coefficient LT1 (LastX 1a, LastY 1a) is (6,0).
  • the position (LastX 1b , LastY 1b ) of the second coefficient LT2 from the last is (5, 0).
  • the position determination unit 122A determines the position of the last coefficient LT1 and the position of the second coefficient LT2 from the last.
  • the position determination unit 122A determines to perform a two-stage coefficient decoding process.
  • FIG. 21A shows the first-stage coefficient decoding process and coefficient encoding process
  • FIG. 21B shows the second-stage coefficient decoding process and coefficient encoding process.
  • the two-stage decoding unit 123A sets the first target range R30 in the first row as a decoding target in the first-stage coefficient decoding process.
  • the two-stage decoding unit 123A as shown in FIG. 21A, the position of the coefficient to be actually decoded in the first target range R30, that is, the second coefficient LT2 from the end.
  • the region R31 from the next coefficient CF10 to the DC coefficient is decoded.
  • the two-stage decoding unit 123A sets the second target range R40 other than the first row as a decoding target in the second-stage coefficient decoding processing.
  • the two-stage decoding unit 123A sets a region R42 having a remaining coefficient that has not been decoded as a decoding target.
  • the two-stage decoding unit 123A decodes from the last coefficient K2 in the region R42 to the first coefficient ST in the scan order.
  • FIG. 22 is a flowchart showing the flow of coefficient decoding processing in the TU information decoding unit 12A.
  • the last two coefficient decoding units 125 decode the last coefficient LT1 and the second coefficient LT2 from the last (S11A).
  • the position determination unit 122A determines whether or not the last coefficient LT1 and the second coefficient LT2 from the last satisfy the condition (determination formula (2)) (S12A).
  • the collective decoding unit 124A performs the coefficient decoding process on the remaining coefficients in a lump (S13).
  • the two-stage decoding unit 123A performs the two-stage coefficient decoding process as follows.
  • the first coefficient decoding unit 231 decodes the coefficient from the coefficient CF10 next to the second coefficient from the last to the DC coefficient (S14A). In other words, the first coefficient decoding unit 231 decodes the coefficient included in the first row or the first column in the coefficient matrix.
  • the first reverse scanning unit 232 performs reverse scanning on the coefficients decoded in S14A (S15A). Thereby, the first row or the first column of the coefficient matrix is reproduced.
  • the flag determination unit 233 decodes the second stage flag (S16), and determines whether or not the second stage flag is “1” (S17). If the second stage flag is not “1” (NO in S17), since there is no non-zero coefficient in the region to be decoded in the second stage, the second stage coefficient decoding process is not performed. The coefficient decoding process ends.
  • the second stage coefficient decoding process is executed. That is, the second coefficient decoding unit 234 decodes the remaining coefficients (S18A).
  • the remaining coefficients are the area R41 between the last coefficient LT1 and the second coefficient LT2 from the last, and the second coefficient from the last, among the areas where the coefficients are actually encoded.
  • This is a coefficient in the region R42 excluding the region from the next coefficient CF10 to the DC coefficient of LT2.
  • the region R42 is a region from the coefficient K2 to the coefficient ST in the reverse scan order.
  • the second inverse scanning unit 235 performs inverse scanning on the coefficients decoded in S18, thereby reproducing the coefficient matrix for the remaining coefficients (S19A).
  • the first-stage and second-stage coefficient decoding processes are performed, so that the entire coefficient matrix is reproduced, and the process ends.
  • FIG. 23 is a functional block diagram illustrating another example of the configuration of the TU information encoding unit 31A.
  • the TU information encoding unit 31A determines the position of the last coefficient and the second coefficient from the last, and performs a two-stage coefficient decoding process based on this determination.
  • the TU information encoding unit 31A is different from the TU information encoding unit 31 illustrated in FIG. 9 in the following points. That is, in the TU information encoding unit 31A, the last coefficient encoding unit 310, the position determination unit 320, and the two-stage encoding unit 330 are changed from the last coefficient detection unit 312 and the position determination unit 320A, respectively. , And the two-stage encoding unit 330A.
  • the second to last coefficient detection unit 312 detects and encodes the position of the last coefficient and the second coefficient from the last. Further, the second to last coefficient detection unit 312 notifies the position determination unit 320A of the detected last coefficient and the position of the second coefficient from the last.
  • the position determination unit 320A determines whether or not the position of the last coefficient detected by the second to last coefficient detection unit 312 and the position of the second coefficient from the last satisfy a predetermined condition. Specifically, position determination unit 320A determines the authenticity of the above-described determination formula (2).
  • the position determination unit 320A determines to perform a two-stage coefficient decoding process. In this case, the position determination unit 320A notifies the determination result to the two-stage encoding unit 330A.
  • the position determination unit 320A determines to perform the coefficient decoding process collectively. In this case, the position determination unit 320A notifies the determination result to the batch encoding unit 340.
  • the two-stage encoding unit 330A receives the notification from the position determination unit 320A and performs a two-stage coefficient encoding / decoding process.
  • the function of the two-stage encoding unit 330A is the same as that of the two-stage encoding unit 330 except that the encoding range is from the coefficient next to the second coefficient from the last to the DC coefficient.
  • the second to last coefficient detection units 312 detect the position of the last coefficient LT1 and the second last coefficient LT2. For example, the second to last coefficient detection units 312 perform a reverse zigzag scan on the coefficient matrix to detect the position of the last coefficient LT1. The second to last coefficient detection unit 312 further detects the second coefficient LT2 from the last by performing reverse zigzag scanning from the last coefficient LT1 for the region R41.
  • the second to last coefficient detection unit 312 obtains the position of the last coefficient LT1 and the position of the second coefficient LT2 from the last. As described above, the coordinates (LastX 1a , LastY 1a ) of the last coefficient LT1 are (6, 0). In addition, the position (LastX 1b , LastY 1b ) of the second coefficient LT2 from the last is (5, 0).
  • the second to last coefficient detection unit 312 encodes the last coefficient position last_pos of the last coefficient LT1, the last coefficient level level, and the sign of the last coefficient sign.
  • the coefficient detection unit 312 from the last to the second encodes the 0 run run, the level level of the second coefficient LT2 from the last, and the positive / negative sign sign.
  • the position determination unit 320A determines the position of the last coefficient LT1 and the position of the second coefficient LT2 from the last.
  • the position determination unit 320A determines to perform a two-stage coefficient encoding process.
  • the two-stage encoding unit 330A sets the first target range R30 as an encoding target in the first-stage coefficient encoding process.
  • the two-stage encoding unit 330A as shown in FIG. 21A, the position where the coefficient to be actually encoded exists in the first target range R30, that is, the second coefficient from the end.
  • a region R31 from the next coefficient CF10 of LT2 to the DC coefficient is encoded.
  • the two-stage encoding unit 330A sets the second target range R40 as a decoding target in the second-stage coefficient decoding process.
  • the two-stage encoding unit 330A sets a region R42 having a remaining coefficient that has not been encoded as a decoding target.
  • the two-stage encoding unit 330A decodes from the last coefficient K2 in the region R42 to the first coefficient ST in the scan order.
  • the TU information encoding unit 31A outputs, for example, the following coefficient encoded data.
  • the first two rows are output by the coefficient detector 312 from the last to the second.
  • the third row is output by the first-stage coefficient encoding process in the two-stage encoding unit 330A.
  • coefficient encoded data that will be output when the above-described TU information encoding unit 31 is given a coefficient matrix as shown in FIG. 20 is as follows.
  • the first one row is output by the last coefficient detection unit 310.
  • the second and third lines are output by the first coefficient encoding process in the two-stage encoding unit 330A.
  • FIG. 24 is a flowchart showing the flow of coefficient decoding processing in the TU information encoding unit 31A.
  • the second to last coefficient detector 312 detects and encodes the last coefficient LT1 in the zigzag scan order and the second coefficient LT2 from the last (S21A).
  • the position determination unit 320A determines whether or not the last coefficient LT1 and the second coefficient LT2 from the last satisfy the condition (determination formula (2)) (S22A).
  • the collective decoding unit 340A performs coefficient coding processing on the remaining coefficients in a lump (S23). .
  • the two-stage encoding unit 330A performs a two-stage coefficient encoding process as follows. Is called.
  • the first scanning unit 331 scans the coefficient from the coefficient CF10 next to the second coefficient from the last to the DC coefficient, and stores the coefficient in the one-dimensional array ARR1 (S24A).
  • the first coefficient encoding unit 332 encodes the one-dimensional array ARR1 obtained in S24A from the coefficient CF10 to the DC coefficient (S25A).
  • the first coefficient encoding unit 332 outputs first coefficient encoded data C11 generated by encoding.
  • the second scanning unit 333 scans the remaining coefficients (S26A). That is, the second scanning unit 333 scans the coefficient K2 from the coefficient ST in the region R42. As a result, the coefficients in the region R42 are stored in the one-dimensional array ARR2.
  • the flag setting unit 334 sets “1 (with remaining coefficient)” to the second stage flag F1 (S29), and the second coefficient encoding unit. 335 encodes the remaining coefficients in region R42 (S30A).
  • the second coefficient encoding unit 335 outputs the second coefficient encoded data C12 generated by encoding, and the process ends.
  • FIG. 25 and FIG. 26 show an example of the syntax of the coefficient encoding process in the TU information encoding unit 31A. It should be noted that switching between performing the coefficient encoding process all at once or in two stages is performed in the upper syntax. In other words, the determination of the position of the last coefficient LT is performed using the upper syntax.
  • “More_coeff_flag” of SYN 32 is a syntax element indicating whether or not to perform the second-stage coefficient encoding process.
  • SYN33 is the same as SYN13 shown in FIG.
  • the syntax shown in FIG. 26 indicates the coefficient encoding process in “residual_block_vlc_2a”. As shown in FIG. 26, in the SYN 41, the last coefficient is encoded. More specifically, first, “last_pos_table_idx” is encoded. Since “last_pos_table_idx” has already been described with reference to FIG. 13, the description thereof is omitted here.
  • the second coefficient from the end is encoded.
  • zigzag scan and run mode are used for the second coefficient from the end. Details are as follows.
  • SYN 421 includes the syntax element of “isLevelOne_run” described with reference to FIG. Also, in SYN 422, the processing for run that continues with 0 is skipped.
  • SYN 43 a linear scan is executed. This is the same as the case where SYN 22 shown in FIG. 13 is executed in the first-stage coefficient encoding process, and a description thereof will be omitted.
  • the second stage flag may be omitted instead of encoding the second stage flag one by one. Further, a flag indicating whether or not the second stage flag is omitted may be encoded for each processing unit such as a sequence, a picture, a slice, or an LCU, and the processing may be switched as appropriate.
  • the last coefficient in the second stage is not encoded using last_pos in the second coefficient encoded data. Furthermore, the last coefficient in the second stage does not exist if there is no non-zero coefficient in the region to be encoded in the second stage.
  • FIG. 27 is a diagram illustrating the coefficient encoding process and the coefficient decoding process when the second stage flag is omitted.
  • the first target range R50 that is the first row is the processing range. More specifically, in actuality, in the first stage, a linear region R51 from the coefficient next to the last coefficient LT to the DC coefficient DC is to be processed.
  • the range R60 other than the first row is the processing range. More specifically, in the second stage, the coefficient encoding process is started from the last coefficient K3 in the zigzag scan in the range R60.
  • the coefficient K3 may be a non-zero coefficient or a zero coefficient. Then, the coefficient encoding process is executed up to the first coefficient ST in the range R60. Accordingly, the region R61 is actually processed.
  • the process starts from the run mode.
  • the TU information encoding unit 31 encodes the coefficient matrix MX10 illustrated in FIG. 27 as follows.
  • the TU information encoding unit 31 encodes the last coefficient LT as follows.
  • the TU information encoding unit 31 outputs the following encoded data.
  • the TU information encoding unit 31 outputs the following encoded data.
  • the TU information encoding unit 31 encodes the last coefficient LT as follows. This is the same as in the case of the first modification.
  • FIG. 28 is a flowchart showing the flow of the coefficient encoding process in the TU information encoding unit 31 according to this modification.
  • the two-stage encoding unit 330 When the position of the last coefficient LT satisfies a predetermined condition (YES in S22), the two-stage encoding unit 330 performs a two-stage coefficient encoding process as follows.
  • the first scanning unit 331 scans the coefficient after the last coefficient LT until it passes the DC coefficient, thereby storing the coefficient in the one-dimensional array ARR1 (S24B). That is, in the region R51, if the DC coefficient DC is a zero coefficient, the first scanning unit 331 continues to scan the region R61 coefficient. If the DC coefficient DC is a non-zero coefficient, the first-stage coefficient encoding process stops there.
  • the first coefficient encoding unit 332 encodes the coefficient of the one-dimensional array ARR1 obtained in S24B from the coefficient next to the last coefficient LT until the DC coefficient passes (S25B).
  • the first coefficient encoding unit 332 outputs first coefficient encoded data C11 generated by encoding.
  • the second scanning unit 333 scans the remaining coefficients in the region R61 (S26B). That is, the second scanning unit 333 starts scanning from the coefficient next to the coefficient scanned last in S24B. As a result, the coefficients in the region Q1 are stored in the one-dimensional array ARR2.
  • the second coefficient encoding unit 335 encodes the remaining coefficients in the region R61 (S30B).
  • the second coefficient encoding unit 335 outputs the second coefficient encoded data C12 generated by encoding, and the process ends.
  • FIG. 29 is a flowchart showing the flow of coefficient decoding processing in the TU information decoding unit 12 according to this modification.
  • the two-stage decoding unit 123 When the position of the last coefficient LT satisfies a predetermined condition (YES in S12), the two-stage decoding unit 123 performs a two-stage coefficient decoding process as follows.
  • the first coefficient decoding unit 231 decodes a coefficient from the coefficient next to the last coefficient LT until the DC coefficient is passed (S14B).
  • the first reverse scanning unit 232 performs reverse scanning on the coefficients decoded in S14B (S15B). That is, the first coefficient decoding unit 231 performs reverse scanning from the coefficient next to the last coefficient LT until the DC coefficient is passed.
  • the second stage coefficient decoding process is executed. That is, the second coefficient decoding unit 234 decodes the remaining coefficients (S18B). Then, the second inverse scanning unit 235 performs inverse scanning on the coefficients decoded in S18, thereby reproducing the coefficient matrix for the remaining coefficients (S19B).
  • the first-stage and second-stage coefficient decoding processes are performed, so that the entire coefficient matrix is reproduced, and the process ends.
  • (Syntax) 30 and 31 show an example of the syntax of the coefficient encoding process in the TU information encoding unit 31 according to this modification. It should be noted that switching between performing the coefficient encoding process all at once or in two stages is performed in the upper syntax. In other words, the determination of the position of the last coefficient LT is performed using the upper syntax.
  • SYN51 is the same as SYN21 shown in FIG.
  • the syntax shown in FIG. 31 indicates the coefficient encoding process in “residual_block_vlc_3a”. As shown in FIG. 31, in SYN 61, the run mode and the non-run mode are called in order. SYN61 is the same as SYN22 shown in FIG.
  • the syntax of the coefficient encoding process in the first stage and the second stage can be made common if the level of detail is the above level.
  • the position determination unit 320 calculates true / false of the following determination formula (3).
  • the position determination unit 320 determines to perform a two-stage coefficient decoding process. In this case, the position determination unit 320 notifies the determination result to the two-stage encoding unit 330.
  • the position determination unit 320 determines to perform the coefficient decoding process collectively. In this case, the position determination unit 320 notifies the determination result to the batch encoding unit 340.
  • the first target range R70 to be subjected to the first-stage coefficient decoding process is an area of 2 rows and 8 columns, and is not a linear area as described above. Therefore, the scan order in the first-stage coefficient decoding process may be changed to a flat one as shown by the solid line arrow in FIG.
  • the scan order in the second target range R80 which is the target of the second stage coefficient decoding process, is the same as when performing the coefficient decoding process in a lump. That is, in the copy process from the coefficient matrix MX12 to the coefficient matrix MX13 shown in FIG. 5, the coefficient matrix MX12 may be copied to the coefficient matrix MX13 with the first row and the second row open.
  • the first stage encoding target area is expanded, it is possible to moderately determine whether or not the coefficient is biased in the horizontal direction or the vertical direction. As a result, it is possible to efficiently encode the non-zero coefficient biased to the second row or the second column of the coefficient matrix, and to increase opportunities for improving the coding efficiency.
  • the rows or columns that can be used for the determination are not limited to the second row or the second column, and the number of rows or columns can be further increased. Alternatively, it may be combined with only a part of a row or column, for example, only the entire first column and the left half of the second column.
  • the first condition is appropriately combined with the determination conditions described in the above embodiments.
  • the encoding target region at the stage may be expanded. Opportunities for improving the coding efficiency can be increased by appropriately combining them.
  • a criterion other than the position may be used as the determination condition. For example, when the level of the last coefficient is larger than 1, even if the last coefficient is located in the first row or the first column, the two-stage encoding may not be performed.
  • FIG. 33 Restriction on Number of Coding Coefficients
  • the TU information encoding unit 31 or the TU information decoding unit 12 may limit the coefficient for performing the coefficient encoding process or the coefficient decoding process when the transform size is large, that is, when the size of the coefficient matrix is large.
  • the TU information encoding unit 31 will be described as follows.
  • the TU information encoding unit 31 first detects 64 coefficients from the first to the 64th in the scan order. Then, the TU information encoding unit 31 performs a two-stage coefficient encoding process on the detected 64 coefficients.
  • the TU information encoding unit 31 targets the region R31 in which the detected coefficient is present in the first target range R30.
  • the TU information encoding unit 31 targets the region R41 in which the detected coefficient exists in the second target range R40.
  • the TU information encoding unit 31 first detects 64 coefficients included in an 8 ⁇ 8 size with a DC coefficient as a base point. Then, the TU information encoding unit 31 performs a two-stage coefficient encoding process on the detected 64 coefficients.
  • the TU information encoding unit 31 targets the region R51 in which the detected coefficient is present in the first target range R50.
  • the TU information encoding unit 31 targets the region R61 in which the detected coefficient exists in the second target range R60 that is a row other than the first row. .
  • this modification is merely an example, and the number of coefficients is not limited to 64, and can be arbitrarily set.
  • the prediction mode of the coefficient matrix to be applied is not limited to the above.
  • the size of the upper left 8 ⁇ 8 may be detected for the intra 16 ⁇ 16 coefficient matrix.
  • each block of the moving picture decoding apparatus 1 and the moving picture encoding apparatus 2 described above may be realized in hardware by a logic circuit formed on an integrated circuit (IC chip), or may be a CPU (Central It may be realized by software using a Processing Unit).
  • IC chip integrated circuit
  • CPU Central It may be realized by software using a Processing Unit.
  • each device includes a CPU that executes instructions of a program that realizes each function, a ROM (Read (Memory) that stores the program, a RAM (Random Memory) that expands the program, the program, and various types
  • a storage device such as a memory for storing data is provided.
  • An object of the present invention is to provide a recording medium in which a program code (execution format program, intermediate code program, source program) of a control program of each of the above devices, which is software that realizes the above-described functions, is recorded so as to be readable by a computer. This can also be achieved by supplying to each of the above devices and reading and executing the program code recorded on the recording medium by the computer (or CPU or MPU).
  • Examples of the recording medium include tapes such as magnetic tape and cassette tape, magnetic disks such as floppy (registered trademark) disks / hard disks, and CD-ROM / MO / MD / DVD / CD-R / Blu-ray disks (registered trademarks). ) And other optical disks, IC cards (including memory cards) / optical cards, semiconductor memories such as mask ROM / EPROM / EEPROM / flash ROM, PLD (Programmable logic device) and FPGA ( Logic circuits such as Field Programmable Gate Array can be used.
  • tapes such as magnetic tape and cassette tape
  • magnetic disks such as floppy (registered trademark) disks / hard disks
  • CD-ROM / MO / MD / DVD / CD-R / Blu-ray disks registered trademarks
  • IC cards including memory cards
  • semiconductor memories such as mask ROM / EPROM / EEPROM / flash ROM, PLD (Programmable logic device) and FPGA ( Logic circuits
  • each of the above devices may be configured to be connectable to a communication network, and the program code may be supplied via the communication network.
  • the communication network is not particularly limited as long as it can transmit the program code.
  • the Internet intranet, extranet, LAN, ISDN, VAN, CATV communication network, virtual private network (Virtual Private Network), telephone line network, mobile communication network, satellite communication network, etc. can be used.
  • the transmission medium constituting the communication network may be any medium that can transmit the program code, and is not limited to a specific configuration or type.
  • wired lines such as IEEE 1394, USB, power line carrier, cable TV line, telephone line, ADSL (Asymmetric Digital Subscriber Line) line, infrared rays such as IrDA and remote control, Bluetooth (registered trademark), IEEE 802.11 wireless, HDR ( It can also be used by wireless such as High Data Rate, NFC (Near Field Communication), DLNA (Digital Living Network Alliance), mobile phone network, satellite line, and terrestrial digital network.
  • the present invention can also be realized in the form of a computer data signal embedded in a carrier wave in which the program code is embodied by electronic transmission.
  • the image decoding device decodes a moving image from encoded data.
  • the image decoding device regardless of whether the image is a moving image or a still image, the image decoding device generally Applicable. The same applies to the image encoding device.
  • the moving image decoding apparatus 1 reproduces the coefficient matrix MX10 by decoding and inverse scanning the coefficient encoded data C10.
  • the last coefficient decoding unit 121 that detects the position of the last coefficient and the position of the last coefficient are in the first row or the first column including the DC coefficient DC in the coefficient matrix MX10. If the position determination unit 122 for determining whether or not the position of the last coefficient is in the first row or the first column, the coefficient matrix MX10 is changed to the first row or the first column and the first row.
  • a two-stage decoding unit 123 that performs decoding processing on each row or column other than the first or first column. Therefore, it is possible to improve the encoding efficiency when the distribution of transform coefficients is biased.
  • an image decoding apparatus is an image decoding apparatus that reproduces a coefficient matrix by decoding and inverse scanning an encoded quantized transform coefficient included in encoded data obtained by encoding image data.
  • the last coefficient position detecting means for detecting the position of the last non-zero coefficient in the reverse scan order in the coefficient matrix, and the position of the last non-zero coefficient includes the coefficient of the DC component in the coefficient matrix.
  • the coefficient matrix is Two-stage decoding means for decoding each of a first decoding target range including the position of the last non-zero coefficient and a second decoding target range other than the first decoding target range. It is a configuration.
  • the quantized transform coefficient is obtained by orthogonally transforming and quantizing the prediction residual obtained by subtracting the predicted image from the image data in the image data encoding process. Also, the quantized transform coefficient in the block to be encoded can be expressed in the form of a coefficient matrix.
  • the encoded quantized transform coefficient is obtained by scanning and encoding a coefficient matrix composed of quantized transform coefficients. Scanning the coefficient matrix means storing the coefficients included in the coefficient matrix in a one-dimensional array.
  • reverse scanning is to rearrange the decoded coefficients at corresponding positions on the coefficient matrix.
  • the reverse scan order is a predetermined order in which reverse scan is performed.
  • a zigzag scan can be employed in the reverse scan order.
  • the DC component coefficient in the coefficient matrix is specifically the coefficient in the first row and the first column. Furthermore, it is a coefficient that makes the reverse scan order first in the zigzag scan.
  • the coefficient tends to be a non-zero coefficient whose value is not zero in the low frequency component near the DC component.
  • the coefficient tends to be a zero coefficient whose value becomes zero as it becomes a high frequency component.
  • the low frequency component coefficients are processed in the order in which they are processed before the high frequency component coefficients.
  • the last non-zero coefficient is the last non-zero coefficient in reverse scan order when viewed from the DC component coefficient. Furthermore, all coefficients in order after the last non-zero coefficient are all zero coefficients.
  • the position of the last non-zero coefficient is (1) the position from the first row to the predetermined row or (2) the position from the first column to the predetermined column of the coefficient matrix. Determine if it exists.
  • the above (1) and (2) are collectively referred to as a position determination range.
  • the position determination range can also be said to be an end portion including a coefficient of a direct current component in the coefficient matrix.
  • the coefficient matrix includes the first decoding target range including the position of the last non-zero coefficient
  • the first Decoding processing is performed in two stages with a second decoding target range other than the one decoding target range.
  • the first decoding target range may include the position of the DC component coefficient. Therefore, the decoding process can be performed as follows based on the position of the last non-zero coefficient, for example. First, the first non-zero coefficient to the DC component coefficient are decoded in the first decoding target range. Thereafter, in the second decoding target range, decoding is performed from the last non-zero coefficient in the scanning order in the second decoding target range to the first coefficient in the scanning order. The zigzag scan described above can be applied to the scan order in the second decoding target range.
  • non-zero coefficients tend to be biased to horizontal or vertical components when the residual is relatively small and the total number of coefficients is small. For example, in the case of coding of an inter prediction block, such a tendency is seen.
  • the coding efficiency is better when the lengths of continuous non-zero coefficients (hereinafter referred to as “runs”) are collected as much as possible, that is, when coding is performed without dividing.
  • the first decoding target range is decoded separately from the second decoding target range. For this reason, when non-zero coefficients are concentrated in the first decoding target range, the code amount of the code data to be decoded can be suppressed.
  • the run is encoded without being divided by the coefficients in the first decoding target range, and the encoding is efficiently performed. Therefore, the code amount to be decoded can be suppressed.
  • the position determination means determines whether the position of the last non-zero coefficient is in the first row or the first column in the coefficient matrix, and the two steps It is preferable that the first decoding target range in the decoding process of the decoding unit coincides with the position determination range.
  • the position determination range is linear.
  • the first decoding target range is set in a relatively simple scan order when the non-zero coefficient is biased in the horizontal direction or the vertical direction. Decoding processing can be performed.
  • the image decoding apparatus further comprises distance determining means for determining whether or not the position of the last non-zero coefficient is a predetermined distance or more away from the position of the coefficient of the DC component.
  • the decoding process is preferably performed.
  • the two-stage decoding unit performs a zigzag scan in the reverse scan in the decoding of the second decoding target range.
  • Zigzag scanning is a scanning method adopted in Non-Patent Document 3 and the like.
  • the technique of Non-Patent Document 3 can be employed.
  • the position detection by the last coefficient position detection unit the position determination by the position determination unit, and the two steps It is preferable to provide recursive control means for controlling recursively decoding by the decoding means.
  • the second decoding target range is further divided into a new first decoding target range and a new second decoding target range. Then, a two-stage decoding process is performed recursively. Note that the new second decoding target range may be further recursively processed. In addition, the recursive process can be repeatedly executed under conditions such as “perform until the new second decoding target range reaches a predetermined size”.
  • the two-stage decoding means is a variable length code table that defines a combination of a variable length code and a length of continuous non-zero coefficients in the decoding of the first decoding target range. Therefore, it is preferable to refer to the variable length code table in which the length of the continuous non-zero coefficient is longer as the length of the variable length code is longer than the shortest variable length code.
  • variable length code table is, for example, a VLC table.
  • the VLC table is defined in accordance with the spatial characteristics of the coefficient matrix. That is, in these VLC tables, the longer the variable length code is, the longer the continuous non-zero coefficient is not.
  • the decoding process of the first decoding target range is a linear range
  • the spatial characteristics as described above may not be taken into consideration.
  • variable length code table in which the length of the continuous non-zero coefficient is longer as the length of the variable length code is longer as in the above configuration.
  • the table may be configured with a variable length code.
  • the image decoding apparatus comprises non-zero coefficient position detection means for detecting a position of a predetermined non-zero coefficient from the last non-zero coefficient in the reverse scan order in the coefficient matrix,
  • the position determination means preferably determines whether or not the position from the last non-zero coefficient to the predetermined non-zero coefficient is in the position determination range.
  • the two-stage decoding means switches from a non-zero coefficient length decoding mode that decodes the length of consecutive non-zero coefficients to a sequential decoding mode that decodes successive coefficients, with a predetermined mode switching condition.
  • a predetermined mode switching condition When the condition is satisfied, decoding is performed while switching the mode, and the mode switching condition for decoding the first decoding target range is different from the mode switching condition for decoding the second decoding target range. It is preferable.
  • the first range is smaller than the second range.
  • the appearance tendency of the non-zero coefficient may be completely different between the first range and the second range. Therefore, if the mode switching condition in the non-zero coefficient decoding mode is the same, the switching condition may be inappropriate for the appearance tendency of the first range, or may be inappropriate for the second range. is there. In such a case, the encoding efficiency may be reduced.
  • the mode switching condition includes the number of decoded coefficients and the number of coefficients whose absolute values exceed a threshold.
  • the mode switching condition in the first range can be appropriately set, it is possible to prevent the encoding efficiency from being lowered.
  • An image encoding apparatus outputs encoded data by performing orthogonal transform on a prediction residual obtained by subtracting a predicted image from image data and scanning and encoding a coefficient matrix composed of quantized transform coefficients.
  • the last coefficient position detecting means for detecting the position of the last non-zero coefficient in the scan order in the coefficient matrix, and the position of the last non-zero coefficient are the DC component in the coefficient matrix.
  • Position determination means for determining whether or not a position determination range from a row or column including the coefficient to a predetermined row or column and the position of the last non-zero coefficient are in the position determination range,
  • a two-stage code for encoding a coefficient matrix in each of a first encoding target range including the position of the last non-zero coefficient and a second encoding target range other than the first encoding target range.
  • means which is configured to include.
  • the data structure of the encoded data according to the present invention is a code generated by performing orthogonal transform on a prediction residual obtained by subtracting a predicted image from image data and scanning and coding a coefficient matrix composed of quantized transform coefficients.
  • the position information indicating the position of the last non-zero coefficient in the scan order in the coefficient matrix and the last non-zero coefficient are included in the coefficient matrix, and the coefficient matrix includes the DC component coefficient.
  • the first coefficient encoded data in which the coefficients in the first encoding target range from the column to the predetermined row or column are sequentially encoded and the second encoding target other than the first encoding target range
  • the same effects as those of the image decoding device according to the present invention can be obtained.
  • the image encoding device includes position information indicating the position of the last non-zero coefficient in the scan order in the coefficient matrix and the last non-zero coefficient, and includes a coefficient of a DC component in the coefficient matrix.
  • First coefficient encoded data obtained by sequentially encoding coefficients in a first range from a row or column to a predetermined row or column, and coefficients in a second range other than the first range are sequentially encoded.
  • the encoded second coefficient encoded data may be included in the data structure of the encoded data.
  • the image encoding device may encode the information in, for example, side information.
  • Embodiment 2 Another embodiment of the decoding device and the encoding device according to the present invention will be described below with reference to the drawings.
  • the decoding apparatus decodes a moving image from encoded data. Therefore, hereinafter, this is referred to as “moving image decoding apparatus”.
  • the encoding device according to the present embodiment generates encoded data by encoding a moving image. Therefore, in the following, this is referred to as a “video encoding device”.
  • the scope of application of the present invention is not limited to this. That is, as will be apparent from the following description, the features of the present invention can be realized without assuming a plurality of frames. That is, the present invention can be applied to a general decoding apparatus and a general encoding apparatus regardless of whether the target is a moving image or a still image.
  • the encoded data # 1 has a hierarchical structure including a sequence layer, a GOP (Group Of Pictures) layer, a picture layer, a slice layer, and a maximum coding unit (LCU: Large Coding Unit) layer.
  • GOP Group Of Pictures
  • LCU Large Coding Unit
  • FIG. 37 shows the hierarchical structure below the picture layer in the encoded data # 1.
  • FIGS. 37A to 37F show a picture layer P, a slice layer S, an LCU layer LCU, a leaf CU included in the LCU (denoted as CUL in FIG. 37D), and inter prediction (inter-screen prediction). It is a figure which shows the structure of inter prediction information PI_Inter which is the prediction information PI about a partition, and intra prediction information PI_Intra which is the prediction information PI about an intra prediction (prediction in a screen) partition.
  • PI_Inter inter prediction information
  • PI_Intra intra prediction information
  • the picture layer P is a set of data that is referenced by the video decoding device 1 in order to decode a target picture that is a processing target picture. As shown in FIG. 37 (a), the picture layer P includes a picture header PH and slice layers S1 to SNs (Ns is the total number of slice layers included in the picture layer P).
  • the picture header PH includes a coding parameter group referred to by the video decoding device 1 in order to determine a decoding method of the target picture.
  • the encoding mode information (entropy_coding_mode_flag) indicating the variable length encoding mode used in encoding by the moving image encoding device 2 is an example of an encoding parameter included in the picture header PH.
  • Each slice layer S included in the picture layer P is a set of data referred to by the video decoding device 1 in order to decode a target slice that is a slice to be processed.
  • the slice layer S includes a slice header SH and LCU layers LCU1 to LCUn (Nc is the total number of LCUs included in the slice S).
  • the slice header SH includes a coding parameter group that the moving image decoding apparatus 1 refers to in order to determine a decoding method of the target slice.
  • Slice type designation information (slice_type) for designating a slice type is an example of an encoding parameter included in the slice header SH.
  • I slice that uses only intra prediction at the time of encoding (2) P slice that uses unidirectional prediction or intra prediction at the time of encoding, (3) B-slice using unidirectional prediction, bidirectional prediction, or intra prediction at the time of encoding may be used.
  • the slice header SH includes a filter parameter FP that is referred to by an adaptive filter included in the video decoding device 1.
  • the configuration of the filter parameter FP will be described later and will not be described here.
  • Each LCU layer LCU included in the slice layer S is a set of data that the video decoding device 1 refers to in order to decode the target LCU that is the processing target LCU.
  • the LCU layer LCU is composed of a plurality of coding units (CU: Coding Units) obtained by hierarchically dividing the LCU into a quadtree.
  • the LCU layer LCU is a coding unit corresponding to the highest level in a hierarchical structure that recursively includes a plurality of CUs.
  • each CU included in the LCU layer LCU has a hierarchical structure that recursively includes a CU header CUH and a plurality of CUs obtained by dividing the CU into quadtrees. is doing.
  • each CU excluding the LCU is half the size of the CU to which the CU directly belongs (that is, the CU one layer higher than the CU), and the size that each CU can take is encoded data # 1.
  • a CU that is not further divided is called a leaf CU.
  • the CU header CUH includes a coding parameter referred to by the video decoding device 1 in order to determine a decoding method of the target CU. Specifically, as shown in FIG. 37 (c), a CU division flag SP_CU for specifying whether or not the target CU is further divided into four subordinate CUs is included. When the CU division flag SP_CU is 0, that is, when the CU is not further divided, the CU is a leaf CU.
  • CU leaf A CU (CU leaf) that is not further divided is handled as a prediction unit (PU: Prediction Unit) and a transform unit (TU: Transform Unit).
  • PU Prediction Unit
  • TU Transform Unit
  • the leaf CU (denoted as CUL in FIG. 37 (d)) includes (1) PU information PUI that is referred to when the moving image decoding apparatus 1 generates a predicted image, and (2) The TU information TUI that is referred to when the residual data is decoded by the moving picture decoding apparatus 1 is included.
  • the skip flag SKIP is a flag indicating whether or not the skip mode is applied to the target PU.
  • the value of the skip flag SKIP is 1, that is, when the skip mode is applied to the target leaf, PU information PUI and TU information TUI in the leaf CU are omitted. Note that the skip flag SKIP is omitted for the I slice.
  • the PU information PUI includes a skip flag SKIP, prediction type information PT, and prediction information PI as shown in FIG.
  • the prediction type information PT is information that specifies whether intra prediction or inter prediction is used as a predicted image generation method for the target leaf CU (target PU).
  • the prediction information PI includes intra prediction information PI_Intra or inter prediction information PI_Inter depending on which prediction method is specified by the prediction type information PT.
  • a PU to which intra prediction is applied is also referred to as an intra PU
  • a PU to which inter prediction is applied is also referred to as an inter PU.
  • the PU information PUI includes information specifying the shape and size of each partition included in the target PU and the position in the target PU.
  • the partition is one or a plurality of non-overlapping areas constituting the target leaf CU, and the generation of the predicted image is performed in units of partitions.
  • the TU information TUI specifies the quantization parameter difference ⁇ qp (tu_qp_delta) that specifies the size of the quantization step and the division pattern of the target leaf CU (target TU) into each block.
  • TU partition information SP_TU and quantization residual information QD are included.
  • the quantization parameter difference ⁇ qp is a difference qp ⁇ qp ′ between the quantization parameter qp in the target TU and the quantization parameter qp ′ in the TU encoded immediately before the TU.
  • TU partition information SP_TU is information that specifies the shape and size of each block included in the target TU and the position in the target TU.
  • Each TU can be, for example, a size from 64 ⁇ 64 pixels to 2 ⁇ 2 pixels.
  • the block is one or a plurality of non-overlapping areas constituting the target leaf CU, and encoding / decoding of the prediction residual is performed in units of blocks.
  • the quantization residual information QD is encoded data generated by the moving picture encoding apparatus 2 performing the following processes 1 to 3 on a target block that is a processing target block.
  • Process 1 DCT transform (Discrete Cosine Transform) is performed on the prediction residual obtained by subtracting the prediction image from the encoding target image.
  • Process 2 The transform coefficient obtained in Process 1 is quantized.
  • Process 3 The transform coefficient quantized in Process 2 is variable-length encoded.
  • Various syntaxes included in the quantization residual information QD will be described later.
  • the inter prediction information PI_Inter includes a coding parameter that is referred to when the video decoding device 1 generates an inter prediction image by inter prediction. As shown in FIG. 37 (e), the inter prediction information PI_Inter includes inter PU partition information SP_Inter that specifies a partition pattern for each partition of the target PU, and inter prediction parameters PP_Inter1 to PP_InterNe (Ne for each partition). The total number of inter prediction partitions included in the target PU).
  • the inter-PU partition information SP_Inter is information for designating the shape and size of each inter prediction partition included in the target PU (inter PU) and the position in the target PU.
  • the inter PU is composed of four symmetric splittings of 2N ⁇ 2N pixels, 2N ⁇ N pixels, N ⁇ 2N pixels, and N ⁇ N pixels, and 2N ⁇ nU pixels, 2N ⁇ nD pixels, and nL ⁇ 2N. It is possible to divide into 8 types of partitions in total by four asymmetric splits of pixels and nR ⁇ 2N pixels.
  • the specific value of N is defined by the size of the CU to which the PU belongs, and the specific values of nU, nD, nL, and nR are determined according to the value of N.
  • an inter PU of 128 ⁇ 128 pixels is 128 ⁇ 128 pixels, 128 ⁇ 64 pixels, 64 ⁇ 128 pixels, 64 ⁇ 64 pixels, 128 ⁇ 32 pixels, 128 ⁇ 96 pixels, 32 ⁇ 128 pixels, and 96 ⁇ It is possible to divide into 128-pixel inter prediction partitions.
  • the inter prediction parameter PP_Inter includes a reference image index RI, an estimated motion vector index PMVI, and a motion vector residual MVD.
  • the motion vector residual MVD is encoded data generated by the moving image encoding device 2 executing the following processes 4 to 6.
  • Process 4 Select an encoded / decoded locally decoded image (more precisely, an image obtained by performing deblocking processing and adaptive filtering on the encoded / decoded local decoded image)
  • the motion vector mv for the target partition is derived with reference to the selected encoded / decoded local decoded image (hereinafter also referred to as “reference image”).
  • Process 5 An estimation method is selected, and an estimated value (hereinafter also referred to as “estimated motion vector”) pmv of the motion vector mv assigned to the target partition is derived using the selected estimation method.
  • Process 6 The motion vector residual MVD obtained by subtracting the estimated motion vector pmv derived in Process 5 from the motion vector mv derived in Process 4 is encoded.
  • the reference image index RI designates the locally decoded image (reference image) that has been encoded / decoded selected in the process 4.
  • the estimated motion vector index PMVI described above is the estimation method selected in the process 5. Is specified.
  • the estimation methods that can be selected in the processing 5 include: (1) a locally decoded image being encoded / decoded (more precisely, a region that has already been decoded in a locally decoded image being encoded / decoded).
  • a median of a motion vector allocated to a partition adjacent to the target partition hereinafter also referred to as “adjacent partition” is used as an estimated motion vector pmv.
  • a motion vector assigned to a partition (often referred to as a “collocated partition”) occupying the same position as the target partition is used as an estimated motion vector pmv, etc. Is mentioned.
  • the prediction parameter PP related to the partition for which unidirectional prediction is performed includes one each of the reference image index RI, the estimated motion vector index PMVI, and the motion vector residual MVD, as shown in FIG.
  • the prediction parameters PP for a partition that performs bi-directional prediction include two reference image indexes RI1 and RI2, two estimated motion vector indexes PMVI1 and PMVI2, and two motion vector residuals MVD1. And MVD2.
  • the intra prediction information PI_Intra includes an encoding parameter that is referred to when the video decoding device 1 generates an intra predicted image by intra prediction.
  • the intra prediction information PI_Intra includes intra PU partition information SP_Intra that specifies a partition pattern for the target PU (intra PU) into each partition, and intra prediction parameters PP_Intra1 to PP_IntraNa for each partition. (Na is the total number of intra prediction partitions included in the target PU).
  • the intra-PU partition information SP_Intra is information that specifies the shape and size of each intra-predicted partition included in the target PU, and the position in the target PU.
  • the intra PU split information SP_Intra includes an intra split flag (intra_split_flag) that specifies whether or not the target PU is split into partitions. If the intra partition flag is 1, the target PU is divided symmetrically into four partitions. If the intra partition flag is 0, the target PU is not divided and the target PU itself is one partition.
  • N 2 n , n is an arbitrary integer of 1 or more.
  • a 128 ⁇ 128 pixel intra PU can be divided into 128 ⁇ 128 pixel and 64 ⁇ 64 pixel intra prediction partitions.
  • the intra prediction parameter PP_Intra includes an estimation flag MPM and a residual prediction mode index RIPM.
  • the intra prediction parameter PP_Intra is a parameter for designating an intra prediction method (prediction mode) for each partition.
  • the estimation flag MPM is a flag indicating whether or not the prediction mode estimated based on the prediction mode allocated to the peripheral partition of the target partition that is the processing target is the same as the prediction mode for the target partition.
  • examples of partitions around the target partition include a partition adjacent to the upper side of the target partition and a partition adjacent to the left side of the target partition.
  • the residual prediction mode index RIPM is an index included in the intra prediction parameter PP_Intra when the estimated prediction mode and the prediction mode for the target partition are different, and is an index for designating a prediction mode assigned to the target partition. It is.
  • the slice header SH includes the filter parameter FP that is referred to by the adaptive filter included in the video decoding device 1.
  • the filter parameter FP includes a filter coefficient group as shown in FIG.
  • the filter coefficient group includes (1) tap number designation information for designating the number of taps of the filter, (2) filter coefficients a 0 to a NT-1 (NT is the total number of filter coefficients included in the filter coefficient group), and (3) Offset o is included.
  • FIG. 38 is a table showing each syntax included in the quantization residual information QD (indicated as residual_block_pipe (tuSize) in FIG. 38).
  • the quantization residual information QD includes syntax sig_flag, last_flag, abs_greater_one, coeff_abs_level, and sign.
  • the syntax sig_flag and the syntax last_flag are also referred to as a significant map.
  • Various syntaxes included in the quantized residual information QD are encoded by context adaptive binary arithmetic coding (CABAC: (Context-based Adaptive Binary Arithmetic Coding)).
  • FIG. 39A is a diagram illustrating a non-zero transform coefficient (hereinafter also referred to as a non-zero change coefficient) in an 8 ⁇ 8 pixel block.
  • the horizontal axis represents the horizontal frequency
  • the vertical axis represents the vertical frequency.
  • the transform coefficient for the horizontal frequency u (0 ⁇ u ⁇ 7) and the vertical frequency v (0 ⁇ v ⁇ 7) will be expressed as Coeff (u, v).
  • the conversion coefficient Coeff (0, 0) represents a DC component
  • the other conversion coefficients represent components other than the DC component.
  • variable-length code decoding unit 11 included in the moving picture decoding apparatus 1 to be described later is directed from the low frequency side (upper left in FIG. 39A) to the high frequency side (lower right in FIG. 39A) for the target block. Scanning is performed, and the transform coefficient Coeff (u, v) is sequentially decoded. A specific scan order will be described later.
  • the syntax sig_flag is a flag indicating the presence or absence of a non-zero conversion coefficient for each u and v.
  • FIG. 39 (b) shows the value of the syntax sig_flag when the transform coefficient to be decoded is the one shown in FIG. 39 (a).
  • the syntax sig_flag is a flag that takes 0 for each of u and v if the transform coefficient is 0, and 1 if the transform coefficient is not 0.
  • the syntax last_flag is a flag indicating whether or not u and v are the last conversion coefficients in the scan order.
  • FIG. 39 (c) is a diagram illustrating the syntax last_flag when the transform coefficient to be decoded is the one illustrated in FIG. 39 (a).
  • the syntax last_flag is a flag that takes 1 for u and v if the last conversion coefficient is in the scan order, and takes 0 if it is not the last conversion coefficient in the scan order.
  • the syntax abs_greater_one is a flag indicating whether or not the absolute value of the conversion coefficient exceeds 1 for each of u and v.
  • FIG. 39D is a diagram illustrating the syntax abs_greater_one when the transform coefficients to be decoded are those illustrated in FIG. As shown in FIG. 39D, the syntax abs_greater_one takes 1 when the absolute value of the transform coefficient exceeds 1, and takes 0 when the absolute value of the transform coefficient does not exceed 1. Flag.
  • the syntax coeff_abs_level is a syntax indicating the magnitude of the absolute value of the transform coefficient when the absolute value of the transform coefficient exceeds 1, and a value obtained by subtracting 2 from the absolute value is encoded.
  • the moving picture decoding apparatus 1 includes H.264 as a part thereof. H.264 / MPEG-4.
  • Decoding device including technology adopted in KTA software which is a codec for joint development in AVC and VCEG (Video Coding Expert Group), and technology adopted in TMuC (Test Model under Consideration) software which is a successor codec It is.
  • FIG. 40 is a block diagram showing a configuration of the moving picture decoding apparatus 1.
  • the moving image decoding apparatus 1 includes a variable length code decoding unit 11, a predicted image generation unit 12, an inverse quantization / inverse conversion unit 13, an adder 14, a frame memory 15, and a loop filter 16. I have.
  • the predicted image generation unit 12 includes a motion vector restoration unit 12a, an inter predicted image generation unit 12b, an intra predicted image generation unit 12c, and a prediction method determination unit 12d.
  • the moving picture decoding apparatus 1 is an apparatus for generating moving picture # 2 by decoding encoded data # 1.
  • FIG. 41 is a block diagram illustrating a main configuration of the variable length code decoding unit 11. As shown in FIG. 41, the variable-length code decoding unit 11 includes a quantization residual information decoding unit 111, a prediction parameter decoding unit 112, a prediction type information decoding unit 113, and a filter parameter decoding unit 114.
  • the variable length code decoding unit 11 uses the prediction parameter decoding unit 112 to decode the prediction parameter PP related to each partition from the encoded data # 1, and supplies the decoded image to the predicted image generation unit 12. Specifically, for the inter prediction partition, the prediction parameter decoding unit 112 decodes the inter prediction parameter PP_Inter including the reference image index RI, the estimated motion vector index PMVI, and the motion vector residual MVD from the encoded data # 1. These are supplied to the motion vector restoration unit 12a. On the other hand, for the intra prediction partition, the intra prediction parameter PP_Intra including the estimation flag MPM, the residual index RIPM, and the additional index AI is decoded from the encoded data # 1, and these are supplied to the intra prediction image generation unit 12c.
  • variable length code decoding unit 11 decodes the prediction type information PT for each partition from the encoded data # 1 in the prediction type information decoding unit 113, and supplies this to the prediction method determination unit 12d. Further, the variable length code decoding unit 11 uses the quantization residual information decoding unit 111 to convert the quantization residual information QD related to the block and the quantization parameter difference ⁇ qp related to the TU including the block from the encoded data # 1. These are decoded and supplied to the inverse quantization / inverse transform unit 13. In the variable length code decoding unit 11, the filter parameter decoding unit 114 decodes the filter parameter FP from the encoded data # 1 and supplies this to the loop filter 16. Note that a specific configuration of the quantized residual information decoding unit 111 will be described later, and a description thereof will be omitted here.
  • the predicted image generation unit 12 identifies whether each partition is an inter prediction partition for performing inter prediction or an intra prediction partition for performing intra prediction based on the prediction type information PT for each partition. In the former case, the inter prediction image Pred_Inter is generated, and the generated inter prediction image Pred_Inter is supplied to the adder 14 as the prediction image Pred. In the latter case, the intra prediction image Pred_Intra is generated, The generated intra predicted image Pred_Intra is supplied to the adder 14. Note that, when the skip mode is applied to the processing target PU, the predicted image generation unit 12 omits decoding of other parameters belonging to the PU.
  • the motion vector restoration unit 12a restores the motion vector mv related to each inter prediction partition from the motion vector residual MVD related to that partition and the restored motion vector mv ′ related to another partition. Specifically, (1) the estimated motion vector pmv is derived from the restored motion vector mv ′ according to the estimation method specified by the estimated motion vector index PMVI, and (2) the derived estimated motion vector pmv and the motion vector remaining are derived. The motion vector mv is obtained by adding the difference MVD. It should be noted that the restored motion vector mv ′ relating to other partitions can be read from the frame memory 15. The motion vector restoration unit 12a supplies the restored motion vector mv to the inter predicted image generation unit 12b together with the corresponding reference image index RI.
  • the inter prediction image generation unit 12b generates a motion compensated image mc related to each inter prediction partition by inter-screen prediction. Specifically, using the motion vector mv supplied from the motion vector restoration unit 12a, the motion compensated image from the adaptive filtered decoded image P_ALF ′ designated by the reference image index RI also supplied from the motion vector restoration unit 12a. Generate mc.
  • the adaptive filtered decoded image P_ALF ′ is an image obtained by performing the filtering process by the loop filter 16 on the decoded image that has already been decoded for the entire frame. 12b can read out the pixel value of each pixel constituting the adaptive filtered decoded image P_ALF ′ from the frame memory 15.
  • the motion compensated image mc generated by the inter predicted image generation unit 12b is supplied to the prediction method determination unit 12d as an inter predicted image Pred_Inter.
  • the intra predicted image generation unit 12c generates a predicted image Pred_Intra related to each intra prediction partition. Specifically, first, a prediction mode is specified based on the intra prediction parameter PP_Intra supplied from the variable length code decoding unit 11, and the specified prediction mode is assigned to the target partition in, for example, raster scan order.
  • the estimation flag MPM is decoded, and the estimation flag MPM indicates that the prediction mode for the target partition to be processed is the same as the prediction mode assigned to the peripheral partition of the target partition. If it is, the prediction mode assigned to the partition around the target partition is assigned to the target partition.
  • the estimation flag MPM indicates that the prediction mode for the target partition to be processed is not the same as the prediction mode assigned to a partition around the target partition, the remaining The prediction mode index RIPM is decoded, and the prediction mode indicated by the residual prediction mode index RIPM is assigned to the target partition.
  • the intra predicted image generation unit 12c generates a predicted image Pred_Intra from the (local) decoded image P by intra prediction according to the prediction method indicated by the prediction mode assigned to the target partition.
  • the intra predicted image Pred_Intra generated by the intra predicted image generation unit 12c is supplied to the prediction method determination unit 12d.
  • the intra predicted image generation unit 12c can also be configured to generate the predicted image Pred_Intra from the adaptive filtered decoded image P_ALF by intra prediction.
  • the prediction method determination unit 12d determines whether each partition is an inter prediction partition that should perform inter prediction or an intra prediction partition that should perform intra prediction based on the prediction type information PT about the PU to which each partition belongs. To do. In the former case, the inter prediction image Pred_Inter generated by the inter prediction image generation unit 12b is supplied to the adder 14 as the prediction image Pred. In the latter case, the inter prediction image generation unit 12c generates the inter prediction image Pred_Inter. The intra predicted image Pred_Intra that has been processed is supplied to the adder 14 as the predicted image Pred.
  • the inverse quantization / inverse transform unit 13 (1) inverse quantizes the transform coefficient Coeff decoded from the quantized residual information QD, and (2) transforms the transform coefficient Coeff_IQ obtained by the inverse quantization into an inverse DCT (Discrete Cosine). Transform), and (3) the prediction residual D obtained by the inverse DCT transform is supplied to the adder 14. Note that when the transform coefficient Coeff decoded from the quantization residual information QD is inversely quantized, the inverse quantization / inverse transform unit 13 performs quantization from the quantization parameter difference ⁇ qp supplied from the variable length code decoding unit 11. Deriving step QP.
  • the generation of the prediction residual D by the inverse quantization / inverse transform unit 13 is performed in units of blocks obtained by dividing TUs or TUs.
  • the inverse DCT transform performed by the inverse quantization / inverse transform unit 13 sets the pixel position in the target block to (i, j) (0 ⁇ i If it is assumed that ⁇ 7, 0 ⁇ j ⁇ 7) and the value of the prediction residual D at the position (i, j) is represented as D (i, j), it is given by the following mathematical formula (1), for example.
  • Coeff_IQ (u, v) (0 ⁇ u ⁇ 7, 0 ⁇ v ⁇ 7) represents inversely quantized transform coefficients for the horizontal frequency u and the vertical frequency v.
  • C (u) and C (v) are given as follows.
  • the adder 14 generates the decoded image P by adding the prediction image Pred supplied from the prediction image generation unit 12 and the prediction residual D supplied from the inverse quantization / inverse conversion unit 13.
  • the generated decoded image P is stored in the frame memory 15.
  • the loop filter 16 includes (1) a function as a deblocking filter (DF) that performs smoothing (deblocking processing) on an image around a block boundary or partition boundary in the decoded image P, and (2) a deblocking filter. It has a function as an adaptive filter (ALF: Adaptive Loop Filter) which performs an adaptive filter process using the filter parameter FP with respect to the image which the blocking filter acted on.
  • ALF Adaptive Loop Filter
  • the quantization residual information decoding unit 111 decodes the quantized transform coefficient Coeff (PosX, PosY) for each frequency component (PosX, PosY) from the quantization residual information QD included in the encoded data # 1. It is the structure for doing.
  • PosX and PosY are indexes representing the position of each frequency component in the frequency domain, and are indexes corresponding to the above-described horizontal frequency u and vertical frequency v, respectively.
  • Various syntaxes included in the quantized residual information QD are encoded by context adaptive binary arithmetic coding (CABAC: (Context-based Adaptive Binary Arithmetic Coding)).
  • CABAC Context-based Adaptive Binary Arithmetic Coding
  • FIG. 36 is a block diagram showing a configuration of the quantized residual information decoding unit 111.
  • the quantized residual information decoding unit 111 includes a context index allocating unit 111a, a transform coefficient decoding unit 111b, a context variable managing unit 111c, and a context index changing unit 111d.
  • the context index allocation unit 111a allocates a context index ctxIdx to each frequency component according to the position of the frequency component in the frequency domain. More specifically, the context index assigning unit 111a assigns a context index ctxIdx determined by the following expression to the frequency component specified by PosX and PosY.
  • ctdIdx ((PosX >> shift) ⁇ 2) + (PosX >> shift)
  • the symbol “>>” represents a right bit shift operation
  • the symbol “ ⁇ ” represents a left bit shift operation.
  • FIG. 42 (a) is a diagram showing an example of the context index ctxIdx assigned by the context index assigning unit 111a to each frequency component when the frequency region to be processed is 4 ⁇ 4 components.
  • FIG. 42B is a diagram illustrating an example of the context index ctxIdx allocated by the context index allocation unit 111a for each frequency component when the frequency region to be processed is an 8 ⁇ 8 component. is there.
  • the context index ctxIdx is individually assigned to each frequency component.
  • the context index ctxIdx is assigned to each adjacent 2 ⁇ 2 component.
  • context index ctxIdx illustrated in FIGS. 42A to 42B may be used when decoding any one of various syntaxes sig_flag, last_flag, abs_greater_one, coeff_abs_level, and sign described later. (The same applies to context indexes exemplified in other drawings).
  • the specific context index allocated by the context index allocation unit 111a may differ depending on the type of syntax to be decoded. Therefore, the context index allocation unit 111a expresses that each syntax in the target frequency domain is allocated with a context index determined according to the type of syntax and the position of the syntax in the target frequency domain. be able to.
  • the context index ctxIdx for each frequency component illustrated in FIGS. 42A to 42B may be an increment value from the offset of the context index set for each frequency region to be processed (others) The same applies to the context index illustrated in the drawing).
  • the context index offset set for the frequency region to be processed is 200
  • ctxIdx 201 is assigned to the frequency component (1, 0) in FIG. The same applies to other frequency components.
  • transform coefficient decoding unit 111b refers to the context index ctxIdx assigned to the target frequency component that is the frequency component to be processed, and decodes various syntaxes sig_flag, last_flag, abs_greater_one, coeff_abs_level, and sign for the target frequency component . Also, transform coefficients Coeff (PosX, PosY) for each frequency component are generated from the decoded syntax.
  • the transform coefficient decoding unit 111b supplies the decoded syntax sig_flag (PosX, PosY) to the context index changing unit 111d.
  • the transform coefficient decoding unit 111b generates multi-value data for each syntax by performing binary arithmetic code decoding processing and multi-value processing for each syntax to be decoded.
  • the binary arithmetic code decoding process is a process of decoding encoded data regarding the syntax to be decoded included in the quantized residual information QD into binary data.
  • the transform coefficient decoding unit 111b derives a context index ctxIdx assigned to the frequency domain (PosX, PosY) to be processed.
  • the context variable CV specified by the context index ctxIdx is acquired from the context variable management unit 111c.
  • the context variable CV includes (1) a dominant symbol MPS (most probable symbol) having a high occurrence probability, and (2) a probability state index pStateIdx for designating the occurrence probability of the dominant symbol MPS.
  • the transform coefficient decoding unit 111b performs the arithmetic decoding according to the occurrence probability specified by the probability state index pStateIdx included in the acquired context variable CV, thereby converting the encoded data about the syntax to be decoded into binary data. Decrypt.
  • the dominant symbol MPS is 0 or 1.
  • the dominant symbol MPS and the probability state index pStateIdx are updated by the context variable management unit 111c every time one symbol is decoded.
  • the multi-value process is a process for converting binary data decoded by the binary arithmetic code decoding process into multi-value data. By performing multi-value processing for each syntax, multi-value data for each syntax is generated.
  • the transform coefficient decoding unit 111b performs binary arithmetic code decoding processing and multi-value processing of various syntaxes on the frequency components (PosX, PosY) to be processed in accordance with the scan order described later, and is generated by multi-value processing. Conversion coefficients Coeff (PosX, PosY) are generated from the multivalued data for the various syntaxes.
  • FIG. 43 (a) is a diagram for explaining a scan line in each scan.
  • scanning of each frequency component is performed along each scanning line indicated by a broken line in FIG.
  • the scan is performed along the scan line (L + 1) after the scan is performed along the scan line (L).
  • FIG. 43B is a diagram showing the scan order of each frequency component by the zigzag scan.
  • the scan in the zigzag scan, from the low frequency side to the high frequency side, the scan to the lower left direction (also referred to as BottomLeft or DownLeft) and the upper right direction (also referred to as TopRight or UpRight)
  • the scanning for each frequency component is performed by alternately repeating the scanning to the above. That is, the scan direction is reversed between the scan line (L) and the scan line (L + 1).
  • the numbers assigned to the frequency components represent the scan order of the frequency components in the zigzag scan.
  • the scan order for each frequency component to be decoded is determined according to the bias of the appearance frequency of the non-zero transform coefficient. . More specifically, the scan direction in the scan line (L + 1) is determined according to the bias in the appearance frequency of non-zero transform coefficients decoded from the scan line (0) to the scan line (L).
  • FIG. 43C shows an example of the scan order of the adaptive scan.
  • FIG. 44 is a flowchart showing a flow of adaptive scan processing performed by the transform coefficient decoding unit 111b.
  • Step S101 the transform coefficient decoding unit 111b initializes the scan direction by setting the scan direction scanDirection to BottomLeft (lower left direction). Note that the scan direction scanDirection initialized in this step is applied to the scan line (1).
  • Step S102 the transform coefficient decoding unit 111b sets variables PosX and PosY along the scan line (L) to be processed.
  • Step S103 Subsequently, the transform coefficient decoding unit 111b decodes the syntax sig_flag for the frequency component specified by PosX and PosY set in step S102.
  • Step S104 the transform coefficient decoding unit 111b determines whether or not the value of the syntax sig_flag decoded in step S103 is non-zero.
  • Step S105 When the value of the syntax sig_flag is non-zero (Yes in Step S104), the variable length code decoding unit 11 determines whether PosX> PosY.
  • Step S106 If PosX> PosY (Yes in step S105), the transform coefficient decoding unit 111b adds 1 to the variable scanTopRight.
  • the variable scanTopRight is a variable representing the frequency of appearance of non-zero transform coefficients for frequency components satisfying PosX> PosY.
  • the shaded area in FIG. 45A indicates an area for counting the variable scanTopRight.
  • Step S107 If PosX> PosY is not satisfied (No in step S105), the transform coefficient decoding unit 111b determines whether PosY> PosX.
  • Step S108 If PosY> PosX (Yes in step S107), the transform coefficient decoding unit 111b adds 1 to the variable scanBottomLeft.
  • the variable scanBottomLeft is a variable representing the frequency of occurrence of non-zero conversion coefficients for frequency components satisfying PosX ⁇ PosY.
  • the shaded area in FIG. 45 (b) indicates an area where the variable scanBottomLeft is counted.
  • Step S109 Subsequently, the transform coefficient decoding unit 111b decodes the syntax last_flag for the frequency component to be decoded.
  • Step S110 the transform coefficient decoding unit 111b determines whether or not the value of the syntax last_flag decoded in step S109 is 1. If the value of the syntax last_flag is 1, the process ends.
  • Step S111 When the value of syntax sig_flag is not non-zero (that is, when the value of syntax sig_flag is 0) (No in step S104), or when the value of syntax last_flag is not 1 (No in step S110), conversion
  • the coefficient decoding unit 111b determines whether PosX and PosY for the target frequency component correspond to the folding position in the frequency domain.
  • that the target frequency component is the turn-back position indicates a case where the following condition is satisfied.
  • Step S112 When PosX and PosY for the target frequency component correspond to the return position in the frequency domain (Yes in step S111), the transform coefficient decoding unit 111b determines whether scanTopRight ⁇ scanBottomLeft.
  • Step S113 If scanTopRight ⁇ scanBottomLeft (Yes in step S112), the scan direction scanDirection for the next scan line in the processing order is set to BottomLeft. After the scan direction scanDirection for the next scan line in the processing order is set to BottomLeft, the process returns to step S102, and along the next scan line in the processing order and the scan direction is BottomLeft, PosX and PosY Is set.
  • Step S114 If scanTopRight ⁇ scanBottomLeft is not satisfied (No in step S112), the scan direction scanDirection for the next scan line in the processing order is set to TopRight. After the scan direction scanDirection for the next scan line in the processing order is set to TopRight, the process returns to step S102, and along the next scan line in the processing order and with the scan direction as TopRight, PosX and PosY Is set.
  • the scan direction in the scan line (L + 1) is determined according to the bias in the appearance frequency of the non-zero transform coefficients decoded from the scan line (0) to the scan line (L).
  • the present embodiment is not limited to this.
  • the scan in the scan line (L + 1) according to the bias of the appearance frequency of non-zero transform coefficients decoded along the scan line (L).
  • the direction may be determined. That is, the scanTopRight and scanBottomLeft may be initialized for each scan line.
  • the context variable management unit 111c manages the context variable CV corresponding to each context.
  • Each context variable CV is stored in a memory provided in the context variable management unit 111c.
  • Each context variable CV includes (1) a dominant symbol MPS (most probable symbol) having a high occurrence probability, and (2) a probability state index pStateIdx designating the occurrence probability of the dominant symbol MPS.
  • Each context variable CV is specified by a context index ctxIdx.
  • the context variable CV specified by the context index ctxIdx is also expressed as CV (ctxIdx).
  • the context variable management unit 111c updates the probability state index pStateIdx every time the transform coefficient decoding unit 111b decodes one symbol. By updating the probability state index pStateIdx, the occurrence probability specified by the probability state index pStateIdx changes.
  • decoding is performed according to the probability of symbol occurrence.
  • the probability that the next decoded symbol is 1 is also high, and the probability of occurrence of the decoded value (probability) Updates adaptively to increase the state index (pStateIdx).
  • the context (probability state index pStateIdx) used for each frequency component is switched. In this way, the conditional probability that the occurrence probability differs depending on the condition such as the frequency component is used.
  • the context index changing unit 111d refers to the syntax sig_flag (PosX, PosY) supplied from the transform coefficient decoding unit 111b, determines the non-uniform distribution of transform coefficients in the frequency domain, and according to the determination result, A context index assigned to an undecoded component in the frequency domain is changed.
  • Context index change processing example 1 Below, the 1st specific example of the context index change process by the context index change part 111d is demonstrated.
  • the context index changing unit 111d refers to the decoded syntax sig_flag at a stage where a predetermined number of syntaxes sig_flag for frequency components on the low frequency side are decoded, and sets non-zero in the frequency domain. The bias of the distribution of the conversion coefficient is determined. Further, the context index assigned to the undecoded component is changed according to the determination result.
  • the context index changing unit 111d for example, the syntax sig_flag supplied from the transform coefficient decoding unit 111b for the hatched component in FIG. Refer to the syntax sig_flag for frequency components (0, 0), (0, 1), (0, 2), (1, 0), (1, 1), (2, 0), and their frequencies
  • the distribution bias of the non-zero transform coefficient for the component is determined.
  • the context index changing unit 111d refers to the syntax sig_flag for the frequency components along the scan line (0) to the scan line (2), and distributes non-zero transform coefficients for those frequency components. Judge the bias.
  • FIG. 47 is a flowchart showing a specific processing flow of the context index changing unit 111d in this processing example.
  • Step S201 The context index changing unit 111d first sets variables PosX and PosY.
  • the variables PosX and PosY are sequentially set according to a predetermined scan order (the above-described zigzag scan or adaptive scan) from the low frequency side of the frequency region to be processed.
  • Step S202 the context index changing unit 111d determines whether or not the value of the syntax sig_flag for the frequency component specified by PosX and PosY is non-zero.
  • the syntax sig_flag to be determined in this step is supplied from the transform coefficient decoding unit 111b.
  • Step S203 When the value of the syntax sig_flag is non-zero (Yes in step S104), the context index changing unit 111d determines whether PosX> PosY.
  • Step S204 If PosX> PosY (Yes in step S203), the context index changing unit 111d adds 1 to the variable coeffTopRight and proceeds to the process of step S207.
  • the variable coeffTopRight is a variable representing the frequency of appearance of non-zero transform coefficients for frequency components satisfying PosX> PosY.
  • Step S205 If PosX> PosY is not satisfied (No in step S203), the context index changing unit 111d determines whether PosY> PosX. If PosY> PosX, the process proceeds to step S207.
  • Step S206 If PosY> PosX (Yes in step S205), the context index changing unit 111d adds 1 to the variable coeffBottomLeft and proceeds to the process of step S207.
  • the variable coeffBottomLeft is a variable representing the frequency of occurrence of non-zero transform coefficients for frequency components satisfying PosX ⁇ PosY.
  • Step S207 the context index changing unit 111d determines whether or not processing for a predetermined number of components has been completed.
  • the predetermined number may be 6 or 10 as shown in FIG. If the processing for the predetermined number of components has not been completed, the process returns to step S201, and PosX and PosY for the next component are set in the processing order.
  • Step S208 When the processing for the predetermined number of components is completed (Yes in step S207), the context index changing unit 111d determines whether coeffBottomLeft> coeffTopRight. If coeffBottomLeft ⁇ coeffTopRight, the process ends without changing the context index. In other words, if the number of non-zero transform coefficients in the region satisfying PosX> PosY is equal to or greater than the number of non-zero transform coefficients in the region satisfying PosY> PosX, the process is terminated without changing the context index. To do.
  • FIG. 46B is a diagram illustrating an example of a context index that has been allocated by the context index allocation unit 111a and has not been changed when the frequency domain to be processed is an 8 ⁇ 8 component. .
  • Step S209 When coeffBottomLeft> coeffTopRight (Yes in step S208), the context index changing unit 111d changes the context index ctxIdx for the undecoded component in the frequency domain. That is, when the number of non-zero transform coefficients in a region satisfying PosY> PosX is larger than the number of non-zero transform coefficients in a region satisfying PosX> PosY, the context index ctxIdx for an undecoded component in the frequency domain To change.
  • FIG. 46C is a diagram illustrating an example of the context index changed in this step when the frequency domain to be processed is an 8 ⁇ 8 component.
  • the context index ctxIdx is changed when coeffBottomLeft> coeffTopRight, but the opposite configuration, that is, the context index ctxIdx is changed when coeffBottomLeft ⁇ coeffTopRight, and otherwise.
  • a configuration in which no change is made may be used.
  • FIG. 48 is a sequence diagram illustrating an example of a cooperative operation between the context index changing unit 111d that performs the operation of this processing example and the transform coefficient decoding unit 111b.
  • Step S301 The transform coefficient decoding unit 111b decodes transform coefficients along the scan line (0) to the scan line (2). Further, the decoded syntax sig_flag for each frequency component along those scan lines is supplied to the context index changing unit 111d. In FIG. 48, a set of decoded syntax sig_flag for each frequency component along the scan line (0) to the scan line (2) is expressed as sig_flag (0) to (2).
  • the context index changing unit 111d refers to the value of the decoded syntax sig_flag supplied from the transform coefficient decoding unit 111b, and performs non-zero conversion on frequency components along the scan line (0) to the scan line (2). Judge the distribution of coefficients.
  • the context index changing unit 111d determines the context index for the undecoded frequency component in accordance with the non-zero transform coefficient distribution bias for the frequency component along the scan line (0) to the scan line (2). To change. Also, the changed context index ctxIdx ′ is supplied to the transform coefficient decoding unit 111b.
  • Step S304 The transform coefficient decoding unit 111b decodes transform coefficients for undecoded frequency components using the changed context index ctxIdx ′ supplied from the context index changing unit 111d.
  • the context index changing unit 111d changes the context index for the undecoded syntax in accordance with the bias of the non-zero transform coefficient distribution in the frequency domain.
  • Each syntax can be decoded using an appropriate probability of occurrence.
  • the determination of the non-zero transform coefficient distribution in the frequency domain and the change of the context index are performed for each scan line.
  • FIG. 49 is a flowchart showing a specific processing flow of the context index changing unit 111d in this processing example. As shown in FIG. 49, in this processing example, steps S201, S207, and S209 for the above-described (context index change processing example 1) are replaced with steps S401, S407, and S409 described below, respectively.
  • Step S401 The context index changing unit 111d sequentially sets variables PosX and PosY along the scan lines (0) to (L).
  • Step S407 The context index changing unit 111d determines whether or not the processing for the scan lines (0) to (L) has been completed.
  • Step S409 When coeffBottomLeft> coeffTopRight (Yes in step S208), the context index changing unit 111d changes the context index ctxIdx for the frequency component along the scan line (L + 1).
  • FIG. 50 is a diagram for explaining the present processing example when the frequency domain to be processed is 4 ⁇ 4 components. As shown in FIG. 50A, for example, according to the values of coeffBottomLeft and coeffTopRight calculated along the scan line (0) to the scan line (2), for each frequency component along the scan line (3). The context index ctxIdx of is changed.
  • FIG. 50 (b) shows an example of the context index assigned to each frequency component along the scan line (0) to the scan line (3) by the context index assigning unit 111a.
  • An example of the context index changed by the context index changing unit 111d according to the values of coeffBottomLeft and coeffTopRight calculated along the scan line (0) to the scan line (2) is shown.
  • the context index ctxIdx (PosX, PosY) allocated along the scan line (3) by the context index allocation unit 111a is converted into ctxIdx (PosY, PosX) by the context index change unit 111d. Changed to
  • FIG. 51 is a diagram for explaining the present processing example when the frequency region to be processed is an 8 ⁇ 8 component. As shown in FIG. 51A, for example, for each frequency component along the scan line (4) according to the values of coeffBottomLeft and coeffTopRight calculated along the scan line (0) to the scan line (3). The context index ctxIdx of is changed.
  • FIG. 51 (b) shows an example of the context index assigned to the frequency components along the scan lines (0) to (4) by the context index assigning unit 111a.
  • FIG. The example of the context index changed by the index change part 111d is shown.
  • the context index ctxIdx (PosX, PosY) allocated along the scan line (L + 1) by the context index allocation unit 111a is converted into ctxIdx (PosY, PosX) by the context index change unit 111d.
  • Changed to In other words, if the context index for the frequency components (PosX, PosY) and changed by the context index changing unit 111d is expressed as ctxIdx ′ (PosX, PosY), ctxIdx ′ (PosX, PosY) ctxIdx (PosY, PosX) Is satisfied.
  • the scan direction in the scan line (L + 1) is determined according to the values of scanTopRight and scanBottomLeft calculated along the scan line (0) to the scan line (L) is taken as an example.
  • the present embodiment is not limited to this, and the scan direction in the scan line (L + 1) may be determined according to the values of scanTopRight and scanBottomLeft calculated along the scan line (L). . That is, the scanTopRight and scanBottomLeft may be initialized for each scan line.
  • the scanTopRight and scanBottomLeft may be initialized every time a predetermined number (for example, two) of scan lines are scanned.
  • a predetermined number for example, two
  • the context index assigned to the frequency component along the scan line (L + 1) is changed according to the scanTopRight and scanBottomLeft accumulated by scanning the scan line (L-1) and the scan line (L). It is good also as composition to do.
  • the context index allocated to the frequency components along the scan lines (0) to (2) is not changed, and the scan line ( 3) It is preferable to change the context index assigned to the frequency components along the subsequent scan lines.
  • the context index assigning unit 111a assigns the frequency components (0, 3), (1, 2), (2, 1), (3, 0) along the scan line (3).
  • An example of the context index is shown, and
  • FIG. 52C shows an example of the context index changed by the context index changing unit 111d.
  • FIG. 53 is a sequence diagram illustrating an example of a cooperative operation between the context index changing unit 111d that performs the operation of the present processing example and the transform coefficient decoding unit 111b.
  • Step S501 The transform coefficient decoding unit 111b decodes transform coefficients along the scan line (0) to the scan line (2). Further, the decoded syntax sig_flag for each frequency component along those scan lines is supplied to the context index changing unit 111d.
  • a set of decoded syntax sig_flag for each frequency component along scan line (0) to scan line (2) is denoted as sig_flag (0) to (2) (the same applies hereinafter).
  • the context index changing unit 111d refers to the value of the decoded syntax sig_flag supplied from the transform coefficient decoding unit 111b, and performs non-zero conversion on frequency components along the scan line (0) to the scan line (2). Judge the distribution of coefficients.
  • Step S503 the context index changing unit 111d determines whether the non-zero transform coefficient distribution for the frequency components along the scan line (0) to the scan line (2) is unbalanced along the scan line (3). Change the context index for the frequency component of decoding. Also, the changed context index ctxIdx ′ is supplied to the transform coefficient decoding unit 111b.
  • ctxIdx ′ (3) a set of changed context indexes for undecoded frequency components along the scan line (3) (the same applies hereinafter).
  • Step S504 The transform coefficient decoding unit 111b decodes transform coefficients for undecoded frequency components along the scanline (3) using the changed context index ctxIdx ′ supplied from the context index changing unit 111d. Also, the decoded syntax sig_flag for each frequency component along the scan line (3) is supplied to the context index changing unit 111d.
  • the context index changing unit 111d refers to the value of the decoded syntax sig_flag supplied from the transform coefficient decoding unit 111b, and performs non-zero conversion on frequency components along the scan lines (0) to (3). Judge the distribution of coefficients.
  • Step S506 the context index changing unit 111d applies the non-decoded frequency component along the scan line (4) according to the non-zero transform coefficient distribution for the frequency component along the scan line (3). Change the context index. Also, the changed context index ctxIdx ′ is supplied to the transform coefficient decoding unit 111b.
  • Step S507 The transform coefficient decoding unit 111b decodes transform coefficients for undecoded frequency components along the scan line (4) using the changed context index ctxIdx ′ supplied from the context index changing unit 111d. Also, the decoded syntax sig_flag for each frequency component along the scan line (4) is supplied to the context index changing unit 111d.
  • the context index changing unit 111d refers to the value of the decoded syntax sig_flag supplied from the transform coefficient decoding unit 111b, and performs non-zero conversion on frequency components along the scan lines (0) to (4). Judge the distribution of coefficients.
  • the transform coefficient decoding unit 111b can perform decoding of each syntax using a more appropriate occurrence probability.
  • the transform coefficient decoding unit 111b supplies sig_flag to the context index change unit 111d, and the context index change unit 111d receives sig_flag.
  • the configuration for determining the distribution bias of non-zero conversion coefficients has been described with reference to FIG. 5, but the present embodiment is not limited to this.
  • the transform coefficient decoding unit 111b supplies the variables scanBottomLeft and scanTopRight to the context index changing unit 111d, and the context index changing unit 111d compares the value of the variable scanBottomLeft with the value of the variable scanTopRight.
  • a configuration may be used in which the deviation of the distribution of the conversion coefficient of 0 is determined.
  • scanBottomLeft> scanTopRight the context index ctxIdx for an undecoded component in the frequency domain is changed.
  • the processing amount by the context index changing unit 111d can be reduced.
  • the processing amount by the context index changing unit 111d can be reduced.
  • the context index changing unit 111d may be configured to limit the frequency component that is the target of changing the text index, and to change the context index only for the frequency component at a predetermined (PosX, PosY).
  • the context index can be changed for the hatched frequency components, but the context index is not changed for the other frequency components. The same applies to the case where the frequency region to be processed is an 8 ⁇ 8 component.
  • the encoding efficiency may not be improved as expected.
  • a diagonal edge exists in the processing target block
  • the encoding efficiency can be improved while reducing the processing amount.
  • the context index can be changed for the hatched frequency component, but the context index is not changed for the other frequency components. The same applies to the case where the frequency region to be processed is an 8 ⁇ 8 component.
  • the context index changing unit 111d performs the context index ctxIdx (PosX, PosY) for the undecoded frequency component in accordance with the bias of the distribution of the decoded non-zero transform coefficients in the frequency domain to be processed.
  • ctxIdx ′ (PosX, PosY) ctxIdx (PosY, PosX)
  • the method of changing the context index in the present embodiment is not limited to this example.
  • the context index changing unit 111d determines the context group ctxgroup by comparing coeffTopRight and coeffBottomLeft. Specifically, the context index changing unit 111d determines the context group ctxgroup as follows.
  • the context index changing unit 111d determines a context index ctxIdx (PosX, PosY) for the frequency components (PosX, PosY) by the following formula.
  • FIG. 55A is determined by the context index changing unit 111d when coeffTopRight ⁇ 2 ⁇ coeffBottomLeft and 2 ⁇ coeffTopRight> coeffBottomLeft, that is, when there is almost no bias in the decoded non-zero transform coefficients.
  • FIG. 55B shows a context index determined by the context index changing unit 111d when coeffTopRight ⁇ 2 ⁇ coeffBottomLeft, that is, when decoded non-zero transform coefficients are biased in the horizontal direction. It is.
  • 55C is a diagram showing a context index determined by the context index changing unit 111d when 2 ⁇ coeffTopRight ⁇ coeffBottomLeft, that is, when decoded non-zero transform coefficients are biased in the vertical direction. It is.
  • the context index assigning unit 111a assigns the context index shown in FIG. 55 (a) to each frequency component in the frequency domain to be processed
  • the context index changing unit 111d assigns to the undecoded frequency domain.
  • the obtained context index is changed to the context index shown in FIG. 55 (b) or 55 (c) according to the bias of the decoded non-zero transform coefficient.
  • ⁇ Modification 5> a configuration in which different sets of context indexes are used for a case where the distribution of decoded non-zero transform coefficients is biased and a case where the distribution of decoded non-zero transform coefficients is almost biased Further, if the distribution of the decoded non-zero transform coefficients is biased, the context index is set according to whether the decoded non-zero transform coefficients are biased in the horizontal direction or the vertical direction. It is good also as a structure to replace.
  • the context index changing unit 111d first determines the context group ctxgroup and the replacement index swap by comparing coeffTopRight and coeffBottomLeft. Specifically, the context index changing unit 111d determines the context group ctxgroup and the replacement index swap as follows.
  • the context index changing unit 111d determines a context index ctxIdx (PosX, PosY) for the frequency components (PosX, PosY) by the following formula.
  • FIG. 56A is determined by the context index changing unit 111d when coeffTopRight ⁇ 2 ⁇ coeffBottomLeft and 2 ⁇ coeffTopRight> coeffBottomLeft, that is, when there is almost no bias in the decoded non-zero transform coefficients.
  • FIG. 56A is determined by the context index changing unit 111d when coeffTopRight ⁇ 2 ⁇ coeffBottomLeft and 2 ⁇ coeffTopRight> coeffBottomLeft, that is, when there is almost no bias in the decoded non-zero transform coefficients.
  • FIG. 56B is a diagram showing a context index determined by the context index changing unit 111d when coeffTopRight ⁇ 2 ⁇ coeffBottomLeft, that is, when decoded non-zero transform coefficients are biased in the horizontal direction. It is.
  • FIG. 56C is a diagram showing the context index determined by the context index changing unit 111d when 2 ⁇ coeffTopRight ⁇ coeffBottomLeft, that is, when the decoded non-zero transform coefficient is biased in the vertical direction. It is.
  • the context index assigning unit 111a assigns the context index shown in FIG. 56 (a) to each frequency component in the frequency domain to be processed
  • the context index changing unit 111d assigns to the undecoded frequency domain.
  • the obtained context index is changed to the context index shown in FIG. 56 (b) or 56 (c) according to the bias of the decoded non-zero transform coefficient.
  • the context index changing unit 111d when the index indicating the bias of the distribution of the decoded non-zero transform coefficient in the frequency domain to be processed is larger than a predetermined threshold, It can also be expressed as changing the context index assigned to the undecoded syntax in the region.
  • the context index changing unit 111d according to the present modification can be considered to change the context index as shown in FIG. 56B when the index R is 0 or more. .
  • the context index changing unit 111d may be considered to change the context index as shown in FIG. 56 (c). it can.
  • the context index changing unit 111d calculates, as coeffTopRight, the number of non-zero transform coefficients that have been decoded for frequency components that satisfy PosX> PosY, and the non-zero that has been decoded for frequency components that satisfy PosX ⁇ PosY.
  • the configuration for calculating the number of transform coefficients as coeffBottomLeft has been described, the present embodiment is not limited to this.
  • the number of conversion coefficients may be calculated as coeffBottomLeft.
  • FIG. 57 is a diagram illustrating frequency components referred to by the context index changing unit 111d according to the present modification for calculating coeffTopRight and coeffBottomLeft.
  • a frequency component with a diagonal line rising to the right is referred to calculate coeffTopRight
  • a frequency component with a diagonal line to the right is referred to calculate coeffBottomLeft.
  • the context index changing unit 111d adopts the configuration of the present modification, thereby preventing a reduction in encoding efficiency due to an estimation error of the non-zero transform coefficient distribution.
  • the context index changing unit 111d calculates, as coeffTopRight, a weighted average of absolute values of transform coefficients that have been decoded for frequency components that satisfy PosX> PosY, and an absolute value of transform coefficients that have been decoded for frequency components that satisfy PosX ⁇ PosY. It is good also as a structure which calculates the weighted average of as coeffBottomLeft.
  • the context index changing unit 111d may be configured to calculate coeffTopRight and coeffBottomLeft using the following equations (2) and (3), respectively.
  • ⁇ in Equation (2) is a decoded transform coefficient and represents the sum of transform coefficients satisfying PosX> PosY
  • ⁇ in Equation (3) is a decoded transform coefficient.
  • is a symbol representing an absolute value.
  • the weighting factor w (PosX, PosY) may be set so as to more effectively prevent a decrease in coding efficiency due to an estimation error in the non-zero transform coefficient distribution bias. it can.
  • Equations (2) and (3) instead of
  • the data structure of the encoded data of the present invention has the following characteristics. That is, a data structure of encoded data obtained by arithmetically encoding one or a plurality of types of syntax representing the conversion coefficient for each conversion coefficient obtained by frequency-converting the original image for each unit region.
  • the one or more types of syntax include a flag indicating whether or not the transform coefficient is 0, and the arithmetic decoding apparatus that decodes the encoded data has a target corresponding to the unit area to be processed.
  • a context index determined according to the type of syntax and the position of the syntax in the target frequency domain is assigned, and each syntax in the target frequency domain is assigned to the syntax.
  • Sequential arithmetic decoding based on the probability state specified by the assigned context index Rutotomoni, depending on the deviation of the distribution of restored the flag in the target frequency range, changes the context index allocated to the syntax of the undecoded in the subject frequency range, is characterized in that.
  • a context complexity flag indicating whether or not to change the context index assigned to the undecoded syntax in the target frequency domain according to the distribution of each syntax distribution in the target frequency domain.
  • the context complexity flag is 0 indicating low complexity, the context index is not changed due to the distribution bias.
  • the context complexity flag is 1 indicating high complexity, the context index is determined due to the distribution bias. Make changes.
  • the context complexity flag may be included in the picture header PH or the slice header SH shown in FIG. Also, information different from the picture header PH and the slice header SH, for example, H. It may be included in a picture parameter set or a sequence parameter set in H.264.
  • the context complexity flag is decoded by a header decoding unit or a parameter set decoding unit (not shown) in the variable length code decoding unit 11 and transmitted to the quantization residual information decoding unit 111.
  • the context complexity flag is 0 indicating low complexity, the operation of the context index changing unit 111d is not performed.
  • the context complexity flag is 1 indicating high complexity, the operation of the context index changing unit 111d is not performed.
  • the complexity of the context allocation unit can be controlled by switching the context allocation method using the context complexity flag.
  • the context complexity flag is low complexity, it is possible to reduce the amount of switching processing common to all the modified examples.
  • the context complexity flag is high complexity, higher decoding efficiency can be realized than when the flag is low complexity.
  • the moving picture encoding apparatus 2 includes H.264 as a part thereof.
  • KTA software which is a codec for joint development in AVC and VCEG (Video Coding Expert Group)
  • TMuC Traffic Model under Consideration
  • FIG. 58 is a block diagram showing a configuration of the moving picture encoding apparatus 2.
  • the moving image encoding device 2 includes a predicted image generation unit 21, a transform / quantization unit 22, an inverse quantization / inverse transform unit 23, an adder 24, a frame memory 25, a loop filter 26, a variable A long code encoding unit 27 and a subtracter 28 are provided.
  • the prediction image generation unit 21 includes an intra prediction image generation unit 21a, a motion vector detection unit 21b, an inter prediction image generation unit 21c, a prediction method control unit 21d, and a motion vector redundancy deletion unit. 21e.
  • the moving image encoding device 2 is a device that generates encoded data # 1 by encoding moving image # 10 (encoding target image).
  • the predicted image generation unit 21 recursively divides the processing target LCU into one or a plurality of lower-order CUs, further divides each leaf CU into one or a plurality of partitions, and uses an inter-screen prediction for each partition.
  • a predicted image Pred_Inter or an intra predicted image Pred_Intra using intra prediction is generated.
  • the generated inter prediction image Pred_Inter and intra prediction image Pred_Intra are supplied to the adder 24 and the subtracter 28 as the prediction image Pred.
  • the prediction image generation unit 21 omits encoding of other parameters belonging to the PU for the PU to which the skip mode is applied. Also, (1) the mode of division into lower CUs and partitions in the target LCU, (2) whether to apply the skip mode, and (3) which of the inter predicted image Pred_Inter and the intra predicted image Pred_Intra for each partition Whether to generate is determined so as to optimize the encoding efficiency.
  • the intra predicted image generation unit 21a generates a predicted image Pred_Intra for each partition by intra prediction. Specifically, (1) a prediction mode used for intra prediction is selected for each partition, and (2) a prediction image Pred_Intra is generated from the decoded image P using the selected prediction mode. The intra predicted image generation unit 21a supplies the generated intra predicted image Pred_Intra to the prediction method control unit 21d.
  • the intra predicted image generation unit 21a determines an estimated prediction mode for the target partition from the prediction modes assigned to the peripheral partitions of the target partition, and the estimated prediction mode and the prediction mode actually selected for the target partition Are supplied as a part of the intra prediction parameter PP_Intra to the variable length code encoding unit 27 via the prediction scheme control unit 21d, and the variable length code encoding unit 27 The flag is included in the encoded data # 1.
  • the intra predicted image generation unit 21a sets the residual prediction mode index RIPM indicating the prediction mode for the target partition. , And supplied as a part of the intra prediction parameter PP_Intra to the variable length code encoding unit 27 via the prediction scheme control unit 21d, and the variable length code encoding unit 27 is included in the residual prediction mode index encoded data # 1 And
  • the motion vector detection unit 21b detects a motion vector mv regarding each partition. Specifically, (1) by selecting an adaptive filtered decoded image P_ALF ′ used as a reference image, and (2) by searching for a region that best approximates the target partition in the selected adaptive filtered decoded image P_ALF ′, A motion vector mv related to the target partition is detected.
  • the adaptive filtered decoded image P_ALF ′ is an image obtained by performing an adaptive filter process by the loop filter 26 on a decoded image that has already been decoded for the entire frame, and is a motion vector detection unit.
  • the unit 21b can read out the pixel value of each pixel constituting the adaptive filtered decoded image P_ALF ′ from the frame memory 25.
  • the motion vector detection unit 21b sends the detected motion vector mv to the inter-predicted image generation unit 21c and the motion vector redundancy deletion unit 21e together with the reference image index RI designating the adaptive filtered decoded image P_ALF ′ used as a reference image. Supply.
  • the inter prediction image generation unit 21c generates a motion compensated image mc related to each inter prediction partition by inter-screen prediction. Specifically, using the motion vector mv supplied from the motion vector detection unit 21b, the motion compensated image mc from the adaptive filtered decoded image P_ALF ′ designated by the reference image index RI supplied from the motion vector detection unit 21b. Is generated. Similar to the motion vector detection unit 21b, the inter prediction image generation unit 21c can read out the pixel value of each pixel constituting the adaptive filtered decoded image P_ALF ′ from the frame memory 25. The inter prediction image generation unit 21c supplies the generated motion compensated image mc (inter prediction image Pred_Inter) together with the reference image index RI supplied from the motion vector detection unit 21b to the prediction method control unit 21d.
  • inter prediction image Pred_Inter inter prediction image Pred_Inter
  • the prediction scheme control unit 21d compares the intra predicted image Pred_Intra and the inter predicted image Pred_Inter with the encoding target image, and selects whether to perform intra prediction or inter prediction.
  • the prediction scheme control unit 21d supplies the intra prediction image Pred_Intra as the prediction image Pred to the adder 24 and the subtracter 28, and sets the intra prediction parameter PP_Intra supplied from the intra prediction image generation unit 21a. This is supplied to the variable length code encoding unit 27.
  • the prediction scheme control unit 21d supplies the inter prediction image Pred_Inter as the prediction image Pred to the adder 24 and the subtracter 28, and the reference image index RI and motion vector redundancy described later.
  • the estimated motion vector index PMVI and the motion vector residual MVD supplied from the deletion unit 21e are supplied to the variable length code encoding unit 27 as an inter prediction parameter PP_Inter.
  • the prediction scheme control unit 21 d supplies the prediction type information PT indicating which prediction image is selected from the intra prediction image Pred_Intra and the inter prediction image Pred_Inter to the variable length code encoding unit 27.
  • the motion vector redundancy deletion unit 21e deletes redundancy in the motion vector mv detected by the motion vector detection unit 21b. Specifically, (1) an estimation method used for estimating the motion vector mv is selected, (2) an estimated motion vector pmv is derived according to the selected estimation method, and (3) the estimated motion vector pmv is subtracted from the motion vector mv. As a result, a motion vector residual MVD is generated. The motion vector redundancy deleting unit 21e supplies the generated motion vector residual MVD to the prediction method control unit 21d together with the estimated motion vector index PMVI indicating the selected estimation method.
  • the transform / quantization unit 22 performs (1) DCT transform (Discrete Cosine Transform) for each block (transform unit) on the prediction residual D obtained by subtracting the predicted image Pred from the encoding target image, and (2) obtains the DCT transform.
  • the obtained transform coefficient Coeff_IQ is quantized, and (3) the transform coefficient Coeff obtained by the quantization is supplied to the variable length code encoding unit 27 and the inverse quantization / inverse transform unit 23.
  • the transform / quantization unit 22 (1) selects a quantization step QP to be used for quantization for each TU, and (2) sets a quantization parameter difference ⁇ qp indicating the size of the selected quantization step QP.
  • the variable length code encoding unit 28 is supplied, and (3) the selected quantization step QP is supplied to the inverse quantization / inverse transform unit 23.
  • the difference value obtained by subtracting the value of '.
  • the DCT transform performed by the transform / quantization unit 22 is, for example, when transforming coefficients before quantization for the horizontal frequency u and the vertical frequency v when the size of the target block is 8 ⁇ 8 pixels.
  • Coeff_IQ (u, v) (0 ⁇ u ⁇ 7, 0 ⁇ v ⁇ 7), for example, is given by the following mathematical formula (4).
  • D (i, j) (0 ⁇ i ⁇ 7, 0 ⁇ j ⁇ 7) represents the prediction residual D at the position (i, j) in the target block.
  • C (u) and C (v) are given as follows.
  • the inverse quantization / inverse transform unit 23 (1) inversely quantizes the quantized transform coefficient Coeff, and (2) performs inverse DCT (Discrete Cosine Transform) transform on the transform coefficient Coeff_IQ obtained by inverse quantization. 3) The prediction residual D obtained by the inverse DCT transform is supplied to the adder 24.
  • inverse DCT Discrete Cosine Transform
  • the quantization step QP supplied from the transform / quantization unit 22 is used.
  • the prediction residual D output from the inverse quantization / inverse transform unit 23 is obtained by adding a quantization error to the prediction residual D input to the transform / quantization unit 22.
  • Common names are used for this purpose.
  • a more specific operation of the inverse quantization / inverse transform unit 23 is substantially the same as that of the inverse quantization / inverse transform unit 13 included in the video decoding device 1.
  • the adder 24 adds the predicted image Pred selected by the prediction scheme control unit 21d to the prediction residual D generated by the inverse quantization / inverse transform unit 23, thereby obtaining the (local) decoded image P. Generate.
  • the (local) decoded image P generated by the adder 24 is supplied to the loop filter 26 and stored in the frame memory 25, and is used as a reference image in intra prediction.
  • variable-length code encoding unit 27 (Variable-length code encoding unit 27) The variable length code encoding unit 27 (1) the quantized transform coefficient Coeff and ⁇ qp supplied from the transform / quantization unit 22, and (2) the quantization parameter PP (interpolation) supplied from the prediction scheme control unit 21d. Prediction parameter PP_Inter and intra prediction parameter PP_Intra), (3) Prediction type information, and (4) Encoding data # 1 is generated by variable-length encoding the filter parameter FP supplied from the loop filter 26. To do.
  • FIG. 59 is a block diagram showing a configuration of the variable-length code encoding unit 27.
  • the variable-length code encoding unit 27 includes a quantization residual information encoding unit 271 that encodes the quantized transform coefficient Coeff, and a prediction parameter encoding unit 272 that encodes the prediction parameter PP.
  • a prediction type information encoding unit 273 that encodes the prediction type information
  • a filter parameter encoding unit 274 that encodes the filter parameter FP. Since the specific configuration of the quantization residual information encoding unit 271 will be described later, the description thereof is omitted here.
  • the subtracter 28 generates the prediction residual D by subtracting the prediction image Pred selected by the prediction method control unit 21d from the encoding target image.
  • the prediction residual D generated by the subtracter 28 is DCT transformed / quantized by the transform / quantization unit 22.
  • the loop filter 26 includes (1) a function as a deblocking filter (DF: Deblocking Filter) that performs smoothing (deblocking processing) on an image around a block boundary or partition boundary in the decoded image P; It has a function as an adaptive filter (ALF: Adaptive Loop Filter) which performs an adaptive filter process using the filter parameter FP with respect to the image which the blocking filter acted on.
  • DF Deblocking Filter
  • ALF Adaptive Loop Filter
  • Quantization residual information encoding unit 271 The quantization residual information encoding unit 271 generates quantization residual information QD by performing context adaptive binary arithmetic coding (CABAC) on the transform coefficient Coeff.
  • CABAC context adaptive binary arithmetic coding
  • FIG. 60 is a block diagram illustrating a configuration of the quantization residual information encoding unit 271.
  • the quantization residual information encoding unit 271 includes a context index allocation unit 271a, a transform coefficient encoding unit 271b, a context variable management unit 271c, and a context index change unit 271d.
  • Context index allocation unit 271a The context index assigning unit 271a performs each frequency component in the frequency domain to be processed. A context index ctxIdx is assigned according to the position of the frequency component in the frequency domain.
  • the specific operation of the context index allocating unit 271a is the same as that of the context index allocating unit 111a included in the video decoding device 1, and thus the description thereof is omitted here.
  • the context variable management unit 271c manages the context variable CV corresponding to each context.
  • the context variable CV managed by the context variable management unit 271c includes (1) a dominant symbol MPS (most probable symbol) having a high occurrence probability, and (2) a probability state index pStateIdx that specifies the occurrence probability of the dominant symbol MPS. Is included.
  • Each context variable CV is specified by a context index ctxIdx.
  • the context variable management unit 271c updates the occurrence probability specified by the probability state index pStateIdx every time the transform coefficient encoding unit 271b encodes one symbol.
  • the transform coefficient encoding unit 271b refers to the context index ctxIdx assigned to the target frequency component that is the frequency component to be processed, and encodes the transform coefficient Coeff (PosX, PosY) for the target frequency component, thereby Encoded data for the syntax sig_flag, last_flag, abs_greater_one, coeff_abs_level, and sign is generated.
  • the transform coefficient encoding unit 271b supplies the syntax sig_flag (PosX, PosY) to the context index changing unit 271d.
  • Encoding process of various syntaxes A process for generating encoded data for various syntaxes sig_flag, last_flag, abs_greater_one, coeff_abs_level, and sign by the transform coefficient encoding unit 271b will be described.
  • the transform coefficient encoding unit 271b generates encoded data for each syntax by performing binarization processing and binary arithmetic code encoding processing on each syntax to be encoded.
  • Binary processing is processing that converts input multi-value data into binary data. By performing binarization processing for each syntax, binary data for each syntax is generated.
  • Binary arithmetic code encoding processing is processing for arithmetically encoding binary data for each syntax.
  • the transform coefficient encoding unit 271b refers to the context index ctxIdx (PosX, PosY) assigned to the frequency domain to be processed when encoding one symbol (1 bit of binary data, also referred to as Bin),
  • the context variable CV (ctxIdx) specified by the context index is acquired from the context variable management unit 271c.
  • the transform coefficient encoding unit 271b performs binary encoding on the syntax to be encoded by performing arithmetic encoding according to the occurrence probability specified by the probability state index pStateIdx included in the acquired context variable CV (ctxIdx).
  • the encoded data is encoded, and encoded data for the syntax to be encoded is generated.
  • the occurrence probability specified by the probability state index pStateIdx is updated by the context variable management unit 271c every time one symbol is encoded.
  • the scan order of each frequency component by the transform coefficient encoding unit 271b is substantially the same as that described in (Scan order of each frequency component by the transform coefficient decoding unit 111b). However, “decoding” in (scan order of each frequency component by the transform coefficient decoding unit 111b) is read as “encoding”.
  • the context index changing unit 111d refers to the syntax sig_flag (PosX, PosY) supplied from the transform coefficient encoding unit 271b, determines the bias of the non-zero transform coefficient distribution in the frequency domain, and depends on the determination result , Change the context index allocated for the uncoded components in the frequency domain.
  • the context index changing process by the context index changing unit 271d is the same as (context index changing process example 1) and (context index changing process example 2) by the context index changing unit 111d, and thus description thereof is omitted here. Further, the context index changing unit 271d may be configured to perform the same processing as in ⁇ Modification 1> to ⁇ Modification 7> described for the context index changing unit 111d. However, “decoding” in (context index change processing example 1), (context index change processing example 2) and ⁇ variation 1> to ⁇ variation 7> is read as “encoding”.
  • the moving picture decoding apparatus 1 of the present configuration also has a context indicating whether or not to change a context index assigned to the syntax of an uncoded component in the target frequency domain in accordance with the distribution of each syntax in the target frequency domain.
  • the complexity flag can be encoded.
  • the context complexity flag is encoded by being included in the picture header PH or the slice header SH shown in FIG. Information different from the picture header PH and the slice header SH, for example, H.264. Similarly to H.264, when a picture parameter set or a sequence parameter set is encoded, the parameter encoded there may have a meaning of a context complexity flag.
  • the context complexity flag is determined and encoded by a header encoding unit or a parameter set encoding unit (not shown) in the variable length code encoding unit 27.
  • the context complexity flag to be encoded is transmitted to the quantization residual information encoding unit 271.
  • the context index changing unit 271d does not perform the changing operation.
  • 1 indicating high complexity
  • the changing operation is performed.
  • the complexity is low and the coding efficiency is low.
  • the complexity is high and the efficiency is high. Therefore, according to the configuration including the context complexity flag, the balance between the complexity and the encoding efficiency can be selected.
  • Each block of the moving picture decoding apparatus 1 and the moving picture encoding apparatus 2 described above may be realized in hardware by a logic circuit formed on an integrated circuit (IC chip), or may be a CPU (Central Processing Unit). ) May be implemented in software.
  • IC chip integrated circuit
  • CPU Central Processing Unit
  • each device includes a CPU that executes instructions of a program that realizes each function, a ROM (Read (Memory) that stores the program, a RAM (Random Memory) that expands the program, the program, and various types
  • a storage device such as a memory for storing data is provided.
  • An object of the present invention is to provide a recording medium in which a program code (execution format program, intermediate code program, source program) of a control program of each of the above devices, which is software that realizes the above-described functions, is recorded so as to be readable by a computer. This can also be achieved by supplying to each of the above devices and reading and executing the program code recorded on the recording medium by the computer (or CPU or MPU).
  • Examples of the recording medium include tapes such as magnetic tapes and cassette tapes, magnetic disks such as floppy (registered trademark) disks / hard disks, and disks including optical disks such as CD-ROM / MO / MD / DVD / CD-R.
  • IC cards including memory cards
  • semiconductor memories such as mask ROM / EPROM / EEPROM / flash ROM, or PLD (Programmable logic device) or FPGA (Field Programmable Gate Array) Logic circuits can be used.
  • each of the above devices may be configured to be connectable to a communication network, and the program code may be supplied via the communication network.
  • the communication network is not particularly limited as long as it can transmit the program code.
  • the Internet intranet, extranet, LAN, ISDN, VAN, CATV communication network, virtual private network (Virtual Private Network), telephone line network, mobile communication network, satellite communication network, etc. can be used.
  • the transmission medium constituting the communication network may be any medium that can transmit the program code, and is not limited to a specific configuration or type.
  • wired lines such as IEEE 1394, USB, power line carrier, cable TV line, telephone line, ADSL (Asymmetric Digital Subscriber Line) line, infrared rays such as IrDA and remote control, Bluetooth (registered trademark), IEEE 802.11 wireless, HDR ( It can also be used by wireless such as High Data Rate, NFC (Near Field Communication), DLNA (Digital Living Network Alliance), mobile phone network, satellite line, and terrestrial digital network.
  • wired lines such as IEEE 1394, USB, power line carrier, cable TV line, telephone line, ADSL (Asymmetric Digital Subscriber Line) line, infrared rays such as IrDA and remote control, Bluetooth (registered trademark), IEEE 802.11 wireless, HDR ( It can also be used by wireless such as High Data Rate, NFC (Near Field Communication), DLNA (Digital Living Network Alliance), mobile phone network, satellite line, and terrestrial digital network.
  • wired lines such as IEEE 1394, USB, power line carrier, cable TV line, telephone line, ADSL (Asymmetric Digital Subscriber Line) line,
  • the moving picture decoding apparatus 1 includes the quantization residual information decoding unit 111.
  • the quantized residual information decoding unit 111 includes a context index allocating unit 111a that allocates a context index to each syntax in the target frequency domain, and a context allocated to each syntax in the target frequency domain.
  • a transform coefficient decoding unit 111b that sequentially performs arithmetic decoding based on the probability state specified by the index and restores each transform coefficient from each decoded syntax, and a distribution of restored non-zero transform coefficients in the target frequency domain
  • a context index changing unit 111d that changes a context index assigned to an undecoded syntax in the target frequency domain according to the bias.
  • the present invention can also be expressed as follows. That is, the arithmetic decoding device according to the present invention is obtained by arithmetically encoding one or a plurality of types of syntax representing the transform coefficient for each transform coefficient obtained by frequency transforming the target image for each unit region.
  • An arithmetic decoding apparatus for decoding encoded data wherein each syntax in a target frequency domain corresponding to a unit area to be processed has a type of syntax and a position of the syntax in the target frequency domain.
  • Context index allocating means for allocating a context index determined in accordance with the syntax decoding, and sequentially decoding each syntax in the target frequency domain based on a probability state specified by the context index allocated to the syntax Means and the syntax decoding means Therefore, the transform coefficient restoring means for restoring each transform coefficient from each decoded syntax, and the undecoded syntax in the target frequency domain according to the distribution of the restored non-zero transform coefficient in the target frequency domain And a context index changing means for changing a context index to be allocated.
  • the context index allocating unit is responsive to each syntax in the target frequency domain according to the type of syntax and the position of the syntax in the target frequency domain. Assign a context index.
  • the context index changing means changes a context index assigned to an undecoded syntax in the target frequency domain according to a bias of a distribution of decoded non-zero transform coefficients in the target frequency domain, and
  • the decoding means decodes the undecoded syntax based on the probability state specified by the changed context index assigned to the undecoded syntax.
  • each syntax representing a transform coefficient can be coded based on an appropriate probability state. Even in a different case, encoded data having high encoding efficiency can be generated.
  • the unit area corresponds to, for example, a TU (conversion unit) in TMuC (Test (under Consideration) or a block obtained by dividing the TU.
  • the context index assigned to the undecoded syntax by the context index assigning means is represented as ctxIdx (u, v).
  • the context index allocation unit when the distribution of the decoded non-zero transform coefficients in the target frequency domain is biased in a predetermined direction between the horizontal direction and the vertical direction, the context index allocation unit performs the above
  • the context index assigned to the undecoded syntax is changed to a context index obtained by replacing the argument of the context index.
  • the syntax of each transform coefficient distributed with a bias in the predetermined direction is used when each transform coefficient is distributed with a bias in a direction other than the predetermined direction. It can be decoded using the context index used.
  • the syntax of each transform coefficient distributed with a bias in the vertical direction is used, and the context index used when each transform coefficient is distributed with a bias in the horizontal direction. Can be used to decrypt.
  • each syntax is based on an appropriate probability state corresponding to the bias. Can be decrypted. For this reason, according to said structure, even if it is a case where the bias
  • the context index changing unit is configured to detect an undecoded symbol in the target frequency domain when an index indicating the distribution bias of the decoded non-zero transform coefficient in the target frequency domain is larger than a predetermined threshold.
  • the context index assigned to the tax is changed.
  • the context index changing unit is configured to detect the target frequency domain when an index representing the distribution deviation of the decoded non-zero transform coefficient in the target frequency domain is larger than a predetermined threshold. Since the context index assigned to the undecoded syntax is changed, each syntax can be decoded without being affected by the estimation error of the non-zero transform coefficient distribution bias that may occur when the index is small. it can.
  • each syntax can be encoded without being affected by the estimation error of the non-zero transform coefficient distribution bias. Encoded data having efficiency can be generated.
  • the context index changing means is a syntax in which at least one of a horizontal coordinate and a vertical coordinate in the target frequency region is not more than a predetermined threshold among undecoded syntaxes in the target frequency region.
  • the context index assigned to the tax is changed.
  • the inventor as for the syntax in which both the horizontal coordinate and the vertical coordinate in the target frequency domain are larger than the predetermined threshold, even if the context index is changed, the encoding efficiency is as expected. The knowledge that there is a case where it does not improve is obtained.
  • the context index changing unit is configured such that, of the undecoded syntax in the target frequency domain, both the horizontal coordinate and the vertical coordinate in the target frequency domain are the predetermined threshold values. Since the context index assigned to a larger syntax is not changed, the coding efficiency can be improved while reducing the processing amount.
  • the one or more types of syntax include a first flag indicating whether or not the transform coefficient is 0, and the context index changing means includes the undecoded first flag in the target frequency domain. It is preferable that the context index to be assigned is changed.
  • the code amount of the first flag can be reduced.
  • the first flag corresponds to a flag sig_flag used in, for example, TMuC (Test Model Consideration).
  • the one or more types of syntax include a second flag indicating whether or not it is the last transform coefficient in the processing order, and the context index changing means performs undecoding in the target frequency domain. It is preferable that the context index assigned to the second flag is changed.
  • the code amount of the second flag can be reduced.
  • the second flag corresponds to the flag last_flag used in, for example, TMuC (Test Model under Consideration).
  • An image decoding apparatus includes the arithmetic decoding apparatus, an inverse frequency converting unit that generates a residual image by performing inverse frequency conversion on a transform coefficient decoded by the arithmetic decoding apparatus, and the inverse frequency transform. And a decoded image generating means for generating a decoded image by adding the residual image generated by the means and the predicted image predicted from the generated decoded image.
  • the arithmetic coding apparatus encodes each transform coefficient obtained by frequency-transforming the target image for each unit region by arithmetically coding one or more kinds of syntax representing the transform coefficient.
  • An arithmetic coding apparatus for generating coded data wherein each syntax representing each transform coefficient in a target frequency region corresponding to a unit region to be processed has a syntax type and a target frequency of the syntax Context index allocating means for allocating a context index determined according to a position in a region, and each syntax in the target frequency region is sequentially arithmetic code based on a probability state specified by the context index allocated to the syntax
  • syntax encoding means for generating the target circumference
  • the context index changing means for changing a context index allocated to uncoded syntax in the subject frequency range, it is configured to include.
  • the context index allocating unit determines, for each syntax in the target frequency domain, the type of syntax and the position of the syntax in the target frequency domain. Assign a context index that is determined accordingly.
  • the context index changing means changes a context index assigned to an uncoded syntax in the target frequency domain according to a bias in a distribution of encoded non-zero transform coefficients in the target frequency domain, and
  • the tax encoding means encodes the uncoded syntax based on the probability state specified by the changed context index assigned to the undecoded syntax.
  • the arithmetic coding apparatus configured as described above, it is possible to appropriately encode an uncoded syntax in accordance with the distribution of the distribution of coded non-zero transform coefficients in the target frequency domain.
  • a random state can be specified and the uncoded syntax can be encoded based on the appropriate probability state.
  • encoded data having high encoding efficiency can be generated.
  • the image coding apparatus includes a transform coefficient generating unit that generates a transform coefficient by frequency-converting a residual image between a coding target image and a predicted image for each unit region, and the arithmetic coding device.
  • the arithmetic encoding device generates encoded data by arithmetically encoding one or a plurality of types of syntax representing the transform coefficient generated by the transform coefficient generating means. .
  • the calculation encoding device generates a transform coefficient generated by frequency-converting the residual image between the encoding target image and the prediction image for each unit region. Since encoding is performed, encoded data with high encoding efficiency can be generated.
  • the data structure of the encoded data according to the present invention is such that, for each transform coefficient obtained by frequency transforming the original image for each unit region, one or more kinds of syntax representing the transform coefficient are arithmetically encoded.
  • the one or more types of syntax includes a flag indicating whether or not a transform coefficient is 0, and arithmetic decoding is performed to decode the encoded data.
  • the apparatus assigns, to each syntax in the target frequency domain corresponding to the unit area to be processed, a context index determined according to the type of the syntax and the position of the syntax in the target frequency domain, and the target frequency Each syntax in the region is indicated by the context index assigned to that syntax. With successively arithmetic decoding based on the probability state which is in accordance with the deviation of the distribution of restored the flag in the target frequency range, it changes the context index allocated to the syntax of the undecoded in the subject frequency range.
  • the arithmetic decoding device that decodes the encoded data configured as described above is configured to assign a context to an undecoded syntax in the target frequency domain according to a bias of a distribution of the restored flag in the target frequency domain. Since the index is changed, the decoding process is performed using an appropriate probability state for decoding the undecoded syntax.
  • the arithmetic coding device that generates the coded data is substantially the same as the arithmetic decoding device, in accordance with the distribution of the distribution of the flag that has been coded in the target frequency region. It is preferable to change the context index assigned to the syntax. Since the encoded data generated by such an arithmetic encoding device is generated using an appropriate probability state, it is encoded data with high encoding efficiency.
  • the above-described moving image encoding device 2 and moving image decoding device 1 can be used by being mounted on various devices that perform transmission, reception, recording, and reproduction of moving images.
  • the moving image may be a natural moving image captured by a camera or the like, or may be an artificial moving image (including CG and GUI) generated by a computer or the like.
  • FIG. 61 (a) is a block diagram showing a configuration of a transmission apparatus PROD_A in which the moving picture encoding apparatus 2 is mounted.
  • the transmission device PROD_A modulates a carrier wave with an encoding unit PROD_A1 that obtains encoded data by encoding a moving image, and with the encoded data obtained by the encoding unit PROD_A1.
  • a modulation unit PROD_A2 that obtains a modulation signal and a transmission unit PROD_A3 that transmits the modulation signal obtained by the modulation unit PROD_A2 are provided.
  • the moving image encoding apparatus 2 described above is used as the encoding unit PROD_A1.
  • the transmission device PROD_A is a camera PROD_A4 that captures a moving image, a recording medium PROD_A5 that records the moving image, an input terminal PROD_A6 that inputs the moving image from the outside, as a supply source of the moving image input to the encoding unit PROD_A1.
  • An image processing unit A7 that generates or processes an image may be further provided. In FIG. 61A, a configuration in which all of these are provided in the transmission device PROD_A is illustrated, but a part thereof may be omitted.
  • the recording medium PROD_A5 may be a recording of a non-encoded moving image, or a recording of a moving image encoded by a recording encoding scheme different from the transmission encoding scheme. It may be a thing. In the latter case, a decoding unit (not shown) for decoding the encoded data read from the recording medium PROD_A5 according to the recording encoding method may be interposed between the recording medium PROD_A5 and the encoding unit PROD_A1.
  • FIG. 61 (b) is a block diagram showing a configuration of a receiving device PROD_B in which the moving image decoding device 1 is mounted.
  • the receiving device PROD_B includes a receiving unit PROD_B1 that receives a modulated signal, a demodulating unit PROD_B2 that obtains encoded data by demodulating the modulated signal received by the receiving unit PROD_B1, and a demodulator.
  • a decoding unit PROD_B3 that obtains a moving image by decoding the encoded data obtained by the unit PROD_B2.
  • the moving picture decoding apparatus 1 described above is used as the decoding unit PROD_B3.
  • the receiving device PROD_B has a display PROD_B4 for displaying a moving image, a recording medium PROD_B5 for recording the moving image, and an output terminal for outputting the moving image to the outside as a supply destination of the moving image output by the decoding unit PROD_B3.
  • PROD_B6 may be further provided.
  • FIG. 61 (b) a configuration in which all of these are provided in the receiving device PROD_B is illustrated, but a part thereof may be omitted.
  • the recording medium PROD_B5 may be used for recording a non-encoded moving image, or may be encoded using a recording encoding method different from the transmission encoding method. May be. In the latter case, an encoding unit (not shown) for encoding the moving image acquired from the decoding unit PROD_B3 according to the recording encoding method may be interposed between the decoding unit PROD_B3 and the recording medium PROD_B5.
  • the transmission medium for transmitting the modulation signal may be wireless or wired.
  • the transmission mode for transmitting the modulated signal may be broadcasting (here, a transmission mode in which the transmission destination is not specified in advance) or communication (here, transmission in which the transmission destination is specified in advance). Refers to the embodiment). That is, the transmission of the modulation signal may be realized by any of wireless broadcasting, wired broadcasting, wireless communication, and wired communication.
  • a terrestrial digital broadcast broadcasting station (broadcasting equipment or the like) / receiving station (such as a television receiver) is an example of a transmitting device PROD_A / receiving device PROD_B that transmits and receives a modulated signal by wireless broadcasting.
  • a broadcasting station (such as broadcasting equipment) / receiving station (such as a television receiver) of cable television broadcasting is an example of a transmitting device PROD_A / receiving device PROD_B that transmits and receives a modulated signal by cable broadcasting.
  • a server workstation etc.
  • Client television receiver, personal computer, smart phone etc.
  • VOD Video On Demand
  • video sharing service using the Internet is a transmitting device for transmitting and receiving modulated signals by communication.
  • PROD_A / reception device PROD_B usually, either a wireless or wired transmission medium is used in a LAN, and a wired transmission medium is used in a WAN.
  • the personal computer includes a desktop PC, a laptop PC, and a tablet PC.
  • the smartphone also includes a multi-function mobile phone terminal.
  • the video sharing service client has a function of encoding a moving image captured by the camera and uploading it to the server. That is, the client of the video sharing service functions as both the transmission device PROD_A and the reception device PROD_B.
  • FIG. 62 (a) is a block diagram showing a configuration of a recording apparatus PROD_C in which the above-described moving picture encoding apparatus 2 is mounted.
  • the recording apparatus PROD_C includes an encoding unit PROD_C1 that obtains encoded data by encoding a moving image, and the encoded data obtained by the encoding unit PROD_C1 on the recording medium PROD_M.
  • a writing unit PROD_C2 for writing.
  • the moving image encoding apparatus 2 described above is used as the encoding unit PROD_C1.
  • the recording medium PROD_M may be of a type built in the recording device PROD_C, such as (1) HDD (Hard Disk Drive) or SSD (Solid State Drive), or (2) SD memory. It may be of the type connected to the recording device PROD_C, such as a card or USB (Universal Serial Bus) flash memory, or (3) DVD (Digital Versatile Disc) or BD (Blu-ray Disc: registration) Or a drive device (not shown) built in the recording device PROD_C.
  • HDD Hard Disk Drive
  • SSD Solid State Drive
  • SD memory such as a card or USB (Universal Serial Bus) flash memory, or (3) DVD (Digital Versatile Disc) or BD (Blu-ray Disc: registration) Or a drive device (not shown) built in the recording device PROD_C.
  • the recording device PROD_C is a camera PROD_C3 that captures moving images as a supply source of moving images to be input to the encoding unit PROD_C1, an input terminal PROD_C4 for inputting moving images from the outside, and reception for receiving moving images.
  • the unit PROD_C5 and an image processing unit C6 that generates or processes an image may be further provided.
  • 62A illustrates the configuration in which the recording apparatus PROD_C includes all of these, a part of the configuration may be omitted.
  • the receiving unit PROD_C5 may receive a non-encoded moving image, or may receive encoded data encoded by a transmission encoding scheme different from the recording encoding scheme. You may do. In the latter case, a transmission decoding unit (not shown) that decodes encoded data encoded by the transmission encoding method may be interposed between the reception unit PROD_C5 and the encoding unit PROD_C1.
  • Examples of such a recording device PROD_C include a DVD recorder, a BD recorder, and an HDD (Hard Disk Drive) recorder (in this case, the input terminal PROD_C4 or the receiving unit PROD_C5 is a main supply source of moving images).
  • a camcorder in this case, the camera PROD_C3 is a main source of moving images
  • a personal computer in this case, the receiving unit PROD_C5 or the image processing unit C6 is a main source of moving images
  • a smartphone in this case In this case, the camera PROD_C3 or the receiving unit PROD_C5 is a main supply source of moving images
  • the camera PROD_C3 or the receiving unit PROD_C5 is a main supply source of moving images
  • FIG. 62 (b) is a block diagram showing the configuration of the playback device PROD_D in which the above-described video decoding device 1 is mounted.
  • the playback device PROD_D reads a moving image by decoding a read unit PROD_D1 that reads encoded data written to the recording medium PROD_M and a coded data read by the read unit PROD_D1. And a decoding unit PROD_D2 to be obtained.
  • the moving picture decoding apparatus 1 described above is used as the decoding unit PROD_D2.
  • the recording medium PROD_M may be of the type built into the playback device PROD_D, such as (1) HDD or SSD, or (2) such as an SD memory card or USB flash memory, It may be of a type connected to the playback device PROD_D, or (3) may be loaded into a drive device (not shown) built in the playback device PROD_D, such as DVD or BD. Good.
  • the playback device PROD_D has a display PROD_D3 that displays a moving image, an output terminal PROD_D4 that outputs the moving image to the outside, and a transmission unit that transmits the moving image as a supply destination of the moving image output by the decoding unit PROD_D2.
  • PROD_D5 may be further provided.
  • FIG. 62B illustrates a configuration in which the playback apparatus PROD_D includes all of these, but a part of the configuration may be omitted.
  • the transmission unit PROD_D5 may transmit an unencoded moving image, or transmits encoded data encoded by a transmission encoding method different from the recording encoding method. You may do. In the latter case, it is preferable to interpose an encoding unit (not shown) that encodes a moving image with an encoding method for transmission between the decoding unit PROD_D2 and the transmission unit PROD_D5.
  • Examples of such a playback device PROD_D include a DVD player, a BD player, and an HDD player (in this case, an output terminal PROD_D4 to which a television receiver or the like is connected is a main supply destination of moving images).
  • a television receiver in this case, the display PROD_D3 is a main supply destination of moving images
  • a digital signage also referred to as an electronic signboard or an electronic bulletin board
  • the display PROD_D3 or the transmission unit PROD_D5 is the main supply of moving images.
  • Desktop PC (in this case, the output terminal PROD_D4 or the transmission unit PROD_D5 is the main video image supply destination), laptop or tablet PC (in this case, the display PROD_D3 or the transmission unit PROD_D5 is a moving image)
  • a smartphone which is a main image supply destination
  • a smartphone in this case, the display PROD_D3 or the transmission unit PROD_D5 is a main moving image supply destination
  • the like are also examples of such a playback device PROD_D.
  • the LCU (Largest Coding Unit) in each of the above embodiments is H.264. It corresponds to the root of a coding tree (Coding Tree) of HEVC (High Efficiency Video Coding) proposed as a successor to H.264 / MPEG-4 AVC, and a leaf CU is a CU (Coding Unit, coding) It is also called the leaf of the tree).
  • PU and TU in each said embodiment are respectively equivalent to the prediction tree (Prediction Tree) and transformation tree (transform tree) in HEVC.
  • the partition of PU in the said embodiment is corresponded to PU (Prediction Unit) in HEVC.
  • a block obtained by dividing a TU corresponds to a TU (Transformation Unit) in HEVC.
  • the present invention can be suitably applied to a decoding device that decodes encoded data and an encoding device that generates encoded data. Further, the present invention can be suitably applied to the data structure of encoded data generated by the encoding device and referenced by the decoding device.
  • Embodiment 1-1 1 video decoding device (image decoding device) 121 Last coefficient decoding unit (last coefficient position detecting means) 122 Position determination unit (position determination means, distance determination means) 123 Two-stage decoding unit (two-stage decoding means) 125 Last two coefficient decoding units (non-zero coefficient position detecting means) 2 Video encoding device (image encoding device) 310 Last coefficient detection unit (last coefficient position detection means) 320 Position determination unit (position determination means) 330 Two-stage encoding unit (two-stage encoding means) C10 Coefficient encoded data (Data structure of encoded data) LT Last coefficient (last non-zero coefficient) MX10 Coefficient matrix R10, R30, R50, R70 First target range (position determination range) TBL11, TBL21 VLC table for linear scanning (variable length code table) ⁇ Embodiment 2 >> 1 video decoding device (image decoding device) 11 variable length code decoding unit 111 quantization residual information decoding unit (arithmetic decoding device)

Landscapes

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

Abstract

A video decoding device (1) comprises: a final-coefficient decoding unit (121) for detecting, in reverse scan order in a coefficient matrix (MX10), the position of the final coefficient; a position determination unit (122) for determining whether or not, in the coefficient matrix (MX10), the final coefficient is positioned in the first row containing DC coefficient DC; and a two-step decoding unit (123) for, in a case where the position of the final coefficient is in the first row, performing decoding of the coefficient matrix (MX10) separately for the first row and rows other than the first row.

Description

画像復号装置、画像符号化装置、および符号化データのデータ構造、ならびに、算術復号装置、算術符号化装置Image decoding device, image encoding device, data structure of encoded data, arithmetic decoding device, arithmetic encoding device
 本発明は係数行列を復号する画像復号装置、係数行列を符号化する画像符号化装置、および係数行列が符号化された符号化データのデータ構造に関する。また、本発明は、算術符号化された符号化データを復号する算術復号装置、および、そのような算術復号装置を備えている画像復号装置に関する。また、算術符号化された符号化データを生成する算術符号化装置、および、そのような算術符号化装置を備えている画像符号化装置に関する。 The present invention relates to an image decoding apparatus for decoding a coefficient matrix, an image encoding apparatus for encoding a coefficient matrix, and a data structure of encoded data obtained by encoding the coefficient matrix. The present invention also relates to an arithmetic decoding device that decodes encoded data that has been arithmetically encoded, and an image decoding device that includes such an arithmetic decoding device. The present invention also relates to an arithmetic encoding device that generates encoded data that has been arithmetically encoded, and an image encoding device that includes such an arithmetic encoding device.
 動画像を効率的に伝送または記録するために、動画像を符号化することによって符号化データを生成する動画像符号化装置、および、当該符号化データを復号することによって復号画像を生成する動画像復号装置が用いられている。 In order to efficiently transmit or record a moving image, a moving image encoding device that generates encoded data by encoding the moving image, and a moving image that generates a decoded image by decoding the encoded data An image decoding device is used.
 具体的な動画像符号化方式としては、例えば、H.264/MPEG-4.AVC(非特許文献1、2)、および、VCEG(Video Coding Expert Group)における共同開発用コーデックであるKTAソフトウェアに採用されている方式、および、その後継コーデックであるTMuC(Test Model under Consideration)ソフトウェアに採用されている方式などが挙げられる(非特許文献3)。 Specific examples of the moving image encoding method include H.264. H.264 / MPEG-4. A method adopted in KTA software which is a codec for joint development in AVC (Non-patent Documents 1 and 2) and VCEG (Video Coding Expert Group), and TMuC (Test Model Under Consationation) software which is a successor codec (Non-Patent Document 3).
 これらの動画像符号化方式においては、原画像から予測画像を差し引いた予測残差を変換し、さらに量子化した変換係数を符号化して符号化データを生成する。 In these moving image encoding systems, a prediction residual obtained by subtracting a prediction image from an original image is converted, and further, quantized conversion coefficients are encoded to generate encoded data.
 この予測残差の変換係数は、符号化データの大部分を占める。より具体的には、エンコード設定や、画像の特性にも依存するが、符号化データの50~80%が変換係数に関する情報であるといわれている。このため、変換係数を効率よく符号化することが望まれている。 The conversion coefficient of this prediction residual occupies most of the encoded data. More specifically, although it depends on encoding settings and image characteristics, it is said that 50 to 80% of the encoded data is information related to the transform coefficient. For this reason, it is desired to efficiently encode the transform coefficient.
 変換係数は、所定サイズの2次元行列の形式で表される。この行列の各要素を所定の順序がスキャンされて1次元配列に格納されたうえで、変換係数の符号化が行われる。 The conversion coefficient is expressed in the form of a two-dimensional matrix of a predetermined size. Each element of this matrix is scanned in a predetermined order and stored in a one-dimensional array, and then transform coefficients are encoded.
 例えば、H.264/AVCでは、変換係数の値の相関が有効に利用できるように、スキャン順が考慮されており、変換係数は、いわゆるジグザグスキャンによって1次元配列に格納される(非特許文献1、2)。そして、H.264/AVCでは、可変長符号化方式の一つとしてCAVLC(Context-Adaptive Variable Length Coding;コンテキスト適応型可変長符号化)を採用している。なお、H.264/AVCでは、他にもCABAC(Context-Adaptive Binary Arithmetic Coding;コンテキスト適応型2値算術符号化)という可変長符号化方式も採用している。 For example, H. In H.264 / AVC, the scan order is taken into consideration so that the correlation between the values of transform coefficients can be used effectively, and the transform coefficients are stored in a one-dimensional array by so-called zigzag scanning (Non-Patent Documents 1 and 2). . And H. In H.264 / AVC, CAVLC (Context-Adaptive Variable Length Coding) is adopted as one of the variable length coding methods. H. In H.264 / AVC, a variable length coding method called CABAC (Context-AdaptiveAdBinary Arithmetic Coding) is also employed.
 CAVLCでは、各変換係数の絶対値(level)や正負(sign)、係数0(非ゼロ係数とも称する)の連なり(0ラン;zero run)に基づいて可変長符号化を行う。さらにいえば、CAVLCでは、ランとレベルの符号化については、それぞれに対応したVLC(Variable Length Coding)テーブルを用いる。また、非ゼロ係数の個数(TotalCoeff)と、最後に連続する絶対値1の係数の個数(TrailingOnes)の符号化の際には、周囲のブロックの状況に応じて、複数のVLCテーブルのうちの1つが、適応的に選択されて符号化が行われる。 In CAVLC, variable length coding is performed based on a series (0 run; zero run) of absolute values (level), positive / negative (sign), and coefficient 0 (also referred to as non-zero coefficient) of each transform coefficient. Furthermore, in CAVLC, VLC (Variable Length Coding) tables corresponding to the run and level encoding are used. In addition, when encoding the number of non-zero coefficients (TotalCoeff) and the number of coefficients having the last consecutive absolute value 1 (TrailingOnes), among the plurality of VLC tables according to the situation of surrounding blocks, One is adaptively selected and encoded.
 また、TMuC(Test Model under Consideration)では、VLCによる符号化方式について次のような手法が採用されている(非特許文献3)。すなわち、まず、符号化処理において、最後の係数の位置と値とを符号化する。次に、ランモードと呼ばれる手順において、0ランと係数の組を符号化する。このランモードは、レベルの大きな係数が出現する等の所定の条件が満たされるまでの間実行される。ランモードが終了すると、以後、残りの係数を逐次符号化する手順が実行されて、すべての係数が符号化されることにより符号化処理は終了する。 Also, TMuC (Test Model Consideration) employs the following method for the VLC encoding method (Non-Patent Document 3). That is, first, in the encoding process, the position and value of the last coefficient are encoded. Next, in a procedure called a run mode, a set of zero runs and coefficients is encoded. This run mode is executed until a predetermined condition such as the appearance of a coefficient having a large level is satisfied. When the run mode ends, the procedure for sequentially encoding the remaining coefficients is executed, and the encoding process ends when all the coefficients are encoded.
 さらに、補足しておくと次のとおりである。まず、このような符号化方式において、動画像を構成する画像(ピクチャ)は、画像を分割することにより得られるスライス、スライスを分割することにより得られる最大符号化単位(LCU:Largest Coding Unit)、最大符号化単位を分割することにより得られる符号化単位(CU:Coding Unit)、及び、符号化単位を分割することより得られるブロックおよびパーティションからなる階層構造により管理され、多くの場合、ブロックを最小単位として符号化される。 Furthermore, it is as follows to supplement. First, in such an encoding method, an image (picture) constituting a moving image is a slice obtained by dividing the image, and a maximum coding unit (LCU: Largegest Coding Unit) obtained by dividing the slice. The coding unit (CU: Coding Unit) obtained by dividing the maximum coding unit and the hierarchical structure consisting of blocks and partitions obtained by dividing the coding unit are often used. Is encoded as a minimum unit.
 また、上述のとおり、このような符号化方式においては、通常、入力画像を符号化/復号することによって得られる局所復号画像に基づいて予測画像が生成され、当該予測画像と入力画像との差分画像(「残差画像」または「予測残差」と呼ぶこともある)をブロック毎にDCT(Discrete Cosine Transform)変換することによって得られる変換係数が符号化される。 Further, as described above, in such an encoding method, a prediction image is usually generated based on a locally decoded image obtained by encoding / decoding an input image, and the difference between the prediction image and the input image is determined. A transform coefficient obtained by DCT (Discrete Cosine Transform) transform of an image (sometimes referred to as “residual image” or “predictive residual”) is encoded.
 また、上述のとおり、変換係数の具体的な符号化の方式としては、コンテキスト適応型可変長符号化(CALVC:Context-based Adaptive Variable Length Coding)、および、コンテキスト適応型2値算術符号化(CABAC:Context-based Adaptive Binary Arithmetic Coding)が知られている。 As described above, specific coding methods for transform coefficients include context-adaptive variable-length coding (CALVC) and context-adaptive binary arithmetic coding (CABAC). : Context-based (Adaptive (Binary) Arithmetic (Coding)).
 また、上述のとおり、CALVCでは、各変換係数をジグザグスキャンすることによって1次元のベクトルとした後、各変換係数の値を示すシンタックス、および、連続する0の長さ(ランとも呼ぶ)を表すシンタックス等が符号化される。 Further, as described above, in CALVC, each transform coefficient is zigzag scanned into a one-dimensional vector, and then the syntax indicating the value of each transform coefficient and the length of consecutive zeros (also called a run) are used. Representing syntax and the like are encoded.
 CABACでは、変換係数を表す各種のシンタックスに対して2値化処理が施され、この2値化処理によって得られた2値データが算術符号化される。ここで、上記各種のシンタックスとしては、変換係数が0であるか否かを示すフラグsig_flag、および、処理順で最後の変換係数であるか否かを示すフラグlast_flagなどが挙げられる。 In CABAC, binarization processing is performed on various syntaxes representing transform coefficients, and binary data obtained by the binarization processing is arithmetically encoded. Here, examples of the various syntaxes include a flag sig_flag indicating whether or not the conversion coefficient is 0, a flag last_flag indicating whether or not the conversion coefficient is the last conversion coefficient in the processing order, and the like.
 また、CABACでは、シンボル(2値データの1ビット、Binとも呼ぶ)を1つ符号化する際、処理対象の周波数領域に割り付けられたコンテキストインデックスが参照され、当該コンテキストインデックスによって指定されるコンテキスト変数に含まれる確率状態インデックスの指し示す発生確率に応じた算術符号化が行われる。また、確率状態インデックスによって指定される発生確率は、シンボルを1つ符号化する毎に更新される。 In CABAC, when one symbol (1 bit of binary data, also referred to as Bin) is encoded, the context index assigned to the frequency domain to be processed is referred to, and the context variable specified by the context index is used. Is subjected to arithmetic coding according to the occurrence probability indicated by the probability state index included in. The occurrence probability specified by the probability state index is updated every time one symbol is encoded.
 非特許文献3には、処理対象のブロックに対応する周波数領域における各変換係数を表すシンタックスに対して、該変換係数の該周波数領域における位置に応じたコンテキストインデックスを割り付ける技術が開示されている。 Non-Patent Document 3 discloses a technique for assigning a context index corresponding to the position of each transform coefficient in the frequency domain to the syntax representing each transform coefficient in the frequency domain corresponding to the block to be processed. .
 この技術によれば、周波数領域における変換係数の分布が、複数のブロックについて略定常的である場合、例えば、複数のブロックにおけるエッジの方向が略同一であるような場合には、変換係数毎に適切な発生確率を用いた算術符号化を行うことができるため、高い符号化効率が得られる。 According to this technique, when the distribution of transform coefficients in the frequency domain is substantially stationary for a plurality of blocks, for example, when the directions of edges in the plurality of blocks are substantially the same, for each transform coefficient, Since arithmetic encoding using an appropriate occurrence probability can be performed, high encoding efficiency can be obtained.
 しかしながら、従来のVLCによる変換係数の可変長符号化は、次の理由から非効率的なことがある。 However, conventional variable length coding of transform coefficients by VLC may be inefficient for the following reasons.
 まず、従来の変換係数の行列の係数のスキャン方法は、行列上の係数分布によらず一定であった。例えば、スキャン方法として代表的なのは、上述のジグザグスキャンであるが、従来技術では、行列上の係数分布によらずこのジグザグスキャンのみを用いていた。また、このためジグザグスキャン専用のVLCテーブルしか定義されていなかった。 First, the conventional coefficient scanning method for the matrix of transform coefficients is constant regardless of the coefficient distribution on the matrix. For example, a typical scanning method is the above-described zigzag scan, but the conventional technique uses only this zigzag scan regardless of the coefficient distribution on the matrix. For this reason, only a VLC table dedicated to zigzag scanning has been defined.
 よって、行列上の係数分布に偏りがある場合には符号化効率の改善の余地があった。図35を用いて、より具体的な事例を挙げれば次のとおりである。図35は、2次元行列により表される変換係数を、ジグザグスキャンにより1次元配列に格納する場合の例を示している。同図の(a)は、4×4サイズの変換係数のマトリクスMX100をスキャンするときの例を示しており、同図の(b)は、スキャンにより変換係数が格納された1次元配列ARR100の例を示している。 Therefore, there is room for improvement in coding efficiency when the coefficient distribution on the matrix is biased. Using FIG. 35, a more specific example is given as follows. FIG. 35 shows an example in which transform coefficients represented by a two-dimensional matrix are stored in a one-dimensional array by zigzag scanning. (A) of the figure shows an example of scanning the matrix MX100 of 4 × 4 size conversion coefficients, and (b) of the figure shows the one-dimensional array ARR100 in which the conversion coefficients are stored by scanning. An example is shown.
 図35の(a)に示すマトリクスMX100に示す数字は、変換係数の値を表している。マトリクスMX100では、非ゼロ係数が、第1列に偏って分布している。その一方で、ゼロ係数は、マトリクスMX100の右3列に集中して分布している。 35. The numbers shown in the matrix MX100 shown in (a) of FIG. 35 represent the conversion coefficient values. In the matrix MX100, non-zero coefficients are distributed in the first column. On the other hand, the zero coefficients are concentrated and distributed in the right three columns of the matrix MX100.
 また、同図の(a)に示す点線矢印は、マトリクスMX100のスキャン順を表している。つまり、マトリクスMX100左上から点線矢印が示すスキャン順にスキャンが実行されて、図35の(b)に示す1次元配列ARR100に変換係数が格納される。 In addition, the dotted line arrows shown in (a) of the figure represent the scan order of the matrix MX100. That is, scans are executed in the scan order indicated by the dotted arrows from the upper left of the matrix MX100, and the conversion coefficients are stored in the one-dimensional array ARR100 shown in FIG.
 図35の(a)に示すマトリクスMX100では、ゼロ係数が、右3列に集中して分布していたのに、スキャンの実行の結果、図35の(b)に示す1次元配列ARR100では、RUN101およびRUN102に分かれて格納されてしまっている。 In the matrix MX100 shown in (a) of FIG. 35, the zero coefficients are concentrated and distributed in the right three columns. However, in the one-dimensional array ARR100 shown in (b) of FIG. RUN 101 and RUN 102 are stored separately.
 以上のように、変換係数のマトリクスの第1列または第1行など、マトリクスの上端または左端に変換係数が集中した場合、平面的には、集中していたゼロ係数が、スキャンにより得られた1次元配列では分断されてしまうという問題があった。 As described above, when the conversion coefficients are concentrated on the upper end or the left end of the matrix, such as the first column or the first row of the conversion coefficient matrix, the concentrated zero coefficients are obtained by scanning in a plan view. There is a problem that the one-dimensional array is divided.
 本発明は、上記の問題点に鑑みてなされたものであり、その目的は、変換係数の分布に偏りがある場合に符号化効率の向上を図ることができる画像復号装置等を実現することにある。 The present invention has been made in view of the above-described problems, and an object of the present invention is to realize an image decoding apparatus or the like that can improve the encoding efficiency when the distribution of transform coefficients is biased. is there.
 なお、さらに付言すれば、本発明の技術的範囲は、符号化方式に、VLCを適用する場合に限られず、CABACを適用する場合にも及ぶ。その詳細については、後述する。 In addition, in addition, the technical scope of the present invention is not limited to the case where VLC is applied to the encoding method, but extends to the case where CABAC is applied. Details thereof will be described later.
 上記課題を解決するために、本発明に係る画像復号装置は、画像データが符号化された符号化データに含まれる、符号化された量子化変換係数を復号および逆スキャンすることにより係数行列を再現する画像復号装置において、上記係数行列における、上記逆スキャン順上最後の非ゼロ係数の位置を検出する最後の係数位置検出手段と、上記最後の非ゼロ係数の位置が、上記係数行列において、直流成分の係数を含む行または列から所定の行または列までの位置判定範囲にあるか否かを判定する位置判定手段と、上記最後の非ゼロ係数の位置が、上記位置判定範囲にある場合、上記係数行列を、上記最後の非ゼロ係数の位置を含む第1の復号対象範囲と、上記第1の復号対象範囲以外の第2の復号対象範囲とでそれぞれ復号処理する2段階復号手段と、を備えることを特徴とする。 In order to solve the above problems, an image decoding apparatus according to the present invention decodes a coefficient matrix by decoding and inverse scanning encoded quantized transform coefficients included in encoded data obtained by encoding image data. In the image decoding device to be reproduced, the last coefficient position detecting means for detecting the position of the last non-zero coefficient in the reverse scan order in the coefficient matrix, and the position of the last non-zero coefficient in the coefficient matrix, A position determination means for determining whether or not a position determination range from a row or column including a coefficient of a direct current component to a predetermined row or column and the position of the last non-zero coefficient are in the position determination range 2 steps of decoding the coefficient matrix in a first decoding target range including the position of the last non-zero coefficient and a second decoding target range other than the first decoding target range, respectively. Characterized in that it comprises a No. means.
 上記構成において、量子化変換係数とは、画像データの符号化処理において、画像データから予測画像を減じた予測残差を、直交変換し、量子化したものである。また、符号化の対象となるブロックにおける量子化変換係数は、係数行列の形式で表現することができる。 In the above configuration, the quantized transform coefficient is obtained by orthogonally transforming and quantizing the prediction residual obtained by subtracting the predicted image from the image data in the image data encoding process. Also, the quantized transform coefficient in the block to be encoded can be expressed in the form of a coefficient matrix.
 また、符号化された量子化変換係数とは、量子化変換係数により構成される係数行列をスキャンし符号化したものである。係数行列をスキャンするとは、係数行列に含まれる係数を1次元配列に格納することである。 Also, the encoded quantized transform coefficient is obtained by scanning and encoding a coefficient matrix composed of quantized transform coefficients. Scanning the coefficient matrix means storing the coefficients included in the coefficient matrix in a one-dimensional array.
 ここで、逆スキャンとは、復号された係数を係数行列上の対応する位置に配置し直すことである。 Here, reverse scanning is to rearrange the decoded coefficients at corresponding positions on the coefficient matrix.
 また、逆スキャン順とは、逆スキャンが行われる所定の順序のことである。例えば、逆スキャン順には、ジグザグスキャンが採用できる。 The reverse scan order is a predetermined order in which reverse scan is performed. For example, a zigzag scan can be employed in the reverse scan order.
 係数行列における直流成分の係数とは、具体的には、第1行目、第1列目にある係数のことである。さらにいえば、ジグザグスキャンにおいて逆スキャン順が1番目となる係数である。 The DC component coefficient in the coefficient matrix is specifically the coefficient in the first row and the first column. Furthermore, it is a coefficient that makes the reverse scan order first in the zigzag scan.
 また、係数は、直流成分付近の低周波成分においては、値がゼロでない非ゼロ係数である傾向がある。一方、係数は、高周波成分になるにつれて、値がゼロとなるゼロ係数である傾向がある。ジグザグスキャンでは、低周波成分の係数が、高周波成分の係数よりも先に処理されるような順になっている。 Also, the coefficient tends to be a non-zero coefficient whose value is not zero in the low frequency component near the DC component. On the other hand, the coefficient tends to be a zero coefficient whose value becomes zero as it becomes a high frequency component. In the zigzag scan, the low frequency component coefficients are processed in the order in which they are processed before the high frequency component coefficients.
 最後の非ゼロ係数とは、直流成分の係数からみて、逆スキャン順上、最後にくる非ゼロ係数のことである。さらにいえば、最後の非ゼロ係数より後の順にある係数は、すべてゼロ係数である。 The last non-zero coefficient is the last non-zero coefficient in reverse scan order when viewed from the DC component coefficient. Furthermore, all coefficients in order after the last non-zero coefficient are all zero coefficients.
 上記構成によれば、最後の非ゼロ係数の位置が、係数行列の(1)第1行目から所定の行までの位置、または、(2)第1列目から所定の列までの位置にあるかどうかを判定する。 According to the above configuration, the position of the last non-zero coefficient is (1) the position from the first row to the predetermined row or (2) the position from the first column to the predetermined column of the coefficient matrix. Determine if it exists.
 なお、上記(1)および(2)をあわせて位置判定範囲と称している。また、位置判定範囲は、係数行列において、直流成分の係数を含む端部ともいえる。 The above (1) and (2) are collectively referred to as a position determination range. The position determination range can also be said to be an end portion including a coefficient of a direct current component in the coefficient matrix.
 また、上記構成によれば、上記位置判定範囲に、最後の非ゼロ係数の位置がある場合、上記係数行列を、上記最後の非ゼロ係数の位置を含む第1の復号対象範囲と、上記第1の復号対象範囲以外の第2の復号対象範囲とで、2段階で復号処理する。 Further, according to the above configuration, when the position determination range includes the position of the last non-zero coefficient, the coefficient matrix includes the first decoding target range including the position of the last non-zero coefficient, and the first Decoding processing is performed in two stages with a second decoding target range other than the one decoding target range.
 第1の復号対象範囲には、直流成分の係数の位置が含まれていてもよい。よって、復号処理は、例えば、最後の非ゼロ係数の位置を基点に次のとおり行うことができる。まず、第1の復号対象範囲において最後の非ゼロ係数から直流成分の係数までを復号する。その後、第2の復号対象範囲において、第2の復号対象範囲におけるスキャン順上最後の非ゼロ係数から、スキャン順上最初の係数までを復号する。第2の復号対象範囲におけるスキャン順には、上述のジグザグスキャンが適用できる。 The first decoding target range may include the position of the DC component coefficient. Therefore, the decoding process can be performed as follows based on the position of the last non-zero coefficient, for example. First, the first non-zero coefficient to the DC component coefficient are decoded in the first decoding target range. Thereafter, in the second decoding target range, decoding is performed from the last non-zero coefficient in the scanning order in the second decoding target range to the first coefficient in the scanning order. The zigzag scan described above can be applied to the scan order in the second decoding target range.
 ところで、非ゼロ係数は、残差が比較的小さく係数の総数が少ない場合、水平成分または垂直成分に偏ることが多い。例えば、インター予測のブロックの符号化の場合、このような傾向が見られる。 By the way, non-zero coefficients tend to be biased to horizontal or vertical components when the residual is relatively small and the total number of coefficients is small. For example, in the case of coding of an inter prediction block, such a tendency is seen.
 また、連続する非ゼロ係数の長さ(以下、ランと称する)をできるだけまとめたほうが、つまり分断しないで符号化したほうが、符号化効率がよくなる。 Also, the coding efficiency is better when the lengths of continuous non-zero coefficients (hereinafter referred to as “runs”) are collected as much as possible, that is, when coding is performed without dividing.
 上記構成では、第1の復号対象範囲が第2の復号対象範囲とは別に復号される。このため第1の復号対象範囲に、非ゼロ係数が集中している場合、復号すべき符号データの符号量を抑制することができる。 In the above configuration, the first decoding target range is decoded separately from the second decoding target range. For this reason, when non-zero coefficients are concentrated in the first decoding target range, the code amount of the code data to be decoded can be suppressed.
 また、第2の復号対象範囲では、第1の復号対象範囲にある係数によりランが分断されず符号化されていることになり、効率よく符号化されていることになる。よって、復号すべき符号量を抑制することができる。 Also, in the second decoding target range, the run is encoded without being divided by the coefficients in the first decoding target range, and the encoding is efficiently performed. Therefore, the code amount to be decoded can be suppressed.
 このように、係数の分布に偏りがある場合、復号すべき符号データの符号量の削減を図ることができる。 Thus, when there is a bias in the distribution of coefficients, it is possible to reduce the code amount of code data to be decoded.
 本発明に係る画像符号化装置は、画像データから予測画像を減じた予測残差を、直交変換し、量子化した変換係数からなる係数行列をスキャンして符号することにより符号化データを出力する画像符号化装置において、上記係数行列における、上記スキャン順上最後の非ゼロ係数の位置を検出する最後の係数位置検出手段と、上記最後の非ゼロ係数の位置が、上記係数行列において、直流成分の係数を含む行または列から所定の行または列までの位置判定範囲にあるか否かを判定する位置判定手段と、上記最後の非ゼロ係数の位置が、上記位置判定範囲にある場合、上記係数行列を、上記最後の非ゼロ係数の位置を含む第1の符号化対象範囲と、上記第1の符号化対象範囲以外の第2の符号化対象範囲とでそれぞれ符号化処理する2段階符号化手段と、を備えることを特徴とする。 An image encoding apparatus according to the present invention outputs encoded data by performing orthogonal transform on a prediction residual obtained by subtracting a predicted image from image data and scanning and encoding a coefficient matrix composed of quantized transform coefficients. In the image encoding device, the last coefficient position detecting means for detecting the position of the last non-zero coefficient in the scan order in the coefficient matrix, and the position of the last non-zero coefficient are the DC component in the coefficient matrix. Position determination means for determining whether or not a position determination range from a row or column including the coefficient to a predetermined row or column and the position of the last non-zero coefficient are in the position determination range, A two-stage code for encoding a coefficient matrix in each of a first encoding target range including the position of the last non-zero coefficient and a second encoding target range other than the first encoding target range. Characterized in that it and a means.
 本発明に係る符号化データのデータ構造は、画像データから予測画像を減じた予測残差を、直行変換し、量子化した変換係数からなる係数行列をスキャンして符号することにより生成される符号化データのデータ構造において、上記係数行列における、上記スキャン順上最後の非ゼロ係数の位置を示す位置情報と、上記最後の非ゼロ係数を含み、上記係数行列において、直流成分の係数を含む行または列から所定の行または列までの第1の符号化対象範囲にある係数が順に符号化された第1係数符号化データと、上記第1の符号化対象範囲以外の第2の符号化対象範囲にある係数が順に符号化された第2係数符号化データとを含むことを特徴とする。 The data structure of the encoded data according to the present invention is a code generated by performing orthogonal transform on a prediction residual obtained by subtracting a predicted image from image data and scanning and coding a coefficient matrix composed of quantized transform coefficients. In the data structure of the digitized data, the position information indicating the position of the last non-zero coefficient in the scan order in the coefficient matrix and the last non-zero coefficient are included in the coefficient matrix, and the coefficient matrix includes the DC component coefficient. Alternatively, the first coefficient encoded data in which the coefficients in the first encoding target range from the column to the predetermined row or column are sequentially encoded, and the second encoding target other than the first encoding target range And second coefficient encoded data in which the coefficients in the range are sequentially encoded.
 上記のように構成された画像符号化装置または符号化データのデータ構造によれば、本発明に係る画像復号装置と同様の効果を奏する。 According to the image encoding device or the data structure of the encoded data configured as described above, the same effects as those of the image decoding device according to the present invention can be obtained.
 なお、画像符号化装置は、上記係数行列における、上記スキャン順上最後の非ゼロ係数の位置を示す位置情報と、上記最後の非ゼロ係数を含み、上記係数行列において、直流成分の係数を含む行または列から所定の行または列までの第1の範囲にある係数が順に符号化された第1係数符号化データと、上記第1の範囲以外の第2の範囲にある係数が順に符号化された第2係数符号化データとを符号化データのデータ構造に含めてもよい。画像符号化装置は、上記情報を、例えば、サイド情報において符号化してもよい。 The image encoding device includes position information indicating the position of the last non-zero coefficient in the scan order in the coefficient matrix and the last non-zero coefficient, and includes a coefficient of a DC component in the coefficient matrix. First coefficient encoded data obtained by sequentially encoding coefficients in a first range from a row or column to a predetermined row or column, and coefficients in a second range other than the first range are sequentially encoded. The encoded second coefficient encoded data may be included in the data structure of the encoded data. The image encoding device may encode the information in, for example, side information.
 また、上述の問題は、別の観点からいえば次のように表現することもできる。すなわち、符号化方式に、CABACを適用する際、周波数領域における変換係数の分布が、ブロック毎に変動するような場合、例えば、隣接する複数のブロックにおけるエッジの方向が互いに大きく異なっているような場合には、非特許文献3に開示された技術を用いたとしても、変換係数毎に適切な発生確率を用いることができないため、符号化効率が低下するという問題を生じていた。 Also, the above problem can be expressed as follows from another viewpoint. That is, when CABAC is applied to the encoding method, when the distribution of transform coefficients in the frequency domain varies from block to block, for example, the directions of edges in a plurality of adjacent blocks are greatly different from each other. In this case, even if the technique disclosed in Non-Patent Document 3 is used, an appropriate generation probability cannot be used for each transform coefficient, which causes a problem that the encoding efficiency is lowered.
 よって、本発明は、別の観点から言えば、次のように表現することもできる。すなわち、本発明は、上記の問題に鑑みてなされたものであり、その目的は、周波数領域における変換係数の分布がブロック毎に変動するような場合であっても、符号化効率の高い算術符号化装置、および算術復号装置を実現することにある。 Therefore, the present invention can be expressed as follows from another viewpoint. That is, the present invention has been made in view of the above problems, and its purpose is to provide an arithmetic code with high coding efficiency even when the distribution of transform coefficients in the frequency domain varies from block to block. And an arithmetic decoding device.
 上記の課題を解決するために、本発明に係る算術復号装置は、対象画像を単位領域毎に周波数変換して得られる各変換係数について、該変換係数を表す1または複数種類のシンタックスを算術符号化することによって得られた符号化データを復号する算術復号装置であって、処理対象の単位領域に対応する対象周波数領域における各シンタックスに対して、該シンタックスの種類および該シンタックスの該対象周波数領域における位置に応じて定まるコンテキストインデックスを割り付けるコンテキストインデックス割り付け手段と、上記対象周波数領域における各シンタックスを、該シンタックスに対して割り付けられたコンテキストインデックスによって指定される確率状態に基づいて順次算術復号するシンタックス復号手段と、上記シンタックス復号手段によって復号された各シンタックスから各変換係数を復元する変換係数復元手段と、上記対象周波数領域における復元済みの非0変換係数の分布の偏りに応じて、該対象周波数領域における未復号のシンタックスに割り付けるコンテキストインデックスを変更するコンテキストインデックス変更手段と、を備えていることを特徴としている。 In order to solve the above-described problem, the arithmetic decoding apparatus according to the present invention arithmetically calculates one or a plurality of types of syntax representing transform coefficients for each transform coefficient obtained by subjecting a target image to frequency conversion for each unit region. An arithmetic decoding device that decodes encoded data obtained by encoding, wherein each syntax in a target frequency domain corresponding to a unit area to be processed has a type of syntax and a syntax of the syntax Context index assigning means for assigning a context index determined according to a position in the target frequency domain, and each syntax in the target frequency domain based on a probability state specified by the context index assigned to the syntax Syntax decoding means for sequential arithmetic decoding, and the above Transform coefficient restoring means for restoring each transform coefficient from each syntax decoded by the syntax decoding means, and undecoding in the target frequency domain according to the bias of the distribution of the restored non-zero transform coefficients in the target frequency domain And a context index changing means for changing a context index assigned to the syntax.
 上記のように構成された算術復号装置によれば、上記コンテキストインデックス割り付け手段は、対象周波数領域における各シンタックスに対して、該シンタックスの種類および該シンタックスの該対象周波数領域における位置に応じて定まるコンテキストインデックスを割り付ける。また、上記コンテキストインデックス変更手段は、上記対象周波数領域における復号済みの非0変換係数の分布の偏りに応じて、該対象周波数領域における未復号のシンタックスに割り付けるコンテキストインデックスを変更し、上記シンタックス復号手段は、上記未復号のシンタックスに割り付けられた変更後のコンテキストインデックスによって指定される確率状態に基づいて、該未復号のシンタックスを復号する。 According to the arithmetic decoding apparatus configured as described above, the context index allocating unit is responsive to each syntax in the target frequency domain according to the type of syntax and the position of the syntax in the target frequency domain. Assign a context index. Further, the context index changing means changes a context index assigned to an undecoded syntax in the target frequency domain according to a bias of a distribution of decoded non-zero transform coefficients in the target frequency domain, and The decoding means decodes the undecoded syntax based on the probability state specified by the changed context index assigned to the undecoded syntax.
 したがって、上記のように構成された算術復号装置によれば、上記対象周波数領域における復号済みの非0変換係数の分布の偏りに応じて、未復号のシンタックスを復号するための適切な確率状態を指定し、該適切な確率状態に基づいて、上記未復号のシンタックスを復号することができる。 Therefore, according to the arithmetic decoding apparatus configured as described above, an appropriate probability state for decoding the undecoded syntax according to the distribution bias of the decoded non-zero transform coefficient in the target frequency domain And the undecoded syntax can be decoded based on the appropriate probability state.
 上記の構成に対応する構成を有する算術符号化装置によれば、変換係数を表す各シンタックスを、適切な確率状態に基づいて符号化することができるので、各変換係数の偏りが単位領域毎に異なる場合であっても、高い符号化効率を有する符号化データを生成することができる。 According to the arithmetic coding apparatus having a configuration corresponding to the above configuration, each syntax representing a transform coefficient can be coded based on an appropriate probability state. Even in a different case, encoded data having high encoding efficiency can be generated.
 上記のように構成された算術復号装置によれば、そのような符号化効率の高い符号化データを復号することができる。 According to the arithmetic decoding apparatus configured as described above, it is possible to decode such encoded data with high encoding efficiency.
 なお、上記単位領域とは、例えば、TMuC(Test Model under Consideration)におけるTU(変換単位)、または、TUを分割して得られるブロックに対応する。 The unit area corresponds to, for example, a TU (conversion unit) in TMuC (Test (under Consideration) or a block obtained by dividing the TU.
 また、本発明に係る算術符号化装置は、対象画像を単位領域毎に周波数変換して得られる各変換係数について、該変換係数を表す1または複数種類のシンタックスを算術符号化することによって符号化データを生成する算術符号化装置であって、処理対象の単位領域に対応する対象周波数領域における各変換係数を表す各シンタックスに対して、該シンタックスの種類および該シンタックスの該対象周波数領域における位置に応じて定まるコンテキストインデックスを割り付けるコンテキストインデックス割り付け手段と、上記対象周波数領域における各シンタックスを、該シンタックスに対して割り付けられたコンテキストインデックスによって指定される確率状態に基づいて順次算術符号化するシンタックス符号化手段と、上記対象周波数領域における符号化済みの非0変換係数の分布の偏りに応じて、該対象周波数領域における未符号化シンタックスに割り付けるコンテキストインデックスを変更するコンテキストインデックス変更手段と、を備えていることを特徴としている。 In addition, the arithmetic coding apparatus according to the present invention encodes each transform coefficient obtained by frequency-transforming the target image for each unit region by arithmetically coding one or more kinds of syntax representing the transform coefficient. An arithmetic coding apparatus for generating coded data, wherein each syntax representing each transform coefficient in a target frequency region corresponding to a unit region to be processed has a syntax type and a target frequency of the syntax Context index allocating means for allocating a context index determined according to a position in a region, and each syntax in the target frequency region is sequentially arithmetic code based on a probability state specified by the context index allocated to the syntax Syntax encoding means for generating the target circumference Context index changing means for changing a context index to be assigned to an uncoded syntax in the target frequency domain according to a bias in the distribution of encoded non-zero transform coefficients in a number domain. Yes.
 上記のように構成された算術符号化装置によれば、上記コンテキストインデックス割り付け手段は、対象周波数領域における各シンタックスに対して、該シンタックスの種類および該シンタックスの該対象周波数領域における位置に応じて定まるコンテキストインデックスを割り付ける。また、上記コンテキストインデックス変更手段は、上記対象周波数領域における符号化済みの非0変換係数の分布の偏りに応じて、該対象周波数領域における未符号化シンタックスに割り付けるコンテキストインデックスを変更し、上記シンタックス符号化手段は、上記未復号のシンタックスに割り付けられた変更後のコンテキストインデックスによって指定される確率状態に基づいて、該未符号化シンタックスを符号化する。 According to the arithmetic coding apparatus configured as described above, the context index allocating unit determines, for each syntax in the target frequency domain, the type of syntax and the position of the syntax in the target frequency domain. Assign a context index that is determined accordingly. Further, the context index changing means changes a context index assigned to an uncoded syntax in the target frequency domain according to a bias in a distribution of encoded non-zero transform coefficients in the target frequency domain, and The tax encoding means encodes the uncoded syntax based on the probability state specified by the changed context index assigned to the undecoded syntax.
 したがって、上記のように構成された算術符号化装置によれば、上記対象周波数領域における符号化済みの非0変換係数の分布の偏りに応じて、未符号化シンタックスを符号化するための適切な確率状態を指定し、該適切な確率状態に基づいて、上記未符号化シンタックスを符号化することができる。これにより、各変換係数の偏りが単位領域毎に異なる場合であっても、高い符号化効率を有する符号化データを生成することができる。 Therefore, according to the arithmetic coding apparatus configured as described above, it is possible to appropriately encode an uncoded syntax in accordance with the distribution of the distribution of coded non-zero transform coefficients in the target frequency domain. A random state can be specified and the uncoded syntax can be encoded based on the appropriate probability state. As a result, even if the bias of each transform coefficient is different for each unit region, encoded data having high encoding efficiency can be generated.
 また、本発明に係る符号化データのデータ構造は、原画像を単位領域毎に周波数変換して得られる各変換係数について、該変換係数を表す1または複数種類のシンタックスを算術符号化することによって得られる符号化データのデータ構造であって、上記1または複数種類のシンタックスには、変換係数が0であるか否か示すフラグが含まれており、上記符号化データを復号する算術復号装置は、処理対象の単位領域に対応する対象周波数領域における各シンタックスに対して、該シンタックスの種類および該シンタックスの該対象周波数領域における位置に応じて定まるコンテキストインデックスを割り付け、上記対象周波数領域における各シンタックスを、該シンタックスに対して割り付けられたコンテキストインデックスによって指定される確率状態に基づいて順次算術復号すると共に、上記対象周波数領域における復元済みの上記フラグの分布の偏りに応じて、該対象周波数領域における未復号のシンタックスに割り付けるコンテキストインデックスを変更する、ことを特徴としている。 Also, the data structure of the encoded data according to the present invention is such that, for each transform coefficient obtained by frequency transforming the original image for each unit region, one or more kinds of syntax representing the transform coefficient are arithmetically encoded. The one or more types of syntax includes a flag indicating whether or not a transform coefficient is 0, and arithmetic decoding is performed to decode the encoded data. The apparatus assigns, to each syntax in the target frequency domain corresponding to the unit area to be processed, a context index determined according to the type of the syntax and the position of the syntax in the target frequency domain, and the target frequency Each syntax in the region is indicated by the context index assigned to that syntax. Sequentially performing arithmetic decoding based on the probability state to be performed, and changing a context index assigned to an undecoded syntax in the target frequency domain according to a bias in the distribution of the restored flag in the target frequency domain It is characterized by.
 本発明の一側面について説明すると次のとおりである。すなわち、本発明に係る画像復号装置は、係数行列における、逆スキャン順上最後の非ゼロ係数の位置を検出する最後の係数位置検出手段と、上記最後の非ゼロ係数の位置が、上記係数行列において、直流成分の係数を含む行または列から所定の行または列までの位置判定範囲にあるか否かを判定する位置判定手段と、上記最後の非ゼロ係数の位置が、上記位置判定範囲にある場合、上記係数行列を、上記最後の非ゼロ係数の位置を含む第1の復号対象範囲と、上記第1の復号対象範囲以外の第2の復号対象範囲とでそれぞれ復号処理する2段階復号手段と、を備える構成である。 The following explains one aspect of the present invention. That is, the image decoding apparatus according to the present invention includes a last coefficient position detecting unit that detects the position of the last non-zero coefficient in the reverse scan order in the coefficient matrix, and the position of the last non-zero coefficient is the coefficient matrix In the position determination means, the position determination means for determining whether or not the position determination range from the row or column including the coefficient of the DC component to the predetermined row or column is within the position determination range. In some cases, the coefficient matrix is decoded in a first decoding target range including the position of the last non-zero coefficient and a second decoding target range other than the first decoding target range, respectively. Means.
 本発明に係る画像符号化装置は、係数行列における、スキャン順上最後の非ゼロ係数の位置を検出する最後の係数位置検出手段と、上記最後の非ゼロ係数の位置が、上記係数行列において、直流成分の係数を含む行または列から所定の行または列までの位置判定範囲にあるか否かを判定する位置判定手段と、上記最後の非ゼロ係数の位置が、上記位置判定範囲にある場合、上記係数行列を、上記最後の非ゼロ係数の位置を含む第1の符号化対象範囲と、上記第1の符号化対象範囲以外の第2の符号化対象範囲とでそれぞれ符号化処理する2段階符号化手段と、を備える構成である。 The image coding apparatus according to the present invention includes a last coefficient position detecting unit that detects a position of the last non-zero coefficient in the scan order in the coefficient matrix, and a position of the last non-zero coefficient in the coefficient matrix. A position determination means for determining whether or not a position determination range from a row or column including a coefficient of a direct current component to a predetermined row or column and the position of the last non-zero coefficient are in the position determination range The coefficient matrix is encoded by a first encoding target range including the position of the last non-zero coefficient and a second encoding target range other than the first encoding target range, respectively. 2 And a stage encoding means.
 本発明に係る符号化データのデータ構造は、係数行列における、スキャン順上最後の非ゼロ係数の位置を示す位置情報と、上記最後の非ゼロ係数を含み、上記係数行列において、直流成分の係数を含む行または列から所定の行または列までの第1の符号化対象範囲にある係数が順に符号化された第1係数符号化データと、上記第1の符号化対象範囲以外の第2の符号化対象範囲にある係数が順に符号化された第2係数符号化データとを含むデータ構造である。 The data structure of the encoded data according to the present invention includes position information indicating the position of the last non-zero coefficient in the scan order in the coefficient matrix and the last non-zero coefficient. In the coefficient matrix, the coefficient of the DC component First coefficient encoded data obtained by sequentially encoding the coefficients in the first encoding target range from the row or column including the predetermined row or column, and the second coefficient other than the first encoding target range. This is a data structure including second coefficient encoded data in which coefficients in the encoding target range are sequentially encoded.
 よって、係数の分布に偏りがある場合においても、可変長符号化方式による符号化効率の向上を図ることができる。 Therefore, even when the coefficient distribution is biased, it is possible to improve the coding efficiency by the variable length coding method.
 また、本発明の別の側面について説明すると次のとおりである。すなわち、本発明に係る算術復号装置は、対象画像を単位領域毎に周波数変換して得られる各変換係数について、該変換係数を表す1または複数種類のシンタックスを算術符号化することによって得られた符号化データを復号する算術復号装置であって、処理対象の単位領域に対応する対象周波数領域における各シンタックスに対して、該シンタックスの種類および該シンタックスの該対象周波数領域における位置に応じて定まるコンテキストインデックスを割り付けるコンテキストインデックス割り付け手段と、上記対象周波数領域における各シンタックスを、該シンタックスに対して割り付けられたコンテキストインデックスによって指定される確率状態に基づいて順次算術復号するシンタックス復号手段と、上記シンタックス復号手段によって復号された各シンタックスから各変換係数を復元する変換係数復元手段と、上記対象周波数領域における復元済みの非0変換係数の分布の偏りに応じて、該対象周波数領域における未復号のシンタックスに割り付けるコンテキストインデックスを変更するコンテキストインデックス変更手段と、を備えている。 Further, another aspect of the present invention will be described as follows. That is, the arithmetic decoding device according to the present invention is obtained by arithmetically encoding one or a plurality of types of syntax representing the transform coefficient for each transform coefficient obtained by frequency transforming the target image for each unit region. An arithmetic decoding apparatus for decoding encoded data, wherein each syntax in a target frequency domain corresponding to a unit area to be processed has a type of syntax and a position of the syntax in the target frequency domain. Context index allocating means for allocating a context index determined in accordance with the syntax decoding, and sequentially decoding each syntax in the target frequency domain based on a probability state specified by the context index allocated to the syntax Means and the syntax decoding means Therefore, the transform coefficient restoring means for restoring each transform coefficient from each decoded syntax, and the undecoded syntax in the target frequency domain according to the distribution of the restored non-zero transform coefficient in the target frequency domain And a context index changing means for changing a context index to be allocated.
 また、本発明に係る算術符号化装置は、対象画像を単位領域毎に周波数変換して得られる各変換係数について、該変換係数を表す1または複数種類のシンタックスを算術符号化することによって符号化データを生成する算術符号化装置であって、処理対象の単位領域に対応する対象周波数領域における各変換係数を表す各シンタックスに対して、該シンタックスの種類および該シンタックスの該対象周波数領域における位置に応じて定まるコンテキストインデックスを割り付けるコンテキストインデックス割り付け手段と、上記対象周波数領域における各シンタックスを、該シンタックスに対して割り付けられたコンテキストインデックスによって指定される確率状態に基づいて順次算術符号化するシンタックス符号化手段と、上記対象周波数領域における符号化済みの非0変換係数の分布の偏りに応じて、該対象周波数領域における未符号化シンタックスに割り付けるコンテキストインデックスを変更するコンテキストインデックス変更手段と、を備えている。 In addition, the arithmetic coding apparatus according to the present invention encodes each transform coefficient obtained by frequency-transforming the target image for each unit region by arithmetically coding one or more kinds of syntax representing the transform coefficient. An arithmetic coding apparatus for generating coded data, wherein each syntax representing each transform coefficient in a target frequency region corresponding to a unit region to be processed has a syntax type and a target frequency of the syntax Context index allocating means for allocating a context index determined according to a position in a region, and each syntax in the target frequency region is sequentially arithmetic code based on a probability state specified by the context index allocated to the syntax Syntax encoding means for generating the target circumference Depending on the deviation of the distribution of coded nonzero transform coefficients in several regions, and a, a context index changing means for changing a context index allocated to uncoded syntax in the subject frequency range.
 また、本発明に係る符号化データのデータ構造は、原画像を単位領域毎に周波数変換して得られる各変換係数について、該変換係数を表す1または複数種類のシンタックスを算術符号化することによって得られる符号化データのデータ構造であって、
 上記1または複数種類のシンタックスには、変換係数が0であるか否か示すフラグが含まれており、
 上記符号化データを復号する算術復号装置は、処理対象の単位領域に対応する対象周波数領域における各シンタックスに対して、該シンタックスの種類および該シンタックスの該対象周波数領域における位置に応じて定まるコンテキストインデックスを割り付け、上記対象周波数領域における各シンタックスを、該シンタックスに対して割り付けられたコンテキストインデックスによって指定される確率状態に基づいて順次算術復号すると共に、上記対象周波数領域における復元済みの上記フラグの分布の偏りに応じて、該対象周波数領域における未復号のシンタックスに割り付けるコンテキストインデックスを変更する。
Also, the data structure of the encoded data according to the present invention is such that, for each transform coefficient obtained by frequency transforming the original image for each unit region, one or more kinds of syntax representing the transform coefficient are arithmetically encoded. The data structure of the encoded data obtained by
The one or more types of syntax include a flag indicating whether or not the conversion coefficient is 0,
The arithmetic decoding apparatus that decodes the encoded data, for each syntax in the target frequency domain corresponding to the unit area to be processed, according to the type of syntax and the position of the syntax in the target frequency domain A fixed context index is allocated, and each syntax in the target frequency domain is sequentially arithmetically decoded based on the probability state specified by the context index allocated to the syntax, and the restored in the target frequency domain The context index assigned to the undecoded syntax in the target frequency domain is changed according to the distribution of the flag.
 上記のように構成された算術復号装置等によれば、符号化効率の高い符号化データを復号することができる。 According to the arithmetic decoding apparatus configured as described above, it is possible to decode encoded data with high encoding efficiency.
 本発明の他の目的、特徴、および優れた点は、以下に示す記載によって十分分かるであろう。また、本発明の利点は、添付図面を参照した次の説明によって明白になるであろう。 Other objects, features, and superior points of the present invention will be fully understood from the following description. The advantages of the present invention will become apparent from the following description with reference to the accompanying drawings.
本発明の一実施形態に係る動画像復号装置が備えるTU情報復号部の構成例を示すブロック図である。It is a block diagram which shows the structural example of the TU information decoding part with which the moving image decoding apparatus which concerns on one Embodiment of this invention is provided. 上記動画像復号装置の概略的構成を示す機能ブロック図である。It is a functional block diagram which shows the schematic structure of the said moving image decoding apparatus. 本発明の一実施形態に係る動画像符号化装置によって生成され、上記動画像復号装置によって復号される符号化データの構成を示す図である。It is a figure which shows the structure of the encoding data produced | generated by the moving image encoder which concerns on one Embodiment of this invention, and decoded by the said moving image decoder. 係数行列のスキャンについて説明する図であり、(a)は、8×8の係数行列のスキャン例を示しており、(b)は、スキャン結果により得られる1次元配列について示している。FIG. 4 is a diagram for explaining a coefficient matrix scan, where (a) shows an example of 8 × 8 coefficient matrix scan, and (b) shows a one-dimensional array obtained from the scan result. 上記TU情報復号部が備える2段階復号部における処理と当該処理に関する入出力データとの関係について示した図である。It is the figure shown about the relationship between the process in the two-stage decoding part with which the said TU information decoding part is provided, and the input-output data regarding the said process. 上記係数行列の2段階の係数符号化処理または係数復号処理について例示する図であり、(a)は、第1段階について、(b)は、第2段階について示している。It is a figure which illustrates about the coefficient encoding process or coefficient decoding process of the two steps | paragraphs of the said coefficient matrix, (a) has shown about the 1st step and (b) has shown about the 2nd step. 上記TU情報復号部における係数復号処理の流れについて示したフローチャートである。It is the flowchart shown about the flow of the coefficient decoding process in the said TU information decoding part. 本発明の一実施形態に係る動画像符号化装置の構成例について示す機能ブロック図である。It is a functional block diagram shown about the structural example of the moving image encoder which concerns on one Embodiment of this invention. 上記動画像符号化装置が備える可変長符号化部の構成例について示すブロック図である。It is a block diagram shown about the structural example of the variable length encoding part with which the said moving image encoder is provided. 本実施形態に係るTU情報符号化部が備える2段階符号化部における処理と当該処理に関する入出力データとの関係について示した図である。It is the figure shown about the relationship in the input / output data regarding the process in the 2 step | paragraph encoding part with which the TU information encoding part which concerns on this embodiment is provided. 上記TU情報符号化部における係数符号化処理の流れについて示したフローチャートである。It is the flowchart shown about the flow of the coefficient encoding process in the said TU information encoding part. 上記TU情報符号化部における係数符号化処理のシンタックスの一例について示す図である。It is a figure shown about an example of the syntax of the coefficient encoding process in the said TU information encoding part. 上記TU情報符号化部における係数符号化処理のシンタックスの一例について示す図である。It is a figure shown about an example of the syntax of the coefficient encoding process in the said TU information encoding part. ラン(run)の最大値が5の場合における”run”および”isLevelOne”の組み合わせに対応するコード番号(CodeNum)の対応を定義したテーブルの一例を示す図である。It is a figure which shows an example of the table which defined the correspondence of the code number (CodeNum) corresponding to the combination of "run" and "isLevelOne" in case the maximum value of a run (run) is 5. ランの最大値が5である場合におけるジグザグスキャン用VLCテーブルの一例を示す図である。It is a figure which shows an example of the VLC table for zigzag scanning in case the maximum value of a run is 5. ”run”の最大値について説明する図である。It is a figure explaining the maximum value of "run". ランの最大値が5の場合における”run”および”isLevelOne”の組み合わせに対応するコード番号(CodeNum)の対応を定義したテーブルの他の例を示す図である。It is a figure which shows the other example of the table which defined the response | compatibility of the code number (CodeNum) corresponding to the combination of "run" and "isLevelOne" in case the maximum value of a run is 5. ランの最大値が5である場合における直線スキャン用VLCテーブルの他の例を示す図である。It is a figure which shows the other example of the VLC table for linear scan in case the maximum value of a run is 5. FIG. 本発明の他の実施形態に係るTU情報復号部の構成例について示す機能ブロック図である。It is a functional block diagram shown about the structural example of the TU information decoding part which concerns on other embodiment of this invention. 係数行列の最後の係数および最後から2つ目の係数の係数符号化処理または係数復号処理について示す図である。It is a figure shown about the coefficient encoding process or coefficient decoding process of the last coefficient of a coefficient matrix, and the 2nd coefficient from the last. 係数行列の2段階の係数符号化処理または係数復号処理について例示する図であり、(a)は、第1段階について示しており、(b)は、第2段階について示している。It is a figure which illustrates about the coefficient encoding process of 2 steps | paragraphs of a coefficient matrix, or a coefficient decoding process, (a) has shown about the 1st step and (b) has shown about the 2nd step. 上記TU情報復号部における係数復号処理の流れについて示したフローチャートである。It is the flowchart shown about the flow of the coefficient decoding process in the said TU information decoding part. 本発明の他の実施形態に係るTU情報符号化部の構成例について示す機能ブロック図である。It is a functional block diagram shown about the structural example of the TU information encoding part which concerns on other embodiment of this invention. 上記TU情報符号化部における係数復号処理の流れについて示したフローチャートである。It is the flowchart shown about the flow of the coefficient decoding process in the said TU information encoding part. 上記TU情報符号化部における係数符号化処理のシンタックスの他の例について示す。Another example of the syntax of the coefficient encoding process in the TU information encoding unit will be described. 上記TU情報符号化部における係数符号化処理のシンタックスの他の例について示す。Another example of the syntax of the coefficient encoding process in the TU information encoding unit will be described. 第2段階フラグを省略する場合における係数符号化処理および係数復号処理について説明する図である。It is a figure explaining the coefficient encoding process and coefficient decoding process in the case of omitting the second stage flag. 変形例に係るTU情報符号化部における係数符号化処理の流れについて示したフローチャートである。It is the flowchart shown about the flow of the coefficient encoding process in the TU information encoding part which concerns on a modification. 変形例に係るTU情報復号部における係数復号処理の流れについて示したフローチャートである。It is the flowchart shown about the flow of the coefficient decoding process in the TU information decoding part which concerns on a modification. 変形例に係るTU情報符号化部における係数符号化処理のシンタックスのさらに他の例について示す。Another example of the syntax of the coefficient encoding process in the TU information encoding unit according to the modification will be described. 変形例に係るTU情報符号化部における係数符号化処理のシンタックスのさらに他の例について示す。Another example of the syntax of the coefficient encoding process in the TU information encoding unit according to the modification will be described. 第1段階の符号化対象領域の拡張について説明する図である。It is a figure explaining the expansion of the encoding object area | region of the 1st step. 符号化する係数の数の制限の例について説明する図である。It is a figure explaining the example of a restriction | limiting of the number of the coefficients to encode. 符号化する係数の数の制限の別の例について説明する図である。It is a figure explaining another example of restriction | limiting of the number of the coefficients to encode. 従来、2次元行列により表される変換係数を、ジグザグスキャンにより1次元配列に格納する場合を例示する図であり、(a)は、4×4サイズの変換係数のマトリクスをスキャンするときの例を示しており、(b)は、スキャンにより変換係数が格納された1次元配列の例を示している。It is a figure which illustrates the case where the conversion coefficient represented by a two-dimensional matrix is conventionally stored in a one-dimensional array by a zigzag scan, (a) is an example when scanning the matrix of a conversion coefficient of 4x4 size (B) shows an example of a one-dimensional array in which conversion coefficients are stored by scanning. 本発明の別の実施形態に係る動画像復号装置の備える量子化残差情報復号部の構成を示すブロック図である。It is a block diagram which shows the structure of the quantization residual information decoding part with which the moving image decoding apparatus which concerns on another embodiment of this invention is provided. 実施形態に係る符号化データのデータ構造を示す図である。(a)は、符号化データのピクチャレイヤの構成を示しており、(b)は、ピクチャレイヤに含まれるスライスレイヤの構成を示しており、(c)は、スライスレイヤに含まれるLCUレイヤを構成する各CUの構成を示しており、(d)は、CUレイヤに含まれるリーフCUの構成を示しており、(e)は、リーフCUについてのインター予測情報の構成を示しており、(f)は、リーフCUについてのイントラ予測情報の構成を示しており、(g)は、スライスヘッダに含まれるフィルタパラメータの構成を示している。It is a figure which shows the data structure of the coding data which concern on embodiment. (A) shows the configuration of the picture layer of the encoded data, (b) shows the configuration of the slice layer included in the picture layer, and (c) shows the LCU layer included in the slice layer. (D) shows the configuration of the leaf CU included in the CU layer, (e) shows the configuration of the inter prediction information for the leaf CU, ( f) shows the configuration of the intra prediction information for the leaf CU, and (g) shows the configuration of the filter parameter included in the slice header. 実施形態に係る符号化データの量子化残差情報に含まれる各シンタックスを示す図である。It is a figure which shows each syntax contained in the quantization residual information of the coding data which concerns on embodiment. 実施形態に係る符号化データの量子化残差情報に含まれる各シンタックスを説明するための図であって、(a)は、処理対象の周波数領域における非0の変換係数を例示しており、(b)は、処理対象の周波数領域におけるシンタックスsig_flagの値を例示しており、(c)は、処理対象の周波数領域におけるシンタックスlast_flagの値を例示しており、(d)は、処理対象の周波数領域におけるシンタックスabs_greater_oneの値を例示している。It is a figure for demonstrating each syntax contained in the quantization residual information of the coding data which concerns on embodiment, Comprising: (a) has illustrated the non-zero conversion coefficient in the frequency domain of a process target. , (B) illustrates the value of the syntax sig_flag in the frequency domain to be processed, (c) illustrates the value of the syntax last_flag in the frequency domain to be processed, and (d) The value of syntax abs_greater_one in the frequency domain to be processed is illustrated. 実施形態に係る動画像復号装置の構成を示すブロック図である。It is a block diagram which shows the structure of the moving image decoding apparatus which concerns on embodiment. 実施形態に係る動画像復号装置の備える可変長符号復号部11の構成を示すブロック図である。It is a block diagram which shows the structure of the variable length code decoding part 11 with which the moving image decoding apparatus which concerns on embodiment is provided. 実施形態に係る量子化残差情報復号部の備えるコンテキストインデックス割り付け部の動作を説明するための図であって、(a)は、処理対象となる周波数領域が4×4成分である場合に、各周波数成分に対して、コンテキストインデックス割り付け部によって割り付けられたコンテキストインデックスの例を示しており、(b)は、処理対象となる周波数領域が8×8成分である場合に、各周波数成分に対して、コンテキストインデックス割り付け部によって割り付けられたコンテキストインデックスの例を示している。It is a figure for demonstrating operation | movement of the context index allocation part with which the quantization residual information decoding part which concerns on embodiment is equipped, Comprising: (a) is when the frequency domain used as a process target is 4x4 component, The example of the context index allocated by the context index allocation unit for each frequency component is shown. (B) shows the case where the frequency region to be processed is 8 × 8 component, An example of the context index allocated by the context index allocation unit is shown. 実施形態に係る量子化残差情報復号部の備える変換係数復号部の動作を説明するための図であって、(a)は、各スキャンにおけるスキャンラインを示しており、(b)は、ジグザグスキャンのスキャン順を示しており、(c)は、適応的スキャンのスキャン順の例を示している。It is a figure for demonstrating operation | movement of the transform coefficient decoding part with which the quantization residual information decoding part which concerns on embodiment is equipped, Comprising: (a) has shown the scan line in each scan, (b) has zigzag The scanning order of scanning is shown, and (c) shows an example of the scanning order of adaptive scanning. 実施形態に係る変換係数復号部により行われる適応的スキャンの処理の流れを示すフローチャートである。It is a flowchart which shows the flow of the process of the adaptive scan performed by the transform coefficient decoding part which concerns on embodiment. 実施形態に係る変換係数復号部により行われる適応的スキャンを説明するための図であって、(a)は、非0の変換係数の出現度数を表す変数scanTopRightをカウントする領域を示しており、(b)は、非0の変換係数の出現度数を表す変数scanBottomLeftをカウントする領域を示している。FIG. 6 is a diagram for explaining an adaptive scan performed by the transform coefficient decoding unit according to the embodiment, in which (a) shows a region for counting a variable scanTopRight indicating the appearance frequency of non-zero transform coefficients; (B) shows an area in which a variable scanBottomLeft representing the frequency of appearance of non-zero conversion coefficients is counted. 実施形態に係る量子化残差情報復号部の備えるコンテキストインデックス変更部によるコンテキストインデックス変更処理の第1の具体例を説明するための図であって、(a)は、非0の変換係数の分布の偏りを判定する際に参照される周波数成分を示しており、(b)は、コンテキストインデックス変更部による変更が行われていないコンテキストインデックスを例示しており、(c)は、コンテキストインデックス変更部による変更が行われたコンテキストインデックスを例示している。It is a figure for demonstrating the 1st specific example of the context index change process by the context index change part with which the quantization residual information decoding part which concerns on embodiment is provided, Comprising: (a) is distribution of non-zero conversion coefficient (B) illustrates a context index that has not been changed by the context index changing unit, and (c) illustrates a context index changing unit. The context index by which change by (2) was performed is illustrated. コンテキストインデックス変更処理の第1の具体例について、コンテキストインデックス変更部の処理の流れを示すフローチャートである。It is a flowchart which shows the flow of a process of a context index change part about the 1st specific example of a context index change process. コンテキストインデックス変更処理の第1の具体例について、変換係数復号部とコンテキストインデックス変更部との連携動作の一例を示すシーケンス図である。It is a sequence diagram which shows an example of cooperation operation | movement with a transform coefficient decoding part and a context index change part about the 1st specific example of a context index change process. コンテキストインデックス変更処理の第2の具体例について、コンテキストインデックス変更部の処理の流れを示すフローチャートである。It is a flowchart which shows the flow of a process of a context index change part about the 2nd specific example of a context index change process. コンテキストインデックス変更処理の第2の具体例を説明するための図であって、(a)は、処理対象の周波数領域が4×4成分である場合に、変数coeffBottomLeftおよびcoeffTopRightを算出するために参照される周波数領域の一例を示しており、(b)は、コンテキストインデックス変更部による変更が行われていないコンテキストインデックスを例示しており、(c)は、コンテキストインデックス変更部による変更が行われたコンテキストインデックスを例示している。It is a figure for demonstrating the 2nd specific example of a context index change process, Comprising: (a) is referred in order to calculate the variable coeffBottomLeft and coeffTopRight when the frequency domain of a process target is a 4x4 component. (B) illustrates a context index that has not been changed by the context index changing unit, and (c) shows a change that has been made by the context index changing unit. The context index is illustrated. コンテキストインデックス変更処理の第2の具体例を説明するための図であって、(a)は、処理対象の周波数領域が8×8成分である場合に、変数coeffBottomLeftおよびcoeffTopRightを算出するために参照される周波数領域の一例を示しており、(b)は、コンテキストインデックス変更部による変更が行われていないコンテキストインデックスを例示しており、(c)は、コンテキストインデックス変更部による変更が行われたコンテキストインデックスを例示している。It is a figure for demonstrating the 2nd specific example of a context index change process, Comprising: (a) is referred in order to calculate the variable coeffBottomLeft and coeffTopRight when the frequency domain of a process target is an 8x8 component. (B) illustrates a context index that has not been changed by the context index changing unit, and (c) shows a change that has been made by the context index changing unit. The context index is illustrated. コンテキストインデックス変更処理の第2の具体例を説明するための図であって、(a)は、処理対象の周波数領域が8×8成分である場合に、変数coeffBottomLeftおよびcoeffTopRightを算出するために参照される周波数領域の一例を示しており、(b)は、コンテキストインデックス変更部による変更が行われていないコンテキストインデックスを例示しており、(c)は、コンテキストインデックス変更部による変更が行われたコンテキストインデックスを例示している。It is a figure for demonstrating the 2nd specific example of a context index change process, Comprising: (a) is referred in order to calculate the variable coeffBottomLeft and coeffTopRight when the frequency domain of a process target is an 8x8 component. (B) illustrates a context index that has not been changed by the context index changing unit, and (c) shows a change that has been made by the context index changing unit. The context index is illustrated. コンテキストインデックス変更処理の第2の具体例について、変換係数復号部とコンテキストインデックス変更部との連携動作の一例を示すシーケンス図である。It is a sequence diagram which shows an example of cooperation operation | movement with a transform coefficient decoding part and a context index change part about the 2nd specific example of a context index change process. 実施形態の第3の変形例を説明するための図であって、(a)および(b)は、コンテキストインデックスが変更可能な周波数成分と、コンテキストインデックスが変更されない周波数成分とを示している。It is a figure for demonstrating the 3rd modification of embodiment, Comprising: (a) And (b) has shown the frequency component in which a context index can be changed, and the frequency component in which a context index is not changed. 実施形態の第4の変形例を説明するための図であって、(a)は、復号済みの非0の変換係数にほとんど偏りがない場合に、コンテキストインデックス変更部によって決定されたコンテキストインデックスを示しており、(b)は、復号済みの非0の変換係数が水平方向に偏っている場合に、コンテキストインデックス変更部によって決定されたコンテキストインデックスを示しており、(c)は、復号済みの非0の変換係数が垂直方向に偏っている場合に、コンテキストインデックス変更部によって決定されたコンテキストインデックスを示している。FIG. 10 is a diagram for explaining a fourth modification of the embodiment, in which (a) shows the context index determined by the context index changing unit when there is almost no bias in the decoded non-zero transform coefficients. (B) shows the context index determined by the context index changing unit when the decoded non-zero transform coefficients are biased in the horizontal direction, and (c) shows the decoded When the non-zero transform coefficient is biased in the vertical direction, the context index determined by the context index changing unit is shown. 実施形態の第5の変形例を説明するための図であって、(a)は、復号済みの非0の変換係数にほとんど偏りがない場合に、コンテキストインデックス変更部によって決定されたコンテキストインデックスを示しており、(b)は、復号済みの非0の変換係数が水平方向に偏っている場合に、コンテキストインデックス変更部によって決定されたコンテキストインデックスを示しており、(c)は、復号済みの非0の変換係数が垂直方向に偏っている場合に、コンテキストインデックス変更部によって決定されたコンテキストインデックスを示している。FIG. 11 is a diagram for explaining a fifth modification of the embodiment, in which (a) shows the context index determined by the context index changing unit when there is almost no bias in the decoded non-zero transform coefficients. (B) shows the context index determined by the context index changing unit when the decoded non-zero transform coefficients are biased in the horizontal direction, and (c) shows the decoded When the non-zero transform coefficient is biased in the vertical direction, the context index determined by the context index changing unit is shown. 実施形態の第6の変形例を説明するための図であって、コンテキストインデックス変更部が、coeffTopRightおよびcoeffBottomLeftを算出するために参照する周波数成分を例示する図である。It is a figure for demonstrating the 6th modification of embodiment, Comprising: It is a figure which illustrates the frequency component which a context index change part refers in order to calculate coeffTopRight and coeffBottomLeft. 実施形態に係る動画像符号化装置の構成を示すブロック図である。It is a block diagram which shows the structure of the moving image encoder which concerns on embodiment. 実施形態に係る動画像符号化装置の備える可変長符号符号化部の構成を示すブロック図である。It is a block diagram which shows the structure of the variable-length code encoding part with which the moving image encoder which concerns on embodiment is provided. 実施形態に係る可変長符号符号化部の備える量子化残差情報符号化部の構成を示すブロック図である。It is a block diagram which shows the structure of the quantization residual information encoding part with which the variable-length code encoding part which concerns on embodiment is provided. 上記動画像符号化装置を搭載した送信装置、および、上記動画像復号装置を搭載した受信装置の構成について示した図である。(a)は、動画像符号化装置を搭載した送信装置を示しており、(b)は、動画像復号装置を搭載した受信装置を示している。It is the figure shown about the structure of the transmitter which mounts the said moving image encoder, and the receiver which mounts the said moving image decoder. (A) shows a transmitting apparatus equipped with a moving picture coding apparatus, and (b) shows a receiving apparatus equipped with a moving picture decoding apparatus. 上記動画像符号化装置を搭載した記録装置、および、上記動画像復号装置を搭載した再生装置の構成について示した図である。(a)は、動画像符号化装置を搭載した記録装置を示しており、(b)は、動画像復号装置を搭載した再生装置を示している。It is the figure shown about the structure of the recording device which mounts the said moving image encoder, and the reproducing | regenerating apparatus which mounts the said moving image decoder. (A) shows a recording apparatus equipped with a moving picture coding apparatus, and (b) shows a reproduction apparatus equipped with a moving picture decoding apparatus.
<<実施形態1>>
 本発明に係る復号装置および符号化装置の一つの実施形態について図面に基づいて説明すれば以下のとおりである。
〔1〕実施形態1-1
 本発明の一実施形態について図1~図18を参照して説明する。まず、図2を参照しながら、動画像復号装置(画像復号装置)1および動画像符号化装置(画像符号化装置)2の概要について説明する。図2は、動画像復号装置1の概略的構成を示す機能ブロック図である。
<< Embodiment 1 >>
An embodiment of a decoding apparatus and an encoding apparatus according to the present invention will be described below with reference to the drawings.
[1] Embodiment 1-1
An embodiment of the present invention will be described with reference to FIGS. First, an overview of the moving picture decoding apparatus (image decoding apparatus) 1 and the moving picture encoding apparatus (image encoding apparatus) 2 will be described with reference to FIG. FIG. 2 is a functional block diagram showing a schematic configuration of the moving picture decoding apparatus 1.
 図2に示す動画像復号装置1および動画像符号化装置2は、H.264/MPEG-4 AVC規格に採用されている技術、VCEG(Video Coding Expert Group)における共同開発用コーデックであるKTAソフトウェアに採用されている技術、および、その後継コーデックであるTMuC(Test Model under Consideration)ソフトウェアに採用されている技術を実装している。 The video decoding device 1 and the video encoding device 2 shown in FIG. H.264 / MPEG-4 AVC standard technology, VCEG (Video Coding Expert Group) technology used in KTA software, which is a joint development codec, and successor codec TMuC (Test Model Under Consideration ) The technology used in the software is implemented.
 動画像復号装置1には、動画像符号化装置2が動画像を符号化した符号化データ(符号化データのデータ構造)#1が入力される。動画像復号装置1は、入力された符号化データ#1を復号して動画像#2を外部に出力する。動画像復号装置1の詳細な説明に先立ち、符号化データ#1の構成を以下に説明する。 The moving image decoding apparatus 1 receives encoded data (data structure of encoded data) # 1 obtained by encoding a moving image by the moving image encoding apparatus 2. The video decoding device 1 decodes the input encoded data # 1 and outputs the video # 2 to the outside. Prior to detailed description of the moving picture decoding apparatus 1, the configuration of the encoded data # 1 will be described below.
 〔符号化データの構成〕
 図3を用いて、動画像符号化装置2によって生成され、動画像復号装置1によって復号される符号化データ#1の構成について説明する。符号化データ#1は、シーケンスレイヤ、GOP(Group Of Pictures)レイヤ、ピクチャレイヤ、スライスレイヤ、及び、最大符号化単位(LCU:Largest Coding Unit)レイヤからなる階層構造を有している。
[Configuration of encoded data]
The configuration of encoded data # 1 that is generated by the video encoding device 2 and decoded by the video decoding device 1 will be described with reference to FIG. The encoded data # 1 has a hierarchical structure including a sequence layer, a GOP (Group Of Pictures) layer, a picture layer, a slice layer, and a maximum coding unit (LCU: Large Coding Unit) layer.
 符号化データ#1におけるピクチャレイヤ以下の階層の構造を図3に示す。図3の(a)~(d)は、それぞれ、ピクチャレイヤPICT、スライスレイヤS、LCUレイヤLCU、LCUに含まれるリーフCU(図3の(d)ではCULと表記)の構造を示す図である。 FIG. 3 shows the hierarchical structure below the picture layer in the encoded data # 1. FIGS. 3A to 3D are diagrams showing the structures of leaf CUs (denoted as CUL in FIG. 3D) included in the picture layer PICT, slice layer S, LCU layer LCU, and LCU, respectively. is there.
  (ピクチャレイヤ)
 ピクチャレイヤPICTは、処理対象のピクチャである対象ピクチャを復号するために動画像復号装置1が参照するデータの集合である。ピクチャレイヤPICTは、図3の(a)に示すように、ピクチャヘッダPH、及び、スライスレイヤS1~SNSを含んでいる(NSはピクチャレイヤPICTに含まれるスライスレイヤの総数)。なお、以下、スライスレイヤS1~SNSのそれぞれを区別する必要が無い場合、符号の添え字を省略して記述することがある。また、符号化データ#1に含まれる他の構成についても同様である。
(Picture layer)
The picture layer PICT is a set of data referred to by the video decoding device 1 in order to decode a target picture that is a processing target picture. As shown in FIG. 3A, the picture layer PICT includes a picture header PH and slice layers S 1 to S NS (NS is the total number of slice layers included in the picture layer PICT). Hereinafter, when it is not necessary to distinguish each of the slice layers S 1 to S NS , the reference numerals may be omitted. The same applies to other configurations included in the encoded data # 1.
 ピクチャヘッダPHには、対象ピクチャの復号方法を決定するために動画像復号装置1が参照する符号化パラメータ群が含まれている。例えば、動画像符号化装置2が符号化の際に用いた可変長符号化のモードを示す符号化モード情報(entoropy_coding_mode_flag)は、ピクチャヘッダPHに含まれる符号化パラメータの一例である。entorpy_coding_mode_flagが0の場合、当該ピクチャは、CAVLC(Context-based Adaptive Variable Length Coding)によって符号化されており、entorpy_coding_mode_flagが1である場合、当該ピクチャは、CABAC(Context-based Adaptive Binary Arithmetic Coding)によって符号化されている。 The picture header PH includes a coding parameter group referred to by the video decoding device 1 in order to determine a decoding method of the target picture. For example, the encoding mode information (entoropy_coding_mode_flag) indicating the variable length encoding mode used in encoding by the moving image encoding device 2 is an example of an encoding parameter included in the picture header PH. When entorpy_coding_mode_flag is 0, the picture is encoded by CAVLC (Context-based Adaptive Variable Length Coding). It has become.
  (スライスレイヤ)
 ピクチャレイヤPICTに含まれる各スライスレイヤSは、処理対象のスライスである対象スライスを復号するために動画像復号装置1が参照するデータの集合である。スライスレイヤSは、図3の(b)に示すように、スライスヘッダSH、及び、LCUレイヤLCU1~LCUNC(NCはスライスSに含まれるLCUの総数)を含んでいる。
(Slice layer)
Each slice layer S included in the picture layer PICT is a set of data referred to by the video decoding device 1 in order to decode a target slice that is a processing target slice. As shown in FIG. 3B, the slice layer S includes a slice header SH and LCU layers LCU 1 to LCU NC (NC is the total number of LCUs included in the slice S).
 スライスヘッダSHには、対象スライスの復号方法を決定するために動画像復号装置1が参照する符号化パラメータ群が含まれる。スライスタイプを指定するスライスタイプ指定情報(slice_type)は、スライスヘッダSHに含まれる符号化パラメータの一例である。また、スライスヘッダSHには、動画像復号装置1の備えるループフィルタ(不図示)によって参照されるフィルタパラメータFPが含まれる。 The slice header SH includes a coding parameter group that the moving image decoding apparatus 1 refers to in order to determine a decoding method of the target slice. Slice type designation information (slice_type) for designating a slice type is an example of an encoding parameter included in the slice header SH. In addition, the slice header SH includes a filter parameter FP that is referred to by a loop filter (not shown) included in the video decoding device 1.
 なお、スライスタイプ指定情報により指定可能なスライスタイプとしては、(1)符号化の際にイントラ予測のみを用いるIスライス、(2)符号化の際に単方向予測、又は、イントラ予測を用いるPスライス、(3)符号化の際に単方向予測、双方向予測、又は、イントラ予測を用いるBスライスなどが挙げられる。 As slice types that can be specified by the slice type specification information, (1) I slice using only intra prediction at the time of encoding, and (2) P using unidirectional prediction or intra prediction at the time of encoding. Slice, (3) B-slice using unidirectional prediction, bidirectional prediction, or intra prediction at the time of encoding.
  (LCUレイヤ)
 スライスレイヤSに含まれる各LCUレイヤLCUは、処理対象のLCUである対象LCUを復号するために動画像復号装置1が参照するデータの集合である。LCUレイヤLCUは、図3の(c)に示すように、LCUヘッダLCUH、および、LCUを4分木分割することにより得られる複数の符号化単位(CU:Coding Unit)CU1~CUNLを含んでいる。
(LCU layer)
Each LCU layer LCU included in the slice layer S is a set of data that the video decoding device 1 refers to in order to decode the target LCU that is the processing target LCU. LCU layer LCU, as shown in (c) of FIG. 3, LCU header LCUH, and a plurality of coding units obtained by the quadtree dividing the LCU: the (CU Coding Unit) CU 1 ~ CU NL Contains.
 各CUのとり得るサイズは、符号化データ#1のシーケンスパラメータセットSPSに含まれる、LCUのサイズおよび階層深度(hierarchical depth)に依存する。例えば、LCUのサイズが128×128画素であって、最大階層深度が5である場合には、当該LCUに含まれるCUは、5種類のサイズ、すなわち、128×128画素、64×64画素、32×32画素、16×16画素、および、8×8画素の何れかをとり得る。また、それ以上分割されないCUをリーフCUと呼ぶことにする。 The size that each CU can take depends on the LCU size and the hierarchical depth included in the sequence parameter set SPS of the encoded data # 1. For example, when the size of the LCU is 128 × 128 pixels and the maximum hierarchical depth is 5, the CU included in the LCU has five types of sizes, that is, 128 × 128 pixels, 64 × 64 pixels, Any of 32 × 32 pixels, 16 × 16 pixels, and 8 × 8 pixels can be taken. A CU that is not further divided is called a leaf CU.
  (LCUヘッダ)
 LCUヘッダLCUHには、対象LCUの復号方法を決定するために動画像復号装置1が参照する符号化パラメータが含まれる。具体的には、図3の(c)に示すように、対象LCUの各リーフCUへの分割パターンを指定するCU分割情報SP_CU、および、量子化ステップの大きさを指定する量子化パラメータ差分Δqp(mb_qp_delta)が含まれる。
(LCU header)
The LCU header LCUH includes an encoding parameter referred to by the video decoding device 1 in order to determine a decoding method of the target LCU. Specifically, as shown in FIG. 3C, CU partition information SP_CU that specifies a partition pattern for each leaf CU of the target LCU, and a quantization parameter difference Δqp that specifies the size of the quantization step. (Mb_qp_delta) is included.
 CU分割情報SP_CUは、具体的には、対象LCUに含まれる各CU(およびリーフCU)の形状、サイズ、および、対象LCU内での位置を指定する情報である。なお、CU分割情報SP_CUは、リーフCUの形状やサイズを明示的に含んでいる必要は必ずしもない。例えばCU分割情報SP_CUは、LCU全体またはLCUの部分領域を四分割するか否かを示すフラグ(split_coding_unit_flag)の集合であってもよい。その場合、LCUの形状やサイズを併用することで各リーフCUの形状やサイズを特定できる。 CU division information SP_CU is information that specifies the shape and size of each CU (and leaf CU) included in the target LCU, and the position in the target LCU. Note that the CU partition information SP_CU does not necessarily need to explicitly include the shape and size of the leaf CU. For example, the CU partition information SP_CU may be a set of flags (split_coding_unit_flag) indicating whether or not the entire LCU or a partial region of the LCU is divided into four. In that case, the shape and size of each leaf CU can be specified by using the shape and size of the LCU together.
 また、量子化パラメータ差分Δqpは、対象LCUにおける量子化パラメータqpと、そのLCUの直前に符号化されたLCUにおける量子化パラメータqp’との差分qp-qp’である。 Further, the quantization parameter difference Δqp is a difference qp−qp ′ between the quantization parameter qp in the target LCU and the quantization parameter qp ′ in the LCU encoded immediately before the LCU.
  (リーフCU)
 それ以上分割することができないCU(リーフCU)は予測単位(PU:Prediction Unit)、および、変換単位(TU:Transform Unit)として取り扱われる。
(Leaf CU)
A CU (leaf CU) that cannot be further divided is treated as a prediction unit (PU: Prediction Unit) and a transform unit (TU: Transform Unit).
 図3の(d)に示すように、リーフCU(図3の(d)においてはCULと表記)は、(1)動画像復号装置1により予測画像を生成する際に参照されるPU情報PUI、および、(2)動画像復号装置1により残差データを復号する際に参照されるTU情報TUIを含んでいる。なお、PU情報PUIにはスキップフラグSKIPが含まれている場合があり、スキップフラグSKIPの値が1の場合、TU情報は省略される。 As shown in (d) of FIG. 3, the leaf CU (denoted as CUL in (d) of FIG. 3) is (1) PU information PUI that is referred to when the moving image decoding apparatus 1 generates a predicted image. And (2) the TU information TUI that is referred to when the moving image decoding apparatus 1 decodes the residual data. The PU information PUI may include a skip flag SKIP. When the value of the skip flag SKIP is 1, the TU information is omitted.
 PU情報PUIは、図3の(d)に示すように、予測タイプ情報PT、および、予測情報PIを含んでいる。予測タイプ情報PTは、対象リーフCU(対象PU)についての予測画像生成方法として、イントラ予測を用いるのか、または、インター予測を用いるのかを指定する情報である。予測情報PIは、予測タイプ情報PTが何れの予測方法を指定するのかに応じて、イントラ予測情報、または、インター予測情報より構成される。以下では、イントラ予測が適用されるPUをイントラPUとも呼称し、インター予測が適用されるPUをインターPUとも呼称する。 The PU information PUI includes prediction type information PT and prediction information PI, as shown in FIG. The prediction type information PT is information that specifies whether intra prediction or inter prediction is used as a predicted image generation method for the target leaf CU (target PU). The prediction information PI is composed of intra prediction information or inter prediction information depending on which prediction method the prediction type information PT designates. Hereinafter, a PU to which intra prediction is applied is also referred to as an intra PU, and a PU to which inter prediction is applied is also referred to as an inter PU.
 PU情報PUIには、対象PUに含まれる各パーティションの形状、サイズ、および、対象PU内での位置を指定する情報が含まれる。ここで、パーティションとは、対象リーフCUを構成する1又は複数の重複しない領域のことであり、予測画像の生成は、パーティションを単位として行われる。 The PU information PUI includes information specifying the shape and size of each partition included in the target PU and the position in the target PU. Here, the partition is one or a plurality of non-overlapping areas constituting the target leaf CU, and the generation of the predicted image is performed in units of partitions.
 TU情報TUIは、図3の(d)に示すように、対象リーフCU(対象TU)の各ブロックへの分割パターンを指定するTU分割情報SP_TU、および、量子化予測残差QD1~QDNT(NTは、対象TUに含まれるブロックの総数)を含んでいる。 As shown in FIG. 3 (d), the TU information TUI includes TU partition information SP_TU that specifies a partition pattern for each block of the target leaf CU (target TU), and quantized prediction residuals QD 1 to QD NT. (NT is the total number of blocks included in the target TU).
 TU分割情報SP_TUは、具体的には、対象TUに含まれる各ブロックの形状、サイズ、および、対象TU内での位置を指定する情報である。各TUは、例えば、64×64画素から2×2画素までのサイズをとり得る。ここで、ブロックとは、対象リーフCUを構成する1又は複数の重複しない領域のことであり、予測残差の符号化・復号は、TUあるいはTUを分割したブロックを単位として行われる。 TU partition information SP_TU is information that specifies the shape and size of each block included in the target TU and the position in the target TU. Each TU can be, for example, a size from 64 × 64 pixels to 2 × 2 pixels. Here, the block is one or a plurality of non-overlapping areas constituting the target leaf CU, and prediction residual encoding / decoding is performed in units of TUs or blocks obtained by dividing TUs.
 各量子化予測残差QDは、動画像符号化装置2が以下の処理1~3を、処理対象のブロックである対象ブロックに施すことによって生成した符号化データである。処理1:符号化対象画像から予測画像を減算した予測残差をDCT変換(Discrete Cosine Transform)する。処理2:処理1にて得られた変換係数を量子化する。処理3:処理2にて量子化された変換係数を可変長符号化する。上述した量子化パラメータqpは、動画像符号化装置2が変換係数を量子化する際に用いた量子化ステップQPの大きさを表す(QP=2qp/6)。 Each quantized prediction residual QD is encoded data generated by the moving image encoding apparatus 2 performing the following processes 1 to 3 on a target block that is a processing target block. Process 1: DCT transform (Discrete Cosine Transform) is performed on the prediction residual obtained by subtracting the prediction image from the encoding target image. Process 2: The transform coefficient obtained in Process 1 is quantized. Process 3: The transform coefficient quantized in Process 2 is variable-length encoded. The quantization parameter qp described above represents the magnitude of the quantization step QP used when the moving image encoding apparatus 2 quantizes the transform coefficient (QP = 2 qp / 6 ).
  (予測情報PI)
 上述のとおり、予測情報PIには、インター予測情報およびイントラ予測情報の2種類がある。
(Prediction information PI)
As described above, there are two types of prediction information PI: inter prediction information and intra prediction information.
 インター予測情報には、動画像復号装置1が、インター予測によってインター予測画像を生成する際に参照される符号化パラメータが含まれる。より具体的には、インター予測情報には、対象PU(インターPU)の各パーティションへの分割パターンを指定するインターPU分割情報、および、各パーティションについてのインター予測パラメータが含まれる。 The inter prediction information includes an encoding parameter that is referred to when the video decoding device 1 generates an inter predicted image by inter prediction. More specifically, the inter prediction information includes inter PU partition information that specifies a partition pattern of the target PU (inter PU) into each partition, and inter prediction parameters for each partition.
 インター予測パラメータには、参照画像インデックスと、推定動きベクトルインデックスと、動きベクトル残差とが含まれる。 The inter prediction parameters include a reference image index, an estimated motion vector index, and a motion vector residual.
 一方、イントラ予測情報には、動画像復号装置1が、イントラ予測によってイントラ予測画像を生成する際に参照される符号化パラメータが含まれる。より具体的には、イントラ予測情報には、対象PU(イントラPU)の各パーティションへの分割パターンを指定するイントラPU分割情報、および、各パーティションについてのイントラ予測パラメータが含まれる。イントラ予測パラメータは、各パーティションについてのイントラ予測方法(予測モード)を指定するためのパラメータである。 On the other hand, the intra prediction information includes an encoding parameter that is referred to when the video decoding device 1 generates an intra predicted image by intra prediction. More specifically, the intra prediction information includes intra PU partition information for specifying a partition pattern of the target PU (intra PU) into each partition, and intra prediction parameters for each partition. The intra prediction parameter is a parameter for designating an intra prediction method (prediction mode) for each partition.
 〔動画像復号装置〕
 以下では、本実施形態に係る動画像復号装置1の構成について、図1~図8を参照して説明する。
[Video decoding device]
Hereinafter, the configuration of the video decoding device 1 according to the present embodiment will be described with reference to FIGS.
  (動画像復号装置の概要)
 動画像復号装置1は、パーティション毎に予測画像を生成し、生成された予測画像と、データ#1から復号された予測残差とを加算することによって復号画像#2を生成し、生成された復号画像#2を外部に出力する。
(Outline of video decoding device)
The video decoding device 1 generates a predicted image for each partition, generates a decoded image # 2 by adding the generated predicted image and the prediction residual decoded from the data # 1, and is generated The decoded image # 2 is output to the outside.
 ここで、予測画像の生成は、符号化データ#1を復号することによって得られる符号化パラメータを参照して行われる。ここで、符号化パラメータとは、予測画像を生成するために参照されるパラメータのことであり、画面間予測において参照される動きベクトルや画面内予測において参照される予測モードなどの予測パラメータに加えて、パーティションのサイズや形状、ブロックのサイズや形状、および、原画像と予測画像との残差データなどが含まれる。以下では、符号化パラメータに含まれる情報のうち、上記残差データを除く全ての情報の集合を、サイド情報と呼ぶ。 Here, the generation of the predicted image is performed with reference to the encoding parameter obtained by decoding the encoded data # 1. Here, the encoding parameter is a parameter referred to in order to generate a prediction image, and in addition to a prediction parameter such as a motion vector referred to in inter-screen prediction and a prediction mode referred to in intra-screen prediction. Partition size and shape, block size and shape, and residual data between the original image and the predicted image. Hereinafter, a set of all information excluding the residual data among the information included in the encoding parameter is referred to as side information.
 また、以下では、上記予測単位が、LCUを構成するパーティションである場合を例に挙げ説明を行うが、本実施形態はこれに限定されるものではなく、予測単位がパーティションよりも大きい単位である場合、および、予測単位がパーティションよりも小さい単位である場合に対しても適用することができる。 Further, in the following description, the case where the prediction unit is a partition constituting the LCU will be described as an example. However, the present embodiment is not limited to this, and the prediction unit is a unit larger than the partition. The present invention can also be applied to the case where the prediction unit is a unit smaller than the partition.
 また、以下では、復号の対象となるフレーム(ピクチャ)、スライス、LCU、ブロック、および、パーティションをそれぞれ、対象フレーム、対象スライス、対象LCU、対象ブロック、および、対象パーティションと呼ぶことにする。 In the following, a frame (picture), a slice, an LCU, a block, and a partition to be decoded are referred to as a target frame, a target slice, a target LCU, a target block, and a target partition, respectively.
 なお、LCUのサイズは、例えば64×64画素であり、パーティションのサイズは、例えば、64×64画素、32×32画素、16×16画素、8×8画素や4×4画素などであるが、これらのサイズは本実施形態を限定するものではなく、LCUのサイズおよびパーティションはそれらのサイズ以外のサイズであってもよい。 The LCU size is, for example, 64 × 64 pixels, and the partition size is, for example, 64 × 64 pixels, 32 × 32 pixels, 16 × 16 pixels, 8 × 8 pixels, 4 × 4 pixels, or the like. These sizes do not limit the present embodiment, and the size and partition of the LCU may be other sizes.
  (動画像復号装置の構成)
 再び、図2を参照して、動画像復号装置1の概略的構成について説明すると次のとおりである。図2は、動画像復号装置1の概略的構成について示した機能ブロック図である。
(Configuration of video decoding device)
Referring to FIG. 2 again, the schematic configuration of the moving picture decoding apparatus 1 will be described as follows. FIG. 2 is a functional block diagram showing a schematic configuration of the moving picture decoding apparatus 1.
 図2に示すように動画像復号装置1は、可変長符号逆多重化部11、TU情報復号部12、逆量子化・逆変換部13、予測画像生成部(チャンネル復号手段)14、加算器(チャンネル復号手段)15およびフレームメモリ16を備えている。 As shown in FIG. 2, the moving picture decoding apparatus 1 includes a variable length code demultiplexing unit 11, a TU information decoding unit 12, an inverse quantization / inverse conversion unit 13, a predicted image generation unit (channel decoding unit) 14, and an adder. (Channel decoding means) 15 and a frame memory 16 are provided.
   [可変長符号逆多重化部]
 可変長符号逆多重化部11は、動画像復号装置1に入力された1フレーム分の符号化データ#1を、逆多重化することで、図3に示した階層構造に含まれる各種情報に分離する。例えば、可変長符号逆多重化部11は、各種ヘッダに含まれる情報を参照して、符号化データ#1を、スライス、LCUに順次分離する。
[Variable length code demultiplexer]
The variable-length code demultiplexing unit 11 demultiplexes the encoded data # 1 for one frame input to the video decoding device 1 to obtain various kinds of information included in the hierarchical structure shown in FIG. To separate. For example, the variable length code demultiplexing unit 11 refers to information included in various headers, and sequentially separates the encoded data # 1 into slices and LCUs.
 ここで、各種ヘッダには、(1)対象フレームのスライスへの分割方法についての情報、および(2)対象スライスに属するLCUのサイズ、形状および対象スライス内での位置についての情報が含まれる。 Here, the various headers include (1) information on the method of dividing the target frame into slices, and (2) information on the size, shape, and position of the LCU belonging to the target slice.
 そして、可変長符号逆多重化部11は、符号化LCUヘッダLCUHに含まれるCU分割情報SP_CUを参照して、対象LCUを、リーフCUに分割する。また、可変長符号逆多重化部11は、対象リーフCU:CULについてTU情報TUI、およびPU情報PUIを取得する。 Then, the variable length code demultiplexer 11 refers to the CU partition information SP_CU included in the encoded LCU header LCUH and divides the target LCU into leaf CUs. In addition, the variable-length code demultiplexing unit 11 acquires the TU information TUI and the PU information PUI for the target leaf CU: CUL.
 可変長符号逆多重化部11は、対象リーフCUについて得られたTU情報TUIをTU情報復号部12に供給する。また、可変長符号逆多重化部11は、対象リーフCUについて得られたPU情報PUIを予測画像生成部14に供給する。 The variable length code demultiplexing unit 11 supplies the TU information TUI obtained for the target leaf CU to the TU information decoding unit 12. In addition, the variable length code demultiplexing unit 11 supplies the PU information PUI obtained for the target leaf CU to the predicted image generation unit 14.
   [TU情報復号部]
 TU情報復号部12は、可変長符号逆多重化部11から供給されるTU情報TUIの復号を行う。
[TU information decoding unit]
The TU information decoding unit 12 decodes the TU information TUI supplied from the variable length code demultiplexing unit 11.
 具体的には、TU情報復号部12は、まず、可変長符号逆多重化部11から供給される、対象リーフCUについてのTU情報TUIからTU分割情報SP_TUを復号する。 Specifically, the TU information decoding unit 12 first decodes the TU partition information SP_TU from the TU information TUI for the target leaf CU supplied from the variable length code demultiplexing unit 11.
 また、TU情報復号部12は、復号したTU分割情報SP_TUに従って、対象リーフCUを1または複数のブロックへと分割する。 Further, the TU information decoding unit 12 divides the target leaf CU into one or a plurality of blocks according to the decoded TU division information SP_TU.
 そして、TU情報復号部12は、各ブロックについて、TU情報TUIからTU分割情報SP_TUおよび量子化予測残差QDを復号する。ここで、各ブロックについての量子化予測残差QDは、量子化された変換係数が2次元の行列に配列された形式で表現できる。以下、量子化された変換係数の2次元の行列表現のことを係数行列と称する。なお、TU情報復号部12において、TU情報TUIから係数行列を得るための構成の詳細については後述する。 Then, the TU information decoding unit 12 decodes the TU partition information SP_TU and the quantized prediction residual QD from the TU information TUI for each block. Here, the quantized prediction residual QD for each block can be expressed in a format in which quantized transform coefficients are arranged in a two-dimensional matrix. Hereinafter, a two-dimensional matrix representation of quantized transform coefficients is referred to as a coefficient matrix. Details of the configuration for obtaining the coefficient matrix from the TU information TUI in the TU information decoding unit 12 will be described later.
 TU情報復号部12は、復号したTU分割情報SP_TU’および量子化予測残差QD’を含む復号済みTU情報TUI’を逆量子化・逆変換部13に供給する。 The TU information decoding unit 12 supplies the decoded TU information TUI ′ including the decoded TU partition information SP_TU ′ and the quantized prediction residual QD ′ to the inverse quantization / inverse conversion unit 13.
   [逆量子化・逆変換部]
 逆量子化・逆変換部13は、TU情報復号部12から供給される復号済みTU情報TUI’に基づいて対象リーフCUについて、ブロックごとに、量子化予測残差の逆量子化・逆変換を行う。逆量子化・逆変換部13は、復号済みTU情報TUI’に含まれる量子化予測残差QD’を逆量子化および逆DCT変換(Inverse Discrete Cosine Transform)することによって、各対象パーティションについて、画素毎の予測残差Dを復元する。逆量子化・逆変換部13は、復元した予測残差Dを加算器14に供給する。
[Inverse quantization / inverse transform unit]
The inverse quantization / inverse transform unit 13 performs inverse quantization / inverse transformation of the quantization prediction residual for each block on the target leaf CU based on the decoded TU information TUI ′ supplied from the TU information decoding unit 12. Do. The inverse quantization / inverse transform unit 13 performs inverse quantization and inverse DCT transform (Inverse Discrete Cosine Transform) on the quantized prediction residual QD ′ included in the decoded TU information TUI ′, so that a pixel is obtained for each target partition. The prediction residual D for each is restored. The inverse quantization / inverse transform unit 13 supplies the restored prediction residual D to the adder 14.
   [予測画像生成部]
 予測画像生成部14は、対象リーフCUに含まれる各パーティションについて、パーティションの周辺の復号済み画像である局所復号画像P’を参照して、イントラ予測またはインター予測により予測画像Predを生成する。
[Predicted image generator]
For each partition included in the target leaf CU, the predicted image generation unit 14 refers to a local decoded image P ′ that is a decoded image around the partition, and generates a predicted image Pred by intra prediction or inter prediction.
 予測画像生成部14は、具体的には、次のように動作する。まず、予測画像生成部14は、可変長符号逆多重化部11から供給される、対象リーフCUについてのPU情報PUIを復号する。続いて、予測画像生成部14は、PU情報PUIに従って、対象リーフCUの各パーティションへの分割パターンを決定する。さらに、予測画像生成部14は、PU情報PUIに従って、各パーティションの予測モードを選択して、選択した各予測モードを各パーティションに割り付ける。 Specifically, the predicted image generation unit 14 operates as follows. First, the predicted image generation unit 14 decodes the PU information PUI for the target leaf CU supplied from the variable length code demultiplexing unit 11. Subsequently, the predicted image generation unit 14 determines a division pattern for each partition of the target leaf CU according to the PU information PUI. Further, the predicted image generation unit 14 selects a prediction mode of each partition according to the PU information PUI, and assigns each selected prediction mode to each partition.
 そして、予測画像生成部14は、対象リーフCUに含まれる各パーティションについての予測画像Predを、選択した予測モードと該パーティションの周辺の局所復号画像P’の画素値とを参照して生成する。予測画像生成部14は、対象リーフCUについて生成した予測画像Predを加算器15に供給する。 Then, the predicted image generation unit 14 generates a predicted image Pred for each partition included in the target leaf CU with reference to the selected prediction mode and the pixel values of the local decoded image P ′ around the partition. The predicted image generation unit 14 supplies the predicted image Pred generated for the target leaf CU to the adder 15.
   [加算器]
 加算器15は、予測画像生成部14より供給される予測画像Predと、逆量子化・逆変換部13より供給される予測残差Dとを加算することによって、対象リーフCUについての復号画像Pを生成する。
[Adder]
The adder 15 adds the predicted image Pred supplied from the predicted image generation unit 14 and the prediction residual D supplied from the inverse quantization / inverse transform unit 13, thereby decoding the decoded image P for the target leaf CU. Is generated.
   [フレームメモリ]
 フレームメモリ16には、復号された復号画像Pが順次記録される。フレームメモリ16には、対象LCUを復号する時点において、当該対象LCUよりも先に復号された全てのLCU(例えば、ラスタスキャン順で先行する全てのLCU)に対応する復号画像が記録されている。
[Frame memory]
The decoded image P that has been decoded is sequentially recorded in the frame memory 16. In the frame memory 16, at the time of decoding the target LCU, decoded images corresponding to all the LCUs decoded before the target LCU (for example, all the LCUs preceding in the raster scan order) are recorded. .
 なお、動画像復号装置1において、画像内の全てのLCUに対して、LCU単位の復号画像生成処理が終わった時点で、動画像復号装置1に入力された1フレーム分の符号化データ#1に対応する復号画像#2が外部に出力される。 Note that, in the moving image decoding apparatus 1, one frame of encoded data # 1 input to the moving image decoding apparatus 1 at the time when the decoded image generation processing for each LCU is completed for all the LCUs in the image. The decoded image # 2 corresponding to is output to the outside.
  (係数のスキャンについて)
 ここで、TU情報復号部12の構成の詳細について説明する前に、まず、図4を用いて、量子化された変換係数のスキャンの例について説明する。図4は、量子化された変換係数のスキャンについて例示する図である。図4の(a)は、8×8の係数行列MX10のスキャン例を示しており、同図の(b)は、スキャン結果により得られる1次元配列ARR10について示している。
(About coefficient scanning)
Here, before describing the details of the configuration of the TU information decoding unit 12, first, an example of scanning of quantized transform coefficients will be described with reference to FIG. FIG. 4 is a diagram illustrating scanning of quantized transform coefficients. 4A shows a scan example of the 8 × 8 coefficient matrix MX10, and FIG. 4B shows the one-dimensional array ARR10 obtained from the scan result.
 上述のとおり、量子化された変換係数(以下、単に係数と称する)は、例えば、図4の(a)に示すような8×8の係数行列MX10の形式で表現することができる。また、図4の(a)に示す数字は、スキャン順序である。係数の符号化においては、まず、図4の(a)に示すスキャン順序(点線矢印の順序でもある)で、係数行列MX10がスキャンされる。スキャンとは、係数行列MX10における座標を、1次元のスキャン順インデックスに変換する処理である。同図の(a)に示す数字の順序で係数がスキャンされることにより、係数が1次元配列ARR10に格納される。 As described above, the quantized transform coefficients (hereinafter simply referred to as coefficients) can be expressed in the form of an 8 × 8 coefficient matrix MX10 as shown in FIG. Also, the numbers shown in FIG. 4A are the scan order. In the coding of coefficients, first, the coefficient matrix MX10 is scanned in the scan order (also the order of dotted arrows) shown in FIG. Scanning is a process of converting the coordinates in the coefficient matrix MX10 into a one-dimensional scan order index. When the coefficients are scanned in the numerical order shown in FIG. 4A, the coefficients are stored in the one-dimensional array ARR10.
 より具体的には、図4の(a)に示す係数行列MX10の左上の”1”からスキャンが開始される。つまり、1番目にスキャンされるのは、DC成分の係数(以下、DC係数と称する)DCである。続いて、DC係数DCの右隣の”2”の位置からジグザグに係数がスキャンされる。そして、順に、係数が、”64”の位置にある係数行列の最後の係数FINまでスキャンされる。なお、DC係数DCは、係数行列において座標(0,0)である。また、スキャン順インデックスは、図4の(a)に示す数字から1を引いたものであり、DC係数DCのスキャン順インデックスは、0である。 More specifically, scanning starts from “1” in the upper left of the coefficient matrix MX10 shown in FIG. That is, the DC component coefficient (hereinafter referred to as DC coefficient) DC is scanned first. Subsequently, the coefficient is scanned in a zigzag manner from the position “2” on the right side of the DC coefficient DC. Then, in order, the coefficients are scanned up to the last coefficient FIN of the coefficient matrix at the position “64”. The DC coefficient DC is a coordinate (0, 0) in the coefficient matrix. The scan order index is obtained by subtracting 1 from the number shown in FIG. 4A, and the scan order index of the DC coefficient DC is 0.
 これにより、図4の(b)に示す1次元配列ARR10に、DC係数DCから、係数FINまでが格納される。 Thereby, the DC coefficient DC to the coefficient FIN are stored in the one-dimensional array ARR10 shown in FIG.
 ところで、高周波成分の係数の値は、ゼロまたはゼロに近くなる傾向がある一方で、低周波成分の係数の値は、ゼロでないまたは値が大きい可能性が高いという特性がある。このためジグザグスキャンは、低周波成分の係数を早くスキャンするスキャン順序となっている。 By the way, while the coefficient value of the high frequency component tends to be zero or close to zero, the coefficient value of the low frequency component is not zero or has a high possibility of being large. For this reason, the zigzag scan has a scan order in which the low-frequency component coefficients are scanned quickly.
 ”64”までスキャンが完了し、すべての係数が1次元配列ARR10に格納されると、その後、符号化処理が開始される。 When the scan is completed up to “64” and all the coefficients are stored in the one-dimensional array ARR10, the encoding process is started thereafter.
 なお、符号化処理は、スキャンとは逆の順序にて行われる。すなわち、符号化処理は、”64”から”1”にかけて行われる。以下において、この処理順序のことを逆順のジグザグスキャンとも呼ぶ。 Note that the encoding process is performed in the reverse order of the scan. That is, the encoding process is performed from “64” to “1”. Hereinafter, this processing order is also referred to as reverse zigzag scanning.
 上述のとおり”64”に近い位置にある係数は、高周波成分であるので、”0”であることが多い。よって、符号化処理においては、このようなゼロ係数の符号化を省略し、DC係数からみて最後の非ゼロの係数を基点に行われる。以下、DC係数からみて最後に現れる非ゼロの係数のことを最後の係数と称する。また、係数の符号化処理の詳細については、別途説明する。 As described above, the coefficient at a position close to “64” is a high-frequency component, and is often “0”. Therefore, in the encoding process, encoding of such zero coefficients is omitted, and the process is performed based on the last non-zero coefficient as viewed from the DC coefficient. Hereinafter, the non-zero coefficient that appears last from the viewpoint of the DC coefficient is referred to as the last coefficient. Details of the coefficient encoding process will be described separately.
 なお、以上では、説明の便宜上、8×8の係数行列のスキャン例を示したが、4×4の係数行列をスキャンする場合についても同様のことが言える。 In the above, for convenience of explanation, an example of scanning an 8 × 8 coefficient matrix is shown, but the same can be said for a case of scanning a 4 × 4 coefficient matrix.
  (係数の符号化について)
 以下において、動画像符号化装置2において符号化される係数符号化データについて説明する。なお、係数行列の第1行目または第1列目に最後の係数がない場合、動画像符号化装置2では、上述のとおりスキャンと逆順の順番で、最後の係数から、DC係数にかけて符号化が行われているものとする。この場合の符号化処理を、以下、一括の係数符号化処理と称する。
(About coefficient coding)
Hereinafter, coefficient encoded data encoded by the moving image encoding apparatus 2 will be described. If there is no last coefficient in the first row or the first column of the coefficient matrix, the moving picture coding apparatus 2 performs coding from the last coefficient to the DC coefficient in the reverse order of scanning as described above. Is assumed to have been performed. The encoding process in this case is hereinafter referred to as a batch coefficient encoding process.
 また、係数行列の第1行目または第1列目に最後の係数がある場合、動画像復号装置1では、2段階で係数符号化処理を行う。 Further, when the last coefficient is in the first row or the first column of the coefficient matrix, the moving picture decoding apparatus 1 performs the coefficient encoding process in two stages.
 具体的には、最後の係数がある第1行目または第1列目を符号化の第1の対象範囲とする第1段階の係数符号化処理と、第1行目または第1列目以外の行または列を符号化の第2の対象範囲とする第2段階の係数符号化処理との2段階である。 Specifically, a first-stage coefficient encoding process in which the first row or first column with the last coefficient is the first target range of encoding, and other than the first row or first column This is a two-stage process with a second-stage coefficient encoding process in which the second row or column is the second target range of encoding.
 第1段階の係数符号化処理では、第1の対象範囲において、最後の係数からDC係数までが順に直線的にスキャンされ符号化される。 In the first stage coefficient encoding process, the last coefficient to the DC coefficient are sequentially scanned and encoded in order in the first target range.
 第2段階の係数符号化処理では、第2の対象範囲における、スキャン順上の最後の非ゼロ係数からスキャン順上の最初の係数までが第2の対象範囲の中で順にジグザグにスキャンされ符号化される。 In the second-stage coefficient encoding process, the second non-zero coefficient in the second target range to the first coefficient in the scan order are scanned zigzag in the second target range in order. It becomes.
 なお、動画像符号化装置2における係数符号化データの詳細は、後述する。 The details of the coefficient coded data in the moving picture coding apparatus 2 will be described later.
   [最後の係数]
 最後の係数は、最後の係数の位置last_pos、最後の係数のレベルlevel、最後の係数の正負符号signが符号化される。ここで係数のレベルとは、係数の絶対値を意味する。last_posは、スキャン順インデックスの形式の値をとる。最後の係数が、スキャン順で10番目(DC係数を1番目とする)であり、その値が”-1”である場合は次のとおりである。
[Last coefficient]
The last coefficient is encoded with the position of the last coefficient last_pos, the level of the last coefficient level, and the sign of the last coefficient sign. Here, the coefficient level means the absolute value of the coefficient. last_pos takes a value in the form of a scan order index. The case where the last coefficient is the 10th in the scanning order (the DC coefficient is the first) and the value is “−1” is as follows.
 last_pos:9
 level:1,sign:1
 なお、2段階で係数符号化処理を行う場合、それぞれの段階における対象範囲において、最後の係数が検出されて符号化される。例えば、第1の段階であれば、係数行列全体の最後の係数そのものであり、第2の段階であれば、第2の対象範囲におけるスキャン順上の最後の非ゼロ係数である。
last_pos: 9
level: 1, sign: 1
In the case where the coefficient encoding process is performed in two stages, the last coefficient is detected and encoded in the target range in each stage. For example, if it is the first stage, it is the last coefficient itself of the entire coefficient matrix, and if it is the second stage, it is the last non-zero coefficient in the scan order in the second target range.
   [ランモード]
 ランモードとは、連続するゼロ係数の数(0ラン)を符号化するモードである。ランモードでは、係数ごとに、0ランrun、係数のレベルlevel、および係数の正負符号signが符号化される。次に符号化する非ゼロ係数が、前の非ゼロ係数との間に0を1つ挟んでおり、かつ値が”1”である場合は次のとおりである。
[Run mode]
The run mode is a mode for encoding the number of consecutive zero coefficients (0 run). In the run mode, for each coefficient, a 0 run, a coefficient level, and a coefficient sign sign are encoded. The next case where the non-zero coefficient to be encoded is one 0 between the previous non-zero coefficient and the value is “1” is as follows.
 run:1,level:1,sign:0
 なお、非特許文献3では、levelが2以上の係数が出現した場合を、ランモードの終了条件のひとつとして用いている。
run: 1, level: 1, sign: 0
In Non-Patent Document 3, a case where a coefficient having a level of 2 or more appears is used as one of the end conditions of the run mode.
   [非ランモード]
 非ランモードとは、ゼロ係数であっても、1つずつ符号化するモードである。非ランモードでは、係数ごとに、係数のレベルlevel、および係数の正負符号signが符号化される。符号化する係数の値が”-6”である場合、および符号化する係数がゼロ係数である場合はそれぞれ次のとおりである。
[Non-run mode]
The non-run mode is a mode that encodes one by one even with zero coefficients. In the non-run mode, for each coefficient, the coefficient level level and the coefficient sign sign are encoded. The case where the value of the coefficient to be encoded is “−6” and the case where the coefficient to be encoded is a zero coefficient are as follows.
 level:6,sign:1
 level:0
   [備考]
 なお、以上に示した符号化データは、単なる例示であり、シンタックス要素としては上記と異なる名称または定義により符号化されていてもよい。例えば、ランモードの係数のレベルlevelは、isLevelOne(levelは1)、および、これに追加してlevel_magnitude_minus2(係数値が2以上の場合であり、符号化するのは2を引いたレベル)のシンタックス要素として符号化されていてもよい(非特許文献3の「level_magnitude_minus2」を参照)。
level: 6, sign: 1
level: 0
[Remarks]
The encoded data shown above is merely an example, and the syntax element may be encoded with a name or definition different from the above. For example, the level level of the coefficient of the run mode is a thin level of isLevelOne (level is 1) and additionally, level_magnitude_minus2 (when the coefficient value is 2 or more, encoding is a level obtained by subtracting 2). It may be encoded as a tax element (see “level_magnitude_minus2” in Non-Patent Document 3).
 なお、levelは、最後の係数については、last_pos_levelのシンタックス要素として符号化されていてもよい。 Note that the level may be encoded as a syntax element of the last_pos_level for the last coefficient.
 また、非ランモードのlevelは、level_magnitudeのシンタックス要素として符号化されていてもよい。 Further, the level of the non-run mode may be encoded as a syntax element of the level_magnitude.
  (TU情報復号部)
 次に、図1を用いてTU情報復号部12の構成についてさらに詳しく説明する。図1は、TU情報復号部12の構成について示すブロック図である。
(TU information decoding unit)
Next, the configuration of the TU information decoding unit 12 will be described in more detail with reference to FIG. FIG. 1 is a block diagram showing the configuration of the TU information decoding unit 12.
 なお、以下では、TU情報復号部12が、TU情報TUIに含まれる符号化データのうち、符号化された量子化予測残差QD、すなわち係数符号化データC10を復号するための構成について説明する。 Hereinafter, a configuration for the TU information decoding unit 12 to decode the encoded quantized prediction residual QD, that is, the coefficient encoded data C10 among the encoded data included in the TU information TUI will be described. .
 しかしながら、これに限られずTU情報復号部12は、符号化データに含まれる係数符号化データC10以外のデータ、例えば、サイド情報等を復号することができる。 However, the TU information decoding unit 12 is not limited to this, and can decode data other than the coefficient encoded data C10 included in the encoded data, for example, side information.
 また、以下では、係数符号化データC10を復号して得られる係数行列MX10のサイズは、例示的に、8×8であるとする。 In the following, it is assumed that the size of the coefficient matrix MX10 obtained by decoding the coefficient encoded data C10 is, for example, 8 × 8.
 図1に示すように、TU情報復号部12は、最後の係数復号部(最後の係数位置検出手段)121、位置判定部(位置判定手段、距離判定手段)122、2段階復号部123、一括復号部124、直線スキャン用VLCテーブルTBL11、およびジグザグスキャン用VLCテーブルTBL12を備える。 As shown in FIG. 1, the TU information decoding unit 12 includes a last coefficient decoding unit (last coefficient position detection unit) 121, a position determination unit (position determination unit, distance determination unit) 122, a two-stage decoding unit 123, and a batch. A decoding unit 124, a linear scanning VLC table TBL11, and a zigzag scanning VLC table TBL12 are provided.
 最後の係数復号部121は、係数符号化データC10から最後の係数を復号する。具体的には、最後の係数復号部121は、係数符号化データC10に含まれる最後の係数の位置last_pos、最後の係数のレベルlevel、および最後の係数の正負符号signを復号する。 The last coefficient decoding unit 121 decodes the last coefficient from the coefficient encoded data C10. Specifically, the last coefficient decoding unit 121 decodes the last coefficient position last_pos, the last coefficient level level, and the last coefficient sign sign included in the coefficient coded data C10.
 位置判定部122は、最後の係数復号部121が復号した最後の係数の位置last_posを判定する。位置判定部122は、最後の係数の位置に応じて、2段階復号部123または一括復号部124のいずれにおいて係数復号処理を行うかを決定する。 The position determination unit 122 determines the last coefficient position last_pos decoded by the last coefficient decoding unit 121. The position determination unit 122 determines whether to perform the coefficient decoding process in the two-stage decoding unit 123 or the collective decoding unit 124 according to the position of the last coefficient.
 具体的には、位置判定部122は、最後の係数の位置last_pos(=LastIdx)とすると、
 LastX=scanX(LastIdx)、LastY=scanY(LastIdx
を計算して、係数行列における最後の係数の座標(LastX,LastY)を算出する。
Specifically, the position determination unit 122 assumes that the position of the last coefficient is last_pos (= LastIdx 1 ).
LastX 1 = scanX (LastIdx 1 ), LastY 1 = scanY (LastIdx 1 )
To calculate the coordinates (LastX 1 , LastY 1 ) of the last coefficient in the coefficient matrix.
 ここで、scanXは、スキャン順インデックスをx座標に変換する関数であり、scanYは、スキャン順インデックスをy座標に変換する関数である。 Here, scanX is a function that converts a scan order index into an x coordinate, and scanY is a function that converts a scan order index into a y coordinate.
 そして、位置判定部122は、次の判定式(1)の真偽を計算する。 And the position determination part 122 calculates the truth of the following determination formula (1).
 (LastX==0   && LastY≧ThY)||
 (LastX≧ThX && LastY==0) … (1)
 なお、判定式(1)において、”&&”は、論理積の演算子であり、”||”は、論理和の演算子である。
(LastX 1 == 0 && LastY 1 ≧ ThY 1 ) ||
(LastX 1 ≧ ThX 1 && LastY 1 == 0) (1)
In the determination formula (1), “&&” is a logical product operator, and “||” is a logical sum operator.
 判定式(1)では、次の2つの判定が行われている。まず、第1に、最後の係数の位置LastIdxが、係数行列において、第1行目および第1列目のいずれかにあるか否かが判定されている(” LastX==0”と、” LastY==0”との部分)。 In the determination formula (1), the following two determinations are made. First, it is determined whether or not the last coefficient position LastIdx 1 is in either the first row or the first column in the coefficient matrix (“LastX 1 == 0”). , “LastY 1 == 0”).
 第2に、最後の係数の位置LastXが、DC係数の位置(X,Y)=(0,0)から所定以上離れているか否かが判定されている(” LastY≧ThY”および”LastX≧ThX”の部分)。 Second, it is determined whether or not the last coefficient position LastX 1 is more than a predetermined distance from the DC coefficient position (X, Y) = (0, 0) (“LastY 1 ≧ ThY 1 ” and “LastX 1 ≧ ThX 1 ”).
 これは、最後の係数の位置LastIdxが、DC係数の位置から十分離れているときに、スキャン順序の適応化の効果が向上することを見込んでのことである。 This is because the effect of adaptation of the scan order is expected to be improved when the last coefficient position LastIdx 1 is sufficiently away from the position of the DC coefficient.
 逆に言えば、最後の係数の位置LastIdxが、第1行目または第1列目にあったとしても、閾値ThXおよびThYよりもDC係数に近い位置にある場合は、スキャン順序の適応化を控える構成である。 Conversely, if the position of the last coefficient LastIdx 1 is in the first row or the first column but is closer to the DC coefficient than the thresholds ThX 1 and ThY 1 , It is a configuration that refrains from adaptation.
 なお、8×8サイズの係数行列の場合、閾値ThXおよびThYは、それぞれ”3”程度に設定することができる。 In the case of an 8 × 8 size coefficient matrix, the thresholds ThX 1 and ThY 1 can be set to about “3”, respectively.
 判定式(1)の結果が「真」である場合、位置判定部122は、2段階の係数復号処理を行うことを決定する。この場合、位置判定部122は、決定結果を、2段階復号部123に通知する。 When the result of the determination formula (1) is “true”, the position determination unit 122 determines to perform a two-stage coefficient decoding process. In this case, the position determination unit 122 notifies the determination result to the two-stage decoding unit 123.
 一方、判定式(1)の結果が「偽」である場合、位置判定部122は、一括で係数復号処理を行うことを決定する。この場合、位置判定部122は、決定結果を、一括復号部124に通知する。 On the other hand, when the result of the determination formula (1) is “false”, the position determination unit 122 determines to perform the coefficient decoding process collectively. In this case, the position determination unit 122 notifies the determination result to the batch decoding unit 124.
 2段階復号部123は、位置判定部122からの通知を受けて、2段階の係数復号処理を行う。この場合、2段階復号部123は、直線スキャン用VLCテーブルTBL11およびジグザグスキャン用VLCテーブルTBL12を参照して、対象ブロックについて2段階の係数復号処理を行う。2段階復号部123の詳細については後述する。2段階復号部123は、復号した係数行列MX10を出力する。 The two-stage decoding unit 123 receives the notification from the position determination unit 122 and performs a two-stage coefficient decoding process. In this case, the two-stage decoding unit 123 refers to the linear scan VLC table TBL11 and the zigzag scan VLC table TBL12, and performs a two-stage coefficient decoding process on the target block. Details of the two-stage decoding unit 123 will be described later. The two-stage decoding unit 123 outputs the decoded coefficient matrix MX10.
 一括復号部124は、位置判定部122からの通知を受けて、一括で係数復号処理を行う。この場合、一括復号部124は、ジグザグスキャン用VLCテーブルTBL12を参照して、対象ブロックについて一括で係数復号処理を行う。一括復号部124は、復号した係数行列MX10を出力する。 The collective decoding unit 124 receives the notification from the position determination unit 122 and performs a coefficient decoding process in a batch. In this case, the collective decoding unit 124 refers to the zigzag scan VLC table TBL12 and performs coefficient decoding processing on the target block in a batch. The collective decoding unit 124 outputs the decoded coefficient matrix MX10.
 直線スキャン用VLCテーブルTBL11は、符号化データのビット列と、各パラメータとの対応づけが定義されたテーブルである。直線スキャン用VLCテーブルTBL11は、2段階復号部123の第1段階の係数復号処理において用いられる。また、直線スキャン用VLCテーブルTBL11は、コンテキストに応じて複数定義されている。なお、コンテキストとは、対象ブロックおよびその周辺ブロックの状況のことをいう。対象ブロックおよびその周辺ブロックの状況とは、各ブロックの各種パラメータおよび各種パラメータから導出できる値等のことをいう。 The linear scan VLC table TBL11 is a table in which a bit string of encoded data is associated with each parameter. The linear scanning VLC table TBL11 is used in the first-stage coefficient decoding process of the two-stage decoding unit 123. A plurality of linear scan VLC tables TBL11 are defined according to the context. The context refers to the status of the target block and its surrounding blocks. The status of the target block and its surrounding blocks refers to various parameters of each block and values that can be derived from the various parameters.
 ジグザグスキャン用VLCテーブルTBL12は、符号化データのビット列と、各パラメータとの対応づけが定義されたテーブルである。ジグザグスキャン用VLCテーブルTBL12は、2段階復号部123の第2段階の係数復号処理と、一括復号部124における係数復号処理との両方において用いられる。また、ジグザグスキャン用VLCテーブルTBL12は、コンテキストに応じて複数定義されている。 The zigzag scan VLC table TBL12 is a table in which a bit string of encoded data is associated with each parameter. The zigzag scan VLC table TBL12 is used in both the second-stage coefficient decoding process of the two-stage decoding unit 123 and the coefficient decoding process of the collective decoding unit 124. A plurality of zigzag scan VLC tables TBL12 are defined according to the context.
  (一括復号部の構成)
 引き続き、図1を参照しながら、一括復号部124の構成についてさらに詳しく説明する。一括復号部124は、一括係数復号部241および一括逆スキャン部242を備える。なお、以下の説明では、位置判定部122が、一括で係数復号処理を行うことを決定していることとする。
(Configuration of batch decryption unit)
Next, the configuration of the collective decoding unit 124 will be described in more detail with reference to FIG. The batch decoding unit 124 includes a batch coefficient decoding unit 241 and a batch reverse scanning unit 242. In the following description, it is assumed that the position determination unit 122 has decided to perform the coefficient decoding process all at once.
 一括係数復号部241は、対象ブロックについて係数符号化データC10を入力として符号化された係数を復号することにより係数の1次元配列を出力する。すなわち、一括係数復号部241は、対象ブロックの64個の係数を要素とする1次元配列を再現する。 The collective coefficient decoding unit 241 outputs a one-dimensional array of coefficients by decoding the encoded coefficients with the coefficient encoded data C10 as input for the target block. That is, the collective coefficient decoding unit 241 reproduces a one-dimensional array having the 64 coefficients of the target block as elements.
 一括係数復号部241は、例示的に、次のようにして、係数の復号を行う。まず、一括係数復号部241は、ランモードによる復号を行う。すなわち、一括係数復号部241は、所定の条件下、0ランrun、係数のレベルlevel、および係数の正負符号signを係数ごとに復号する。所定の条件としては、例えば、係数の値が閾値を超えるか否か、あるいは、所定の数だけ係数を復号したか否かなど挙げられる。 The collective coefficient decoding unit 241 illustratively performs coefficient decoding as follows. First, the batch coefficient decoding unit 241 performs decoding in the run mode. That is, the collective coefficient decoding unit 241 decodes 0 run, coefficient level, and coefficient sign sign for each coefficient under predetermined conditions. Examples of the predetermined condition include whether or not the coefficient value exceeds a threshold value, or whether or not a predetermined number of coefficients are decoded.
 ランモードが終了すると、一括係数復号部241は、非ランモードにて復号を行う。すなわち、一括係数復号部241は、係数のレベルlevel、および係数の正負符号signを復号する。一括係数復号部241は、このようにして係数を復号することにより、1次元配列を再現する。 When the run mode ends, the batch coefficient decoding unit 241 performs decoding in the non-run mode. In other words, the collective coefficient decoding unit 241 decodes the coefficient level level and the coefficient sign sign. The collective coefficient decoding unit 241 reproduces a one-dimensional array by decoding the coefficients in this way.
 一括逆スキャン部242は、一括係数復号部241が出力した1次元配列に対して逆スキャンを行うことにより、8×8の係数行列MX10を再現する。逆スキャンとは、1次元配列に格納されている要素を順に読み取り、2次元の係数行列に配置し直す処理のことをいう。また、一括逆スキャン部242の逆スキャンには、非特許文献3の技術を採用することができる。 The collective inverse scan unit 242 reproduces the 8 × 8 coefficient matrix MX10 by performing inverse scan on the one-dimensional array output by the collective coefficient decoding unit 241. Inverse scanning refers to a process of sequentially reading elements stored in a one-dimensional array and rearranging them in a two-dimensional coefficient matrix. Further, the technique of Non-Patent Document 3 can be adopted for the reverse scan of the collective reverse scan unit 242.
  (2段階復号処理の概要)
 次に、図5を用いて、2段階復号部123による2段階復号処理の概要について説明する。図5は、2段階復号部123における処理と当該処理に関する入出力データとの関係について示した図である。
(Outline of the two-stage decoding process)
Next, the outline of the two-stage decoding process by the two-stage decoding unit 123 will be described with reference to FIG. FIG. 5 is a diagram showing the relationship between the process in the two-stage decoding unit 123 and the input / output data related to the process.
 図5に示すように、2段階復号部123は、TU情報TUIに含まれる係数符号化データC10を入力として復号処理を行い2次元の係数行列MX10を出力する。すなわち、2段階復号部123は、復号処理により、量子化された係数を要素として含む8×8の係数行列MX10を出力する。 As shown in FIG. 5, the two-stage decoding unit 123 receives the coefficient encoded data C10 included in the TU information TUI as input, performs a decoding process, and outputs a two-dimensional coefficient matrix MX10. That is, the two-stage decoding unit 123 outputs an 8 × 8 coefficient matrix MX10 including quantized coefficients as elements by decoding processing.
 なお、以下の説明では、位置判定部122は、2段階の係数復号処理を行うことを決定していることとする。 In the following description, it is assumed that the position determination unit 122 has decided to perform a two-stage coefficient decoding process.
 また、係数符号化データC10は、第1係数符号化データC11、第2段階フラグF1、および第2係数符号化データC12を含む。第2段階フラグF1は、第2段階の復号処理を実行する必要があるか否かを示すものである。 Also, the coefficient encoded data C10 includes first coefficient encoded data C11, a second stage flag F1, and second coefficient encoded data C12. The second stage flag F1 indicates whether or not the second stage decoding process needs to be executed.
 2段階復号部123では、まず第1段階の係数復号処理が次のように実行される。すなわち、まず、第1係数符号化データC11、第2段階フラグF1を入力として、直線スキャン用VLCテーブルTBL11を参照しながら第1段階における係数の復号が行われる。これにより1次元配列ARR1が出力される。1次元配列ARR1のサイズは、”8”である。 In the two-stage decoding unit 123, first, the first-stage coefficient decoding process is executed as follows. That is, first, the first coefficient encoded data C11 and the second stage flag F1 are input, and the coefficients are decoded in the first stage while referring to the linear scan VLC table TBL11. As a result, a one-dimensional array ARR1 is output. The size of the one-dimensional array ARR1 is “8”.
 また、1次元配列ARR1に対して逆スキャン(直線)が行われる。これにより、8×8の係数行列MX10のうち、第1行目の係数行列MX11(8×1)が再現される。 Also, reverse scanning (straight line) is performed on the one-dimensional array ARR1. Accordingly, the coefficient matrix MX11 (8 × 1) in the first row is reproduced from the 8 × 8 coefficient matrix MX10.
 さらに、第2段階フラグF1に従い、2段階復号部123において、第2段階の係数復号処理が実行される。すなわち、第2係数符号化データC12を入力として、ジグザグスキャン用VLCテーブルTBL12を参照しながら、第2段階における係数の復号が行われる。これにより1次元配列ARR2が出力される。 Further, according to the second-stage flag F1, the second-stage decoding unit 123 performs the second-stage coefficient decoding process. That is, the coefficient decoding in the second stage is performed with the second coefficient encoded data C12 as input and referring to the zigzag scan VLC table TBL12. As a result, a one-dimensional array ARR2 is output.
 また、1次元配列ARR2に対して逆スキャンが行われる。これにより、8×8の係数行列MX10のうち、残りの係数を含む係数行列MX12(8×7)が再現される。なお、係数行列MX12では、8行目が空になっているが、見かけ上は、8×8の係数行列として係数符号化処理が可能である。つまり、一括での係数符号化処理の処理順序が適用可能である。また、この逆スキャンは、非特許文献3の技術を採用することができる。 Also, reverse scanning is performed on the one-dimensional array ARR2. Thus, the coefficient matrix MX12 (8 × 7) including the remaining coefficients is reproduced from the 8 × 8 coefficient matrix MX10. In the coefficient matrix MX12, the eighth row is empty, but apparently, the coefficient encoding process can be performed as an 8 × 8 coefficient matrix. In other words, the processing order of the coefficient encoding processing in a batch is applicable. Moreover, the technique of nonpatent literature 3 is employable for this reverse scan.
 その後、再現した係数の位置を調整するため、第1行目を空けて係数行列MX12の係数がコピーされた係数行列MX13が生成される。 Thereafter, in order to adjust the position of the reproduced coefficient, a coefficient matrix MX13 in which the coefficient of the coefficient matrix MX12 is copied is generated with the first line open.
 そして、2段階復号部123において、第1段階および第2段階の係数復号処理により得られた係数行列MX11および係数行列MX13がマージされて、係数行列MX10として出力される。 In the two-stage decoding unit 123, the coefficient matrix MX11 and the coefficient matrix MX13 obtained by the first-stage and second-stage coefficient decoding processes are merged and output as a coefficient matrix MX10.
  (2段階復号部の構成)
 次に、再び図1を参照して、2段階復号部123の構成をさらに詳しく説明する。図1に示すように、2段階復号部123は、第1係数復号部231、第1逆スキャン部232、フラグ判定部233、第2係数復号部234、および第2逆スキャン部235を備える。
(Configuration of two-stage decoding unit)
Next, the configuration of the two-stage decoding unit 123 will be described in more detail with reference to FIG. 1 again. As shown in FIG. 1, the two-stage decoding unit 123 includes a first coefficient decoding unit 231, a first inverse scanning unit 232, a flag determining unit 233, a second coefficient decoding unit 234, and a second inverse scanning unit 235.
 第1係数復号部231は、第1係数符号化データC11を入力として、係数行列において、最後の係数が含まれている行または列に含まれる係数を復号する。すなわち、第1係数復号部231は、係数行列の第1行目または第1列目に含まれる係数を復号する。 The first coefficient decoding unit 231 receives the first coefficient encoded data C11 as input, and decodes the coefficient included in the row or column including the last coefficient in the coefficient matrix. That is, the first coefficient decoding unit 231 decodes the coefficient included in the first row or the first column of the coefficient matrix.
 第1係数復号部231は、復号した1次元配列ARR1を第1逆スキャン部232に供給する。 The first coefficient decoding unit 231 supplies the decoded one-dimensional array ARR1 to the first reverse scanning unit 232.
 第1逆スキャン部232は、1次元配列ARR1を逆スキャンして、2次元配列MX11に配置し直す。 The first reverse scanning unit 232 performs reverse scanning on the one-dimensional array ARR1 and rearranges it in the two-dimensional array MX11.
 フラグ判定部233は、第2段階フラグF1のフラグを判定して、第2段階の復号処理を行うか否かを判定する。 The flag determination unit 233 determines whether or not the second-stage decoding process is performed by determining the flag of the second-stage flag F1.
 第2係数復号部234は、第2係数符号化データC12を入力として、係数行列において、最後の係数が含まれている行または列以外の行または列に含まれる係数を復号する。すなわち第2係数復号部234は、係数行列の第1行目または第1列目以外の行または列に含まれる係数を復号する。第1係数復号部231は、復号した1次元配列ARR1を第1逆スキャン部232に供給する。 The second coefficient decoding unit 234 receives the second coefficient encoded data C12 as input, and decodes a coefficient included in a row or column other than the row or column including the last coefficient in the coefficient matrix. That is, the second coefficient decoding unit 234 decodes the coefficients included in the rows or columns other than the first row or the first column of the coefficient matrix. The first coefficient decoding unit 231 supplies the decoded one-dimensional array ARR1 to the first inverse scanning unit 232.
 第2逆スキャン部235は、1次元配列ARR2を逆スキャンして、2次元配列MX12に配置し直す。 The second reverse scanning unit 235 performs reverse scanning on the one-dimensional array ARR2 and rearranges it in the two-dimensional array MX12.
  (具体例)
 次に、図6を用いて、2段階復号部123の2段階の係数復号処理の具体例について説明する。図6は、係数行列MX10の2段階の係数符号化処理または係数復号処理について示す図である。同図の(a)は、第1段階について示しており、同図の(b)は、第2段階について示している。
(Concrete example)
Next, a specific example of the two-stage coefficient decoding process of the two-stage decoding unit 123 will be described with reference to FIG. FIG. 6 is a diagram illustrating a two-stage coefficient encoding process or coefficient decoding process of the coefficient matrix MX10. (A) of the figure shows the first stage, and (b) of the figure shows the second stage.
 なお、図6に示す例において、最後の係数LTは、濃い網掛けの位置にある。また、図6に示す例では、最後の係数LTは、係数行列MX10の第1行目の第7列目に位置している。このため、最後の係数LTは、第1行目においてDC係数DCから所定距離以上離れた位置にある。また、第1行目において、非ゼロ係数を網掛けにて示している。 In the example shown in FIG. 6, the last coefficient LT is at a dark shaded position. In the example shown in FIG. 6, the last coefficient LT is located in the seventh column of the first row of the coefficient matrix MX10. For this reason, the last coefficient LT is at a position away from the DC coefficient DC by a predetermined distance or more in the first row. In the first line, the non-zero coefficient is shaded.
 図6の(a)に示すとおり、第1段階の係数復号処理では、処理対象となる範囲(以下、第1の対象範囲と称する)R10は、第1行目である。 As shown in FIG. 6A, in the first-stage coefficient decoding process, a processing target range (hereinafter referred to as a first target range) R10 is the first row.
 また、図6の(b)に示すとおり、第2段階の係数復号処理では、処理対象となる範囲(以下、第2の対象範囲と称する)R20は、第1行目以外の行である。なお、図6の(b)では、第1段階において処理済(符号化・復号)である位置は、斜線にて表している。 Also, as shown in FIG. 6B, in the second-stage coefficient decoding process, a range to be processed (hereinafter referred to as a second target range) R20 is a line other than the first line. In FIG. 6B, the positions that have been processed (encoding / decoding) in the first stage are indicated by hatching.
 以下において、第1段階および第2段階の係数復号処理の詳細について説明する。 Hereinafter, details of the coefficient decoding process in the first stage and the second stage will be described.
 まず、第1段階の係数復号処理は次のようにして実行される。すなわち、まず、第1係数復号部231が、第1の対象範囲R10のうち、最後の係数LTから、DC係数DCまでを復号する。 First, the first-stage coefficient decoding process is executed as follows. That is, first, the first coefficient decoding unit 231 decodes from the last coefficient LT to the DC coefficient DC in the first target range R10.
 図6の(a)を参照しながら説明すると、第1係数復号部231が復号する係数は、第1の対象範囲R10のうち、最後の係数LTの次の係数から、DC係数DCまでの連続する領域R11に含まれる係数である。このように第1係数復号部231は、実際には、非ゼロ係数が存在する可能性のある領域R11を復号対象とする。 Explaining with reference to FIG. 6A, the coefficients decoded by the first coefficient decoding unit 231 are continuous from the coefficient next to the last coefficient LT to the DC coefficient DC in the first target range R10. This is a coefficient included in the region R11. As described above, the first coefficient decoding unit 231 actually sets a region R11 in which a non-zero coefficient may exist as a decoding target.
 なお、第1行目の第8列目は、係数行列全体のスキャン順において最後の係数LTよりも後に現れる位置なので、この位置の係数の値は、”0”であるものとして取り扱われる。 Note that the eighth column of the first row is a position that appears after the last coefficient LT in the scan order of the entire coefficient matrix, and therefore, the value of the coefficient at this position is treated as “0”.
 続いて、第1逆スキャン部232が、第1係数復号部231により復号された係数を逆スキャンする。第1逆スキャン部232は、具体的には、次のようにして逆スキャンを行う。 Subsequently, the first reverse scanning unit 232 performs reverse scanning on the coefficients decoded by the first coefficient decoding unit 231. Specifically, the first reverse scanning unit 232 performs reverse scanning as follows.
 すなわち、第1逆スキャン部232は、
 X=scanX(idx)、Y=scanY(idx)
を計算して、係数行列における座標(X,Y)を算出する。ここで、scanXは、スキャン順インデックスidxをx座標のXに変換する関数であり、scanYは、スキャン順インデックスをy座標のYに変換する関数である。
That is, the first reverse scanning unit 232
X = scanX (idx), Y = scanY (idx)
To calculate the coordinates (X, Y) in the coefficient matrix. Here, scanX is a function that converts the scan order index idx into X of the x coordinate, and scanY is a function that converts the scan order index into Y of the y coordinate.
 また、scanXおよびscanYは、idxと、(X,Y)との対応を定義したテーブルにより実現することができる。 Also, scanX and scanY can be realized by a table that defines the correspondence between idx and (X, Y).
 例えば、DC係数の位置は、スキャン順インデックスによればidx=0であり、対応する座標表現は、(X,Y)=(scanX(0),scanY(0))=(0,0)である。 For example, the position of the DC coefficient is idx = 0 according to the scan order index, and the corresponding coordinate expression is (X, Y) = (scanX (0), scanY (0)) = (0, 0). is there.
 また、図6の(a)に示す例では、最後の係数LTの位置は、スキャン順インデックスLastIdx=27である。最後の係数LTの位置は、座標表現により(LastX,LastY)=(6,0)である。 In the example shown in FIG. 6A, the position of the last coefficient LT is the scan order index LastIdx 1 = 27. The position of the last coefficient LT is (LastX 1 , LastY 1 ) = ( 6 , 0) by coordinate expression.
 第1逆スキャン部123は、このようにして逆スキャンを行って係数行列の第1行目を復元する。 The first inverse scan unit 123 performs the inverse scan in this way to restore the first row of the coefficient matrix.
 以上により第1段階の係数復号処理が終了すると、フラグ判定部233のフラグ判定に応じて、第2段階の係数復号処理が開始される。 When the first-stage coefficient decoding process is completed as described above, the second-stage coefficient decoding process is started according to the flag determination of the flag determination unit 233.
 次に、第2段階の係数復号処理は次のようにして実行される。まず、第2係数復号部234が、第2の対象範囲R20のうち、第2の対象範囲R20におけるスキャン順上の最後の係数K1から、第2の対象範囲R20におけるスキャン順上の最初の係数STまでを復号する。 Next, the second stage coefficient decoding process is executed as follows. First, the second coefficient decoding unit 234 starts with the first coefficient in the scan order in the second target range R20 from the last coefficient K1 in the scan order in the second target range R20 in the second target range R20. Decode up to ST.
 続いて、第2逆スキャン部235が、第2係数復号部234により復号された係数を逆スキャンする。第2逆スキャン部235は、具体的には、次のようにして逆スキャンを行う。 Subsequently, the second reverse scanning unit 235 performs reverse scanning on the coefficients decoded by the second coefficient decoding unit 234. Specifically, the second reverse scanning unit 235 performs reverse scanning as follows.
 ここで、第2逆スキャン部235は、第2の対象範囲R20について、一括で係数復号処理を行う場合のスキャン順序を適用する。 Here, the second reverse scanning unit 235 applies the scan order in the case where the coefficient decoding process is performed collectively for the second target range R20.
 また、第2逆スキャン部235は、実際には係数K1から係数STにかけての領域R21を逆スキャン対象とする。このとき領域R21における最後の係数は、係数K1である。第2逆スキャン部235は、係数STから係数K1にかけて、順に逆スキャンを実行する。 In addition, the second reverse scanning unit 235 actually sets a region R21 from the coefficient K1 to the coefficient ST as a reverse scan target. At this time, the last coefficient in the region R21 is the coefficient K1. The second reverse scanning unit 235 sequentially performs reverse scanning from the coefficient ST to the coefficient K1.
 第2逆スキャン部235は、このように逆スキャンを行って係数行列の第2行目~第8行目までを再現する。 The second reverse scanning unit 235 performs the reverse scanning in this manner to reproduce the second to eighth rows of the coefficient matrix.
 このように、2段階復号部123は、係数行列の第1行目~第8行目までを再現し、再現した係数行列を、復号済みTU情報TUIに含めて符号化データ多重化部34に供給する。 As described above, the two-stage decoding unit 123 reproduces the first to eighth rows of the coefficient matrix, includes the reproduced coefficient matrix in the decoded TU information TUI, and transmits it to the encoded data multiplexing unit 34. Supply.
  (処理の流れ)
 次に、図7を用いて、TU情報復号部12における係数復号処理の流れについて説明する。図7は、TU情報復号部12における係数復号処理の流れについて示したフローチャートである。
(Process flow)
Next, the flow of coefficient decoding processing in the TU information decoding unit 12 will be described with reference to FIG. FIG. 7 is a flowchart showing the flow of coefficient decoding processing in the TU information decoding unit 12.
 まず、最後の係数復号部121が最後の係数LTを復号する(S11)と、位置判定部122が、最後の係数LTの位置が所定の条件を満たすか否かを判定する(S12)。 First, when the last coefficient decoding unit 121 decodes the last coefficient LT (S11), the position determination unit 122 determines whether or not the position of the last coefficient LT satisfies a predetermined condition (S12).
 最後の係数LTの位置が所定の条件を満たさない場合(S12においてNO)、一括復号部124において、一括で係数復号処理を行う(S13)。 If the position of the last coefficient LT does not satisfy the predetermined condition (NO in S12), the batch decoding unit 124 performs batch coefficient decoding processing (S13).
 すなわち、S13では、まず、一括係数復号部241が、最後の係数の次の係数から順に係数を復号する(S131)。そして、一括逆スキャン部242が、復号された係数が格納された1次元配列に対して逆スキャンを行って係数行列を再現する(S132)。一括復号部124が、このようにして得られた2次元の係数行列を出力して、処理は終了する。 That is, in S13, the collective coefficient decoding unit 241 first decodes the coefficients in order from the coefficient next to the last coefficient (S131). Then, the collective inverse scan unit 242 performs inverse scan on the one-dimensional array in which the decoded coefficients are stored to reproduce the coefficient matrix (S132). The collective decoding unit 124 outputs the two-dimensional coefficient matrix obtained in this way, and the process ends.
 一方、最後の係数LTの位置が所定の条件を満たす場合(S12においてYES)、2段階復号部123において次のように2段階の係数復号処理が行われる。 On the other hand, when the position of the last coefficient LT satisfies a predetermined condition (YES in S12), the two-stage decoding unit 123 performs a two-stage coefficient decoding process as follows.
 すなわち、まず、第1係数復号部231が、最後の係数の次の係数からDC係数までを復号する(S14)。 That is, first, the first coefficient decoding unit 231 decodes from the coefficient next to the last coefficient to the DC coefficient (S14).
 次に、第1逆スキャン部232が、S14で復号された係数に対して逆スキャンを行う(S15)。これにより、係数行列の第1行目または第1列目が再現される。 Next, the first inverse scanning unit 232 performs inverse scanning on the coefficients decoded in S14 (S15). Thereby, the first row or the first column of the coefficient matrix is reproduced.
 次に、フラグ判定部233が、第2段階フラグを復号して(S16)、第2段階フラグが”1”か否かを判定する(S17)。第2段階フラグが”1”でない場合(S17においてNO)は、第2段階において復号対象となる領域に、非ゼロ係数が存在しないことになるので、第2段階の係数復号処理を行うことなく、係数復号処理は終了する。 Next, the flag determination unit 233 decodes the second stage flag (S16), and determines whether or not the second stage flag is “1” (S17). If the second stage flag is not “1” (NO in S17), since there is no non-zero coefficient in the region to be decoded in the second stage, the second stage coefficient decoding process is not performed. The coefficient decoding process ends.
 一方、第2段階フラグが”1”である場合(S17においてYES)、第2段階の係数復号処理が実行される。すなわち、第2係数復号部234が、残りの係数を復号する(S18)。そして、第2逆スキャン部235が、S18において復号された係数に対して逆スキャンを実行することにより、残りの係数について係数行列を再現する(S19)。 On the other hand, when the second stage flag is “1” (YES in S17), the second stage coefficient decoding process is executed. That is, the second coefficient decoding unit 234 decodes the remaining coefficients (S18). Then, the second inverse scanning unit 235 performs inverse scanning on the coefficients decoded in S18, thereby reproducing the coefficient matrix for the remaining coefficients (S19).
 第1段階および第2段階の係数復号処理が行われることにより、係数行列の全体が再現されて、処理は終了する。 The first-stage and second-stage coefficient decoding processes are performed, so that the entire coefficient matrix is reproduced, and the process ends.
  (作用・効果)
 以上のように、本発明に係る動画像復号装置1は、画像データが符号化された符号化データ#1に含まれる、係数符号化データC10を復号および逆スキャンすることにより係数行列MX10を再現する動画像復号装置1において、係数行列MX10における、上記逆スキャン順上、最後の係数LTの位置を検出する最後の係数復号部121と、最後の係数LTの位置が、係数行列MX10において、DC係数DCを含む第1行目または第1列目である第1の対象範囲R10にあるか否かを判定する位置判定部122と、最後の係数LTの位置が、第1の対象範囲R10にある場合、係数行列MX10を、第1の対象範囲R10と、第1の対象範囲R10以外の第2の対象範囲R20とでそれぞれ復号処理する2段階復号部123と、を備える構成である。
(Action / Effect)
As described above, the moving picture decoding apparatus 1 according to the present invention reproduces the coefficient matrix MX10 by decoding and inverse scanning the coefficient encoded data C10 included in the encoded data # 1 obtained by encoding the image data. In the moving picture decoding apparatus 1, the last coefficient decoding unit 121 that detects the position of the last coefficient LT in the reverse scan order in the coefficient matrix MX10, and the position of the last coefficient LT in the coefficient matrix MX10 The position determination unit 122 that determines whether or not the first target range R10 in the first row or the first column including the coefficient DC and the position of the last coefficient LT are in the first target range R10. In some cases, the coefficient matrix MX10 includes a two-stage decoding unit 123 that performs a decoding process on each of the first target range R10 and the second target range R20 other than the first target range R10. It is a configuration.
 このため、係数の分布に偏りがある場合、復号すべき符号データの符号量の削減を図ることができる。 For this reason, when the coefficient distribution is biased, it is possible to reduce the code amount of the code data to be decoded.
 なお、第2の対象範囲R20の復号処理において、第2の対象範囲R20をさらに、新たな第1の対象範囲と、新たな第2の対象範囲とに分割して、再帰的に上記処理を行ってもかまわない。 In the decoding process of the second target range R20, the second target range R20 is further divided into a new first target range and a new second target range, and the above processing is recursively performed. You can go.
  〔動画像符号化装置〕
 以下では、本実施形態に係る動画像符号化装置2の構成について、図8を参照して説明する。なお、すでに説明した部材と同じ部材については、同じ符号を付し、その説明を省略する。
[Moving picture encoding device]
Below, the structure of the moving image encoder 2 which concerns on this embodiment is demonstrated with reference to FIG. In addition, the same code | symbol is attached | subjected about the same member as the already demonstrated member, and the description is abbreviate | omitted.
  (動画像符号化装置の概要)
 動画像符号化装置2は、概略的に言えば、入力画像#10を符号化することによって符号化データ#1を生成し、出力する装置である。
(Outline of video encoding device)
Generally speaking, the moving image encoding device 2 is a device that generates and outputs encoded data # 1 by encoding the input image # 10.
  (動画像符号化装置の構成)
 図8は、動画像符号化装置2の構成について示す機能ブロック図である。図8に示すように、動画像符号化装置2は、符号化設定部21、逆量子化・逆変換部22、予測画像生成部23、加算器24、フレームメモリ25、減算器26、変換・量子化部27、および可変長符号化部28を備えている。
(Configuration of video encoding device)
FIG. 8 is a functional block diagram showing the configuration of the moving picture coding apparatus 2. As illustrated in FIG. 8, the moving image encoding device 2 includes an encoding setting unit 21, an inverse quantization / inverse conversion unit 22, a predicted image generation unit 23, an adder 24, a frame memory 25, a subtractor 26, A quantization unit 27 and a variable length coding unit 28 are provided.
 符号化設定部21は、入力画像#10に基づいて、符号化に関する画像データおよび各種の設定情報を生成する。 The encoding setting unit 21 generates image data related to encoding and various setting information based on the input image # 10.
 具体的には、符号化設定部21は、次の画像データおよび設定情報を生成する。 Specifically, the encoding setting unit 21 generates the next image data and setting information.
 まず、符号化設定部21は、入力画像#10を、スライス単位、LCU単位に順次分割することにより、対象リーフCUについてのリーフCU画像#100を生成する。 First, the encoding setting unit 21 generates the leaf CU image # 100 for the target leaf CU by sequentially dividing the input image # 10 into slice units and LCU units.
 また、符号化設定部21は、分割処理の結果に基づいて、ヘッダ設定情報H’を生成する。ヘッダ情報H’は、(1)対象スライスに属するLCUのサイズ、形状および対象スライス内での位置についての情報、並びに、(2)各LCUに属するリーフCUのサイズ、形状および対象LCU内での位置についてのCU情報CU’を含んでいる。 Also, the encoding setting unit 21 generates header setting information H ′ based on the result of the division process. The header information H ′ includes (1) information about the size, shape and position of the LCU belonging to the target slice, and (2) the size, shape and shape of the leaf CU belonging to each LCU. It includes CU information CU ′ about the position.
 さらに、符号化設定部21は、リーフCU画像#100、および、CU情報CU’を参照して、PU設定情報PUI’を生成する。PU設定情報PUI’には、(1)対象リーフCUの各パーティションへの可能な分割パターン、および、(2)各パーティションに割り付ける可能な予測モード、の全ての組み合わせに関する情報が含まれる。 Furthermore, the encoding setting unit 21 refers to the leaf CU image # 100 and the CU information CU 'to generate PU setting information PUI'. The PU setting information PUI 'includes information on all combinations of (1) possible division patterns for each partition of the target leaf CU and (2) prediction modes that can be assigned to each partition.
 符号化設定部21は、リーフCU画像#100を減算器26に供給する。 The encoding setting unit 21 supplies the leaf CU image # 100 to the subtractor 26.
 また、符号化設定部21は、ヘッダ情報H’を可変長符号化部28に供給する。また、符号化設定部21は、PU設定情報PUI’を予測画像生成部23に供給する。 Also, the encoding setting unit 21 supplies the header information H ′ to the variable length encoding unit 28. Also, the encoding setting unit 21 supplies the PU setting information PUI ′ to the predicted image generation unit 23.
 逆量子化・逆変換部22は、変換・量子化部27より供給される、ブロック毎の量子化予測残差を、逆量子化、および、逆DCT変換(Inverse Discrete Cosine Transform)することによって、ブロック毎の予測残差を復元する。また、逆量子化・逆変換部22は、ブロック毎の予測残差を、TU分割情報により指定される分割パターンに従って統合し、対象リーフCUについての予測残差Dを生成する。逆量子化・逆変換部22は、生成した対象リーフCUについての予測残差Dを、加算器24に供給する。 The inverse quantization / inverse transform unit 22 performs inverse quantization and inverse DCT transform (Inverse Discrete Cosine Transform) on the quantization prediction residual for each block supplied from the transform / quantization unit 27, Restore the prediction residual for each block. Further, the inverse quantization / inverse transform unit 22 integrates the prediction residual for each block according to the division pattern specified by the TU partition information, and generates a prediction residual D for the target leaf CU. The inverse quantization / inverse transform unit 22 supplies the prediction residual D for the generated target leaf CU to the adder 24.
 予測画像生成部23は、フレームメモリ25に記録されている局所復号画像P’、および、PU設定情報PUI’を参照して、対象リーフCUについての予測画像Predを生成する。色差の予測においてチャンネル間予測を行う場合、予測画像生成部23は、輝度復号画像Pを参照する。予測画像生成部23は、予測画像生成処理により得られた予測パラメータを、PU設定情報PUI’に設定し、設定後のPU設定情報PUI’を可変長符号化部28に転送する。なお、予測画像生成部23による予測画像生成処理は、動画像復号装置1の備える予測画像生成部13と同様であるので、ここでは説明を省略する。 The predicted image generation unit 23 refers to the locally decoded image P ′ recorded in the frame memory 25 and the PU setting information PUI ′, and generates a predicted image Pred for the target leaf CU. When performing inter-channel prediction in the prediction of chrominance, the prediction image generation unit 23 refers to the luminance decoded image P Y. The predicted image generation unit 23 sets the prediction parameter obtained by the predicted image generation process in the PU setting information PUI ′, and transfers the set PU setting information PUI ′ to the variable length encoding unit 28. Note that the predicted image generation process performed by the predicted image generation unit 23 is the same as that performed by the predicted image generation unit 13 included in the video decoding device 1, and thus description thereof is omitted here.
 加算器24は、予測画像生成部23より供給される予測画像Predと、逆量子化・逆変換部22より供給される予測残差Dとを加算することによって、対象リーフCUについての復号画像Pを生成する。 The adder 24 adds the predicted image Pred supplied from the predicted image generation unit 23 and the prediction residual D supplied from the inverse quantization / inverse transform unit 22 to add a decoded image P for the target leaf CU. Is generated.
 フレームメモリ25には、復号された復号画像Pが順次記録される。フレームメモリ25には、対象LCUを復号する時点において、当該対象LCUよりも先に復号された全てのLCU(例えば、ラスタスキャン順で先行する全てのLCU)に対応する復号画像が記録されている。 Decoded decoded image P is sequentially recorded in the frame memory 25. In the frame memory 25, decoded images corresponding to all the LCUs decoded before the target LCU (for example, all the LCUs preceding in the raster scan order) at the time of decoding the target LCU are recorded. .
 減算器26は、リーフCU画像#100から予測画像Predを減算することによって、対象リーフCUについての予測残差Dを生成する。減算器26は、生成した予測残差Dを、変換・量子化部27に供給する。 The subtracter 26 generates a prediction residual D for the target leaf CU by subtracting the prediction image Pred from the leaf CU image # 100. The subtractor 26 supplies the generated prediction residual D to the transform / quantization unit 27.
 変換・量子化部27は、予測残差Dに対して、DCT変換(Discrete Cosine Transform)および量子化を行うことで量子化予測残差を生成する。 The transform / quantization unit 27 performs a DCT transform (Discrete Cosine Transform) and quantization on the prediction residual D to generate a quantized prediction residual.
 具体的には、変換・量子化部27は、リーフCU画像#100、および、CU情報CU’を参照し、対象リーフCUの1または複数のブロックへの分割パターンを決定する。また、決定された分割パターンに従って、予測残差Dを、各ブロックについての予測残差に分割する。 Specifically, the transform / quantization unit 27 refers to the leaf CU image # 100 and the CU information CU ', and determines the division pattern of the target leaf CU into one or a plurality of blocks. Further, according to the determined division pattern, the prediction residual D is divided into prediction residuals for each block.
 また、変換・量子化部27は、各ブロックについての予測残差をDCT変換(Discrete Cosine Transform)することによって周波数領域における予測残差を生成した後、当該周波数領域における予測残差を量子化することによってブロック毎の量子化予測残差を生成する。 The transform / quantization unit 27 generates a prediction residual in the frequency domain by performing DCT transform (DiscretecreCosine Transform) on the prediction residual for each block, and then quantizes the prediction residual in the frequency domain. Thus, a quantized prediction residual for each block is generated.
 また、変換・量子化部27は、生成したブロック毎の量子化予測残差と、対象リーフCUの分割パターンを指定するTU分割情報と、対象リーフCUの各ブロックへの可能な全分割パターンに関する情報とを含むTU設定情報TUI’を生成する。 Also, the transform / quantization unit 27 relates to the generated quantization prediction residual for each block, TU partition information that specifies the partition pattern of the target leaf CU, and all possible partition patterns for each block of the target leaf CU. TU setting information TUI ′ including the information is generated.
 変換・量子化部27は、生成したTU設定情報TUI’を、逆量子化・逆変換部22、および、可変長符号化部28に供給する。 The transform / quantization unit 27 supplies the generated TU setting information TUI 'to the inverse quantization / inverse transform unit 22 and the variable length coding unit 28.
 可変長符号化部28は、TU設定情報TUI’、PU設定情報PUI’、ヘッダ情報H’に基づいて符号化データ#1を生成し、出力する。なお、可変長符号化部28の詳細については以下に説明する。 The variable length encoding unit 28 generates and outputs encoded data # 1 based on the TU setting information TUI ′, the PU setting information PUI ′, and the header information H ′. Details of the variable length coding unit 28 will be described below.
  (可変長符号化部)
 次に、図9を用いて可変長符号化部28の構成についてさらに詳しく説明する。図9は、可変長符号化部28の構成例について示すブロック図である。
(Variable length coding unit)
Next, the configuration of the variable length coding unit 28 will be described in more detail with reference to FIG. FIG. 9 is a block diagram illustrating a configuration example of the variable length coding unit 28.
 図9に示すように、可変長符号化部28は、TU情報符号化部31、ヘッダ情報符号化部32、PUI情報符号化部33、符号化データ多重化部34を備える。 As shown in FIG. 9, the variable length coding unit 28 includes a TU information coding unit 31, a header information coding unit 32, a PUI information coding unit 33, and a coded data multiplexing unit 34.
 TU情報符号化部31は、TU設定情報TUI’を符号化して、符号化データ多重化部34に供給する。また、ヘッダ情報符号化部32は、ヘッダ情報H’を符号化して、符号化データ多重化部34に供給する。また、PUI情報符号化部33は、PUI情報PUI’を符号化して符号化データ多重化部34に供給する。 The TU information encoding unit 31 encodes the TU setting information TUI ′ and supplies it to the encoded data multiplexing unit 34. The header information encoding unit 32 encodes the header information H ′ and supplies the encoded header information H ′ to the encoded data multiplexing unit 34. The PUI information encoding unit 33 encodes the PUI information PUI ′ and supplies the encoded PUI information PUI ′ to the encoded data multiplexing unit 34.
 符号化データ多重化部34は、TU設定情報TUI’、ヘッダ情報H’およびPUI情報PUI’を多重化して符号化データ#1を生成し、出力する。 The encoded data multiplexing unit 34 multiplexes the TU setting information TUI ', header information H', and PUI information PUI 'to generate encoded data # 1, and outputs it.
 ここで、TU情報符号化部31の構成についてさらに詳しく説明すると次のとおりである。なお、以下では、TU設定情報TUI’に含まれる量子化予測残差、すなわち係数行列を符号化するための構成について説明する。 Here, the configuration of the TU information encoding unit 31 will be described in more detail as follows. Hereinafter, a configuration for encoding a quantized prediction residual, that is, a coefficient matrix included in the TU setting information TUI ′ will be described.
 TU情報符号化部31は、最後の係数検出部(最後の係数位置検出手段)310、位置判定部(位置判定手段)320、2段階符号化部330、一括符号化部340、直線スキャン用VLCテーブルTBL21、およびジグザグスキャン用VLCテーブルTBL22を備える。 The TU information encoding unit 31 includes a final coefficient detection unit (last coefficient position detection unit) 310, a position determination unit (position determination unit) 320, a two-stage encoding unit 330, a batch encoding unit 340, and a linear scan VLC. A table TBL21 and a zigzag scanning VLC table TBL22 are provided.
 最後の係数検出部310は、係数行列に対して逆順のジグザグスキャンを行って、最後の係数を検出する。最後の係数検出部310では、最後の係数の検出手法として、例えば、非特許文献3の技術を採用することができる。最後の係数検出部310は、検出した係数の最後の係数の位置last_pos、最後の係数のレベルlevel、および最後の係数の正負符号signを符号化して係数符号化データに含める。 The last coefficient detection unit 310 performs a reverse zigzag scan on the coefficient matrix to detect the last coefficient. The last coefficient detection unit 310 can employ, for example, the technique of Non-Patent Document 3 as the last coefficient detection method. The last coefficient detection unit 310 encodes the last coefficient position last_pos of the detected coefficient, the last coefficient level level, and the last coefficient positive / negative sign sign and includes them in the coefficient encoded data.
 位置判定部320は、最後の係数検出部310が検出した最後の係数の位置last_posが所定の条件を満たすか否かを判定する。具体的には、位置判定部320は、上述の判定式(1)の真偽を判定する。 The position determination unit 320 determines whether or not the last coefficient position last_pos detected by the last coefficient detection unit 310 satisfies a predetermined condition. Specifically, the position determination unit 320 determines the authenticity of the above-described determination formula (1).
 判定式(1)の結果が「真」である場合、位置判定部320は、2段階の係数復号処理を行うことを決定する。この場合、位置判定部320は、決定結果を、2段階符号化部330に通知する。 When the result of the determination formula (1) is “true”, the position determination unit 320 determines to perform a two-stage coefficient decoding process. In this case, the position determination unit 320 notifies the determination result to the two-stage encoding unit 330.
 一方、判定式(1)の結果が「偽」である場合、位置判定部320は、一括で係数復号処理を行うことを決定する。この場合、位置判定部320は、決定結果を、一括符号化部340に通知する。 On the other hand, when the result of the determination formula (1) is “false”, the position determination unit 320 determines to perform the coefficient decoding process collectively. In this case, the position determination unit 320 notifies the determination result to the batch encoding unit 340.
 2段階符号化部330は、位置判定部320からの通知を受けて、2段階の係数復号処理を行う。この場合、2段階符号化部330は、直線スキャン用VLCテーブルTBL21およびジグザグスキャン用VLCテーブルTBL22を参照して、対象ブロックについて2段階の係数復号処理を行う。2段階符号化部330の詳細については後述する。2段階符号化部330は、符号化した係数行列MX10を出力する。 The two-stage encoding unit 330 receives the notification from the position determination unit 320 and performs a two-stage coefficient decoding process. In this case, the two-stage encoding unit 330 refers to the linear scan VLC table TBL21 and the zigzag scan VLC table TBL22, and performs a two-stage coefficient decoding process on the target block. Details of the two-stage encoding unit 330 will be described later. The two-stage encoding unit 330 outputs the encoded coefficient matrix MX10.
 一括符号化部340は、位置判定部320からの通知を受けて、一括で係数符号化処理を行う。この場合、一括符号化部340は、ジグザグスキャン用VLCテーブルTBL22を参照して、対象ブロックについて一括で係数復号処理を行う。一括符号化部340は、符号化した係数行列MX10を出力する。 The batch encoding unit 340 receives the notification from the position determination unit 320 and performs a coefficient encoding process in a batch. In this case, the batch encoding unit 340 refers to the zigzag scan VLC table TBL22 and performs a coefficient decoding process on the target block in a batch. The batch encoding unit 340 outputs the encoded coefficient matrix MX10.
 直線スキャン用VLCテーブルTBL21は、各パラメータと、符号化データのビット列との対応づけが定義されたテーブルである。直線スキャン用VLCテーブルTBL21は、2段階符号化部330の第1段階の係数符号化処理において用いられる。また、直線スキャン用VLCテーブルTBL21は、コンテキストに応じて複数定義されている。さらにいえば、直線スキャン用VLCテーブルTBL21の定義を逆引きできるようにしたものが、動画像復号装置1における直線スキャン用VLCテーブルTBL11である。 The linear scan VLC table TBL21 is a table in which the correspondence between each parameter and a bit string of encoded data is defined. The linear scanning VLC table TBL21 is used in the first-stage coefficient encoding process of the two-stage encoding unit 330. A plurality of linear scan VLC tables TBL21 are defined according to the context. More specifically, the linear scanning VLC table TBL11 in the moving picture decoding apparatus 1 is such that the definition of the linear scanning VLC table TBL21 can be reversed.
 ジグザグスキャン用VLCテーブルTBL22は、各パラメータと、符号化データのビット列との対応づけが定義されたテーブルである。ジグザグスキャン用VLCテーブルTBL22は、2段階符号化部330の第2段階の係数符号化処理と、一括符号化部340における係数符号化処理との両方において用いられる。また、ジグザグスキャン用VLCテーブルTBL22は、コンテキストに応じて複数定義されている。 The zigzag scan VLC table TBL22 is a table in which the correspondence between each parameter and a bit string of encoded data is defined. The zigzag scan VLC table TBL22 is used in both the second-stage coefficient encoding process of the two-stage encoding unit 330 and the coefficient encoding process in the batch encoding unit 340. A plurality of zigzag scan VLC tables TBL22 are defined in accordance with the context.
 さらにいえば、ジグザグスキャン用VLCテーブルTBL22の定義を逆引きできるようにしたものが、動画像復号装置1におけるジグザグスキャン用VLCテーブルTBL12である。 Further, the zigzag scan VLC table TBL12 in the moving picture decoding apparatus 1 is a table in which the definition of the zigzag scan VLC table TBL22 can be reversed.
  (一括符号化部)
 引き続き、図9を参照しながら、一括符号化部340の構成についてさらに詳しく説明する。一括符号化部340は、一括スキャン部341および一括係数符号化部342を備える。なお、以下の説明では、位置判定部320が、一括で係数復号処理を行うことを決定していることとする。
(Batch encoding unit)
Next, the configuration of the batch encoding unit 340 will be described in more detail with reference to FIG. The batch encoding unit 340 includes a batch scan unit 341 and a batch coefficient encoding unit 342. In the following description, it is assumed that the position determination unit 320 determines to perform the coefficient decoding process all at once.
 一括スキャン部341は、2次元の係数行列MX10に対してジグザグスキャンを行うことによって読み取った係数を、逐次1次元配列に格納する。一括スキャン部341は、スキャンによって得られた1次元配列を一括係数符号化部342に供給する。 The collective scanning unit 341 sequentially stores the coefficients read by performing the zigzag scan on the two-dimensional coefficient matrix MX10 in a one-dimensional array. The collective scanning unit 341 supplies the one-dimensional array obtained by scanning to the collective coefficient encoding unit 342.
 一括係数符号化部342は、一括スキャン部341から供給される1次元配列を、ジグザグスキャン用VLCテーブルTBL22を参照しながら符号化して係数符号化データを出力する。 The collective coefficient encoding unit 342 encodes the one-dimensional array supplied from the collective scan unit 341 with reference to the zigzag scan VLC table TBL22, and outputs coefficient encoded data.
 一括係数符号化部342は、例示的に、次のようにして係数の符号化を行う。まず、一括係数符号化部342は、ランモードによる符号化を行う。すなわち、一括係数符号化部342は、所定の条件下、0ランrun、係数のレベルlevel、および係数の正負符号signを係数ごとに符号化する。所定の条件としては、例えば、係数の値が閾値を超えるか否か、あるいは、所定の数だけ係数を符号化したか否かなど挙げられる。 The batch coefficient encoding unit 342 illustratively encodes coefficients as follows. First, the batch coefficient encoding unit 342 performs encoding in the run mode. That is, the collective coefficient encoding unit 342 encodes 0 run, the coefficient level level, and the coefficient sign sign for each coefficient under a predetermined condition. Examples of the predetermined condition include whether or not the coefficient value exceeds a threshold value, or whether or not a predetermined number of coefficients are encoded.
 ランモードが終了すると、一括係数符号化部342は、非ランモードにて符号化を行う。すなわち、一括係数符号化部342は、係数のレベルlevel、および係数の正負符号signを符号化する。一括係数符号化部342は、このようにして係数を符号化することにより、係数符号化データを生成する。 When the run mode ends, the batch coefficient encoding unit 342 performs encoding in the non-run mode. In other words, the collective coefficient encoding unit 342 encodes the coefficient level level and the coefficient sign sign. The collective coefficient encoding unit 342 generates coefficient encoded data by encoding the coefficients in this way.
  (2段階符号化処理の概要)
 次に、図10を用いて、2段階符号化部330による2段階符号化処理の概要について説明する。図10は、2段階符号化部330における処理と当該処理に関する入出力データとの関係について示した図である。
(Outline of the two-stage encoding process)
Next, an overview of the two-stage encoding process performed by the two-stage encoding unit 330 will be described with reference to FIG. FIG. 10 is a diagram showing the relationship between the process in the two-stage encoding unit 330 and the input / output data related to the process.
 図10に示すように、2段階符号化部330は、2次元の係数行列MX10を入力として符号化処理を行い、係数符号化データC10を出力する。なお、位置判定部320が、2段階の係数復号処理を行うことを決定していることとする。 As shown in FIG. 10, the two-stage encoding unit 330 performs an encoding process with a two-dimensional coefficient matrix MX10 as an input, and outputs coefficient encoded data C10. It is assumed that the position determination unit 320 has decided to perform a two-stage coefficient decoding process.
 また、係数符号化データC10は、第1係数符号化データC11、第2段階フラグF1、および第2係数符号化データC12を含む。第2段階フラグF1は、第2段階の復号処理を実行する必要があるか否かを示すものである。 Also, the coefficient encoded data C10 includes first coefficient encoded data C11, a second stage flag F1, and second coefficient encoded data C12. The second stage flag F1 indicates whether or not the second stage decoding process needs to be executed.
 2段階符号化部330では、まず第1段階の符号化処理が次のように実行される。すなわち、まず、係数行列MX10のうち、第1行目の係数行列MX11(8×1)に対してスキャン処理が行われる。このスキャン処理は、第1行目に含まれるDC係数から、最後の係数にかけて直線的に行われる。また、このスキャン処理により1次元配列ARR1が出力される。1次元配列ARR1のサイズは、最大”8”である。 In the two-stage encoding unit 330, first, the first-stage encoding process is executed as follows. That is, first, a scan process is performed on the coefficient matrix MX11 (8 × 1) in the first row of the coefficient matrix MX10. This scanning process is performed linearly from the DC coefficient included in the first row to the last coefficient. In addition, a one-dimensional array ARR1 is output by this scanning process. The size of the one-dimensional array ARR1 is “8” at the maximum.
 そして、直線スキャン用VLCテーブルTBL21を参照しながら1次元配列ARR1を符号化する処理が実行される。これにより係数符号化データC11が出力される。 Then, a process of encoding the one-dimensional array ARR1 is executed with reference to the linear scan VLC table TBL21. As a result, the coefficient encoded data C11 is output.
 続いて、2段階符号化部330において、第2段階の係数符号化処理が次のように実行される。すなわち、まず、係数行列MX11のうち、残りの係数を含む係数行列MX12(8×7)を位置調整のためコピーする。すなわち、係数行列MX12(8×7)の各係数を、第1行目から格納した8×8の係数行列MX13が生成される。このようにコピーを行うことにより一括での係数符号化処理の処理順序が適用可能となる。 Subsequently, in the two-stage encoding unit 330, the second-stage coefficient encoding process is executed as follows. That is, first, of the coefficient matrix MX11, the coefficient matrix MX12 (8 × 7) including the remaining coefficients is copied for position adjustment. That is, an 8 × 8 coefficient matrix MX13 storing the coefficients of the coefficient matrix MX12 (8 × 7) from the first row is generated. By performing copying in this way, it is possible to apply the processing order of coefficient encoding processing in a lump.
 続いて、係数行列MX13に対してジグザグスキャンが実行されることにより、1次元配列ARR22が生成される。このスキャン処理では、係数行列MX13に非ゼロ係数が含まれている場合、第2段階フラグF1が設定される。 Subsequently, a one-dimensional array ARR22 is generated by performing a zigzag scan on the coefficient matrix MX13. In this scan process, when the coefficient matrix MX13 includes a non-zero coefficient, the second stage flag F1 is set.
 さらに、2段階符号化部330において、ジグザグスキャン用VLCテーブルTBL22の参照により、1次元配列ARR22に格納されている係数の符号化処理が行われる。これにより、係数符号化データC12が生成される。 Further, in the two-stage encoding unit 330, the coefficient stored in the one-dimensional array ARR22 is encoded by referring to the zigzag scan VLC table TBL22. Thereby, coefficient encoded data C12 is generated.
 2段階符号化部330において、第1段階および第2段階の係数符号化処理により得られた係数符号化データC11、第2段階フラグF1および係数符号化データC12がマージされて、係数符号化データC10として出力される。 In the two-stage encoding unit 330, the coefficient encoded data C11, the second-stage flag F1, and the coefficient encoded data C12 obtained by the first-stage and second-stage coefficient encoding processes are merged to generate coefficient encoded data. Output as C10.
  (2段階符号化部の構成)
 次に、再び図9を参照して、2段階符号化部330の構成をさらに詳しく説明する。図9に示すように、2段階符号化部330は、第1スキャン部331、第1係数符号化部332、第2スキャン部333、フラグ設定部334、および第2係数符号化部335を備える。
(Configuration of two-stage encoding unit)
Next, the configuration of the two-stage encoding unit 330 will be described in more detail with reference to FIG. 9 again. As shown in FIG. 9, the two-stage encoding unit 330 includes a first scanning unit 331, a first coefficient encoding unit 332, a second scanning unit 333, a flag setting unit 334, and a second coefficient encoding unit 335. .
 第1スキャン部331は、8×8の係数行列MX10における第1行目または第1列目について、直線スキャンを実行し、スキャンした係数を1次元配列ARR1に格納する。ここで、直線スキャンとは、8×8の係数行列MX10における第1行目または第1列目について、DC係数から、最後の係数にかけて直線的にスキャンを実行することである。 The first scan unit 331 performs a linear scan on the first row or the first column in the 8 × 8 coefficient matrix MX10 and stores the scanned coefficients in the one-dimensional array ARR1. Here, the linear scan is to perform a linear scan from the DC coefficient to the last coefficient for the first row or the first column in the 8 × 8 coefficient matrix MX10.
 第1係数符号化部332は、直線スキャン用VLCテーブルTBL21を参照しながら第1スキャン部331が生成した1次元配列ARR1に格納されている係数を符号化することにより第1係数符号化データC11を生成する。 The first coefficient encoding unit 332 encodes the coefficients stored in the one-dimensional array ARR1 generated by the first scanning unit 331 while referring to the linear scan VLC table TBL21 to thereby generate first coefficient encoded data C11. Is generated.
 なお、第1係数符号化部332における係数符号化処理は、スキャン順が一直線で、係数の数が異なることを除いては、一括係数符号化部342における係数符号化処理と同様である。例えば、第1係数符号化部332が符号化する係数の数は、高々(LastX+1)個または(LastY+1)個しかない。 The coefficient encoding process in the first coefficient encoding unit 332 is the same as the coefficient encoding process in the collective coefficient encoding unit 342 except that the scan order is a straight line and the number of coefficients is different. For example, the number of coefficients encoded by the first coefficient encoding unit 332 is at most (LastX 1 +1) or (LastY 1 +1).
 第2スキャン部333は、8×8の係数行列MX10における第1行目または第1列目以外の残りの部分について、ジグザグスキャンを実行し、スキャンした係数を1次元配列ARR2に格納する。 The second scan unit 333 performs a zigzag scan on the remaining part other than the first row or the first column in the 8 × 8 coefficient matrix MX10, and stores the scanned coefficients in the one-dimensional array ARR2.
 フラグ設定部334は、1次元配列ARR2に非ゼロ係数があるか否かを判定し、判定結果を示す第2段階フラグを設定する。すなわち、第2段階フラグとは、第2段階の復号処理を実行する必要があるか否かを示すものである。 The flag setting unit 334 determines whether or not the one-dimensional array ARR2 has a non-zero coefficient, and sets a second stage flag indicating the determination result. That is, the second stage flag indicates whether or not the second stage decoding process needs to be executed.
 第2係数符号化部335は、ジグザグスキャン用VLCテーブルTBL12を参照しながら、1次元配列ARR2に格納されている非ゼロ係数を符号化することにより、第2係数符号化データC12を生成する。 The second coefficient encoding unit 335 generates the second coefficient encoded data C12 by encoding the non-zero coefficient stored in the one-dimensional array ARR2 while referring to the zigzag scan VLC table TBL12.
 なお、第2係数符号化部335における係数符号化処理は、対象となる係数の位置が1行または1列ずれる以外は、一括係数符号化部342における係数符号化処理と同様である。 Note that the coefficient encoding process in the second coefficient encoding unit 335 is the same as the coefficient encoding process in the collective coefficient encoding unit 342 except that the position of the target coefficient is shifted by one row or one column.
  (具体例)
 次に、再び図6を参照して、2段階符号化部330の2段階の係数符号化処理の具体例について説明する。
(Concrete example)
Next, referring to FIG. 6 again, a specific example of the two-stage coefficient encoding processing of the two-stage encoding unit 330 will be described.
 図6の(a)に示すとおり、最後の係数LTは、第1行目においてDC係数DCから所定距離以上離れた位置にあるので、第1段階においては、第1の対象範囲R10が係数符号化処理の対象となる。 As shown in FIG. 6A, since the last coefficient LT is located at a predetermined distance or more away from the DC coefficient DC in the first row, in the first stage, the first target range R10 is a coefficient code. To be processed.
 このとき第1段階の係数符号化処理は次のようにして実行される。すなわち、まず、第1スキャン部331が、第1の対象範囲R10を最後の係数LTの次の係数からDC係数DCにかけて直線的にスキャンして、スキャンした係数を1次元配列ARR1に格納する。 At this time, the first-stage coefficient encoding process is executed as follows. That is, first, the first scanning unit 331 linearly scans the first target range R10 from the coefficient next to the last coefficient LT to the DC coefficient DC, and stores the scanned coefficients in the one-dimensional array ARR1.
 続いて、第1係数符号化部332が、直線スキャン用VLCテーブルTBL21を参照しながら、1次元配列ARR1に格納された係数を、最後の係数LTの次の係数からDC係数DCにかけて符号化する。第1係数符号化部332が係数を符号化する順を、図6の(a)に実線矢印にて示している。 Subsequently, the first coefficient encoding unit 332 encodes the coefficient stored in the one-dimensional array ARR1 from the coefficient next to the last coefficient LT to the DC coefficient DC while referring to the linear scan VLC table TBL21. . The order in which the first coefficient encoding unit 332 encodes the coefficients is indicated by solid line arrows in FIG.
 以上により第1段階の係数符号化処理が終了すると、第2段階の係数符号化処理が開始される。 When the first stage coefficient encoding process is completed as described above, the second stage coefficient encoding process is started.
 また、図6の(b)に示すとおり、第2段階の係数符号化処理では、第2の対象範囲R20が処理対象となる。 Further, as shown in FIG. 6B, in the second stage coefficient encoding process, the second target range R20 is a processing target.
 このとき第2段階の係数復号処理は次のようにして実行される。すなわち、まず、第2係数スキャン部333が、係数STを基点にして対象範囲R20についてジグザグスキャンを行う。つまり、ジグザグスキャンは、図6の(b)のに示す実線矢印の逆順により行われる。第2係数スキャン部333は、スキャンした係数を順に1次元配列ARR2に格納する。 At this time, the second-stage coefficient decoding process is executed as follows. That is, first, the second coefficient scanning unit 333 performs a zigzag scan on the target range R20 with the coefficient ST as a base point. That is, the zigzag scan is performed in the reverse order of the solid line arrows shown in FIG. The second coefficient scanning unit 333 stores the scanned coefficients in order in the one-dimensional array ARR2.
 次に、第2係数符号化部335が、1次元配列ARR2に格納された係数を符号化する。 Next, the second coefficient encoding unit 335 encodes the coefficients stored in the one-dimensional array ARR2.
 第2段階においては、実際には、係数K1から係数STにかけての領域R21が符号化処理の対象となる。 In the second stage, the region R21 from the coefficient K1 to the coefficient ST is actually the target of the encoding process.
 第2係数符号化部335が係数を符号化する順を、図6の(b)に実線矢印にて示している。すなわち、第2係数符号化部335は、第2段階の最後の係数K1から、第2段階の最初の係数STにかけて符号化を行い、第2係数符号化データC12を生成する。 The order in which the second coefficient encoding unit 335 encodes the coefficients is indicated by solid line arrows in FIG. That is, the second coefficient encoding unit 335 performs encoding from the last coefficient K1 in the second stage to the first coefficient ST in the second stage, and generates second coefficient encoded data C12.
 このようにして、2段階符号化部330は係数符号化処理を行って、第1係数符号化データC11、2段階フラグF1、および第2係数符号化データC12を含む係数符号化データC10を生成する。 In this way, the two-stage encoding unit 330 performs coefficient encoding processing to generate coefficient encoded data C10 including the first coefficient encoded data C11, the first-stage flag F1, and the second coefficient encoded data C12. To do.
  (処理の流れ)
 次に、図11を用いて、TU情報符号化部31における係数符号化処理の流れについて説明する。図11は、TU情報符号化部31における係数符号化処理の流れについて示したフローチャートである。
(Process flow)
Next, the flow of coefficient encoding processing in the TU information encoding unit 31 will be described with reference to FIG. FIG. 11 is a flowchart showing the flow of coefficient encoding processing in the TU information encoding unit 31.
 まず、最後の係数検出部310が、係数行列MX10の最後の係数LTを導出する(S21)と、位置判定部320が、最後の係数LTの位置が所定の条件を満たすか否かを判定する(S22)。 First, when the last coefficient detection unit 310 derives the last coefficient LT of the coefficient matrix MX10 (S21), the position determination unit 320 determines whether the position of the last coefficient LT satisfies a predetermined condition. (S22).
 最後の係数LTの位置が所定の条件を満たさない場合(S22においてNO)、一括符号化部340が、一括で係数符号化処理を行う(S23)。 When the position of the last coefficient LT does not satisfy the predetermined condition (NO in S22), the batch encoding unit 340 performs the coefficient encoding process in a batch (S23).
 すなわち、S23では、まず、一括スキャン部341が、係数行列MX10に対してスキャンを行って、スキャンした係数を1次元配列に格納する(S231)。そして、一括係数符号化部342が、1次元配列に格納された係数を順に符号化する(S232)。一括符号化部340が、このようにして得られた係数符号化データC10を出力して、処理は終了する。 That is, in S23, the collective scanning unit 341 first scans the coefficient matrix MX10 and stores the scanned coefficients in a one-dimensional array (S231). Then, the collective coefficient encoding unit 342 sequentially encodes the coefficients stored in the one-dimensional array (S232). The batch encoding unit 340 outputs the coefficient encoded data C10 obtained in this way, and the process ends.
 なお、一括係数符号化部342は、まず、ランモードにより係数を符号化し、所定の条件を満たした場合、非ランモードに切り替えて係数を符号化する。 Note that the batch coefficient encoding unit 342 first encodes the coefficient in the run mode, and when the predetermined condition is satisfied, switches to the non-run mode and encodes the coefficient.
 一方、最後の係数LTの位置が所定の条件を満たす場合(S22においてYES)、2段階符号化部330において次のように2段階の係数符号化処理が行われる。 On the other hand, when the position of the last coefficient LT satisfies a predetermined condition (YES in S22), the two-stage encoding unit 330 performs a two-stage coefficient encoding process as follows.
 すなわち、まず、第1スキャン部331が、最後の係数の次の係数からDC係数までをスキャンすることにより、1次元配列ARR1に係数を格納する(S24)。 That is, first, the first scanning unit 331 scans the coefficient from the coefficient next to the last coefficient to the DC coefficient to store the coefficient in the one-dimensional array ARR1 (S24).
 次に、第1係数符号化部332が、S24において得られた1次元配列ARR1の係数を最後の係数の次の係数からDC係数にかけて符号化する(S25)。第1係数符号化部332は、符号化により生成した第1係数符号化データC11を出力する。 Next, the first coefficient encoding unit 332 encodes the coefficient of the one-dimensional array ARR1 obtained in S24 from the coefficient next to the last coefficient to the DC coefficient (S25). The first coefficient encoding unit 332 outputs first coefficient encoded data C11 generated by encoding.
 次に、第2スキャン部333が、残りの係数をスキャンする(S26)。すなわち、第2スキャン部333が、領域R21に対してスキャンを行う。これにより領域R21にある係数が1次元配列ARR2に格納される。 Next, the second scanning unit 333 scans the remaining coefficients (S26). That is, the second scanning unit 333 performs scanning on the region R21. As a result, the coefficients in the region R21 are stored in the one-dimensional array ARR2.
 ここで、フラグ設定部334が、残りの係数があるか否かを判定する(S27)。すなわち、フラグ設定部334は、1次元配列ARR2に、非ゼロ係数が存在するか否かを判定する。 Here, the flag setting unit 334 determines whether there is a remaining coefficient (S27). That is, the flag setting unit 334 determines whether or not a non-zero coefficient exists in the one-dimensional array ARR2.
 残りの係数がない場合(S27においてNO)、フラグ設定部334は、第2段階フラグF1に”0(残りの係数なし)”を設定する(S28)。そして、第2段階では係数の符号化が行われることなく、処理は終了する。 If there is no remaining coefficient (NO in S27), the flag setting unit 334 sets “0 (no remaining coefficient)” to the second stage flag F1 (S28). Then, in the second stage, the processing ends without encoding the coefficients.
 一方、残りの係数がある場合(S27においてYES)、フラグ設定部334は、第2段階フラグF1に”1(残りの係数あり)”を設定する(S29)。 On the other hand, when there is a remaining coefficient (YES in S27), the flag setting unit 334 sets “1 (with remaining coefficient)” to the second stage flag F1 (S29).
 次に、第2係数符号化部335が、領域R21にある残りの係数を符号化する(S30)。第2係数符号化部335が、符号化により生成した第2係数符号化データC12を出力し、処理は終了する。 Next, the second coefficient encoding unit 335 encodes the remaining coefficients in the region R21 (S30). The second coefficient encoding unit 335 outputs the second coefficient encoded data C12 generated by encoding, and the process ends.
 なお、第2係数符号化部335は、まず、ランモードにより係数を符号化し、所定の条件を満たした場合、非ランモードに切り替えて係数を符号化してもよい。また、第2係数符号化部335は、非ランモードのみで係数を符号化してもよい。 Note that the second coefficient encoding unit 335 may first encode the coefficient in the run mode, and may encode the coefficient by switching to the non-run mode when a predetermined condition is satisfied. Further, the second coefficient encoding unit 335 may encode the coefficient only in the non-run mode.
  (作用・効果)
 以上のように、動画像符号化装置2は、入力画像#10から予測画像Predを減じた予測残差Dを、直交変換し、量子化した量子化予測残差QDからなる係数行列MX10をスキャンして符号することにより係数符号化データC10を出力する動画像符号化装置2において、係数行列MX10における、上記スキャン順上、最後の係数LTの位置を検出する最後の係数検出部310と、最後の係数LTの位置が、係数行列MX10において、DC係数DCを含む第1行目または第1列目の第1段階の対象範囲R10にあるか否かを判定する位置判定部320と、最後の係数LTの位置が、第1段階の対象範囲R10にある場合、係数行列MX10を、第1段階の対象範囲R10と、第1段階の対象範囲R10以外の第1段階の対象範囲R20との2段階で符号化する2段階符号化部330と、を備えることを特徴とする。
(Action / Effect)
As described above, the video encoding device 2 scans the coefficient matrix MX10 including the quantized prediction residual QD obtained by orthogonally transforming the prediction residual D obtained by subtracting the prediction image Pred from the input image # 10 and quantizing the prediction residual D. In the moving picture encoding apparatus 2 that outputs the coefficient encoded data C10 by encoding the last coefficient detection unit 310 that detects the position of the last coefficient LT in the scan order in the coefficient matrix MX10, and the last A position determination unit 320 that determines whether or not the position of the coefficient LT is within the first stage target range R10 of the first row or first column including the DC coefficient DC in the coefficient matrix MX10; When the position of the coefficient LT is in the first stage target range R10, the coefficient matrix MX10 is converted into the first stage target range R10 and the first stage target range R2 other than the first stage target range R10. Characterized in that it comprises a two step encoding unit 330 for encoding in two stages with.
 この構成により、係数の分布に偏りがある場合、係数符号化処理の際に、0ランが分断されることを防ぎ、符号化効率の向上を図ることができる。 With this configuration, when there is a bias in the distribution of coefficients, it is possible to prevent the 0 run from being divided during the coefficient encoding process and improve the encoding efficiency.
  (実施例)
 以下において、動画像符号化装置2の詳細な実施例についてさらに説明する。
(Example)
In the following, a detailed embodiment of the video encoding device 2 will be further described.
   [シンタックス]
 図12および図13に、動画像符号化装置2のTU情報符号化部31における係数符号化処理のシンタックスの例について示す。なお、係数符号化処理を一括で行うか、2段階で行うかの切り替えは、上位のシンタックスにて行われているものとする。すなわち、最後の係数LTの位置の判定は、上位のシンタックスにて行われる。
[Syntax]
FIGS. 12 and 13 show an example of the syntax of the coefficient encoding process in the TU information encoding unit 31 of the moving image encoding apparatus 2. It should be noted that switching between performing the coefficient encoding process all at once or in two stages is performed in the upper syntax. In other words, the determination of the position of the last coefficient LT is performed using the upper syntax.
 図12に示すシンタックスについて説明すると次のとおりである。1行目の「residual_block_vlc_1」が呼び出され、2段階の係数符号化処理が開始される。 The syntax shown in FIG. 12 will be described as follows. “Residual_block_vlc_1” on the first line is called, and a two-stage coefficient encoding process is started.
 また、SYN11の「residual_block_vlc_1a」では、第1段階の係数符号化処理を呼び出している。SYN12の”more_coeff_flag”は、第2段階の係数符号化処理を行うか否かを示すシンタックス要素である。 Also, in “residual_block_vlc_1a” of SYN11, the first-stage coefficient encoding process is called. “More_coeff_flag” of SYN 12 is a syntax element indicating whether or not to perform the second-stage coefficient encoding process.
 そして、”more_coeff_flag”が”1”である場合、SYN13にて、「residual_block_vlc_1a」により、第2段階の係数符号化処理が呼び出される。 When “more_coeff_flag” is “1”, the second stage coefficient encoding process is called by “residual_block_vlc — 1a” in SYN13.
 図13に示すシンタックスは、「residual_block_vlc_1a」における係数符号化処理について示している。図13に示すように、SYN21では、最後の係数が符号化される。より詳細には、まず、”last_pos_table_idx”が符号化される。”last_pos_table_idx”は、最後の係数が1かどうかを示すフラグ(levelMagnitudeGreaterThanOneFlag)と、最後の係数の位置(last_pos)との組み合わせを示すシンタックス要素である。この組み合わせは、テーブルに定義されており、インデックスにより組み合わせを特定する。 The syntax shown in FIG. 13 indicates the coefficient encoding process in “residual_block_vlc_1a”. As shown in FIG. 13, in the SYN 21, the last coefficient is encoded. More specifically, first, “last_pos_table_idx” is encoded. “Last_pos_table_idx” is a syntax element indicating a combination of a flag (levelMagnitudeGreaterThanOneFlag) indicating whether or not the last coefficient is 1 and the position (last_pos) of the last coefficient. This combination is defined in the table, and the combination is specified by an index.
 そして、”levelMagnitudeGreaterThanOneFlag”が”1”である場合、最後の係数のレベルは1より大きいので、2を引いた値が符号化される(last_pos_level)。 When “levelMagnitudeGreaterThanOneFlag” is “1”, the level of the last coefficient is larger than 1, so the value obtained by subtracting 2 is encoded (last_pos_level).
 そして、最後の係数の正負符号が符号化される(last_pos_sign)。 Then, the sign of the last coefficient is encoded (last_pos_sign).
 続く、SYN22では、ランモードおよび非ランモードが実行される。より詳細には、まず、SYN220にて、所定の条件下、ランモードのループが実行される。 Subsequently, in SYN 22, the run mode and the non-run mode are executed. More specifically, first, the loop of the run mode is executed in SYN 220 under a predetermined condition.
 ここで、SYN221の” isLevelOne_run”は、次の係数が1かどうかを示すフラグ(isLevelOne)と、0ランの長さ(run)との組み合わせを示すシンタックス要素である。また、SYN222では、0が続くrun分の処理がスキップされる。 Here, “isLevelOne_run” of SYN 221 is a syntax element indicating a combination of a flag (isLevelOne) indicating whether or not the next coefficient is 1 and the length (run) of 0 run. Also, in SYN 222, processing for the run that continues with 0 is skipped.
 また、”isLevelOne”が”1”でない場合、係数のレベルが1より大きいので、実際の係数値から2が引かれた値(level_magnitude_minus2)と、その正負符号(level_sign)とが符号化される。 Also, when “isLevelOne” is not “1”, the coefficient level is larger than 1, so the value obtained by subtracting 2 from the actual coefficient value (level_magnitude_minus2) and its sign (level_sign) are encoded.
 一方、”isLevelOne”が”1”である場合、係数値の正負符号(level_sign)が符号化される。 On the other hand, when “isLevelOne” is “1”, the sign of the coefficient value (level_sign) is encoded.
 なお、ループの終了条件のうち”i<=i_max”について説明すると次のとおりである。対象ブロックが8×8のとき、まず、”i”の初期値は、”63-last_pos”である。そして、”i_max”は、第1段階であれば”63-last_pos+scanX(last_pos)”であり、また、第2段階であれば”63”である。 It should be noted that “i <= i_max” in the loop termination condition will be described as follows. When the target block is 8 × 8, first, the initial value of “i” is “63-last_pos”. “I_max” is “63−last_pos + scanX (last_pos)” in the first stage, and “63” in the second stage.
 また、”runMode”は、SYN220のループ内で所定の条件が満たされると0になる。対象ブロックが8×8の場合、レベル2以上の係数が2個出現するか、または、”i_max-i”が閾値以下になることが条件である。 Also, “runMode” becomes 0 when a predetermined condition is satisfied in the loop of SYN220. When the target block is 8 × 8, it is a condition that two coefficients of level 2 or higher appear or “i_max-i” is equal to or less than a threshold value.
 閾値は、係数の数が残りn個以下になるとランモードを終了するよう制御するためのものである。この閾値は、予測モードがインターであるか、イントラであるか、輝度や色差の値等、ブロックの属性に応じて決定される。例えば、閾値n=15である。 The threshold value is for controlling the run mode to end when the remaining number of coefficients is n or less. This threshold value is determined according to block attributes such as whether the prediction mode is inter or intra, and values of luminance and color difference. For example, the threshold value n = 15.
 SYN220のランモードのループが終了すると、SYN230の非ランモードのループに入り、残りの係数が符号化される。非ランモードは、”level_magnitude”のシンタックス要素と、”level_sign”のシンタックス要素とを含む。 When the run mode loop of SYN 220 is completed, the loop of non-run mode of SYN 230 is entered, and the remaining coefficients are encoded. The non-run mode includes a “level_magnitude” syntax element and a “level_sign” syntax element.
 ”level_magnitude”は、係数のレベルであり、このレベルが0でない場合、正負符号である”level_sign”が符号化される。 “Level_magnitude” is a coefficient level. When this level is not 0, “level_sign” that is a positive / negative sign is encoded.
 以上のように、第1段階および第2段階の係数符号化処理のシンタックスは、上記の水準の詳細度であれば共通化することができる。なお、より詳細には、第1段階および第2段階の係数符号化処理の違いとしては、スキャン順序、対象となる係数の個数、使用するVLCテーブル、”last_pos_table_idx”が示す係数などがある。 As described above, the syntax of the coefficient encoding process in the first stage and the second stage can be made common if the level of detail is the above level. In more detail, the difference between the first and second stage coefficient encoding processes includes the scan order, the number of target coefficients, the VLC table to be used, the coefficient indicated by “last_pos_table_idx”, and the like.
  [一括係数符号化部が参照するVLCテーブル]
 以下において、図14、図15、図16を用いて、動画像符号化装置2における一括係数符号化部342が参照するジグザグスキャン用VLCテーブルTBL22の具体例について説明する。
[VLC table referenced by the batch coefficient encoding unit]
Hereinafter, a specific example of the zigzag scan VLC table TBL22 referred to by the collective coefficient encoding unit 342 in the moving image encoding device 2 will be described with reference to FIGS. 14, 15, and 16.
 図14に、ラン(run)の最大値が5の場合における”run”および”isLevelOne”の組み合わせに対応するコード番号(CodeNum)の対応を定義したテーブルを示す。 FIG. 14 shows a table defining the correspondence of code numbers (CodeNum) corresponding to combinations of “run” and “isLevelOne” when the maximum value of run is 5.
 また、図15は、ランの最大値が5である場合におけるジグザグスキャン用VLCテーブルTBL22の一例を示している。同図に示すジグザグスキャン用VLCテーブルTBL22は、runの最大値が”5”、Pスライス、8×8変換の場合における定義の例である。 FIG. 15 shows an example of the zigzag scan VLC table TBL22 when the maximum value of the run is 5. The zigzag scan VLC table TBL22 shown in the figure is an example of the definition when the maximum value of run is “5”, P slice, and 8 × 8 conversion.
 係数符号化処理は、図14に示すテーブルから”run”および”isLevelOne”の組み合わせに対応するコード番号が読み取られ、読み取られたコード番号に対応するコードを図15に示すジグザグスキャン用VLCテーブルTBL22から参照することで行われる。 In the coefficient encoding process, the code number corresponding to the combination of “run” and “isLevelOne” is read from the table shown in FIG. 14, and the code corresponding to the read code number is read in the zigzag scan VLC table TBL22 shown in FIG. It is done by referring to.
 ランモードでは、”run”および”isLevelOne”の組み合わせに基づいてジグザグスキャン用VLCテーブルTBL22が参照される。また、ジグザグスキャン用VLCテーブルTBL22は、符号化の対象となる係数の位置における”run”の最大値に基づいて決定される。 In the run mode, the zigzag scan VLC table TBL22 is referred to based on the combination of “run” and “isLevelOne”. The zigzag scan VLC table TBL22 is determined based on the maximum value of “run” at the position of the coefficient to be encoded.
 ここで、図16を用いて、”run”の最大値について説明すると次のとおりである。図16では、T1の位置にある係数(以下、係数T1と称する)が符号化の対象となっている。 Here, the maximum value of “run” will be described with reference to FIG. In FIG. 16, the coefficient at the position of T1 (hereinafter referred to as coefficient T1) is the object of encoding.
 このとき、係数T1以後の図16に示す実線矢印の順序で符号化される。係数T1以後の符号化は、DC係数DCまで行われる。つまり、係数T1の次に処理される係数からDC係数DCまでの係数の数がrunの最大値である。言い換えれば、runの最大値は、符号化対象の係数のうち、未処理である係数の数から決定される。図16に示す例では、runの最大値は”5”である。 At this time, encoding is performed in the order of solid line arrows shown in FIG. 16 after the coefficient T1. Encoding after the coefficient T1 is performed up to the DC coefficient DC. That is, the number of coefficients from the coefficient processed next to the coefficient T1 to the DC coefficient DC is the maximum value of run. In other words, the maximum value of run is determined from the number of unprocessed coefficients among the coefficients to be encoded. In the example shown in FIG. 16, the maximum value of run is “5”.
 また、係数T1のひとつ左下の係数T2が非ゼロ係数であった場合、runは、”0”であり、DC係数DCが、係数T1の次に出現する非ゼロ係数である場合、runは、”4”である。なお、runが”5”である場合、係数T1以降には非ゼロ係数が存在しないことを意味する。 When the coefficient T2 at the lower left of the coefficient T1 is a non-zero coefficient, run is “0”, and when the DC coefficient DC is a non-zero coefficient that appears next to the coefficient T1, run is “4”. When run is “5”, it means that there is no non-zero coefficient after coefficient T1.
 図16の各位置に示す数字は、その位置で次の非ゼロ係数が出現したときに得られるコード番号を示している。なお、図示するコード番号は、図14において、isLevelOne=trueの場合のものを示している。 The numbers shown at each position in FIG. 16 indicate the code numbers obtained when the next non-zero coefficient appears at that position. The code numbers shown in FIG. 14 are those when isLevelOne = true in FIG.
 図15に示すジグザグスキャン用VLCテーブルTBL22の例では、コード番号が大きいほど、より長い符号(code)が割り当てられている。 In the example of the zigzag scan VLC table TBL22 shown in FIG. 15, the longer the code number, the longer the code is assigned.
 しかし、同図において、コード番号は、runが短いほど小さな値になっているわけではない。これは、係数同士の平面的な位置関係に基づいて、コード番号が定められているからである。 However, in the same figure, the code number does not become smaller as the run is shorter. This is because the code number is determined based on the planar positional relationship between the coefficients.
 図15に基づいて、より詳しく説明すると、次のとおりである。すなわち、ランモードが適用される領域では、”isLevelOne=true”の可能性が高いため、同図において、”isLevelOne”が、”true”であるものに、比較的短い符号が割り当てられている。これに対して、”isLevelOne”が、”false”であるものには、比較的長い符号が割り当てられている。 The following is a more detailed description based on FIG. That is, in the region to which the run mode is applied, there is a high possibility of “isLevelOne = true”. Therefore, in the same figure, a relatively short code is assigned to “isLevelOne” being “true”. On the other hand, a relatively long code is assigned to “isLevelOne” having “false”.
 また、図15において、係数T1の左および左下に隣接する係数が次の非ゼロ係数である可能性は高いので、これらにも比較的短い符号が割り当てられている(コード番号:1、2参照)。 Further, in FIG. 15, since there is a high possibility that the coefficients adjacent to the left and lower left of the coefficient T1 are the next non-zero coefficients, relatively short codes are also assigned to them (see code numbers: 1 and 2) ).
 動画像符号化装置2では、以上に例示したようなジグザグスキャン用VLCテーブルTBL22が、ランモードの最大値や、ブロックの属性などのコンテキストに応じて複数定義されている。一括係数符号化部342は、コンテキストに応じてジグザグスキャン用VLCテーブルTBL22を適宜切り替えて参照する。 In the video encoding device 2, a plurality of zigzag scan VLC tables TBL22 as exemplified above are defined in accordance with the context such as the maximum value of the run mode and the attribute of the block. The batch coefficient encoding unit 342 refers to the zigzag scan VLC table TBL22 by appropriately switching according to the context.
  [第1係数符号化部が参照するVLCテーブル]
 次に、図17および図18を用いて、動画像符号化装置2における第1係数符号化部332が参照する直線スキャン用VLCテーブルTBL21の具体例について説明する。
[VLC table referred to by first coefficient encoding unit]
Next, a specific example of the linear scan VLC table TBL21 referred to by the first coefficient encoding unit 332 in the moving image encoding device 2 will be described with reference to FIGS. 17 and 18.
 図17に、ラン(run)の最大値が5の場合における”run”および”isLevelOne”の組み合わせに対応するコード番号(CodeNum)の対応を定義したテーブルを示す。 FIG. 17 shows a table defining the correspondence of code numbers (CodeNum) corresponding to combinations of “run” and “isLevelOne” when the maximum value of run is 5.
 また、図18に、ラン(run)の最大値が5である場合における直線スキャン用VLCテーブルTBL21を示す。 FIG. 18 shows the VLC table TBL21 for linear scanning when the maximum value of run is 5.
 第1係数符号化部332は、”run”および”isLevelOne”の組み合わせに基づいて、図17に示すテーブルを参照し、対応するコード番号を取得する。そして、第1係数符号化部332は、取得したコード番号に基づいて。図18に示す直線スキャン用VLCテーブルTBL21を参照し、対応するコードを取得することにより、係数の符号化を行う。 The first coefficient encoding unit 332 acquires a corresponding code number by referring to the table shown in FIG. 17 based on the combination of “run” and “isLevelOne”. Then, the first coefficient encoding unit 332 is based on the acquired code number. The coefficient is encoded by obtaining the corresponding code with reference to the linear scanning VLC table TBL21 shown in FIG.
 ところで、第1係数符号化部332が符号化する領域は直線であるので、直線スキャン用VLCテーブルTBL21は、ジグザグスキャン用VLCテーブルTBL22のような平面的位置関係を考慮した定義となっていなくてもかまわない。 By the way, since the region encoded by the first coefficient encoding unit 332 is a straight line, the linear scan VLC table TBL21 is not defined in consideration of the planar positional relationship like the zigzag scan VLC table TBL22. It doesn't matter.
 よって、図18に示すように、直線スキャン用VLCテーブルTBL21では、runの長さに比例した長さのコードが割り当てられていることが好ましい。ただし、run=5については、非ゼロ係数が残りの処理対象係数に存在しないことを意味し、また、発生頻度の高い事象であるため、短いコードが割り当てられている。
〔2〕実施形態1-2
 本発明の他の実施形態について図19~図26に基づいて説明すると、以下の通りである。なお、説明の便宜上、前記実施形態1-1にて説明した図面と同じ機能を有する部材については、同じ符号を付記し、その説明を省略する。
Therefore, as shown in FIG. 18, in the linear scanning VLC table TBL21, a code having a length proportional to the length of run is preferably assigned. However, run = 5 means that the non-zero coefficient does not exist in the remaining processing target coefficients, and since it is an event with a high occurrence frequency, a short code is assigned.
[2] Embodiment 1-2
Another embodiment of the present invention will be described with reference to FIGS. 19 to 26 as follows. For convenience of explanation, members having the same functions as those in the drawings described in the embodiment 1-1 are denoted by the same reference numerals and description thereof is omitted.
 〔画像復号装置:TU情報復号部〕
 まず、図19を用いて、本実施形態に係るTU情報復号部12Aの構成について説明する。図19は、TU情報復号部12Aの構成の他の例について示す機能ブロック図である。
[Image decoding device: TU information decoding unit]
First, the configuration of the TU information decoding unit 12A according to the present embodiment will be described with reference to FIG. FIG. 19 is a functional block diagram illustrating another example of the configuration of the TU information decoding unit 12A.
 TU情報復号部12Aでは、最後の係数および最後から2つ目の非ゼロ係数(以下、最後から2つ目の係数と称する)の位置を判定し、この判定に基づいて、2段階の係数復号処理を行う。なお、以下では、最後の係数および最後から2つ目の係数をまとめて、最後2つの係数と称する。 The TU information decoding unit 12A determines the position of the last coefficient and the second nonzero coefficient from the last (hereinafter referred to as the second coefficient from the last), and based on this determination, performs two-stage coefficient decoding. Process. Hereinafter, the last coefficient and the second coefficient from the last are collectively referred to as the last two coefficients.
 図19に示すように、TU情報復号部12Aは、図1に示したTU情報復号部12と、以下の点で相違する。すなわち、TU情報復号部12Aでは、最後の係数復号部121、位置判定部122、2段階復号部123、および一括復号部124を、それぞれ、最後2つの係数復号部125、位置判定部122A、2段階復号部123A、一括復号部124Aに変更している。 As shown in FIG. 19, the TU information decoding unit 12A is different from the TU information decoding unit 12 shown in FIG. 1 in the following points. That is, in the TU information decoding unit 12A, the last coefficient decoding unit 121, the position determination unit 122, the two-stage decoding unit 123, and the collective decoding unit 124 are respectively replaced with the last two coefficient decoding units 125, the position determination units 122A, 2A, and 2B. The stage decoding unit 123A and the batch decoding unit 124A are changed.
 最後2つの係数復号部125は、係数符号化データC10から最後の係数および最後から2つ目の係数までを復号する。 The last two coefficient decoding units 125 decode the last coefficient and the second coefficient from the last from the coefficient encoded data C10.
 具体的には、最後2つの係数復号部125は、まず、係数符号化データC10に含まれる最後の係数の位置last_pos(=LastIdx1a)、最後の係数のレベルlevel、および最後の係数の正負符号signを復号する。さらに、最後2つの係数復号部125は、最後から2つ目の係数の位置LastIdx1bおよびレベルlevelおよび正負符号signを復号する。 Specifically, the last two coefficient decoding units 125 firstly include the last coefficient position last_pos (= LastIdx 1a ), the last coefficient level level included in the coefficient encoded data C10, and the sign of the last coefficient. Decode sign. Further, the last two coefficient decoding units 125 decode the position LastIdx 1b, the level level, and the positive / negative sign sign of the second coefficient from the last.
 位置判定部122Aは、最後の係数復号部125が復号した最後の係数の位置および最後の係数復号部125が求めた最後2つ目の係数の位置を判定する。 The position determination unit 122A determines the position of the last coefficient decoded by the last coefficient decoding unit 125 and the position of the last coefficient obtained by the last coefficient decoding unit 125.
 まず、位置判定部122Aは、上述のとおりscanX、scanY関数を用いて、最後の係数の位置LastIdx1aおよび最後から2つ目の係数の位置LastIdx1bから、それぞれ、最後の係数の位置の座標(LastX1a,LastY1a)および最後から2つ目の係数の位置の座標(LastX1b,LastY1b)を求める。 First, the position determination unit 122A uses the scanX and scanY functions as described above, from the last coefficient position LastIdx 1a and the last coefficient position LastIdx 1b , respectively, to the coordinates of the last coefficient position ( LastX 1a , LastY 1a ) and coordinates (LastX 1b , LastY 1b ) of the second coefficient from the last are obtained.
 そして、位置判定部122Aは、次の判定式(2)の真偽を計算する。 Then, the position determination unit 122A calculates true / false of the following determination formula (2).
 ((LastX1a==0   && LastY1a≧ThY)&&
  (LastX1b==0   && LastY1b≧ThY)  )||
 ((LastX1a≧ThX && LastY1a==0)&&
  (LastX1b≧ThX && LastY1b==0)  ) … (2)
 判定式(2)における演算子およびThXおよびThYの意味は、判定式(1)のものに準じている。
((LastX 1a == 0 && LastY 1a ≧ ThY 1 ) &&
(LastX 1b == 0 && LastY 1b ≧ ThY 1 )) ||
((LastX 1a ≧ ThX 1 && LastY 1a == 0) &&
(LastX 1b ≧ ThX 1 && LastY 1b == 0)) (2)
The meanings of the operators and ThX 1 and ThY 1 in the judgment formula (2) are the same as those in the judgment formula (1).
 判定式(2)では、最後の係数の位置に加えて、最後から2つ目の係数の位置が判定されている。すなわち、最後から2つ目の係数の位置が、第1行目または第1列目にあり、かつDC係数の位置から閾値以上離れているか否かが判定されている。 In the determination formula (2), in addition to the position of the last coefficient, the position of the second coefficient from the last is determined. That is, it is determined whether or not the position of the second coefficient from the end is in the first row or the first column and is more than the threshold value from the position of the DC coefficient.
 判定式(2)の結果が「真」である場合、位置判定部122Aは、2段階の係数復号処理を行うことを決定する。この場合、位置判定部122Aは、決定結果を、2段階復号部123Aに通知する。 When the result of the determination formula (2) is “true”, the position determination unit 122A determines to perform a two-stage coefficient decoding process. In this case, the position determination unit 122A notifies the determination result to the two-stage decoding unit 123A.
 一方、判定式(2)の結果が「偽」である場合、位置判定部122Aは、一括で係数復号処理を行うことを決定する。この場合、位置判定部122A、決定結果を、一括復号部124Aに通知する。 On the other hand, when the result of the determination formula (2) is “false”, the position determination unit 122A determines to perform the coefficient decoding process collectively. In this case, the position determination unit 122A and the determination result are notified to the collective decoding unit 124A.
 2段階復号部123Aは、位置判定部320Aからの通知を受けて、2段階の係数復号処理を行う。2段階復号部123Aの機能は、復号の範囲が、最後から2つめの係数から、DC係数までである点以外は、2段階復号部123Aと同様である。 The two-stage decoding unit 123A receives the notification from the position determination unit 320A and performs a two-stage coefficient decoding process. The function of the two-stage decoding unit 123A is the same as that of the two-stage decoding unit 123A except that the decoding range is from the second coefficient from the last to the DC coefficient.
 一括復号部124Aは、位置判定部320からの通知を受けて、一括で係数符号化処理を行う。一括復号部124Aの機能は、復号の範囲が、最後から2つめの係数から、DC係数までである点以外は、一括復号部124Aと同様である。 The collective decoding unit 124A receives the notification from the position determination unit 320 and performs coefficient coding processing in a batch. The function of the collective decoding unit 124A is the same as that of the collective decoding unit 124A except that the decoding range is from the second coefficient from the last to the DC coefficient.
  (具体例)
 次に、図20および21を用いて、2段階の係数復号処理の具体例について説明する。図20は、係数行列MX10の最後の係数および最後から2つ目の係数の係数符号化処理または係数復号処理について示す図である。また、図21の(a)は、第1段階について示しており、同図の(b)は、第2段階について示している。
(Concrete example)
Next, a specific example of a two-stage coefficient decoding process will be described with reference to FIGS. FIG. 20 is a diagram illustrating the coefficient encoding process or the coefficient decoding process for the last coefficient and the second coefficient from the end of the coefficient matrix MX10. 21A shows the first stage, and FIG. 21B shows the second stage.
 また、図20において、濃い網掛けは、最後の係数LT1を示している。また、図20および図21の(a)において、薄い網掛けは、非ゼロ係数を示している。なお、図21の(a)では、第1段階までに処理済(符号化・復号)となる位置は、斜線にて表している。また、図21の(b)では、第1段階において処理済(符号化・復号)である位置は、斜線にて表している。 Further, in FIG. 20, the dark shading indicates the last coefficient LT1. In FIG. 20 and FIG. 21A, thin shading indicates a non-zero coefficient. In FIG. 21A, positions that have been processed (encoded / decoded) up to the first stage are indicated by hatching. In FIG. 21B, the positions that have been processed (encoding / decoding) in the first stage are indicated by hatching.
 まず、図20を用いて、最後2つの係数復号部125および位置判定部122Aの具体的動作について説明すると次のとおりである。 First, specific operations of the last two coefficient decoding units 125 and the position determination unit 122A will be described with reference to FIG.
 図20に示すように、最後2つの係数復号部125が、最後の係数LT1の位置および最後から2つ目の係数LT2を復号する。最後の係数LT1の位置および最後から2つ目の係数LT2の間は、長さ11のランである。別の表現をすれば、最後2つの係数復号部125は、同図に示す最後の係数LT1の位置および最後から2つ目の係数LT2の間の領域R41を復号する。 20, the last two coefficient decoding units 125 decode the position of the last coefficient LT1 and the second coefficient LT2 from the last. Between the position of the last coefficient LT1 and the second coefficient LT2 from the end, there is a run of length 11. In other words, the last two coefficient decoding units 125 decode the region R41 between the position of the last coefficient LT1 and the second coefficient LT2 from the last shown in FIG.
 そして、最後2つの係数復号部125は、最後の係数LT1の位置および最後から2つ目の係数LT2の位置を求める。最後の係数LT1の位置の座標(LastX1a,LastY1a)は、(6,0)である。また、最後から2つ目の係数LT2の位置(LastX1b,LastY1b)は、(5,0)である。 Then, the last two coefficient decoding units 125 obtain the position of the last coefficient LT1 and the position of the second coefficient LT2 from the last. Position coordinates of the last coefficient LT1 (LastX 1a, LastY 1a) is (6,0). In addition, the position (LastX 1b , LastY 1b ) of the second coefficient LT2 from the last is (5, 0).
 続いて、位置判定部122Aは、最後の係数LT1の位置および最後から2つ目の係数LT2の位置を判定する。 Subsequently, the position determination unit 122A determines the position of the last coefficient LT1 and the position of the second coefficient LT2 from the last.
 ここで、(LastX1a,LastY1a)=(6,0)より、最後の係数LT1の位置は、第1行目に含まれており、かつLastX1aが閾値ThX(=3)よりも大きい。また、(LastX1b,LastY1b)=(5,0)より、最後から2つ目の係数LT2は、第1行目に含まれており、かつLastX1bが閾値ThX(=3)よりも大きい。 Here, from (LastX 1a , LastY 1a ) = (6, 0), the position of the last coefficient LT1 is included in the first row, and LastX 1a is larger than the threshold ThX 1 (= 3). . Further, from (LastX 1b , LastY 1b ) = (5, 0), the second coefficient LT2 from the last is included in the first row, and LastX 1b is more than the threshold ThX 1 (= 3). large.
 よって、判定式(2)は、「真」となるので、位置判定部122Aは、2段階の係数復号処理を行うことを決定する。 Therefore, since the determination formula (2) is “true”, the position determination unit 122A determines to perform a two-stage coefficient decoding process.
 次に、図21を用いて、2段階復号部123Aの2段階の係数復号処理の具体例について説明する。図21の(a)は、第1段階の係数復号処理および係数符号化処理について示しており、図21の(b)は、第2段階の係数復号処理および係数符号化処理について示している。 Next, a specific example of the two-stage coefficient decoding process of the two-stage decoding unit 123A will be described with reference to FIG. 21A shows the first-stage coefficient decoding process and coefficient encoding process, and FIG. 21B shows the second-stage coefficient decoding process and coefficient encoding process.
 図21の(a)に示すように、2段階復号部123Aは、第1段階の係数復号処理において、第1行目の第1の対象範囲R30を復号の対象とする。実際には、2段階復号部123Aは、図21の(a)に示すように、第1の対象範囲R30において実際に復号すべき係数が存在する位置、すなわち最後から2つ目の係数LT2の次の係数CF10から、DC係数までの領域R31を復号する。 21 (a), the two-stage decoding unit 123A sets the first target range R30 in the first row as a decoding target in the first-stage coefficient decoding process. Actually, the two-stage decoding unit 123A, as shown in FIG. 21A, the position of the coefficient to be actually decoded in the first target range R30, that is, the second coefficient LT2 from the end. The region R31 from the next coefficient CF10 to the DC coefficient is decoded.
 続いて、図21の(b)に示すように、2段階復号部123Aは、第2段階の係数復号処理において、第1行目以外の第2の対象範囲R40を復号の対象とする。実際には、2段階復号部123Aは、図21の(b)に示すように、復号が未済の残りの係数がある領域R42を復号の対象とする。具体的には、2段階復号部123Aは、領域R42における最後の係数K2から、スキャン順上最初の係数STまでを復号する。 Subsequently, as illustrated in FIG. 21B, the two-stage decoding unit 123A sets the second target range R40 other than the first row as a decoding target in the second-stage coefficient decoding processing. Actually, as shown in FIG. 21B, the two-stage decoding unit 123A sets a region R42 having a remaining coefficient that has not been decoded as a decoding target. Specifically, the two-stage decoding unit 123A decodes from the last coefficient K2 in the region R42 to the first coefficient ST in the scan order.
  (処理の流れ)
 次に、図22を用いて、TU情報復号部12Aにおける係数復号処理の流れについて説明する。図22は、TU情報復号部12Aにおける係数復号処理の流れについて示したフローチャートである。
(Process flow)
Next, the flow of coefficient decoding processing in the TU information decoding unit 12A will be described using FIG. FIG. 22 is a flowchart showing the flow of coefficient decoding processing in the TU information decoding unit 12A.
 まず、最後2つの係数復号部125が、最後の係数LT1と、最後から2つ目の係数LT2とを復号する(S11A)
 次に、位置判定部122Aが、最後の係数LT1と、最後から2つ目の係数LT2とが条件(判定式(2))を満たすか否かを判定する(S12A)。
First, the last two coefficient decoding units 125 decode the last coefficient LT1 and the second coefficient LT2 from the last (S11A).
Next, the position determination unit 122A determines whether or not the last coefficient LT1 and the second coefficient LT2 from the last satisfy the condition (determination formula (2)) (S12A).
 最後の係数LT1と、最後から2つ目の係数LT2とが所定の条件を満たさない場合(S12AにおいてNO)、一括復号部124Aにおいて、残りの係数について一括で係数復号処理を行う(S13)。 When the last coefficient LT1 and the second coefficient LT2 from the last do not satisfy the predetermined condition (NO in S12A), the collective decoding unit 124A performs the coefficient decoding process on the remaining coefficients in a lump (S13).
 一方、最後の係数LT1と、最後から2つ目の係数LT2とが所定の条件を満たす場合(S12AにおいてYES)、2段階復号部123Aにおいて次のように2段階の係数復号処理が行われる。 On the other hand, if the last coefficient LT1 and the second coefficient LT2 from the last satisfy the predetermined condition (YES in S12A), the two-stage decoding unit 123A performs the two-stage coefficient decoding process as follows.
 すなわち、まず、第1係数復号部231が、最後から2つ目の係数の次の係数CF10からDC係数までを復号する(S14A)。いいかえれば、第1係数復号部231は、係数行列において第1行目または第1列目に含まれる係数を復号する。 That is, first, the first coefficient decoding unit 231 decodes the coefficient from the coefficient CF10 next to the second coefficient from the last to the DC coefficient (S14A). In other words, the first coefficient decoding unit 231 decodes the coefficient included in the first row or the first column in the coefficient matrix.
 次に、第1逆スキャン部232が、S14Aで復号された係数に対して逆スキャンを行う(S15A)。これにより、係数行列の第1行目または第1列目が再現される。 Next, the first reverse scanning unit 232 performs reverse scanning on the coefficients decoded in S14A (S15A). Thereby, the first row or the first column of the coefficient matrix is reproduced.
 次に、フラグ判定部233が、第2段階フラグを復号して(S16)、第2段階フラグが”1”か否かを判定する(S17)。第2段階フラグが”1”でない場合(S17においてNO)は、第2段階において復号対象となる領域に、非ゼロ係数が存在しないことになるので、第2段階の係数復号処理を行うことなく、係数復号処理は終了する。 Next, the flag determination unit 233 decodes the second stage flag (S16), and determines whether or not the second stage flag is “1” (S17). If the second stage flag is not “1” (NO in S17), since there is no non-zero coefficient in the region to be decoded in the second stage, the second stage coefficient decoding process is not performed. The coefficient decoding process ends.
 一方、第2段階フラグが”1”である場合(S17においてYES)、第2段階の係数復号処理が実行される。すなわち、第2係数復号部234が、残りの係数を復号する(S18A)。ここで、残りの係数は、実際に係数が符号化されている領域のうち、最後の係数LT1から、最後から2つ目の係数LT2までの間の領域R41と、最後から2つ目の係数LT2の次の係数CF10からDC係数までの領域とを除く領域R42にある係数である。さらにいえば、領域R42は、逆順のスキャン順上、係数K2から係数STにかけての領域である。 On the other hand, when the second stage flag is “1” (YES in S17), the second stage coefficient decoding process is executed. That is, the second coefficient decoding unit 234 decodes the remaining coefficients (S18A). Here, the remaining coefficients are the area R41 between the last coefficient LT1 and the second coefficient LT2 from the last, and the second coefficient from the last, among the areas where the coefficients are actually encoded. This is a coefficient in the region R42 excluding the region from the next coefficient CF10 to the DC coefficient of LT2. Furthermore, the region R42 is a region from the coefficient K2 to the coefficient ST in the reverse scan order.
 そして、第2逆スキャン部235が、S18において復号された係数に対して逆スキャンを実行することにより、残りの係数について係数行列を再現する(S19A)。 Then, the second inverse scanning unit 235 performs inverse scanning on the coefficients decoded in S18, thereby reproducing the coefficient matrix for the remaining coefficients (S19A).
 第1段階および第2段階の係数復号処理が行われることにより、係数行列の全体が再現されて、処理は終了する。 The first-stage and second-stage coefficient decoding processes are performed, so that the entire coefficient matrix is reproduced, and the process ends.
 〔動画像符号化装置:TU情報符号化部〕
 次に、図23を用いて、本実施形態に係るTU情報符号化部31Aの構成について説明する。図23は、TU情報符号化部31Aの構成の他の例について示す機能ブロック図である。
[Moving picture encoding device: TU information encoding unit]
Next, the configuration of the TU information encoding unit 31A according to the present embodiment will be described using FIG. FIG. 23 is a functional block diagram illustrating another example of the configuration of the TU information encoding unit 31A.
 TU情報符号化部31Aでは、最後の係数および最後から2つ目の係数の位置を判定し、この判定に基づいて、2段階の係数復号処理を行う。 The TU information encoding unit 31A determines the position of the last coefficient and the second coefficient from the last, and performs a two-stage coefficient decoding process based on this determination.
 図23に示すように、TU情報符号化部31Aは、図9に示したTU情報符号化部31と、以下の点で相違する。すなわち、TU情報符号化部31Aでは、最後の係数符号化部310、位置判定部320、および2段階符号化部330を、それぞれ、最後から2つ目までの係数検出部312、位置判定部320A、および2段階符号化部330Aに変更している。 23, the TU information encoding unit 31A is different from the TU information encoding unit 31 illustrated in FIG. 9 in the following points. That is, in the TU information encoding unit 31A, the last coefficient encoding unit 310, the position determination unit 320, and the two-stage encoding unit 330 are changed from the last coefficient detection unit 312 and the position determination unit 320A, respectively. , And the two-stage encoding unit 330A.
 最後から2つ目までの係数検出部312は、最後の係数および最後から2つ目の係数の位置を検出して、符号化する。また、最後から2つ目までの係数検出部312は、検出した最後の係数および最後から2つ目の係数の位置を位置判定部320Aに通知する。 The second to last coefficient detection unit 312 detects and encodes the position of the last coefficient and the second coefficient from the last. Further, the second to last coefficient detection unit 312 notifies the position determination unit 320A of the detected last coefficient and the position of the second coefficient from the last.
 位置判定部320Aは、最後から2つ目までの係数検出部312が検出した最後の係数および最後から2つ目の係数の位置が所定の条件を満たすか否かを判定する。具体的には、位置判定部320Aは、上述の判定式(2)の真偽を判定する。 The position determination unit 320A determines whether or not the position of the last coefficient detected by the second to last coefficient detection unit 312 and the position of the second coefficient from the last satisfy a predetermined condition. Specifically, position determination unit 320A determines the authenticity of the above-described determination formula (2).
 判定式(2)の結果が「真」である場合、位置判定部320Aは、2段階の係数復号処理を行うことを決定する。この場合、位置判定部320Aは、決定結果を、2段階符号化部330Aに通知する。 When the result of the determination formula (2) is “true”, the position determination unit 320A determines to perform a two-stage coefficient decoding process. In this case, the position determination unit 320A notifies the determination result to the two-stage encoding unit 330A.
 一方、判定式(2)の結果が「偽」である場合、位置判定部320Aは、一括で係数復号処理を行うことを決定する。この場合、位置判定部320Aは、決定結果を、一括符号化部340に通知する。 On the other hand, when the result of the determination formula (2) is “false”, the position determination unit 320A determines to perform the coefficient decoding process collectively. In this case, the position determination unit 320A notifies the determination result to the batch encoding unit 340.
 2段階符号化部330Aは、位置判定部320Aからの通知を受けて、2段階の係数符号化復号処理を行う。2段階符号化部330Aの機能は、符号化の範囲が、最後から2つ目の係数の次の係数からDC係数までとである点以外は、2段階符号化部330と同様である。 The two-stage encoding unit 330A receives the notification from the position determination unit 320A and performs a two-stage coefficient encoding / decoding process. The function of the two-stage encoding unit 330A is the same as that of the two-stage encoding unit 330 except that the encoding range is from the coefficient next to the second coefficient from the last to the DC coefficient.
  (具体例)
 次に、再び図20および21を用いて、2段階の係数符号化処理の具体例について説明する。
(Concrete example)
Next, a specific example of a two-stage coefficient encoding process will be described with reference to FIGS. 20 and 21 again.
 まず、図20を用いて、最後から2つ目までの係数検出部312および位置判定部320Aの具体的動作について説明すると次のとおりである。 First, the specific operations of the coefficient detection unit 312 and the position determination unit 320A from the last to the second will be described with reference to FIG.
 図20に示すように、最後から2つ目までの係数検出部312が、最後の係数LT1の位置および最後から2つ目の係数LT2を検出する。最後から2つ目までの係数検出部312は、例えば、係数行列に対して逆順のジグザグスキャンを行って、最後の係数LT1の位置を検出する。また、最後から2つ目までの係数検出部312は、さらに領域R41について最後の係数LT1から逆順のジグザグスキャンを行うことにより最後から2つ目の係数LT2を検出する。 As shown in FIG. 20, the second to last coefficient detection units 312 detect the position of the last coefficient LT1 and the second last coefficient LT2. For example, the second to last coefficient detection units 312 perform a reverse zigzag scan on the coefficient matrix to detect the position of the last coefficient LT1. The second to last coefficient detection unit 312 further detects the second coefficient LT2 from the last by performing reverse zigzag scanning from the last coefficient LT1 for the region R41.
 そして、最後から2つ目までの係数検出部312は、最後の係数LT1の位置および最後から2つ目の係数LT2の位置を求める。上述のとおり、最後の係数LT1の位置の座標(LastX1a,LastY1a)は、(6,0)である。また、最後から2つ目の係数LT2の位置(LastX1b,LastY1b)は、(5,0)である。 The second to last coefficient detection unit 312 obtains the position of the last coefficient LT1 and the position of the second coefficient LT2 from the last. As described above, the coordinates (LastX 1a , LastY 1a ) of the last coefficient LT1 are (6, 0). In addition, the position (LastX 1b , LastY 1b ) of the second coefficient LT2 from the last is (5, 0).
 また、最後から2つ目までの係数検出部312は、最後の係数LT1の最後の係数の位置last_pos、最後の係数のレベルlevel、および最後の係数の正負符号signを符号化する。また、最後から2つ目までの係数検出部312は、0ランrunおよび最後から2つ目の係数LT2のレベルlevelおよび正負符号signを符号化する。 Also, the second to last coefficient detection unit 312 encodes the last coefficient position last_pos of the last coefficient LT1, the last coefficient level level, and the sign of the last coefficient sign. In addition, the coefficient detection unit 312 from the last to the second encodes the 0 run run, the level level of the second coefficient LT2 from the last, and the positive / negative sign sign.
 続いて、位置判定部320Aは、最後の係数LT1の位置および最後から2つ目の係数LT2の位置を判定する。 Subsequently, the position determination unit 320A determines the position of the last coefficient LT1 and the position of the second coefficient LT2 from the last.
 上述のとおり、判定式(2)は、「真」となるので、位置判定部320Aは、2段階の係数符号化処理を行うことを決定する。 As described above, since the determination formula (2) is “true”, the position determination unit 320A determines to perform a two-stage coefficient encoding process.
 次に、図21を用いて、2段階符号化部330Aにおける2段階の係数符号化処理の具体例について説明する。 Next, a specific example of the two-stage coefficient encoding process in the two-stage encoding unit 330A will be described with reference to FIG.
 図21の(a)に示すように、2段階符号化部330Aは、第1段階の係数符号化処理において、第1の対象範囲R30を符号化の対象とする。実際には、2段階符号化部330Aは、図21の(a)に示すように、第1の対象範囲R30において実際に符号化すべき係数が存在する位置、すなわち、最後から2つ目の係数LT2の次の係数CF10から、DC係数までの領域R31を符号化する。 21 (a), the two-stage encoding unit 330A sets the first target range R30 as an encoding target in the first-stage coefficient encoding process. Actually, the two-stage encoding unit 330A, as shown in FIG. 21A, the position where the coefficient to be actually encoded exists in the first target range R30, that is, the second coefficient from the end. A region R31 from the next coefficient CF10 of LT2 to the DC coefficient is encoded.
 続いて、図21の(b)に示すように、2段階符号化部330Aは、第2段階の係数復号処理において、第2の対象範囲R40を復号の対象とする。実際には、2段階符号化部330Aは、図21の(b)に示すように、符号化が未済の残りの係数がある領域R42を復号の対象とする。具体的には、2段階符号化部330Aは、領域R42における最後の係数K2から、スキャン順上最初の係数STまでを復号する。 Subsequently, as illustrated in FIG. 21B, the two-stage encoding unit 330A sets the second target range R40 as a decoding target in the second-stage coefficient decoding process. Actually, as shown in FIG. 21B, the two-stage encoding unit 330A sets a region R42 having a remaining coefficient that has not been encoded as a decoding target. Specifically, the two-stage encoding unit 330A decodes from the last coefficient K2 in the region R42 to the first coefficient ST in the scan order.
   [係数符号化データの例]
 なお、図20および図21に示す例において、TU情報符号化部31Aは、例えば、以下のような係数符号化データを出力する。
[Example of coefficient coded data]
In the example illustrated in FIGS. 20 and 21, the TU information encoding unit 31A outputs, for example, the following coefficient encoded data.
 last_pos=27,level=1,sign=0
 run=11,level=2,sign=0
 run=1,level=1,sign=1
 …
 上記係数符号化データの例において、最初の2行は、最後から2つ目までの係数検出部312によって出力される。また、3行目は、2段階符号化部330Aにおいて第1段階の係数符号化処理により出力される。
last_pos = 27, level = 1, sign = 0
run = 11, level = 2, sign = 0
run = 1, level = 1, sign = 1
...
In the example of the coefficient encoded data, the first two rows are output by the coefficient detector 312 from the last to the second. The third row is output by the first-stage coefficient encoding process in the two-stage encoding unit 330A.
   [参考例]
 なお、参考までに、上述のTU情報符号化部31が図20に示すような係数行列が与えられたときに出力するであろう係数符号化データについて示すと次のとおりである。
[Reference example]
For reference, coefficient encoded data that will be output when the above-described TU information encoding unit 31 is given a coefficient matrix as shown in FIG. 20 is as follows.
 last_pos=27,level=1,sign=0
 run=0,level=2,sign=0
 run=1,level=1,sign=1
 …
 上記係数符号化データの例において、最初の1行は、最後の係数検出部310によって出力される。また、2行目および3行目は、2段階符号化部330Aにおいて第1の係数符号化処理により出力される。
last_pos = 27, level = 1, sign = 0
run = 0, level = 2, sign = 0
run = 1, level = 1, sign = 1
...
In the example of the coefficient encoded data, the first one row is output by the last coefficient detection unit 310. The second and third lines are output by the first coefficient encoding process in the two-stage encoding unit 330A.
  (処理の流れ)
 次に、図24を用いて、TU情報符号化部31Aにおける係数復号処理の流れについて説明する。図24は、TU情報符号化部31Aにおける係数復号処理の流れについて示したフローチャートである。
(Process flow)
Next, the flow of coefficient decoding processing in the TU information encoding unit 31A will be described using FIG. FIG. 24 is a flowchart showing the flow of coefficient decoding processing in the TU information encoding unit 31A.
 まず、最後から2つ目までの係数検出部312が、ジグザグスキャン順における最後の係数LT1と、最後から2つ目の係数LT2とを検出するとともに、符号化する(S21A)。 First, the second to last coefficient detector 312 detects and encodes the last coefficient LT1 in the zigzag scan order and the second coefficient LT2 from the last (S21A).
 次に、位置判定部320Aが、最後の係数LT1と、最後から2つ目の係数LT2とが条件(判定式(2))を満たすか否かを判定する(S22A)。 Next, the position determination unit 320A determines whether or not the last coefficient LT1 and the second coefficient LT2 from the last satisfy the condition (determination formula (2)) (S22A).
 最後の係数LT1と、最後から2つ目の係数LT2とが所定の条件を満たさない場合(S22AにおいてNO)、一括復号部340Aにおいて、残りの係数について一括で係数符号化処理を行う(S23)。 If the last coefficient LT1 and the second coefficient LT2 from the last do not satisfy the predetermined condition (NO in S22A), the collective decoding unit 340A performs coefficient coding processing on the remaining coefficients in a lump (S23). .
 一方、最後の係数LT1と、最後から2つ目の係数LT2とが所定の条件を満たす場合(S22AにおいてYES)、2段階符号化部330Aにおいて次のように2段階の係数符号化処理が行われる。 On the other hand, when the last coefficient LT1 and the second coefficient LT2 from the last satisfy the predetermined condition (YES in S22A), the two-stage encoding unit 330A performs a two-stage coefficient encoding process as follows. Is called.
 すなわち、まず、第1スキャン部331が、最後から2つ目の係数の次の係数CF10からDC係数までをスキャンすることにより、1次元配列ARR1に係数を格納する(S24A)。 That is, first, the first scanning unit 331 scans the coefficient from the coefficient CF10 next to the second coefficient from the last to the DC coefficient, and stores the coefficient in the one-dimensional array ARR1 (S24A).
 次に、第1係数符号化部332が、S24Aにおいて得られた1次元配列ARR1について係数CF10からDC係数にかけて符号化する(S25A)。第1係数符号化部332は、符号化により生成した第1係数符号化データC11を出力する。 Next, the first coefficient encoding unit 332 encodes the one-dimensional array ARR1 obtained in S24A from the coefficient CF10 to the DC coefficient (S25A). The first coefficient encoding unit 332 outputs first coefficient encoded data C11 generated by encoding.
 次に、第2スキャン部333が、残りの係数をスキャンする(S26A)。すなわち、第2スキャン部333が、領域R42の係数STから係数K2に対してスキャンを行う。これにより領域R42にある係数が1次元配列ARR2に格納される。 Next, the second scanning unit 333 scans the remaining coefficients (S26A). That is, the second scanning unit 333 scans the coefficient K2 from the coefficient ST in the region R42. As a result, the coefficients in the region R42 are stored in the one-dimensional array ARR2.
 ここで、残りの係数があるとき(S27においてYES)、フラグ設定部334は、第2段階フラグF1に”1(残りの係数あり)”を設定して(S29)、第2係数符号化部335が、領域R42にある残りの係数を符号化する(S30A)。 Here, when there is a remaining coefficient (YES in S27), the flag setting unit 334 sets “1 (with remaining coefficient)” to the second stage flag F1 (S29), and the second coefficient encoding unit. 335 encodes the remaining coefficients in region R42 (S30A).
 そして、第2係数符号化部335が、符号化により生成した第2係数符号化データC12を出力し、処理は終了する。 Then, the second coefficient encoding unit 335 outputs the second coefficient encoded data C12 generated by encoding, and the process ends.
  (実施例)
 以下において、TU情報符号化部31Aの詳細な実施例についてさらに説明する。
(Example)
Hereinafter, a detailed example of the TU information encoding unit 31A will be further described.
   [シンタックス]
 図25および図26に、TU情報符号化部31Aにおける係数符号化処理のシンタックスの例について示す。なお、係数符号化処理を一括で行うか、2段階で行うかの切り替えは、上位のシンタックスにて行われているものとする。すなわち、最後の係数LTの位置の判定は、上位のシンタックスにて行われる。
[Syntax]
FIG. 25 and FIG. 26 show an example of the syntax of the coefficient encoding process in the TU information encoding unit 31A. It should be noted that switching between performing the coefficient encoding process all at once or in two stages is performed in the upper syntax. In other words, the determination of the position of the last coefficient LT is performed using the upper syntax.
 図25に示すシンタックスについて説明すると次のとおりである。1行目の「residual_block_vlc_2」が呼び出され、2段階の係数符号化処理が開始される。 The syntax shown in FIG. 25 will be described as follows. “Residual_block_vlc_2” on the first line is called, and a two-stage coefficient encoding process is started.
 また、SYN31の「residual_block_vlc_2a」では、第1段階の係数符号化処理を呼び出している。SYN32の”more_coeff_flag”は、第2段階の係数符号化処理を行うか否かを示すシンタックス要素である。 Also, in “residual_block_vlc_2a” of SYN31, the first-stage coefficient encoding process is called. “More_coeff_flag” of SYN 32 is a syntax element indicating whether or not to perform the second-stage coefficient encoding process.
 そして、”more_coeff_flag”が”1”である場合、SYN33にて、「residual_block_vlc_1a」により、第2段階の係数符号化処理が呼び出される。SYN33は、図12に示したSYN13と同様である。 When “more_coeff_flag” is “1”, the second stage coefficient encoding process is called by “residual_block_vlc — 1a” in SYN33. SYN33 is the same as SYN13 shown in FIG.
 図26に示すシンタックスは、「residual_block_vlc_2a」における係数符号化処理について示している。図26に示すように、SYN41では、最後の係数が符号化される。より詳細には、まず、”last_pos_table_idx”が符号化される。”last_pos_table_idx”については、図13を用いてすでに説明しているので、ここではその説明を省略する。 The syntax shown in FIG. 26 indicates the coefficient encoding process in “residual_block_vlc_2a”. As shown in FIG. 26, in the SYN 41, the last coefficient is encoded. More specifically, first, “last_pos_table_idx” is encoded. Since “last_pos_table_idx” has already been described with reference to FIG. 13, the description thereof is omitted here.
 そして、”levelMagnitudeGreaterThanOneFlag”が”1”である場合、最後の係数のレベルは1より大きいので、2を引いた値が符号化される(last_pos_level)。 When “levelMagnitudeGreaterThanOneFlag” is “1”, the level of the last coefficient is larger than 1, so the value obtained by subtracting 2 is encoded (last_pos_level).
 そして、最後の係数の正負符号が符号化される(last_pos_sign)。 Then, the sign of the last coefficient is encoded (last_pos_sign).
 続く、SYN42では、最後から2つ目の係数が符号化される。最後から2つ目の係数は、ジグザグスキャンとランモードとが用いられる。詳しくは次のとおりである。 In the subsequent SYN 42, the second coefficient from the end is encoded. For the second coefficient from the end, zigzag scan and run mode are used. Details are as follows.
 ここで、SYN421には、図13を用いて説明した”isLevelOne_run”のシンタックス要素が含まれる。また、SYN422では、0が続くrun分の処理がスキップされる。 Here, SYN 421 includes the syntax element of “isLevelOne_run” described with reference to FIG. Also, in SYN 422, the processing for run that continues with 0 is skipped.
 また、SYN423において、”isLevelOne”が”1”でない場合、係数のレベルが1より大きいので、実際の係数値から2が引かれた値(level_magnitude_minus2)と、その正負符号(level_sign)とが符号化される。 Also, in SYN 423, when “isLevelOne” is not “1”, the coefficient level is larger than 1, so the value obtained by subtracting 2 from the actual coefficient value (level_magnitude_minus2) and its sign (level_sign) are encoded. Is done.
 一方、SYN423において、”isLevelOne”が”1”である場合、係数値の正負符号(level_sign)が符号化される。 On the other hand, when “isLevelOne” is “1” in SYN 423, the sign of the coefficient value (level_sign) is encoded.
 続く、SYN43では、直線スキャンが実行される。これは、図13に示したSYN22が第1段階の係数符号化処理で実行される場合と同様であるので、その説明を省略する。 Subsequently, in SYN 43, a linear scan is executed. This is the same as the case where SYN 22 shown in FIG. 13 is executed in the first-stage coefficient encoding process, and a description thereof will be omitted.
 〔3〕変形例
 以下において、動画像復号装置1について説明したTU情報復号部12およびTU情報復号部12Aと、動画像符号化装置2について説明したTU情報符号化部31およびTU情報符号化部31Aとの好ましい変形例について説明する。
[3] Modifications In the following, the TU information decoding unit 12 and the TU information decoding unit 12A described for the moving image decoding device 1, and the TU information encoding unit 31 and the TU information encoding unit described for the moving image encoding device 2. A preferred modification with 31A will be described.
 〔3-1〕第2段階フラグの省略
 2段階の係数符号化処理を行うことになっても、画像の特性によっては、第1行目または第1列目以外の行または列に係数が含まれる場合も多い。この場合は、係数符号化処理において、第2段階フラグを逐一符号化するのではなく、第2段階フラグを省略してもよい。さらに、第2段階フラグを省略するか否かを示すフラグを、シーケンス、ピクチャ、スライス、あるいはLCUなどの処理単位毎に符号化し、適宜処理を切り替えるとよい。
[3-1] Omission of the second-stage flag Even if the two-stage coefficient encoding process is performed, depending on the characteristics of the image, the coefficients are included in the rows or columns other than the first row or the first column. There are many cases. In this case, in the coefficient encoding process, the second stage flag may be omitted instead of encoding the second stage flag one by one. Further, a flag indicating whether or not the second stage flag is omitted may be encoded for each processing unit such as a sequence, a picture, a slice, or an LCU, and the processing may be switched as appropriate.
 また、本変形例では、第2段階での最後の係数が存在しても、存在しなくても適切に処理可能な構成例を示す。つまり、本変形例では、第2係数符号化データにおいて、第2段階での最後の係数を、last_posを用いては符号化しない。さらにいえば、第2段階での最後の係数は、第2段階で符号化対象となる領域に、非ゼロ係数が存在しない場合、存在しない。 Also, in this modification, a configuration example that can be appropriately processed even if the last coefficient in the second stage exists or does not exist is shown. That is, in the present modification, the last coefficient in the second stage is not encoded using last_pos in the second coefficient encoded data. Furthermore, the last coefficient in the second stage does not exist if there is no non-zero coefficient in the region to be encoded in the second stage.
 以下、図27を用いて、2つの変形例について説明する。図27は、第2段階フラグを省略する場合における係数符号化処理および係数復号処理について説明する図である。 Hereinafter, two modified examples will be described with reference to FIG. FIG. 27 is a diagram illustrating the coefficient encoding process and the coefficient decoding process when the second stage flag is omitted.
 なお、図27において、第1段階では、第1行目である第1の対象範囲R50が処理範囲となることとする。さらにいえば、実際には、第1段階では、最後の係数LTの次の係数からDC係数DCまでの直線的な領域R51が、処理対象となる。 In FIG. 27, in the first stage, the first target range R50 that is the first row is the processing range. More specifically, in actuality, in the first stage, a linear region R51 from the coefficient next to the last coefficient LT to the DC coefficient DC is to be processed.
 また、図27において、第2段階では、第1行目以外の範囲R60が処理範囲となることとする。さらにいえば、実際には、第2段階では、範囲R60におけるジグザグスキャン上最後の係数K3から係数符号化処理が開始される。係数K3は、非ゼロ係数であっても、ゼロ係数であってもよい。そして、範囲R60における最初の係数STまで係数符号化処理が実行される。よって、実際に処理対象となるのは、領域R61である。 Further, in FIG. 27, in the second stage, the range R60 other than the first row is the processing range. More specifically, in the second stage, the coefficient encoding process is started from the last coefficient K3 in the zigzag scan in the range R60. The coefficient K3 may be a non-zero coefficient or a zero coefficient. Then, the coefficient encoding process is executed up to the first coefficient ST in the range R60. Accordingly, the region R61 is actually processed.
 また、第2段階の係数符号化処理では、ランモードから処理を始めることとする。 In the second stage coefficient encoding process, the process starts from the run mode.
 〔第1の変形例〕
 第1の変形例では、第1段階と第2段階との間でランを区切る場合について説明する。この場合、図27に示す係数行列MX10についてTU情報符号化部31は、次のように符号化を行う。
[First Modification]
In the first modification, a case where a run is divided between the first stage and the second stage will be described. In this case, the TU information encoding unit 31 encodes the coefficient matrix MX10 illustrated in FIG. 27 as follows.
 まず、TU情報符号化部31は、最後の係数LTを以下のごとく符号化する。 First, the TU information encoding unit 31 encodes the last coefficient LT as follows.
 last_pos=15,level=1,sign=1
 続いて、図27に示すように、領域R51において残りの係数が非ゼロ係数でない場合でも、ランは、領域R51の中で終了させる。TU情報符号化部31は、次のような符号化データを出力する。
last_pos = 15, level = 1, sign = 1
Subsequently, as shown in FIG. 27, even when the remaining coefficients are not non-zero coefficients in the region R51, the run is ended in the region R51. The TU information encoding unit 31 outputs the following encoded data.
 run=5
 第2段階において、第2段階では、ランをリセットして、領域R61における係数K3から最初の係数STまで係数符号化処理を続ける。TU情報符号化部31は、次のような符号化データを出力する。
run = 5
In the second stage, in the second stage, the run is reset, and the coefficient coding process is continued from the coefficient K3 to the first coefficient ST in the region R61. The TU information encoding unit 31 outputs the following encoded data.
 run=2,level=1,sign=1
 run=1,level=1,sign=0
 run=5
 以上で、係数符号化処理は終了する。
run = 2, level = 1, sign = 1
run = 1, level = 1, sign = 0
run = 5
This completes the coefficient encoding process.
 〔第2の変形例〕
 第2の変形例では、第1段階と第2段階との間でランを継続させる場合について説明する。この場合、図27に示すTU情報符号化部31は、次のように符号化を行う。
[Second Modification]
In the second modification, a case where the run is continued between the first stage and the second stage will be described. In this case, the TU information encoding unit 31 illustrated in FIG. 27 performs encoding as follows.
 まず、TU情報符号化部31は、最後の係数LTを以下のごとく符号化する。これは上記第1の変形例の場合と同様である。 First, the TU information encoding unit 31 encodes the last coefficient LT as follows. This is the same as in the case of the first modification.
 last_pos=15,level=1,sign=1
 続いて、領域R61まで、非ゼロ係数が出現しないので、領域R51におけるランの長さと、領域R61におけるランの長さとを合算して、以下のとおり符号化する。
last_pos = 15, level = 1, sign = 1
Subsequently, since the non-zero coefficient does not appear up to the region R61, the run length in the region R51 and the run length in the region R61 are added together and encoded as follows.
 run=7,level=1,sign=1
 run=1,level=1,sign=0
 run=5
 ここでは、run=7の行が第1段階、残りの2行が第2段階として符号化される情報である。
run = 7, level = 1, sign = 1
run = 1, level = 1, sign = 0
run = 5
In this case, the information is encoded with the row of run = 7 as the first step and the remaining two rows as the second step.
 以上で、係数符号化処理は終了する。 This completes the coefficient encoding process.
  (TU情報符号化部の処理の流れ)
 次に、図28を用いて、本変形例に係るTU情報符号化部31における係数符号化処理の流れについて説明する。図28は、本変形例に係るTU情報符号化部31における係数符号化処理の流れについて示したフローチャートである。
(Processing flow of TU information encoding unit)
Next, the flow of coefficient encoding processing in the TU information encoding unit 31 according to this modification will be described with reference to FIG. FIG. 28 is a flowchart showing the flow of the coefficient encoding process in the TU information encoding unit 31 according to this modification.
 S21~S23の処理は、図11を用いて説明したとおりであるので、その説明を終了する。S24Bから説明すると次のとおりである。 Since the processing of S21 to S23 is as described with reference to FIG. 11, the description is ended. The description from S24B is as follows.
 最後の係数LTの位置が所定の条件を満たす場合(S22においてYES)、2段階符号化部330において次のように2段階の係数符号化処理が行われる。 When the position of the last coefficient LT satisfies a predetermined condition (YES in S22), the two-stage encoding unit 330 performs a two-stage coefficient encoding process as follows.
 すなわち、まず、第1スキャン部331が、最後の係数LTの次の係数からDC係数を過ぎるまでスキャンすることにより、1次元配列ARR1に係数を格納する(S24B)。すなわち、領域R51において、DC係数DCがゼロ係数であれば、第1スキャン部331は、引き続き領域R61の係数をスキャンする。DC係数DCが非ゼロ係数であれば、そこで第1段階の係数符号化処理は停止する。 That is, first, the first scanning unit 331 scans the coefficient after the last coefficient LT until it passes the DC coefficient, thereby storing the coefficient in the one-dimensional array ARR1 (S24B). That is, in the region R51, if the DC coefficient DC is a zero coefficient, the first scanning unit 331 continues to scan the region R61 coefficient. If the DC coefficient DC is a non-zero coefficient, the first-stage coefficient encoding process stops there.
 次に、第1係数符号化部332が、S24Bにおいて得られた1次元配列ARR1の係数を最後の係数LTの次の係数からDC係数を過ぎるまで符号化する(S25B)。第1係数符号化部332は、符号化により生成した第1係数符号化データC11を出力する。 Next, the first coefficient encoding unit 332 encodes the coefficient of the one-dimensional array ARR1 obtained in S24B from the coefficient next to the last coefficient LT until the DC coefficient passes (S25B). The first coefficient encoding unit 332 outputs first coefficient encoded data C11 generated by encoding.
 次に、第2スキャン部333が、領域R61にある残りの係数をスキャンする(S26B)。すなわち、第2スキャン部333が、S24Bで最後にスキャンされた係数の次の係数からスキャンを開始する。これにより領域Q1にある係数が1次元配列ARR2に格納される。 Next, the second scanning unit 333 scans the remaining coefficients in the region R61 (S26B). That is, the second scanning unit 333 starts scanning from the coefficient next to the coefficient scanned last in S24B. As a result, the coefficients in the region Q1 are stored in the one-dimensional array ARR2.
 次に、第2係数符号化部335が、領域R61にある残りの係数を符号化する(S30B)。第2係数符号化部335が、符号化により生成した第2係数符号化データC12を出力し、処理は終了する。 Next, the second coefficient encoding unit 335 encodes the remaining coefficients in the region R61 (S30B). The second coefficient encoding unit 335 outputs the second coefficient encoded data C12 generated by encoding, and the process ends.
  (TU情報復号部の処理の流れ)
 次に、図29を用いて、本変形例に係るTU情報復号部12における係数復号処理の流れについて説明する。図29は、本変形例に係るTU情報復号部12における係数復号処理の流れについて示したフローチャートである。
(Processing flow of TU information decoding unit)
Next, the flow of coefficient decoding processing in the TU information decoding unit 12 according to this modification will be described with reference to FIG. FIG. 29 is a flowchart showing the flow of coefficient decoding processing in the TU information decoding unit 12 according to this modification.
 S11~S13までは、図7を用いて説明したとおりであるので、その説明を終了する。S14Bから説明すると次のとおりである。 Since S11 to S13 are as described with reference to FIG. 7, the description is ended. The description from S14B is as follows.
 最後の係数LTの位置が所定の条件を満たす場合(S12においてYES)、2段階復号部123において次のように2段階の係数復号処理が行われる。 When the position of the last coefficient LT satisfies a predetermined condition (YES in S12), the two-stage decoding unit 123 performs a two-stage coefficient decoding process as follows.
 すなわち、まず、第1係数復号部231が、最後の係数LTの次の係数からDC係数を過ぎるまで係数を復号する(S14B)。 That is, first, the first coefficient decoding unit 231 decodes a coefficient from the coefficient next to the last coefficient LT until the DC coefficient is passed (S14B).
 次に、第1逆スキャン部232が、S14Bで復号された係数に対して逆スキャンを行う(S15B)。すなわち、第1係数復号部231は、最後の係数LTの次の係数からDC係数を過ぎるまで逆スキャンを実行する。 Next, the first reverse scanning unit 232 performs reverse scanning on the coefficients decoded in S14B (S15B). That is, the first coefficient decoding unit 231 performs reverse scanning from the coefficient next to the last coefficient LT until the DC coefficient is passed.
 次に、第2段階の係数復号処理が実行される。すなわち、第2係数復号部234が、残りの係数を復号する(S18B)。そして、第2逆スキャン部235が、S18において復号された係数に対して逆スキャンを実行することにより、残りの係数について係数行列を再現する(S19B)。 Next, the second stage coefficient decoding process is executed. That is, the second coefficient decoding unit 234 decodes the remaining coefficients (S18B). Then, the second inverse scanning unit 235 performs inverse scanning on the coefficients decoded in S18, thereby reproducing the coefficient matrix for the remaining coefficients (S19B).
 第1段階および第2段階の係数復号処理が行われることにより、係数行列の全体が再現されて、処理は終了する。 The first-stage and second-stage coefficient decoding processes are performed, so that the entire coefficient matrix is reproduced, and the process ends.
  (シンタックス)
 図30および図31に、本変形例に係るTU情報符号化部31における係数符号化処理のシンタックスの例について示す。なお、係数符号化処理を一括で行うか、2段階で行うかの切り替えは、上位のシンタックスにて行われているものとする。すなわち、最後の係数LTの位置の判定は、上位のシンタックスにて行われる。
(Syntax)
30 and 31 show an example of the syntax of the coefficient encoding process in the TU information encoding unit 31 according to this modification. It should be noted that switching between performing the coefficient encoding process all at once or in two stages is performed in the upper syntax. In other words, the determination of the position of the last coefficient LT is performed using the upper syntax.
 図30に示すシンタックスについて説明すると次のとおりである。1行目の「residual_block_vlc_1a」が、呼び出され2段階の係数符号化処理が開始される。 The syntax shown in FIG. 30 will be described as follows. "Residual_block_vlc_1a" on the first line is called to start a two-stage coefficient encoding process.
 まず、SYN51において、最後の係数が符号化される。SYN51は、図13に示したSYN21と同様である。 First, in the SYN 51, the last coefficient is encoded. SYN51 is the same as SYN21 shown in FIG.
 続いて、SYN52およびSYN53の「residual_block_vlc_3a」では、それぞれ、第1段階の係数符号化処理および第2段階の係数符号化処理を呼び出している。 Subsequently, in “residual_block_vlc_3a” of SYN 52 and SYN 53, the first-stage coefficient encoding process and the second-stage coefficient encoding process are called, respectively.
 図31に示すシンタックスは、「residual_block_vlc_3a」における係数符号化処理について示している。図31に示すように、SYN61では、ランモードおよび非ランモードが順に呼ばれる。SYN61は、図13に示したSYN22と同様である。 The syntax shown in FIG. 31 indicates the coefficient encoding process in “residual_block_vlc_3a”. As shown in FIG. 31, in SYN 61, the run mode and the non-run mode are called in order. SYN61 is the same as SYN22 shown in FIG.
 以上のように、第1段階および第2段階の係数符号化処理のシンタックスは、上記の水準の詳細度であれば共通化することができる。 As described above, the syntax of the coefficient encoding process in the first stage and the second stage can be made common if the level of detail is the above level.
 〔3-2〕第1段階の符号化対象領域の拡張
 以下、図32を用いて、第1段階の符号化対象領域の拡張する変形例について説明する。すなわち、TU情報復号部12の位置判定部122、およびTU情報符号化部31の位置判定部320は、最後の係数の位置が、第2行目まで、または、第2列目までであるか否かを判定してもよい。以下、位置判定部320について説明すると次のとおりである。
[3-2] Expansion of First Stage Encoding Target Area Hereinafter, a modified example of extending the first stage encoding target area will be described with reference to FIG. That is, the position determination unit 122 of the TU information decoding unit 12 and the position determination unit 320 of the TU information encoding unit 31 determine whether the position of the last coefficient is up to the second row or the second column. It may be determined whether or not. Hereinafter, the position determination unit 320 will be described as follows.
 具体的には、位置判定部320は、次の判定式(3)の真偽を計算する。 Specifically, the position determination unit 320 calculates true / false of the following determination formula (3).
 (LastX≦1   && LastY≧ThY)||
 (LastX≧ThX && LastY≦1) … (3)
 判定式(1)の結果が「真」である場合、位置判定部320は、2段階の係数復号処理を行うことを決定する。この場合、位置判定部320は、決定結果を、2段階符号化部330に通知する。
(LastX 1 ≦ 1 && LastY 1 ≧ ThY 1 ) ||
(LastX 1 ≧ ThX 1 && LastY 1 ≦ 1) (3)
When the result of the determination formula (1) is “true”, the position determination unit 320 determines to perform a two-stage coefficient decoding process. In this case, the position determination unit 320 notifies the determination result to the two-stage encoding unit 330.
 一方、判定式(1)の結果が「偽」である場合、位置判定部320は、一括で係数復号処理を行うことを決定する。この場合、位置判定部320は、決定結果を、一括符号化部340に通知する。 On the other hand, when the result of the determination formula (1) is “false”, the position determination unit 320 determines to perform the coefficient decoding process collectively. In this case, the position determination unit 320 notifies the determination result to the batch encoding unit 340.
 
 図32を用いて、より詳細に説明すると次のとおりである、図32に示す例では、最後の係数LTは、第2行目の第6列目にある。よって、図32に示す例では、判定式(3)は「真」となる。

32 will be described in more detail with reference to FIG. 32. In the example shown in FIG. 32, the last coefficient LT is in the sixth column of the second row. Therefore, in the example shown in FIG. 32, the determination formula (3) is “true”.
 このとき、第1段階の係数復号処理の対象となる第1の対象範囲R70は、2行8列の領域であり、以上で説明してきたような直線的な領域ではなくなる。よって、第1段階の係数復号処理におけるスキャン順序は、図32の実線矢印に示すように、平面的なものに変更してもよい。 At this time, the first target range R70 to be subjected to the first-stage coefficient decoding process is an area of 2 rows and 8 columns, and is not a linear area as described above. Therefore, the scan order in the first-stage coefficient decoding process may be changed to a flat one as shown by the solid line arrow in FIG.
 また、第2段階の係数復号処理の対象となる第2の対象範囲R80におけるスキャン順序は、一括で係数復号処理を行う場合と変わらない。つまり、図5で示した係数行列MX12から係数行列MX13へのコピー処理においては、第1行目および第2行目を空けて係数行列MX12を係数行列MX13にコピーすればよい。 Also, the scan order in the second target range R80, which is the target of the second stage coefficient decoding process, is the same as when performing the coefficient decoding process in a lump. That is, in the copy process from the coefficient matrix MX12 to the coefficient matrix MX13 shown in FIG. 5, the coefficient matrix MX12 may be copied to the coefficient matrix MX13 with the first row and the second row open.
 なお、位置判定部122についても同様である。また、TU情報復号部12Aの位置判定部122A、およびTU情報符号化部31Aの位置判定部320Aについても同様のことがいえる。すなわち、最後から2つ目の係数の位置が第2行目まで、または、第2列目までにあるか否かを判定してもよい。 The same applies to the position determination unit 122. The same applies to the position determination unit 122A of the TU information decoding unit 12A and the position determination unit 320A of the TU information encoding unit 31A. That is, it may be determined whether or not the position of the second coefficient from the end is up to the second row or the second column.
 本変形例の構成によれば、第1段階の符号化対象領域を拡張するので、係数が水平方向または垂直方向に偏っているか否かの判定を緩やかにすることができる。これにより、係数行列の第2行目または第2列目に偏っている非ゼロ係数を効率的に符号化し、符号化効率向上の機会を増やすことができる。 According to the configuration of the present modification, since the first stage encoding target area is expanded, it is possible to moderately determine whether or not the coefficient is biased in the horizontal direction or the vertical direction. As a result, it is possible to efficiently encode the non-zero coefficient biased to the second row or the second column of the coefficient matrix, and to increase opportunities for improving the coding efficiency.
 また、判定に用いることができる行または列は、第2行目または第2列目に限られず、さらに行数または列数を増加させることもできる。あるいは、行や列の一部分だけと組み合わせてもよく、例えば、第1列の全体と第2列の左半分のみ、としてもよい。 Further, the rows or columns that can be used for the determination are not limited to the second row or the second column, and the number of rows or columns can be further increased. Alternatively, it may be combined with only a part of a row or column, for example, only the entire first column and the left half of the second column.
 さらに、判定の条件として、最後の係数が第1行目もしくは第1列目にあり、かつ最後の係数の次の係数が第2行目もしくは第2列目にある場合、または最後の係数が第2行目もしくは第2列目にあり、かつ最後の係数の次の係数が第1行目もしくは第1列目にある場合など、上記実施例に記載の判定の条件を適宜組み合わせて第1段階の符号化対象領域を拡張しても構わない。適宜組み合わせることにより、符号化効率向上の機会を増やすことができる。 Further, as a determination condition, when the last coefficient is in the first row or the first column and the next coefficient after the last coefficient is in the second row or the second column, or the last coefficient is When the second row or the second column is present and the coefficient next to the last coefficient is the first row or the first column, the first condition is appropriately combined with the determination conditions described in the above embodiments. The encoding target region at the stage may be expanded. Opportunities for improving the coding efficiency can be increased by appropriately combining them.
 なお、判定の条件として、位置以外の基準を用いてもよい。例えば、最後の係数のレベルが1よりも大きい場合には、最後の係数が第1行目または第1列目に位置していても、2段階の符号化を行わないようにするとよい。 Note that a criterion other than the position may be used as the determination condition. For example, when the level of the last coefficient is larger than 1, even if the last coefficient is located in the first row or the first column, the two-stage encoding may not be performed.
 〔3-3〕符号化する係数の数の制限
 以下、図33および図34を用いて、符号化する係数の数を制限する変形例について説明する。TU情報符号化部31またはTU情報復号部12は、変換サイズが大きい場合、すなわち、係数行列のサイズが大きい場合は、係数符号化処理または係数復号処理を行う係数を制限してもよい。以下、TU情報符号化部31について説明すると次のとおりである。
[3-3] Restriction on Number of Coding Coefficients A modification example for restricting the number of coefficients to be coded will be described below with reference to FIGS. 33 and 34. FIG. The TU information encoding unit 31 or the TU information decoding unit 12 may limit the coefficient for performing the coefficient encoding process or the coefficient decoding process when the transform size is large, that is, when the size of the coefficient matrix is large. Hereinafter, the TU information encoding unit 31 will be described as follows.
 まず、図33を用いて、TU情報符号化部31が、スキャン順上、イントラ16×16の係数行列について、64個に限定して係数を符号化する変形例について説明する。 First, a modified example in which the TU information encoding unit 31 encodes coefficients by limiting the number of intra 16 × 16 coefficient matrices to 64 in the scan order will be described with reference to FIG.
 図33に例示すように、TU情報符号化部31は、まず、スキャン順上、1番目から64番目までの64個の係数を検出する。そして、TU情報符号化部31は、検出した64個の係数を対象に2段階の係数符号化処理を行う。 33, the TU information encoding unit 31 first detects 64 coefficients from the first to the 64th in the scan order. Then, the TU information encoding unit 31 performs a two-stage coefficient encoding process on the detected 64 coefficients.
 すなわち、図33に例示するように、TU情報符号化部31は、第1段階の係数符号化処理では、第1の対象範囲R30のうち、検出された係数がある領域R31を対象とする。また、TU情報符号化部31は、第2段階の係数符号化処理では、第2の対象範囲R40のうち、検出された係数がある領域R41を対象とする。 That is, as illustrated in FIG. 33, in the first stage coefficient encoding process, the TU information encoding unit 31 targets the region R31 in which the detected coefficient is present in the first target range R30. In the second stage coefficient encoding process, the TU information encoding unit 31 targets the region R41 in which the detected coefficient exists in the second target range R40.
 次に、図34を用いて、TU情報符号化部31が、スキャン順上、インター16×16の係数行列について、64個に限定して係数を符号化する変形例について説明する。 Next, a modification example in which the TU information encoding unit 31 encodes coefficients by limiting the number of inter 16 × 16 coefficient matrices to 64 in the scan order will be described with reference to FIG.
 図34に例示すように、TU情報符号化部31は、まず、DC係数を基点とする8×8のサイズに含まれる64個の係数を検出する。そして、TU情報符号化部31は、検出した64個の係数を対象に2段階の係数符号化処理を行う。 As illustrated in FIG. 34, the TU information encoding unit 31 first detects 64 coefficients included in an 8 × 8 size with a DC coefficient as a base point. Then, the TU information encoding unit 31 performs a two-stage coefficient encoding process on the detected 64 coefficients.
 すなわち、図34に例示するように、TU情報符号化部31は、第1段階の係数符号化処理では、第1の対象範囲R50のうち、検出された係数がある領域R51を対象とする。また、TU情報符号化部31は、第2段階の係数符号化処理では、第1行目以外の行である第2の対象範囲R60のうち、検出された係数がある領域R61を対象とする。 That is, as illustrated in FIG. 34, in the first stage coefficient encoding process, the TU information encoding unit 31 targets the region R51 in which the detected coefficient is present in the first target range R50. In the second-stage coefficient encoding process, the TU information encoding unit 31 targets the region R61 in which the detected coefficient exists in the second target range R60 that is a row other than the first row. .
 なお、位置判定部122についても同様である。また、TU情報復号部12Aの位置判定部122A、およびTU情報符号化部31Aの位置判定部320Aについても同様のことがいえる。 The same applies to the position determination unit 122. The same applies to the position determination unit 122A of the TU information decoding unit 12A and the position determination unit 320A of the TU information encoding unit 31A.
 本変形例によれば、係数行列のサイズが大きいときに、処理する必要のない係数まで係数符号化処理または係数復号処理の対象としてしまうことを防ぐことができる。 According to this modification, when the coefficient matrix size is large, it is possible to prevent a coefficient that does not need to be processed from being subjected to coefficient encoding processing or coefficient decoding processing.
 また、本変形例は、単なる一例であり、係数の数は、64個に限られず、任意に設定可能である。さらに、適用する係数行列の予測モードについても、上記には限られず、例えば、イントラ16×16の係数行列に対して左上の8×8のサイズを検出するようにしても構わない。 Further, this modification is merely an example, and the number of coefficients is not limited to 64, and can be arbitrarily set. Furthermore, the prediction mode of the coefficient matrix to be applied is not limited to the above. For example, the size of the upper left 8 × 8 may be detected for the intra 16 × 16 coefficient matrix.
  (結び)
 最後に、上述した動画像復号装置1および動画像符号化装置2の各ブロックは、集積回路(ICチップ)上に形成された論理回路によってハードウェア的に実現してもよいし、CPU(Central Processing Unit)を用いてソフトウェア的に実現してもよい。
(Conclusion)
Finally, each block of the moving picture decoding apparatus 1 and the moving picture encoding apparatus 2 described above may be realized in hardware by a logic circuit formed on an integrated circuit (IC chip), or may be a CPU (Central It may be realized by software using a Processing Unit).
 後者の場合、上記各装置は、各機能を実現するプログラムの命令を実行するCPU、上記プログラムを格納したROM(Read Only Memory)、上記プログラムを展開するRAM(Random Access Memory)、上記プログラムおよび各種データを格納するメモリ等の記憶装置(記録媒体)などを備えている。そして、本発明の目的は、上述した機能を実現するソフトウェアである上記各装置の制御プログラムのプログラムコード(実行形式プログラム、中間コードプログラム、ソースプログラム)をコンピュータで読み取り可能に記録した記録媒体を、上記各装置に供給し、そのコンピュータ(またはCPUやMPU)が記録媒体に記録されているプログラムコードを読み出し実行することによっても、達成可能である。 In the latter case, each device includes a CPU that executes instructions of a program that realizes each function, a ROM (Read (Memory) that stores the program, a RAM (Random Memory) that expands the program, the program, and various types A storage device (recording medium) such as a memory for storing data is provided. An object of the present invention is to provide a recording medium in which a program code (execution format program, intermediate code program, source program) of a control program of each of the above devices, which is software that realizes the above-described functions, is recorded so as to be readable by a computer. This can also be achieved by supplying to each of the above devices and reading and executing the program code recorded on the recording medium by the computer (or CPU or MPU).
 上記記録媒体としては、例えば、磁気テープやカセットテープ等のテープ類、フロッピー(登録商標)ディスク/ハードディスク等の磁気ディスクやCD-ROM/MO/MD/DVD/CD-R/ブルーレイディスク(登録商標)等の光ディスクを含むディスク類、ICカード(メモリカードを含む)/光カード等のカード類、マスクROM/EPROM/EEPROM/フラッシュROM等の半導体メモリ類、あるいはPLD(Programmable logic device)やFPGA(Field Programmable Gate Array)等の論理回路類などを用いることができる。 Examples of the recording medium include tapes such as magnetic tape and cassette tape, magnetic disks such as floppy (registered trademark) disks / hard disks, and CD-ROM / MO / MD / DVD / CD-R / Blu-ray disks (registered trademarks). ) And other optical disks, IC cards (including memory cards) / optical cards, semiconductor memories such as mask ROM / EPROM / EEPROM / flash ROM, PLD (Programmable logic device) and FPGA ( Logic circuits such as Field Programmable Gate Array can be used.
 また、上記各装置を通信ネットワークと接続可能に構成し、上記プログラムコードを通信ネットワークを介して供給してもよい。この通信ネットワークは、プログラムコードを伝送可能であればよく、特に限定されない。例えば、インターネット、イントラネット、エキストラネット、LAN、ISDN、VAN、CATV通信網、仮想専用網(Virtual Private Network)、電話回線網、移動体通信網、衛星通信網等が利用可能である。また、この通信ネットワークを構成する伝送媒体も、プログラムコードを伝送可能な媒体であればよく、特定の構成または種類のものに限定されない。例えば、IEEE1394、USB、電力線搬送、ケーブルTV回線、電話線、ADSL(Asymmetric Digital Subscriber Line)回線等の有線でも、IrDAやリモコンのような赤外線、Bluetooth(登録商標)、IEEE802.11無線、HDR(High Data Rate)、NFC(Near Field Communication)、DLNA(Digital Living Network Alliance)、携帯電話網、衛星回線、地上波デジタル網等の無線でも利用可能である。なお、本発明は、上記プログラムコードが電子的な伝送で具現化された、搬送波に埋め込まれたコンピュータデータ信号の形態でも実現され得る。 Also, each of the above devices may be configured to be connectable to a communication network, and the program code may be supplied via the communication network. The communication network is not particularly limited as long as it can transmit the program code. For example, the Internet, intranet, extranet, LAN, ISDN, VAN, CATV communication network, virtual private network (Virtual Private Network), telephone line network, mobile communication network, satellite communication network, etc. can be used. The transmission medium constituting the communication network may be any medium that can transmit the program code, and is not limited to a specific configuration or type. For example, even in the case of wired lines such as IEEE 1394, USB, power line carrier, cable TV line, telephone line, ADSL (Asymmetric Digital Subscriber Line) line, infrared rays such as IrDA and remote control, Bluetooth (registered trademark), IEEE 802.11 wireless, HDR ( It can also be used by wireless such as High Data Rate, NFC (Near Field Communication), DLNA (Digital Living Network Alliance), mobile phone network, satellite line, and terrestrial digital network. The present invention can also be realized in the form of a computer data signal embedded in a carrier wave in which the program code is embodied by electronic transmission.
 本発明は上述した実施形態に限定されるものではなく、請求項に示した範囲で種々の変更が可能である。すなわち、請求項に示した範囲で適宜変更した技術的手段を組み合わせて得られる実施形態についても本発明の技術的範囲に含まれる。 The present invention is not limited to the above-described embodiment, and various modifications can be made within the scope indicated in the claims. That is, embodiments obtained by combining technical means appropriately modified within the scope of the claims are also included in the technical scope of the present invention.
 例えば、上述の本実施形態に係る画像復号装置は、符号化データから動画像を復号するものとしたが、動画像を対象とするか静止画像を対象とするかを問わず、画像復号装置一般に適用できるものである。画像符号化装置についても同様である。 For example, the image decoding device according to the present embodiment described above decodes a moving image from encoded data. However, regardless of whether the image is a moving image or a still image, the image decoding device generally Applicable. The same applies to the image encoding device.
 以上に示したように、本発明に係る動画像復号装置1は、係数符号化データC10を復号および逆スキャンすることにより係数行列MX10を再現する動画像復号装置1において、係数行列MX10における、上記逆スキャン順上、最後の係数の位置を検出する最後の係数復号部121と、最後の係数の位置が、係数行列MX10において、DC係数DCを含む第1行目または第1列目にあるか否かを判定する位置判定部122と、最後の係数の位置が、第1行目または第1列目にある場合、係数行列MX10を、第1行目または第1列目と、第1行目または第1列目以外の行または列とでそれぞれ復号処理する2段階復号部123と、を備える構成である。このため、変換係数の分布に偏りがある場合に符号化効率の向上を図ることができる。 As described above, the moving image decoding apparatus 1 according to the present invention reproduces the coefficient matrix MX10 by decoding and inverse scanning the coefficient encoded data C10. In the reverse scan order, the last coefficient decoding unit 121 that detects the position of the last coefficient and the position of the last coefficient are in the first row or the first column including the DC coefficient DC in the coefficient matrix MX10. If the position determination unit 122 for determining whether or not the position of the last coefficient is in the first row or the first column, the coefficient matrix MX10 is changed to the first row or the first column and the first row. And a two-stage decoding unit 123 that performs decoding processing on each row or column other than the first or first column. Therefore, it is possible to improve the encoding efficiency when the distribution of transform coefficients is biased.
 また、本発明は、次のように表現することもできる。すなわち、本発明に係る画像復号装置は、画像データが符号化された符号化データに含まれる、符号化された量子化変換係数を復号および逆スキャンすることにより係数行列を再現する画像復号装置において、上記係数行列における、上記逆スキャン順上最後の非ゼロ係数の位置を検出する最後の係数位置検出手段と、上記最後の非ゼロ係数の位置が、上記係数行列において、直流成分の係数を含む行または列から所定の行または列までの位置判定範囲にあるか否かを判定する位置判定手段と、上記最後の非ゼロ係数の位置が、上記位置判定範囲にある場合、上記係数行列を、上記最後の非ゼロ係数の位置を含む第1の復号対象範囲と、上記第1の復号対象範囲以外の第2の復号対象範囲とでそれぞれ復号処理する2段階復号手段と、を備える構成である。 Further, the present invention can also be expressed as follows. That is, an image decoding apparatus according to the present invention is an image decoding apparatus that reproduces a coefficient matrix by decoding and inverse scanning an encoded quantized transform coefficient included in encoded data obtained by encoding image data. The last coefficient position detecting means for detecting the position of the last non-zero coefficient in the reverse scan order in the coefficient matrix, and the position of the last non-zero coefficient includes the coefficient of the DC component in the coefficient matrix. When the position determination means for determining whether or not the position determination range is from a row or column to a predetermined row or column, and the position of the last non-zero coefficient is within the position determination range, the coefficient matrix is Two-stage decoding means for decoding each of a first decoding target range including the position of the last non-zero coefficient and a second decoding target range other than the first decoding target range. It is a configuration.
 上記構成において、量子化変換係数とは、画像データの符号化処理において、画像データから予測画像を減じた予測残差を、直交変換し、量子化したものである。また、符号化の対象となるブロックにおける量子化変換係数は、係数行列の形式で表現することができる。 In the above configuration, the quantized transform coefficient is obtained by orthogonally transforming and quantizing the prediction residual obtained by subtracting the predicted image from the image data in the image data encoding process. Also, the quantized transform coefficient in the block to be encoded can be expressed in the form of a coefficient matrix.
 また、符号化された量子化変換係数とは、量子化変換係数により構成される係数行列をスキャンし符号化したものである。係数行列をスキャンするとは、係数行列に含まれる係数を1次元配列に格納することである。 Also, the encoded quantized transform coefficient is obtained by scanning and encoding a coefficient matrix composed of quantized transform coefficients. Scanning the coefficient matrix means storing the coefficients included in the coefficient matrix in a one-dimensional array.
 ここで、逆スキャンとは、復号された係数を係数行列上の対応する位置に配置し直すことである。 Here, reverse scanning is to rearrange the decoded coefficients at corresponding positions on the coefficient matrix.
 また、逆スキャン順とは、逆スキャンが行われる所定の順序のことである。例えば、逆スキャン順には、ジグザグスキャンが採用できる。 The reverse scan order is a predetermined order in which reverse scan is performed. For example, a zigzag scan can be employed in the reverse scan order.
 係数行列における直流成分の係数とは、具体的には、第1行目、第1列目にある係数のことである。さらにいえば、ジグザグスキャンにおいて逆スキャン順が1番目となる係数である。 The DC component coefficient in the coefficient matrix is specifically the coefficient in the first row and the first column. Furthermore, it is a coefficient that makes the reverse scan order first in the zigzag scan.
 また、係数は、直流成分付近の低周波成分においては、値がゼロでない非ゼロ係数である傾向がある。一方、係数は、高周波成分になるにつれて、値がゼロとなるゼロ係数である傾向がある。ジグザグスキャンでは、低周波成分の係数が、高周波成分の係数よりも先に処理されるような順になっている。 Also, the coefficient tends to be a non-zero coefficient whose value is not zero in the low frequency component near the DC component. On the other hand, the coefficient tends to be a zero coefficient whose value becomes zero as it becomes a high frequency component. In the zigzag scan, the low frequency component coefficients are processed in the order in which they are processed before the high frequency component coefficients.
 最後の非ゼロ係数とは、直流成分の係数からみて、逆スキャン順上、最後にくる非ゼロ係数のことである。さらにいえば、最後の非ゼロ係数より後の順にある係数は、すべてゼロ係数である。 The last non-zero coefficient is the last non-zero coefficient in reverse scan order when viewed from the DC component coefficient. Furthermore, all coefficients in order after the last non-zero coefficient are all zero coefficients.
 上記構成によれば、最後の非ゼロ係数の位置が、係数行列の(1)第1行目から所定の行までの位置、または、(2)第1列目から所定の列までの位置にあるかどうかを判定する。 According to the above configuration, the position of the last non-zero coefficient is (1) the position from the first row to the predetermined row or (2) the position from the first column to the predetermined column of the coefficient matrix. Determine if it exists.
 なお、上記(1)および(2)をあわせて位置判定範囲と称している。また、位置判定範囲は、係数行列において、直流成分の係数を含む端部ともいえる。 The above (1) and (2) are collectively referred to as a position determination range. The position determination range can also be said to be an end portion including a coefficient of a direct current component in the coefficient matrix.
 また、上記構成によれば、上記位置判定範囲に、最後の非ゼロ係数の位置がある場合、上記係数行列を、上記最後の非ゼロ係数の位置を含む第1の復号対象範囲と、上記第1の復号対象範囲以外の第2の復号対象範囲とで、2段階で復号処理する。 Further, according to the above configuration, when the position determination range includes the position of the last non-zero coefficient, the coefficient matrix includes the first decoding target range including the position of the last non-zero coefficient, and the first Decoding processing is performed in two stages with a second decoding target range other than the one decoding target range.
 第1の復号対象範囲には、直流成分の係数の位置が含まれていてもよい。よって、復号処理は、例えば、最後の非ゼロ係数の位置を基点に次のとおり行うことができる。まず、第1の復号対象範囲において最後の非ゼロ係数から直流成分の係数までを復号する。その後、第2の復号対象範囲において、第2の復号対象範囲におけるスキャン順上最後の非ゼロ係数から、スキャン順上最初の係数までを復号する。第2の復号対象範囲におけるスキャン順には、上述のジグザグスキャンが適用できる。 The first decoding target range may include the position of the DC component coefficient. Therefore, the decoding process can be performed as follows based on the position of the last non-zero coefficient, for example. First, the first non-zero coefficient to the DC component coefficient are decoded in the first decoding target range. Thereafter, in the second decoding target range, decoding is performed from the last non-zero coefficient in the scanning order in the second decoding target range to the first coefficient in the scanning order. The zigzag scan described above can be applied to the scan order in the second decoding target range.
 ところで、非ゼロ係数は、残差が比較的小さく係数の総数が少ない場合、水平成分または垂直成分に偏ることが多い。例えば、インター予測のブロックの符号化の場合、このような傾向が見られる。 By the way, non-zero coefficients tend to be biased to horizontal or vertical components when the residual is relatively small and the total number of coefficients is small. For example, in the case of coding of an inter prediction block, such a tendency is seen.
 また、連続する非ゼロ係数の長さ(以下、ランと称する)をできるだけまとめたほうが、つまり分断しないで符号化したほうが、符号化効率がよくなる。 Also, the coding efficiency is better when the lengths of continuous non-zero coefficients (hereinafter referred to as “runs”) are collected as much as possible, that is, when coding is performed without dividing.
 上記構成では、第1の復号対象範囲が第2の復号対象範囲とは別に復号される。このため第1の復号対象範囲に、非ゼロ係数が集中している場合、復号すべき符号データの符号量を抑制することができる。 In the above configuration, the first decoding target range is decoded separately from the second decoding target range. For this reason, when non-zero coefficients are concentrated in the first decoding target range, the code amount of the code data to be decoded can be suppressed.
 また、第2の復号対象範囲では、第1の復号対象範囲にある係数によりランが分断されず符号化されていることになり、効率よく符号化されていることになる。よって、復号すべき符号量を抑制することができる。 Also, in the second decoding target range, the run is encoded without being divided by the coefficients in the first decoding target range, and the encoding is efficiently performed. Therefore, the code amount to be decoded can be suppressed.
 このように、係数の分布に偏りがある場合、復号すべき符号データの符号量の削減を図ることができる。 Thus, when there is a bias in the distribution of coefficients, it is possible to reduce the code amount of code data to be decoded.
 本発明に係る画像復号装置では、上記位置判定手段は、上記最後の非ゼロ係数の位置が、上記係数行列における第1行目または第1列目にあるか否かを判定し、上記2段階復号手段の復号処理における第1の復号対象範囲は、位置判定範囲と一致することが好ましい。 In the image decoding device according to the present invention, the position determination means determines whether the position of the last non-zero coefficient is in the first row or the first column in the coefficient matrix, and the two steps It is preferable that the first decoding target range in the decoding process of the decoding unit coincides with the position determination range.
 非ゼロ係数が、水平方向または垂直方向に偏る場合、最後の非ゼロ係数は、上記係数行列における第1行目または第1列目にある可能性が高い。また、上記構成では、位置判定範囲は、直線的となる。 If the non-zero coefficient is biased horizontally or vertically, the last non-zero coefficient is likely to be in the first row or the first column in the coefficient matrix. In the above configuration, the position determination range is linear.
 また、位置判定範囲が、第1の復号対象範囲に一致していれば、非ゼロ係数が、水平方向または垂直方向に偏る場合において、第1の復号対象範囲を、比較的簡単なスキャン順で、復号処理ができる。 In addition, if the position determination range matches the first decoding target range, the first decoding target range is set in a relatively simple scan order when the non-zero coefficient is biased in the horizontal direction or the vertical direction. Decoding processing can be performed.
 本発明に係る画像復号装置では、上記最後の非ゼロ係数の位置が、上記直流成分の係数の位置から所定距離以上離れているか否かを判定する距離判定手段を備え、上記2段階復号手段は、上記最後の非ゼロ係数の位置が、上記直流成分の係数の位置から所定距離以上離れている場合、上記復号処理を行うことが好ましい。 The image decoding apparatus according to the present invention further comprises distance determining means for determining whether or not the position of the last non-zero coefficient is a predetermined distance or more away from the position of the coefficient of the DC component. When the position of the last non-zero coefficient is a predetermined distance or more away from the position of the DC component coefficient, the decoding process is preferably performed.
 最後の非ゼロ係数の位置が、直流成分の係数の位置から離れているほうが、ランが分断される可能性が高くなる。 ¡The more likely the run is divided, the more the position of the last non-zero coefficient is far from the position of the DC component coefficient.
 上記構成によれば、最後の非ゼロ係数の位置が直流成分の係数の位置から離れているときに2段階で復号処理するので、ランの分断を防ぐことができる。 According to the above configuration, since the decoding process is performed in two stages when the position of the last non-zero coefficient is away from the position of the DC component coefficient, it is possible to prevent the run from being divided.
 本発明に係る画像復号装置では、上記2段階復号手段は、上記第2の復号対象範囲の復号における逆スキャンにおいて、ジグザグスキャンを行うことが好ましい。 In the image decoding apparatus according to the present invention, it is preferable that the two-stage decoding unit performs a zigzag scan in the reverse scan in the decoding of the second decoding target range.
 ジグザグスキャンは、非特許文献3などで、採用されているスキャン方式である。また、例えば、第1の復号対象範囲および第2の復号対象範囲を一括で復号処理する場合、非特許文献3の技術を採用することができる。 Zigzag scanning is a scanning method adopted in Non-Patent Document 3 and the like. In addition, for example, when the first decoding target range and the second decoding target range are collectively decoded, the technique of Non-Patent Document 3 can be employed.
 上記構成によれば、一括で復号処理する場合の制御を、第2の復号対象範囲について適用することができる。このため、第2の復号対象範囲における復号処理に、一括で復号処理する場合の制御を流用することができる。 According to the above configuration, it is possible to apply the control in the case of performing batch decoding processing to the second decoding target range. For this reason, it is possible to divert the control in the case of performing batch decoding processing to the decoding processing in the second decoding target range.
 本発明に係る画像復号装置では、上記2段階復号手段による上記第2の復号対象範囲の復号処理について、上記最後の係数位置検出手段による位置検出、上記位置判定手段による位置判定、および上記2段階復号手段による復号を再帰的に行うよう制御する再帰制御手段を備えることが好ましい。 In the image decoding apparatus according to the present invention, for the decoding process of the second decoding target range by the two-stage decoding unit, the position detection by the last coefficient position detection unit, the position determination by the position determination unit, and the two steps It is preferable to provide recursive control means for controlling recursively decoding by the decoding means.
 上記構成によれば、第2の復号対象範囲の復号処理では、さらに、第2の復号対象範囲を、新たな第1の復号対象範囲、および、新たな第2の復号対象範囲に分割して、再帰的に2段階の復号処理を行う。なお、新たな第2の復号対象範囲をさらに再帰的に処理してもかまわない。また、当該再帰処理は、「新たな第2の復号対象範囲が所定のサイズになるまで行う」といった条件下で繰り返し実行することができる。 According to the above configuration, in the decoding process of the second decoding target range, the second decoding target range is further divided into a new first decoding target range and a new second decoding target range. Then, a two-stage decoding process is performed recursively. Note that the new second decoding target range may be further recursively processed. In addition, the recursive process can be repeatedly executed under conditions such as “perform until the new second decoding target range reaches a predetermined size”.
 これにより、水平方向または垂直方向に係数が偏って分布している場合に、符号化効率を向上させることができる。 This makes it possible to improve the coding efficiency when the coefficients are distributed unevenly in the horizontal direction or the vertical direction.
 本発明に係る画像復号装置では、上記2段階復号手段は、上記第1の復号対象範囲の復号において、可変長符号と、連続する非ゼロ係数の長さとの組み合わせを定義した可変長符号テーブルであって、最短の可変長符号を除き、上記可変長符号の長さが長いほど、上記連続する非ゼロ係数の長さが長い可変長符号テーブルを参照することが好ましい。 In the image decoding apparatus according to the present invention, the two-stage decoding means is a variable length code table that defines a combination of a variable length code and a length of continuous non-zero coefficients in the decoding of the first decoding target range. Therefore, it is preferable to refer to the variable length code table in which the length of the continuous non-zero coefficient is longer as the length of the variable length code is longer than the shortest variable length code.
 可変長符号テーブルは、例えば、VLCテーブルのことである。非特許文献3に開示されているVLCテーブル等においては、係数行列が有する空間的特性に併せて、VLCテーブルが定義されている。つまり、これらのVLCテーブルでは、上記可変長符号の長さが長いほど、上記連続する非ゼロ係数の長さが長いわけではない。 The variable length code table is, for example, a VLC table. In the VLC table disclosed in Non-Patent Document 3, the VLC table is defined in accordance with the spatial characteristics of the coefficient matrix. That is, in these VLC tables, the longer the variable length code is, the longer the continuous non-zero coefficient is not.
 これに対して、上記構成では、第1の復号対象範囲の復号処理は、直線的な範囲となるので、上記のような空間的特性を考慮しなくてもかまわない。 On the other hand, in the above configuration, since the decoding process of the first decoding target range is a linear range, the spatial characteristics as described above may not be taken into consideration.
 むしろ、上記構成のように、上記可変長符号の長さが長いほど、上記連続する非ゼロ係数の長さが長い可変長符号テーブルにより復号処理を行うことが好ましい。 Rather, it is preferable to perform the decoding process using the variable length code table in which the length of the continuous non-zero coefficient is longer as the length of the variable length code is longer as in the above configuration.
 なお、連続する非ゼロ係数の長さが最長となる場合、すなわち、範囲内の残りの係数が全て非ゼロ係数である場合は、発生の頻度が高いため、とりうる最短の可変長符号を割り当てることで符号化効率が向上できる。また、連続する非ゼロ係数の長さが最長となる場合を除いて、上記可変長符号の長さが長いほど、上記連続する非ゼロ係数の長さが長い可変長符号が対応しているようにテーブルを可変長符号構成してもかまわない。 When the length of consecutive non-zero coefficients is the longest, that is, when all remaining coefficients in the range are non-zero coefficients, the shortest possible variable-length code is assigned because the frequency of occurrence is high. Thus, the encoding efficiency can be improved. In addition, unless the length of the continuous non-zero coefficient is the longest, the longer the variable length code, the longer the variable length code corresponding to the longer non-zero coefficient. Alternatively, the table may be configured with a variable length code.
 本発明に係る画像復号装置では、上記係数行列における、上記逆スキャン順上、最後の非ゼロ係数から所定番目の非ゼロ係数の位置を検出する非ゼロ係数位置検出手段を備え、
 上記位置判定手段は、上記最後の非ゼロ係数から上記所定番目の非ゼロ係数までの位置が、上記位置判定範囲にあるか否かを判定することが好ましい。
The image decoding apparatus according to the present invention comprises non-zero coefficient position detection means for detecting a position of a predetermined non-zero coefficient from the last non-zero coefficient in the reverse scan order in the coefficient matrix,
The position determination means preferably determines whether or not the position from the last non-zero coefficient to the predetermined non-zero coefficient is in the position determination range.
 上記構成によれば、たまたま最後の非ゼロ係数のみが第1の範囲にあった場合であるにもかかわらず、2段階で復号処理を行ってしまうことを防ぐことができる。 According to the above configuration, it is possible to prevent the decoding process from being performed in two stages even though only the last non-zero coefficient happens to be in the first range.
 本発明に係る画像復号装置では、上記2段階復号手段は、連続する非ゼロ係数の長さを復号する非ゼロ係数長復号モードから、逐次係数を復号する逐次復号モードに、所定のモード切替条件が満たされた場合、モード切り替えながら復号するものであり、上記第1の復号対象範囲の復号の上記モード切替条件が、上記第2の復号対象範囲の復号の上記モード切替条件と異なる条件であることが好ましい。 In the image decoding device according to the present invention, the two-stage decoding means switches from a non-zero coefficient length decoding mode that decodes the length of consecutive non-zero coefficients to a sequential decoding mode that decodes successive coefficients, with a predetermined mode switching condition. When the condition is satisfied, decoding is performed while switching the mode, and the mode switching condition for decoding the first decoding target range is different from the mode switching condition for decoding the second decoding target range. It is preferable.
 第1の範囲は、第2の範囲よりも小さくなることが考えられる。このような場合、第1の範囲と第2の範囲とで、非ゼロ係数の出現の傾向が全く異なることがある。よって、非ゼロ係数復号モードのモード切替条件を同じにしてしまうと、第1の範囲の出現傾向に対して切替条件が不適切になる、あるいは第2の範囲に対して不適切になる場合がある。このような場合、符号化効率が低下するおそれがある。 It is conceivable that the first range is smaller than the second range. In such a case, the appearance tendency of the non-zero coefficient may be completely different between the first range and the second range. Therefore, if the mode switching condition in the non-zero coefficient decoding mode is the same, the switching condition may be inappropriate for the appearance tendency of the first range, or may be inappropriate for the second range. is there. In such a case, the encoding efficiency may be reduced.
 なお、モード切替条件としては、復号された係数の個数や、係数の絶対値が閾値を超えた数などが挙げられる。 The mode switching condition includes the number of decoded coefficients and the number of coefficients whose absolute values exceed a threshold.
 上記構成によれば、第1の範囲のモード切替条件を適切に設定することができるので、符号化効率が低下することを防ぐことができる。 According to the above configuration, since the mode switching condition in the first range can be appropriately set, it is possible to prevent the encoding efficiency from being lowered.
 本発明に係る画像符号化装置は、画像データから予測画像を減じた予測残差を、直交変換し、量子化した変換係数からなる係数行列をスキャンして符号することにより符号化データを出力する画像符号化装置において、上記係数行列における、上記スキャン順上最後の非ゼロ係数の位置を検出する最後の係数位置検出手段と、上記最後の非ゼロ係数の位置が、上記係数行列において、直流成分の係数を含む行または列から所定の行または列までの位置判定範囲にあるか否かを判定する位置判定手段と、上記最後の非ゼロ係数の位置が、上記位置判定範囲にある場合、上記係数行列を、上記最後の非ゼロ係数の位置を含む第1の符号化対象範囲と、上記第1の符号化対象範囲以外の第2の符号化対象範囲とでそれぞれ符号化処理する2段階符号化手段と、を備える構成である。 An image encoding apparatus according to the present invention outputs encoded data by performing orthogonal transform on a prediction residual obtained by subtracting a predicted image from image data and scanning and encoding a coefficient matrix composed of quantized transform coefficients. In the image encoding device, the last coefficient position detecting means for detecting the position of the last non-zero coefficient in the scan order in the coefficient matrix, and the position of the last non-zero coefficient are the DC component in the coefficient matrix. Position determination means for determining whether or not a position determination range from a row or column including the coefficient to a predetermined row or column and the position of the last non-zero coefficient are in the position determination range, A two-stage code for encoding a coefficient matrix in each of a first encoding target range including the position of the last non-zero coefficient and a second encoding target range other than the first encoding target range. And means, which is configured to include.
 本発明に係る符号化データのデータ構造は、画像データから予測画像を減じた予測残差を、直行変換し、量子化した変換係数からなる係数行列をスキャンして符号することにより生成される符号化データのデータ構造において、上記係数行列における、上記スキャン順上最後の非ゼロ係数の位置を示す位置情報と、上記最後の非ゼロ係数を含み、上記係数行列において、直流成分の係数を含む行または列から所定の行または列までの第1の符号化対象範囲にある係数が順に符号化された第1係数符号化データと、上記第1の符号化対象範囲以外の第2の符号化対象範囲にある係数が順に符号化された第2係数符号化データとを含むデータ構造である。 The data structure of the encoded data according to the present invention is a code generated by performing orthogonal transform on a prediction residual obtained by subtracting a predicted image from image data and scanning and coding a coefficient matrix composed of quantized transform coefficients. In the data structure of the digitized data, the position information indicating the position of the last non-zero coefficient in the scan order in the coefficient matrix and the last non-zero coefficient are included in the coefficient matrix, and the coefficient matrix includes the DC component coefficient. Alternatively, the first coefficient encoded data in which the coefficients in the first encoding target range from the column to the predetermined row or column are sequentially encoded, and the second encoding target other than the first encoding target range This is a data structure including second coefficient encoded data in which coefficients in a range are sequentially encoded.
 上記のように構成された画像符号化装置または符号化データのデータ構造によれば、本発明に係る画像復号装置と同様の効果を奏する。 According to the image encoding device or the data structure of the encoded data configured as described above, the same effects as those of the image decoding device according to the present invention can be obtained.
 なお、画像符号化装置は、上記係数行列における、上記スキャン順上最後の非ゼロ係数の位置を示す位置情報と、上記最後の非ゼロ係数を含み、上記係数行列において、直流成分の係数を含む行または列から所定の行または列までの第1の範囲にある係数が順に符号化された第1係数符号化データと、上記第1の範囲以外の第2の範囲にある係数が順に符号化された第2係数符号化データとを符号化データのデータ構造に含めてもよい。画像符号化装置は、上記情報を、例えば、サイド情報において符号化してもよい。
<<実施形態2>>
 本発明に係る復号装置および符号化装置の別の実施形態について図面に基づいて説明すれば以下のとおりである。なお、本実施形態に係る復号装置は、符号化データから動画像を復号するものである。したがって、以下では、これを「動画像復号装置」と呼称する。また、本実施形態に係る符号化装置は、動画像を符号化することによって符号化データを生成するものである。したがって、以下では、これを「動画像符号化装置」と呼ぶ。
The image encoding device includes position information indicating the position of the last non-zero coefficient in the scan order in the coefficient matrix and the last non-zero coefficient, and includes a coefficient of a DC component in the coefficient matrix. First coefficient encoded data obtained by sequentially encoding coefficients in a first range from a row or column to a predetermined row or column, and coefficients in a second range other than the first range are sequentially encoded. The encoded second coefficient encoded data may be included in the data structure of the encoded data. The image encoding device may encode the information in, for example, side information.
<< Embodiment 2 >>
Another embodiment of the decoding device and the encoding device according to the present invention will be described below with reference to the drawings. Note that the decoding apparatus according to the present embodiment decodes a moving image from encoded data. Therefore, hereinafter, this is referred to as “moving image decoding apparatus”. In addition, the encoding device according to the present embodiment generates encoded data by encoding a moving image. Therefore, in the following, this is referred to as a “video encoding device”.
 ただし、本発明の適用範囲はこれに限定されるものではない。すなわち、以下の説明からも明らかなように、本発明の特徴は複数のフレームを前提としなくとも成立するものである。すなわち、動画像を対象とするか静止画像を対象とするかを問わず、復号装置一般および符号化装置一般に適用できるものである。 However, the scope of application of the present invention is not limited to this. That is, as will be apparent from the following description, the features of the present invention can be realized without assuming a plurality of frames. That is, the present invention can be applied to a general decoding apparatus and a general encoding apparatus regardless of whether the target is a moving image or a still image.
 (符号化データ#1の構成)
 本実施形態に係る動画像復号装置1の説明に先立ち、本実施形態に係る動画像符号化装置2によって生成され、動画像復号装置1によって復号される符号化データ#1の構成について、図37を参照して説明する。符号化データ#1は、シーケンスレイヤ、GOP(Group Of Pictures)レイヤ、ピクチャレイヤ、スライスレイヤ、及び、最大符号化単位(LCU:Largest Coding Unit)レイヤからなる階層構造を有している。
(Configuration of encoded data # 1)
Prior to the description of the moving picture decoding apparatus 1 according to the present embodiment, the configuration of encoded data # 1 generated by the moving picture encoding apparatus 2 according to the present embodiment and decoded by the moving picture decoding apparatus 1 will be described with reference to FIG. Will be described with reference to FIG. The encoded data # 1 has a hierarchical structure including a sequence layer, a GOP (Group Of Pictures) layer, a picture layer, a slice layer, and a maximum coding unit (LCU: Large Coding Unit) layer.
 符号化データ#1におけるピクチャレイヤ以下の階層の構造を図37に示す。図37(a)~(f)は、それぞれ、ピクチャレイヤP、スライスレイヤS、LCUレイヤLCU、LCUに含まれるリーフCU(図37(d)ではCULと表記)、インター予測(画面間予測)パーティションについての予測情報PIであるインター予測情報PI_Inter、イントラ予測(画面内予測)パーティションについての予測情報PIであるイントラ予測情報PI_Intraの構造を示す図である。 FIG. 37 shows the hierarchical structure below the picture layer in the encoded data # 1. FIGS. 37A to 37F show a picture layer P, a slice layer S, an LCU layer LCU, a leaf CU included in the LCU (denoted as CUL in FIG. 37D), and inter prediction (inter-screen prediction). It is a figure which shows the structure of inter prediction information PI_Inter which is the prediction information PI about a partition, and intra prediction information PI_Intra which is the prediction information PI about an intra prediction (prediction in a screen) partition.
 (ピクチャレイヤ)
 ピクチャレイヤPは、処理対象のピクチャである対象ピクチャを復号するために動画像復号装置1が参照するデータの集合である。ピクチャレイヤPは、図37(a)に示すように、ピクチャヘッダPH、及び、スライスレイヤS1~SNsを含んでいる(NsはピクチャレイヤPに含まれるスライスレイヤの総数)。
(Picture layer)
The picture layer P is a set of data that is referenced by the video decoding device 1 in order to decode a target picture that is a processing target picture. As shown in FIG. 37 (a), the picture layer P includes a picture header PH and slice layers S1 to SNs (Ns is the total number of slice layers included in the picture layer P).
 ピクチャヘッダPHには、対象ピクチャの復号方法を決定するために動画像復号装置1が参照する符号化パラメータ群が含まれている。例えば、動画像符号化装置2が符号化の際に用いた可変長符号化のモードを示す符号化モード情報(entropy_coding_mode_flag)は、ピクチャヘッダPHに含まれる符号化パラメータの一例である。 The picture header PH includes a coding parameter group referred to by the video decoding device 1 in order to determine a decoding method of the target picture. For example, the encoding mode information (entropy_coding_mode_flag) indicating the variable length encoding mode used in encoding by the moving image encoding device 2 is an example of an encoding parameter included in the picture header PH.
 (スライスレイヤ)
 ピクチャレイヤPに含まれる各スライスレイヤSは、処理対象のスライスである対象スライスを復号するために動画像復号装置1が参照するデータの集合である。スライスレイヤSは、図37(b)に示すように、スライスヘッダSH、及び、LCUレイヤLCU1~LCUNc(NcはスライスSに含まれるLCUの総数)を含んでいる。
(Slice layer)
Each slice layer S included in the picture layer P is a set of data referred to by the video decoding device 1 in order to decode a target slice that is a slice to be processed. As shown in FIG. 37B, the slice layer S includes a slice header SH and LCU layers LCU1 to LCUn (Nc is the total number of LCUs included in the slice S).
 スライスヘッダSHには、対象スライスの復号方法を決定するために動画像復号装置1が参照する符号化パラメータ群が含まれる。スライスタイプを指定するスライスタイプ指定情報(slice_type)は、スライスヘッダSHに含まれる符号化パラメータの一例である。 The slice header SH includes a coding parameter group that the moving image decoding apparatus 1 refers to in order to determine a decoding method of the target slice. Slice type designation information (slice_type) for designating a slice type is an example of an encoding parameter included in the slice header SH.
 スライスタイプ指定情報により指定可能なスライスタイプとしては、(1)符号化の際にイントラ予測のみを用いるIスライス、(2)符号化の際に単方向予測、又は、イントラ予測を用いるPスライス、(3)符号化の際に単方向予測、双方向予測、又は、イントラ予測を用いるBスライスなどが挙げられる。 As slice types that can be specified by the slice type specification information, (1) I slice that uses only intra prediction at the time of encoding, (2) P slice that uses unidirectional prediction or intra prediction at the time of encoding, (3) B-slice using unidirectional prediction, bidirectional prediction, or intra prediction at the time of encoding may be used.
 また、スライスヘッダSHには、動画像復号装置1の備える適応フィルタによって参照されるフィルタパラメータFPが含まれる。なお、フィルタパラメータFPの構成については、後述するためここでは説明を省略する。 Also, the slice header SH includes a filter parameter FP that is referred to by an adaptive filter included in the video decoding device 1. The configuration of the filter parameter FP will be described later and will not be described here.
 (LCUレイヤ)
 スライスレイヤSに含まれる各LCUレイヤLCUは、処理対象のLCUである対象LCUを復号するために動画像復号装置1が参照するデータの集合である。
(LCU layer)
Each LCU layer LCU included in the slice layer S is a set of data that the video decoding device 1 refers to in order to decode the target LCU that is the processing target LCU.
 LCUレイヤLCUは、当該LCUを階層的に4分木分割することにより得られる複数の符号化単位(CU:Coding Unit)より構成される。換言すれば、LCUレイヤLCUは、複数のCUを再帰的に含む階層構造のうち、最上位にあたる符号化単位である。LCUレイヤLCUに含まれる各CUは、図37(c)に示すように、CUヘッダCUH、および、当該CUを4分木分割することにより得られる複数のCUを再帰的に含む階層構造を有している。 The LCU layer LCU is composed of a plurality of coding units (CU: Coding Units) obtained by hierarchically dividing the LCU into a quadtree. In other words, the LCU layer LCU is a coding unit corresponding to the highest level in a hierarchical structure that recursively includes a plurality of CUs. As shown in FIG. 37 (c), each CU included in the LCU layer LCU has a hierarchical structure that recursively includes a CU header CUH and a plurality of CUs obtained by dividing the CU into quadtrees. is doing.
 LCUを除く各CUのサイズは、当該CUが直接に属するCU(すなわち、当該CUの1階層上位のCU)のサイズの縦横とも半分であり、各CUのとり得るサイズは、符号化データ#1のシーケンスパラメータセットSPSに含まれる、LCUのサイズおよび階層深度(hierarchical depth)に依存する。例えば、LCUのサイズが128×128画素であって、最大階層深度が5である場合には、当該LCU以下の階層におけるCUは、5種類のサイズ、すなわち、128×128画素、64×64画素、32×32画素、16×16画素、および、8×8画素の何れかをとり得る。また、それ以上分割されないCUをリーフCUと呼ぶことにする。 The size of each CU excluding the LCU is half the size of the CU to which the CU directly belongs (that is, the CU one layer higher than the CU), and the size that each CU can take is encoded data # 1. Dependent on the size and hierarchical depth of the LCU included in the sequence parameter set SPS. For example, when the size of the LCU is 128 × 128 pixels and the maximum hierarchical depth is 5, the CUs in the hierarchical level below the LCU have five sizes, that is, 128 × 128 pixels and 64 × 64 pixels. , 32 × 32 pixels, 16 × 16 pixels, and 8 × 8 pixels. A CU that is not further divided is called a leaf CU.
 (CUヘッダ)
 CUヘッダCUHには、対象CUの復号方法を決定するために動画像復号装置1が参照する符号化パラメータが含まれる。具体的には、図37(c)に示すように、対象CUをさらに下位のCUへ4分割するか否かを指定するCU分割フラグSP_CUが含まれる。CU分割フラグSP_CUが0である場合、すなわち、それ以上CUが分割されない場合、当該CUはリーフCUである。
(CU header)
The CU header CUH includes a coding parameter referred to by the video decoding device 1 in order to determine a decoding method of the target CU. Specifically, as shown in FIG. 37 (c), a CU division flag SP_CU for specifying whether or not the target CU is further divided into four subordinate CUs is included. When the CU division flag SP_CU is 0, that is, when the CU is not further divided, the CU is a leaf CU.
 (リーフCU)
 それ以上分割されないCU(CUのリーフ)は予測単位(PU:Prediction Unit)、および、変換単位(TU:Transform Unit)として取り扱われる。
(Leaf CU)
A CU (CU leaf) that is not further divided is handled as a prediction unit (PU: Prediction Unit) and a transform unit (TU: Transform Unit).
 図37(d)に示すように、リーフCU(図37(d)においてはCULと表記)は、(1)動画像復号装置1により予測画像を生成する際に参照されるPU情報PUI、および、(2)動画像復号装置1により残差データを復号する際に参照されるTU情報TUIを含んでいる。 As shown in FIG. 37 (d), the leaf CU (denoted as CUL in FIG. 37 (d)) includes (1) PU information PUI that is referred to when the moving image decoding apparatus 1 generates a predicted image, and (2) The TU information TUI that is referred to when the residual data is decoded by the moving picture decoding apparatus 1 is included.
 スキップフラグSKIPは、対象のPUについて、スキップモードが適用されているか否かを示すフラグであり、スキップフラグSKIPの値が1の場合、すなわち、対象のリーフにスキップモードが適用されている場合、そのリーフCUにおけるPU情報PUI、および、TU情報TUIは省略される。なお、スキップフラグSKIPは、Iスライスでは省略される。 The skip flag SKIP is a flag indicating whether or not the skip mode is applied to the target PU. When the value of the skip flag SKIP is 1, that is, when the skip mode is applied to the target leaf, PU information PUI and TU information TUI in the leaf CU are omitted. Note that the skip flag SKIP is omitted for the I slice.
 PU情報PUIは、図37(d)に示すように、スキップフラグSKIP、予測タイプ情報PT、および、予測情報PIを含んでいる。予測タイプ情報PTは、対象リーフCU(対象PU)についての予測画像生成方法として、イントラ予測を用いるのか、または、インター予測を用いるのかを指定する情報である。予測情報PIは、予測タイプ情報PTが何れの予測方法を指定するのかに応じて、イントラ予測情報PI_Intra、または、インター予測情報PI_Interより構成される。以下では、イントラ予測が適用されるPUをイントラPUとも呼称し、インター予測が適用されるPUをインターPUとも呼称する。 The PU information PUI includes a skip flag SKIP, prediction type information PT, and prediction information PI as shown in FIG. The prediction type information PT is information that specifies whether intra prediction or inter prediction is used as a predicted image generation method for the target leaf CU (target PU). The prediction information PI includes intra prediction information PI_Intra or inter prediction information PI_Inter depending on which prediction method is specified by the prediction type information PT. Hereinafter, a PU to which intra prediction is applied is also referred to as an intra PU, and a PU to which inter prediction is applied is also referred to as an inter PU.
 PU情報PUIには、対象PUに含まれる各パーティションの形状、サイズ、および、対象PU内での位置を指定する情報が含まれる。ここで、パーティションとは、対象リーフCUを構成する1又は複数の重複しない領域のことであり、予測画像の生成は、パーティションを単位として行われる。 The PU information PUI includes information specifying the shape and size of each partition included in the target PU and the position in the target PU. Here, the partition is one or a plurality of non-overlapping areas constituting the target leaf CU, and the generation of the predicted image is performed in units of partitions.
 TU情報TUIは、図37(d)に示すように、量子化ステップの大きさを指定する量子化パラメータ差分Δqp(tu_qp_delta)、対象リーフCU(対象TU)の各ブロックへの分割パターンを指定するTU分割情報SP_TU、および、量子化残差情報QDを含んでいる。 As shown in FIG. 37 (d), the TU information TUI specifies the quantization parameter difference Δqp (tu_qp_delta) that specifies the size of the quantization step and the division pattern of the target leaf CU (target TU) into each block. TU partition information SP_TU and quantization residual information QD are included.
 量子化パラメータ差分Δqpは、対象TUにおける量子化パラメータqpと、そのTUの直前に符号化されたTUにおける量子化パラメータqp’との差分qp-qp’である。 The quantization parameter difference Δqp is a difference qp−qp ′ between the quantization parameter qp in the target TU and the quantization parameter qp ′ in the TU encoded immediately before the TU.
 TU分割情報SP_TUは、具体的には、対象TUに含まれる各ブロックの形状、サイズ、および、対象TU内での位置を指定する情報である。各TUは、例えば、64×64画素から2×2画素までのサイズをとり得る。ここで、ブロックとは、対象リーフCUを構成する1又は複数の重複しない領域のことであり、予測残差の符号化・復号は、ブロックを単位として行われる。 TU partition information SP_TU is information that specifies the shape and size of each block included in the target TU and the position in the target TU. Each TU can be, for example, a size from 64 × 64 pixels to 2 × 2 pixels. Here, the block is one or a plurality of non-overlapping areas constituting the target leaf CU, and encoding / decoding of the prediction residual is performed in units of blocks.
 量子化残差情報QDは、動画像符号化装置2が以下の処理1~3を、処理対象のブロックである対象ブロックに施すことによって生成した符号化データである。処理1:符号化対象画像から予測画像を減算した予測残差をDCT変換(Discrete Cosine Transform)する。処理2:処理1にて得られた変換係数を量子化する。処理3:処理2にて量子化された変換係数を可変長符号化する。上述した量子化パラメータqpは、動画像符号化装置2が変換係数を量子化する際に用いた量子化ステップQPの大きさを表す(QP=2qp/6)。量子化残差情報QDに含まれる各種のシンタックスについては後述する。 The quantization residual information QD is encoded data generated by the moving picture encoding apparatus 2 performing the following processes 1 to 3 on a target block that is a processing target block. Process 1: DCT transform (Discrete Cosine Transform) is performed on the prediction residual obtained by subtracting the prediction image from the encoding target image. Process 2: The transform coefficient obtained in Process 1 is quantized. Process 3: The transform coefficient quantized in Process 2 is variable-length encoded. The quantization parameter qp described above represents the magnitude of the quantization step QP used when the moving image encoding apparatus 2 quantizes the transform coefficient (QP = 2 qp / 6 ). Various syntaxes included in the quantization residual information QD will be described later.
 (インター予測情報PI_Inter)
 インター予測情報PI_Interは、動画像復号装置1が、インター予測によってインター予測画像を生成する際に参照される符号化パラメータが含まれる。図37(e)に示すように、インター予測情報PI_Interは、対象PUの各パーティションへの分割パターンを指定するインターPU分割情報SP_Inter、および、各パーティションについてのインター予測パラメータPP_Inter1~PP_InterNe(Neは、対象PUに含まれるインター予測パーティションの総数)を含んでいる。
(Inter prediction information PI_Inter)
The inter prediction information PI_Inter includes a coding parameter that is referred to when the video decoding device 1 generates an inter prediction image by inter prediction. As shown in FIG. 37 (e), the inter prediction information PI_Inter includes inter PU partition information SP_Inter that specifies a partition pattern for each partition of the target PU, and inter prediction parameters PP_Inter1 to PP_InterNe (Ne for each partition). The total number of inter prediction partitions included in the target PU).
 インターPU分割情報SP_Interは、具体的には、対象PU(インターPU)に含まれる各インター予測パーティションの形状、サイズ、および、対象PU内での位置を指定する情報である。 Specifically, the inter-PU partition information SP_Inter is information for designating the shape and size of each inter prediction partition included in the target PU (inter PU) and the position in the target PU.
 インターPUは、2N×2N画素、2N×N画素、N×2N画素、およびN×N画素の4つの対称的分割(symmetric splittings)、並びに、2N×nU画素、2N×nD画素、nL×2N画素、およびnR×2N画素の4つの非対称的分割(asymmetric splittings)により、合計8種類のパーティションに分割することが可能である。ここで、Nの具体的な値は、当該PUが属するCUのサイズによって規定され、nU、nD、nL、および、nRの具体的な値は、Nの値に応じて定められる。例えば、128×128画素のインターPUは、128×128画素、128×64画素、64×128画素、64×64画素、128×32画素、128×96画素、32×128画素、および、96×128画素のインター予測パーティションへ分割することが可能である。 The inter PU is composed of four symmetric splittings of 2N × 2N pixels, 2N × N pixels, N × 2N pixels, and N × N pixels, and 2N × nU pixels, 2N × nD pixels, and nL × 2N. It is possible to divide into 8 types of partitions in total by four asymmetric splits of pixels and nR × 2N pixels. Here, the specific value of N is defined by the size of the CU to which the PU belongs, and the specific values of nU, nD, nL, and nR are determined according to the value of N. For example, an inter PU of 128 × 128 pixels is 128 × 128 pixels, 128 × 64 pixels, 64 × 128 pixels, 64 × 64 pixels, 128 × 32 pixels, 128 × 96 pixels, 32 × 128 pixels, and 96 × It is possible to divide into 128-pixel inter prediction partitions.
 (インター予測パラメータPP_Inter)
 インター予測パラメータPP_Interは、図37(e)に示すように、参照画像インデックスRIと、推定動きベクトルインデックスPMVIと、動きベクトル残差MVDとを含んでいる。
(Inter prediction parameter PP_Inter)
As illustrated in FIG. 37E, the inter prediction parameter PP_Inter includes a reference image index RI, an estimated motion vector index PMVI, and a motion vector residual MVD.
 動きベクトル残差MVDは、動画像符号化装置2が以下の処理4~6を実行することによって生成した符号化データである。処理4:符号化/復号化済みの局所復号画像(より正確には、符号化/復号化済みの局所復号画像に対してデブロック処理および適応的フィルタ処理を施すことによって得られる画像)を選択し、選択した符号化/復号化済みの局所復号画像(以下「参照画像」とも呼称)を参照して対象パーティションに対する動きベクトルmvを導出する。処理5:推定方法を選択し、選択した推定方法を用いて対象パーティションに割り付ける動きベクトルmvの推定値(以下「推定動きベクトル」とも呼称)pmvを導出する。処理6:処理4にて導出した動きベクトルmvから処理5にて導出した推定動きベクトルpmvを減算した動きベクトル残差MVDを符号化する。 The motion vector residual MVD is encoded data generated by the moving image encoding device 2 executing the following processes 4 to 6. Process 4: Select an encoded / decoded locally decoded image (more precisely, an image obtained by performing deblocking processing and adaptive filtering on the encoded / decoded local decoded image) The motion vector mv for the target partition is derived with reference to the selected encoded / decoded local decoded image (hereinafter also referred to as “reference image”). Process 5: An estimation method is selected, and an estimated value (hereinafter also referred to as “estimated motion vector”) pmv of the motion vector mv assigned to the target partition is derived using the selected estimation method. Process 6: The motion vector residual MVD obtained by subtracting the estimated motion vector pmv derived in Process 5 from the motion vector mv derived in Process 4 is encoded.
 参照画像インデックスRIは、処理4にて選択した符号化/復号化済みの局所復号画像(参照画像)を指定するものであり、上述した推定動きベクトルインデックスPMVIは、処理5にて選択した推定方法を指定するものである。処理5にて選択可能な推定方法としては、(1)符号化/復号化中の局所復号画像(より正確には、符号化/復号化中の局所復号画像における復号済みの領域に対してデブロック処理および適応的フィルタ処理を施すことによって得られる画像)において、対象パーティションに隣接するパーティション(以下「隣接パーティション」とも呼称する)に割り付けられた動きベクトルのメジアンを推定動きベクトルpmvとする方法や、(2)符号化/復号化済みの局所復号画像において、対象パーティションと同じ位置を占めるパーティション(しばしば「コロケートパーティション」と呼称される)に割り付けられた動きベクトルを推定動きベクトルpmvとする方法などが挙げられる。 The reference image index RI designates the locally decoded image (reference image) that has been encoded / decoded selected in the process 4. The estimated motion vector index PMVI described above is the estimation method selected in the process 5. Is specified. The estimation methods that can be selected in the processing 5 include: (1) a locally decoded image being encoded / decoded (more precisely, a region that has already been decoded in a locally decoded image being encoded / decoded). In an image obtained by performing block processing and adaptive filter processing), a median of a motion vector allocated to a partition adjacent to the target partition (hereinafter also referred to as “adjacent partition”) is used as an estimated motion vector pmv. (2) In a locally decoded image that has been encoded / decoded, a motion vector assigned to a partition (often referred to as a “collocated partition”) occupying the same position as the target partition is used as an estimated motion vector pmv, etc. Is mentioned.
 なお、単方向予測を行うパーティションに関する予測パラメータPPには、図37(e)に示すように、参照画像インデックスRI、推定動きベクトルインデックスPMVI、及び、動きベクトル残差MVDがそれぞれ1つずつ含まれているが、双方向予測(重み付き予測)を行うパーティションに関する予測パラメータPPには、2つの参照画像インデックスRI1及びRI2、2つの推定動きベクトルインデックスPMVI1及びPMVI2、並びに、2つの動きベクトル残差MVD1及びMVD2が含まれる。 Note that the prediction parameter PP related to the partition for which unidirectional prediction is performed includes one each of the reference image index RI, the estimated motion vector index PMVI, and the motion vector residual MVD, as shown in FIG. However, the prediction parameters PP for a partition that performs bi-directional prediction (weighted prediction) include two reference image indexes RI1 and RI2, two estimated motion vector indexes PMVI1 and PMVI2, and two motion vector residuals MVD1. And MVD2.
 (イントラ予測情報PI_Intra)
 イントラ予測情報PI_Intraは、動画像復号装置1が、イントラ予測によってイントラ予測画像を生成する際に参照される符号化パラメータが含まれる。図37(f)に示すように、イントラ予測情報PI_Intraは、対象PU(イントラPU)の各パーティションへの分割パターンを指定するイントラPU分割情報SP_Intra、および、各パーティションについてのイントラ予測パラメータPP_Intra1~PP_IntraNa(Naは、対象PUに含まれるイントラ予測パーティションの総数)を含んでいる。
(Intra prediction information PI_Intra)
The intra prediction information PI_Intra includes an encoding parameter that is referred to when the video decoding device 1 generates an intra predicted image by intra prediction. As shown in FIG. 37 (f), the intra prediction information PI_Intra includes intra PU partition information SP_Intra that specifies a partition pattern for the target PU (intra PU) into each partition, and intra prediction parameters PP_Intra1 to PP_IntraNa for each partition. (Na is the total number of intra prediction partitions included in the target PU).
 イントラPU分割情報SP_Intraは、具体的には、対象PUに含まれる各イントラ予測パーティションの形状、サイズ、および、対象PU内での位置を指定する情報である。イントラPU分割情報SP_Intraには、対象PUをパーティションに分割するか否かを指定するイントラ分割フラグ(intra_split_flag)が含まれている。イントラ分割フラグが1であれば、対象PUは、4つのパーティションへと対称的に分割され、イントラ分割フラグが0であれば、対象PUは、分割されることなく、対象PU自身が1つのパーティションとして取り扱われる。したがって、対象PUのサイズを2N×2N画素とすると、イントラ予測パーティションは、2N×2N画素(分割なし)、および、N×N画素(4分割)の何れかのサイズを取り得る(ここで、N=2n、nは1以上の任意の整数)。例えば、128×128画素のイントラPUは、128×128画素、および、64×64画素のイントラ予測パーティションへ分割することが可能である。 Specifically, the intra-PU partition information SP_Intra is information that specifies the shape and size of each intra-predicted partition included in the target PU, and the position in the target PU. The intra PU split information SP_Intra includes an intra split flag (intra_split_flag) that specifies whether or not the target PU is split into partitions. If the intra partition flag is 1, the target PU is divided symmetrically into four partitions. If the intra partition flag is 0, the target PU is not divided and the target PU itself is one partition. Are treated as Therefore, if the size of the target PU is 2N × 2N pixels, the intra prediction partition can take any of 2N × 2N pixels (no division) and N × N pixels (four divisions) (where, N = 2 n , n is an arbitrary integer of 1 or more). For example, a 128 × 128 pixel intra PU can be divided into 128 × 128 pixel and 64 × 64 pixel intra prediction partitions.
 (イントラ予測パラメータPP_Intra)
 イントラ予測パラメータPP_Intraは、図37(f)に示すように、推定フラグMPM、および、残余予測モードインデックスRIPMを含んでいる。イントラ予測パラメータPP_Intraは、各パーティションについてのイントラ予測方法(予測モード)を指定するためのパラメータである。
(Intra prediction parameter PP_Intra)
As shown in FIG. 37 (f), the intra prediction parameter PP_Intra includes an estimation flag MPM and a residual prediction mode index RIPM. The intra prediction parameter PP_Intra is a parameter for designating an intra prediction method (prediction mode) for each partition.
 推定フラグMPMは、処理対象である対象パーティションの周辺のパーティションに割り付けられた予測モードに基づいて推定された予測モードと当該対象パーティションについての予測モードとが同じであるか否かを示すフラグである。ここで、対象パーティションの周辺のパーティションの例としては、対象パーティションの上辺に隣接するパーティション、および、対象パーティションの左辺に隣接するパーティション等が挙げられる。 The estimation flag MPM is a flag indicating whether or not the prediction mode estimated based on the prediction mode allocated to the peripheral partition of the target partition that is the processing target is the same as the prediction mode for the target partition. . Here, examples of partitions around the target partition include a partition adjacent to the upper side of the target partition and a partition adjacent to the left side of the target partition.
 残余予測モードインデックスRIPMは、推定された予測モードと対象パーティションについての予測モードとが異なる場合に、イントラ予測パラメータPP_Intraに含められるインデックスであり、当該対象パーティションに割り付けられる予測モードを指定するためのインデックスである。 The residual prediction mode index RIPM is an index included in the intra prediction parameter PP_Intra when the estimated prediction mode and the prediction mode for the target partition are different, and is an index for designating a prediction mode assigned to the target partition. It is.
 (フィルタパラメータFP)
 上述のように、スライスヘッダSHには、動画像復号装置1の備える適応フィルタが参照するフィルタパラメータFPが含まれる。フィルタパラメータFPは、図37(g)に示すように、フィルタ係数群を含んでいる。フィルタ係数群には、(1)フィルタのタップ数を指定するタップ数指定情報、(2)フィルタ係数a0~aNT-1(NTは、フィルタ係数群に含まれるフィルタ係数の総数)、および、(3)オフセットoが含まれる。
(Filter parameter FP)
As described above, the slice header SH includes the filter parameter FP that is referred to by the adaptive filter included in the video decoding device 1. The filter parameter FP includes a filter coefficient group as shown in FIG. The filter coefficient group includes (1) tap number designation information for designating the number of taps of the filter, (2) filter coefficients a 0 to a NT-1 (NT is the total number of filter coefficients included in the filter coefficient group), and (3) Offset o is included.
 (量子化残差情報QDの構成)
 図38は、量子化残差情報QD(図38ではresidual_block_pipe(tuSize)と表記)に含まれる各シンタックスを示す表である。
(Configuration of quantization residual information QD)
FIG. 38 is a table showing each syntax included in the quantization residual information QD (indicated as residual_block_pipe (tuSize) in FIG. 38).
 図38に示すように、量子化残差情報QDは、シンタックスsig_flag、last_flag、abs_greater_one、coeff_abs_level、およびsignを含んでいる。シンタックスsig_flagとシンタックスlast_flagとは合わせてsignificant mapとも呼ばれる。量子化残差情報QDに含まれる各種のシンタックスは、コンテキスト適応型2値算術符号化(CABAC:(Context-based Adaptive Binary Arithmetic Coding))によって符号化されている。 38, the quantization residual information QD includes syntax sig_flag, last_flag, abs_greater_one, coeff_abs_level, and sign. The syntax sig_flag and the syntax last_flag are also referred to as a significant map. Various syntaxes included in the quantized residual information QD are encoded by context adaptive binary arithmetic coding (CABAC: (Context-based Adaptive Binary Arithmetic Coding)).
 図39(a)は、8×8画素のブロックにおける0でない変換係数(以下、非0の変化係数とも呼ぶ)を例示する図である。図39(a)の横軸は、水平方向周波数を表しており、縦軸は、垂直方向周波数を表している。以下では、水平方向周波数u(0≦u≦7)、および、垂直方向周波数v(0≦v≦7)についての変換係数をCoeff(u、v)と表すことにする。なお、図39(a)において、変換係数Coeff(0、0)はDC成分を表しており、それ以外の変換係数は、DC成分以外の成分を表している。 FIG. 39A is a diagram illustrating a non-zero transform coefficient (hereinafter also referred to as a non-zero change coefficient) in an 8 × 8 pixel block. In FIG. 39A, the horizontal axis represents the horizontal frequency, and the vertical axis represents the vertical frequency. Hereinafter, the transform coefficient for the horizontal frequency u (0 ≦ u ≦ 7) and the vertical frequency v (0 ≦ v ≦ 7) will be expressed as Coeff (u, v). In FIG. 39A, the conversion coefficient Coeff (0, 0) represents a DC component, and the other conversion coefficients represent components other than the DC component.
 後述する動画像復号装置1の備える可変長符号復号部11は、対象ブロックについて、低周波数側(図39(a)において左上)から高周波数側(図39(a)において右下)に向かってスキャンを行い、順次、変換係数Coeff(u、v)の復号を行う。具体的なスキャン順序については、後述することにする。 The variable-length code decoding unit 11 included in the moving picture decoding apparatus 1 to be described later is directed from the low frequency side (upper left in FIG. 39A) to the high frequency side (lower right in FIG. 39A) for the target block. Scanning is performed, and the transform coefficient Coeff (u, v) is sequentially decoded. A specific scan order will be described later.
 また、以下の説明では、周波数領域に含まれる各部分領域のうち、水平方向周波数u(0≦u≦7)、および、垂直方向周波数v(0≦v≦7)によって指定される部分領域を、周波数成分(u、v)とも呼称する。 In the following description, among the partial areas included in the frequency domain, the partial areas specified by the horizontal frequency u (0 ≦ u ≦ 7) and the vertical frequency v (0 ≦ v ≦ 7) are described. Also called frequency components (u, v).
 シンタックスsig_flagは、各u、vについて、非0の変換係数の有無を示すフラグである。図39(b)は、復号対象の変換係数が、図39(a)に示すものである場合のシンタックスsig_flagの値を示している。図39(a)に示すように、シンタックスsig_flagは、各u、vについて、変換係数が0であれば0、変換係数が0でなければ1をとるフラグである。 The syntax sig_flag is a flag indicating the presence or absence of a non-zero conversion coefficient for each u and v. FIG. 39 (b) shows the value of the syntax sig_flag when the transform coefficient to be decoded is the one shown in FIG. 39 (a). As shown in FIG. 39A, the syntax sig_flag is a flag that takes 0 for each of u and v if the transform coefficient is 0, and 1 if the transform coefficient is not 0.
 シンタックスlast_flagは、各u、vについて、スキャン順で最後の変換係数であるか否かを示すフラグである。図39(c)は、復号対象の変換係数が、図39(a)に示すものである場合のシンタックスlast_flagを示す図である。シンタックスlast_flagは、各u、vについて、スキャン順で最後の変換係数であれば1、スキャン順で最後の変換係数でなければ0をとるフラグである。可変長符号復号部11は、低周波数側から順次シンタックスlast_flagの復号を行い、last_flag=1である周波数成分まで変換係数の復号処理を行う。 The syntax last_flag is a flag indicating whether or not u and v are the last conversion coefficients in the scan order. FIG. 39 (c) is a diagram illustrating the syntax last_flag when the transform coefficient to be decoded is the one illustrated in FIG. 39 (a). The syntax last_flag is a flag that takes 1 for u and v if the last conversion coefficient is in the scan order, and takes 0 if it is not the last conversion coefficient in the scan order. The variable length code decoding unit 11 sequentially decodes the syntax last_flag from the low frequency side, and performs the transform coefficient decoding processing up to the frequency component where last_flag = 1.
 シンタックスabs_greater_oneは、各u、vについて、変換係数の絶対値が1を越えるものであるのか否かを示すフラグである。図39(d)は、復号対象の変換係数が、図39(a)に示すものである場合のシンタックスabs_greater_oneを示す図である。図39(d)に示すように、シンタックスabs_greater_oneは、変換係数の絶対値が1を越えるものである場合に1をとり、変換係数の絶対値が1を越えるものではない場合に0をとるフラグである。 The syntax abs_greater_one is a flag indicating whether or not the absolute value of the conversion coefficient exceeds 1 for each of u and v. FIG. 39D is a diagram illustrating the syntax abs_greater_one when the transform coefficients to be decoded are those illustrated in FIG. As shown in FIG. 39D, the syntax abs_greater_one takes 1 when the absolute value of the transform coefficient exceeds 1, and takes 0 when the absolute value of the transform coefficient does not exceed 1. Flag.
 シンタックスcoeff_abs_levelは、変換係数の絶対値が1を超える場合における変換係数の絶対値の大きさを示すシンタックスであり、絶対値から2を引いた値が符号化される。また、シンタックスsignは、変換係数の符号(正であるのか負であるのか)を示すフラグである。変換係数の値が負であるときに、sign=1をとり、変換係数の値が正であるときに、sign=0をとる。 The syntax coeff_abs_level is a syntax indicating the magnitude of the absolute value of the transform coefficient when the absolute value of the transform coefficient exceeds 1, and a value obtained by subtracting 2 from the absolute value is encoded. The syntax sign is a flag indicating the sign of the transform coefficient (whether positive or negative). Sign = 1 is taken when the value of the transform coefficient is negative, and sign = 0 is taken when the value of the transform coefficient is positive.
 動画像復号装置1の備える可変長符号復号部11は、量子化残差情報QDは、シンタックスsig_flag、last_flag、abs_greater_one、coeff_abs_level、およびsignを復号することによって、各周波数成分についての変換係数Coeff(u、v)を生成することができる。可変長符号復号部11は、例えば、周波数成分(u、v)について、sig_flag=1、abs_greater_one=0、sign=1であれば、Coeff(u、v)=-1を生成し、sig_flag=1、abs_greater_one=1、coeff_abs_level=3、sign=0であれば、Coeff(u、v)=+5を生成する。 The variable-length code decoding unit 11 included in the video decoding device 1 decodes the quantization residual information QD from the syntax sig_flag, last_flag, abs_greater_one, coeff_abs_level, and sign, thereby transform coefficients Coeff ( u, v) can be generated. For example, if sig_flag = 1, abs_greater_one = 0, and sign = 1 for the frequency component (u, v), the variable-length code decoding unit 11 generates Coeff (u, v) = − 1 and sig_flag = 1 If abs_greater_one = 1, coeff_abs_level = 3, and sign = 0, Coeff (u, v) = + 5 is generated.
 (動画像復号装置1)
 以下では、本実施形態に係る動画像復号装置1について図40~図57を参照して説明する。動画像復号装置1は、その一部に、H.264/MPEG-4.AVC、VCEG(Video Coding Expert Group)における共同開発用コーデックであるKTAソフトウェアに採用されている技術、および、その後継コーデックであるTMuC(Test Model under Consideration)ソフトウェアに採用されている技術を含む復号装置である。
(Moving picture decoding apparatus 1)
Hereinafter, the video decoding device 1 according to the present embodiment will be described with reference to FIGS. The moving picture decoding apparatus 1 includes H.264 as a part thereof. H.264 / MPEG-4. Decoding device including technology adopted in KTA software which is a codec for joint development in AVC and VCEG (Video Coding Expert Group), and technology adopted in TMuC (Test Model under Consideration) software which is a successor codec It is.
 図40は、動画像復号装置1の構成を示すブロック図である。図40に示すように、動画像復号装置1は、可変長符号復号部11、予測画像生成部12、逆量子化・逆変換部13、加算器14、フレームメモリ15、および、ループフィルタ16を備えている。また、図40に示すように、予測画像生成部12は、動きベクトル復元部12a、インター予測画像生成部12b、イントラ予測画像生成部12c、および、予測方式決定部12dを備えている。動画像復号装置1は、符号化データ#1を復号することによって動画像#2を生成するための装置である。 FIG. 40 is a block diagram showing a configuration of the moving picture decoding apparatus 1. As shown in FIG. 40, the moving image decoding apparatus 1 includes a variable length code decoding unit 11, a predicted image generation unit 12, an inverse quantization / inverse conversion unit 13, an adder 14, a frame memory 15, and a loop filter 16. I have. As illustrated in FIG. 40, the predicted image generation unit 12 includes a motion vector restoration unit 12a, an inter predicted image generation unit 12b, an intra predicted image generation unit 12c, and a prediction method determination unit 12d. The moving picture decoding apparatus 1 is an apparatus for generating moving picture # 2 by decoding encoded data # 1.
 (可変長符号復号部11)
 図41は、可変長符号復号部11の要部構成を示すブロック図である。図41に示すように、可変長符号復号部11は、量子化残差情報復号部111、予測パラメータ復号部112、予測タイプ情報復号部113、および、フィルタパラメータ復号部114を備えている。
(Variable-length code decoding unit 11)
FIG. 41 is a block diagram illustrating a main configuration of the variable length code decoding unit 11. As shown in FIG. 41, the variable-length code decoding unit 11 includes a quantization residual information decoding unit 111, a prediction parameter decoding unit 112, a prediction type information decoding unit 113, and a filter parameter decoding unit 114.
 可変長符号復号部11は、予測パラメータ復号部112にて、各パーティションに関する予測パラメータPPを、符号化データ#1から復号し、予測画像生成部12に供給する。具体的には、予測パラメータ復号部112は、インター予測パーティションに関しては、参照画像インデックスRI、推定動きベクトルインデックスPMVI、及び、動きベクトル残差MVDを含むインター予測パラメータPP_Interを符号化データ#1から復号し、これらを動きベクトル復元部12aに供給する。一方、イントラ予測パーティションに関しては、推定フラグMPM、残余インデックスRIPM、および、追加インデックスAIを含むイントラ予測パラメータPP_Intraを符号化データ#1から復号し、これらをイントラ予測画像生成部12cに供給する。 The variable length code decoding unit 11 uses the prediction parameter decoding unit 112 to decode the prediction parameter PP related to each partition from the encoded data # 1, and supplies the decoded image to the predicted image generation unit 12. Specifically, for the inter prediction partition, the prediction parameter decoding unit 112 decodes the inter prediction parameter PP_Inter including the reference image index RI, the estimated motion vector index PMVI, and the motion vector residual MVD from the encoded data # 1. These are supplied to the motion vector restoration unit 12a. On the other hand, for the intra prediction partition, the intra prediction parameter PP_Intra including the estimation flag MPM, the residual index RIPM, and the additional index AI is decoded from the encoded data # 1, and these are supplied to the intra prediction image generation unit 12c.
 また、可変長符号復号部11は、予測タイプ情報復号部113にて、各パーティションについての予測タイプ情報PTを符号化データ#1から復号し、これを予測方式決定部12dに供給する。更に、可変長符号復号部11は、量子化残差情報復号部111にて、ブロックに関する量子化残差情報QD、及び、そのブロックを含むTUに関する量子化パラメータ差分Δqpを符号化データ#1から復号し、これらを逆量子化・逆変換部13に供給する。また、可変長符号復号部11は、フィルタパラメータ復号部114にて、符号化データ#1からフィルタパラメータFPを復号し、これをループフィルタ16に供給する。なお、量子化残差情報復号部111の具体的な構成については後述するためここでは説明を省略する。 Also, the variable length code decoding unit 11 decodes the prediction type information PT for each partition from the encoded data # 1 in the prediction type information decoding unit 113, and supplies this to the prediction method determination unit 12d. Further, the variable length code decoding unit 11 uses the quantization residual information decoding unit 111 to convert the quantization residual information QD related to the block and the quantization parameter difference Δqp related to the TU including the block from the encoded data # 1. These are decoded and supplied to the inverse quantization / inverse transform unit 13. In the variable length code decoding unit 11, the filter parameter decoding unit 114 decodes the filter parameter FP from the encoded data # 1 and supplies this to the loop filter 16. Note that a specific configuration of the quantized residual information decoding unit 111 will be described later, and a description thereof will be omitted here.
 (予測画像生成部12)
 予測画像生成部12は、各パーティションについての予測タイプ情報PTに基づいて、各パーティションがインター予測を行うべきインター予測パーティションであるのか、イントラ予測を行うべきイントラ予測パーティションであるのかを識別する。そして、前者の場合には、インター予測画像Pred_Interを生成すると共に、生成したインター予測画像Pred_Interを予測画像Predとして加算器14に供給し、後者の場合には、イントラ予測画像Pred_Intraを生成すると共に、生成したイントラ予測画像Pred_Intraを加算器14に供給する。なお、予測画像生成部12は、処理対象PUに対してスキップモードが適用されている場合には、当該PUに属する他のパラメータの復号を省略する。
(Predicted image generation unit 12)
The predicted image generation unit 12 identifies whether each partition is an inter prediction partition for performing inter prediction or an intra prediction partition for performing intra prediction based on the prediction type information PT for each partition. In the former case, the inter prediction image Pred_Inter is generated, and the generated inter prediction image Pred_Inter is supplied to the adder 14 as the prediction image Pred. In the latter case, the intra prediction image Pred_Intra is generated, The generated intra predicted image Pred_Intra is supplied to the adder 14. Note that, when the skip mode is applied to the processing target PU, the predicted image generation unit 12 omits decoding of other parameters belonging to the PU.
 (動きベクトル復元部12a)
 動きベクトル復元部12aは、各インター予測パーティションに関する動きベクトルmvを、そのパーティションに関する動きベクトル残差MVDと、他のパーティションに関する復元済みの動きベクトルmv’とから復元する。具体的には、(1)推定動きベクトルインデックスPMVIにより指定される推定方法に従って、復元済みの動きベクトルmv’から推定動きベクトルpmvを導出し、(2)導出した推定動きベクトルpmvと動きベクトル残差MVDとを加算することによって動きベクトルmvを得る。なお、他のパーティションに関する復元済みの動きベクトルmv’は、フレームメモリ15から読み出すことができる。動きベクトル復元部12aは、復元した動きベクトルmvを、対応する参照画像インデックスRIと共に、インター予測画像生成部12bに供給する。
(Motion vector restoration unit 12a)
The motion vector restoration unit 12a restores the motion vector mv related to each inter prediction partition from the motion vector residual MVD related to that partition and the restored motion vector mv ′ related to another partition. Specifically, (1) the estimated motion vector pmv is derived from the restored motion vector mv ′ according to the estimation method specified by the estimated motion vector index PMVI, and (2) the derived estimated motion vector pmv and the motion vector remaining are derived. The motion vector mv is obtained by adding the difference MVD. It should be noted that the restored motion vector mv ′ relating to other partitions can be read from the frame memory 15. The motion vector restoration unit 12a supplies the restored motion vector mv to the inter predicted image generation unit 12b together with the corresponding reference image index RI.
 (インター予測画像生成部12b)
 インター予測画像生成部12bは、画面間予測によって、各インター予測パーティションに関する動き補償画像mcを生成する。具体的には、動きベクトル復元部12aから供給された動きベクトルmvを用いて、同じく動きベクトル復元部12aから供給された参照画像インデックスRIによって指定される適応フィルタ済復号画像P_ALF’から動き補償画像mcを生成する。ここで、適応フィルタ済復号画像P_ALF’は、既にフレーム全体の復号が完了した復号済みの復号画像に対して、ループフィルタ16によるフィルタ処理を施すことによって得られる画像であり、インター予測画像生成部12bは、適応フィルタ済復号画像P_ALF’を構成する各画素の画素値をフレームメモリ15から読み出すことができる。インター予測画像生成部12bによって生成された動き補償画像mcは、インター予測画像Pred_Interとして予測方式決定部12dに供給される。
(Inter prediction image generation unit 12b)
The inter prediction image generation unit 12b generates a motion compensated image mc related to each inter prediction partition by inter-screen prediction. Specifically, using the motion vector mv supplied from the motion vector restoration unit 12a, the motion compensated image from the adaptive filtered decoded image P_ALF ′ designated by the reference image index RI also supplied from the motion vector restoration unit 12a. Generate mc. Here, the adaptive filtered decoded image P_ALF ′ is an image obtained by performing the filtering process by the loop filter 16 on the decoded image that has already been decoded for the entire frame. 12b can read out the pixel value of each pixel constituting the adaptive filtered decoded image P_ALF ′ from the frame memory 15. The motion compensated image mc generated by the inter predicted image generation unit 12b is supplied to the prediction method determination unit 12d as an inter predicted image Pred_Inter.
 (イントラ予測画像生成部12c)
 イントラ予測画像生成部12cは、各イントラ予測パーティションに関する予測画像Pred_Intraを生成する。具体的には、まず、可変長符号復号部11から供給されたイントラ予測パラメータPP_Intraに基づいて予測モードを特定し、特定された予測モードを対象パーティションに対して、例えば、ラスタスキャン順に割り付ける。
(Intra predicted image generation unit 12c)
The intra predicted image generation unit 12c generates a predicted image Pred_Intra related to each intra prediction partition. Specifically, first, a prediction mode is specified based on the intra prediction parameter PP_Intra supplied from the variable length code decoding unit 11, and the specified prediction mode is assigned to the target partition in, for example, raster scan order.
 ここで、イントラ予測パラメータPP_Intraに基づく予測モードの特定は、以下のように行うことができる。(1)推定フラグMPMを復号し、当該推定フラグMPMが、処理対象である対象パーティションについての予測モードと、当該対象パーティションの周辺のパーティションに割り付けられた予測モードとが同一であることを示している場合には、対象パーティションに対して、当該対象パーティションの周辺のパーティションに割り付けられた予測モードを割り付ける。(2)一方で、推定フラグMPMが、処理対象である対象パーティションについての予測モードと、当該対象パーティションの周辺のパーティションに割り付けられた予測モードとが同一でないことを示している場合には、残余予測モードインデックスRIPMを復号し、当該残余予測モードインデックスRIPMの示す予測モードを対象パーティションに対して割り付ける。 Here, specification of the prediction mode based on the intra prediction parameter PP_Intra can be performed as follows. (1) The estimation flag MPM is decoded, and the estimation flag MPM indicates that the prediction mode for the target partition to be processed is the same as the prediction mode assigned to the peripheral partition of the target partition. If it is, the prediction mode assigned to the partition around the target partition is assigned to the target partition. (2) On the other hand, if the estimation flag MPM indicates that the prediction mode for the target partition to be processed is not the same as the prediction mode assigned to a partition around the target partition, the remaining The prediction mode index RIPM is decoded, and the prediction mode indicated by the residual prediction mode index RIPM is assigned to the target partition.
 イントラ予測画像生成部12cは、対象パーティションに割り付けられた予測モードの示す予測方法に従って、画面内予測によって、(局所)復号画像Pから予測画像Pred_Intraを生成する。イントラ予測画像生成部12cによって生成されたイントラ予測画像Pred_Intraは、予測方式決定部12dに供給される。なお、イントラ予測画像生成部12cは、画面内予測によって、適応フィルタ済復号画像P_ALFから予測画像Pred_Intraを生成する構成とすることも可能である。 The intra predicted image generation unit 12c generates a predicted image Pred_Intra from the (local) decoded image P by intra prediction according to the prediction method indicated by the prediction mode assigned to the target partition. The intra predicted image Pred_Intra generated by the intra predicted image generation unit 12c is supplied to the prediction method determination unit 12d. Note that the intra predicted image generation unit 12c can also be configured to generate the predicted image Pred_Intra from the adaptive filtered decoded image P_ALF by intra prediction.
 (予測方式決定部12d)
 予測方式決定部12dは、各パーティションが属するPUについての予測タイプ情報PTに基づいて、各パーティションがインター予測を行うべきインター予測パーティションであるのか、イントラ予測を行うべきイントラ予測パーティションであるのかを決定する。そして、前者の場合には、インター予測画像生成部12bにて生成されたインター予測画像Pred_Interを予測画像Predとして加算器14に供給し、後者の場合には、イントラ予測画像生成部12cにて生成されたイントラ予測画像Pred_Intraを予測画像Predとして加算器14に供給する。
(Prediction method determination unit 12d)
The prediction method determination unit 12d determines whether each partition is an inter prediction partition that should perform inter prediction or an intra prediction partition that should perform intra prediction based on the prediction type information PT about the PU to which each partition belongs. To do. In the former case, the inter prediction image Pred_Inter generated by the inter prediction image generation unit 12b is supplied to the adder 14 as the prediction image Pred. In the latter case, the inter prediction image generation unit 12c generates the inter prediction image Pred_Inter. The intra predicted image Pred_Intra that has been processed is supplied to the adder 14 as the predicted image Pred.
 (逆量子化・逆変換部13)
 逆量子化・逆変換部13は、(1)量子化残差情報QDから復号された変換係数Coeffを逆量子化し、(2)逆量子化によって得られた変換係数Coeff_IQを逆DCT(Discrete Cosine Transform)変換し、(3)逆DCT変換によって得られた予測残差Dを加算器14に供給する。なお、量子化残差情報QDから復号された変換係数Coeffを逆量子化する際に、逆量子化・逆変換部13は、可変長符号復号部11から供給された量子化パラメータ差分Δqpから量子化ステップQPを導出する。量子化パラメータqpは、直前に逆量子化/逆DCT変換したTUに関する量子化パラメータqp’に量子化パラメータ差分Δqpを加算することによって導出でき、量子化ステップQPは、量子化ステップqpから例えばQP=2pq/6によって導出できる。また、逆量子化・逆変換部13による予測残差Dの生成は、TUあるいはTUを分割したブロックを単位として行われる。
(Inverse quantization / inverse transform unit 13)
The inverse quantization / inverse transform unit 13 (1) inverse quantizes the transform coefficient Coeff decoded from the quantized residual information QD, and (2) transforms the transform coefficient Coeff_IQ obtained by the inverse quantization into an inverse DCT (Discrete Cosine). Transform), and (3) the prediction residual D obtained by the inverse DCT transform is supplied to the adder 14. Note that when the transform coefficient Coeff decoded from the quantization residual information QD is inversely quantized, the inverse quantization / inverse transform unit 13 performs quantization from the quantization parameter difference Δqp supplied from the variable length code decoding unit 11. Deriving step QP. The quantization parameter qp can be derived by adding the quantization parameter difference Δqp to the quantization parameter qp ′ relating to the TU that has been inversely quantized / inversely DCT transformed immediately before, and the quantization step QP is derived from the quantization step qp, for example, QP = 2 pq / 6 . The generation of the prediction residual D by the inverse quantization / inverse transform unit 13 is performed in units of blocks obtained by dividing TUs or TUs.
 なお、逆量子化・逆変換部13によって行われる逆DCT変換は、例えば、対象ブロックのサイズが8×8画素である場合、当該対象ブロックにおける画素の位置を(i、j)(0≦i≦7、0≦j≦7)とし、位置(i、j)における予測残差Dの値をD(i、j)と表すことにすると、例えば、以下の数式(1)によって与えられる。 For example, when the size of the target block is 8 × 8 pixels, the inverse DCT transform performed by the inverse quantization / inverse transform unit 13 sets the pixel position in the target block to (i, j) (0 ≦ i If it is assumed that ≦ 7, 0 ≦ j ≦ 7) and the value of the prediction residual D at the position (i, j) is represented as D (i, j), it is given by the following mathematical formula (1), for example.
Figure JPOXMLDOC01-appb-M000001
Figure JPOXMLDOC01-appb-M000001
ここで、Coeff_IQ(u、v)(0≦u≦7、0≦v≦7)は、水平方向の周波数uおよび垂直方向の周波数vについての、逆量子化された変換係数を表している。また、C(u)およびC(v)は、以下のように与えられる。 Here, Coeff_IQ (u, v) (0 ≦ u ≦ 7, 0 ≦ v ≦ 7) represents inversely quantized transform coefficients for the horizontal frequency u and the vertical frequency v. C (u) and C (v) are given as follows.
 ・C(u)=1/√2 (u=0)
 ・C(u)=1    (u≠0)
 ・C(v)=1/√2 (v=0)
 ・C(v)=1    (v≠0)
 (加算器14)
 加算器14は、予測画像生成部12から供給された予測画像Predと、逆量子化・逆変換部13から供給された予測残差Dとを加算することによって復号画像Pを生成する。生成された復号画像Pは、フレームメモリ15に格納される。
・ C (u) = 1 / √2 (u = 0)
・ C (u) = 1 (u ≠ 0)
・ C (v) = 1 / √2 (v = 0)
・ C (v) = 1 (v ≠ 0)
(Adder 14)
The adder 14 generates the decoded image P by adding the prediction image Pred supplied from the prediction image generation unit 12 and the prediction residual D supplied from the inverse quantization / inverse conversion unit 13. The generated decoded image P is stored in the frame memory 15.
 (ループフィルタ16)
 ループフィルタ16は、(1)復号画像Pにおけるブロック境界、またはパーティション境界の周辺の画像の平滑化(デブロック処理)を行うデブロッキングフィルタ(DF:Deblocking Filter)としての機能と、(2)デブロッキングフィルタが作用した画像に対して、フィルタパラメータFPを用いて適応フィルタ処理を行う適応フィルタ(ALF:Adaptive Loop Filter)としての機能とを有している。
(Loop filter 16)
The loop filter 16 includes (1) a function as a deblocking filter (DF) that performs smoothing (deblocking processing) on an image around a block boundary or partition boundary in the decoded image P, and (2) a deblocking filter. It has a function as an adaptive filter (ALF: Adaptive Loop Filter) which performs an adaptive filter process using the filter parameter FP with respect to the image which the blocking filter acted on.
 (量子化残差情報復号部111)
 量子化残差情報復号部111は、符号化データ#1に含まれる量子化残差情報QDから、各周波数成分(PosX、PosY)についての量子化された変換係数Coeff(PosX、PosY)を復号するための構成である。ここで、PosXおよびPosYは、周波数領域における各周波数成分の位置を表すインデックスであり、それぞれ、上述した水平方向周波数uおよび垂直方向周波数vに対応するインデックスである。また、量子化残差情報QDに含まれる各種のシンタックスは、コンテキスト適応型2値算術符号化(CABAC:(Context-based Adaptive Binary Arithmetic Coding))によって符号化されている。なお、以下では、量子化された変換係数Coeffを、単に、変換係数Coeffと呼ぶこともある。
(Quantization residual information decoding unit 111)
The quantization residual information decoding unit 111 decodes the quantized transform coefficient Coeff (PosX, PosY) for each frequency component (PosX, PosY) from the quantization residual information QD included in the encoded data # 1. It is the structure for doing. Here, PosX and PosY are indexes representing the position of each frequency component in the frequency domain, and are indexes corresponding to the above-described horizontal frequency u and vertical frequency v, respectively. Various syntaxes included in the quantized residual information QD are encoded by context adaptive binary arithmetic coding (CABAC: (Context-based Adaptive Binary Arithmetic Coding)). Hereinafter, the quantized transform coefficient Coeff may be simply referred to as a transform coefficient Coeff.
 図36は、量子化残差情報復号部111の構成を示すブロック図である。図36に示すように、量子化残差情報復号部111は、コンテキストインデックス割り付け部111a、変換係数復号部111b、コンテキスト変数管理部111c、および、コンテキストインデックス変更部111dを備えている。 FIG. 36 is a block diagram showing a configuration of the quantized residual information decoding unit 111. As shown in FIG. 36, the quantized residual information decoding unit 111 includes a context index allocating unit 111a, a transform coefficient decoding unit 111b, a context variable managing unit 111c, and a context index changing unit 111d.
 (コンテキストインデックス割り付け部111a)
 コンテキストインデックス割り付け部111aは、各周波数成分に対して、該周波数成分の周波数領域における位置に応じて、コンテキストインデックスctxIdxを割り付ける。より具体的には、コンテキストインデックス割り付け部111aは、PosXおよびPosYによって指定される周波数成分に対して、以下の式によって決定されるコンテキストインデックスctxIdxを割り付ける。
(Context index allocation unit 111a)
The context index allocation unit 111a allocates a context index ctxIdx to each frequency component according to the position of the frequency component in the frequency domain. More specifically, the context index assigning unit 111a assigns a context index ctxIdx determined by the following expression to the frequency component specified by PosX and PosY.
  ctdIdx=((PosX>>shift)<<2)+(PosX>>shift)
ここで、記号「>>」は右ビットシフト演算を表しており、記号「<<」は左ビットシフト演算を表している。また、周波数領域が4×4成分である場合、shift=0であり、周波数領域が8×8成分である場合、shift=1である。
ctdIdx = ((PosX >> shift) << 2) + (PosX >> shift)
Here, the symbol “>>” represents a right bit shift operation, and the symbol “<<” represents a left bit shift operation. When the frequency domain is 4 × 4 components, shift = 0, and when the frequency domain is 8 × 8 components, shift = 1.
 図42(a)は、処理対象となる周波数領域が4×4成分である場合に、各周波数成分に対して、コンテキストインデックス割り付け部111aによって割り付けられたコンテキストインデックスctxIdxの例を示す図である。また、図42(b)は、処理対象となる周波数領域が8×8成分である場合に、各周波数成分に対して、コンテキストインデックス割り付け部111aによって割り付けられたコンテキストインデックスctxIdxの例を示す図である。 FIG. 42 (a) is a diagram showing an example of the context index ctxIdx assigned by the context index assigning unit 111a to each frequency component when the frequency region to be processed is 4 × 4 components. FIG. 42B is a diagram illustrating an example of the context index ctxIdx allocated by the context index allocation unit 111a for each frequency component when the frequency region to be processed is an 8 × 8 component. is there.
 図42(a)に示すように、周波数領域が4×4成分である場合には、各周波数成分についてコンテキストインデックスctxIdxが個別に割り付けられる。一方で、図42(b)に示すように、周波数領域が8×8成分である場合には、隣接する2×2成分毎に、コンテキストインデックスctxIdxが割り付けられる。例えば、図42(b)に示すコンテキストインデックスctxIdx=0は、周波数成分(0、0)、(0、1)、(1、0)、(1、1)に対して割り付けられる。 As shown in FIG. 42 (a), when the frequency domain is 4 × 4 components, the context index ctxIdx is individually assigned to each frequency component. On the other hand, as shown in FIG. 42 (b), when the frequency domain is 8 × 8 components, the context index ctxIdx is assigned to each adjacent 2 × 2 component. For example, the context index ctxIdx = 0 shown in FIG. 42B is assigned to the frequency components (0, 0), (0, 1), (1, 0), (1, 1).
 なお、図42(a)~(b)に例示したコンテキストインデックスctxIdxは、後述する各種のシンタックスsig_flag、last_flag、abs_greater_one、coeff_abs_level、およびsignの何れを復号する際に用いられるものであってもよい(他の図面にて例示するコンテキストインデックスについても同様)。ただし、コンテキストインデックス割り付け部111aによって割り付けられる具体的なコンテキストインデックスは、復号対象のシンタックスの種類によって異なり得る。したがって、コンテキストインデックス割り付け部111aは、対象周波数領域における各シンタックスに対して、該シンタックスの種類および該シンタックスの該対象周波数領域における位置に応じて定まるコンテキストインデックスを割り付けるものであると表現することができる。 Note that the context index ctxIdx illustrated in FIGS. 42A to 42B may be used when decoding any one of various syntaxes sig_flag, last_flag, abs_greater_one, coeff_abs_level, and sign described later. (The same applies to context indexes exemplified in other drawings). However, the specific context index allocated by the context index allocation unit 111a may differ depending on the type of syntax to be decoded. Therefore, the context index allocation unit 111a expresses that each syntax in the target frequency domain is allocated with a context index determined according to the type of syntax and the position of the syntax in the target frequency domain. be able to.
 また、図42(a)~(b)に例示した各周波数成分についてのコンテキストインデックスctxIdxは、処理対象の周波数領域毎に設定されるコンテキストインデックスのオフセットからの増分値であってもよい(他の図面にて例示するコンテキストインデックスについても同様)。例えば、処理対象の周波数領域に対して設定されるコンテキストインデックスのオフセットが200である場合、図42(a)における周波数成分(1、0)に対して、ctxIdx=201が割り付けられることになる。他の周波数成分についても同様である。 Also, the context index ctxIdx for each frequency component illustrated in FIGS. 42A to 42B may be an increment value from the offset of the context index set for each frequency region to be processed (others) The same applies to the context index illustrated in the drawing). For example, when the context index offset set for the frequency region to be processed is 200, ctxIdx = 201 is assigned to the frequency component (1, 0) in FIG. The same applies to other frequency components.
 (変換係数復号部111b)
 変換係数復号部111bは、処理対象の周波数成分である対象周波数成分に割り付けられたコンテキストインデックスctxIdxを参照し、対象周波数成分についての各種のシンタックスsig_flag、last_flag、abs_greater_one、coeff_abs_level、およびsignを復号する。また、復号された上記のシンタックスから、各周波数成分についての変換係数Coeff(PosX、PosY)を生成する。
(Transform coefficient decoding unit 111b)
The transform coefficient decoding unit 111b refers to the context index ctxIdx assigned to the target frequency component that is the frequency component to be processed, and decodes various syntaxes sig_flag, last_flag, abs_greater_one, coeff_abs_level, and sign for the target frequency component . Also, transform coefficients Coeff (PosX, PosY) for each frequency component are generated from the decoded syntax.
 また、変換係数復号部111bは、復号されたシンタックスsig_flag(PosX,PosY)をコンテキストインデックス変更部111dに供給する。 Also, the transform coefficient decoding unit 111b supplies the decoded syntax sig_flag (PosX, PosY) to the context index changing unit 111d.
 (各種シンタックスの復号処理)
 変換係数復号部111bによる各種のシンタックスsig_flag、last_flag、abs_greater_one、coeff_abs_level、およびsignの復号処理について説明する。変換係数復号部111bは、復号対象の各シンタックスについて、2値算術符号復号処理、及び、多値化処理を行うことによって、シンタックス毎の多値データを生成する。
(Decoding process of various syntaxes)
Decoding processing of various syntaxes sig_flag, last_flag, abs_greater_one, coeff_abs_level, and sign by the transform coefficient decoding unit 111b will be described. The transform coefficient decoding unit 111b generates multi-value data for each syntax by performing binary arithmetic code decoding processing and multi-value processing for each syntax to be decoded.
 2値算術符号復号処理とは、量子化残差情報QDに含まれる復号対象のシンタックスについての符号化データを、2値データに復号する処理のことである。変換係数復号部111bは、シンボル(2値データの1ビット、Binとも呼ぶ)を1つ復号する際、処理対象の周波数領域(PosX、PosY)に割り付けられたコンテキストインデックスctxIdxを導出する。次に当該コンテキストインデックスctxIdxによって指定されるコンテキスト変数CVを、コンテキスト変数管理部111cから取得する。ここで、コンテキスト変数CVには、(1)発生確率が高い優勢シンボルMPS(most probable symbol)と、(2)その優勢シンボルMPSの発生確率を指定する確率状態インデックスpStateIdxとが含まれている。変換係数復号部111bは、取得したコンテキスト変数CVに含まれる確率状態インデックスpStateIdxによって指定される発生確率に応じた算術復号を行うことによって、復号対象のシンタックスについての符号化データを2値データに復号する。なお、優勢シンボルMPSは0か1である。また、優勢シンボルMPSと確率状態インデックスpStateIdxは、シンボルを1つ復号する毎に、コンテキスト変数管理部111cにて更新される。 The binary arithmetic code decoding process is a process of decoding encoded data regarding the syntax to be decoded included in the quantized residual information QD into binary data. When transforming one symbol (1 bit of binary data, also referred to as Bin), the transform coefficient decoding unit 111b derives a context index ctxIdx assigned to the frequency domain (PosX, PosY) to be processed. Next, the context variable CV specified by the context index ctxIdx is acquired from the context variable management unit 111c. Here, the context variable CV includes (1) a dominant symbol MPS (most probable symbol) having a high occurrence probability, and (2) a probability state index pStateIdx for designating the occurrence probability of the dominant symbol MPS. The transform coefficient decoding unit 111b performs the arithmetic decoding according to the occurrence probability specified by the probability state index pStateIdx included in the acquired context variable CV, thereby converting the encoded data about the syntax to be decoded into binary data. Decrypt. The dominant symbol MPS is 0 or 1. The dominant symbol MPS and the probability state index pStateIdx are updated by the context variable management unit 111c every time one symbol is decoded.
 多値化処理とは、2値算術符号復号処理によって復号された2値データを多値データに変換する処理のことである。各シンタックスについて多値化処理を行うことによって、各シンタックスについての多値データが生成される。 The multi-value process is a process for converting binary data decoded by the binary arithmetic code decoding process into multi-value data. By performing multi-value processing for each syntax, multi-value data for each syntax is generated.
 変換係数復号部111bは、後述するスキャン順序に従って、処理対象の周波数成分(PosX、PosY)についての各種シンタックスの2値算術符号復号処理および多値化処理を行うと共に、多値化処理によって生成された各種シンタックスについての多値データから、変換係数Coeff(PosX、PosY)を生成する。 The transform coefficient decoding unit 111b performs binary arithmetic code decoding processing and multi-value processing of various syntaxes on the frequency components (PosX, PosY) to be processed in accordance with the scan order described later, and is generated by multi-value processing. Conversion coefficients Coeff (PosX, PosY) are generated from the multivalued data for the various syntaxes.
 (変換係数復号部111bによる各周波数成分のスキャン順序)
 変換係数復号部111bによる各周波数成分のスキャンは、ジグザグスキャン、および、適応的スキャンの何れかによって行われる。以下では、各スキャンについて図43~図44を参照して説明する。
(Scanning order of frequency components by transform coefficient decoding unit 111b)
The scan of each frequency component by the transform coefficient decoding unit 111b is performed by either a zigzag scan or an adaptive scan. Hereinafter, each scan will be described with reference to FIGS. 43 to 44. FIG.
 図43(a)は、各スキャンにおけるスキャンラインを説明するための図である。ジグザグスキャン、および、適応的スキャンの何れの場合であっても、各周波数成分のスキャンは、図43(a)において破線で示した各スキャンラインに沿って行われる。各スキャンラインは、PosX+PosY=Lによって特徴付けることができる。以下では、PosX+PosY=Lを満たすスキャンラインをスキャンライン(L)とも表記する。例えば、スキャンライン(2)は、PosX+PosY=2を満たす周波数成分(2、0)、(1、1)、(0、2)についてのスキャンである。 FIG. 43 (a) is a diagram for explaining a scan line in each scan. In both cases of zigzag scanning and adaptive scanning, scanning of each frequency component is performed along each scanning line indicated by a broken line in FIG. Each scan line can be characterized by PosX + PosY = L. Hereinafter, a scan line that satisfies PosX + PosY = L is also referred to as a scan line (L). For example, scan line (2) is a scan for frequency components (2, 0), (1, 1), (0, 2) that satisfy PosX + PosY = 2.
 なお、ジグザグスキャン、および、適応的スキャンの何れの場合であっても、スキャンライン(L)に沿ってスキャンが行われた後、スキャンライン(L+1)に沿ってスキャンが行われる。 In either case of the zigzag scan and the adaptive scan, the scan is performed along the scan line (L + 1) after the scan is performed along the scan line (L).
 また、図43(a)においてスキャンライン(0)に沿った周波数成分は(0、0)のみであるため、スキャン方向に依らずに周波数成分(0、0)がスキャンされる。スキャンライン(14)についても同様である。 Further, in FIG. 43A, since the frequency component along the scan line (0) is only (0, 0), the frequency component (0, 0) is scanned regardless of the scan direction. The same applies to the scan line (14).
 (1)ジグザグスキャン
 図43(b)は、ジグザグスキャンによる各周波数成分のスキャン順を示す図である。図43(b)に示すように、ジグザグスキャンでは、低周波数側から高周波数側へ、左下方向(BottomLeft、または、DownLeftとも呼ぶ)へのスキャンと、右上方向(TopRight、または、UpRightとも呼ぶ)へのスキャンとを交互に繰り返すことによって各周波数成分についてのスキャンが行われる。すなわち、スキャンライン(L)とスキャンライン(L+1)とでは、スキャンの方向が逆になる。図43(b)において、各周波数成分に付された番号は、ジグザグスキャンにおける各周波数成分のスキャン順を表している。
(1) Zigzag Scan FIG. 43B is a diagram showing the scan order of each frequency component by the zigzag scan. As shown in FIG. 43 (b), in the zigzag scan, from the low frequency side to the high frequency side, the scan to the lower left direction (also referred to as BottomLeft or DownLeft) and the upper right direction (also referred to as TopRight or UpRight) The scanning for each frequency component is performed by alternately repeating the scanning to the above. That is, the scan direction is reversed between the scan line (L) and the scan line (L + 1). In FIG. 43B, the numbers assigned to the frequency components represent the scan order of the frequency components in the zigzag scan.
 (2)適応的スキャン
 一方で、適応的スキャンにおいては、復号済みの変換係数において、非0の変換係数の出現度数の偏りに応じて、復号対象の各周波数成分についてのスキャン順序が決定される。より具体的には、スキャンライン(0)からスキャンライン(L)までに復号された非0の変換係数の出現度数の偏りに応じてスキャンライン(L+1)におけるスキャン方向が決定される。図43(c)は、適応的スキャンのスキャン順の例を示している。
(2) Adaptive Scan On the other hand, in the adaptive scan, in the decoded transform coefficient, the scan order for each frequency component to be decoded is determined according to the bias of the appearance frequency of the non-zero transform coefficient. . More specifically, the scan direction in the scan line (L + 1) is determined according to the bias in the appearance frequency of non-zero transform coefficients decoded from the scan line (0) to the scan line (L). FIG. 43C shows an example of the scan order of the adaptive scan.
 図44は、変換係数復号部111bにより行われる適応的スキャンの処理の流れを示すフローチャートである。 FIG. 44 is a flowchart showing a flow of adaptive scan processing performed by the transform coefficient decoding unit 111b.
 (ステップS101)
 まず、変換係数復号部111bは、スキャン方向scanDirectionをBottomLeft(左下方向)に設定することによって、スキャン方向の初期化を行う。なお、本ステップにて初期化されたスキャン方向scanDirectionは、スキャンライン(1)に対して適用される。
(Step S101)
First, the transform coefficient decoding unit 111b initializes the scan direction by setting the scan direction scanDirection to BottomLeft (lower left direction). Note that the scan direction scanDirection initialized in this step is applied to the scan line (1).
 (ステップS102)
 続いて、変換係数復号部111bは、処理対象のスキャンライン(L)に沿って、変数PosXおよびPosYを設定する。ここで、Lの値は、L=0を初期値として順次更新される。
(Step S102)
Subsequently, the transform coefficient decoding unit 111b sets variables PosX and PosY along the scan line (L) to be processed. Here, the value of L is sequentially updated with L = 0 as an initial value.
 (ステップS103)
 続いて、変換係数復号部111bは、ステップS102にて設定されたPosXおよびPosYによって指定される周波数成分についてのシンタックスsig_flagを復号する。
(Step S103)
Subsequently, the transform coefficient decoding unit 111b decodes the syntax sig_flag for the frequency component specified by PosX and PosY set in step S102.
 (ステップS104)
 続いて、変換係数復号部111bは、ステップS103にて復号されたシンタックスsig_flagの値が非0であるか否かを判定する。
(Step S104)
Subsequently, the transform coefficient decoding unit 111b determines whether or not the value of the syntax sig_flag decoded in step S103 is non-zero.
 (ステップS105)
 シンタックスsig_flagの値が非0である場合(ステップS104でYes)、可変長符号復号部11は、PosX>PosYであるか否かを判定する。
(Step S105)
When the value of the syntax sig_flag is non-zero (Yes in Step S104), the variable length code decoding unit 11 determines whether PosX> PosY.
 (ステップS106)
 PosX>PosYである場合(ステップS105でYes)、変換係数復号部111bは、変数scanTopRightに1を加算する。ここで、変数scanTopRightは、PosX>PosYを満たす周波数成分について非0の変換係数の出現度数を表す変数である。図45(a)の斜線部は、変数scanTopRightをカウントする領域を示している。
(Step S106)
If PosX> PosY (Yes in step S105), the transform coefficient decoding unit 111b adds 1 to the variable scanTopRight. Here, the variable scanTopRight is a variable representing the frequency of appearance of non-zero transform coefficients for frequency components satisfying PosX> PosY. The shaded area in FIG. 45A indicates an area for counting the variable scanTopRight.
 (ステップS107)
 PosX>PosYでない場合(ステップS105でNo)、変換係数復号部111bは、PosY>PosXであるか否かを判定する。
(Step S107)
If PosX> PosY is not satisfied (No in step S105), the transform coefficient decoding unit 111b determines whether PosY> PosX.
 (ステップS108)
 PosY>PosXである場合(ステップS107でYes)、変換係数復号部111bは、変数scanBottomLeftに1を加算する。ここで、変数scanBottomLeftは、PosX<PosYを満たす周波数成分について非0の変換係数の出現度数を表す変数である。図45(b)の斜線部は、変数scanBottomLeftをカウントする領域を示している。
(Step S108)
If PosY> PosX (Yes in step S107), the transform coefficient decoding unit 111b adds 1 to the variable scanBottomLeft. Here, the variable scanBottomLeft is a variable representing the frequency of occurrence of non-zero conversion coefficients for frequency components satisfying PosX <PosY. The shaded area in FIG. 45 (b) indicates an area where the variable scanBottomLeft is counted.
 (ステップS109)
 続いて、変換係数復号部111bは、復号対象の周波数成分について、シンタックスlast_flagを復号する。
(Step S109)
Subsequently, the transform coefficient decoding unit 111b decodes the syntax last_flag for the frequency component to be decoded.
 (ステップS110)
 続いて、変換係数復号部111bは、ステップS109にて復号されたシンタックスlast_flagの値が1であるか否かを判定する。シンタックスlast_flagの値が1である場合には処理を終了する。
(Step S110)
Subsequently, the transform coefficient decoding unit 111b determines whether or not the value of the syntax last_flag decoded in step S109 is 1. If the value of the syntax last_flag is 1, the process ends.
 (ステップS111)
 シンタックスsig_flagの値が非0でない場合(すなわち、シンタックスsig_flagの値が0である場合)(ステップS104でNo)、または、シンタックスlast_flagの値が1でない場合(ステップS110でNo)、変換係数復号部111bは、対象周波数成分についてのPosXおよびPosYが、周波数領域における折り返し位置に対応するか否かを判定する。ここで、対象周波数成分が折り返し位置であるとは以下の条件が満たされる場合を指す。
(Step S111)
When the value of syntax sig_flag is not non-zero (that is, when the value of syntax sig_flag is 0) (No in step S104), or when the value of syntax last_flag is not 1 (No in step S110), conversion The coefficient decoding unit 111b determines whether PosX and PosY for the target frequency component correspond to the folding position in the frequency domain. Here, that the target frequency component is the turn-back position indicates a case where the following condition is satisfied.
  ・スキャン方向scanDirection=DownLeftのとき:
   PosX=0であるか、またはPosY=Height-1である場合
  ・スキャン方向scanDirection=UpDownLeftのとき:
   PosY=0であるか、またはPosX=Width-1である場合
ここで、「Height」とは、周波数領域における垂直方向周波数の成分数を表しており、「Width」とは、周波数領域における水平方向周波数の成分数を表している。例えば、図39(a)に示したように、周波数領域が8×8成分から構成されている場合、Height=8であり、Width=8である。
-When scan direction scanDirection = DownLeft:
When PosX = 0 or PosY = Height−1 When the scan direction scanDirection = UpDownLeft:
When PosY = 0 or PosX = Width−1 Here, “Height” represents the number of vertical frequency components in the frequency domain, and “Width” represents the horizontal direction in the frequency domain. It represents the number of frequency components. For example, as shown in FIG. 39A, when the frequency domain is composed of 8 × 8 components, Height = 8 and Width = 8.
 対象周波数成分についてのPosXおよびPosYが、周波数領域における折り返し位置に対応しない場合(本ステップでNo)、ステップS102に戻り、既に設定されているスキャン方向scanDirectionに沿って処理順で次の周波数成分についてPosXおよびPosYが設定される。 If PosX and PosY for the target frequency component do not correspond to the return position in the frequency domain (No in this step), the process returns to step S102, and the next frequency component in the processing order along the already set scan direction scanDirection PosX and PosY are set.
 (ステップS112)
 対象周波数成分についてのPosXおよびPosYが、周波数領域における折り返し位置に対応する場合(ステップS111でYes)、変換係数復号部111bは、scanTopRight≧scanBottomLeftであるか否かを判定する。
(Step S112)
When PosX and PosY for the target frequency component correspond to the return position in the frequency domain (Yes in step S111), the transform coefficient decoding unit 111b determines whether scanTopRight ≧ scanBottomLeft.
 (ステップS113)
 scanTopRight≧scanBottomLeftである場合(ステップS112でYes)、処理順で次のスキャンラインについてのスキャン方向scanDirectionをBottomLeftに設定する。なお、処理順で次のスキャンラインについてのスキャン方向scanDirectionがBottomLeftに設定された後、ステップS102に戻り、当該処理順で次のスキャンラインに沿って、かつ、スキャン方向をBottomLeftとして、PosXおよびPosYが設定される。
(Step S113)
If scanTopRight ≧ scanBottomLeft (Yes in step S112), the scan direction scanDirection for the next scan line in the processing order is set to BottomLeft. After the scan direction scanDirection for the next scan line in the processing order is set to BottomLeft, the process returns to step S102, and along the next scan line in the processing order and the scan direction is BottomLeft, PosX and PosY Is set.
 (ステップS114)
 scanTopRight≧scanBottomLeftでない場合(ステップS112でNo)、処理順で次のスキャンラインについてのスキャン方向scanDirectionをTopRightに設定する。なお、処理順で次のスキャンラインについてのスキャン方向scanDirectionがTopRightに設定された後、ステップS102に戻り、当該処理順で次のスキャンラインに沿って、かつ、スキャン方向をTopRightとして、PosXおよびPosYが設定される。
(Step S114)
If scanTopRight ≧ scanBottomLeft is not satisfied (No in step S112), the scan direction scanDirection for the next scan line in the processing order is set to TopRight. After the scan direction scanDirection for the next scan line in the processing order is set to TopRight, the process returns to step S102, and along the next scan line in the processing order and with the scan direction as TopRight, PosX and PosY Is set.
 なお、上記の説明では、スキャンライン(0)からスキャンライン(L)までに復号された非0の変換係数の出現度数の偏りに応じてスキャンライン(L+1)におけるスキャン方向が決定される場合を例に挙げたが、本実施形態はこれに限定されるものではなく、スキャンライン(L)に沿って復号された非0の変換係数の出現度数の偏りに応じてスキャンライン(L+1)におけるスキャン方向が決定される構成としてもよい。すなわち、スキャンライン毎に、scanTopRightおよびscanBottomLeftを初期化する構成としてもよい。 In the above description, the case where the scan direction in the scan line (L + 1) is determined according to the bias in the appearance frequency of the non-zero transform coefficients decoded from the scan line (0) to the scan line (L). As an example, the present embodiment is not limited to this. The scan in the scan line (L + 1) according to the bias of the appearance frequency of non-zero transform coefficients decoded along the scan line (L). The direction may be determined. That is, the scanTopRight and scanBottomLeft may be initialized for each scan line.
 (コンテキスト変数管理部111c)
 コンテキスト変数管理部111cは、各コンテキストに対応したコンテキスト変数CVを管理する。各コンテキスト変数CVは、コンテキスト変数管理部111cの備えるメモリに格納されている。各コンテキスト変数CVは、(1)発生確率が高い優勢シンボルMPS(most probable symbol)と、(2)その優勢シンボルMPSの発生確率を指定する確率状態インデックスpStateIdxとを含んでいる。また、各コンテキスト変数CVは、コンテキストインデックスctxIdxによって特定される。コンテキストインデックスctxIdxによって指定されるコンテキスト変数CVをCV(ctxIdx)とも表記する。
(Context variable manager 111c)
The context variable management unit 111c manages the context variable CV corresponding to each context. Each context variable CV is stored in a memory provided in the context variable management unit 111c. Each context variable CV includes (1) a dominant symbol MPS (most probable symbol) having a high occurrence probability, and (2) a probability state index pStateIdx designating the occurrence probability of the dominant symbol MPS. Each context variable CV is specified by a context index ctxIdx. The context variable CV specified by the context index ctxIdx is also expressed as CV (ctxIdx).
 コンテキスト変数管理部111cは、変換係数復号部111bが1つのシンボルを復号する毎に、確率状態インデックスpStateIdxを更新する。確率状態インデックスpStateIdxの更新により、確率状態インデックスpStateIdxによって指定される発生確率が変化する。 The context variable management unit 111c updates the probability state index pStateIdx every time the transform coefficient decoding unit 111b decodes one symbol. By updating the probability state index pStateIdx, the occurrence probability specified by the probability state index pStateIdx changes.
 算術符号では、シンボルの発生確率に従って復号を行う。一般に、あるシンタックス要素のシンボルが1である場合には、次に復号されるシンボルも1である確率が高いことを利用して、シンボルを復号する毎に、復号した値の発生確率(確率状態インデックスpStateIdx)を高めるように適応的に更新を行う。また、低周波数成分のシンボルの発生確率と、高周波数成分のシンボルの発生確率とが異なるため、周波数成分毎に用いるコンテキスト(確率状態インデックスpStateIdx)を切り替える。このようにして、周波数成分などの条件で発生確率が異なるという条件付き確率を利用する。 In arithmetic codes, decoding is performed according to the probability of symbol occurrence. In general, when the symbol of a certain syntax element is 1, the probability that the next decoded symbol is 1 is also high, and the probability of occurrence of the decoded value (probability) Updates adaptively to increase the state index (pStateIdx). Further, since the occurrence probability of low frequency component symbols and the occurrence probability of high frequency component symbols are different, the context (probability state index pStateIdx) used for each frequency component is switched. In this way, the conditional probability that the occurrence probability differs depending on the condition such as the frequency component is used.
 (コンテキストインデックス変更部111d)
 コンテキストインデックス変更部111dは、変換係数復号部111bから供給されるシンタックスsig_flag(PosX,PosY)を参照し、周波数領域における非0の変換係数の分布の偏りを判定し、判定結果に応じて、周波数領域における未復号成分に割り付けられるコンテキストインデックスを変更する。
(Context index change unit 111d)
The context index changing unit 111d refers to the syntax sig_flag (PosX, PosY) supplied from the transform coefficient decoding unit 111b, determines the non-uniform distribution of transform coefficients in the frequency domain, and according to the determination result, A context index assigned to an undecoded component in the frequency domain is changed.
 (コンテキストインデックス変更処理例1)
 以下では、コンテキストインデックス変更部111dによるコンテキストインデックス変更処理の第1の具体例について説明する。
(Context index change processing example 1)
Below, the 1st specific example of the context index change process by the context index change part 111d is demonstrated.
 本処理例では、コンテキストインデックス変更部111dは、低周波数側の周波数成分についてのシンタックスsig_flagが所定の個数復号された段階で、それら復号済のシンタックスsig_flagを参照し、周波数領域における非0の変換係数の分布の偏りを判定する。また、未復号成分について割り付けられるコンテキストインデックスを、判定結果に応じて変更する。 In this processing example, the context index changing unit 111d refers to the decoded syntax sig_flag at a stage where a predetermined number of syntaxes sig_flag for frequency components on the low frequency side are decoded, and sets non-zero in the frequency domain. The bias of the distribution of the conversion coefficient is determined. Further, the context index assigned to the undecoded component is changed according to the determination result.
 処理対象の周波数領域が8×8成分である場合、コンテキストインデックス変更部111dは、例えば、図46(a)において斜線を付した成分について変換係数復号部111bより供給されるシンタックスsig_flag、すなわち、周波数成分(0、0)、(0、1)、(0、2)、(1、0)、(1、1)、(2、0)についてのシンタックスsig_flagを参照して、それらの周波数成分についての非0の変換係数の分布の偏りを判定する。換言すれば、コンテキストインデックス変更部111dは、スキャンライン(0)~スキャンライン(2)に沿った周波数成分についてのシンタックスsig_flagを参照して、それらの周波数成分についての非0の変換係数の分布の偏りを判定する。 When the frequency domain to be processed is an 8 × 8 component, the context index changing unit 111d, for example, the syntax sig_flag supplied from the transform coefficient decoding unit 111b for the hatched component in FIG. Refer to the syntax sig_flag for frequency components (0, 0), (0, 1), (0, 2), (1, 0), (1, 1), (2, 0), and their frequencies The distribution bias of the non-zero transform coefficient for the component is determined. In other words, the context index changing unit 111d refers to the syntax sig_flag for the frequency components along the scan line (0) to the scan line (2), and distributes non-zero transform coefficients for those frequency components. Judge the bias.
 図47は、本処理例におけるコンテキストインデックス変更部111dの具体的な処理の流れを示すフローチャートである。 FIG. 47 is a flowchart showing a specific processing flow of the context index changing unit 111d in this processing example.
 (ステップS201)
 コンテキストインデックス変更部111dは、まず、変数PosXおよびPosYを設定する。ここで、変数PosXおよびPosYは、処理対象の周波数領域の低周波数側から所定のスキャン順(上述したジグザグスキャン、または、適応的スキャン)に従って順次設定される。
(Step S201)
The context index changing unit 111d first sets variables PosX and PosY. Here, the variables PosX and PosY are sequentially set according to a predetermined scan order (the above-described zigzag scan or adaptive scan) from the low frequency side of the frequency region to be processed.
 (ステップS202)
 続いて、コンテキストインデックス変更部111dは、PosXおよびPosYによって指定される周波数成分についてのシンタックスsig_flagの値が非0であるか否かを判定する。本ステップにて判定の対象となるシンタックスsig_flagは、変換係数復号部111bより供給される。
(Step S202)
Subsequently, the context index changing unit 111d determines whether or not the value of the syntax sig_flag for the frequency component specified by PosX and PosY is non-zero. The syntax sig_flag to be determined in this step is supplied from the transform coefficient decoding unit 111b.
 (ステップS203)
 シンタックスsig_flagの値が非0である場合(ステップS104でYes)、コンテキストインデックス変更部111dは、PosX>PosYであるか否かを判定する。
(Step S203)
When the value of the syntax sig_flag is non-zero (Yes in step S104), the context index changing unit 111d determines whether PosX> PosY.
 (ステップS204)
 PosX>PosYである場合(ステップS203でYes)、コンテキストインデックス変更部111dは、変数coeffTopRightに1を加算し、ステップS207の処理へ進む。ここで、変数coeffTopRightは、PosX>PosYを満たす周波数成分について非0の変換係数の出現度数を表す変数である。
(Step S204)
If PosX> PosY (Yes in step S203), the context index changing unit 111d adds 1 to the variable coeffTopRight and proceeds to the process of step S207. Here, the variable coeffTopRight is a variable representing the frequency of appearance of non-zero transform coefficients for frequency components satisfying PosX> PosY.
 (ステップS205)
 PosX>PosYでない場合(ステップS203でNo)、コンテキストインデックス変更部111dは、PosY>PosXであるか否かを判定する。PosY>PosXでない場合、ステップS207の処理へ進む。
(Step S205)
If PosX> PosY is not satisfied (No in step S203), the context index changing unit 111d determines whether PosY> PosX. If PosY> PosX, the process proceeds to step S207.
 (ステップS206)
 PosY>PosXである場合(ステップS205でYes)、コンテキストインデックス変更部111dは、変数coeffBottomLeftに1を加算し、ステップS207の処理へ進む。ここで、変数coeffBottomLeftは、PosX<PosYを満たす周波数成分について非0の変換係数の出現度数を表す変数である。
(Step S206)
If PosY> PosX (Yes in step S205), the context index changing unit 111d adds 1 to the variable coeffBottomLeft and proceeds to the process of step S207. Here, the variable coeffBottomLeft is a variable representing the frequency of occurrence of non-zero transform coefficients for frequency components satisfying PosX <PosY.
 (ステップS207)
 続いて、コンテキストインデックス変更部111dは、所定の個数の成分についての処理が完了したか否かを判定する。ここで、所定の個数は、例えば、処理対象の周波数領域が8×8成分である場合、図46(a)に示したように6としてもよいし、10としてもよい。所定の個数の成分についての処理が完了していない場合には、ステップS201に戻り、処理順で次の成分についてのPosXおよびPosYを設定する。
(Step S207)
Subsequently, the context index changing unit 111d determines whether or not processing for a predetermined number of components has been completed. Here, for example, when the frequency region to be processed is an 8 × 8 component, the predetermined number may be 6 or 10 as shown in FIG. If the processing for the predetermined number of components has not been completed, the process returns to step S201, and PosX and PosY for the next component are set in the processing order.
 (ステップS208)
 所定の個数の成分についての処理が完了した場合(ステップS207でYes)、コンテキストインデックス変更部111dは、coeffBottomLeft>coeffTopRightであるか否かを判定する。coeffBottomLeft≦coeffTopRightである場合、コンテキストインデックスを変更することなく、処理を終了する。すなわち、PosX>PosYを満たす領域における非0の変換係数の個数が、PosY>PosXを満たす領域における非0の変換係数の個数以上である場合には、コンテキストインデックスを変更することなく、処理を終了する。
(Step S208)
When the processing for the predetermined number of components is completed (Yes in step S207), the context index changing unit 111d determines whether coeffBottomLeft> coeffTopRight. If coeffBottomLeft ≦ coeffTopRight, the process ends without changing the context index. In other words, if the number of non-zero transform coefficients in the region satisfying PosX> PosY is equal to or greater than the number of non-zero transform coefficients in the region satisfying PosY> PosX, the process is terminated without changing the context index. To do.
 図46(b)は、コンテキストインデックス割り付け部111aによって割り付けられたコンテキストインデックスであって、変更されていないコンテキストインデックスの例を、処理対象の周波数領域が8×8成分である場合に示す図である。 FIG. 46B is a diagram illustrating an example of a context index that has been allocated by the context index allocation unit 111a and has not been changed when the frequency domain to be processed is an 8 × 8 component. .
 (ステップS209)
 coeffBottomLeft>coeffTopRightである場合(ステップS208でYes)、コンテキストインデックス変更部111dは、周波数領域における未復号の成分についてのコンテキストインデックスctxIdxを変更する。すなわち、PosY>PosXを満たす領域における非0の変換係数の個数が、PosX>PosYを満たす領域における非0の変換係数の個数より大きい場合には、周波数領域における未復号の成分についてのコンテキストインデックスctxIdxを変更する。
(Step S209)
When coeffBottomLeft> coeffTopRight (Yes in step S208), the context index changing unit 111d changes the context index ctxIdx for the undecoded component in the frequency domain. That is, when the number of non-zero transform coefficients in a region satisfying PosY> PosX is larger than the number of non-zero transform coefficients in a region satisfying PosX> PosY, the context index ctxIdx for an undecoded component in the frequency domain To change.
 図46(c)は、本ステップにて変更されたコンテキストインデックスの例を、処理対象の周波数領域が8×8成分である場合に示す図である。図46(c)に示すように、コンテキストインデックス割り付け部111aによって各周波数成分に割り付けられたコンテキストインデックスは、本ステップにて、PosX=PosYを満たす対角線を対称軸として線対称変換される。すなわち、コンテキストインデックス割り付け部111aによって周波数成分(PosX、PosY)に対して割り付けられたコンテキストインデックスctxIdx(PosX、PosY)は、本ステップにてctxIdx(PosY、PosX)に変更される。換言すれば、周波数成分(PosX、PosY)についてのコンテキストインデックスであって、本ステップにて変更後のコンテキストインデックスをctxIdx’(PosX、PosY)と表すことにすると、
  ctxIdx’(PosX、PosY)=ctxIdx(PosY、PosX)
が満たされる。
FIG. 46C is a diagram illustrating an example of the context index changed in this step when the frequency domain to be processed is an 8 × 8 component. As shown in FIG. 46 (c), the context index assigned to each frequency component by the context index assigning unit 111a is subjected to line symmetry conversion with a diagonal line satisfying PosX = PosY as a symmetry axis in this step. That is, the context index ctxIdx (PosX, PosY) allocated to the frequency components (PosX, PosY) by the context index allocation unit 111a is changed to ctxIdx (PosY, PosX) in this step. In other words, if the context index for the frequency component (PosX, PosY) and changed in this step is represented as ctxIdx ′ (PosX, PosY),
ctxIdx ′ (PosX, PosY) = ctxIdx (PosY, PosX)
Is satisfied.
 なお、上記の説明では、coeffBottomLeft>coeffTopRightの場合に、コンテキストインデックスctxIdxの変更を行っているが、その逆の構成、すなわちcoeffBottomLeft<coeffTopRightの場合にコンテキストインデックスctxIdxの変更を行い、それ以外の場合に変更を行わない構成としても構わない。 In the above description, the context index ctxIdx is changed when coeffBottomLeft> coeffTopRight, but the opposite configuration, that is, the context index ctxIdx is changed when coeffBottomLeft <coeffTopRight, and otherwise. A configuration in which no change is made may be used.
 図48は、本処理例の動作を行うコンテキストインデックス変更部111dと、変換係数復号部111bとの連携動作の一例を示すシーケンス図である。 FIG. 48 is a sequence diagram illustrating an example of a cooperative operation between the context index changing unit 111d that performs the operation of this processing example and the transform coefficient decoding unit 111b.
 (ステップS301)
 変換係数復号部111bは、スキャンライン(0)~スキャンライン(2)に沿って変換係数の復号を行う。また、それらのスキャンラインに沿った各周波数成分についての復号済みのシンタックスsig_flagを、コンテキストインデックス変更部111dに供給する。図48において、スキャンライン(0)~スキャンライン(2)に沿った各周波数成分についての復号済みのシンタックスsig_flagの集合をsig_flag(0)~(2)と表記している。
(Step S301)
The transform coefficient decoding unit 111b decodes transform coefficients along the scan line (0) to the scan line (2). Further, the decoded syntax sig_flag for each frequency component along those scan lines is supplied to the context index changing unit 111d. In FIG. 48, a set of decoded syntax sig_flag for each frequency component along the scan line (0) to the scan line (2) is expressed as sig_flag (0) to (2).
 (ステップS302)
 コンテキストインデックス変更部111dは、変換係数復号部111bから供給される復号済みのシンタックスsig_flagの値を参照し、スキャンライン(0)~スキャンライン(2)に沿った周波数成分についての非0の変換係数の分布の偏りを判定する。
(Step S302)
The context index changing unit 111d refers to the value of the decoded syntax sig_flag supplied from the transform coefficient decoding unit 111b, and performs non-zero conversion on frequency components along the scan line (0) to the scan line (2). Judge the distribution of coefficients.
 (ステップS303)
 続いて、コンテキストインデックス変更部111dは、スキャンライン(0)~スキャンライン(2)に沿った周波数成分についての非0の変換係数の分布の偏りに応じて、未復号の周波数成分についてのコンテキストインデックスを変更する。また、変更後のコンテキストインデックスctxIdx'を変換係数復号部111bに供給する。
(Step S303)
Subsequently, the context index changing unit 111d determines the context index for the undecoded frequency component in accordance with the non-zero transform coefficient distribution bias for the frequency component along the scan line (0) to the scan line (2). To change. Also, the changed context index ctxIdx ′ is supplied to the transform coefficient decoding unit 111b.
 (ステップS304)
 変換係数復号部111bは、コンテキストインデックス変更部111dより供給される変更後のコンテキストインデックスctxIdx'を用いて、未復号の周波数成分についての変換係数を復号する。
(Step S304)
The transform coefficient decoding unit 111b decodes transform coefficients for undecoded frequency components using the changed context index ctxIdx ′ supplied from the context index changing unit 111d.
 一般に、一部の周波数成分を復号した時点で、非0の変換係数の出現に偏りがある場合には、残りの周波数成分を復号する場合にも同様の偏りが存在する可能性が高い。
コンテキストインデックス変更部111dは、上述のように、周波数領域における非0の変換係数の分布の偏りに応じて、未復号のシンタックスについてのコンテキストインデックスを変更するので、変換係数復号部111bは、より適切な発生確率を用いて、各シンタックスの復号を行うことができる。
In general, if some non-zero transform coefficients appear biased when some frequency components are decoded, there is a high possibility that the same bias exists even when the remaining frequency components are decoded.
As described above, the context index changing unit 111d changes the context index for the undecoded syntax in accordance with the bias of the non-zero transform coefficient distribution in the frequency domain. Each syntax can be decoded using an appropriate probability of occurrence.
 (コンテキストインデックス変更処理例2)
 続いて、コンテキストインデックス変更部111dによるコンテキストインデックス変更処理の第2の具体例について説明する。
(Context index change processing example 2)
Subsequently, a second specific example of the context index changing process by the context index changing unit 111d will be described.
 本処理例においては、周波数領域における非0の変換係数の分布の偏りの判定、および、コンテキストインデックスの変更を、スキャンライン毎に行う。 In this processing example, the determination of the non-zero transform coefficient distribution in the frequency domain and the change of the context index are performed for each scan line.
 図49は、本処理例におけるコンテキストインデックス変更部111dの具体的な処理の流れを示すフローチャートである。図49に示すように、本処理例においては、上述した(コンテキストインデックス変更処理例1)についてのステップS201、S207、およびS209が、それぞれ、以下に説明するステップS401、S407、およびS409に置き換わる。 FIG. 49 is a flowchart showing a specific processing flow of the context index changing unit 111d in this processing example. As shown in FIG. 49, in this processing example, steps S201, S207, and S209 for the above-described (context index change processing example 1) are replaced with steps S401, S407, and S409 described below, respectively.
 (ステップS401)
 コンテキストインデックス変更部111dは、スキャンライン(0)~スキャンライン(L)に沿って順次変数PosXおよびPosYを設定する。
(Step S401)
The context index changing unit 111d sequentially sets variables PosX and PosY along the scan lines (0) to (L).
 (ステップS407)
 コンテキストインデックス変更部111dは、スキャンライン(0)~スキャンライン(L)についての処理が完了したか否かを判定する。
(Step S407)
The context index changing unit 111d determines whether or not the processing for the scan lines (0) to (L) has been completed.
 (ステップS409)
 coeffBottomLeft>coeffTopRightである場合(ステップS208でYes)、コンテキストインデックス変更部111dは、スキャンライン(L+1)に沿った周波数成分についてのコンテキストインデックスctxIdxを変更する。
(Step S409)
When coeffBottomLeft> coeffTopRight (Yes in step S208), the context index changing unit 111d changes the context index ctxIdx for the frequency component along the scan line (L + 1).
 図50は、処理対象の周波数領域が4×4成分である場合に本処理例を説明するための図である。図50(a)に示すように、例えば、スキャンライン(0)~スキャンライン(2)に沿って算出されたcoeffBottomLeftおよびcoeffTopRightの値に応じて、スキャンライン(3)に沿った各周波数成分についてのコンテキストインデックスctxIdxが変更される。 FIG. 50 is a diagram for explaining the present processing example when the frequency domain to be processed is 4 × 4 components. As shown in FIG. 50A, for example, according to the values of coeffBottomLeft and coeffTopRight calculated along the scan line (0) to the scan line (2), for each frequency component along the scan line (3). The context index ctxIdx of is changed.
 図50(b)は、コンテキストインデックス割り付け部111aによってスキャンライン(0)~スキャンライン(3)に沿った各周波数成分に割り付けられたコンテキストインデックスの例を示しており、図50(c)は、スキャンライン(0)~スキャンライン(2)に沿って算出されたcoeffBottomLeftおよびcoeffTopRightの値に応じて、コンテキストインデックス変更部111dによって変更されたコンテキストインデックスの例を示している。 FIG. 50 (b) shows an example of the context index assigned to each frequency component along the scan line (0) to the scan line (3) by the context index assigning unit 111a. An example of the context index changed by the context index changing unit 111d according to the values of coeffBottomLeft and coeffTopRight calculated along the scan line (0) to the scan line (2) is shown.
 図50(c)に示すように、コンテキストインデックス割り付け部111aによってスキャンライン(3)に沿って割り付けられたコンテキストインデックスctxIdx(PosX、PosY)は、コンテキストインデックス変更部111dによって、ctxIdx(PosY、PosX)に変更される。 As shown in FIG. 50C, the context index ctxIdx (PosX, PosY) allocated along the scan line (3) by the context index allocation unit 111a is converted into ctxIdx (PosY, PosX) by the context index change unit 111d. Changed to
 図51は、処理対象の周波数領域が8×8成分である場合に本処理例を説明するための図である。図51(a)に示すように、例えば、スキャンライン(0)~スキャンライン(3)に沿って算出されたcoeffBottomLeftおよびcoeffTopRightの値に応じて、スキャンライン(4)に沿った各周波数成分についてのコンテキストインデックスctxIdxが変更される。 FIG. 51 is a diagram for explaining the present processing example when the frequency region to be processed is an 8 × 8 component. As shown in FIG. 51A, for example, for each frequency component along the scan line (4) according to the values of coeffBottomLeft and coeffTopRight calculated along the scan line (0) to the scan line (3). The context index ctxIdx of is changed.
 図51(b)は、コンテキストインデックス割り付け部111aによってスキャンライン(0)~スキャンライン(4)に沿った周波数成分に割り付けられたコンテキストインデックスの例を示しており、図51(c)は、コンテキストインデックス変更部111dによって変更されたコンテキストインデックスの例を示している。 FIG. 51 (b) shows an example of the context index assigned to the frequency components along the scan lines (0) to (4) by the context index assigning unit 111a. FIG. The example of the context index changed by the index change part 111d is shown.
 図51(c)に示すように、コンテキストインデックス割り付け部111aによってスキャンライン(L+1)に沿って割り付けられたコンテキストインデックスctxIdx(PosX、PosY)は、コンテキストインデックス変更部111dによって、ctxIdx(PosY、PosX)に変更される。換言すれば、周波数成分(PosX、PosY)についてのコンテキストインデックスであって、コンテキストインデックス変更部111dによって変更された後のコンテキストインデックスをctxIdx’(PosX、PosY)と表すことにすると、
  ctxIdx’(PosX、PosY)=ctxIdx(PosY、PosX)
が満たされる。
As shown in FIG. 51 (c), the context index ctxIdx (PosX, PosY) allocated along the scan line (L + 1) by the context index allocation unit 111a is converted into ctxIdx (PosY, PosX) by the context index change unit 111d. Changed to In other words, if the context index for the frequency components (PosX, PosY) and changed by the context index changing unit 111d is expressed as ctxIdx ′ (PosX, PosY),
ctxIdx ′ (PosX, PosY) = ctxIdx (PosY, PosX)
Is satisfied.
 なお、図51(c)においては、スキャンライン(2)およびスキャンライン(3)に沿った周波数成分に割り付けられたコンテキストインデックスも変更されているが、これらの周波数成分については、変換係数の復号が完了しているため、実際の復号処理において参照されることはない。 In FIG. 51 (c), the context index assigned to the frequency components along the scan line (2) and the scan line (3) is also changed. For these frequency components, the transform coefficients are decoded. Is completed, it is not referred to in the actual decoding process.
 また、上記の説明では、スキャンライン(0)~スキャンライン(L)に沿って算出されたscanTopRightおよびscanBottomLeftの値に応じてスキャンライン(L+1)におけるスキャン方向が決定される場合を例に挙げたが、本実施形態はこれに限定されるものではなく、スキャンライン(L)に沿って算出されたscanTopRightおよびscanBottomLeftの値に応じてスキャンライン(L+1)におけるスキャン方向が決定される構成としてもよい。すなわち、スキャンライン毎に、scanTopRightおよびscanBottomLeftを初期化する構成としてもよい。 In the above description, the case where the scan direction in the scan line (L + 1) is determined according to the values of scanTopRight and scanBottomLeft calculated along the scan line (0) to the scan line (L) is taken as an example. However, the present embodiment is not limited to this, and the scan direction in the scan line (L + 1) may be determined according to the values of scanTopRight and scanBottomLeft calculated along the scan line (L). . That is, the scanTopRight and scanBottomLeft may be initialized for each scan line.
 また、スキャンラインを所定の本数(例えば2本)スキャンする毎にscanTopRightおよびscanBottomLeftが初期化される構成としてもよい。例えば、スキャンライン(L-1)およびスキャンライン(L)をスキャンすることによって蓄積されたscanTopRightおよびscanBottomLeftの大小に応じて、スキャンライン(L+1)に沿った周波数成分に割り付けられたコンテキストインデックスを変更する構成としてもよい。 Also, the scanTopRight and scanBottomLeft may be initialized every time a predetermined number (for example, two) of scan lines are scanned. For example, the context index assigned to the frequency component along the scan line (L + 1) is changed according to the scanTopRight and scanBottomLeft accumulated by scanning the scan line (L-1) and the scan line (L). It is good also as composition to do.
 また、本処理例では、例えばスキャンライン(0)~(2)に沿った周波数成分に割り付けられたコンテキストインデックスは、変更の対象とせずに、図52(a)に示すように、スキャンライン(3)以降のスキャンラインに沿った周波数成分に割り付けられたコンテキストインデックスを変更の対象とすることが好ましい。 In this processing example, for example, the context index allocated to the frequency components along the scan lines (0) to (2) is not changed, and the scan line ( 3) It is preferable to change the context index assigned to the frequency components along the subsequent scan lines.
 これは、スキャンライン(0)~(2)を復号した時点では十分な数の周波数成分を復号しておらず、そのため、このようなスキャンラインに沿った周波数成分については、非0の変換係数の分布の偏りの推定に誤りが生じ易いためである。上記の構成によれば、そのような推定誤りに起因する符号化効率の低下を防ぐことができる。 This is because a sufficient number of frequency components have not been decoded at the time when scan lines (0) to (2) are decoded, and therefore, non-zero conversion coefficients are not used for frequency components along such a scan line. This is because an error is likely to occur in the estimation of the distribution bias. According to said structure, the fall of the encoding efficiency resulting from such an estimation error can be prevented.
 図52(b)は、コンテキストインデックス割り付け部111aによってスキャンライン(3)に沿った周波数成分(0、3)、(1、2)、(2、1)、(3、0)に割り付けられたコンテキストインデックスの例を示しており、図52(c)は、コンテキストインデックス変更部111dによって変更されたコンテキストインデックスの例を示している。 In FIG. 52B, the context index assigning unit 111a assigns the frequency components (0, 3), (1, 2), (2, 1), (3, 0) along the scan line (3). An example of the context index is shown, and FIG. 52C shows an example of the context index changed by the context index changing unit 111d.
 図53は、本処理例の動作を行うコンテキストインデックス変更部111dと、変換係数復号部111bとの連携動作の一例を示すシーケンス図である。 FIG. 53 is a sequence diagram illustrating an example of a cooperative operation between the context index changing unit 111d that performs the operation of the present processing example and the transform coefficient decoding unit 111b.
 (ステップS501)
 変換係数復号部111bは、スキャンライン(0)~スキャンライン(2)に沿って変換係数の復号を行う。また、それらのスキャンラインに沿った各周波数成分についての復号済みのシンタックスsig_flagを、コンテキストインデックス変更部111dに供給する。図53において、スキャンライン(0)~スキャンライン(2)に沿った各周波数成分についての復号済みのシンタックスsig_flagの集合をsig_flag(0)~(2)と表記している(以下同様)。
(Step S501)
The transform coefficient decoding unit 111b decodes transform coefficients along the scan line (0) to the scan line (2). Further, the decoded syntax sig_flag for each frequency component along those scan lines is supplied to the context index changing unit 111d. In FIG. 53, a set of decoded syntax sig_flag for each frequency component along scan line (0) to scan line (2) is denoted as sig_flag (0) to (2) (the same applies hereinafter).
 (ステップS502)
 コンテキストインデックス変更部111dは、変換係数復号部111bから供給される復号済みのシンタックスsig_flagの値を参照し、スキャンライン(0)~スキャンライン(2)に沿った周波数成分についての非0の変換係数の分布の偏りを判定する。
(Step S502)
The context index changing unit 111d refers to the value of the decoded syntax sig_flag supplied from the transform coefficient decoding unit 111b, and performs non-zero conversion on frequency components along the scan line (0) to the scan line (2). Judge the distribution of coefficients.
 (ステップS503)
 続いて、コンテキストインデックス変更部111dは、スキャンライン(0)~スキャンライン(2)に沿った周波数成分についての非0の変換係数の分布の偏りに応じて、スキャンライン(3)に沿った未復号の周波数成分についてのコンテキストインデックスを変更する。また、変更後のコンテキストインデックスctxIdx'を変換係数復号部111bに供給する。図53において、スキャンライン(3)に沿った未復号の周波数成分についての変更後のコンテキストインデックスの集合をctxIdx'(3)と表記している(以下同様)。
(Step S503)
Subsequently, the context index changing unit 111d determines whether the non-zero transform coefficient distribution for the frequency components along the scan line (0) to the scan line (2) is unbalanced along the scan line (3). Change the context index for the frequency component of decoding. Also, the changed context index ctxIdx ′ is supplied to the transform coefficient decoding unit 111b. In FIG. 53, a set of changed context indexes for undecoded frequency components along the scan line (3) is denoted as ctxIdx ′ (3) (the same applies hereinafter).
 (ステップS504)
 変換係数復号部111bは、コンテキストインデックス変更部111dより供給される変更後のコンテキストインデックスctxIdx'を用いて、スキャンライン(3)に沿った未復号の周波数成分についての変換係数を復号する。また、スキャンライン(3)に沿った各周波数成分についての復号済みのシンタックスsig_flagを、コンテキストインデックス変更部111dに供給する。
(Step S504)
The transform coefficient decoding unit 111b decodes transform coefficients for undecoded frequency components along the scanline (3) using the changed context index ctxIdx ′ supplied from the context index changing unit 111d. Also, the decoded syntax sig_flag for each frequency component along the scan line (3) is supplied to the context index changing unit 111d.
 (ステップS505)
 コンテキストインデックス変更部111dは、変換係数復号部111bから供給される復号済みのシンタックスsig_flagの値を参照し、スキャンライン(0)~スキャンライン(3)に沿った周波数成分についての非0の変換係数の分布の偏りを判定する。
(Step S505)
The context index changing unit 111d refers to the value of the decoded syntax sig_flag supplied from the transform coefficient decoding unit 111b, and performs non-zero conversion on frequency components along the scan lines (0) to (3). Judge the distribution of coefficients.
 (ステップS506)
 続いて、コンテキストインデックス変更部111dは、スキャンライン(3)に沿った周波数成分についての非0の変換係数の分布の偏りに応じて、スキャンライン(4)に沿った未復号の周波数成分についてのコンテキストインデックスを変更する。また、変更後のコンテキストインデックスctxIdx'を変換係数復号部111bに供給する。
(Step S506)
Subsequently, the context index changing unit 111d applies the non-decoded frequency component along the scan line (4) according to the non-zero transform coefficient distribution for the frequency component along the scan line (3). Change the context index. Also, the changed context index ctxIdx ′ is supplied to the transform coefficient decoding unit 111b.
 (ステップS507)
 変換係数復号部111bは、コンテキストインデックス変更部111dより供給される変更後のコンテキストインデックスctxIdx'を用いて、スキャンライン(4)に沿った未復号の周波数成分についての変換係数を復号する。また、スキャンライン(4)に沿った各周波数成分についての復号済みのシンタックスsig_flagを、コンテキストインデックス変更部111dに供給する。
(Step S507)
The transform coefficient decoding unit 111b decodes transform coefficients for undecoded frequency components along the scan line (4) using the changed context index ctxIdx ′ supplied from the context index changing unit 111d. Also, the decoded syntax sig_flag for each frequency component along the scan line (4) is supplied to the context index changing unit 111d.
 (ステップS508)
 コンテキストインデックス変更部111dは、変換係数復号部111bから供給される復号済みのシンタックスsig_flagの値を参照し、スキャンライン(0)~スキャンライン(4)に沿った周波数成分についての非0の変換係数の分布の偏りを判定する。
(Step S508)
The context index changing unit 111d refers to the value of the decoded syntax sig_flag supplied from the transform coefficient decoding unit 111b, and performs non-zero conversion on frequency components along the scan lines (0) to (4). Judge the distribution of coefficients.
 以降、ステップS506~ステップS508と同様の動作を繰り返すことによって、処理対象周波数領域に含まれる各周波数成分についての変換係数の復号が行われる。 Thereafter, by repeating the same operations as in steps S506 to S508, the transform coefficients for each frequency component included in the processing target frequency region are decoded.
 コンテキストインデックス変更部111dが、本処理例の動作を行うことによっても、変換係数復号部111bは、より適切な発生確率を用いて、各シンタックスの復号を行うことができる。 Also when the context index changing unit 111d performs the operation of this processing example, the transform coefficient decoding unit 111b can perform decoding of each syntax using a more appropriate occurrence probability.
 <変形例1>
 上述の(コンテキストインデックス変更処理例1)および(コンテキストインデックス変更処理例2)においては、変換係数復号部111bが、コンテキストインデックス変更部111dに対してsig_flagを供給し、コンテキストインデックス変更部111dは、sig_flagを参照して、非0の変換係数の分布の偏りを判定する構成について説明したが、本実施形態はこれに限定されるものではない。例えば、変換係数復号部111bは、コンテキストインデックス変更部111dに対して、変数scanBottomLeftおよびscanTopRightを供給し、コンテキストインデックス変更部111dは、変数scanBottomLeftの値と変数scanTopRightの値とを比較することによって、非0の変換係数の分布の偏りを判定する構成としてもよい。このような構成の場合、scanBottomLeft>scanTopRightである場合に、周波数領域における未復号の成分についてのコンテキストインデックスctxIdxが変更される。
<Modification 1>
In the above-described (context index change processing example 1) and (context index change processing example 2), the transform coefficient decoding unit 111b supplies sig_flag to the context index change unit 111d, and the context index change unit 111d receives sig_flag. The configuration for determining the distribution bias of non-zero conversion coefficients has been described with reference to FIG. 5, but the present embodiment is not limited to this. For example, the transform coefficient decoding unit 111b supplies the variables scanBottomLeft and scanTopRight to the context index changing unit 111d, and the context index changing unit 111d compares the value of the variable scanBottomLeft with the value of the variable scanTopRight. A configuration may be used in which the deviation of the distribution of the conversion coefficient of 0 is determined. In such a configuration, when scanBottomLeft> scanTopRight, the context index ctxIdx for an undecoded component in the frequency domain is changed.
 上記の構成とすることによって、コンテキストインデックス変更部111dによる処理量を削減することができる。 With the above configuration, the processing amount by the context index changing unit 111d can be reduced.
 <変形例2>
 また、変換係数復号部111bは、コンテキストインデックス変更部111dに対して、各スキャンラインについてのスキャン方向scanDirectionを供給し、コンテキストインデックス変更部111dは、スキャン方向scanDirectionを参照して、非0の変換係数の分布の偏りを判定する構成としてもよい。このような構成の場合、scanDirection=TopRightである場合に、周波数領域における未復号の成分についてのコンテキストインデックスctxIdxが変更される。
<Modification 2>
In addition, the transform coefficient decoding unit 111b supplies the scan direction scanDirection for each scan line to the context index change unit 111d, and the context index change unit 111d refers to the scan direction scanDirection to determine a non-zero transform coefficient. It is good also as a structure which determines the deviation of distribution of. In such a configuration, when scanDirection = TopRight, the context index ctxIdx for an undecoded component in the frequency domain is changed.
 上記の構成とすることによっても、コンテキストインデックス変更部111dによる処理量を削減することができる。 Also with the above configuration, the processing amount by the context index changing unit 111d can be reduced.
 <変形例3>
 また、コンテキストインデックス変更部111dは、ンテキストインデックスを変更する対象となる周波数成分を制限し、所定の(PosX、PosY)における周波数成分についてのみコンテキストインデックスを変更可能な構成としてもよい。
<Modification 3>
Further, the context index changing unit 111d may be configured to limit the frequency component that is the target of changing the text index, and to change the context index only for the frequency component at a predetermined (PosX, PosY).
 例えば、以下の条件
  ABS(PosX-PosY)≧TH1
を満たす周波数成分についてのみ、コンテキストインデックスを変更可能な構成としてもよい。ここで、ABS(…)は、括弧内の変数の絶対値を表す記号である。また、TH1は、所定の閾値を表している。図54(a)は、処理対象の周波数領域が4×4成分であり、TH1=1とした場合について、コンテキストインデックスを変更可能な周波数成分を示す図である。図54(a)に示す例において、斜線を付した周波数成分については、コンテキストインデックスが変更可能であるが、その他の周波数成分については、コンテキストインデックスが変更されない。処理対象の周波数領域が8×8成分である場合についても同様である。
For example, the following condition ABS (PosX−PosY) ≧ TH1
Only the frequency components satisfying the condition may be configured such that the context index can be changed. Here, ABS (...) Is a symbol representing the absolute value of a variable in parentheses. TH1 represents a predetermined threshold value. FIG. 54A is a diagram showing frequency components whose context index can be changed when the frequency region to be processed is 4 × 4 components and TH1 = 1. In the example shown in FIG. 54A, the context index can be changed for the hatched frequency components, but the context index is not changed for the other frequency components. The same applies to the case where the frequency region to be processed is an 8 × 8 component.
 周波数領域においてPosX=PosYを満たす対角線付近の周波数成分については、コンテキストインデックスを変更したとしても、期待されるほど符号化効率が向上しない場合がある。例えば、処理対象ブロックに斜めのエッジが存在する場合には、周波数領域において、PosX=PosYを満たす対角線付近の周波数成分について、非0の変換係数が生じるが、それらの周波数成分については、コンテキストインデックスを変更したとしても、期待されるほど符号化効率が向上しない場合がある。これは、PosX=PosYを満たす対角線付近の周波数成分については、非0の変換係数の分布の偏りの推定に誤りが生じ易いことに起因する。 For frequency components near the diagonal line that satisfies PosX = PosY in the frequency domain, even if the context index is changed, the encoding efficiency may not be improved as expected. For example, when a diagonal edge exists in the processing target block, a non-zero transform coefficient is generated for a frequency component near the diagonal line that satisfies PosX = PosY in the frequency domain. Even if this is changed, the encoding efficiency may not be improved as expected. This is because, for frequency components in the vicinity of the diagonal line that satisfies PosX = PosY, an error is likely to occur in the estimation of the non-zero transform coefficient distribution.
 本変形例によれば、処理量を削減しつつ、符号化効率を向上させることができる。 According to this modification, the encoding efficiency can be improved while reducing the processing amount.
 また、本変形例においては、以下の条件
  PosX≦TH2 または PosY≦TH2
を満たす周波数成分についてのみ、コンテキストインデックスを変更可能な構成としてもよい。図54(b)は、処理対象の周波数領域が4×4成分であり、TH2=1とした場合について、コンテキストインデックスを変更可能な周波数成分を示す図である。図54(b)に示す例において、斜線を付した周波数成分については、コンテキストインデックスが変更可能であるが、その他の周波数成分については、コンテキストインデックスが変更されない。処理対象の周波数領域が8×8成分である場合についても同様である。
Moreover, in this modification, the following conditions PosX ≦ TH2 or PosY ≦ TH2
Only the frequency components satisfying the condition may be configured such that the context index can be changed. FIG. 54B is a diagram showing frequency components whose context index can be changed when the frequency region to be processed is 4 × 4 components and TH2 = 1. In the example shown in FIG. 54B, the context index can be changed for the hatched frequency component, but the context index is not changed for the other frequency components. The same applies to the case where the frequency region to be processed is an 8 × 8 component.
 図54(b)に示すように、PosX=0、および、PosY=0付近の周波数成分についてのみコンテキストインデックスを変更可能な構成とすることによっても、処理量を削減しつつ、符号化効率を向上させることができる。 As shown in FIG. 54B, the encoding efficiency is improved while reducing the processing amount by adopting a configuration in which the context index can be changed only for frequency components in the vicinity of PosX = 0 and PosY = 0. Can be made.
 <変形例4>
 以上の説明では、コンテキストインデックス変更部111dは、処理対象の周波数領域において、復号済みの非0の変換係数の分布の偏りに応じて、未復号の周波数成分についてのコンテキストインデックスctxIdx(PosX、PosY)を、ctxIdx’(PosX、PosY)=ctxIdx(PosY、PosX)に入れ替える構成について述べたが、本実施形態におけるコンテキストインデックスの変更の仕方は、この例に限られるものではない。
<Modification 4>
In the above description, the context index changing unit 111d performs the context index ctxIdx (PosX, PosY) for the undecoded frequency component in accordance with the bias of the distribution of the decoded non-zero transform coefficients in the frequency domain to be processed. Has been described as ctxIdx ′ (PosX, PosY) = ctxIdx (PosY, PosX), but the method of changing the context index in the present embodiment is not limited to this example.
 本変形例では、処理対象の周波数領域において、(1)復号済みの非0の変換係数がX方向(水平方向)に偏っている場合、(2)復号済みの非0の変換係数がY方向(垂直方向)に偏っている場合、および、(3)復号済みの非0の変換係数にほとんど偏りがない場合(偏りが小さい場合)の3つの場合について、それぞれ異なったコンテキストインデックスを割り付ける構成について説明する。 In this modification, in the frequency domain to be processed, when (1) decoded non-zero transform coefficients are biased in the X direction (horizontal direction), (2) decoded non-zero transform coefficients are in the Y direction. Regarding a configuration in which different context indexes are allocated for each of the three cases of (biased in the vertical direction) and (3) the case where the decoded non-zero transform coefficient has little bias (when the bias is small). explain.
 まず、コンテキストインデックス変更部111dは、coeffTopRightとcoeffBottomLeftとを比較することによって、コンテキストグループctxgroupを決定する。具体的には、コンテキストインデックス変更部111dは、以下のようにコンテキストグループctxgroupを決定する。 First, the context index changing unit 111d determines the context group ctxgroup by comparing coeffTopRight and coeffBottomLeft. Specifically, the context index changing unit 111d determines the context group ctxgroup as follows.
  ctxgroup=1:coeffTopRight≧2×coeffBottomLeftのとき
  ctxgroup=2:2×coeffTopRight≦coeffBottomLeftのとき
  ctxgroup=0:それ以外(coeffTopRight<2×coeffBottomLeft、かつ、2×coeffTopRight>coeffBottomLeft)のとき
 すなわち、コンテキストインデックス変更部111dは、復号済みの非0の変換係数が水平方向に偏っている場合に、ctxgroup=1に決定し、復号済みの非0の変換係数が垂直方向に偏っている場合に、ctxgroup=2に決定し、復号済みの非0の変換係数にほとんど偏りがない場合に、ctxgroup=0に決定する。
When ctxgroup = 1: coeffTopRight ≧ 2 × coeffBottomLeft ctxgroup = 2: When 2 × coeffTopRight ≦ coeffBottomLeft ctxgroup = 0: Other (coeffTopRight <2 × coeffBottomLeft and 2 × coeffTopRight> coeffBottomLeft) The unit 111d determines ctxgroup = 1 when the decoded non-zero transform coefficient is biased in the horizontal direction, and ctxgroup = 2 when the decoded non-zero transform coefficient is skewed in the vertical direction. If there is almost no bias in the decoded non-zero transform coefficients, ctxgroup = 0 is determined.
 続いて、コンテキストインデックス変更部111dは、周波数成分(PosX、PosY)についてのコンテキストインデックスctxIdx(PosX、PosY)を、以下の式によって決定する。 Subsequently, the context index changing unit 111d determines a context index ctxIdx (PosX, PosY) for the frequency components (PosX, PosY) by the following formula.
  ctxIdx(PosX、PosY)=(4×PosY+PosX)+16×ctxgroup
 図55(a)は、coeffTopRight<2×coeffBottomLeft、かつ、2×coeffTopRight>coeffBottomLeftである場合、すなわち、復号済みの非0の変換係数にほとんど偏りがない場合に、コンテキストインデックス変更部111dによって決定されたコンテキストインデックスを示す図である。図55(b)は、coeffTopRight≧2×coeffBottomLeftである場合、すなわち、復号済みの非0の変換係数が水平方向に偏っている場合に、コンテキストインデックス変更部111dによって決定されたコンテキストインデックスを示す図である。図55(c)は、2×coeffTopRight≦coeffBottomLeftである場合、すなわち、復号済みの非0の変換係数が垂直方向に偏っている場合に、コンテキストインデックス変更部111dによって決定されたコンテキストインデックスを示す図である。
ctxIdx (PosX, PosY) = (4 × PosY + PosX) + 16 × ctxgroup
FIG. 55A is determined by the context index changing unit 111d when coeffTopRight <2 × coeffBottomLeft and 2 × coeffTopRight> coeffBottomLeft, that is, when there is almost no bias in the decoded non-zero transform coefficients. FIG. FIG. 55B shows a context index determined by the context index changing unit 111d when coeffTopRight ≧ 2 × coeffBottomLeft, that is, when decoded non-zero transform coefficients are biased in the horizontal direction. It is. FIG. 55C is a diagram showing a context index determined by the context index changing unit 111d when 2 × coeffTopRight ≦ coeffBottomLeft, that is, when decoded non-zero transform coefficients are biased in the vertical direction. It is.
 図55(a)~(c)に示すように、処理対象の周波数領域に対して、復号済みの非0の変換係数の偏りに応じて異なったコンテキストインデックスのセットが決定される。 As shown in FIGS. 55A to 55C, different context index sets are determined for the frequency domain to be processed according to the bias of the decoded non-zero transform coefficient.
 コンテキストインデックス割り付け部111aが、処理対象の周波数領域の各周波数成分に対して、図55(a)に示したコンテキストインデックスを割り付けるものとすると、コンテキストインデックス変更部111dは、未復号の周波数領域に割り付けられたコンテキストインデックスを、復号済みの非0の変換係数の偏りに応じて、図55(b)または図55(c)に示すコンテキストインデックスに変更する構成となる。 Assuming that the context index assigning unit 111a assigns the context index shown in FIG. 55 (a) to each frequency component in the frequency domain to be processed, the context index changing unit 111d assigns to the undecoded frequency domain. The obtained context index is changed to the context index shown in FIG. 55 (b) or 55 (c) according to the bias of the decoded non-zero transform coefficient.
 <変形例5>
 また、復号済みの非0の変換係数の分布に偏りがある場合、および、復号済みの非0の変換係数の分布にほとんど偏りがない場合に対して、それぞれ異なったコンテキストインデックスのセットを用いる構成とし、さらに、復号済みの非0の変換係数の分布に偏りがある場合には、復号済みの非0の変換係数が水平方向および垂直方向の何れに偏っているのかに応じて、コンテキストインデックスを入れ替える構成としてもよい。
<Modification 5>
Also, a configuration in which different sets of context indexes are used for a case where the distribution of decoded non-zero transform coefficients is biased and a case where the distribution of decoded non-zero transform coefficients is almost biased Further, if the distribution of the decoded non-zero transform coefficients is biased, the context index is set according to whether the decoded non-zero transform coefficients are biased in the horizontal direction or the vertical direction. It is good also as a structure to replace.
 本変形では、コンテキストインデックス変更部111dは、まず、coeffTopRightとcoeffBottomLeftとを比較することによって、コンテキストグループctxgroupおよび入れ替えインデックスswapを決定する。具体的には、コンテキストインデックス変更部111dは、以下のようにコンテキストグループctxgroupおよび入れ替えインデックスswapを決定する。 In this modification, the context index changing unit 111d first determines the context group ctxgroup and the replacement index swap by comparing coeffTopRight and coeffBottomLeft. Specifically, the context index changing unit 111d determines the context group ctxgroup and the replacement index swap as follows.
  ctxgroup=1、swap=0:coeffTopRight≧2×coeffBottomLeftのとき
  ctxgroup=1、swap=1:2×coeffTopRight≦coeffBottomLeftのとき
  ctxgroup=0、swap=0:coeffTopRight<2×coeffBottomLeft、かつ、2×coeffTopRight>coeffBottomLeftのとき
 すなわち、コンテキストインデックス変更部111dは、復号済みの非0の変換係数に偏りがある場合にctxgroup=1に決定し、復号済みの非0の変換係数にほとんど偏りがない場合に、ctxgroup=0に決定する。また、復号済みの非0の変換係数が水平方向に偏っている場合に入れ替えインデックスswap=0に決定し、復号済みの非0の変換係数が垂直方向に偏っている場合に入れ替えインデックスswap=1に決定する。
ctxgroup = 1, swap = 0: when coeffTopRight ≧ 2 × coeffBottomLeft ctxgroup = 1, swap = 1: 2 × coeffTopRight ≦ coeffBottomLeft ctxgroup = 0, swap = 0: coeffTopRight <2 × coeffBottomLeft and 2 × coeffTopRight> In the case of coeffBottomLeft, that is, the context index changing unit 111d determines ctxgroup = 1 when there is a bias in the decoded non-zero transform coefficient, and ctxgroup when there is almost no bias in the decoded non-zero transform coefficient. = 0. Also, when the decoded non-zero transform coefficient is biased in the horizontal direction, the replacement index swap = 0 is determined, and when the decoded non-zero transform coefficient is biased in the vertical direction, the swap index swap = 1. To decide.
 続いて、コンテキストインデックス変更部111dは、周波数成分(PosX、PosY)についてのコンテキストインデックスctxIdx(PosX、PosY)を、以下の式によって決定する。 Subsequently, the context index changing unit 111d determines a context index ctxIdx (PosX, PosY) for the frequency components (PosX, PosY) by the following formula.
  swap=1のとき:ctxIdx(PosX、PosY)=(4×PosX+PosY)+16×ctxgroup
  swap=0のとき:ctxIdx(PosX、PosY)=(4×PosY+PosX)+16×ctxgroup
 図56(a)は、coeffTopRight<2×coeffBottomLeft、かつ、2×coeffTopRight>coeffBottomLeftである場合、すなわち、復号済みの非0の変換係数にほとんど偏りがない場合に、コンテキストインデックス変更部111dによって決定されたコンテキストインデックスを示す図である。図56(b)は、coeffTopRight≧2×coeffBottomLeftである場合、すなわち、復号済みの非0の変換係数が水平方向に偏っている場合に、コンテキストインデックス変更部111dによって決定されたコンテキストインデックスを示す図である。図56(c)は、2×coeffTopRight≦coeffBottomLeftである場合、すなわち、復号済みの非0の変換係数が垂直方向に偏っている場合に、コンテキストインデックス変更部111dによって決定されたコンテキストインデックスを示す図である。
When swap = 1: ctxIdx (PosX, PosY) = (4 × PosX + PosY) + 16 × ctxgroup
When swap = 0: ctxIdx (PosX, PosY) = (4 × PosY + PosX) + 16 × ctxgroup
FIG. 56A is determined by the context index changing unit 111d when coeffTopRight <2 × coeffBottomLeft and 2 × coeffTopRight> coeffBottomLeft, that is, when there is almost no bias in the decoded non-zero transform coefficients. FIG. FIG. 56B is a diagram showing a context index determined by the context index changing unit 111d when coeffTopRight ≧ 2 × coeffBottomLeft, that is, when decoded non-zero transform coefficients are biased in the horizontal direction. It is. FIG. 56C is a diagram showing the context index determined by the context index changing unit 111d when 2 × coeffTopRight ≦ coeffBottomLeft, that is, when the decoded non-zero transform coefficient is biased in the vertical direction. It is.
 図56(a)~(c)に示すように、処理対象の周波数領域に対して、復号済みの非0の変換係数の偏りに応じて異なったコンテキストインデックスが決定される。 As shown in FIGS. 56A to 56C, different context indexes are determined for the frequency domain to be processed according to the bias of the decoded non-zero transform coefficient.
 なお、復号済みの非0の変換係数が偏りがある場合におけるswapの値の決定において、上記の説明とは値が逆の構成、すなわち、復号済みの非0の変換係数が水平方向に偏っている場合に入れ替えインデックスswap=1に決定し、復号済みの非0の変換係数が垂直方向に偏っている場合に入れ替えインデックスswap=0に決定する構成でも構わない。 In the determination of the swap value when the decoded non-zero transform coefficient is biased, the configuration opposite to the above description, that is, the decoded non-zero transform coefficient is biased in the horizontal direction. In this case, the replacement index swap = 1 may be determined, and the replacement index swap = 0 may be determined when the decoded non-zero transform coefficient is biased in the vertical direction.
 コンテキストインデックス割り付け部111aが、処理対象の周波数領域の各周波数成分に対して、図56(a)に示したコンテキストインデックスを割り付けるものとすると、コンテキストインデックス変更部111dは、未復号の周波数領域に割り付けられたコンテキストインデックスを、復号済みの非0の変換係数の偏りに応じて、図56(b)または図56(c)に示すコンテキストインデックスに変更する構成となる。 Assuming that the context index assigning unit 111a assigns the context index shown in FIG. 56 (a) to each frequency component in the frequency domain to be processed, the context index changing unit 111d assigns to the undecoded frequency domain. The obtained context index is changed to the context index shown in FIG. 56 (b) or 56 (c) according to the bias of the decoded non-zero transform coefficient.
 なお、本変形例に係るコンテキストインデックス変更部111dは、処理対象の周波数領域における復号済みの非0変換係数の分布の偏りを表す指標が、予め定められた閾値よりも大きい場合に、該対象周波数領域における未復号のシンタックスに割り付けるコンテキストインデックスを変更するものである、と表現することもできる。 Note that the context index changing unit 111d according to the present modification, when the index indicating the bias of the distribution of the decoded non-zero transform coefficient in the frequency domain to be processed is larger than a predetermined threshold, It can also be expressed as changing the context index assigned to the undecoded syntax in the region.
 例えば、上記指標として、
  R=coeffTopRight-2×coeffBottomLeft
を用いるものとすると、本変形例に係るコンテキストインデックス変更部111dは、指標Rが0以上である場合に、図56(b)に示すようにコンテキストインデックスを変更するものであると捉えることができる。
For example, as the above index,
R = coeffTopRight-2 × coeffBottomLeft
, The context index changing unit 111d according to the present modification can be considered to change the context index as shown in FIG. 56B when the index R is 0 or more. .
 また、上記指標として、
  R’=coeffBottomLeft-2×coeffTopRight
を用いるものとすると、本変形例に係るコンテキストインデックス変更部111dは、指標R’が0以上である場合に、図56(c)に示すようにコンテキストインデックスを変更するものであると捉えることができる。
In addition, as the above index,
R '= coeffBottomLeft-2 × coeffTopRight
When the index R ′ is 0 or more, the context index changing unit 111d according to this modification may be considered to change the context index as shown in FIG. 56 (c). it can.
 <変形例6>
 以上の説明では、コンテキストインデックス変更部111dが、PosX>PosYを満たす周波数成分について復号済みの非0の変換係数の数をcoeffTopRightとして算出し、PosX<PosYを満たす周波数成分について復号済みの非0の変換係数の数をcoeffBottomLeftとして算出する構成について述べたが、本実施形態は、これに限られるものではない。
<Modification 6>
In the above description, the context index changing unit 111d calculates, as coeffTopRight, the number of non-zero transform coefficients that have been decoded for frequency components that satisfy PosX> PosY, and the non-zero that has been decoded for frequency components that satisfy PosX <PosY. Although the configuration for calculating the number of transform coefficients as coeffBottomLeft has been described, the present embodiment is not limited to this.
 例えば、コンテキストインデックス変更部111dは、PosY=0または1である周波数成分について復号済みの非0の変換係数の数をcoeffTopRightとして算出し、PosX=0または1である周波数成分について復号済みの非0の変換係数の数をcoeffBottomLeftとして算出する構成としてもよい。 For example, the context index changing unit 111d calculates, as coeffTopRight, the number of non-zero transformed coefficients that have been decoded for frequency components with PosY = 0 or 1, and the non-zero that has been decoded for frequency components with PosX = 0 or 1. The number of conversion coefficients may be calculated as coeffBottomLeft.
 図57は、本変形例係るコンテキストインデックス変更部111dが、coeffTopRightおよびcoeffBottomLeftを算出するために参照する周波数成分を例示する図である。図57において右上がりの斜線が付された周波数成分は、coeffTopRightを算出するために参照され、右下がりの斜線が付された周波数成分は、coeffBottomLeftを算出するために参照される。 FIG. 57 is a diagram illustrating frequency components referred to by the context index changing unit 111d according to the present modification for calculating coeffTopRight and coeffBottomLeft. In FIG. 57, a frequency component with a diagonal line rising to the right is referred to calculate coeffTopRight, and a frequency component with a diagonal line to the right is referred to calculate coeffBottomLeft.
 コンテキストインデックス変更部111dが本変形例の構成をとることによって、非0変換係数の分布の偏りの推定誤りに起因する符号化効率の低下を防ぐことができる。 The context index changing unit 111d adopts the configuration of the present modification, thereby preventing a reduction in encoding efficiency due to an estimation error of the non-zero transform coefficient distribution.
 <変形例7>
 また、コンテキストインデックス変更部111dは、PosX>PosYを満たす周波数成分について復号済みの変換係数の絶対値の加重平均をcoeffTopRightとして算出し、PosX<PosYを満たす周波数成分について復号済みの変換係数の絶対値の加重平均をcoeffBottomLeftとして算出する構成としてもよい。
<Modification 7>
Further, the context index changing unit 111d calculates, as coeffTopRight, a weighted average of absolute values of transform coefficients that have been decoded for frequency components that satisfy PosX> PosY, and an absolute value of transform coefficients that have been decoded for frequency components that satisfy PosX <PosY. It is good also as a structure which calculates the weighted average of as coeffBottomLeft.
 例えば、コンテキストインデックス変更部111dは、coeffTopRightおよびcoeffBottomLeftを、それぞれ、以下の数式(2)および(3)を用いて算出する構成としてもよい。 For example, the context index changing unit 111d may be configured to calculate coeffTopRight and coeffBottomLeft using the following equations (2) and (3), respectively.
Figure JPOXMLDOC01-appb-M000002
Figure JPOXMLDOC01-appb-M000002
Figure JPOXMLDOC01-appb-M000003
Figure JPOXMLDOC01-appb-M000003
ここで、数式(2)におけるΣは、復号済みの変換係数であって、PosX>PosYを満たす変換係数についての和を表しており、数式(3)におけるΣは、復号済みの変換係数であって、PosX<PosYを満たす変換係数についての和を表している。また、記号|…|は、絶対値を表す記号である。 Here, Σ in Equation (2) is a decoded transform coefficient and represents the sum of transform coefficients satisfying PosX> PosY, and Σ in Equation (3) is a decoded transform coefficient. The sum of transform coefficients satisfying PosX <PosY. The symbol | ... | is a symbol representing an absolute value.
 数式(2)および(3)において重み係数w(PosX、PosY)は、非0変換係数の分布の偏りの推定誤りに起因する符号化効率の低下をより効果的に防ぐように設定することができる。例えば、重み係数w(PosX、PosY)は、
  w(PosX=0、PosY)>w(PosX≠0、PosY)
  w(PosX、PosY=0)>w(PosX、PosY≠0)
を満たすように設定することができる。
In Equations (2) and (3), the weighting factor w (PosX, PosY) may be set so as to more effectively prevent a decrease in coding efficiency due to an estimation error in the non-zero transform coefficient distribution bias. it can. For example, the weighting factor w (PosX, PosY) is
w (PosX = 0, PosY)> w (PosX ≠ 0, PosY)
w (PosX, PosY = 0)> w (PosX, PosY ≠ 0)
Can be set to satisfy.
 また、数式(2)および(3)において、|Coeff(PosX、PosY)|に代えて、周波数成分(PosX、PosY)について復号されたシンタックスsig_flagの値を用いる構成としてもよい。 Also, in Equations (2) and (3), instead of | Coeff (PosX, PosY) |, the value of the syntax sig_flag decoded for the frequency component (PosX, PosY) may be used.
 (符号化データのデータ構造)
 本発明の符号化データのデータ構造は、次の特徴を有する。すなわち、原画像を単位領域毎に周波数変換して得られる各変換係数について、該変換係数を表す1または複数種類のシンタックスを算術符号化することによって得られる符号化データのデータ構造であって、上記1または複数種類のシンタックスには、変換係数が0であるか否か示すフラグが含まれており、上記符号化データを復号する算術復号装置は、処理対象の単位領域に対応する対象周波数領域における各シンタックスに対して、該シンタックスの種類および該シンタックスの該対象周波数領域における位置に応じて定まるコンテキストインデックスを割り付け、上記対象周波数領域における各シンタックスを、該シンタックスに対して割り付けられたコンテキストインデックスによって指定される確率状態に基づいて順次算術復号すると共に、上記対象周波数領域における復元済みの上記フラグの分布の偏りに応じて、該対象周波数領域における未復号のシンタックスに割り付けるコンテキストインデックスを変更する、ことを特徴としている。
(Data structure of encoded data)
The data structure of the encoded data of the present invention has the following characteristics. That is, a data structure of encoded data obtained by arithmetically encoding one or a plurality of types of syntax representing the conversion coefficient for each conversion coefficient obtained by frequency-converting the original image for each unit region. The one or more types of syntax include a flag indicating whether or not the transform coefficient is 0, and the arithmetic decoding apparatus that decodes the encoded data has a target corresponding to the unit area to be processed. For each syntax in the frequency domain, a context index determined according to the type of syntax and the position of the syntax in the target frequency domain is assigned, and each syntax in the target frequency domain is assigned to the syntax. Sequential arithmetic decoding based on the probability state specified by the assigned context index Rutotomoni, depending on the deviation of the distribution of restored the flag in the target frequency range, changes the context index allocated to the syntax of the undecoded in the subject frequency range, is characterized in that.
 また、対象周波数領域における各シンタックスの分布の偏りに応じて、対象周波数領域における未復号のシンタックスに割り付けるコンテキストインデックスを変更するか否かを示すコンテキスト複雑度フラグを定めることができる。コンテキスト複雑度フラグが低複雑度を示す0の場合には、分布の偏りによってコンテキストインデックスの変更を行わず、コンテキスト複雑度フラグが高複雑度を示す1の場合には、分布の偏りによってコンテキストインデックスの変更を行う。 Also, it is possible to define a context complexity flag indicating whether or not to change the context index assigned to the undecoded syntax in the target frequency domain according to the distribution of each syntax distribution in the target frequency domain. When the context complexity flag is 0 indicating low complexity, the context index is not changed due to the distribution bias. When the context complexity flag is 1 indicating high complexity, the context index is determined due to the distribution bias. Make changes.
 コンテキスト複雑度フラグは、図37に示すピクチャヘッダPHまたはスライスヘッダSHに含まれても構わない。また、ピクチャヘッダPHおよびスライスヘッダSHとは異なる情報、例えば、H.264におけるピクチャパラメータセットやシーケンスパラメータセットに含まれても構わない。コンテキスト複雑度フラグは、可変長符号復号部11内の図示しないヘッダ復号部もしくはパラメータセット復号部で復号され、量子化残差情報復号部111に伝達される。コンテキスト複雑度フラグが低複雑度を示す0の場合には、コンテキストインデックス変更部111dの動作は行わない。コンテキスト複雑度フラグが高複雑度を示す1の場合には、コンテキストインデックス変更部111dの動作は行わない。 The context complexity flag may be included in the picture header PH or the slice header SH shown in FIG. Also, information different from the picture header PH and the slice header SH, for example, H. It may be included in a picture parameter set or a sequence parameter set in H.264. The context complexity flag is decoded by a header decoding unit or a parameter set decoding unit (not shown) in the variable length code decoding unit 11 and transmitted to the quantization residual information decoding unit 111. When the context complexity flag is 0 indicating low complexity, the operation of the context index changing unit 111d is not performed. When the context complexity flag is 1 indicating high complexity, the operation of the context index changing unit 111d is not performed.
 このように、コンテキスト複雑度フラグを用いて、コンテキスト割り付け方法の切り替えを行うことにより、コンテキスト割り付け部の複雑度を制御することができる。コンテキスト複雑度フラグが低複雑度の場合には、全ての変形例に共通して、切り替えの処理量の削減が可能である。また、変形例4、変形例5のように偏りの有無に応じてコンテキストを切り替える構成の場合に適用した場合には、偏りの有無に応じたコンテキストを用意する必要がない分、メモリの削減が可能である。コンテキスト複雑度フラグが高複雑度の場合には、フラグが低複雑度の場合よりも高い復号化効率を実現できる。 In this way, the complexity of the context allocation unit can be controlled by switching the context allocation method using the context complexity flag. When the context complexity flag is low complexity, it is possible to reduce the amount of switching processing common to all the modified examples. In addition, when applied to a configuration in which contexts are switched according to the presence or absence of bias as in Modification 4 and Modification 5, it is not necessary to prepare a context according to the presence or absence of bias, so that the memory can be reduced. Is possible. When the context complexity flag is high complexity, higher decoding efficiency can be realized than when the flag is low complexity.
 以上、説明した構成によれば、復号対象の変換係数の周波数領域における位置だけではなく、復号済みの非0の変換係数の偏りに応じてコンテキストを切り替えることによって、変換係数の偏りが単位領域毎に異なる場合であっても、偏りに応じて、適切な確率状態を用いるため、高い符号化効率を有する符号化データを復号することができる。 As described above, according to the configuration described above, not only the position of the transform coefficient to be decoded in the frequency domain but also the context is switched according to the bias of the decoded non-zero transform coefficient, so that the bias of the transform coefficient is changed for each unit region. Even in a different case, since an appropriate probability state is used according to the bias, encoded data having high encoding efficiency can be decoded.
 (動画像符号化装置2)
 本実施形態に係る動画像符号化装置2の構成について図58~図60を参照して説明する。動画像符号化装置2は、その一部に、H.264/MPEG-4.AVC、VCEG(Video Coding Expert Group)における共同開発用コーデックであるKTAソフトウェアに採用されている技術、および、その後継コーデックであるTMuC(Test Model under Consideration)ソフトウェアに採用されている技術を含む符号化装置である。以下では、既に説明した部分と同じ部分については同じ符号を付し、その説明を省略する。
(Moving picture encoding device 2)
The configuration of the moving picture encoding apparatus 2 according to the present embodiment will be described with reference to FIGS. The moving image encoding apparatus 2 includes H.264 as a part thereof. H.264 / MPEG-4. Coding including technology adopted in KTA software, which is a codec for joint development in AVC and VCEG (Video Coding Expert Group), and technology adopted in TMuC (Test Model under Consideration) software, which is the successor codec Device. In the following, the same parts as those already described are denoted by the same reference numerals, and the description thereof is omitted.
 図58は、動画像符号化装置2の構成を示すブロック図である。図58に示すように、動画像符号化装置2は、予測画像生成部21、変換・量子化部22、逆量子化・逆変換部23、加算器24、フレームメモリ25、ループフィルタ26、可変長符号符号化部27、および、減算器28を備えている。また、図58に示すように、予測画像生成部21は、イントラ予測画像生成部21a、動きベクトル検出部21b、インター予測画像生成部21c、予測方式制御部21d、および、動きベクトル冗長性削除部21eを備えている。動画像符号化装置2は、動画像#10(符号化対象画像)を符号化することによって、符号化データ#1を生成する装置である。 FIG. 58 is a block diagram showing a configuration of the moving picture encoding apparatus 2. As illustrated in FIG. 58, the moving image encoding device 2 includes a predicted image generation unit 21, a transform / quantization unit 22, an inverse quantization / inverse transform unit 23, an adder 24, a frame memory 25, a loop filter 26, a variable A long code encoding unit 27 and a subtracter 28 are provided. As shown in FIG. 58, the prediction image generation unit 21 includes an intra prediction image generation unit 21a, a motion vector detection unit 21b, an inter prediction image generation unit 21c, a prediction method control unit 21d, and a motion vector redundancy deletion unit. 21e. The moving image encoding device 2 is a device that generates encoded data # 1 by encoding moving image # 10 (encoding target image).
 (予測画像生成部21)
 予測画像生成部21は、処理対象LCUを、1または複数の下位CUに再帰的に分割し、各リーフCUをさらに1または複数のパーティションに分割し、パーティション毎に、画面間予測を用いたインター予測画像Pred_Inter、または、画面内予測を用いたイントラ予測画像Pred_Intraを生成する。生成されたインター予測画像Pred_Interおよびイントラ予測画像Pred_Intraは、予測画像Predとして、加算器24および減算器28に供給される。
(Predicted image generation unit 21)
The predicted image generation unit 21 recursively divides the processing target LCU into one or a plurality of lower-order CUs, further divides each leaf CU into one or a plurality of partitions, and uses an inter-screen prediction for each partition. A predicted image Pred_Inter or an intra predicted image Pred_Intra using intra prediction is generated. The generated inter prediction image Pred_Inter and intra prediction image Pred_Intra are supplied to the adder 24 and the subtracter 28 as the prediction image Pred.
 なお、予測画像生成部21は、スキップモードの適応されたPUについては、当該PUに属する他のパラメータの符号化を省略する。また、(1)対象LCUにおける下位CUおよびパーティションへの分割の態様、(2)スキップモードを適用するか否か、および、(3)パーティション毎にインター予測画像Pred_Interおよびイントラ予測画像Pred_Intraの何れを生成するか、は、符号化効率を最適化するように決定される。 Note that the prediction image generation unit 21 omits encoding of other parameters belonging to the PU for the PU to which the skip mode is applied. Also, (1) the mode of division into lower CUs and partitions in the target LCU, (2) whether to apply the skip mode, and (3) which of the inter predicted image Pred_Inter and the intra predicted image Pred_Intra for each partition Whether to generate is determined so as to optimize the encoding efficiency.
 (イントラ予測画像生成部21a)
 イントラ予測画像生成部21aは、画面内予測によって、各パーティションに関する予測画像Pred_Intraを生成する。具体的には、(1)各パーティションついてイントラ予測に用いる予測モードを選択し、(2)選択した予測モードを用いて、復号画像Pから予測画像Pred_Intraを生成する。イントラ予測画像生成部21aは、生成したイントラ予測画像Pred_Intraを、予測方式制御部21dに供給する。
(Intra predicted image generation unit 21a)
The intra predicted image generation unit 21a generates a predicted image Pred_Intra for each partition by intra prediction. Specifically, (1) a prediction mode used for intra prediction is selected for each partition, and (2) a prediction image Pred_Intra is generated from the decoded image P using the selected prediction mode. The intra predicted image generation unit 21a supplies the generated intra predicted image Pred_Intra to the prediction method control unit 21d.
 また、イントラ予測画像生成部21aは、対象パーティションの周辺のパーティションに割り付けられた予測モードから対象パーティションに対する推定予測モードを決定し、当該推定予測モードと、対象パーティションについて実際に選択された予測モードとが同じであるか否かを示すフラグMPMを、イントラ予測パラメータPP_Intraの一部として、予測方式制御部21dを介して可変長符号符号化部27に供給し、可変長符号符号化部27は、当該フラグを、符号化データ#1に含める構成とする。 In addition, the intra predicted image generation unit 21a determines an estimated prediction mode for the target partition from the prediction modes assigned to the peripheral partitions of the target partition, and the estimated prediction mode and the prediction mode actually selected for the target partition Are supplied as a part of the intra prediction parameter PP_Intra to the variable length code encoding unit 27 via the prediction scheme control unit 21d, and the variable length code encoding unit 27 The flag is included in the encoded data # 1.
 また、イントラ予測画像生成部21aは、対象パーティションについての推定予測モードと、対象パーティションについて実際に選択された予測モードとが異なる場合には、対象パーティションについての予測モードを示す残余予測モードインデックスRIPMを、イントラ予測パラメータPP_Intraの一部として、予測方式制御部21dを介して可変長符号符号化部27に供給し、可変長符号符号化部27は当該残余予測モードインデックス符号化データ#1に含める構成とする。 In addition, when the estimated prediction mode for the target partition is different from the prediction mode actually selected for the target partition, the intra predicted image generation unit 21a sets the residual prediction mode index RIPM indicating the prediction mode for the target partition. , And supplied as a part of the intra prediction parameter PP_Intra to the variable length code encoding unit 27 via the prediction scheme control unit 21d, and the variable length code encoding unit 27 is included in the residual prediction mode index encoded data # 1 And
 (動きベクトル検出部21b)
 動きベクトル検出部21bは、各パーティションに関する動きベクトルmvを検出する。具体的には、(1)参照画像として利用する適応フィルタ済復号画像P_ALF’を選択し、(2)選択した適応フィルタ済復号画像P_ALF’において対象パーティションを最良近似する領域を探索することによって、対象パーティションに関する動きベクトルmvを検出する。ここで、適応フィルタ済復号画像P_ALF’は、既にフレーム全体の復号が完了した復号済みの復号画像に対して、ループフィルタ26による適応的フィルタ処理を施すことによって得られる画像であり、動きベクトル検出部21bは、適応フィルタ済復号画像P_ALF’を構成する各画素の画素値をフレームメモリ25から読み出すことができる。動きベクトル検出部21bは、検出した動きベクトルmvを、参照画像として利用した適応フィルタ済復号画像P_ALF’を指定する参照画像インデックスRIと共に、インター予測画像生成部21c及び動きベクトル冗長性削除部21eに供給する。
(Motion vector detection unit 21b)
The motion vector detection unit 21b detects a motion vector mv regarding each partition. Specifically, (1) by selecting an adaptive filtered decoded image P_ALF ′ used as a reference image, and (2) by searching for a region that best approximates the target partition in the selected adaptive filtered decoded image P_ALF ′, A motion vector mv related to the target partition is detected. Here, the adaptive filtered decoded image P_ALF ′ is an image obtained by performing an adaptive filter process by the loop filter 26 on a decoded image that has already been decoded for the entire frame, and is a motion vector detection unit. The unit 21b can read out the pixel value of each pixel constituting the adaptive filtered decoded image P_ALF ′ from the frame memory 25. The motion vector detection unit 21b sends the detected motion vector mv to the inter-predicted image generation unit 21c and the motion vector redundancy deletion unit 21e together with the reference image index RI designating the adaptive filtered decoded image P_ALF ′ used as a reference image. Supply.
 (インター予測画像生成部21c)
 インター予測画像生成部21cは、画面間予測によって、各インター予測パーティションに関する動き補償画像mcを生成する。具体的には、動きベクトル検出部21bから供給された動きベクトルmvを用いて、動きベクトル検出部21bから供給された参照画像インデックスRIによって指定される適応フィルタ済復号画像P_ALF’から動き補償画像mcを生成する。動きベクトル検出部21bと同様に、インター予測画像生成部21cは、適応フィルタ済復号画像P_ALF’を構成する各画素の画素値をフレームメモリ25から読み出すことができる。インター予測画像生成部21cは、生成した動き補償画像mc(インター予測画像Pred_Inter)を、動きベクトル検出部21bから供給された参照画像インデックスRIと共に、予測方式制御部21dに供給する。
(Inter prediction image generation unit 21c)
The inter prediction image generation unit 21c generates a motion compensated image mc related to each inter prediction partition by inter-screen prediction. Specifically, using the motion vector mv supplied from the motion vector detection unit 21b, the motion compensated image mc from the adaptive filtered decoded image P_ALF ′ designated by the reference image index RI supplied from the motion vector detection unit 21b. Is generated. Similar to the motion vector detection unit 21b, the inter prediction image generation unit 21c can read out the pixel value of each pixel constituting the adaptive filtered decoded image P_ALF ′ from the frame memory 25. The inter prediction image generation unit 21c supplies the generated motion compensated image mc (inter prediction image Pred_Inter) together with the reference image index RI supplied from the motion vector detection unit 21b to the prediction method control unit 21d.
 (予測方式制御部21d)
 予測方式制御部21dは、イントラ予測画像Pred_Intra及びインター予測画像Pred_Interを符号化対象画像と比較し、イントラ予測を行うかインター予測を行うかを選択する。イントラ予測を選択した場合、予測方式制御部21dは、イントラ予測画像Pred_Intraを予測画像Predとして加算器24及び減算器28に供給すると共に、イントラ予測画像生成部21aから供給されるイントラ予測パラメータPP_Intraを可変長符号符号化部27に供給する。一方、インター予測を選択した場合、予測方式制御部21dは、インター予測画像Pred_Interを予測画像Predとして加算器24及び減算器28に供給すると共に、参照画像インデックスRI、並びに、後述する動きベクトル冗長性削除部21eから供給された推定動きベクトルインデックスPMVI及び動きベクトル残差MVDをインター予測パラメータPP_Interとして可変長符号符号化部27に供給する。また、予測方式制御部21dは、イントラ予測画像Pred_Intra及びインター予測画像Pred_Interのうち何れの予測画像を選択したのかを示す予測タイプ情報PTを可変長符号符号化部27に供給する。
(Prediction method controller 21d)
The prediction scheme control unit 21d compares the intra predicted image Pred_Intra and the inter predicted image Pred_Inter with the encoding target image, and selects whether to perform intra prediction or inter prediction. When the intra prediction is selected, the prediction scheme control unit 21d supplies the intra prediction image Pred_Intra as the prediction image Pred to the adder 24 and the subtracter 28, and sets the intra prediction parameter PP_Intra supplied from the intra prediction image generation unit 21a. This is supplied to the variable length code encoding unit 27. On the other hand, when the inter prediction is selected, the prediction scheme control unit 21d supplies the inter prediction image Pred_Inter as the prediction image Pred to the adder 24 and the subtracter 28, and the reference image index RI and motion vector redundancy described later. The estimated motion vector index PMVI and the motion vector residual MVD supplied from the deletion unit 21e are supplied to the variable length code encoding unit 27 as an inter prediction parameter PP_Inter. In addition, the prediction scheme control unit 21 d supplies the prediction type information PT indicating which prediction image is selected from the intra prediction image Pred_Intra and the inter prediction image Pred_Inter to the variable length code encoding unit 27.
 (動きベクトル冗長性削除部21e)
 動きベクトル冗長性削除部21eは、動きベクトル検出部21bによって検出された動きベクトルmvにおける冗長性を削除する。具体的には、(1)動きベクトルmvの推定に用いる推定方法を選択し、(2)選択した推定方法に従って推定動きベクトルpmvを導出し、(3)動きベクトルmvから推定動きベクトルpmvを減算することにより動きベクトル残差MVDを生成する。動きベクトル冗長性削除部21eは、生成した動きベクトル残差MVDを、選択した推定方法を示す推定動きベクトルインデックスPMVIと共に、予測方式制御部21dに供給する。
(Motion vector redundancy deleting unit 21e)
The motion vector redundancy deletion unit 21e deletes redundancy in the motion vector mv detected by the motion vector detection unit 21b. Specifically, (1) an estimation method used for estimating the motion vector mv is selected, (2) an estimated motion vector pmv is derived according to the selected estimation method, and (3) the estimated motion vector pmv is subtracted from the motion vector mv. As a result, a motion vector residual MVD is generated. The motion vector redundancy deleting unit 21e supplies the generated motion vector residual MVD to the prediction method control unit 21d together with the estimated motion vector index PMVI indicating the selected estimation method.
 (変換・量子化部22)
 変換・量子化部22は、(1)符号化対象画像から予測画像Predを減算した予測残差Dをブロック(変換単位)毎にDCT変換(Discrete Cosine Transform)し、(2)DCT変換により得られた変換係数Coeff_IQを量子化し、(3)量子化により得られた変換係数Coeffを可変長符号符号化部27及び逆量子化・逆変換部23に供給する。なお、変換・量子化部22は、(1)量子化の際に用いる量子化ステップQPをTU毎に選択し、(2)選択した量子化ステップQPの大きさを示す量子化パラメータ差分Δqpを可変長符号符号化部28に供給し、(3)選択した量子化ステップQPを逆量子化・逆変換部23に供給する。ここで、量子化パラメータ差分Δqpとは、DCT変換/量子化するTUに関する量子化パラメータqp(例えばQP=2pq/6)の値から、直前にDCT変換/量子化したTUに関する量子化パラメータqp’の値を減算して得られる差分値のことを指す。
(Transformation / quantization unit 22)
The transform / quantization unit 22 performs (1) DCT transform (Discrete Cosine Transform) for each block (transform unit) on the prediction residual D obtained by subtracting the predicted image Pred from the encoding target image, and (2) obtains the DCT transform. The obtained transform coefficient Coeff_IQ is quantized, and (3) the transform coefficient Coeff obtained by the quantization is supplied to the variable length code encoding unit 27 and the inverse quantization / inverse transform unit 23. The transform / quantization unit 22 (1) selects a quantization step QP to be used for quantization for each TU, and (2) sets a quantization parameter difference Δqp indicating the size of the selected quantization step QP. The variable length code encoding unit 28 is supplied, and (3) the selected quantization step QP is supplied to the inverse quantization / inverse transform unit 23. Here, the quantization parameter difference Δqp is the quantization parameter qp for the TU that has been DCT transformed / quantized immediately before, based on the value of the quantization parameter qp (for example, QP = 2 pq / 6 ) for the TU to be DCT transformed / quantized. The difference value obtained by subtracting the value of '.
 なお、変換・量子化部22によって行われるDCT変換は、例えば、対象ブロックのサイズが8×8画素である場合、水平方向の周波数uおよび垂直方向の周波数vについての量子化前の変換係数をCoeff_IQ(u、v)(0≦u≦7、0≦v≦7)と表すことにすると、例えば、以下の数式(4)によって与えられる。 Note that the DCT transform performed by the transform / quantization unit 22 is, for example, when transforming coefficients before quantization for the horizontal frequency u and the vertical frequency v when the size of the target block is 8 × 8 pixels. Coeff_IQ (u, v) (0 ≦ u ≦ 7, 0 ≦ v ≦ 7), for example, is given by the following mathematical formula (4).
Figure JPOXMLDOC01-appb-M000004
Figure JPOXMLDOC01-appb-M000004
ここで、D(i、j)(0≦i≦7、0≦j≦7)は、対象ブロックにおける位置(i、j)での予測残差Dを表している。また、C(u)およびC(v)は、以下のように与えられる。 Here, D (i, j) (0 ≦ i ≦ 7, 0 ≦ j ≦ 7) represents the prediction residual D at the position (i, j) in the target block. C (u) and C (v) are given as follows.
 ・C(u)=1/√2 (u=0)
 ・C(u)=1    (u≠0)
 ・C(v)=1/√2 (v=0)
 ・C(v)=1    (v≠0)
 (逆量子化・逆変換部23)
 逆量子化・逆変換部23は、(1)量子化された変換係数Coeffを逆量子化し、(2)逆量子化によって得られた変換係数Coeff_IQを逆DCT(Discrete Cosine Transform)変換し、(3)逆DCT変換によって得られた予測残差Dを加算器24に供給する。量子化された変換係数Coeffを逆量子化する際には、変換・量子化部22から供給された量子化ステップQPを利用する。なお、逆量子化・逆変換部23から出力される予測残差Dは、変換・量子化部22に入力される予測残差Dに量子化誤差が加わったものであるが、ここでは簡単のために共通の呼称を用いる。逆量子化・逆変換部23のより具体的な動作は、動画像復号装置1の備える逆量子化・逆変換部13とほぼ同様である。
・ C (u) = 1 / √2 (u = 0)
・ C (u) = 1 (u ≠ 0)
・ C (v) = 1 / √2 (v = 0)
・ C (v) = 1 (v ≠ 0)
(Inverse quantization / inverse transform unit 23)
The inverse quantization / inverse transform unit 23 (1) inversely quantizes the quantized transform coefficient Coeff, and (2) performs inverse DCT (Discrete Cosine Transform) transform on the transform coefficient Coeff_IQ obtained by inverse quantization. 3) The prediction residual D obtained by the inverse DCT transform is supplied to the adder 24. When the quantized transform coefficient Coeff is inversely quantized, the quantization step QP supplied from the transform / quantization unit 22 is used. Note that the prediction residual D output from the inverse quantization / inverse transform unit 23 is obtained by adding a quantization error to the prediction residual D input to the transform / quantization unit 22. Common names are used for this purpose. A more specific operation of the inverse quantization / inverse transform unit 23 is substantially the same as that of the inverse quantization / inverse transform unit 13 included in the video decoding device 1.
 (加算器24)
 加算器24は、予測方式制御部21dにて選択された予測画像Predを、逆量子化・逆変換部23にて生成された予測残差Dに加算することによって、(局所)復号画像Pを生成する。加算器24にて生成された(局所)復号画像Pは、ループフィルタ26に供給されると共にフレームメモリ25に格納され、イントラ予測における参照画像として利用される。
(Adder 24)
The adder 24 adds the predicted image Pred selected by the prediction scheme control unit 21d to the prediction residual D generated by the inverse quantization / inverse transform unit 23, thereby obtaining the (local) decoded image P. Generate. The (local) decoded image P generated by the adder 24 is supplied to the loop filter 26 and stored in the frame memory 25, and is used as a reference image in intra prediction.
 (可変長符号符号化部27)
 可変長符号符号化部27は、(1)変換・量子化部22から供給された量子化後の変換係数Coeff並びにΔqp、(2)予測方式制御部21dから供給された量子化パラメータPP(インター予測パラメータPP_Inter、および、イントラ予測パラメータPP_Intra)、(3)予測タイプ情報、および、(4)ループフィルタ26から供給されたフィルタパラメータFPを可変長符号化することによって、符号化データ#1を生成する。
(Variable-length code encoding unit 27)
The variable length code encoding unit 27 (1) the quantized transform coefficient Coeff and Δqp supplied from the transform / quantization unit 22, and (2) the quantization parameter PP (interpolation) supplied from the prediction scheme control unit 21d. Prediction parameter PP_Inter and intra prediction parameter PP_Intra), (3) Prediction type information, and (4) Encoding data # 1 is generated by variable-length encoding the filter parameter FP supplied from the loop filter 26. To do.
 図59は、可変長符号符号化部27の構成を示すブロック図である。図59に示すように、可変長符号符号化部27は、量子化後の変換係数Coeffを符号化する量子化残差情報符号化部271、予測パラメータPPを符号化する予測パラメータ符号化部272、予測タイプ情報を符号化する予測タイプ情報符号化部273、および、フィルタパラメータFPを符号化するフィルタパラメータ符号化部274を備えている。量子化残差情報符号化部271の具体的な構成については後述するためここでは説明を省略する。 FIG. 59 is a block diagram showing a configuration of the variable-length code encoding unit 27. As shown in FIG. 59, the variable-length code encoding unit 27 includes a quantization residual information encoding unit 271 that encodes the quantized transform coefficient Coeff, and a prediction parameter encoding unit 272 that encodes the prediction parameter PP. A prediction type information encoding unit 273 that encodes the prediction type information, and a filter parameter encoding unit 274 that encodes the filter parameter FP. Since the specific configuration of the quantization residual information encoding unit 271 will be described later, the description thereof is omitted here.
 (減算器28)
 減算器28は、予測方式制御部21dにて選択された予測画像Predを、符号化対象画像から減算することによって、予測残差Dを生成する。減算器28にて生成された予測残差Dは、変換・量子化部22によってDCT変換/量子化される。
(Subtractor 28)
The subtracter 28 generates the prediction residual D by subtracting the prediction image Pred selected by the prediction method control unit 21d from the encoding target image. The prediction residual D generated by the subtracter 28 is DCT transformed / quantized by the transform / quantization unit 22.
 (ループフィルタ26)
 ループフィルタ26は、(1)復号画像Pにおけるブロック境界、またはパーティション境界の周辺の画像の平滑化(デブロック処理)を行うデブロッキングフィルタ(DF:Deblocking Filter)としての機能と、(2)デブロッキングフィルタが作用した画像に対して、フィルタパラメータFPを用いて適応フィルタ処理を行う適応フィルタ(ALF:Adaptive Loop Filter)としての機能を有している。
(Loop filter 26)
The loop filter 26 includes (1) a function as a deblocking filter (DF: Deblocking Filter) that performs smoothing (deblocking processing) on an image around a block boundary or partition boundary in the decoded image P; It has a function as an adaptive filter (ALF: Adaptive Loop Filter) which performs an adaptive filter process using the filter parameter FP with respect to the image which the blocking filter acted on.
 (量子化残差情報符号化部271)
 量子化残差情報符号化部271は、変換係数Coeffをコンテキスト適応型2値算術符号化(CABAC:(Context-based Adaptive Binary Arithmetic Coding))することによって、量子化残差情報QDを生成する。生成された量子化残差情報QDに含まれるシンタックスは、図38に示した通りである。
(Quantization residual information encoding unit 271)
The quantization residual information encoding unit 271 generates quantization residual information QD by performing context adaptive binary arithmetic coding (CABAC) on the transform coefficient Coeff. The syntax included in the generated quantization residual information QD is as shown in FIG.
 図60は、量子化残差情報符号化部271の構成を示すブロック図である。図60に示すように、量子化残差情報符号化部271は、コンテキストインデックス割り付け部271a、変換係数符号化部271b、コンテキスト変数管理部271c、および、コンテキストインデックス変更部271dを備えている。 FIG. 60 is a block diagram illustrating a configuration of the quantization residual information encoding unit 271. As illustrated in FIG. 60, the quantization residual information encoding unit 271 includes a context index allocation unit 271a, a transform coefficient encoding unit 271b, a context variable management unit 271c, and a context index change unit 271d.
 (コンテキストインデックス割り付け部271a)
 コンテキストインデックス割り付け部271aは、処理対象の周波数領域における各周波数成分に対して。該周波数成分の周波数領域における位置に応じて、コンテキストインデックスctxIdxを割り付ける。コンテキストインデックス割り付け部271aの具体的な動作は、動画像復号装置1の備えるコンテキストインデックス割り付け部111aと同様であるためここでは説明を省略する。
(Context index allocation unit 271a)
The context index assigning unit 271a performs each frequency component in the frequency domain to be processed. A context index ctxIdx is assigned according to the position of the frequency component in the frequency domain. The specific operation of the context index allocating unit 271a is the same as that of the context index allocating unit 111a included in the video decoding device 1, and thus the description thereof is omitted here.
 (コンテキスト変数管理部271c)
 コンテキスト変数管理部271cは、各コンテキストに対応したコンテキスト変数CVを管理する。コンテキスト変数管理部271cによって管理されるコンテキスト変数CVには、(1)発生確率が高い優勢シンボルMPS(most probable symbol)と、(2)その優勢シンボルMPSの発生確率を指定する確率状態インデックスpStateIdxとを含んでいる。また、各コンテキスト変数CVは、コンテキストインデックスctxIdxによって特定される。
(Context variable management unit 271c)
The context variable management unit 271c manages the context variable CV corresponding to each context. The context variable CV managed by the context variable management unit 271c includes (1) a dominant symbol MPS (most probable symbol) having a high occurrence probability, and (2) a probability state index pStateIdx that specifies the occurrence probability of the dominant symbol MPS. Is included. Each context variable CV is specified by a context index ctxIdx.
 コンテキスト変数管理部271cは、変換係数符号化部271bが1つのシンボルを符号化する毎に、確率状態インデックスpStateIdxによって指定される発生確率を更新する。 The context variable management unit 271c updates the occurrence probability specified by the probability state index pStateIdx every time the transform coefficient encoding unit 271b encodes one symbol.
 (変換係数符号化部271b)
 変換係数符号化部271bは、処理対象の周波数成分である対象周波数成分に割り付けられたコンテキストインデックスctxIdxを参照し、対象周波数成分についての変換係数Coeff(PosX、PosY)を符号化することによって、各種のシンタックスsig_flag、last_flag、abs_greater_one、coeff_abs_level、およびsignについての符号化データを生成する。
(Transform coefficient coding unit 271b)
The transform coefficient encoding unit 271b refers to the context index ctxIdx assigned to the target frequency component that is the frequency component to be processed, and encodes the transform coefficient Coeff (PosX, PosY) for the target frequency component, thereby Encoded data for the syntax sig_flag, last_flag, abs_greater_one, coeff_abs_level, and sign is generated.
 また、変換係数符号化部271bは、シンタックスsig_flag(PosX,PosY)をコンテキストインデックス変更部271dに供給する。 Also, the transform coefficient encoding unit 271b supplies the syntax sig_flag (PosX, PosY) to the context index changing unit 271d.
 (各種シンタックスの符号化処理)
 変換係数符号化部271bによる各種のシンタックスsig_flag、last_flag、abs_greater_one、coeff_abs_level、およびsignについての符号化データの生成処理について説明する。変換係数符号化部271bは、符号化対象の各シンタックスについて、2値化処理および2値算術符号符号化処理を行うことによって、シンタックス毎に符号化データを生成する。
(Encoding process of various syntaxes)
A process for generating encoded data for various syntaxes sig_flag, last_flag, abs_greater_one, coeff_abs_level, and sign by the transform coefficient encoding unit 271b will be described. The transform coefficient encoding unit 271b generates encoded data for each syntax by performing binarization processing and binary arithmetic code encoding processing on each syntax to be encoded.
 2値化処理とは、入力される多値データを2値データに変換する処理のことである。各シンタックスについて2値化処理を行うことによって、各シンタックスについての2値化データが生成される。 Binary processing is processing that converts input multi-value data into binary data. By performing binarization processing for each syntax, binary data for each syntax is generated.
 2値算術符号符号化処理とは、各シンタックスについての2値化データを算術符号化する処理のことである。変換係数符号化部271bは、シンボル(2値データの1ビット、Binとも呼ぶ)を1つ符号化する際、処理対象の周波数領域に割り付けられたコンテキストインデックスctxIdx(PosX,PosY)を参照し、当該コンテキストインデックスによって指定されるコンテキスト変数CV(ctxIdx)を、コンテキスト変数管理部271cから取得する。変換係数符号化部271bは、取得したコンテキスト変数CV(ctxIdx)に含まれる確率状態インデックスpStateIdxによって指定される発生確率に応じた算術符号化を行うことによって、符号化対象のシンタックスについての2値化データを符号化し、符号化対象のシンタックスについての符号化データを生成する。なお、確率状態インデックスpStateIdxによって指定される発生確率は、シンボルを1つ符号化する毎に、コンテキスト変数管理部271cにて更新される。 Binary arithmetic code encoding processing is processing for arithmetically encoding binary data for each syntax. The transform coefficient encoding unit 271b refers to the context index ctxIdx (PosX, PosY) assigned to the frequency domain to be processed when encoding one symbol (1 bit of binary data, also referred to as Bin), The context variable CV (ctxIdx) specified by the context index is acquired from the context variable management unit 271c. The transform coefficient encoding unit 271b performs binary encoding on the syntax to be encoded by performing arithmetic encoding according to the occurrence probability specified by the probability state index pStateIdx included in the acquired context variable CV (ctxIdx). The encoded data is encoded, and encoded data for the syntax to be encoded is generated. The occurrence probability specified by the probability state index pStateIdx is updated by the context variable management unit 271c every time one symbol is encoded.
 変換係数符号化部271bによる各周波数成分のスキャン順序については、(変換係数復号部111bによる各周波数成分のスキャン順序)において説明したものと略同様である。ただし、(変換係数復号部111bによる各周波数成分のスキャン順序)における「復号」を「符号化」と読み替えるものとする。また、変換係数符号化部271bは、スキャン順で最後の変換係数について、last_flag=1を符号化するものとする。 The scan order of each frequency component by the transform coefficient encoding unit 271b is substantially the same as that described in (Scan order of each frequency component by the transform coefficient decoding unit 111b). However, “decoding” in (scan order of each frequency component by the transform coefficient decoding unit 111b) is read as “encoding”. The transform coefficient encoding unit 271b encodes last_flag = 1 for the last transform coefficient in the scan order.
 (コンテキストインデックス変更部271d)
 コンテキストインデックス変更部111dは、変換係数符号化部271bから供給されるシンタックスsig_flag(PosX,PosY)を参照し、周波数領域における非0の変換係数の分布の偏りを判定し、判定結果に応じて、周波数領域における未符号化成分について割り付けられるコンテキストインデックスを変更する。
(Context index change unit 271d)
The context index changing unit 111d refers to the syntax sig_flag (PosX, PosY) supplied from the transform coefficient encoding unit 271b, determines the bias of the non-zero transform coefficient distribution in the frequency domain, and depends on the determination result , Change the context index allocated for the uncoded components in the frequency domain.
 コンテキストインデックス変更部271dによるコンテキストインデックス変更処理は、コンテキストインデックス変更部111dによる(コンテキストインデックス変更処理例1)、および(コンテキストインデックス変更処理例2)と同様であるため、ここでは説明を省略する。また、コンテキストインデックス変更部271dは、コンテキストインデックス変更部111dについて説明した<変形例1>~<変形例7>と同様の処理を行う構成としてもよい。ただし、(コンテキストインデックス変更処理例1)、(コンテキストインデックス変更処理例2)、<変形例1>~<変形例7>における「復号」を「符号化」と読み替えるものとする。 The context index changing process by the context index changing unit 271d is the same as (context index changing process example 1) and (context index changing process example 2) by the context index changing unit 111d, and thus description thereof is omitted here. Further, the context index changing unit 271d may be configured to perform the same processing as in <Modification 1> to <Modification 7> described for the context index changing unit 111d. However, “decoding” in (context index change processing example 1), (context index change processing example 2) and <variation 1> to <variation 7> is read as “encoding”.
 本構成の動画像復号装置1はまた、対象周波数領域における各シンタックスの分布の偏りに応じて、対象周波数領域における未符号化成分のシンタックスに割り付けるコンテキストインデックスを変更するか否かを示すコンテキスト複雑度フラグを符号化することができる。コンテキスト複雑度フラグは、図37に示すピクチャヘッダPHまたはスライスヘッダSHに含めて符号化する。ピクチャヘッダPHおよびスライスヘッダSHとは異なる情報、例えば、H.264と同様にピクチャパラメータセットやシーケンスパラメータセットを符号化する場合には、そこで符号化されるパラメータにコンテキスト複雑度フラグの意味を持たせても構わない。コンテキスト複雑度フラグは、可変長符号符号化部27内の図示しないヘッダ符号化部もしくはパラメータセット符号化部で決定され、符号化される。符号化されるコンテキスト複雑度フラグは、量子化残差情報符号化部271に伝達され、コンテキスト複雑度フラグが低複雑度を示す0の場合には、コンテキストインデックス変更部271dは変更動作を行わず、高複雑度を示す1の場合には変更動作を行う。変更動作を行わない場合には低複雑度・低符号化効率であり、変更動作を行う場合には高複雑度・高効率となる。従って、コンテキスト複雑度フラグを含む構成によれば、複雑度と符号化効率のバランスを選択することができる。 The moving picture decoding apparatus 1 of the present configuration also has a context indicating whether or not to change a context index assigned to the syntax of an uncoded component in the target frequency domain in accordance with the distribution of each syntax in the target frequency domain. The complexity flag can be encoded. The context complexity flag is encoded by being included in the picture header PH or the slice header SH shown in FIG. Information different from the picture header PH and the slice header SH, for example, H.264. Similarly to H.264, when a picture parameter set or a sequence parameter set is encoded, the parameter encoded there may have a meaning of a context complexity flag. The context complexity flag is determined and encoded by a header encoding unit or a parameter set encoding unit (not shown) in the variable length code encoding unit 27. The context complexity flag to be encoded is transmitted to the quantization residual information encoding unit 271. When the context complexity flag is 0 indicating low complexity, the context index changing unit 271d does not perform the changing operation. In the case of 1 indicating high complexity, the changing operation is performed. When the changing operation is not performed, the complexity is low and the coding efficiency is low. When the changing operation is performed, the complexity is high and the efficiency is high. Therefore, according to the configuration including the context complexity flag, the balance between the complexity and the encoding efficiency can be selected.
 (付記事項)
 上述した動画像復号装置1、および動画像符号化装置2の各ブロックは、集積回路(ICチップ)上に形成された論理回路によってハードウェア的に実現してもよいし、CPU(Central Processing Unit)を用いてソフトウェア的に実現してもよい。
(Additional notes)
Each block of the moving picture decoding apparatus 1 and the moving picture encoding apparatus 2 described above may be realized in hardware by a logic circuit formed on an integrated circuit (IC chip), or may be a CPU (Central Processing Unit). ) May be implemented in software.
 後者の場合、上記各装置は、各機能を実現するプログラムの命令を実行するCPU、上記プログラムを格納したROM(Read Only Memory)、上記プログラムを展開するRAM(Random Access Memory)、上記プログラムおよび各種データを格納するメモリ等の記憶装置(記録媒体)などを備えている。そして、本発明の目的は、上述した機能を実現するソフトウェアである上記各装置の制御プログラムのプログラムコード(実行形式プログラム、中間コードプログラム、ソースプログラム)をコンピュータで読み取り可能に記録した記録媒体を、上記各装置に供給し、そのコンピュータ(またはCPUやMPU)が記録媒体に記録されているプログラムコードを読み出し実行することによっても、達成可能である。 In the latter case, each device includes a CPU that executes instructions of a program that realizes each function, a ROM (Read (Memory) that stores the program, a RAM (Random Memory) that expands the program, the program, and various types A storage device (recording medium) such as a memory for storing data is provided. An object of the present invention is to provide a recording medium in which a program code (execution format program, intermediate code program, source program) of a control program of each of the above devices, which is software that realizes the above-described functions, is recorded so as to be readable by a computer. This can also be achieved by supplying to each of the above devices and reading and executing the program code recorded on the recording medium by the computer (or CPU or MPU).
 上記記録媒体としては、例えば、磁気テープやカセットテープ等のテープ類、フロッピー(登録商標)ディスク/ハードディスク等の磁気ディスクやCD-ROM/MO/MD/DVD/CD-R等の光ディスクを含むディスク類、ICカード(メモリカードを含む)/光カード等のカード類、マスクROM/EPROM/EEPROM/フラッシュROM等の半導体メモリ類、あるいはPLD(Programmable logic device)やFPGA(Field Programmable Gate Array)等の論理回路類などを用いることができる。 Examples of the recording medium include tapes such as magnetic tapes and cassette tapes, magnetic disks such as floppy (registered trademark) disks / hard disks, and disks including optical disks such as CD-ROM / MO / MD / DVD / CD-R. IC cards (including memory cards) / optical cards, semiconductor memories such as mask ROM / EPROM / EEPROM / flash ROM, or PLD (Programmable logic device) or FPGA (Field Programmable Gate Array) Logic circuits can be used.
 また、上記各装置を通信ネットワークと接続可能に構成し、上記プログラムコードを通信ネットワークを介して供給してもよい。この通信ネットワークは、プログラムコードを伝送可能であればよく、特に限定されない。例えば、インターネット、イントラネット、エキストラネット、LAN、ISDN、VAN、CATV通信網、仮想専用網(Virtual Private Network)、電話回線網、移動体通信網、衛星通信網等が利用可能である。また、この通信ネットワークを構成する伝送媒体も、プログラムコードを伝送可能な媒体であればよく、特定の構成または種類のものに限定されない。例えば、IEEE1394、USB、電力線搬送、ケーブルTV回線、電話線、ADSL(Asymmetric Digital Subscriber Line)回線等の有線でも、IrDAやリモコンのような赤外線、Bluetooth(登録商標)、IEEE802.11無線、HDR(High Data Rate)、NFC(Near Field Communication)、DLNA(Digital Living Network Alliance)、携帯電話網、衛星回線、地上波デジタル網等の無線でも利用可能である。 Also, each of the above devices may be configured to be connectable to a communication network, and the program code may be supplied via the communication network. The communication network is not particularly limited as long as it can transmit the program code. For example, the Internet, intranet, extranet, LAN, ISDN, VAN, CATV communication network, virtual private network (Virtual Private Network), telephone line network, mobile communication network, satellite communication network, etc. can be used. The transmission medium constituting the communication network may be any medium that can transmit the program code, and is not limited to a specific configuration or type. For example, even in the case of wired lines such as IEEE 1394, USB, power line carrier, cable TV line, telephone line, ADSL (Asymmetric Digital Subscriber Line) line, infrared rays such as IrDA and remote control, Bluetooth (registered trademark), IEEE 802.11 wireless, HDR ( It can also be used by wireless such as High Data Rate, NFC (Near Field Communication), DLNA (Digital Living Network Alliance), mobile phone network, satellite line, and terrestrial digital network.
 本発明は上述した各実施形態に限定されるものではなく、請求項に示した範囲で種々の変更が可能であり、異なる実施形態にそれぞれ開示された技術的手段を適宜組み合わせて得られる実施形態についても本発明の技術的範囲に含まれる。 The present invention is not limited to the above-described embodiments, and various modifications are possible within the scope shown in the claims, and embodiments obtained by appropriately combining technical means disclosed in different embodiments. Is also included in the technical scope of the present invention.
 以上に示したように、本発明に係る動画像復号装置1では、量子化残差情報復号部111を備える。量子化残差情報復号部111は、対象周波数領域における各シンタックスに対してコンテキストインデックスを割り付けるコンテキストインデックス割り付け部111aと、対象周波数領域における各シンタックスを、該シンタックスに対して割り付けられたコンテキストインデックスによって指定される確率状態に基づいて順次算術復号すると共に、復号された各シンタックスから各変換係数を復元する変換係数復号部111bと、対象周波数領域における復元済みの非0変換係数の分布の偏りに応じて、該対象周波数領域における未復号のシンタックスに割り付けるコンテキストインデックスを変更するコンテキストインデックス変更部111dと、を備える構成である。これにより、符号化効率の高い算術復号装置を実現することができる。 As described above, the moving picture decoding apparatus 1 according to the present invention includes the quantization residual information decoding unit 111. The quantized residual information decoding unit 111 includes a context index allocating unit 111a that allocates a context index to each syntax in the target frequency domain, and a context allocated to each syntax in the target frequency domain. A transform coefficient decoding unit 111b that sequentially performs arithmetic decoding based on the probability state specified by the index and restores each transform coefficient from each decoded syntax, and a distribution of restored non-zero transform coefficients in the target frequency domain And a context index changing unit 111d that changes a context index assigned to an undecoded syntax in the target frequency domain according to the bias. Thereby, an arithmetic decoding apparatus with high encoding efficiency can be realized.
 また、本発明は、以下のように表現することもできる。すなわち、本発明に係る算術復号装置は、対象画像を単位領域毎に周波数変換して得られる各変換係数について、該変換係数を表す1または複数種類のシンタックスを算術符号化することによって得られた符号化データを復号する算術復号装置であって、処理対象の単位領域に対応する対象周波数領域における各シンタックスに対して、該シンタックスの種類および該シンタックスの該対象周波数領域における位置に応じて定まるコンテキストインデックスを割り付けるコンテキストインデックス割り付け手段と、上記対象周波数領域における各シンタックスを、該シンタックスに対して割り付けられたコンテキストインデックスによって指定される確率状態に基づいて順次算術復号するシンタックス復号手段と、上記シンタックス復号手段によって復号された各シンタックスから各変換係数を復元する変換係数復元手段と、上記対象周波数領域における復元済みの非0変換係数の分布の偏りに応じて、該対象周波数領域における未復号のシンタックスに割り付けるコンテキストインデックスを変更するコンテキストインデックス変更手段と、を備える構成である。 Further, the present invention can also be expressed as follows. That is, the arithmetic decoding device according to the present invention is obtained by arithmetically encoding one or a plurality of types of syntax representing the transform coefficient for each transform coefficient obtained by frequency transforming the target image for each unit region. An arithmetic decoding apparatus for decoding encoded data, wherein each syntax in a target frequency domain corresponding to a unit area to be processed has a type of syntax and a position of the syntax in the target frequency domain. Context index allocating means for allocating a context index determined in accordance with the syntax decoding, and sequentially decoding each syntax in the target frequency domain based on a probability state specified by the context index allocated to the syntax Means and the syntax decoding means Therefore, the transform coefficient restoring means for restoring each transform coefficient from each decoded syntax, and the undecoded syntax in the target frequency domain according to the distribution of the restored non-zero transform coefficient in the target frequency domain And a context index changing means for changing a context index to be allocated.
 上記のように構成された算術復号装置によれば、上記コンテキストインデックス割り付け手段は、対象周波数領域における各シンタックスに対して、該シンタックスの種類および該シンタックスの該対象周波数領域における位置に応じて定まるコンテキストインデックスを割り付ける。また、上記コンテキストインデックス変更手段は、上記対象周波数領域における復号済みの非0変換係数の分布の偏りに応じて、該対象周波数領域における未復号のシンタックスに割り付けるコンテキストインデックスを変更し、上記シンタックス復号手段は、上記未復号のシンタックスに割り付けられた変更後のコンテキストインデックスによって指定される確率状態に基づいて、該未復号のシンタックスを復号する。 According to the arithmetic decoding apparatus configured as described above, the context index allocating unit is responsive to each syntax in the target frequency domain according to the type of syntax and the position of the syntax in the target frequency domain. Assign a context index. Further, the context index changing means changes a context index assigned to an undecoded syntax in the target frequency domain according to a bias of a distribution of decoded non-zero transform coefficients in the target frequency domain, and The decoding means decodes the undecoded syntax based on the probability state specified by the changed context index assigned to the undecoded syntax.
 したがって、上記のように構成された算術復号装置によれば、上記対象周波数領域における復号済みの非0変換係数の分布の偏りに応じて、未復号のシンタックスを復号するための適切な確率状態を指定し、該適切な確率状態に基づいて、上記未復号のシンタックスを復号することができる。 Therefore, according to the arithmetic decoding apparatus configured as described above, an appropriate probability state for decoding the undecoded syntax according to the distribution bias of the decoded non-zero transform coefficient in the target frequency domain And the undecoded syntax can be decoded based on the appropriate probability state.
 上記の構成に対応する構成を有する算術符号化装置によれば、変換係数を表す各シンタックスを、適切な確率状態に基づいて符号化することができるので、各変換係数の偏りが単位領域毎に異なる場合であっても、高い符号化効率を有する符号化データを生成することができる。 According to the arithmetic coding apparatus having a configuration corresponding to the above configuration, each syntax representing a transform coefficient can be coded based on an appropriate probability state. Even in a different case, encoded data having high encoding efficiency can be generated.
 上記のように構成された算術復号装置によれば、そのような符号化効率の高い符号化データを復号することができる。 According to the arithmetic decoding apparatus configured as described above, it is possible to decode such encoded data with high encoding efficiency.
 なお、上記単位領域とは、例えば、TMuC(Test Model under Consideration)におけるTU(変換単位)、または、TUを分割して得られるブロックに対応する。 The unit area corresponds to, for example, a TU (conversion unit) in TMuC (Test (under Consideration) or a block obtained by dividing the TU.
 また、上記対象周波数領域における水平方向および垂直方向の座標をそれぞれuおよびvと表し、上記コンテキストインデックス割り付け手段によって未復号のシンタックスに割り付けられたコンテキストインデックスをctxIdx(u、v)と表したとき、上記コンテキストインデックス変更手段は、上記対象周波数領域における復号済みの非0変換係数の分布が、水平方向および垂直方向のうち、予め定められた方向に偏っている場合に、上記未復号のシンタックスに割り付けられたコンテキストインデックスctxIdx(u、v)を
  ctxIdx’(u、v)=ctxIdx(v、u)
によって与えられるコンテキストインデックスctxIdx’(u、v)に変更するものである、ことが好ましい。
Also, when the horizontal and vertical coordinates in the target frequency domain are represented as u and v, respectively, and the context index assigned to the undecoded syntax by the context index assigning means is represented as ctxIdx (u, v). The context index changing means, when the distribution of the decoded non-zero transform coefficients in the target frequency domain is biased in a predetermined direction of the horizontal direction and the vertical direction, the undecoded syntax Context index ctxIdx (u, v) assigned to ctxIdx ′ (u, v) = ctxIdx (v, u)
It is preferable to change to the context index ctxIdx ′ (u, v) given by
 上記の構成によれば、上記対象周波数領域における復号済みの非0変換係数の分布が、水平方向および垂直方向のうち、予め定められた方向に偏っている場合に、上記コンテキストインデックス割り付け手段によって上記未復号のシンタックスに割り付けられたコンテキストインデックスを、該コンテキストインデックスの引数を入れ替えることによって得られるコンテキストインデックスに変更する。 According to the above configuration, when the distribution of the decoded non-zero transform coefficients in the target frequency domain is biased in a predetermined direction between the horizontal direction and the vertical direction, the context index allocation unit performs the above The context index assigned to the undecoded syntax is changed to a context index obtained by replacing the argument of the context index.
 したがって、上記の構成によれば、上記予め定められた方向に偏りをもって分布している各変換係数のシンタックスを、各変換係数が上記予め定められた方向以外の方向に偏りをもって分布する場合に用いられるコンテキストインデックスを用いて復号することができる。 Therefore, according to the above configuration, the syntax of each transform coefficient distributed with a bias in the predetermined direction is used when each transform coefficient is distributed with a bias in a direction other than the predetermined direction. It can be decoded using the context index used.
 例えば、上記予め定められた方向を垂直方向とした場合、垂直方向に偏りをもって分布している各変換係数のシンタックスを、各変換係数が水平方向に偏りをもって分布する場合に用いられるコンテキストインデックスを用いて復号することができる。 For example, when the predetermined direction is the vertical direction, the syntax of each transform coefficient distributed with a bias in the vertical direction is used, and the context index used when each transform coefficient is distributed with a bias in the horizontal direction. Can be used to decrypt.
 したがって、上記の構成によれば、各変換係数が、垂直方向および水平方向の何れに偏って分布している場合であっても、その偏りに応じた適切な確率状態に基づいて、各シンタックスを復号することができる。このため、上記の構成によれば、各変換係数の偏りが、単位領域毎に異なる場合であっても、符号化効率を向上させることができる。 Therefore, according to the above configuration, even if each transform coefficient is distributed in a biased manner in either the vertical direction or the horizontal direction, each syntax is based on an appropriate probability state corresponding to the bias. Can be decrypted. For this reason, according to said structure, even if it is a case where the bias | inclination of each conversion coefficient changes for every unit area | region, encoding efficiency can be improved.
 また、上記コンテキストインデックス変更手段は、上記対象周波数領域における復号済みの非0変換係数の分布の偏りを表す指標が、予め定められた閾値よりも大きい場合に、該対象周波数領域における未復号のシンタックスに割り付けるコンテキストインデックスを変更するものである、ことが好ましい。 In addition, the context index changing unit is configured to detect an undecoded symbol in the target frequency domain when an index indicating the distribution bias of the decoded non-zero transform coefficient in the target frequency domain is larger than a predetermined threshold. Preferably, the context index assigned to the tax is changed.
 上記の構成によれば、上記コンテキストインデックス変更手段は、上記対象周波数領域における復号済みの非0変換係数の分布の偏りを表す指標が、予め定められた閾値よりも大きい場合に、該対象周波数領域における未復号のシンタックスに割り付けるコンテキストインデックスを変更するので、上記指標が小さい場合に生じ得る、非0変換係数の分布の偏りの推定誤りの影響を受けることなく、各シンタックスを復号することができる。 According to the above configuration, the context index changing unit is configured to detect the target frequency domain when an index representing the distribution deviation of the decoded non-zero transform coefficient in the target frequency domain is larger than a predetermined threshold. Since the context index assigned to the undecoded syntax is changed, each syntax can be decoded without being affected by the estimation error of the non-zero transform coefficient distribution bias that may occur when the index is small. it can.
 上記の構成に対応する構成を有する算術符号化装置によれば、非0変換係数の分布の偏りの推定誤りの影響を受けることなく、各シンタックスを符号化することができるので、高い符号化効率を有する符号化データを生成することができる。 According to the arithmetic coding apparatus having a configuration corresponding to the above configuration, each syntax can be encoded without being affected by the estimation error of the non-zero transform coefficient distribution bias. Encoded data having efficiency can be generated.
 上記のように構成された算術復号装置によれば、そのような符号化効率の高い符号化データを復号することができる。 According to the arithmetic decoding apparatus configured as described above, it is possible to decode such encoded data with high encoding efficiency.
 また、上記コンテキストインデックス変更手段は、上記対象周波数領域における未復号のシンタックスのうち、上記対象周波数領域における水平方向の座標および垂直方向の座標の少なくとも何れかが予め定められた閾値以下であるシンタックスに割り付けられたコンテキストインデックスを変更するものである、ことが好ましい。 Further, the context index changing means is a syntax in which at least one of a horizontal coordinate and a vertical coordinate in the target frequency region is not more than a predetermined threshold among undecoded syntaxes in the target frequency region. Preferably, the context index assigned to the tax is changed.
 発明者は、上記対象周波数領域における水平方向の座標および垂直方向の座標の双方が上記予め定められた閾値よりも大きいシンタックスについては、コンテキストインデックスを変更したとしても、期待されるほど符号化効率が向上しない場合があるとの知見を得た。 The inventor, as for the syntax in which both the horizontal coordinate and the vertical coordinate in the target frequency domain are larger than the predetermined threshold, even if the context index is changed, the encoding efficiency is as expected. The knowledge that there is a case where it does not improve is obtained.
 上記の構成によれば、上記コンテキストインデックス変更手段は、上記対象周波数領域における未復号のシンタックスのうち、上記対象周波数領域における水平方向の座標および垂直方向の座標の双方が上記予め定められた閾値よりも大きいシンタックスに割り付けられたコンテキストインデックスについては変更しないので、処理量を削減しつつ、符号化効率を向上させることができる。 According to the above configuration, the context index changing unit is configured such that, of the undecoded syntax in the target frequency domain, both the horizontal coordinate and the vertical coordinate in the target frequency domain are the predetermined threshold values. Since the context index assigned to a larger syntax is not changed, the coding efficiency can be improved while reducing the processing amount.
 また、上記1または複数種類のシンタックスには、変換係数が0であるか否か示す第1フラグが含まれており、上記コンテキストインデックス変更手段は、該対象周波数領域における未復号の第1フラグに割り付けるコンテキストインデックスを変更するものである、ことが好ましい。 The one or more types of syntax include a first flag indicating whether or not the transform coefficient is 0, and the context index changing means includes the undecoded first flag in the target frequency domain. It is preferable that the context index to be assigned is changed.
 上記の構成によれば、変換係数が0であるか否か示す第1フラグに割り付けるコンテキストインデックスを変更するので、当該第1フラグの符号量を削減することができる。 According to the above configuration, since the context index assigned to the first flag indicating whether or not the transform coefficient is 0 is changed, the code amount of the first flag can be reduced.
 なお、上記第1フラグは、例えば、TMuC(Test Model under Consideration)において用いられているフラグsig_flagに対応する。 The first flag corresponds to a flag sig_flag used in, for example, TMuC (Test Model Consideration).
 また、上記1または複数種類のシンタックスには、処理順で最後の変換係数であるか否かを示す第2フラグが含まれており、上記コンテキストインデックス変更手段は、該対象周波数領域における未復号の第2フラグに割り付けるコンテキストインデックスを変更するものである、ことが好ましい。 The one or more types of syntax include a second flag indicating whether or not it is the last transform coefficient in the processing order, and the context index changing means performs undecoding in the target frequency domain. It is preferable that the context index assigned to the second flag is changed.
 上記の構成によれば、処理順で最後の変換係数であるか否かを示す第2フラグに割り付けるコンテキストインデックスを変更するので、当該第2フラグの符号量を削減することができる。 According to the above configuration, since the context index assigned to the second flag indicating whether or not it is the last conversion coefficient in the processing order is changed, the code amount of the second flag can be reduced.
 なお、上記第2フラグは、例えば、TMuC(Test Model under Consideration)において用いられているフラグlast_flagに対応する。 The second flag corresponds to the flag last_flag used in, for example, TMuC (Test Model under Consideration).
 また、本発明に係る画像復号装置は、上記算術復号装置と、上記算術復号装置によって復号された変換係数を逆周波数変換することによって残差画像を生成する逆周波数変換手段と、上記逆周波数変換手段によって生成された残差画像と生成済みの復号画像から予測された予測画像とを加算することによって復号画像を生成する復号画像生成手段と、を備える構成である。 An image decoding apparatus according to the present invention includes the arithmetic decoding apparatus, an inverse frequency converting unit that generates a residual image by performing inverse frequency conversion on a transform coefficient decoded by the arithmetic decoding apparatus, and the inverse frequency transform. And a decoded image generating means for generating a decoded image by adding the residual image generated by the means and the predicted image predicted from the generated decoded image.
 上記のように構成された画像復号装置によれば、上記算術復号装置によって復号された変換係数を逆周波数変換することによって生成された残差画像と、生成済みの復号画像から予測された予測画像とを加算することによって復号画像を生成するので、符号化効率の高い符号化データから復号画像を生成することができる。 According to the image decoding device configured as described above, a residual image generated by performing inverse frequency conversion on the transform coefficient decoded by the arithmetic decoding device, and a predicted image predicted from the generated decoded image Is added to generate a decoded image, and thus a decoded image can be generated from encoded data with high encoding efficiency.
 また、本発明に係る算術符号化装置は、対象画像を単位領域毎に周波数変換して得られる各変換係数について、該変換係数を表す1または複数種類のシンタックスを算術符号化することによって符号化データを生成する算術符号化装置であって、処理対象の単位領域に対応する対象周波数領域における各変換係数を表す各シンタックスに対して、該シンタックスの種類および該シンタックスの該対象周波数領域における位置に応じて定まるコンテキストインデックスを割り付けるコンテキストインデックス割り付け手段と、上記対象周波数領域における各シンタックスを、該シンタックスに対して割り付けられたコンテキストインデックスによって指定される確率状態に基づいて順次算術符号化するシンタックス符号化手段と、上記対象周波数領域における符号化済みの非0変換係数の分布の偏りに応じて、該対象周波数領域における未符号化シンタックスに割り付けるコンテキストインデックスを変更するコンテキストインデックス変更手段と、を備える構成である。 In addition, the arithmetic coding apparatus according to the present invention encodes each transform coefficient obtained by frequency-transforming the target image for each unit region by arithmetically coding one or more kinds of syntax representing the transform coefficient. An arithmetic coding apparatus for generating coded data, wherein each syntax representing each transform coefficient in a target frequency region corresponding to a unit region to be processed has a syntax type and a target frequency of the syntax Context index allocating means for allocating a context index determined according to a position in a region, and each syntax in the target frequency region is sequentially arithmetic code based on a probability state specified by the context index allocated to the syntax Syntax encoding means for generating the target circumference Depending on the deviation of the distribution of coded nonzero transform coefficients in several regions, and the context index changing means for changing a context index allocated to uncoded syntax in the subject frequency range, it is configured to include.
 上記のように構成された算術符号化装置によれば、上記コンテキストインデックス割り付け手段は、対象周波数領域における各シンタックスに対して、該シンタックスの種類および該シンタックスの該対象周波数領域における位置に応じて定まるコンテキストインデックスを割り付ける。また、上記コンテキストインデックス変更手段は、上記対象周波数領域における符号化済みの非0変換係数の分布の偏りに応じて、該対象周波数領域における未符号化シンタックスに割り付けるコンテキストインデックスを変更し、上記シンタックス符号化手段は、上記未復号のシンタックスに割り付けられた変更後のコンテキストインデックスによって指定される確率状態に基づいて、該未符号化シンタックスを符号化する。 According to the arithmetic coding apparatus configured as described above, the context index allocating unit determines, for each syntax in the target frequency domain, the type of syntax and the position of the syntax in the target frequency domain. Assign a context index that is determined accordingly. Further, the context index changing means changes a context index assigned to an uncoded syntax in the target frequency domain according to a bias in a distribution of encoded non-zero transform coefficients in the target frequency domain, and The tax encoding means encodes the uncoded syntax based on the probability state specified by the changed context index assigned to the undecoded syntax.
 したがって、上記のように構成された算術符号化装置によれば、上記対象周波数領域における符号化済みの非0変換係数の分布の偏りに応じて、未符号化シンタックスを符号化するための適切な確率状態を指定し、該適切な確率状態に基づいて、上記未符号化シンタックスを符号化することができる。これにより、各変換係数の偏りが単位領域毎に異なる場合であっても、高い符号化効率を有する符号化データを生成することができる。 Therefore, according to the arithmetic coding apparatus configured as described above, it is possible to appropriately encode an uncoded syntax in accordance with the distribution of the distribution of coded non-zero transform coefficients in the target frequency domain. A random state can be specified and the uncoded syntax can be encoded based on the appropriate probability state. As a result, even if the bias of each transform coefficient is different for each unit region, encoded data having high encoding efficiency can be generated.
 また、本発明に係る画像符号化装置は、符号化対象画像と予測画像との残差画像を単位領域毎に周波数変換することによって変換係数を生成する変換係数生成手段と、上記算術符号化装置と、を備えており、上記算術符号化装置は、上記変換係数生成手段によって生成された変換係数を表す1または複数種類のシンタックスを算術符号化することによって符号化データを生成するものである。 The image coding apparatus according to the present invention includes a transform coefficient generating unit that generates a transform coefficient by frequency-converting a residual image between a coding target image and a predicted image for each unit region, and the arithmetic coding device. The arithmetic encoding device generates encoded data by arithmetically encoding one or a plurality of types of syntax representing the transform coefficient generated by the transform coefficient generating means. .
 上記のように構成された画像符号化装置によれば、符号化対象画像と予測画像との残差画像を単位領域毎に周波数変換することによって生成された変換係数を、上記算出符号化装置によって符号化するので、符号化効率の高い符号化データを生成することができる。 According to the image encoding device configured as described above, the calculation encoding device generates a transform coefficient generated by frequency-converting the residual image between the encoding target image and the prediction image for each unit region. Since encoding is performed, encoded data with high encoding efficiency can be generated.
 また、本発明に係る符号化データのデータ構造は、原画像を単位領域毎に周波数変換して得られる各変換係数について、該変換係数を表す1または複数種類のシンタックスを算術符号化することによって得られる符号化データのデータ構造であって、上記1または複数種類のシンタックスには、変換係数が0であるか否か示すフラグが含まれており、上記符号化データを復号する算術復号装置は、処理対象の単位領域に対応する対象周波数領域における各シンタックスに対して、該シンタックスの種類および該シンタックスの該対象周波数領域における位置に応じて定まるコンテキストインデックスを割り付け、上記対象周波数領域における各シンタックスを、該シンタックスに対して割り付けられたコンテキストインデックスによって指定される確率状態に基づいて順次算術復号すると共に、上記対象周波数領域における復元済みの上記フラグの分布の偏りに応じて、該対象周波数領域における未復号のシンタックスに割り付けるコンテキストインデックスを変更する。 Also, the data structure of the encoded data according to the present invention is such that, for each transform coefficient obtained by frequency transforming the original image for each unit region, one or more kinds of syntax representing the transform coefficient are arithmetically encoded. The one or more types of syntax includes a flag indicating whether or not a transform coefficient is 0, and arithmetic decoding is performed to decode the encoded data. The apparatus assigns, to each syntax in the target frequency domain corresponding to the unit area to be processed, a context index determined according to the type of the syntax and the position of the syntax in the target frequency domain, and the target frequency Each syntax in the region is indicated by the context index assigned to that syntax. With successively arithmetic decoding based on the probability state which is in accordance with the deviation of the distribution of restored the flag in the target frequency range, it changes the context index allocated to the syntax of the undecoded in the subject frequency range.
 上記のように構成された符号化データを復号する上記算術復号装置は、上記対象周波数領域における復元済みの上記フラグの分布の偏りに応じて、該対象周波数領域における未復号のシンタックスに割り付けるコンテキストインデックスを変更するので、該未復号のシンタックスを復号するための適切な確率状態を用いて、復号処理を行う。 The arithmetic decoding device that decodes the encoded data configured as described above is configured to assign a context to an undecoded syntax in the target frequency domain according to a bias of a distribution of the restored flag in the target frequency domain. Since the index is changed, the decoding process is performed using an appropriate probability state for decoding the undecoded syntax.
 また、上記符号化データを生成する算術符号化装置は、上記算術復号装置とほぼ同様に、上記対象周波数領域における符号化済みの上記フラグの分布の偏りに応じて、該対象周波数領域における未符号化シンタックスに割り付けるコンテキストインデックスを変更するものであることが好ましい。このような算術符号化装置によって生成された符号化データは、適切な確率状態を用いて生成されたものであるため、符号化効率が高い符号化データである。
<<応用例>>
 上述した動画像符号化装置2及び動画像復号装置1は、動画像の送信、受信、記録、再生を行う各種装置に搭載して利用することができる。なお、動画像は、カメラ等により撮像された自然動画像であってもよいし、コンピュータ等により生成された人工動画像(CGおよびGUIを含む)であってもよい。
In addition, the arithmetic coding device that generates the coded data is substantially the same as the arithmetic decoding device, in accordance with the distribution of the distribution of the flag that has been coded in the target frequency region. It is preferable to change the context index assigned to the syntax. Since the encoded data generated by such an arithmetic encoding device is generated using an appropriate probability state, it is encoded data with high encoding efficiency.
<< Application example >>
The above-described moving image encoding device 2 and moving image decoding device 1 can be used by being mounted on various devices that perform transmission, reception, recording, and reproduction of moving images. The moving image may be a natural moving image captured by a camera or the like, or may be an artificial moving image (including CG and GUI) generated by a computer or the like.
 まず、上述した動画像符号化装置2及び動画像復号装置1を、動画像の送信及び受信に利用できることを、図61を参照して説明する。 First, it will be described with reference to FIG. 61 that the above-described moving image encoding device 2 and moving image decoding device 1 can be used for transmission and reception of moving images.
 図61の(a)は、動画像符号化装置2を搭載した送信装置PROD_Aの構成を示したブロック図である。図61の(a)に示すように、送信装置PROD_Aは、動画像を符号化することによって符号化データを得る符号化部PROD_A1と、符号化部PROD_A1が得た符号化データで搬送波を変調することによって変調信号を得る変調部PROD_A2と、変調部PROD_A2が得た変調信号を送信する送信部PROD_A3と、を備えている。上述した動画像符号化装置2は、この符号化部PROD_A1として利用される。 FIG. 61 (a) is a block diagram showing a configuration of a transmission apparatus PROD_A in which the moving picture encoding apparatus 2 is mounted. As illustrated in (a) of FIG. 61, the transmission device PROD_A modulates a carrier wave with an encoding unit PROD_A1 that obtains encoded data by encoding a moving image, and with the encoded data obtained by the encoding unit PROD_A1. Thus, a modulation unit PROD_A2 that obtains a modulation signal and a transmission unit PROD_A3 that transmits the modulation signal obtained by the modulation unit PROD_A2 are provided. The moving image encoding apparatus 2 described above is used as the encoding unit PROD_A1.
 送信装置PROD_Aは、符号化部PROD_A1に入力する動画像の供給源として、動画像を撮像するカメラPROD_A4、動画像を記録した記録媒体PROD_A5、動画像を外部から入力するための入力端子PROD_A6、及び、画像を生成または加工する画像処理部A7を更に備えていてもよい。図61の(a)においては、これら全てを送信装置PROD_Aが備えた構成を例示しているが、一部を省略しても構わない。 The transmission device PROD_A is a camera PROD_A4 that captures a moving image, a recording medium PROD_A5 that records the moving image, an input terminal PROD_A6 that inputs the moving image from the outside, as a supply source of the moving image input to the encoding unit PROD_A1. An image processing unit A7 that generates or processes an image may be further provided. In FIG. 61A, a configuration in which all of these are provided in the transmission device PROD_A is illustrated, but a part thereof may be omitted.
 なお、記録媒体PROD_A5は、符号化されていない動画像を記録したものであってもよいし、伝送用の符号化方式とは異なる記録用の符号化方式で符号化された動画像を記録したものであってもよい。後者の場合、記録媒体PROD_A5と符号化部PROD_A1との間に、記録媒体PROD_A5から読み出した符号化データを記録用の符号化方式に従って復号する復号部(不図示)を介在させるとよい。 The recording medium PROD_A5 may be a recording of a non-encoded moving image, or a recording of a moving image encoded by a recording encoding scheme different from the transmission encoding scheme. It may be a thing. In the latter case, a decoding unit (not shown) for decoding the encoded data read from the recording medium PROD_A5 according to the recording encoding method may be interposed between the recording medium PROD_A5 and the encoding unit PROD_A1.
 図61の(b)は、動画像復号装置1を搭載した受信装置PROD_Bの構成を示したブロック図である。図61の(b)に示すように、受信装置PROD_Bは、変調信号を受信する受信部PROD_B1と、受信部PROD_B1が受信した変調信号を復調することによって符号化データを得る復調部PROD_B2と、復調部PROD_B2が得た符号化データを復号することによって動画像を得る復号部PROD_B3と、を備えている。上述した動画像復号装置1は、この復号部PROD_B3として利用される。 FIG. 61 (b) is a block diagram showing a configuration of a receiving device PROD_B in which the moving image decoding device 1 is mounted. As illustrated in FIG. 61 (b), the receiving device PROD_B includes a receiving unit PROD_B1 that receives a modulated signal, a demodulating unit PROD_B2 that obtains encoded data by demodulating the modulated signal received by the receiving unit PROD_B1, and a demodulator. A decoding unit PROD_B3 that obtains a moving image by decoding the encoded data obtained by the unit PROD_B2. The moving picture decoding apparatus 1 described above is used as the decoding unit PROD_B3.
 受信装置PROD_Bは、復号部PROD_B3が出力する動画像の供給先として、動画像を表示するディスプレイPROD_B4、動画像を記録するための記録媒体PROD_B5、及び、動画像を外部に出力するための出力端子PROD_B6を更に備えていてもよい。図61の(b)においては、これら全てを受信装置PROD_Bが備えた構成を例示しているが、一部を省略しても構わない。 The receiving device PROD_B has a display PROD_B4 for displaying a moving image, a recording medium PROD_B5 for recording the moving image, and an output terminal for outputting the moving image to the outside as a supply destination of the moving image output by the decoding unit PROD_B3. PROD_B6 may be further provided. In FIG. 61 (b), a configuration in which all of these are provided in the receiving device PROD_B is illustrated, but a part thereof may be omitted.
 なお、記録媒体PROD_B5は、符号化されていない動画像を記録するためのものであってもよいし、伝送用の符号化方式とは異なる記録用の符号化方式で符号化されたものであってもよい。後者の場合、復号部PROD_B3と記録媒体PROD_B5との間に、復号部PROD_B3から取得した動画像を記録用の符号化方式に従って符号化する符号化部(不図示)を介在させるとよい。 The recording medium PROD_B5 may be used for recording a non-encoded moving image, or may be encoded using a recording encoding method different from the transmission encoding method. May be. In the latter case, an encoding unit (not shown) for encoding the moving image acquired from the decoding unit PROD_B3 according to the recording encoding method may be interposed between the decoding unit PROD_B3 and the recording medium PROD_B5.
 なお、変調信号を伝送する伝送媒体は、無線であってもよいし、有線であってもよい。また、変調信号を伝送する伝送態様は、放送(ここでは、送信先が予め特定されていない送信態様を指す)であってもよいし、通信(ここでは、送信先が予め特定されている送信態様を指す)であってもよい。すなわち、変調信号の伝送は、無線放送、有線放送、無線通信、及び有線通信の何れによって実現してもよい。 Note that the transmission medium for transmitting the modulation signal may be wireless or wired. Further, the transmission mode for transmitting the modulated signal may be broadcasting (here, a transmission mode in which the transmission destination is not specified in advance) or communication (here, transmission in which the transmission destination is specified in advance). Refers to the embodiment). That is, the transmission of the modulation signal may be realized by any of wireless broadcasting, wired broadcasting, wireless communication, and wired communication.
 例えば、地上デジタル放送の放送局(放送設備など)/受信局(テレビジョン受像機など)は、変調信号を無線放送で送受信する送信装置PROD_A/受信装置PROD_Bの一例である。また、ケーブルテレビ放送の放送局(放送設備など)/受信局(テレビジョン受像機など)は、変調信号を有線放送で送受信する送信装置PROD_A/受信装置PROD_Bの一例である。 For example, a terrestrial digital broadcast broadcasting station (broadcasting equipment or the like) / receiving station (such as a television receiver) is an example of a transmitting device PROD_A / receiving device PROD_B that transmits and receives a modulated signal by wireless broadcasting. Further, a broadcasting station (such as broadcasting equipment) / receiving station (such as a television receiver) of cable television broadcasting is an example of a transmitting device PROD_A / receiving device PROD_B that transmits and receives a modulated signal by cable broadcasting.
 また、インターネットを用いたVOD(Video On Demand)サービスや動画共有サービスなどのサーバ(ワークステーションなど)/クライアント(テレビジョン受像機、パーソナルコンピュータ、スマートフォンなど)は、変調信号を通信で送受信する送信装置PROD_A/受信装置PROD_Bの一例である(通常、LANにおいては伝送媒体として無線又は有線の何れかが用いられ、WANにおいては伝送媒体として有線が用いられる)。ここで、パーソナルコンピュータには、デスクトップ型PC、ラップトップ型PC、及びタブレット型PCが含まれる。また、スマートフォンには、多機能携帯電話端末も含まれる。 Also, a server (workstation etc.) / Client (television receiver, personal computer, smart phone etc.) such as VOD (Video On Demand) service and video sharing service using the Internet is a transmitting device for transmitting and receiving modulated signals by communication. This is an example of PROD_A / reception device PROD_B (usually, either a wireless or wired transmission medium is used in a LAN, and a wired transmission medium is used in a WAN). Here, the personal computer includes a desktop PC, a laptop PC, and a tablet PC. The smartphone also includes a multi-function mobile phone terminal.
 なお、動画共有サービスのクライアントは、サーバからダウンロードした符号化データを復号してディスプレイに表示する機能に加え、カメラで撮像した動画像を符号化してサーバにアップロードする機能を有している。すなわち、動画共有サービスのクライアントは、送信装置PROD_A及び受信装置PROD_Bの双方として機能する。 In addition to the function of decoding the encoded data downloaded from the server and displaying it on the display, the video sharing service client has a function of encoding a moving image captured by the camera and uploading it to the server. That is, the client of the video sharing service functions as both the transmission device PROD_A and the reception device PROD_B.
 次に、上述した動画像符号化装置2及び動画像復号装置1を、動画像の記録及び再生に利用できることを、図62を参照して説明する。 Next, it will be described with reference to FIG. 62 that the above-described moving picture encoding apparatus 2 and moving picture decoding apparatus 1 can be used for recording and reproduction of moving pictures.
 図62の(a)は、上述した動画像符号化装置2を搭載した記録装置PROD_Cの構成を示したブロック図である。図62の(a)に示すように、記録装置PROD_Cは、動画像を符号化することによって符号化データを得る符号化部PROD_C1と、符号化部PROD_C1が得た符号化データを記録媒体PROD_Mに書き込む書込部PROD_C2と、を備えている。上述した動画像符号化装置2は、この符号化部PROD_C1として利用される。 62 (a) is a block diagram showing a configuration of a recording apparatus PROD_C in which the above-described moving picture encoding apparatus 2 is mounted. As shown in (a) of FIG. 62, the recording apparatus PROD_C includes an encoding unit PROD_C1 that obtains encoded data by encoding a moving image, and the encoded data obtained by the encoding unit PROD_C1 on the recording medium PROD_M. A writing unit PROD_C2 for writing. The moving image encoding apparatus 2 described above is used as the encoding unit PROD_C1.
 なお、記録媒体PROD_Mは、(1)HDD(Hard Disk Drive)やSSD(Solid State Drive)などのように、記録装置PROD_Cに内蔵されるタイプのものであってもよいし、(2)SDメモリカードやUSB(Universal Serial Bus)フラッシュメモリなどのように、記録装置PROD_Cに接続されるタイプのものであってもよいし、(3)DVD(Digital Versatile Disc)やBD(Blu-ray Disc:登録商標)などのように、記録装置PROD_Cに内蔵されたドライブ装置(不図示)に装填されるものであってもよい。 The recording medium PROD_M may be of a type built in the recording device PROD_C, such as (1) HDD (Hard Disk Drive) or SSD (Solid State Drive), or (2) SD memory. It may be of the type connected to the recording device PROD_C, such as a card or USB (Universal Serial Bus) flash memory, or (3) DVD (Digital Versatile Disc) or BD (Blu-ray Disc: registration) Or a drive device (not shown) built in the recording device PROD_C.
 また、記録装置PROD_Cは、符号化部PROD_C1に入力する動画像の供給源として、動画像を撮像するカメラPROD_C3、動画像を外部から入力するための入力端子PROD_C4、動画像を受信するための受信部PROD_C5、及び、画像を生成または加工する画像処理部C6を更に備えていてもよい。図62の(a)においては、これら全てを記録装置PROD_Cが備えた構成を例示しているが、一部を省略しても構わない。 The recording device PROD_C is a camera PROD_C3 that captures moving images as a supply source of moving images to be input to the encoding unit PROD_C1, an input terminal PROD_C4 for inputting moving images from the outside, and reception for receiving moving images. The unit PROD_C5 and an image processing unit C6 that generates or processes an image may be further provided. 62A illustrates the configuration in which the recording apparatus PROD_C includes all of these, a part of the configuration may be omitted.
 なお、受信部PROD_C5は、符号化されていない動画像を受信するものであってもよいし、記録用の符号化方式とは異なる伝送用の符号化方式で符号化された符号化データを受信するものであってもよい。後者の場合、受信部PROD_C5と符号化部PROD_C1との間に、伝送用の符号化方式で符号化された符号化データを復号する伝送用復号部(不図示)を介在させるとよい。 The receiving unit PROD_C5 may receive a non-encoded moving image, or may receive encoded data encoded by a transmission encoding scheme different from the recording encoding scheme. You may do. In the latter case, a transmission decoding unit (not shown) that decodes encoded data encoded by the transmission encoding method may be interposed between the reception unit PROD_C5 and the encoding unit PROD_C1.
 このような記録装置PROD_Cとしては、例えば、DVDレコーダ、BDレコーダ、HDD(Hard Disk Drive)レコーダなどが挙げられる(この場合、入力端子PROD_C4又は受信部PROD_C5が動画像の主な供給源となる)。また、カムコーダ(この場合、カメラPROD_C3が動画像の主な供給源となる)、パーソナルコンピュータ(この場合、受信部PROD_C5又は画像処理部C6が動画像の主な供給源となる)、スマートフォン(この場合、カメラPROD_C3又は受信部PROD_C5が動画像の主な供給源となる)なども、このような記録装置PROD_Cの一例である。 Examples of such a recording device PROD_C include a DVD recorder, a BD recorder, and an HDD (Hard Disk Drive) recorder (in this case, the input terminal PROD_C4 or the receiving unit PROD_C5 is a main supply source of moving images). . In addition, a camcorder (in this case, the camera PROD_C3 is a main source of moving images), a personal computer (in this case, the receiving unit PROD_C5 or the image processing unit C6 is a main source of moving images), a smartphone (in this case In this case, the camera PROD_C3 or the receiving unit PROD_C5 is a main supply source of moving images) is also an example of such a recording device PROD_C.
 図62の(b)は、上述した動画像復号装置1を搭載した再生装置PROD_Dの構成を示したブロックである。図62の(b)に示すように、再生装置PROD_Dは、記録媒体PROD_Mに書き込まれた符号化データを読み出す読出部PROD_D1と、読出部PROD_D1が読み出した符号化データを復号することによって動画像を得る復号部PROD_D2と、を備えている。上述した動画像復号装置1は、この復号部PROD_D2として利用される。 FIG. 62 (b) is a block diagram showing the configuration of the playback device PROD_D in which the above-described video decoding device 1 is mounted. As shown in (b) of FIG. 62, the playback device PROD_D reads a moving image by decoding a read unit PROD_D1 that reads encoded data written to the recording medium PROD_M and a coded data read by the read unit PROD_D1. And a decoding unit PROD_D2 to be obtained. The moving picture decoding apparatus 1 described above is used as the decoding unit PROD_D2.
 なお、記録媒体PROD_Mは、(1)HDDやSSDなどのように、再生装置PROD_Dに内蔵されるタイプのものであってもよいし、(2)SDメモリカードやUSBフラッシュメモリなどのように、再生装置PROD_Dに接続されるタイプのものであってもよいし、(3)DVDやBDなどのように、再生装置PROD_Dに内蔵されたドライブ装置(不図示)に装填されるものであってもよい。 Note that the recording medium PROD_M may be of the type built into the playback device PROD_D, such as (1) HDD or SSD, or (2) such as an SD memory card or USB flash memory, It may be of a type connected to the playback device PROD_D, or (3) may be loaded into a drive device (not shown) built in the playback device PROD_D, such as DVD or BD. Good.
 また、再生装置PROD_Dは、復号部PROD_D2が出力する動画像の供給先として、動画像を表示するディスプレイPROD_D3、動画像を外部に出力するための出力端子PROD_D4、及び、動画像を送信する送信部PROD_D5を更に備えていてもよい。図62の(b)においては、これら全てを再生装置PROD_Dが備えた構成を例示しているが、一部を省略しても構わない。 In addition, the playback device PROD_D has a display PROD_D3 that displays a moving image, an output terminal PROD_D4 that outputs the moving image to the outside, and a transmission unit that transmits the moving image as a supply destination of the moving image output by the decoding unit PROD_D2. PROD_D5 may be further provided. FIG. 62B illustrates a configuration in which the playback apparatus PROD_D includes all of these, but a part of the configuration may be omitted.
  なお、送信部PROD_D5は、符号化されていない動画像を送信するものであってもよいし、記録用の符号化方式とは異なる伝送用の符号化方式で符号化された符号化データを送信するものであってもよい。後者の場合、復号部PROD_D2と送信部PROD_D5との間に、動画像を伝送用の符号化方式で符号化する符号化部(不図示)を介在させるとよい。 The transmission unit PROD_D5 may transmit an unencoded moving image, or transmits encoded data encoded by a transmission encoding method different from the recording encoding method. You may do. In the latter case, it is preferable to interpose an encoding unit (not shown) that encodes a moving image with an encoding method for transmission between the decoding unit PROD_D2 and the transmission unit PROD_D5.
 このような再生装置PROD_Dとしては、例えば、DVDプレイヤ、BDプレイヤ、HDDプレイヤなどが挙げられる(この場合、テレビジョン受像機等が接続される出力端子PROD_D4が動画像の主な供給先となる)。また、テレビジョン受像機(この場合、ディスプレイPROD_D3が動画像の主な供給先となる)、デジタルサイネージ(電子看板や電子掲示板等とも称され、ディスプレイPROD_D3又は送信部PROD_D5が動画像の主な供給先となる)、デスクトップ型PC(この場合、出力端子PROD_D4又は送信部PROD_D5が動画像の主な供給先となる)、ラップトップ型又はタブレット型PC(この場合、ディスプレイPROD_D3又は送信部PROD_D5が動画像の主な供給先となる)、スマートフォン(この場合、ディスプレイPROD_D3又は送信部PROD_D5が動画像の主な供給先となる)なども、このような再生装置PROD_Dの一例である。 Examples of such a playback device PROD_D include a DVD player, a BD player, and an HDD player (in this case, an output terminal PROD_D4 to which a television receiver or the like is connected is a main supply destination of moving images). . In addition, a television receiver (in this case, the display PROD_D3 is a main supply destination of moving images), a digital signage (also referred to as an electronic signboard or an electronic bulletin board), and the display PROD_D3 or the transmission unit PROD_D5 is the main supply of moving images. Desktop PC (in this case, the output terminal PROD_D4 or the transmission unit PROD_D5 is the main video image supply destination), laptop or tablet PC (in this case, the display PROD_D3 or the transmission unit PROD_D5 is a moving image) A smartphone (which is a main image supply destination), a smartphone (in this case, the display PROD_D3 or the transmission unit PROD_D5 is a main moving image supply destination), and the like are also examples of such a playback device PROD_D.
 (HEVCとの対応について)
 なお、上記各実施形態における、LCU(最大コーディングユニット:Largest Coding Unit)は、H.264/MPEG-4 AVCの後継規格として提案されているHEVC(High Efficiency Video Coding)の符号化ツリー(Coding Tree)のrootに相当し、リーフCUは、HEVCのCU(コーディングユニット:Coding Unit、コーディングツリーのleafと呼ばれることもある)に相当する。また、上記各実施形態における、PUおよびTUは、それぞれ、HEVCにおける、予測ツリー(Prediction Tree)および変換ツリー(transform tree)に相当する。また、上記実施形態における、PUのパーティションは、HEVCにおけるPU(Prediction Unit)に相当する。また、上記実施形態において、TUを分割して得られるブロックは、HEVCにおけるTU(Transformation Unit)に相当する。
(About correspondence with HEVC)
Note that the LCU (Largest Coding Unit) in each of the above embodiments is H.264. It corresponds to the root of a coding tree (Coding Tree) of HEVC (High Efficiency Video Coding) proposed as a successor to H.264 / MPEG-4 AVC, and a leaf CU is a CU (Coding Unit, coding) It is also called the leaf of the tree). Moreover, PU and TU in each said embodiment are respectively equivalent to the prediction tree (Prediction Tree) and transformation tree (transform tree) in HEVC. Moreover, the partition of PU in the said embodiment is corresponded to PU (Prediction Unit) in HEVC. In the above embodiment, a block obtained by dividing a TU corresponds to a TU (Transformation Unit) in HEVC.
 本発明は、符号化データを復号する復号装置、および、符号化データを生成する符号化装置に好適に適用することができる。また、符号化装置によって生成され、復号装置によって参照される符号化データのデータ構造に好適に適用することができる。 The present invention can be suitably applied to a decoding device that decodes encoded data and an encoding device that generates encoded data. Further, the present invention can be suitably applied to the data structure of encoded data generated by the encoding device and referenced by the decoding device.
<<実施形態1-1>>
1         動画像復号装置(画像復号装置)
121       最後の係数復号部(最後の係数位置検出手段)
122       位置判定部(位置判定手段、距離判定手段)
123       2段階復号部(2段階復号手段)
125       最後2つの係数復号部(非ゼロ係数位置検出手段)
2         動画像符号化装置(画像符号化装置)
310       最後の係数検出部(最後の係数位置検出手段)
320       位置判定部(位置判定手段)
330       2段階符号化部(2段階符号化手段)
C10       係数符号化データ(符号化データのデータ構造)
LT        最後の係数(最後の非ゼロ係数)
MX10      係数行列
R10、R30、R50、R70  第1の対象範囲(位置判定範囲)
TBL11、TBL21 直線スキャン用VLCテーブル(可変長符号テーブル)
<<実施形態2>>
1         動画像復号装置(画像復号装置)
11        可変長符号復号部
111       量子化残差情報復号部(算術復号装置)
111a      コンテキストインデックス割り付け部(コンテキストインデックス割り付け手段)
111b      変換係数復号部(シンタックス復号手段、変換係数復元手段)
111c      コンテキスト変数管理部
111d      コンテキストインデックス変更部(コンテキストインデックス変更手段)
12        予測画像生成部
15        フレームメモリ
2         動画像符号化装置(画像符号化装置)
21        予測画像生成部
25        フレームメモリ
27        可変長符号符号化部27
271       量子化残差情報符号化部(算術符号化装置)
271a      コンテキストインデックス割り付け部(コンテキストインデックス割り付け手段)
271b      変換係数符号化部(シンタックス符号化手段)
271c      コンテキスト変数管理部
271d      コンテキストインデックス変更部(コンテキストインデックス変更手段)
<< Embodiment 1-1 >>
1 video decoding device (image decoding device)
121 Last coefficient decoding unit (last coefficient position detecting means)
122 Position determination unit (position determination means, distance determination means)
123 Two-stage decoding unit (two-stage decoding means)
125 Last two coefficient decoding units (non-zero coefficient position detecting means)
2 Video encoding device (image encoding device)
310 Last coefficient detection unit (last coefficient position detection means)
320 Position determination unit (position determination means)
330 Two-stage encoding unit (two-stage encoding means)
C10 Coefficient encoded data (Data structure of encoded data)
LT Last coefficient (last non-zero coefficient)
MX10 Coefficient matrix R10, R30, R50, R70 First target range (position determination range)
TBL11, TBL21 VLC table for linear scanning (variable length code table)
<< Embodiment 2 >>
1 video decoding device (image decoding device)
11 variable length code decoding unit 111 quantization residual information decoding unit (arithmetic decoding device)
111a Context index allocation unit (context index allocation means)
111b Transform coefficient decoding unit (syntax decoding means, transform coefficient restoring means)
111c Context variable management unit 111d Context index change unit (context index change means)
12 Predictive image generation unit 15 Frame memory 2 Video encoding device (image encoding device)
21 Predictive image generation unit 25 Frame memory 27 Variable length code encoding unit 27
271 Quantization residual information encoding unit (arithmetic encoding device)
271a Context index allocation unit (context index allocation means)
271b Transform coefficient coding unit (syntax coding means)
271c Context variable management unit 271d Context index change unit (context index change means)

Claims (20)

  1.  画像データが符号化された符号化データに含まれる、符号化された量子化変換係数を復号および逆スキャンすることにより係数行列を再現する画像復号装置において、
     上記係数行列における、上記逆スキャン順上最後の非ゼロ係数の位置を検出する最後の係数位置検出手段と、
     上記最後の非ゼロ係数の位置が、上記係数行列において、直流成分の係数を含む行または列から所定の行または列までの位置判定範囲にあるか否かを判定する位置判定手段と、
     上記最後の非ゼロ係数の位置が、上記位置判定範囲にある場合、上記係数行列を、上記最後の非ゼロ係数の位置を含む第1の復号対象範囲と、上記第1の復号対象範囲以外の第2の復号対象範囲とでそれぞれ復号処理する2段階復号手段と、を備えることを特徴とする画像復号装置。
    In an image decoding apparatus that reproduces a coefficient matrix by decoding and inverse scanning encoded quantized transform coefficients included in encoded data obtained by encoding image data,
    A last coefficient position detecting means for detecting the position of the last non-zero coefficient in the reverse scan order in the coefficient matrix;
    Position determining means for determining whether or not the position of the last non-zero coefficient is in a position determination range from a row or column including a coefficient of a DC component to a predetermined row or column in the coefficient matrix;
    When the position of the last non-zero coefficient is in the position determination range, the coefficient matrix is divided into a first decoding target range including the position of the last non-zero coefficient and a range other than the first decoding target range. An image decoding apparatus comprising: two-stage decoding means for performing decoding processing with each of the second decoding target ranges.
  2.  上記位置判定手段は、上記最後の非ゼロ係数の位置が、上記係数行列における第1行目または第1列目にあるか否かを判定し、
     上記2段階復号手段の復号処理における第1の復号対象範囲は、位置判定範囲と一致することを特徴とする請求項1に記載の画像復号装置。
    The position determining means determines whether the position of the last non-zero coefficient is in the first row or the first column in the coefficient matrix;
    The image decoding apparatus according to claim 1, wherein the first decoding target range in the decoding process of the two-stage decoding unit coincides with the position determination range.
  3.  上記最後の非ゼロ係数の位置が、上記直流成分の係数の位置から所定距離以上離れているか否かを判定する距離判定手段を備え、
     上記2段階復号手段は、上記最後の非ゼロ係数の位置が、上記直流成分の係数の位置から所定距離以上離れている場合、上記復号処理を行うことを特徴とする請求項1または2に記載の画像復号装置。
    Distance determining means for determining whether the position of the last non-zero coefficient is a predetermined distance or more away from the position of the coefficient of the DC component;
    The said two-stage decoding means performs the said decoding process, when the position of the last non-zero coefficient is separated from the position of the coefficient of the DC component by a predetermined distance or more. Image decoding apparatus.
  4.  上記2段階復号手段は、上記第2の復号対象範囲の復号における逆スキャンにおいて、ジグザグスキャンを行うことを特徴とする請求項1から3のいずれか1項に記載の画像復号装置。 The image decoding apparatus according to any one of claims 1 to 3, wherein the two-stage decoding unit performs zigzag scanning in reverse scanning in decoding of the second decoding target range.
  5.  上記2段階復号手段による上記第2の復号対象範囲の復号処理について、上記最後の係数位置検出手段による位置検出、上記位置判定手段による位置判定、および上記2段階復号手段による復号を再帰的に行うよう制御する再帰制御手段を備えることを特徴とする請求項1から4のいずれか1項に記載の画像復号装置。 In the decoding process of the second decoding target range by the two-stage decoding unit, the position detection by the last coefficient position detection unit, the position determination by the position determination unit, and the decoding by the two-stage decoding unit are recursively performed. 5. The image decoding apparatus according to claim 1, further comprising a recursive control unit configured to perform control as described above.
  6.  上記2段階復号手段は、上記第1の復号対象範囲の復号において、可変長符号と、連続する非ゼロ係数の長さとの組み合わせを定義した可変長符号テーブルであって、最短の可変長符号を除き、上記可変長符号の長さが長いほど、上記連続する非ゼロ係数の長さが長い可変長符号テーブルを参照することを特徴とする請求項2に記載の画像復号装置。 The two-stage decoding means is a variable length code table that defines a combination of a variable length code and a length of continuous non-zero coefficients in the decoding of the first decoding target range, wherein the shortest variable length code is 3. The image decoding apparatus according to claim 2, wherein the variable length code table refers to a variable length code table in which the length of the continuous non-zero coefficient is longer as the length of the variable length code is longer.
  7.  上記係数行列における、上記逆スキャン順上、最後の非ゼロ係数から所定番目の非ゼロ係数の位置を検出する非ゼロ係数位置検出手段を備え、
     上記位置判定手段は、上記最後の非ゼロ係数から上記所定番目の非ゼロ係数までの位置が、上記位置判定範囲にあるか否かを判定することを特徴とする請求項1から6のいずれか1項に記載の画像復号装置。
    Non-zero coefficient position detecting means for detecting the position of the predetermined non-zero coefficient from the last non-zero coefficient in the reverse scan order in the coefficient matrix,
    The position determination means determines whether or not the position from the last non-zero coefficient to the predetermined non-zero coefficient is within the position determination range. The image decoding device according to item 1.
  8.  上記2段階復号手段は、連続する非ゼロ係数の長さを復号する非ゼロ係数長復号モードから、逐次係数を復号する逐次復号モードに、所定のモード切替条件が満たされた場合、モード切り替えながら復号するものであり、上記第1の復号対象範囲の復号の上記モード切替条件が、上記第2の復号対象範囲の復号の上記モード切替条件と異なる条件であることを特徴とする請求項1から7のいずれか1項に記載の画像復号装置。 When the predetermined mode switching condition is satisfied from the non-zero coefficient length decoding mode that decodes the length of consecutive non-zero coefficients to the sequential decoding mode that decodes sequential coefficients, the two-stage decoding means The mode switching condition for decoding in the first decoding target range is different from the mode switching condition for decoding in the second decoding target range. 8. The image decoding device according to any one of 7 above.
  9.  画像データから予測画像を減じた予測残差を、直交変換し、量子化した変換係数からなる係数行列をスキャンして符号することにより符号化データを出力する画像符号化装置において、
     上記係数行列における、上記スキャン順上最後の非ゼロ係数の位置を検出する最後の係数位置検出手段と、
     上記最後の非ゼロ係数の位置が、上記係数行列において、直流成分の係数を含む行または列から所定の行または列までの位置判定範囲にあるか否かを判定する位置判定手段と、
     上記最後の非ゼロ係数の位置が、上記位置判定範囲にある場合、上記係数行列を、上記最後の非ゼロ係数の位置を含む第1の符号化対象範囲と、上記第1の符号化対象範囲以外の第2の符号化対象範囲とでそれぞれ符号化処理する2段階符号化手段と、を備えることを特徴とする画像符号化装置。
    In an image encoding device that outputs encoded data by scanning and encoding a coefficient matrix composed of quantized transform coefficients, a prediction residual obtained by subtracting a predicted image from image data,
    A last coefficient position detecting means for detecting a position of the last non-zero coefficient in the scan order in the coefficient matrix;
    Position determining means for determining whether or not the position of the last non-zero coefficient is in a position determination range from a row or column including a coefficient of a DC component to a predetermined row or column in the coefficient matrix;
    When the position of the last non-zero coefficient is in the position determination range, the coefficient matrix is divided into a first encoding target range including the position of the last non-zero coefficient, and the first encoding target range. An image encoding apparatus comprising: a two-stage encoding unit that performs encoding processing with a second encoding target range other than the above.
  10.  画像データから予測画像を減じた予測残差を、直行変換し、量子化した変換係数からなる係数行列をスキャンして符号することにより生成される符号化データのデータ構造において、
     上記係数行列における、上記スキャン順上最後の非ゼロ係数の位置を示す位置情報と、
     上記最後の非ゼロ係数を含み、上記係数行列において、直流成分の係数を含む行または列から所定の行または列までの第1の符号化対象範囲にある係数が順に符号化された第1係数符号化データと、
     上記第1の符号化対象範囲以外の第2の符号化対象範囲にある係数が順に符号化された第2係数符号化データとを含むことを特徴とする符号化データのデータ構造。
    In the data structure of encoded data generated by scanning and encoding a coefficient matrix composed of transform coefficients obtained by performing orthogonal transform and quantized transform coefficients, the prediction residual obtained by subtracting the predicted image from the image data,
    Position information indicating the position of the last non-zero coefficient in the scan order in the coefficient matrix;
    A first coefficient that includes the last non-zero coefficient, and in the coefficient matrix, the coefficients in the first encoding target range from the row or column including the coefficient of the DC component to the predetermined row or column are sequentially encoded Encoded data;
    A data structure of encoded data, comprising: second coefficient encoded data obtained by sequentially encoding coefficients in a second encoding target range other than the first encoding target range.
  11.  対象画像を単位領域毎に周波数変換して得られる各変換係数について、該変換係数を表す1または複数種類のシンタックスを算術符号化することによって得られた符号化データを復号する算術復号装置であって、
     処理対象の単位領域に対応する対象周波数領域における各シンタックスに対して、該シンタックスの種類および該シンタックスの該対象周波数領域における位置に応じて定まるコンテキストインデックスを割り付けるコンテキストインデックス割り付け手段と、
     上記対象周波数領域における各シンタックスを、該シンタックスに対して割り付けられたコンテキストインデックスによって指定される確率状態に基づいて順次算術復号するシンタックス復号手段と、
     上記シンタックス復号手段によって復号された各シンタックスから各変換係数を復元する変換係数復元手段と、
     上記対象周波数領域における復元済みの非0変換係数の分布の偏りに応じて、該対象周波数領域における未復号のシンタックスに割り付けるコンテキストインデックスを変更するコンテキストインデックス変更手段と、
    を備えていることを特徴とする算術復号装置。
    An arithmetic decoding device that decodes encoded data obtained by arithmetically encoding one or a plurality of types of syntax representing a transform coefficient for each transform coefficient obtained by frequency transforming a target image for each unit region There,
    Context index allocating means for allocating a context index determined according to the type of syntax and the position of the syntax in the target frequency domain for each syntax in the target frequency domain corresponding to the unit area to be processed;
    Syntax decoding means for sequentially arithmetically decoding each syntax in the target frequency domain based on a probability state specified by a context index assigned to the syntax;
    Transform coefficient restoration means for restoring each transform coefficient from each syntax decoded by the syntax decoding means;
    A context index changing means for changing a context index to be assigned to an undecoded syntax in the target frequency domain according to a bias in the distribution of the restored non-zero transform coefficient in the target frequency domain;
    An arithmetic decoding device comprising:
  12.  上記対象周波数領域における水平方向および垂直方向の座標をそれぞれuおよびvと表し、上記コンテキストインデックス割り付け手段によって上記未復号のシンタックスに割り付けられたコンテキストインデックスをctxIdx(u、v)と表したとき、
     上記コンテキストインデックス変更手段は、上記対象周波数領域における復号済みの非0変換係数の分布が、水平方向および垂直方向のうち、予め定められた方向に偏っている場合に、上記未復号のシンタックスに割り付けられたコンテキストインデックスctxIdx(u、v)を
      ctxIdx’(u、v)=ctxIdx(v、u)
    によって与えられるコンテキストインデックスctxIdx’(u、v)に変更するものである、
    ことを特徴とする請求項11に記載の算術復号装置。
    When the horizontal and vertical coordinates in the target frequency domain are expressed as u and v, respectively, and the context index allocated to the undecoded syntax by the context index allocation unit is expressed as ctxIdx (u, v),
    The context index changing means uses the undecoded syntax when the distribution of decoded non-zero transform coefficients in the target frequency domain is biased in a predetermined direction of the horizontal direction and the vertical direction. Assigned context index ctxIdx (u, v) ctxIdx ′ (u, v) = ctxIdx (v, u)
    To the context index ctxIdx ′ (u, v) given by
    The arithmetic decoding apparatus according to claim 11, wherein:
  13.  上記コンテキストインデックス変更手段は、上記対象周波数領域における復号済みの非0変換係数の分布の偏りを表す指標が、予め定められた閾値よりも大きい場合に、該対象周波数領域における未復号のシンタックスに割り付けるコンテキストインデックスを変更するものである、
    ことを特徴とする請求項11または12に記載の算術復号装置。
    The context index changing means uses the undecoded syntax in the target frequency domain when an index representing the distribution bias of the decoded non-zero transform coefficient in the target frequency domain is larger than a predetermined threshold. The context index to be allocated is changed.
    The arithmetic decoding apparatus according to claim 11 or 12, wherein
  14.  上記コンテキストインデックス変更手段は、上記対象周波数領域における未復号のシンタックスのうち、上記対象周波数領域における水平方向の座標および垂直方向の座標の少なくとも何れかが予め定められた閾値以下であるシンタックスに割り付けられたコンテキストインデックスを変更するものである、
    ことを特徴とする請求項11から13の何れか1項に記載の算術復号装置。
    The context index changing means uses a syntax in which at least one of the horizontal coordinate and the vertical coordinate in the target frequency region is not more than a predetermined threshold among undecoded syntaxes in the target frequency region. Change the allocated context index,
    The arithmetic decoding device according to any one of claims 11 to 13, wherein the arithmetic decoding device is any one of the above.
  15.  上記1または複数種類のシンタックスには、変換係数が0であるか否か示す第1フラグが含まれており、
     上記コンテキストインデックス変更手段は、該対象周波数領域における未復号の第1フラグに割り付けるコンテキストインデックスを変更するものである、
    ことを特徴とする請求項11から14の何れか1項に記載の算術復号装置。
    The one or more types of syntax include a first flag indicating whether or not the conversion coefficient is 0,
    The context index changing means is for changing a context index assigned to an undecoded first flag in the target frequency domain.
    The arithmetic decoding device according to claim 11, wherein the arithmetic decoding device is any one of the above.
  16.  上記1または複数種類のシンタックスには、処理順で最後の変換係数であるか否かを示す第2フラグが含まれており、
     上記コンテキストインデックス変更手段は、該対象周波数領域における未復号の第2フラグに割り付けるコンテキストインデックスを変更するものである、
    ことを特徴とする請求項11から14の何れか1項に記載の算術復号装置。
    The one or more types of syntax include a second flag indicating whether or not it is the last conversion coefficient in the processing order,
    The context index changing means is for changing a context index assigned to an undecoded second flag in the target frequency domain.
    The arithmetic decoding device according to claim 11, wherein the arithmetic decoding device is any one of the above.
  17.  請求項11から16の何れか1項に記載の算術復号装置と、
     上記算術復号装置によって復号された変換係数を逆周波数変換することによって残差画像を生成する逆周波数変換手段と、
     上記逆周波数変換手段によって生成された残差画像と、生成済みの復号画像から予測された予測画像とを加算することによって復号画像を生成する復号画像生成手段と、
    を備えていることを特徴とする画像復号装置。
    The arithmetic decoding device according to any one of claims 11 to 16,
    Inverse frequency transforming means for generating a residual image by inverse frequency transforming transform coefficients decoded by the arithmetic decoding device;
    Decoded image generating means for generating a decoded image by adding the residual image generated by the inverse frequency transform means and the predicted image predicted from the generated decoded image;
    An image decoding apparatus comprising:
  18.  対象画像を単位領域毎に周波数変換して得られる各変換係数について、該変換係数を表す1または複数種類のシンタックスを算術符号化することによって符号化データを生成する算術符号化装置であって、
     処理対象の単位領域に対応する対象周波数領域における各変換係数を表す各シンタックスに対して、該シンタックスの種類および該シンタックスの該対象周波数領域における位置に応じて定まるコンテキストインデックスを割り付けるコンテキストインデックス割り付け手段と、
     上記対象周波数領域における各シンタックスを、該シンタックスに対して割り付けられたコンテキストインデックスによって指定される確率状態に基づいて順次算術符号化するシンタックス符号化手段と、
     上記対象周波数領域における符号化済みの非0変換係数の分布の偏りに応じて、該対象周波数領域における未符号化シンタックスに割り付けるコンテキストインデックスを変更するコンテキストインデックス変更手段と、
    を備えていることを特徴とする算術符号化装置。
    An arithmetic encoding device that generates encoded data by arithmetically encoding one or a plurality of types of syntax representing a conversion coefficient for each conversion coefficient obtained by frequency-converting a target image for each unit region. ,
    A context index that assigns a context index determined according to the type of the syntax and the position of the syntax in the target frequency domain for each syntax representing each transform coefficient in the target frequency domain corresponding to the unit area to be processed Allocation means;
    Syntax encoding means for sequentially arithmetically encoding each syntax in the target frequency domain based on a probability state specified by a context index assigned to the syntax;
    Context index changing means for changing a context index to be assigned to an uncoded syntax in the target frequency domain according to a bias in the distribution of encoded non-zero transform coefficients in the target frequency domain;
    An arithmetic coding apparatus comprising:
  19.  符号化対象画像と予測画像との残差画像を単位領域毎に周波数変換することによって変換係数を生成する変換係数生成手段と、
     請求項18に記載の算術符号化装置と、
    を備えており、
     上記算術符号化装置は、上記変換係数生成手段によって生成された変換係数を表す1または複数種類のシンタックスを算術符号化することによって符号化データを生成するものである、
    ことを特徴とする画像符号化装置。
    Transform coefficient generating means for generating a transform coefficient by frequency transforming the residual image between the encoding target image and the predicted image for each unit region;
    The arithmetic encoding device according to claim 18,
    With
    The arithmetic encoding device generates encoded data by arithmetically encoding one or a plurality of types of syntax representing the transform coefficient generated by the transform coefficient generation unit.
    An image encoding apparatus characterized by that.
  20.  原画像を単位領域毎に周波数変換して得られる各変換係数について、該変換係数を表す1または複数種類のシンタックスを算術符号化することによって得られる符号化データのデータ構造であって、
     上記1または複数種類のシンタックスには、変換係数が0であるか否か示すフラグが含まれており、
     上記符号化データを復号する算術復号装置は、処理対象の単位領域に対応する対象周波数領域における各シンタックスに対して、該シンタックスの種類および該シンタックスの該対象周波数領域における位置に応じて定まるコンテキストインデックスを割り付け、上記対象周波数領域における各シンタックスを、該シンタックスに対して割り付けられたコンテキストインデックスによって指定される確率状態に基づいて順次算術復号すると共に、上記対象周波数領域における復元済みの上記フラグの分布の偏りに応じて、該対象周波数領域における未復号のシンタックスに割り付けるコンテキストインデックスを変更する、
    ことを特徴とする符号化データのデータ構造。
    A data structure of encoded data obtained by arithmetically encoding one or a plurality of types of syntax representing the conversion coefficient for each conversion coefficient obtained by frequency-converting the original image for each unit region,
    The one or more types of syntax include a flag indicating whether or not the conversion coefficient is 0,
    The arithmetic decoding apparatus that decodes the encoded data, for each syntax in the target frequency domain corresponding to the unit area to be processed, according to the type of syntax and the position of the syntax in the target frequency domain A fixed context index is allocated, and each syntax in the target frequency domain is sequentially arithmetically decoded based on the probability state specified by the context index allocated to the syntax, and the restored in the target frequency domain Changing a context index assigned to an undecoded syntax in the target frequency domain according to the distribution of the flag;
    A data structure of encoded data characterized by the above.
PCT/JP2011/080126 2010-12-28 2011-12-26 Image decoding device, image encoding device, data structure of encoded data, arithmetic decoding device, and arithmetic encoding device WO2012090962A1 (en)

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
JP2010-294110 2010-12-28
JP2010294110 2010-12-28
JP2011-005123 2011-01-13
JP2011005123 2011-01-13

Publications (1)

Publication Number Publication Date
WO2012090962A1 true WO2012090962A1 (en) 2012-07-05

Family

ID=46383062

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2011/080126 WO2012090962A1 (en) 2010-12-28 2011-12-26 Image decoding device, image encoding device, data structure of encoded data, arithmetic decoding device, and arithmetic encoding device

Country Status (1)

Country Link
WO (1) WO2012090962A1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10291924B2 (en) 2012-09-06 2019-05-14 Sun Patent Trust Image coding method, image decoding method, image coding apparatus, image decoding apparatus, image coding and decoding apparatus
CN112585971A (en) * 2018-08-17 2021-03-30 佳能株式会社 Method, apparatus and system for encoding and decoding a transform block of video samples
US11368509B2 (en) * 2012-10-18 2022-06-21 Vid Scale, Inc. Decoding complexity for mobile multimedia streaming

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0818459A (en) * 1993-07-30 1996-01-19 Mitsubishi Electric Corp High efficiency encoder and high efficiency decoder
JP2007129612A (en) * 2005-11-07 2007-05-24 Nippon Telegr & Teleph Corp <Ntt> Scanning method, inverse scanning method, scanner and inverse scanner of orthogonal conversion coefficient, its program, and computer-readable recording medium recording the program
WO2010050156A1 (en) * 2008-10-28 2010-05-06 パナソニック株式会社 Image encoding method, image decoding method, image encoding device, image decoding device, integrated circuit, and program

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0818459A (en) * 1993-07-30 1996-01-19 Mitsubishi Electric Corp High efficiency encoder and high efficiency decoder
JP2007129612A (en) * 2005-11-07 2007-05-24 Nippon Telegr & Teleph Corp <Ntt> Scanning method, inverse scanning method, scanner and inverse scanner of orthogonal conversion coefficient, its program, and computer-readable recording medium recording the program
WO2010050156A1 (en) * 2008-10-28 2010-05-06 パナソニック株式会社 Image encoding method, image decoding method, image encoding device, image decoding device, integrated circuit, and program

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
"Test Model under Consideration, Output Document (draft007)", JOINT COLLABORATIVE TEAM ON VIDEO CODING (JCT-VC) OF ITU-T SG16 WP3 AND ISO/IEC JTC1/SC29/WG11, JCTVC-B205, 2ND MEETING, October 2010 (2010-10-01), GENEVA, CH, pages 1 - 14, 40-42, 132-138 *
KEMAL UGUR ET AL.: "Description of video coding technology proposal by Tandberg, Nokia, Ericsson", JOINT COLLABORATIVE TEAM ON VIDEO CODING (JCT-VC) OF ITU-T SG16 WP3 AND ISO/IEC JTC1/SC29/WG11, JCTVC-A119, 1ST MEETING, April 2010 (2010-04-01), DRESDEN, DE, pages 1 - 12 *
KEMAL UGUR ET AL.: "High Performance, Low Complexity Video Coding and the Emerging HEVC Standard", IEEE TRANSACTIONS ON CIRCUITS AND SYSTEMS FOR VIDEO TECHNOLOGY, vol. 20, no. 12, 1 December 2010 (2010-12-01), pages 1688 - 1697, XP011329410, DOI: doi:10.1109/TCSVT.2010.2092613 *
SUNIL LEE ET AL.: "Efficient coefficient coding method for large transform in VLC mode", JOINT COLLABORATIVE TEAM ON VIDEO CODING (JCT-VC) OF ITU-T SG16 WP3 AND ISO/IEC JTC1/SC29/WG11, JCTVC-C210, 3RD MEETING, October 2010 (2010-10-01), GUANGZHOU, CN, pages 1 - 6 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10291924B2 (en) 2012-09-06 2019-05-14 Sun Patent Trust Image coding method, image decoding method, image coding apparatus, image decoding apparatus, image coding and decoding apparatus
US10897624B2 (en) 2012-09-06 2021-01-19 Sun Patent Trust Image coding method, image decoding method, image coding apparatus, image decoding apparatus, image coding and decoding apparatus
US11368509B2 (en) * 2012-10-18 2022-06-21 Vid Scale, Inc. Decoding complexity for mobile multimedia streaming
CN112585971A (en) * 2018-08-17 2021-03-30 佳能株式会社 Method, apparatus and system for encoding and decoding a transform block of video samples

Similar Documents

Publication Publication Date Title
US11627337B2 (en) Image decoding device
JP7200320B2 (en) Image filter device, filter method and moving image decoding device
US10547861B2 (en) Image decoding device
JP6190361B2 (en) Arithmetic decoding device, image decoding device, arithmetic coding device, and image coding device
WO2016203981A1 (en) Image decoding device and image encoding device
WO2017068856A1 (en) Predictive image generation device, image decoding device, and image encoding device
WO2012081609A1 (en) Image filter device, decoder, encoder, and data structure
JP2017085586A (en) Image decoding device and image encoding device
JP2013192118A (en) Arithmetic decoder, image decoder, arithmetic encoder, and image encoder
JP2013187869A (en) Arithmetic decoding device, arithmetic coding device, image decoding device, and image coding device
JP2013141094A (en) Image decoding device, image encoding device, image filter device, and data structure of encoded data
WO2012090962A1 (en) Image decoding device, image encoding device, data structure of encoded data, arithmetic decoding device, and arithmetic encoding device
WO2012137890A1 (en) Image filter apparatus, decoder apparatus, encoder apparatus, and data structure
AU2015264943B2 (en) Image decoding device, image encoding device, and data structure of encoded data
JP2013223051A (en) Arithmetic decoding device, image decoding device, arithmetic coding device, and image coding device
WO2012081706A1 (en) Image filter device, filter device, decoder, encoder, and data structure
WO2012043676A1 (en) Decoding device, encoding device, and data structure
WO2012081636A1 (en) Image decoding device, image coding device, and data structure of coded data
JP2012182753A (en) Image decoding device, image coding device, and data structure of coding data

Legal Events

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

Ref document number: 11852927

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 11852927

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: JP