WO2018230493A1 - Video decoding device, video encoding device, prediction image generation device and motion vector derivation device - Google Patents

Video decoding device, video encoding device, prediction image generation device and motion vector derivation device Download PDF

Info

Publication number
WO2018230493A1
WO2018230493A1 PCT/JP2018/022196 JP2018022196W WO2018230493A1 WO 2018230493 A1 WO2018230493 A1 WO 2018230493A1 JP 2018022196 W JP2018022196 W JP 2018022196W WO 2018230493 A1 WO2018230493 A1 WO 2018230493A1
Authority
WO
WIPO (PCT)
Prior art keywords
unit
motion vector
prediction
block
image
Prior art date
Application number
PCT/JP2018/022196
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 WO2018230493A1 publication Critical patent/WO2018230493A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/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/103Selection of coding mode or of prediction mode
    • H04N19/109Selection of coding mode or of prediction mode among a plurality of temporal predictive coding modes
    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/182Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being a pixel
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/42Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation
    • H04N19/43Hardware specially adapted for motion estimation or compensation
    • H04N19/433Hardware specially adapted for motion estimation or compensation characterised by techniques for memory access
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/503Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal prediction
    • H04N19/51Motion estimation or motion compensation
    • H04N19/537Motion estimation other than block-based

Definitions

  • the present invention relates to a video decoding device, a video encoding device, a predicted image generation device, and a motion vector derivation 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.
  • the moving image encoding method include a method proposed in H.264 / AVC and HEVC (High-Efficiency Video Coding).
  • an image (picture) constituting a moving image is a slice obtained by dividing the image, a coding tree unit (CTU: Coding Tree Unit obtained by dividing the slice). ), A coding unit obtained by dividing a coding tree unit (sometimes called a coding unit (Coding Unit: CU)), and a prediction unit which is a block obtained by dividing a coding unit (PU) and a hierarchical structure composed of conversion units (TU), and encoded / decoded for each CU.
  • CTU Coding Tree Unit obtained by dividing the slice.
  • CU Coding Unit
  • a prediction unit which is a block obtained by dividing a coding unit (PU) and a hierarchical structure composed of conversion units (TU), and encoded / decoded for each CU.
  • a predicted image is usually generated based on a local decoded image obtained by encoding / decoding an input image, and the predicted image is generated from the input image (original image).
  • a prediction residual obtained by subtraction (sometimes referred to as “difference image” or “residual image”) is encoded. Examples of methods for generating a predicted image include inter-screen prediction (inter prediction) and intra-screen prediction (intra prediction).
  • Non-Patent Documents 1 to 3 can be cited as recent moving picture encoding and decoding techniques.
  • Non-Patent Document 1 describes a technique related to BIO (bi-directional optical flow: bi-predictive gradient change) prediction that is corrected using gradient information in motion compensation processing when generating a predicted image.
  • Non-Patent Document 2 describes a technique using affine prediction.
  • Non-Patent Document 3 describes a technique for searching for a motion vector by matching in an encoding device and a decoding device.
  • JVET-F0028 "Joint Video Exploration Team (JVET) of ITU-T SG16 WP 3 and ISO / IEC JTC 1 / SC 29 / WG 11", 6th Meeting: Hobart, AU, 3 March-7 April 2017 Improved affine motion prediction, JVET-C0062, Joint Video Exploration Team (JVET) of ITU-T SG 16 WP 3 and ISO / IEC JTC 1 / SC 29 / WG 11, 2016-05-17 Video / JVET, "Algorithm Description of Joint Exploration TestModel 1 (JEM 1)", INTERNATIONAL ORGANIZATION FOR STANDARDIZATION ORGANISATION INTERNATIONALE DE NORMALISATION ISO / IEC JTC1 / SC29 / WG11 CODING OF / MOVING PICTCS29 / AND N15790, October 2015, Geneva, CH.
  • the present invention aims to reduce the memory bandwidth.
  • a predicted image generation apparatus is a predicted image generation apparatus that generates a predicted image by performing motion compensation on one or more reference images, Single prediction mode for generating a predicted image with reference to the first reference image, bi-prediction mode for generating a predicted image with reference to the first reference image and the second reference image, and the first reference image
  • a predicted image generation unit that generates a predicted image using at least one of the BIO modes for generating a predicted image with reference to the second reference image and the gradient correction term, wherein the predicted image generation unit includes: When the reference block in at least one of the reference image and the second reference image is outside the screen of the reference image, the generation of the predicted image using the BIO mode is prohibited.
  • a predicted image generation apparatus is a predicted image generation apparatus that generates a predicted image by performing motion compensation on a plurality of reference images.
  • a predicted image generation unit that generates a predicted image using at least a plurality of modes including a BIO mode that generates a predicted image with reference to the reference image, the second reference image, and the gradient correction term.
  • the unit generates a pixel value outside the reading region that is a pixel value outside the reading region with respect to the corresponding block in at least one of the first reference image and the second reference image, and uses the BIO mode to generate a predicted image
  • the generation process of the pixel value outside the reading area along the vertical direction or the horizontal direction by the predicted image generation unit is prohibited.
  • a motion vector deriving device is a motion vector deriving device for deriving a motion vector of each of subblocks constituting a target block.
  • a motion vector deriving unit that calculates a motion vector of each sub-block with reference to motion vectors at a plurality of control points set in a reference block sharing a vertex with the target block, Restricts the range of the difference of each motion vector at the plurality of control points.
  • a motion vector derivation device provides a motion vector derivation that generates a motion vector referred to in order to generate a prediction image used for encoding or decoding a moving image.
  • a first motion vector search unit that searches for a motion vector for each prediction block by matching processing and a motion vector selected by the first motion vector search unit are included in the prediction block.
  • a second motion vector search unit that searches for a motion vector by a matching process for each of the plurality of sub-blocks, and the first motion vector search unit performs an initial vector search for a prediction block;
  • the second motion vector search unit searches for a motion vector by performing a local search.
  • a motion vector is searched by performing a local search after performing an initial vector search for a block, and a local search by the first motion vector search unit and a local search by the second motion vector search unit In at least one of the target searches, a search in an oblique direction is prohibited.
  • the memory bandwidth can be reduced.
  • FIG. 1 It is a figure which shows the hierarchical structure of the data of an encoding stream. It is a figure which shows the pattern of PU division
  • FIG. 3 is a block diagram illustrating a configuration of an AMVP prediction parameter derivation unit according to Embodiment 1.
  • FIG. It is a block diagram which shows the structure of the inter prediction parameter encoding part of the image coding apparatus which concerns on Embodiment 1.
  • FIG. It is a block diagram which shows the structure of the inter estimated image generation part of the image decoding apparatus which concerns on Embodiment 1.
  • FIG. It is a block diagram which shows the structure of the inter prediction parameter decoding part which concerns on Embodiment 1.
  • FIG. It is a block diagram which shows the structure of the inter prediction parameter decoding part which concerns on Embodiment 1.
  • FIG. It is a block diagram which shows the structure of the inter prediction parameter decoding part which concerns on Embodiment 1.
  • FIG. It is a block diagram which shows the structure of the inter prediction parameter decoding part which concerns on Embodiment 1.
  • 5 is a flowchart illustrating an example of a flow of processing in which a motion compensation unit in the image decoding device according to Embodiment 1 generates a predicted image.
  • 12 is a flowchart illustrating another example of a flow of processing in which the motion compensation unit in the image decoding device according to Embodiment 1 generates a predicted image.
  • FIG. 12 is a flowchart illustrating an example of a flow of processing in which the motion compensation unit in the image decoding device according to the second embodiment determines whether to prohibit BIO padding in the horizontal direction.
  • 10 is a flowchart illustrating an example of a flow of processing for determining whether or not the motion compensation unit in the image decoding device according to the second embodiment prohibits BIO padding in the vertical direction.
  • 12 is a flowchart illustrating an example of a flow of processing for determining whether or not the motion compensation unit in the image decoding device according to the second embodiment prohibits BIO padding in the horizontal direction or the vertical direction. It is the schematic of the corresponding block referred when the motion compensation part in the image decoding apparatus which concerns on Embodiment 2 uses BIO mode.
  • 14 is a flowchart illustrating an operation of motion vector decoding processing of the image decoding apparatus according to the third embodiment.
  • FIG. It is a block diagram which shows the structure of the inter prediction parameter encoding part of the image coding apparatus which concerns on Embodiment 3.
  • FIG. It is a block diagram which shows the structure of the inter prediction parameter decoding part which concerns on Embodiment 3.
  • FIG. It is a figure which shows the example which derives
  • (A) is a figure for demonstrating bilateral matching (Bilateral (matching) matching).
  • (B) is a figure for demonstrating template matching (Template
  • FIG. It is a block diagram which shows the structure of the inter prediction parameter encoding part of the image coding apparatus which concerns on Embodiment 4.
  • FIG. It is a block diagram which shows the structure of the inter prediction parameter decoding part which concerns on Embodiment 4.
  • FIG. It is a flowchart figure which shows the outline
  • (A) And (b) is a figure for demonstrating a motion search pattern. It is a flowchart figure which shows the outline
  • FIG. 52 is a schematic diagram illustrating a configuration of the image transmission system 1 according to the first embodiment.
  • the image transmission system 1 is a system that transmits a code obtained by encoding an encoding target image, decodes the transmitted code, and displays an image.
  • the image transmission system 1 includes an image encoding device (moving image encoding device) 11, a network 21, an image decoding device (moving image decoding device) 31, and an image display device 41.
  • the image encoding device 11 receives an image T indicating a single layer image or a plurality of layers.
  • a layer is a concept used to distinguish a plurality of pictures when there are one or more pictures constituting a certain time. For example, when the same picture is encoded by a plurality of layers having different image quality or resolution, scalable encoding is performed, and when a picture of a different viewpoint is encoded by a plurality of layers, view scalable encoding is performed.
  • inter-layer prediction, inter-view prediction encoding efficiency is greatly improved. Further, even when prediction is not performed (simultaneous casting), encoded data can be collected.
  • the network 21 transmits the encoded stream Te generated by the image encoding device 11 to the image decoding device 31.
  • the network 21 is the Internet, a wide area network (WAN: Wide Area Network), a small network (LAN: Local Area Network), or a combination thereof.
  • the network 21 is not necessarily limited to a bidirectional communication network, and may be a one-way communication network that transmits broadcast waves such as terrestrial digital broadcast and satellite broadcast.
  • the network 21 may be replaced by a storage medium that records an encoded stream Te such as a DVD (Digital Versatile Disc) or a BD (Blue-ray Disc).
  • the image decoding device 31 decodes each of the encoded streams Te transmitted by the network 21, and generates one or a plurality of decoded images Td decoded.
  • the image display device 41 displays all or part of one or a plurality of decoded images Td generated by the image decoding device 31.
  • the image display device 41 includes a display device such as a liquid crystal display or an organic EL (Electro-luminescence) display. Further, in spatial scalable coding and SNR scalable coding, when the image decoding device 31 and the image display device 41 have high processing capability, an enhancement layer image with high image quality is displayed. When the processing capability is lower, the base layer image that does not require higher processing capability and display capability is displayed as the enhancement layer.
  • X? Y: z is a ternary operator that takes y when x is true (non-zero) and takes z when x is false (0).
  • FIG. 1 is a diagram showing a hierarchical structure of data in the encoded stream Te.
  • the encoded stream Te illustratively includes a sequence and a plurality of pictures constituting the sequence.
  • (A) to (f) of FIG. 1 respectively show an encoded video sequence defining a sequence SEQ, an encoded picture defining a picture PICT, an encoded slice defining a slice S, and an encoded slice defining a slice data
  • the encoded video sequence In the encoded video sequence, a set of data referred to by the image decoding device 31 for decoding the sequence SEQ to be processed is defined. As shown in FIG. 1A, the sequence SEQ includes a video parameter set (Video Parameter Set), a sequence parameter set SPS (Sequence Parameter Set), a picture parameter set PPS (Picture Parameter Set), a picture PICT, and an addition. Includes SEI (Supplemental Enhancement Information). Here, the value indicated after # indicates the layer ID. FIG. 1 shows an example in which encoded data of # 0 and # 1, that is, layer 0 and layer 1, exists, but the type of layer and the number of layers are not dependent on this.
  • SEI Supplemental Enhancement Information
  • the video parameter set VPS is a set of coding parameters common to a plurality of moving images, a plurality of layers included in the moving image, and coding parameters related to individual layers in a moving image composed of a plurality of layers.
  • a set is defined.
  • the sequence parameter set SPS defines a set of encoding parameters that the image decoding device 31 refers to in order to decode the target sequence. For example, the width and height of the picture are defined. A plurality of SPSs may exist. In that case, one of a plurality of SPSs is selected from the PPS.
  • a set of encoding parameters referred to by the image decoding device 31 in order to decode each picture in the target sequence is defined.
  • a reference value (pic_init_qp_minus26) of a quantization width used for picture decoding and a flag (weighted_pred_flag) indicating application of weighted prediction are included.
  • the picture PICT includes slices S0 to S NS-1 (NS is the total number of slices included in the picture PICT).
  • the coded slice In the coded slice, a set of data referred to by the image decoding device 31 for decoding the slice S to be processed is defined. As shown in FIG. 1C, the slice S includes a slice header SH and slice data SDATA.
  • the slice header SH includes an encoding parameter group that is referred to by the image decoding device 31 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 may include a reference (pic_parameter_set_id) to the picture parameter set PPS included in the encoded video sequence.
  • the slice data SDATA includes a coding tree unit (CTU) as shown in FIG.
  • a CTU is a block of a fixed size (for example, 64x64) that constitutes a slice, and is sometimes called a maximum coding unit (LCU: Large Coding Unit).
  • Encoding tree unit As shown in (e) of FIG. 1, a set of data referred to by the image decoding device 31 in order to decode the encoding tree unit to be processed is defined.
  • the coding tree unit is divided by recursive quadtree division.
  • a tree-structured node obtained by recursive quadtree partitioning is referred to as a coding node (CN).
  • An intermediate node of the quadtree is an encoding node, and the encoding tree unit itself is defined as the highest encoding node.
  • the CTU includes a split flag (cu_split_flag), and when cu_split_flag is 1, it is split into four coding nodes CN.
  • the coding node CN is not divided and has one coding unit (CU: Coding Unit) as a node.
  • CU Coding Unit
  • the encoding unit CU is a terminal node of the encoding node and is not further divided.
  • the encoding unit CU is a basic unit of the encoding process.
  • the size of the coding tree unit CTU is 64 ⁇ 64 pixels
  • the size of the coding unit can be any of 64 ⁇ 64 pixels, 32 ⁇ 32 pixels, 16 ⁇ 16 pixels, and 8 ⁇ 8 pixels.
  • the encoding unit As shown in (f) of FIG. 1, a set of data referred to by the image decoding device 31 in order to decode an encoding unit to be processed is defined. Specifically, the encoding unit includes a prediction tree, a conversion tree, and a CU header CUH. In the CU header, a prediction mode, a division method (PU division mode), and the like are defined.
  • prediction information (a reference picture index, a motion vector, etc.) of each prediction unit (PU) obtained by dividing the coding unit into one or a plurality of parts is defined.
  • the prediction unit is one or a plurality of non-overlapping areas constituting the encoding unit.
  • the prediction tree includes one or a plurality of prediction units obtained by the above-described division.
  • a prediction unit obtained by further dividing the prediction unit is referred to as a “sub-block”.
  • the sub block is composed of a plurality of pixels. When the sizes of the prediction unit and the sub-block are equal, the number of sub-blocks in the prediction unit is one.
  • the prediction unit is divided into sub-blocks. For example, when the prediction unit is 8x8 and the sub-block is 4x4, the prediction unit is divided into four sub-blocks that are horizontally divided into two and vertically divided into two.
  • the prediction process may be performed for each prediction unit (sub block).
  • Intra prediction is prediction within the same picture
  • inter prediction refers to prediction processing performed between different pictures (for example, between display times or between layer images).
  • the division method is encoded by the PU division mode (part_mode) of encoded data, and 2Nx2N (the same size as the encoding unit), 2NxN, 2NxnU, 2NxnD, Nx2N, nLx2N, nRx2N, and NxN etc.
  • 2NxN and Nx2N indicate 1: 1 symmetrical division
  • 2NxnU, 2NxnD, nLx2N, and nRx2N indicate 1: 3 or 3: 1 asymmetric division.
  • the PUs included in the CU are expressed as PU0, PU1, PU2, and PU3 in this order.
  • FIG. 2 specifically illustrate the shape of the partition (the position of the boundary of the PU partition) in each PU partition mode.
  • 2A shows a 2Nx2N partition
  • FIGS. 2B, 2C, and 2D show 2NxN, 2NxnU, and 2NxnD partitions (horizontal partitions), respectively.
  • E), (f), and (g) show partitions (vertical partitions) in the case of Nx2N, nLx2N, and nRx2N, respectively, and (h) shows an NxN partition.
  • the horizontal and vertical partitions are collectively referred to as a rectangular partition
  • 2Nx2N and NxN are collectively referred to as a square partition.
  • the encoding unit is divided into one or a plurality of conversion units, and the position and size of each conversion unit are defined.
  • the transform unit is one or a plurality of non-overlapping areas constituting the encoding unit.
  • the conversion tree includes one or a plurality of conversion units obtained by the above division.
  • the division in the conversion tree includes a case where an area having the same size as that of the encoding unit is assigned as a conversion unit, and a case where recursive quadtree division is used, as in the case of the CU division described above.
  • Conversion processing is performed for each conversion unit.
  • the prediction parameter includes prediction list use flags predFlagL0 and predFlagL1, reference picture indexes refIdxL0 and refIdxL1, and motion vectors mvL0 and mvL1.
  • the prediction list use flags predFlagL0 and predFlagL1 are flags indicating whether or not reference picture lists called L0 list and L1 list are used, respectively, and a reference picture list corresponding to a value of 1 is used.
  • flag indicating whether or not it is XX when “flag indicating whether or not it is XX” is described, when the flag is other than 0 (for example, 1) is XX, 0 is not XX, and logical negation, logical product, etc. 1 is treated as true and 0 is treated as false (the same applies hereinafter).
  • flag when “flag indicating whether or not it is XX” is described, when the flag is other than 0 (for example, 1) is XX, 0 is not XX, and logical negation, logical product, etc. 1 is treated as true and 0 is treated as false (the same applies hereinafter).
  • other values can be used as true values and false values.
  • Syntax elements for deriving inter prediction parameters included in the encoded data include, for example, PU partition mode part_mode, merge flag merge_flag, merge index merge_idx, inter prediction identifier inter_pred_idc, reference picture index refIdxLX, prediction vector index mvp_LX_idx, And there is a difference vector mvdLX.
  • the reference picture list is a list including reference pictures stored in the reference picture memory 306.
  • FIG. 3 is a conceptual diagram illustrating an example of a reference picture and a reference picture list.
  • a rectangle is a picture
  • an arrow is a picture reference relationship
  • a horizontal axis is time
  • I, P and B in the rectangle are intra pictures
  • uni-prediction pictures and bi-prediction pictures respectively
  • numbers in the rectangles are decoded Show the order.
  • the decoding order of pictures is I0, P1, B2, B3, and B4
  • the display order is I0, B3, B2, B4, and P1.
  • FIG. 3B shows an example of the reference picture list.
  • the reference picture list is a list representing candidate reference pictures, and one picture (slice) may have one or more reference picture lists.
  • the target picture B3 has two reference picture lists, an L0 list RefPicList0 and an L1 list RefPicList1.
  • the reference pictures when the target picture is B3 are I0, P1, and B2, and the reference picture has these pictures as elements.
  • refIdxLX the reference picture index
  • the figure shows an example in which reference pictures P1 and B2 are referred to by refIdxL0 and refIdxL1.
  • the prediction parameter decoding (encoding) method includes a merge prediction (merge) mode and an AMVP (Adaptive Motion Vector Prediction) mode.
  • the merge flag merge_flag is a flag for identifying these.
  • the merge prediction mode is a mode in which the prediction list usage flag predFlagLX (or inter prediction identifier inter_pred_idc), the reference picture index refIdxLX, and the motion vector mvLX are not included in the encoded data and are derived from the prediction parameters of already processed neighboring PUs.
  • the AMVP mode is a mode in which the inter prediction identifier inter_pred_idc, the reference picture index refIdxLX, and the motion vector mvLX are included in the encoded data.
  • the motion vector mvLX is encoded as a prediction vector index mvp_LX_idx for identifying the prediction vector mvpLX and a difference vector mvdLX.
  • the inter prediction identifier inter_pred_idc is a value indicating the type and number of reference pictures, and takes one of PRED_L0, PRED_L1, and PRED_BI.
  • PRED_L0 and PRED_L1 indicate that reference pictures managed in the reference picture lists of the L0 list and the L1 list are used, respectively, and that one reference picture (first reference picture) is used (single prediction mode).
  • PRED_BI indicates that two reference pictures (first reference picture and second reference picture) are used (bi-prediction BiPred mode), and reference pictures managed in the L0 list and the L1 list are used.
  • the prediction vector index mvp_LX_idx is an index indicating a prediction vector
  • the reference picture index refIdxLX is an index indicating a reference picture managed in the reference picture list.
  • LX is a description method used when L0 prediction and L1 prediction are not distinguished from each other. By replacing LX with L0 or L1, parameters for the L0 list and parameters for the L1 list are distinguished.
  • the merge index merge_idx is an index indicating whether or not any prediction parameter is used as a prediction parameter of a decoding target PU among prediction parameter candidates (merge candidates) derived from a PU for which processing has been completed.
  • the motion vector mvLX indicates a shift amount between blocks on two different pictures.
  • a prediction vector and a difference vector related to the motion vector mvLX are referred to as a prediction vector mvpLX and a difference vector mvdLX, respectively.
  • Inter prediction identifier inter_pred_idc and prediction list use flag predFlagLX The relationship between the inter prediction identifier inter_pred_idc and the prediction list use flags predFlagL0 and predFlagL1 is as follows and can be converted into each other.
  • the flag biPred as to whether it is in the bi-prediction BiPred mode can be derived based on whether both of the two prediction list use flags are 1. For example, it can be derived by the following equation.
  • the flag biPred can also be derived depending on whether or not the inter prediction identifier is a value indicating that two prediction lists (reference pictures) are used. For example, it can be derived by the following equation.
  • FIG. 5 is a block diagram illustrating a configuration of the image decoding device 31 according to the first embodiment.
  • the image decoding device 31 includes an entropy decoding unit 301, a prediction parameter decoding unit 302, a loop filter 305, a reference picture memory 306, a prediction parameter memory 307, a prediction image generation unit (prediction image generation device) 308, and an inverse quantization / inverse conversion unit. 311 and an adder 312.
  • the prediction parameter decoding unit 302 includes an inter prediction parameter decoding unit 303 and an intra prediction parameter decoding unit 304.
  • the predicted image generation unit 308 includes an inter predicted image generation unit 309 and an intra predicted image generation unit 310.
  • the entropy decoding unit 301 performs entropy decoding on the coded stream Te input from the outside, and separates and decodes individual codes (syntax elements).
  • the separated codes include prediction information for generating a prediction image, residual information for generating a difference image, and the like.
  • the entropy decoding unit 301 outputs a part of the separated code to the prediction parameter decoding unit 302.
  • Some of the separated codes are, for example, the prediction mode predMode, the PU partition mode part_mode, the merge flag merge_flag, the merge index merge_idx, the inter prediction identifier inter_pred_idc, the reference picture index refIdxLX, the prediction vector index mvp_LX_idx, and the difference vector mvdLX. Control of which code is decoded is performed based on an instruction from the prediction parameter decoding unit 302.
  • the entropy decoding unit 301 outputs the quantized coefficient to the inverse quantization / inverse transform unit 311.
  • this quantized coefficient is obtained by performing DCT (Discrete Cosine Transform), DST (Discrete Sine Transform), or KLT (Karyhnen Loeve Transform) in the encoding process.
  • DCT Discrete Cosine Transform
  • DST Discrete Sine Transform
  • KLT Karyhnen Loeve Transform
  • the inter prediction parameter decoding unit 303 decodes the inter prediction parameter with reference to the prediction parameter stored in the prediction parameter memory 307 based on the code input from the entropy decoding unit 301.
  • the inter prediction parameter decoding unit 303 outputs the decoded inter prediction parameter to the prediction image generation unit 308 and stores it in the prediction parameter memory 307. Details of the inter prediction parameter decoding unit 303 will be described later.
  • the intra prediction parameter decoding unit 304 refers to the prediction parameter stored in the prediction parameter memory 307 on the basis of the code input from the entropy decoding unit 301 and decodes the intra prediction parameter.
  • the intra prediction parameter is a parameter used in the process of predicting a CU within one picture, for example, an intra prediction mode IntraPredMode.
  • the intra prediction parameter decoding unit 304 outputs the decoded intra prediction parameter to the prediction image generation unit 308 and stores it in the prediction parameter memory 307.
  • the intra prediction parameter decoding unit 304 may derive different intra prediction modes for luminance and color difference.
  • the intra prediction parameter decoding unit 304 decodes the luminance prediction mode IntraPredModeY as the luminance prediction parameter and the color difference prediction mode IntraPredModeC as the color difference prediction parameter.
  • the luminance prediction mode IntraPredModeY is a 35 mode, and corresponds to planar prediction (0), DC prediction (1), and direction prediction (2 to 34).
  • the color difference prediction mode IntraPredModeC uses one of the planar prediction (0), the DC prediction (1), the direction prediction (2 to 34), and the LM mode (35).
  • the intra prediction parameter decoding unit 304 decodes a flag indicating whether IntraPredModeC is the same mode as the luminance mode.
  • the intra prediction parameter decoding unit 304 assigns IntraPredModeY to IntraPredModeC if it indicates that the flag is the same mode as the luminance mode. If the flag indicates that the flag is different from the luminance mode, the intra prediction parameter decoding unit 304 sets the Plane prediction (0), DC prediction (1), direction prediction (2 to 34), and LM mode (35) as IntraPredModeC. May be decrypted.
  • the loop filter 305 applies filters such as a deblocking filter, a sample adaptive offset (SAO), and an adaptive loop filter (ALF) to the decoded image of the CU generated by the adding unit 312.
  • filters such as a deblocking filter, a sample adaptive offset (SAO), and an adaptive loop filter (ALF) to the decoded image of the CU generated by the adding unit 312.
  • the reference picture memory 306 stores the decoded image of the CU generated by the adding unit 312 at a predetermined position for each decoding target picture and CU.
  • the prediction parameter memory 307 stores the prediction parameter in a predetermined position for each decoding target picture and prediction unit (or sub-block, fixed-size block or pixel). Specifically, the prediction parameter memory 307 stores the inter prediction parameter decoded by the inter prediction parameter decoding unit 303, the intra prediction parameter decoded by the intra prediction parameter decoding unit 304, and the prediction mode predMode separated by the entropy decoding unit 301. .
  • the stored inter prediction parameters include, for example, a prediction list utilization flag predFlagLX (inter prediction identifier inter_pred_idc), a reference picture index refIdxLX, and a motion vector mvLX.
  • the prediction image generation unit 308 receives the prediction mode predMode input from the entropy decoding unit 301 and the prediction parameter from the prediction parameter decoding unit 302. Further, the predicted image generation unit 308 reads a reference picture from the reference picture memory 306. The prediction image generation unit 308 generates a prediction image of a PU or sub-block using the input prediction parameter and the read reference picture (reference picture block) according to the prediction mode indicated by the prediction mode predMode.
  • the inter prediction image generation unit 309 uses the inter prediction parameter input from the inter prediction parameter decoding unit 303 and the read reference picture (reference picture block). To generate a prediction image of the PU or sub-block.
  • the inter predicted image generation unit 309 performs the motion vector mvLX with reference to the decoding target PU from the reference picture indicated by the reference picture index refIdxLX.
  • the reference picture block at the position indicated by is read from the reference picture memory 306.
  • the inter prediction image generation unit 309 performs prediction based on the read reference picture block to generate a prediction image of the PU.
  • the inter prediction image generation unit 309 outputs the generated prediction image of the PU to the addition unit 312.
  • the reference picture block is a set of pixels on the reference picture (usually called a block because it is a rectangle), and is an area that is referred to in order to generate a predicted image of a PU or sub-block.
  • the intra predicted image generation unit 310 When the prediction mode predMode indicates the intra prediction mode, the intra predicted image generation unit 310 performs intra prediction using the intra prediction parameter input from the intra prediction parameter decoding unit 304 and the read reference picture. Specifically, the intra predicted image generation unit 310 reads, from the reference picture memory 306, neighboring PUs that are pictures to be decoded and are in a predetermined range from the decoding target PUs among the PUs that have already been decoded.
  • the predetermined range is, for example, one of the left, upper left, upper and upper right adjacent PUs when the decoding target PU sequentially moves in the so-called raster scan order, and varies depending on the intra prediction mode.
  • the raster scan order is an order in which each row is sequentially moved from the left end to the right end in each picture from the upper end to the lower end.
  • the intra prediction image generation unit 310 generates a prediction image of the PU by performing prediction based on the prediction mode indicated by the intra prediction mode IntraPredMode based on the read adjacent PU.
  • the intra predicted image generation unit 310 outputs the generated predicted image of the PU to the adding unit 312.
  • the intra prediction image generation unit 310 When the intra prediction parameter decoding unit 304 derives different intra prediction modes for luminance and chrominance, the intra prediction image generation unit 310 performs planar prediction (0), DC prediction (1) and DC prediction according to the luminance prediction mode IntraPredModeY. A prediction image of the luminance PU is generated by any one of the direction predictions (2 to 34). The intra-prediction image generation unit 310 predicts a color difference PU according to any of the planar prediction (0), DC prediction (1), direction prediction (2 to 34), and LM mode (35) according to the color difference prediction mode IntraPredModeC. Generate an image.
  • the inverse quantization / inverse transform unit 311 inversely quantizes the quantized coefficient input from the entropy decoding unit 301 to obtain a transform coefficient.
  • the inverse quantization / inverse transform unit 311 performs inverse frequency transform such as inverse DCT, inverse DST, and inverse KLT on the obtained transform coefficient, and calculates a residual signal.
  • the inverse quantization / inverse transform unit 311 outputs the calculated residual signal to the adder 312.
  • the addition unit 312 adds the prediction image of the PU input from the inter prediction image generation unit 309 or the intra prediction image generation unit 310 and the residual signal input from the inverse quantization / inverse conversion unit 311 for each pixel, Generate a decoded PU image.
  • the adding unit 312 stores the generated decoded image of the PU in the reference picture memory 306, and outputs a decoded image Td in which the generated decoded image of the PU is integrated for each picture to the outside.
  • FIG. 11 is a block diagram illustrating a configuration of the inter prediction parameter decoding unit 303 according to the first embodiment.
  • the inter prediction parameter decoding unit 303 includes an inter prediction parameter decoding control unit 3031, an AMVP prediction parameter derivation unit 3032, an addition unit 3038, a merge prediction parameter derivation unit 3036, and a sub-block prediction parameter derivation unit 3037.
  • the inter prediction parameter decoding control unit 3031 instructs the entropy decoding unit 301 to decode a code (syntax element) related to inter prediction. Also, the inter prediction parameter decoding control unit 3031 includes codes (syntax elements) included in the encoded data, for example, PU partition mode part_mode, merge flag merge_flag, merge index merge_idx, inter prediction identifier inter_pred_idc, reference picture index refIdxLX, prediction Vector index mvp_LX_idx or difference vector mvdLX is extracted.
  • the inter prediction parameter decoding control unit 3031 first extracts a merge flag merge_flag.
  • the inter prediction parameter decoding control unit 3031 expresses that a certain syntax element is to be extracted, it means that the entropy decoding unit 301 is instructed to decode a certain syntax element, and the corresponding syntax element is read from the encoded data. To do.
  • the inter prediction parameter decoding control unit 3031 uses the entropy decoding unit 301 to extract the AMVP prediction parameter from the encoded data.
  • AMVP prediction parameters include an inter prediction identifier inter_pred_idc, a reference picture index refIdxLX, a prediction vector index mvp_LX_idx, and a difference vector mvdLX.
  • the AMVP prediction parameter derivation unit 3032 derives a prediction vector mvpLX from the prediction vector index mvp_LX_idx. Details will be described later.
  • the inter prediction parameter decoding control unit 3031 outputs the difference vector mvdLX to the addition unit 3038.
  • the adding unit 3038 adds the prediction vector mvpLX and the difference vector mvdLX to derive a motion vector.
  • the inter prediction parameter decoding control unit 3031 extracts the merge index merge_idx as a prediction parameter related to merge prediction.
  • the inter prediction parameter decoding control unit 3031 outputs the extracted merge index merge_idx to the merge prediction parameter derivation unit 3036 (details will be described later), and outputs the sub-block prediction mode flag subPbMotionFlag to the sub-block prediction parameter derivation unit 3037.
  • the subblock prediction parameter deriving unit 3037 divides the PU into a plurality of subblocks according to the value of the subblock prediction mode flag subPbMotionFlag, and derives a motion vector in units of subblocks.
  • sub-block prediction is used for a method in which a CU is divided into a plurality of partitions (PUs such as 2NxN, Nx2N, and NxN) and the syntax of a prediction parameter is encoded for each partition unit.
  • PUs such as 2NxN, Nx2N, and NxN
  • the syntax of the prediction parameter is encoded for each set. Therefore, motion information of a large number of sub-blocks can be encoded with a small code amount.
  • FIG. 7 is a block diagram illustrating a configuration of the merge prediction parameter deriving unit 3036 according to the first embodiment.
  • the merge prediction parameter derivation unit 3036 includes a merge candidate derivation unit 30361, a merge candidate selection unit 30362, and a merge candidate storage unit 30363.
  • the merge candidate storage unit 30363 stores the merge candidates input from the merge candidate derivation unit 30361.
  • the merge candidate includes a prediction list use flag predFlagLX, a motion vector mvLX, and a reference picture index refIdxLX.
  • an index is assigned to the stored merge candidate according to a predetermined rule.
  • the merge candidate derivation unit 30361 derives a merge candidate using the motion vector of the adjacent PU that has already been decoded and the reference picture index refIdxLX as they are.
  • merge candidates may be derived using affine prediction. This method will be described in detail below.
  • the merge candidate derivation unit 30361 may use affine prediction for a spatial merge candidate derivation process, a temporal merge candidate derivation process, a combined merge candidate derivation process, and a zero merge candidate derivation process described later. Note that affine prediction is performed for each subblock, and the prediction parameters are stored in the prediction parameter memory 307 for each subblock. Alternatively, the affine prediction may be performed for each pixel unit.
  • the merge candidate derivation unit 30361 reads and reads the prediction parameters (prediction list use flag predFlagLX, motion vector mvLX, reference picture index refIdxLX) stored in the prediction parameter memory 307 according to a predetermined rule.
  • the predicted parameters are derived as merge candidates.
  • the prediction parameter to be read is a prediction parameter related to each of the PUs within a predetermined range from the decoding target PU (for example, all or part of the PUs in contact with the lower left end, the upper left end, and the upper right end of the decoding target PU, respectively). is there.
  • the merge candidate derivation unit 30361 reads the prediction parameter of the PU in the reference image including the lower right coordinate of the decoding target PU from the prediction parameter memory 307 and sets it as a merge candidate.
  • the reference picture designation method may be, for example, the reference picture index refIdxLX designated in the slice header, or may be designated using the smallest reference picture index refIdxLX of the PU adjacent to the decoding target PU.
  • the merge candidate derivation unit 30361 uses two different derived merge candidate motion vectors and reference picture indexes already derived and stored in the merge candidate storage unit 30363 as the motion vectors of L0 and L1, respectively. Combined merge candidates are derived by combining them.
  • the merge candidate derivation unit 30361 derives a merge candidate in which the reference picture index refIdxLX is 0 and both the X component and the Y component of the motion vector mvLX are 0.
  • the merge candidates derived by the merge candidate deriving unit 30361 are stored in the merge candidate storage unit 30363.
  • the merge candidate selection unit 30362 selects, from the merge candidates stored in the merge candidate storage unit 30363, a merge candidate to which an index corresponding to the merge index merge_idx input from the inter prediction parameter decoding control unit 3031 is assigned. As an inter prediction parameter.
  • the merge candidate selection unit 30362 stores the selected merge candidate in the prediction parameter memory 307 and outputs it to the prediction image generation unit 308.
  • FIG. 8 is a block diagram illustrating a configuration of the AMVP prediction parameter derivation unit 3032 according to the first embodiment.
  • the AMVP prediction parameter derivation unit 3032 includes a vector candidate derivation unit 3033, a vector candidate selection unit 3034, and a vector candidate storage unit 3035.
  • the vector candidate derivation unit 3033 derives a prediction vector candidate from the already processed PU motion vector mvLX stored in the prediction parameter memory 307 based on the reference picture index refIdx.
  • the vector candidate derivation unit 3033 stores the derived prediction vector candidate in the vector candidate storage unit 3035 prediction vector candidate list mvpListLX [].
  • the vector candidate selection unit 3034 selects the motion vector mvpListLX [mvp_LX_idx] indicated by the prediction vector index mvp_LX_idx from the prediction vector candidates in the prediction vector candidate list mvpListLX [] as the prediction vector mvpLX.
  • the vector candidate selection unit 3034 outputs the selected prediction vector mvpLX to the addition unit 3038.
  • a prediction vector candidate is a PU for which decoding processing has been completed, and is derived by scaling a motion vector of a PU (for example, an adjacent PU) within a predetermined range from the decoding target PU.
  • the adjacent PU includes a PU that is spatially adjacent to the decoding target PU, for example, the left PU and the upper PU, and an area that is temporally adjacent to the decoding target PU, for example, the same position as the decoding target PU. It includes areas obtained from prediction parameters of PUs with different times.
  • the addition unit 3038 adds the prediction vector mvpLX input from the AMVP prediction parameter derivation unit 3032 and the difference vector mvdLX input from the inter prediction parameter decoding control unit 3031 to calculate a motion vector mvLX.
  • the adding unit 3038 outputs the calculated motion vector mvLX to the predicted image generation unit 308 and the prediction parameter memory 307.
  • FIG. 10 is a block diagram illustrating a configuration of the inter predicted image generation unit 309 included in the predicted image generation unit 308 according to the first embodiment.
  • the inter prediction image generation unit 309 includes a motion compensation unit 3091 and a weight prediction unit 3094.
  • the motion compensation unit 3091 receives the reference picture index refIdxLX from the reference picture memory 306 based on the inter prediction parameters (prediction list use flag predFlagLX, reference picture index refIdxLX, and motion vector mvLX) input from the inter prediction parameter decoding unit 303.
  • the reference picture RefX any one of the reference pictures included in the reference picture list specified in (1)
  • an interpolation picture by reading a reference block at a position shifted by the motion vector mvLX starting from the position of the decoding target PU
  • Motion compensated image predSamplesLX is generated.
  • a motion compensation image is generated by applying a filter for generating a pixel at a decimal position called a motion compensation filter.
  • the motion compensation unit 3091 generates a prediction image by referring to the single prediction mode, the bi-prediction mode, the two reference images (first reference image and second reference image), and the gradient correction term.
  • a predicted image is generated using at least one of the BIO mode using prediction.
  • the motion compensation unit 3091 also determines that the reference block in at least one of the first reference image and the second reference image is outside the screen of the reference image (in other words, the reference block in the first reference image is the first block).
  • Generation of a predicted image using the BIO mode is prohibited when the reference image is outside the screen and / or the reference block in the second reference image is outside the second reference image). To do. That is, in the above case, the motion compensation unit 3091 does not perform prediction image generation using the BIO mode. Details of processing executed by the motion compensation unit 3091 will be described later.
  • the reference images referred to by the single prediction mode, the bi-prediction mode, and the BIO mode may be the same or different.
  • the weight prediction unit 3094 generates a prediction image of the PU by multiplying the input motion compensation image predSamplesLX by a weight coefficient.
  • FIG. 12 is a flowchart for explaining the flow of processing in which the motion compensation unit 3091 having a motion compensation function using gradient change (BIO) prediction derives a predicted image.
  • BIO gradient change
  • step S101 When it is determined that the inter prediction parameter decoding unit 303 is not in the bi-prediction mode (No in step S101, that is, uni-prediction UniPred), the process proceeds to step S105, and the motion compensation unit 3091 performs unidirectional motion compensation.
  • the inter prediction parameter decoding unit 303 when it is determined that the inter prediction parameter decoding unit 303 is in the bi-prediction mode (Yes in step S101, BiPred), the inter prediction parameter decoding unit 303 performs the determination shown in step S102.
  • step S102 If the L0 reference image refImgL0 and the L1 reference image refImgL1 (described as “two prediction blocks” in FIG. 12) acquired from the reference picture memory 306 are different reference images (Yes in step S102), the process proceeds to step S103.
  • the motion compensation unit 3091 performs motion compensation using BIO prediction described later.
  • the L0 reference image refImgL0 and the L1 reference image refImgL1 acquired from the reference picture memory 306 are the same reference image (No in step S102)
  • the process proceeds to step S104, and the motion compensation unit 3091 does not apply BIO prediction. Perform motion compensation.
  • FIG. 17 is a block diagram illustrating an example of the configuration of the motion compensation unit 3091.
  • the motion compensation unit 3091 includes a motion compensation gradient unit 30911 and a gradient correction coefficient unit 30912.
  • the motion compensation gradient unit 30911 includes a motion compensation derivation unit 309111 and a gradient derivation unit 309112
  • the gradient correction coefficient unit 30912 includes a gradient product derivation unit 309121 and a gradient correction coefficient derivation unit 309122.
  • the motion compensation unit 3091 applies bi-directional optical flow (bi-predictive gradient change: BIO) prediction that performs motion correction by applying a gradient correction term to a bi-prediction (BiPred) image. I do.
  • BIO bi-directional optical flow
  • This is a gradient correction term derived by Expression (A3).
  • lx0 (first gradient image), ly0 (second gradient image), lx1 (third gradient image), and ly1 (fourth gradient image) are gradient images.
  • the gradient images lx0 and lx1 show the gradient along the horizontal direction (x direction or first direction), and the gradient images ly0 and ly1 show the gradient along the vertical direction (y direction or second direction).
  • U and v are correction weight vectors.
  • the motion compensation unit 3091 generates a prediction image (inter prediction image) with reference to the motion compensation image P0 (first reference image), the motion compensation image P1 (second reference image), and the gradient correction term.
  • the processing flow will be described with reference to FIG. FIG. 18 is a flowchart showing the flow of processing in motion compensation using BIO prediction.
  • the motion compensation unit 3091 performs the following three steps of STEP 111 to 113 to derive a predicted image.
  • the motion compensation deriving unit 309111 reads out the L0 reference image refImgL0 (first reference image) and the L1 reference image refImgL1 (second reference image) to be used as the reference image from the reference picture memory 306, and the motion compensation image.
  • P0 and P1 are derived (S111a in FIG. 18).
  • the gradient deriving unit 309112 derives horizontal gradient images lx0 and lx1 and vertical gradient images ly0 and ly1 for the motion compensated images P0 and P1 derived by the motion compensation deriving unit 309111 (S111b in FIG. 18).
  • refImgL0, refImgL1, P0, P1, lx0, lx1, ly0, and ly1 are two-dimensional reference images refImgL01 [x] [y], refImgL1 [x] [y], and motion compensation image P0 [x] [ y], P1 [x] [y], gradient image lx0 [x] [y], lx1 [x] [y], ly0 [x] [y] and ly1 [x] [y] (x and y are predetermined Or a reference image value refImgL0, refImgL1, motion compensation image value P0, P1, gradient values lx0, lx1, ly0, and ly1.
  • the gradient product deriving unit 309121 derives the gradient product (S112a in FIG. 18).
  • the gradient correction coefficient deriving unit 309122 uses the gradient product derived by the gradient product deriving unit 309121 to derive a correction weight vector (u, v) (gradient correction coefficient, uh and vh in integer arithmetic) (see FIG. 18 S112b).
  • the gradient correction coefficient deriving unit 309122 may derive the correction weight vector (u, v) using Equation 5 in FIG. 13 or may be derived using the least square method as described later.
  • the motion compensation unit 3091 has gradient changes dI / dx (ie, lx) and dI / dy (ie, ly) at a plurality of points. ) And time variation dI / dt, u and v satisfying the condition that minimizes the square of the left side of Equation 5 in FIG. 13 may be derived.
  • the pixel value I of the point I on the target image Cur As shown in FIG. 14, the pixel value I of the point I on the target image Cur, the pixel value I0 of the point 10 (lx0, ly0) on the L0 reference image refImgL0, and the point l1 (lx1, L1 on the L1 reference image refImgL1) This corresponds to the pixel value I1 of ly1).
  • the gradient is (lx0, ly0), and the distance between IO and P0 is (Vx, Vy).
  • the distance (Vx, Vy) correction weight vector (u, v) Can be derived.
  • the motion compensation unit 3091 uses the pixel value I of the point I on the target image Cur, which is the prediction target image, as the pixel value l0 of the point 10 on the L0 reference image refImgL0 and the pixel value l1 of the point 11 on the L1 reference image refImgL1.
  • Average of I (l0 + l1) >> 1
  • Forma A4-1) ⁇ P0 + P1 + (lx0-lx1) * u + (ly0-ly1) * v ⁇ >> 1 (Formula A4-2)
  • l0 P0 + (lx0 * u + ly0 * v)
  • l1 P1-(lx1 * u + ly1 * v) It is.
  • the correction weight vector is (u, v) that minimizes Formula A5 from the assumption that the pixel value does not change.
  • ⁇ l0-l1 ⁇ 2 ⁇ (P0-P1) + (lx0 + lx1) * u + (ly0 + ly1) * v ⁇ 2 (Formula A5)
  • the gradient correction bi-prediction derivation unit 30913 derives the gradient correction term modBIO [] [] using the correction weight vector (u, v) derived in STEP 112 (see Equation A3 and Equation A19 described later). (S113a in FIG. 18). Then, the gradient correction bi-prediction derivation unit 30913 derives the pixel value Pred of the gradient correction bi-prediction image (prediction image, corrected prediction image) using Expression A2 (S113b in FIG. 18).
  • the motion compensation unit 3091 derives (generates) a motion compensation image and a gradient image will be described as an example, but the motion compensation unit 3091 derives a pixel value included in the image, not an image. It may be a configuration. That is, the motion compensation unit 3091 may derive the pixel value of the motion compensation image and the pixel value of the gradient image.
  • the motion compensation derivation unit 309111 derives motion compensation images P0 and P1 (also referred to as basic motion compensation images) based on the L0 reference image refImgL0 and the L1 reference image refImgL1 (S111a in FIG. 18). Further, the gradient deriving unit 309112 derives horizontal gradient images lx0 and lx1 and vertical gradient images ly0 and ly1 for the derived motion compensation images P0 and P1 (S111b in FIG. 18).
  • the motion compensation deriving unit 309111 applies a vertical motion compensation filter (mcFilterVer) to the reference image. Then, the motion compensation images P0 and P1 are derived by further applying a horizontal motion compensation filter (mcFilterHor) to the reference image to which the vertical motion compensation filter is applied.
  • mcFilterVer vertical motion compensation filter
  • mcFilterHor horizontal motion compensation filter
  • the accuracy of the motion vector is assumed to be 1/4 pel accuracy, but the motion vector accuracy is not limited to this, and may be 1/8, 1/16,.
  • the shift value for deriving the integer positions xInt, yInt is log2 (M) and the logical sum for deriving the phases xFrac, yFrac (&
  • the following formula A8 may be used in which the value used for () is M-1.
  • bit Depth of the filter coefficient is, for example, MC_ACCU
  • bitDepthY + MC_ACCU which is a value obtained by adding MC_ACCU to the bit depth bitDepthY of the reference image.
  • a right shift of only MC_ACCU is required as a right shift for adjusting the dynamic range.
  • the two filters are serial processing, it is appropriate to use the intermediate bit depth INTERNAL_BIT_DEPTH higher than bitDepth in the output of the first filter operation and return from INTERNAL_BIT_DEPTH to bitDepth in the output of the second filter operation. It is.
  • the shift values shift1 and shift2 for adjusting the dynamic range of the first and second filters may be set as follows.
  • bitDepthY represents the bit depth of the reference image
  • INTERNAL_BIT_DEPTH represents the intermediate bit depth
  • MC_ACCU represents the accuracy of the motion compensation filter mcFilter. Note that MC_ACCU is not limited to 6, and a value such as 3 to 10 can be used.
  • bitDepth indicates the bit depth of the temporary image temp [] [].
  • the bit depth of the temporary image temp [] [] is a value obtained by subtracting the right shift value shift1 in the filter processing from the sum of the bit depth bitDepthY of the reference image and the accuracy MC_ACCU of the motion compensation filter. This value is referred to herein as the intermediate bit depth INTERNAL_BIT DEPTH.
  • the product sum of the temporary image temp [] [] derived by the compensation filter mcFilterVer is used as the value obtained by adjusting the range by the shift value shift2.
  • the horizontal gradient image lxX is obtained by the gradient derivation unit 309112 applying the horizontal gradient filter gradFilterHor after applying the vertical motion compensation filter mcFilterVer.
  • the gradient deriving unit 309112 applies the horizontal gradient filter gradFilterHor to the temporary image temp [] [] derived by the above equation A10 to derive the horizontal gradient image lxX as in the following equation A12.
  • x 0..BLKW-1
  • y 0..BLKH-1
  • k 0..NTAPS-1
  • offset2 1 ⁇ (shift2-1)
  • lxX is lx0 or lx1.
  • bitDepth (lxX [] []) indicates the bit depth of the filtered image lxX [] [].
  • GRAD_ACCU represents the accuracy of the gradient filter gradFilter (gradFilterHor or gradFilterVer).
  • the gradient derivation unit 309112 applies the vertical gradient filter (gradFilterVer) with reference to the L0 reference image refImgL0 and the L1 reference image refImgL1, and then applies the horizontal motion compensation filter (mcFilterHor) to thereby obtain the vertical gradient image ly0 and Derive ly1.
  • vertical gradient filter gradeFilterVer
  • horizontal motion compensation filter mcFilterHor
  • a vertical gradient image lyX is derived by applying a horizontal motion compensation filter mcFilterHor to this temp [x] [y].
  • the gradient product deriving unit 309121 may derive the correction weight vector (u, v) that minimizes the value obtained by the above equation A5 using the least square method.
  • the gradient correction coefficient deriving unit 309122 is, for example, an integer value obtained by shifting u to the left by shift BIO bits instead of the correction weight vector (u, v) that actually requires calculation of decimal point precision.
  • shiftBIO 5
  • the precision is 1/32.
  • s2 s4
  • s4 may be used instead of s2 in the above formula A15.
  • the gradient correction bi-prediction derivation unit 30913 derives the gradient correction term modBIO by substituting the correction weight vector (u, v) derived in STEP 112 into the equation A3, and the pixel value Pred of the predicted image is calculated using the equation A6. To derive.
  • the slope correction term modBIO may be weakened to 1/2 and used as in the above equation A7.
  • the pixel value Pred of the predicted image is derived using the prediction formula shown in the above formula A2.
  • shiftBIO2 shiftBIO + bitDepth (mcImg)-bitDepth (gradImg) + 1 (Formula A18) It is.
  • bitDepth (mcImg) is the bit depth of the motion compensated image
  • bitDepth (gradImg) is the bit depth of the gradient image
  • FIG. 19 is a diagram illustrating an area where the motion compensation unit 3091 performs BIO padding.
  • FIG. 20 is a diagram illustrating an example when the motion compensation unit 3091 performs off-screen padding.
  • “padding” refers to a process of generating a pixel in an area without a pixel.
  • a method is used in which pixels at the boundary between the reading area and the reference image are copied vertically and horizontally to generate pixels outside the boundary.
  • off-screen padding generating a pixel outside the boundary of the reference image
  • BIO generating a pixel outside the boundary of the reading area (MC reading area) necessary for motion compensation processing
  • N in FIG. 19 indicates the width and height of a corresponding block that is a block at the same position as the encoding target block in the reference image.
  • T is the number of filter taps of the motion compensation filter, and is the number of pixels on which the motion compensation filter is applied to the reference image.
  • the pixel area of (N + T-1) * (N + T-1) indicates an MC reading area necessary for motion compensation.
  • outside of the reference image means the outside of the reference image. Specifically, the region outside the reference image width pic_width and height pic_hight shown in FIG. 20 vertical line areas). Further, the case where the above-described reference block is outside the screen of the reference image can also be expressed as a case where at least a part of the reference block indicated by the motion vector protrudes beyond the boundary of the reference image, as shown in FIG. it can.
  • the width and height of the corresponding block are both N will be described, but the width and height may be different values.
  • the motion compensation unit 3091 is the MC reading area in FIG. N + T-1) * (N + T-1) pixels are read.
  • the motion compensation unit 3091 when generating a gradient image using the BIO mode, the motion compensation unit 3091 obtains an MC reading area (N + T ⁇ 1) * (N +) in order to obtain a weight coefficient (gradient correction coefficient) of the corresponding block. Read pixel of T-1).
  • the diagonal lines in FIG. Partial area pixels are required. For this reason, as shown in FIG.
  • the motion compensation unit 3091 generates padding pixels using the pixels at the boundary of the MC reading area in the portion that protrudes outside the MC reading area, which is the area indicated by the hatched portion of the reference block (BIO Execute padding) to generate a gradient image.
  • the motion compensation unit 3091 performs the BIO padding on the region of the reference block that protrudes outside the reading region. I do.
  • the motion compensation unit 3091 prohibits the BIO mode when a part of the reference block is outside the screen of the reference image. That is, when a part of the reference block is outside the screen of the reference image, the BIO mode is not performed, and thus the motion compensation unit 3091 does not need to perform both the off-screen padding and the BIO padding.
  • FIG. 21 is a flowchart illustrating an example of a flow of processing for determining whether or not the motion compensation unit 3091 executes (permits) generation of a predicted image using the BIO mode.
  • the motion compensation unit 3091 determines whether at least a part of the reference block is outside the screen of the reference image. When the motion compensation unit 3091 determines that at least a part of the reference block is outside the screen (YES in STEP 121), the motion compensation unit 3091 prohibits generation of a predicted image using the BIO mode (STEP 123). In this case, in the processing following FIG. 21, the motion compensation unit 3091 reads the pixels in the MC reading area (N + T-1) * (N + T-1) as shown in FIG. Alternatively, a prediction image is generated in the bi-prediction mode, and the process ends.
  • the motion compensation unit 3091 permits the BIO mode.
  • the motion compensation unit 3091 stores the MC reading area (N + T ⁇ 1) * (N + T ⁇ 1) as shown in FIG. Pixels are read and a motion compensated image is generated (S111a in FIG. 18).
  • the motion compensation unit 3091 reads pixels in the padding area (shaded area) outside the MC reading area, executes S111b to S113b in FIG. 18, generates a predicted image in the BIO mode, and ends the process.
  • the motion compensation unit 3091 determines whether at least a part of the reference block is outside the screen by determining the following (1) to (4). Also good. (1) Whether the upper left and lower left x coordinates of the reference block are less than the x coordinate of the pixel at the left boundary of the reference image. (2) The upper right and lower right x coordinates of the reference block are the right boundary of the reference image.
  • the motion compensation unit 3091 prohibits the BIO mode if at least a part of the reference block indicated by the motion vector protrudes from the boundary of the reference image, but in the present embodiment, the motion compensation unit 3091 is limited to this. Not.
  • FIG. 22 is a flowchart illustrating another example of a flow of processing for determining whether or not the motion compensation unit 3091 executes (permits) prediction image generation using the BIO mode.
  • the motion compensation unit 3091 determines whether or not at least a part of the reference block is outside a certain range from the boundary of the reference image.
  • the motion compensation unit 3091 when a part of the reference block indicated by the motion vector protrudes from the boundary of the reference image, the motion compensation unit 3091 has a length outW that the reference block protrudes from the reference image in the horizontal direction, The length outH protruding in the vertical direction is measured. Subsequently, the motion compensation unit 3091 compares the length outW that protrudes in the horizontal direction with padW that indicates the length in the horizontal direction within a predetermined range. In addition, the motion compensation unit 3091 compares the length outH protruding in the vertical direction with padH indicating the length in a predetermined range in the vertical direction.
  • the motion compensation unit 3091 is: It is determined that at least a part of the reference block is outside a certain range from the boundary of the reference image.
  • the motion compensation unit 3091 determines the following (1) to (4), so that at least a part of the reference block is outside a certain range from the boundary of the reference image. It may be determined whether or not there is. (1) Whether the upper left and lower left x coordinates of the reference block are less than the x coordinate of a pixel outside a certain range from the boundary of the reference image (2) the upper right and lower right x coordinates of the reference block are Whether or not the x coordinate of the pixel outside the certain range from the boundary of the reference image is larger than (3) the y coordinate of the upper left coordinate and the upper right coordinate of the reference block is y of the pixel outside the certain range from the boundary of the reference image Whether or not it is less than the coordinates (4) Whether or not the y coordinate of the lower left coordinate and the lower right coordinate of the reference block is larger than the y coordinate of a pixel outside a certain range from the boundary of the reference image At least a part of the reference block When the motion compensation unit
  • the motion compensation unit 3091 does not execute the BIO mode (STEP 133). In this case, the motion compensation unit 3091 generates a prediction image in the uni-prediction mode or the bi-prediction mode, as in the first specific example, and ends the process.
  • the motion compensation unit 3091 generates a predicted image using the BIO mode in the same manner as in the first specific example, and ends the process.
  • the motion compensation unit 3091 may prohibit the BIO mode when at least a part of the reference block is outside a certain range from the boundary of the reference image. That is, the motion compensation unit 3091 may not execute the BIO mode.
  • the motion compensation unit 3091 when at least a part of the reference block protrudes from the boundary of the reference image but does not protrude outside the fixed range, the motion compensation unit 3091 generates a highly accurate predicted image using the BIO mode. can do. Further, when at least a part of the reference block is outside a certain range from the boundary of the reference image, the motion compensation unit 3091 prohibits the BIO mode. For this reason, if the motion compensation unit 3091 generates a padding area in advance for an out-of-screen area that is outside a certain range from the boundary of the reference image, the motion compensation unit 3091 reduces the padding to one type (when the BIO mode is on, Only). In other words, the motion compensation unit 3091 derives an enlarged reference image in which off-screen padding is performed in advance, so that the BIO is prohibited in advance when it is outside a certain range from the boundary of the reference image. Therefore, BIO processing can be simplified.
  • the motion compensation unit 3091 can refer to an off-screen region that is outside a certain range from the boundary of the reference image. In this case, only one padding ( When the BIO mode is off, only off-screen padding can be limited.
  • the motion compensation unit 3091 determines that the reference block is a reference image when at least one of the following expressions A20-1 to A20-4 is satisfied. It is determined that it falls outside the screen.
  • the following equation A20-1 is an equation used when determining whether or not the left end of the reference block indicated by the motion vector is outside the screen of the reference image.
  • Expression A20-2 is an expression used when determining whether the right end of the reference block is outside the screen of the reference image.
  • Expression A20-3 is an expression used when determining whether or not the upper end of the reference block is outside the screen of the reference image.
  • Expression A20-4 is an expression used when determining whether or not the lower end of the reference block is outside the screen of the reference image.
  • xInt-NTAPS / 2 + 1 ⁇ 0 (Formula A20-1) xInt + BLKW + NTAPS / 2-1> pic_width-1 (Formula A20-2) yInt-NTAPS / 2 + 1 ⁇ 0 (Formula A20-3) yInt + BLKH + NTAPS / 2-1> pic_height-1 (Formula A20-4)
  • xInt and yInt in the equations A20-1 to A20-4 are the upper left block coordinates (xPb, yPb) when the motion vector accuracy is 1 / M pel accuracy, as shown in the above equation A8.
  • NTAPS in Expressions A20-1 to A20-4 indicates the number of filter taps of the motion compensation filter.
  • BLKW and BLKH in the expressions A20-1 to A20-4 indicate the horizontal width and height of the corresponding block, respectively.
  • pic_width and pic_height in the expressions A20-1 to A20-4 indicate the horizontal width and height of the reference image, respectively.
  • NTAPS corresponds to T
  • BLKW and BLKH each correspond to N.
  • the motion compensation unit 3091 may determine whether the reference block is outside a certain range from the boundary of the reference image, instead of determining whether the reference block is outside the screen of the reference image.
  • the motion compensation unit 3091 in the determination that “at least a part of the reference block is out of a certain range from the screen boundary”, the motion compensation unit 3091 satisfies at least one of the following formulas A21-1 to 21-4: In this case, it may be determined that at least a part of the reference block is outside a certain range from the boundary of the reference image.
  • the following expression A21-1 is an expression used when determining whether or not the left end of the reference block indicated by the motion vector is outside a certain range from the boundary of the reference image.
  • Expression A21-2 is an expression used when determining whether or not the right end of the reference block is outside a certain range from the boundary of the reference image.
  • Expression A21-3 is an expression used when determining whether or not the upper end of the reference block is outside a certain range from the boundary of the reference image.
  • Expression A21-4 is an expression used when determining whether or not the lower end of the reference block is outside a certain range from the boundary of the reference image.
  • padW and padH in formulas A21-1 to A21-4 mean padW indicating a predetermined range in the horizontal direction and padH indicating a predetermined range in the vertical direction, respectively. .
  • FIG. 4 is a block diagram illustrating a configuration of the image encoding device 11 according to the first embodiment.
  • the image encoding device 11 includes a predicted image generation unit 101, a subtraction unit 102, a transform / quantization unit 103, an entropy encoding unit 104, an inverse quantization / inverse transform unit 105, an addition unit 106, a loop filter 107, and a prediction parameter memory. 108, a reference picture memory 109, an encoding parameter determination unit 110, and a prediction parameter encoding unit 111.
  • the prediction parameter encoding unit 111 includes an inter prediction parameter encoding unit 112 and an intra prediction parameter encoding unit 113.
  • the predicted image generation unit 101 generates, for each picture of the image T, a predicted image P of the prediction unit PU for each coding unit CU that is an area obtained by dividing the picture.
  • the predicted image generation unit 101 reads a decoded block from the reference picture memory 109 based on the prediction parameter input from the prediction parameter encoding unit 111.
  • the prediction parameter input from the prediction parameter encoding unit 111 is, for example, a motion vector in the case of inter prediction.
  • the predicted image generation unit 101 reads a block at a position on the reference image indicated by the motion vector with the target PU as a starting point.
  • the prediction parameter is, for example, an intra prediction mode.
  • a pixel value of an adjacent PU used in the intra prediction mode is read from the reference picture memory 109, and a predicted image P of the PU is generated.
  • the predicted image generation unit 101 generates a predicted image P of the PU using one prediction method among a plurality of prediction methods for the read reference picture block.
  • the predicted image generation unit 101 outputs the generated predicted image P of the PU to the subtraction unit 102.
  • FIG. 6 is a block diagram illustrating a configuration of the inter predicted image generation unit 1011 included in the predicted image generation unit 101.
  • the inter prediction image generation unit 1011 includes a motion compensation unit 10111 and a weight prediction unit 10112. Since the motion compensation unit 10111 and the weight prediction unit 10112 have the same configurations as the motion compensation unit 3091 and the weight prediction unit 3094 described above, description thereof is omitted here.
  • the prediction image generation unit 101 generates a prediction image P of the PU based on the pixel value of the reference block read from the reference picture memory, using the parameter input from the prediction parameter encoding unit.
  • the predicted image generated by the predicted image generation unit 101 is output to the subtraction unit 102 and the addition unit 106.
  • the subtraction unit 102 subtracts the signal value of the predicted image P of the PU input from the predicted image generation unit 101 from the pixel value of the corresponding PU of the image T, and generates a residual signal.
  • the subtraction unit 102 outputs the generated residual signal to the transform / quantization unit 103.
  • the transform / quantization unit 103 performs frequency transform on the residual signal input from the subtraction unit 102 and calculates a transform coefficient.
  • the transform / quantization unit 103 quantizes the calculated transform coefficient to obtain a quantized coefficient.
  • the transform / quantization unit 103 outputs the obtained quantization coefficient to the entropy coding unit 104 and the inverse quantization / inverse transform unit 105.
  • the entropy encoding unit 104 receives the quantization coefficient from the transform / quantization unit 103 and receives the encoding parameter from the prediction parameter encoding unit 111.
  • Examples of input encoding parameters include codes such as a reference picture index refIdxLX, a prediction vector index mvp_LX_idx, a difference vector mvdLX, a prediction mode predMode, and a merge index merge_idx.
  • the entropy encoding unit 104 generates an encoded stream Te by entropy encoding the input quantization coefficient and encoding parameter, and outputs the generated encoded stream Te to the outside.
  • the inverse quantization / inverse transform unit 105 inversely quantizes the quantization coefficient input from the transform / quantization unit 103 to obtain a transform coefficient.
  • the inverse quantization / inverse transform unit 105 performs inverse frequency transform on the obtained transform coefficient to calculate a residual signal.
  • the inverse quantization / inverse transform unit 105 outputs the calculated residual signal to the addition unit 106.
  • the addition unit 106 adds the signal value of the prediction image P of the PU input from the prediction image generation unit 101 and the signal value of the residual signal input from the inverse quantization / inverse conversion unit 105 for each pixel, and performs decoding. Generate an image.
  • the adding unit 106 stores the generated decoded image in the reference picture memory 109.
  • the loop filter 107 performs a deblocking filter, a sample adaptive offset (SAO), and an adaptive loop filter (ALF) on the decoded image generated by the adding unit 106.
  • SAO sample adaptive offset
  • ALF adaptive loop filter
  • the prediction parameter memory 108 stores the prediction parameter generated by the encoding parameter determination unit 110 at a predetermined position for each encoding target picture and CU.
  • the reference picture memory 109 stores the decoded image generated by the loop filter 107 at a predetermined position for each picture and CU to be encoded.
  • the encoding parameter determination unit 110 selects one set from among a plurality of sets of encoding parameters.
  • the encoding parameter is a parameter to be encoded that is generated in association with the above-described prediction parameter and the prediction parameter.
  • the predicted image generation unit 101 generates a predicted image P of the PU using each of these encoding parameter sets.
  • the encoding parameter determination unit 110 calculates a cost value indicating the amount of information and the encoding error for each of a plurality of sets.
  • the cost value is, for example, the sum of a code amount and a square error multiplied by a coefficient ⁇ .
  • the code amount is the information amount of the encoded stream Te obtained by entropy encoding the quantization error and the encoding parameter.
  • the square error is the sum between pixels regarding the square value of the residual value of the residual signal calculated by the subtracting unit 102.
  • the coefficient ⁇ is a real number larger than a preset zero.
  • the encoding parameter determination unit 110 selects a set of encoding parameters that minimizes the calculated cost value.
  • the entropy encoding unit 104 outputs the selected set of encoding parameters to the outside as the encoded stream Te, and does not output the set of unselected encoding parameters.
  • the encoding parameter determination unit 110 stores the determined encoding parameter in the prediction parameter memory 108.
  • the prediction parameter encoding unit 111 derives a format for encoding from the parameters input from the encoding parameter determination unit 110 and outputs the format to the entropy encoding unit 104. Deriving the format for encoding is, for example, deriving a difference vector from a motion vector and a prediction vector. Also, the prediction parameter encoding unit 111 derives parameters necessary for generating a prediction image from the parameters input from the encoding parameter determination unit 110 and outputs the parameters to the prediction image generation unit 101.
  • the parameter necessary for generating the predicted image is, for example, a motion vector in units of sub-blocks.
  • the inter prediction parameter encoding unit 112 derives an inter prediction parameter such as a difference vector based on the prediction parameter input from the encoding parameter determination unit 110.
  • the inter prediction parameter encoding unit 112 derives parameters necessary for generating a prediction image to be output to the prediction image generating unit 101, and an inter prediction parameter decoding unit 303 (see FIG. 5 and the like) derives inter prediction parameters.
  • Some of the configurations are the same as the configuration to be performed. The configuration of the inter prediction parameter encoding unit 112 will be described later.
  • the intra prediction parameter encoding unit 113 derives a format (for example, MPM_idx, rem_intra_luma_pred_mode) for encoding from the intra prediction mode IntraPredMode input from the encoding parameter determination unit 110.
  • a format for example, MPM_idx, rem_intra_luma_pred_mode
  • the inter prediction parameter encoding unit 112 is a unit corresponding to the inter prediction parameter decoding unit 303 in FIG. 11, and the configuration is shown in FIG. 9.
  • the inter prediction parameter encoding unit 112 includes an inter prediction parameter encoding control unit 1121, an AMVP prediction parameter derivation unit 1122, a subtraction unit 1123, a sub-block prediction parameter derivation unit 1125, and a partition mode derivation unit and a merge flag derivation unit (not shown). , An inter prediction identifier deriving unit, a reference picture index deriving unit, a vector difference deriving unit, and the like.
  • the partition mode deriving unit, the merge flag deriving unit, the inter prediction identifier deriving unit, the reference picture index deriving unit, and the vector difference deriving unit are respectively a PU partition mode part_mode, a merge flag merge_flag, an inter prediction identifier inter_pred_idc, a reference picture index refIdxLX, and a difference vector Derives mvdLX.
  • the inter prediction parameter encoding unit 112 outputs the motion vector (mvLX, subMvLX), the reference picture index refIdxLX, the PU partition mode part_mode, the inter prediction identifier inter_pred_idc, or information indicating these to the predicted image generation unit 101.
  • inter prediction parameter encoding unit 112 entropy PU partition mode part_mode, merge flag merge_flag, merge index merge_idx, inter prediction identifier inter_pred_idc, reference picture index refIdxLX, prediction vector index mvp_LX_idx, difference vector mvdLX and sub-block prediction mode flag subPbMotionFlag.
  • the data is output to the encoding unit 104.
  • the inter prediction parameter encoding control unit 1121 includes a merge index deriving unit 11211 and a vector candidate index deriving unit 11212.
  • the merge index derivation unit 11211 compares the motion vector and reference picture index input from the encoding parameter determination unit 110 with the motion vector and reference picture index of the merge candidate PU read from the prediction parameter memory 108, and performs merge An index merge_idx is derived and output to the entropy encoding unit 104.
  • the merge candidate is a reference PU (for example, a reference PU in contact with the lower left end, upper left end, and upper right end of the encoding target block) within a predetermined range from the encoding target CU to be encoded.
  • the PU has been processed.
  • the vector candidate index deriving unit 11212 derives a prediction vector index mvp_LX_idx.
  • the sub-block prediction parameter derivation unit 1125 When the encoding parameter determination unit 110 determines to use the sub-block prediction mode, the sub-block prediction parameter derivation unit 1125 performs spatial sub-block prediction, temporal sub-block prediction, affine prediction, and matching motion derivation according to the value of subPbMotionFlag.
  • a motion vector and a reference picture index for any sub-block prediction are derived. As described in the description of the image decoding apparatus, the motion vector and the reference picture index are derived by reading out the motion vector such as the adjacent PU and the reference picture block and the reference picture index from the prediction parameter memory 108.
  • the AMVP prediction parameter derivation unit 1122 has the same configuration as the AMVP prediction parameter derivation unit 3032 (see FIG. 11).
  • the motion vector mvLX is input from the encoding parameter determination unit 110 to the AMVP prediction parameter derivation unit 1122.
  • the AMVP prediction parameter derivation unit 1122 derives a prediction vector mvpLX based on the input motion vector mvLX.
  • the AMVP prediction parameter derivation unit 1122 outputs the derived prediction vector mvpLX to the subtraction unit 1123. Note that the reference picture index refIdx and the prediction vector index mvp_LX_idx are output to the entropy encoding unit 104.
  • the subtraction unit 1123 subtracts the prediction vector mvpLX input from the AMVP prediction parameter derivation unit 1122 from the motion vector mvLX input from the coding parameter determination unit 110 to generate a difference vector mvdLX.
  • the difference vector mvdLX is output to the entropy encoding unit 104.
  • the function of the inter prediction image generation unit in the prediction image generation unit of the image decoding device is not limited to the function of the inter prediction image generation unit 309 in the prediction image generation unit 308 of the image decoding device 31 of the image transmission system 1 according to the first embodiment.
  • the inter-predicted image generation unit functions as an inter-predicted image generation unit 309a in the predicted image generation unit 308a of the image decoding device 31a of the image transmission system 1a (not shown) instead of or in addition to the predicted image generation unit 308. You may have the function of.
  • Embodiment 2 will be described with reference to FIGS.
  • members having the same functions as those described in the first embodiment are denoted by the same reference numerals and description thereof is omitted.
  • the image transmission system 1a includes an image encoding device 11a (not shown) and an image decoding device 31a instead of the image encoding device 11 and the image decoding device 31 in the first embodiment.
  • FIG. 23 is a block diagram showing a main configuration of the image decoding device 31a according to the present embodiment. As illustrated in FIG. 23, the image decoding device 31a according to the present embodiment includes a predicted image generation unit 308a instead of the predicted image generation unit 308 in the first embodiment.
  • the predicted image generation unit 308a includes an inter predicted image generation unit 309a instead of the inter predicted image generation unit 309 in the first embodiment. Except for this point, the predicted image generation unit 308a has the same configuration as the predicted image generation unit 308 in the first embodiment.
  • FIG. 24 is a block diagram illustrating a configuration of an inter predicted image generation unit 309a included in the predicted image generation unit 308a according to the second embodiment.
  • the inter prediction image generation unit 309a includes a motion compensation unit 3091a instead of the motion compensation unit 3091 in the first embodiment.
  • the motion compensation unit 3091a generates a pixel value outside the reading region, which is a pixel value outside the MC reading region regarding the corresponding block in at least one of the first reference image and the second reference image.
  • the motion compensation unit 3091a prohibits the generation process of the pixel value outside the MC reading area along the vertical direction or the horizontal direction. That is, the motion compensation unit 3091a prohibits BIO padding in the vertical direction or the horizontal direction when generating a predicted image using the BIO mode.
  • FIG. 25 and 26 are diagrams illustrating regions in which the motion compensation unit 3091a executes BIO padding.
  • FIG. 27 is a diagram illustrating motion vectors in adjacent blocks.
  • the motion compensation unit 3091a when the motion compensation unit 3091a prohibits the generation process of the pixel value outside the MC reading area along the horizontal direction, the motion compensation unit 3091a performs BIO padding only in the vertical direction in the padding region indicated by the diagonal lines in FIG. .
  • BIO padding in the horizontal direction is not performed, when blocks adjacent in the horizontal direction have the same motion vector ((a) in FIG. 27), these blocks are merged to form one corresponding block. Can be considered. Therefore, when the horizontally adjacent blocks have the same motion vector, the motion compensation unit 3091a merges these blocks, regards them as one corresponding block, and refers to the reference block of the corresponding block to obtain a predicted image. It may be generated.
  • the motion compensation unit 3091a when configured to prohibit horizontal BIO padding, is a corresponding block and a block adjacent to the corresponding block in the horizontal direction and having the same motion vector as the corresponding block. And may be processed by merging. Thereby, the entire processing amount can be reduced.
  • the memory bandwidth can be reduced as compared with the case where the motion compensation unit 3091a performs BIO padding separately for each block boundary. That is, the memory bandwidth can be reduced as compared with the case where the motion compensation unit 3091a performs BIO padding on two blocks separately.
  • the motion compensation unit 3091a may prohibit the BIO padding in the vertical direction instead of the configuration for prohibiting the BIO padding in the horizontal direction. In this case, the motion compensation unit 3091a performs BIO padding in the padding area indicated by hatching in FIG.
  • BIO padding in the vertical direction is not performed, when adjacent blocks in the vertical direction have the same motion vector ((b) in FIG. 27), these blocks are merged and regarded as one corresponding block. be able to. Therefore, when the adjacent blocks in the vertical direction have the same motion vector, the motion compensation unit 3091a merges these blocks, regards them as one corresponding block, and refers to the reference block of the corresponding block to obtain a predicted image. It may be generated.
  • the motion compensation unit 3091a when configured to prohibit vertical BIO padding, includes a corresponding block and a neighboring block that is adjacent to the corresponding block in the vertical direction and has the same motion vector as the corresponding block. Merge and process. Thereby, the entire processing amount can be reduced.
  • the motion compensation unit 3091a may include a selection unit 4000 (not shown) that selects whether the direction in which BIO padding is prohibited is the horizontal direction or the vertical direction.
  • the selection unit 4000 sets the direction for prohibiting the BIO padding to the horizontal direction depending on whether the block having the same motion vector is adjacent to the horizontal direction or the vertical direction. Alternatively, it may be selected whether or not the vertical direction is used.
  • FIG. 28 is a flowchart illustrating an example of a processing flow for determining whether to prohibit BIO padding in the horizontal direction when the motion compensation unit 3091a generates a predicted image using the BIO mode.
  • the motion compensation unit 3091a is allowed to execute (permit) both horizontal and vertical BIO padding.
  • the motion compensation unit 3091a determines whether or not the motion vector of the corresponding block is the same as the motion vector of the block adjacent to the corresponding block in the horizontal direction.
  • the process proceeds to STEP 213.
  • the motion compensation unit 3091a determines that the motion vector of the corresponding block is not the same as the motion vector of a block adjacent to the corresponding block in the horizontal direction (No in STEP 212)
  • the motion compensation unit 3091a BIO padding is performed in both directions, and the process ends.
  • the motion compensation unit 3091a prohibits BIO padding in the horizontal direction, executes only BIO padding in the vertical direction, and ends the process.
  • FIG. 29 is a flowchart illustrating an example of a process flow for determining whether to prohibit BIO padding in the vertical direction when the motion compensation unit 3091a generates a predicted image using the BIO mode. Since STEP 221 in FIG. 29 is the same as STEP 211 in FIG. 28, description thereof is omitted.
  • the motion compensation unit 3091a determines whether or not the motion vector of the corresponding block is the same as the motion vector of the block adjacent to the corresponding block in the vertical direction.
  • the process proceeds to STEP 223.
  • the motion compensation unit 3091a determines that the motion vector of the corresponding block and the motion vector of the block adjacent to the corresponding block in the vertical direction are not the same (NO in STEP 222)
  • the motion compensation unit 3091a BIO padding is performed in both directions, and the process ends.
  • the motion compensation unit 3091a prohibits the BIO padding in the vertical direction, executes only the BIO padding in the horizontal direction, and ends the process.
  • the motion compensation unit 3091a determines whether the motion vector of the corresponding block is the same as the motion vector of the block adjacent to the corresponding block in one of the horizontal and vertical directions. Judging. However, in the present embodiment, the present invention is not limited to this, and the motion compensation unit 3091a determines whether or not the motion vectors of blocks adjacent in the horizontal direction are the same, and the motion vector of blocks adjacent in the vertical direction. It may be determined whether or not the same.
  • FIG. 30 is a flowchart illustrating an example of a processing flow for determining whether to prohibit BIO padding in the horizontal direction or the vertical direction when the motion compensation unit 3091a generates a predicted image using the BIO mode.
  • STEP 30 are the same as STEP 211 and STEP 213 in FIG. 28, and thus description thereof is omitted.
  • STEP 234 and STEP 235 in FIG. 30 are the same as STEP 222 and STEP 223 in FIG.
  • the motion compensation unit 3091a determines whether or not the motion vector of the corresponding block is the same as the motion vector of the block adjacent to the corresponding block in the horizontal direction.
  • the motion compensation unit 3091a determines whether or not the motion vectors of the blocks adjacent to the corresponding block are the same in the order of the horizontal direction and the vertical direction, and the BIO padding in the horizontal direction and the vertical direction. It may be determined whether or not to prohibit.
  • the motion compensation unit 3091a prohibits BIO padding.
  • the motion compensation unit 3091a may regard blocks adjacent in the horizontal direction or the vertical direction as one corresponding block and merge them to generate a predicted image of the corresponding block.
  • the motion compensation unit 3091a determines whether or not the motion vectors of the blocks adjacent to the corresponding block are the same in the order of the horizontal direction and the vertical direction. Not. The motion compensation unit 3091a may determine whether or not the motion vectors of the blocks adjacent to the corresponding block are the same in the order of the vertical direction and the horizontal direction.
  • the motion compensation unit 3091a may prohibit the BIO padding in the horizontal direction or the vertical direction described above when referring to the reference block of the corresponding block illustrated in FIG.
  • FIG. 31 is a schematic diagram of a corresponding block used when the motion compensation unit 3091a uses the BIO mode and a block adjacent to the corresponding block in the horizontal direction or the vertical direction.
  • the motion compensation unit 3091a may prohibit horizontal BIO padding when using the BIO mode for a vertically corresponding block. In this case, if the vertically corresponding block and the block adjacent in the horizontal direction of the vertically corresponding block have the same motion vector, the motion compensation unit 3091a merges these blocks and regards it as one corresponding block. A predicted image may be generated from the reference block of the corresponding block. Thus, even when the BIO mode is used for the vertical corresponding block and the block horizontally adjacent to the vertical corresponding block, the motion compensation unit 3091a reduces the overall processing amount in the same manner as in the above example. Can be reduced. In addition, the memory bandwidth can be reduced.
  • the motion compensation unit 3091a uses 4x8 pixels as the minimum unit block size, and when these blocks are merged and the BIO mode is used, processing is performed for each 8x8 pixel unit, and the overall processing amount is large. You do n’t have to. As a result, the memory bandwidth can be suppressed from becoming larger.
  • the motion compensation unit 3091a may prohibit BIO padding in the vertical direction when the BIO mode is used for a horizontally long corresponding block. In this case, the motion compensation unit 3091a merges the horizontally long corresponding block and the block adjacent to the horizontally long corresponding block in the vertical direction into the same motion vector and regards it as one corresponding block.
  • the predicted image may be generated with reference to the reference block of the corresponding block.
  • the motion compensation unit 3091a uses 8x4 pixels as the minimum unit block size, and when these blocks are merged and the BIO mode is used, processing is performed for each 8x8 pixel unit, and the overall processing amount is large. It ’s not necessary. As a result, the memory bandwidth can be suppressed from becoming larger.
  • the motion compensation unit 3091a may refer to a syntax indicating a block division method when determining whether to prohibit horizontal padding or vertical padding.
  • the motion compensation unit 3091a refers to the syntax indicating the block division method, and prohibits horizontal padding when it finally becomes a block of 4x8 pixels, and prohibits vertical padding when it becomes a block of 8x4 pixels. It may be a configuration.
  • the image encoding device 11a includes a predicted image generation unit 101a (not shown) instead of the predicted image generation unit 101 in the first embodiment. Moreover, the predicted image generation unit 101a includes an inter predicted image generation unit 1011a (not shown) instead of the inter predicted image generation unit 1011 in the first embodiment.
  • the inter predicted image generation unit 1011a includes a motion compensation unit 10111a instead of the motion compensation unit 10111 in the first embodiment. Except for this point, the inter prediction image generation unit 1011a has the same configuration as the inter prediction image generation unit 1011 in the first embodiment.
  • motion compensation unit 10111a has the same configuration as the motion compensation unit 3091a described above, description thereof is omitted here.
  • the function of the prediction parameter decoding unit of the image decoding device is not limited to the function of the inter prediction parameter decoding unit 303 in the prediction parameter decoding unit 302 of the image decoding device 31 of the image transmission system 1 according to the first embodiment.
  • the function of the inter prediction parameter decoding unit is the function of the inter prediction parameter decoding unit 303b of the image transmission system 1b (not shown) image decoding device 31b (not shown) instead of or in addition to the inter prediction parameter decoding unit 303. May be provided.
  • Embodiment 3 will be described with reference to FIGS.
  • members having the same functions as those described in the first embodiment are denoted by the same reference numerals and description thereof is omitted.
  • the image transmission system 1b includes an image decoding device 31b (not shown) and an image encoding device 11b (not shown) instead of the image decoding device 31 and the image encoding device 11 in the first embodiment.
  • the image decoding device 31b according to the present embodiment includes a prediction parameter decoding unit 302b (not shown) instead of the prediction parameter decoding unit 302 in the first embodiment.
  • the prediction parameter decoding unit 302 includes an inter prediction parameter decoding unit 303b instead of the inter prediction parameter decoding unit 303 in the first embodiment. Except for this point, the image decoding device 31b has the same configuration as the image decoding device 31 according to the first embodiment.
  • the image encoding device 11b will be described later.
  • FIG. 34 is a block diagram illustrating a configuration of an inter prediction parameter decoding unit 303b included in the prediction parameter decoding unit 302b.
  • the inter prediction parameter decoding unit 302b includes a sub-block prediction parameter deriving unit 3037b instead of the sub-block prediction parameter deriving unit 3037 in the first embodiment. Except for this point, the inter prediction parameter decoding unit 302b has the same configuration as the inter prediction parameter decoding unit 302 in the first embodiment. As shown in FIG.
  • the sub-block prediction parameter derivation unit 3037b performs at least one of the spatio-temporal sub-block prediction unit 30371, the affine prediction unit 30372, and the matching motion derivation unit 30373 that performs sub-block prediction in the sub-block prediction mode.
  • Subblock prediction mode flag a method of deriving a sub-block prediction mode flag subPbMotionFlag indicating whether or not a prediction mode of a certain PU is a sub-block prediction mode in the image decoding device 31b and the image encoding device 11 will be described.
  • the image decoding device 31b and the image encoding device 11 set the sub-block prediction mode flag subPbMotionFlag based on which of spatial sub-block prediction SSUB, temporal sub-block prediction TSUB, affine prediction AFFINE, and matching motion derivation MAT described later is used.
  • the sub-block prediction mode flag subPbMotionFlag may be derived by the following equation.
  • the image decoding device 31b and the image encoding device 11 may be configured to perform some predictions among the spatial sub-block prediction SSUB, temporal sub-block prediction TSUB, affine prediction AFFINE, and matching motion derivation MAT. That is, when the image decoding device 31b and the image encoding device 11 are configured to perform spatial subblock prediction SSUB or affine prediction AFFINE, the subblock prediction mode flag subPbMotionFlag may be derived as follows.
  • the spatio-temporal sub-block prediction unit 30371 calculates the target PU from the motion vector of the PU on the reference image temporally adjacent to the target PU (for example, the immediately preceding picture) or the motion vector of the PU spatially adjacent to the target PU.
  • the motion vector of the sub-block obtained by dividing is derived.
  • (xPb, yPb) is the upper left coordinate of the target PU
  • nPbW, nPbH are the size of the target PU
  • nSbW, nSbH are the sizes of the sub-blocks.
  • the above-described temporal sub-block prediction candidate TSUB and spatial sub-block prediction candidate SSUB are selected as one mode (merge candidate) of the merge mode.
  • the affine prediction unit 30372 derives the affine prediction parameters of the target PU.
  • motion vectors of two or three control points of the target PU are derived as affine prediction parameters.
  • motion vectors mv0_x, mv0_y), (mv1_x, mv1_y), and (mv2_x, mv2_y) are derived.
  • the motion vector of each control point may be derived by predicting from the motion vector of the adjacent PU of the target PU.
  • the motion vector of each control point may be derived from the sum of the control point prediction vector mvpLX and the difference vector mvdLX derived from the encoded data.
  • FIG. 35 shows an example in which the motion vector spMvLX of each sub-block constituting the target PU (nPbW ⁇ nPbH) is derived from the motion vector (mv0_x, mv0_y) of the control point V0 and the motion vector (mv1_x, mv1_y) of V1.
  • the motion vector spMvLX of each subblock is derived as a motion vector for each point located at the center of each subblock, as shown in FIG.
  • xPb and yPb are the upper left coordinates of the target PU
  • nPbW and nPbH are the width and height of the target PU
  • nSbW and nSbH are the width and height of the sub-block.
  • the affine prediction unit 30372 or the AMVP prediction parameter derivation unit 3032 uses representative points (here, V0 and V1) of the target block as two or more control points used for affine prediction for deriving candidates. ) To derive the respective motion vectors. Note that a point on the target block or a point near the target block is used as the representative point of the block. In this specification, a block representative point used as a control point for affine prediction is referred to as a “block control point”.
  • (STEP2) Derivation of sub-block vector
  • the affine prediction unit 30372 or AMVP prediction parameter derivation unit 3032 determines the target block from the motion vector of the block control points (control points V0 and V1) that are representative points of the target block derived in STEP1. Is a step of deriving a motion vector of each sub-block included in. From (STEP 1) and (STEP 2), the motion vector mvLX of each sub-block is derived.
  • the motion compensation unit 3091 receives the reference picture from the reference picture memory 306 based on the prediction list use flag predFlagLX, the reference picture index refIdxLX, and the motion vector mvLX input from the inter prediction parameter decoding unit 303. Performs motion compensation in units of sub-blocks to generate motion compensated image predSamplesLX by reading out and filtering a block at a position shifted by motion vector mvLX from the position of the target block on the reference picture specified by index refIdxLX It is a process.
  • (STEP 4) Storage of motion vectors of sub-blocks
  • the motion vector mvLX of each sub-block derived by the AMVP prediction parameter deriving unit 3032 in (STEP 2) is stored in the prediction parameter memory 307.
  • the motion vector mvLX of each sub-block derived by the affine prediction unit 30372 in (STEP 2) is stored in the prediction parameter memory 307.
  • FIG. 37 is a diagram illustrating an example of the position of a prediction unit (reference block) used for deriving a motion vector of a control point in the AMVP mode and the merge mode.
  • the AMVP prediction parameter derivation unit 3032 decodes the motion vector mvLX of two or more control points (for example, V0 and V1, or V0, V1, and V2). Specifically, the prediction vector mvpLX and the difference vector are added for each control point.
  • the AMVP prediction parameter derivation unit 3032 is adjacent to one of the representative points, and blocks A, B, and C (reference blocks) that share the representative point (vertex) with the target block.
  • the AMVP prediction parameter derivation unit 3032 sets one of the motion vectors of the blocks D and E as the prediction vector mvpLX of the representative point V1.
  • the AMVP prediction parameter derivation unit 3032 derives a prediction vector mvpLX of the representative point V2 from any of the motion vectors of the blocks F and G (reference block). May be.
  • control point in STEP1 is not limited to the above.
  • a vertex at the lower right of the target block or points around the target block as described later may be used.
  • the motion vector (mvi_x, mvi_y) of the sub-block coordinates (xi, yj) has four parameters (mv_x, mv_y, ev, rv), that is, the motion vector of the expansion and rotation center (translation vector mv_x, mv_y) and the expansion parameter Using ev and the rotation parameter rv, the following general formula (eq1) can be obtained.
  • mvi_x mv_x + ev * xi-rv * yj
  • mvi_y mv_y + rv * xi + ev * yj (eq1)
  • (mv_x, mv_y) may be (mv0_x, mv0_y).
  • the affine prediction unit 30372 refers to the prediction parameter memory 307 for a prediction unit including blocks A to E as shown in (c) of FIG. 37, and confirms whether or not affine prediction is used.
  • a prediction unit that is first found using affine prediction (here, referred to as reference block A in FIG. 37C) is selected as an adjacent block (merge reference block), and a motion vector is derived.
  • the affine prediction unit 30372 moves the control point (for example, V0, V1) from the motion vector of the two or three points (point v0, point v1, point v2 in (d) of FIG. 37) of the selected merge reference block. Derive a vector.
  • the horizontal width of the block for which the motion vector is predicted is W
  • the height is H
  • adjacent blocks adjacent blocks including the block A in the example in the figure.
  • the width is w and the height is h.
  • affine parameters ev, rv
  • evBW, rvBW evBW
  • evBH, rvBH ev1, rv1, ev2, rv2
  • ev1BW, rv1BW, ev2BH, rv2BH sub block motion vectors
  • the image encoding device 11 (more specifically, the encoding parameter determination unit 110) or the affine prediction unit 30372 limits the range of the difference between the motion vectors at the plurality of derived control points.
  • the encoding parameter determination unit 110 derives a motion vector so that the difference value (dmv_x, dmv_y) between (mv0_x, mv0_y) and (mv1_x, mv1_y) satisfies (Formula XX1), and the prediction parameter code
  • the encoding unit 111 encodes the difference vector.
  • the encoding parameter determination unit 110 sets the motion vector search range so that the motion vectors of the control point V0 and the control point V1 satisfy Expression XX1 in the motion vector search.
  • THMVX and THMVY are predetermined threshold values.
  • the restricted motion vector at the control point V1 is denoted as (mv1_x ′, mv1_y ′).
  • the AMVP prediction parameter derivation unit 3032 derives a prediction vector of the motion vector selected by the image encoding device 11.
  • a motion vector is derived by the addition unit 3038 adding the derived prediction vector and the difference vector.
  • the affine prediction unit 30372 limits the motion vector of the other control point according to the magnitude of the motion vector of one control point of the control point V0 and the control point V1.
  • the affine prediction unit 30372 restricts the motion vector (mv1_x, mv1_y) of the control point V1 before the restriction to the range from the motion vector (mv0_x, mv0_y) of the control point V0 to (rangeW, rangeH).
  • the motion vector (mv1_x ′, mv1_y ′) of the control point V1 after the restriction is expressed as the following equation.
  • mv1_x ' clip3 (mv0_x-rangeW, mv0_x + rangeW, mv1_x)
  • mv1_y ' clip3 (mv0_y-rangeH, mv0_y + rangeH, mv1_y)
  • the predicted image generation unit 101 can read a region including the reference block group at a time and generate a predicted image. As a result, the memory bandwidth can be reduced.
  • the affine prediction unit 30372 or the AMVP prediction parameter derivation unit 3032 calculates an affine parameter, and derives a motion vector of each sub-block using the derived affine parameter.
  • the affine prediction unit 30372 or the AMVP prediction parameter derivation unit 3032 refers to the motion vectors of two or three control points among the control points V0, V1, and V2, which are representative points on the block, derived in (STEP 1). , (STEP 2), first, affine parameters are calculated. That is, the affine prediction unit 30372 or the AMVP prediction parameter derivation unit 3032 performs any one of the following 4-parameter affine and 6-parameter affine.
  • the affine prediction unit 30372 or the AMVP prediction parameter derivation unit 3032 derives affine parameters (ev, rv) from the motion vectors of two control points among the control points V0, V1, and V2.
  • the affine prediction unit 30372 calculates the affine parameters from the two motion vectors of the motion vector (mv0_x, mv0_y) of the control point V0 and the motion vector (mv1_x ′, mv1_y ′) after the restriction of the control point V1.
  • Deriving (ev, rv). 6-parameter affine The affine prediction unit 30372 or AMVP prediction parameter derivation unit 3032 derives affine parameters (ev1, rv1, ev2, rv2) from the three motion vectors of the control points V0, V1, and V2.
  • the affine predictor 30372 determines the magnitude of two of the three motion vectors as the motion vector of a certain control point. Limit according to size. About the method of control, since a clip function is used similarly to the above-mentioned, description is abbreviate
  • the affine prediction unit 30372 includes the motion vector (mv0_x, mv0_y) of the control point V0, the motion vector after restriction of the control point V1 (mv1_x ′, mv1_y ′), and the motion vector after restriction of the control point V2 (mv2_x ′,
  • the affine parameters (ev1, rv1, ev2, rv2) are derived from the three motion vectors mv2_y ′).
  • the conversion process consisting of the translation vector (mv_x, mv_y) and the affine parameters (ev, rv) is referred to as “4-parameter affine”
  • the translation vector (mv_x, mv_y) and the affine parameters (ev1, rv1, ev2, rv2) is referred to as “6-parameter affine”.
  • Affine parameters can be handled as integers instead of decimal numbers.
  • the decimal affine parameters are (ev, rv), (ev1, rv1, ev2, rv2), and the integer affine parameters are (evBW, rvBW), (evBH, rvBH), (ev1BW, rv1BW, ev2BH, rv2BH) It expresses.
  • the integer affine parameter is obtained by multiplying the decimal affine parameter by a constant (constant for integerization) according to the sub-block size (BW, BH). Specifically, the following relationship exists between the affine parameters for decimal numbers and the affine parameters for integers.
  • the affine prediction unit 30372 or the AMVP prediction parameter derivation unit 3032 uses the affine parameters (ev, rv), the motion vector (mv0_x, mv0_y) of the control point V0, and the magnitude of the motion vector of the control point V0 at the control point V1.
  • the affine prediction unit 30372 or the AMVP prediction parameter derivation unit 3032 has a motion vector (mv2_x ′, mv2_x ′,) limited according to the motion vector of the control point V1 and the magnitude of the motion vector of the control point V1 at the control point V2.
  • mv2_y ') to ev ((mv1_x-mv2_x')-(mv1_y-mv2_y ') ⁇ / 2W
  • rv ⁇ (mv1_x-mv2_x ') + (mv1_y-mv2_y') ⁇ / 2W May be derived.
  • the affine prediction unit 30372 has a motion vector (mv3_x ′, mv3_y ′) limited according to the motion vector (mv0_x, mv0_y) of the control point V0 and the magnitude of the motion vector of the control point V0 at the control point V3.
  • ev (mv3_x '-mv0_x + mv3_y'-mv0_y) / 2W
  • rv (-mv3_x '+ mv0_x + mv3_y'-mv0_y) / 2W May be derived.
  • the affine prediction unit 30372 or the AMVP prediction parameter derivation unit 3032 determines the affine parameters according to the motion vector (mv0_x, mv0_y) of the control point V0 and the magnitude of the motion vector of the control point V0 at the control points V1 and V2.
  • the affine parameter when the motion vector of the control point is not limited is derived as an expression obtained by taking “′” from the above expression.
  • the affine prediction unit 30372 or the AMVP prediction parameter derivation unit 3032 uses the affine parameters (evBW, rvBW), (evBH, rvBH), the motion vector (mv0_x, mv0_y) of the control point V0, and the control point V0 at the control point V1.
  • evBW ev * BW
  • rvBW rv * BW
  • evBH ev * BH
  • rvBH rv * BH
  • the affine prediction unit 30372 or the AMVP prediction parameter derivation unit 3032 performs motion limited according to the motion vector (mv0_x, mv0_y) of the control point V0 and the motion vector of the control point V0 at the control point V2.
  • the affine prediction unit 30372 or the AMVP prediction parameter derivation unit 3032 performs the motion limited according to the motion vector (mv1_x, mv1_y) of the control point V1 and the motion vector of the control point V1 at the control point V2.
  • the affine prediction unit 30372 or the AMVP prediction parameter derivation unit 3032 performs motion limited according to the motion vector (mv0_x, mv0_y) of the control point V0 and the motion vector of the control point V0 at the control point V3.
  • the affine prediction unit 30372 or the AMVP prediction parameter derivation unit 3032 determines the affine parameters according to the motion vector (mv0_x, mv0_y) of the control point V0 and the magnitude of the motion vector of the control point V0 at the control points V1 and V2.
  • the above-described integer precision affine parameter derived by the AMVP prediction parameter deriving unit 3032 is derived as an expression obtained by taking “′” from the above expression.
  • the affine prediction unit 30372 or the AMVP prediction parameter derivation unit 3032 derives the motion vector of the sub-block using the affine parameter obtained by the above formula.
  • sub block motion vectors (mvij_x, mvij_y) of subblock coordinates (xi, yj) are calculated from the affine parameters (ev, rv) calculated in the AMVP mode and the merge mode, respectively, as follows: Derived from AF4P_float.
  • mvij_x mv_x + ev * xi-rv * yj
  • mvij_y mv_y + rv * xi + ev * yj
  • the motion vector (mv0_x, mv0_y) of the control point V0 may be used as the affine parameters mv_x, mv_y of the translation vector
  • the present invention is not limited to this.
  • a motion vector other than the control point V0 a motion vector at the control point V1, a motion vector at the control point V2, and a motion vector at the control point V3 may be used as translation vectors.
  • the motion vector (mvij_x, mvij_y) of the subblock at the subblock position (i, j) is derived by the following formula AF4P_integer To do.
  • mvij_x mv_x + of_x + evBW * i-rvBH * j
  • mvij_y mv_y + of_y + rvBW * i + evBH * j
  • (Mv0_x, mv0_y) can also be used as the translation vector (mv_x, mv_y).
  • mvij_x mv_x + ev * xi-rv * yj
  • mvij_x mv_x + ((evBW-rvBW) >> 1) + evBW * i-rvBW * j
  • mvij_y mv_y + ((rvBW + evBW) >> 1) + rvBW * i + evBW * j
  • it may be derived only from (evBH, rvBH).
  • FIG. 38 is a diagram illustrating an example in which the control point V0 of the target block (horizontal width W, height H) is located at the upper left vertex and is divided into sub-blocks having a width BW and a height BH.
  • W, H) and (BW, BH) correspond to the aforementioned (nPbW, nPbH) and (nSbW, nSbH).
  • the points of the subblock position (i, j) and the subblock coordinates (xi, yj) are the intersections of the broken line parallel to the x axis and the broken line parallel to the y axis in FIG.
  • the motion vector (mvij_x, mvij_y) of the subblock at the subblock position (i, j) ) Is derived by the following expression AF6P_integer.
  • mvij_x mv_x + ((ev1BW + rv2BH) >> 1) + ev1BW * i + rv2BH * j
  • mvij_y mv_y + ((rv1BW + ev2BH) >> 1) + rv1BW * i + ev2BH * j (expression AF6P_integer) [Modification Example 1 of Subblock Motion Vector Derivation Processing]
  • the affine prediction unit 30372 or the AMVP prediction parameter derivation unit 3032 limits the range of the motion vector difference between the control points.
  • the present embodiment is not limited to this.
  • the size of the subblock may be limited.
  • the first modification and the second modification the case where the affine prediction unit 30372 executes the process will be described.
  • the AMVP prediction parameter derivation unit 3032 may execute the process.
  • the affine prediction unit 30372 when the difference between the motion vectors at the plurality of control points is larger than a predetermined value, the affine prediction unit 30372 has a sub size larger than that when the difference is equal to or smaller than the predetermined value.
  • a block may be set and a motion vector may be derived.
  • FIG. 39 is a flowchart showing an outline of the sub-block size determination flow.
  • the sub-block size determination process by the affine prediction unit 30372 includes the following three steps (Step S321) to (Step S323).
  • Step S321 Determination of Motion Vector Difference
  • the affine prediction unit 30372 determines whether or not the vector difference between control points is large. For example, when the vector difference between the control point V0 and the control point V1 in FIG. 37 satisfies the following equation (eq3), the affine prediction unit 30372 calculates the vector difference between the control point V0 and the control point V1. You may determine with it being large. Similarly, the affine prediction unit 30372 may determine that the vector difference between the control point V0 and the control point V1 is not large when the following equation (eq3) is not satisfied.
  • M in the above expression represents a predetermined threshold value.
  • the magnitude of the difference may be obtained as the sum of the absolute values of the differences as described above, or may be obtained as the sum of squares of the differences.
  • the vector difference between control points is not limited to the form discriminate
  • the vector difference between the control points may be determined by the vector difference between the control point V0 and the control point V2, as shown in the following equation (eq3 ′), or the following equation (eq3 ′′): As shown, it may be determined by the vector difference between the control point V1 and the control point V2.
  • step S322 If the affine prediction unit 30372 determines that the vector difference between the control points is large (Y in step S321), the process proceeds to step S322. If the affine prediction unit 30372 determines that the vector difference between the control points is not large (N in step S321), the process proceeds to step S323.
  • Step S322 Determination to Large Subblock Size
  • the affine prediction unit 30372 determines the size of the subblock to be the size of a large subblock (large subblock size). For example, the affine prediction unit 30372 may determine the size of the sub-block to be a large sub-block size of 8 ⁇ 8. The large sub-block size only needs to be larger than the small sub-block size (small sub-block size) described later. For example, when the small subblock size is set to 4 ⁇ 4, the affine prediction unit 30372 may determine the size of the large subblock to be 8 ⁇ 4 or 4 ⁇ 8.
  • Step S323 Determination to Small Subblock Size
  • the size of the subblock is determined to be a small subblock size.
  • the affine prediction unit 30372 may determine the size of the subblock to be a 4 ⁇ 4 small subblock size.
  • the small sub-block size only needs to be smaller than the large sub-block size. For example, when the large sub-block size is set to a large size of 8 ⁇ 8, the affine prediction unit 30372 may determine the size of the small sub-block as 8 ⁇ 4 or 4 ⁇ 8.
  • the affine prediction unit 30372 sets the combination of the large sub-block size and the small sub-block size (large sub-block size, small sub-block size), for example, (8 ⁇ 8, 4 ⁇ 4), (8 ⁇ 8, ⁇ 8 ⁇ 4) or (8 ⁇ 4, 4 ⁇ 4), etc.
  • the affine prediction unit 30372 ends the sub-block size determination process.
  • the affine prediction unit 30372 determines that the vector difference between the controls is large when the expression (eq3) is satisfied, but the present embodiment is not limited to this. In the present embodiment, the affine prediction unit 30372 may determine that the vector difference between the control points is large when the following equation (eq4) is satisfied, or when the following equation (eq4 ′) is satisfied: It may be determined that the vector difference between the control points is large.
  • the affine prediction unit 30372 may use equation (eq4) instead of equation (eq3) as an equation for determining whether or not the affine parameter is large.
  • the AMVP prediction parameter derivation unit 3032 may determine the size of the sub-block in the same manner as the affine prediction unit 30372.
  • the affine prediction unit 30372 determines the aspect ratio of the sub-block used for deriving the motion vector according to the aspect ratio of the target block that is the target of motion vector prediction, instead of the above example. Also good. That is, the affine prediction unit 30372 may derive a motion vector of a sub-block having an aspect ratio corresponding to the aspect ratio of the target block.
  • the affine prediction unit 30372 may determine that the aspect ratio of the sub-block is horizontally long when the target block is horizontally long, and may determine the aspect ratio of the sub-block vertically when the target block is vertically long.
  • the aspect ratio of the sub-block is horizontally long.
  • the aspect ratio of the vertically long sub-block is vertically long, so that the sub-block having the optimum aspect ratio can be obtained.
  • the affine prediction unit 30372 may determine the aspect ratio of the sub-block to be horizontal.
  • the cache is more likely to hit when the sub-block is horizontally long than vertically. Therefore, according to the above configuration, the memory bandwidth can be made smaller when the horizontal width and height of the sub-block are set equal when the horizontal width and height of the target block are equal.
  • the affine prediction unit 30372 may determine the aspect ratio of the sub-block to be vertically long.
  • AMVP prediction parameter derivation unit 3032 may also determine the aspect ratio of the sub-block in the same manner as the affine prediction unit 30372.
  • the matching motion deriving unit 30373 derives a motion vector spMvLX of a block or sub-block constituting the PU by performing a matching process of bilateral matching or template matching.
  • FIG. 36 is a diagram for explaining (a) bilateral matching and (b) template matching.
  • the matching motion derivation mode is selected as one merge candidate (matching candidate) in the merge mode.
  • the matching motion deriving unit 30373 derives a motion vector by matching regions in a plurality of reference images, assuming that the object moves at a constant velocity.
  • bilateral matching it is assumed that a certain object passes through a certain region of the reference image A, a target PU of the target picture Cur_Pic, and a certain region of the reference image B with constant velocity motion, and between the reference images A and B.
  • the motion vector of the target PU is derived from the matching.
  • template matching it is assumed that the motion vector of the target PU adjacent region and the target PU are equal, and motion is performed by matching motion compensated images between the target PU adjacent region Temp_Cur (template) and the reference block adjacent region Temp_L0 on the reference picture. Derive a vector.
  • (mv0_x, mv0_y) is determined so that the matching cost between Block_A and Block_B is minimized.
  • the (mv0_x, mv0_y) derived in this way is a motion vector assigned to the sub-block.
  • (b) of FIG. 36 is a figure for demonstrating a template matching (Template
  • one reference picture is referred to at a time in order to derive a motion vector of the sub-block Cur_block in the target picture Cur_Pic.
  • the reference block Block_A having the upper left coordinates (xPos, yPos) specified by is specified.
  • (xCur, yCur) is the upper left coordinate of the sub-block Cur_block.
  • a template region Temp_Cur adjacent to the sub-block Cur_block in the target picture Cur_Pic and a template region Temp_L0 adjacent to the Block_A in the reference picture A are set.
  • the template region Temp_Cur is composed of a region adjacent to the upper side of the sub-block Cur_block and a region adjacent to the left side of the sub-block Cur_block.
  • the template area Temp_L0 is composed of an area adjacent to the upper side of Block_A and an area adjacent to the left side of Block_A.
  • the same processing may be performed on the reference image Ref1 different from the reference image Ref0.
  • the reference block Block_A having the upper left coordinates (xPos1, yPos1) specified by is specified, and the template region Temp_L1 adjacent to Block_A in the reference picture A is set.
  • the matching cost between Temp_Cur and TempL1 is minimum (mv1_x, mv1_y), and the motion vector spMvL1 assigned to the sub-block is obtained.
  • template matching may be performed on two reference images Ref0 and Ref1. In this case, the matching of one reference image Ref0 and the matching of one reference image Ref1 described above are sequentially performed.
  • the motion vector decoding process includes a process of decoding syntax elements related to inter prediction (also referred to as motion syntax decoding process) and a process of deriving a motion vector ( Motion vector derivation process).
  • FIG. 32 is a flowchart showing the flow of inter prediction syntax decoding processing performed by the inter prediction parameter decoding control unit 3031. In the following description in the description of FIG. 32, each process is performed by the inter prediction parameter decoding control unit 3031 unless otherwise specified.
  • inter_pred_idc is decoded in step S304.
  • inter_pred_idc is other than PRED_L1 (PRED_L0 or PRED_BI)
  • the reference picture index refIdxL0, the difference vector parameter mvdL0, and the prediction vector index mvp_L0_idx are decoded in steps S305, S306, and S307, respectively.
  • inter_pred_idc is other than PRED_L0 (PRED_L1 or PRED_BI)
  • the reference picture index refIdxL1 is decoded in S308, S309, and S310.
  • a motion vector derivation process is executed.
  • the image encoding device 11b includes a prediction parameter encoding unit 111b (not shown) instead of the prediction parameter encoding unit 111 in the first embodiment. Further, the prediction parameter encoding unit 111b includes an inter prediction parameter encoding unit (motion vector deriving unit) 112b instead of the inter prediction parameter encoding unit 112 in the first embodiment. Except for this point, the image encoding device 11b has the same configuration as the image encoding device 11 according to the first embodiment.
  • FIG. 33 is a block diagram illustrating a configuration of the inter prediction parameter encoding unit 112b in the prediction parameter encoding unit 111b of the image encoding device 11b according to the third embodiment.
  • the inter prediction parameter encoding unit 112b includes a sub-block prediction parameter deriving unit 1125b instead of the sub-block prediction parameter deriving unit 1125 in the first embodiment. Except this point, the inter prediction parameter encoding unit 112b has the same configuration as the inter prediction parameter encoding unit 112 in the first embodiment. As illustrated in FIG.
  • the inter prediction parameter encoding unit 112b includes at least one of a spatiotemporal sub-block prediction unit 11251, an affine prediction unit 11252, and a matching motion derivation unit 11253.
  • the spatio-temporal sub-block prediction unit 11251, the affine prediction unit 11252, and the matching motion derivation unit 11253 have the same configurations as the spatio-temporal sub-block prediction unit 30371, the affine prediction unit 30372, and the matching motion derivation unit 30373, respectively. The description in is omitted.
  • the function of the inter prediction parameter decoding unit in the prediction parameter decoding unit of the image decoding device is not limited to the function of the inter prediction parameter decoding unit 303b in the prediction parameter decoding unit 302b of the image decoding device 31b of the image transmission system 1b according to Embodiment 3. .
  • the function of the inter prediction parameter decoding unit is performed in the prediction parameter decoding unit 302c of the image decoding device 31c of the image transmission system 1c (not shown) according to Embodiment 4 instead of or in addition to the inter prediction parameter decoding unit 303b.
  • the function of the inter prediction parameter decoding unit (motion vector deriving unit) 303c may be provided.
  • Embodiment 4 will be described with reference to FIGS.
  • members having the same functions as those described in the third embodiment are denoted by the same reference numerals and description thereof is omitted.
  • the image transmission system 1c includes an image encoding device (motion vector deriving device) 11c and an image decoding device (motion vector deriving device) 31c instead of the image encoding device 11b and the image decoding device 31b in the third embodiment. .
  • FIG. 41 is a block diagram showing a main configuration of the image decoding device 31c according to the present embodiment. As illustrated in FIG. 41, the image decoding device 31c according to the present embodiment includes a prediction parameter decoding unit 302c instead of the prediction parameter decoding unit 302b according to the third embodiment.
  • the prediction parameter decoding unit 302c includes an inter prediction parameter decoding unit 303c instead of the inter prediction parameter decoding unit 303b in the third embodiment. Except for this point, the prediction parameter decoding unit 302c has the same configuration as the prediction parameter decoding unit 302b in the third embodiment.
  • FIG. 43 is a block diagram illustrating a configuration of an inter prediction parameter decoding unit 303c included in the prediction parameter decoding unit 302c according to the second embodiment.
  • the inter prediction parameter decoding unit 303c includes a subblock prediction parameter derivation unit 3037c instead of the subblock prediction parameter derivation unit 3037b in the third embodiment.
  • the sub-block prediction parameter derivation unit 3037c includes a matching motion derivation unit (first motion vector search unit, second motion vector search unit) 30373c instead of the matching motion derivation unit 30373 in the third embodiment.
  • the matching motion derivation unit 30373c includes a first motion vector search unit 303731 and a second motion vector search unit 303732.
  • the first motion vector search unit 303731 searches for a motion vector for each prediction block by matching processing.
  • the first motion vector search unit 303731 searches for a motion vector by performing a local search after performing an initial vector search for a prediction block.
  • the second motion vector search unit 303732 refers to the motion vector selected by the first motion vector search unit 303731, and searches for a motion vector by a matching process for each of a plurality of sub-blocks included in the prediction block. To do.
  • the second motion vector search unit 303732 searches for a motion vector by performing a local search after performing an initial vector search for a sub-block.
  • the matching motion deriving unit 30373c prohibits a search in an oblique direction in at least one of the local search by the first motion vector search unit 303731 and the local search by the second motion vector search unit 303732. That is, the matching motion deriving unit 30373c sets the search direction of the candidate vector in the horizontal direction or the vertical direction centering on the initial vector in at least one of the first motion vector search unit 303731 and the second motion vector search unit 303732. Limit to crab.
  • the image decoding device 31a may read an image by reusing an already read image. Therefore, according to the above-described configuration, it is possible to generate a predicted image while reducing the memory band, compared to a case where search for a motion vector in an oblique direction is not prohibited.
  • FIG. 44 is a flowchart showing an outline of the motion prediction mode determination flow.
  • the motion prediction mode determination flow is executed by the inter prediction parameter decoding unit 303c.
  • the motion prediction mode is a mode for determining a method for deriving a motion vector used for motion compensation prediction.
  • the inter prediction parameter decoding control unit 3031 determines whether or not the mode is the merge mode (step S1501), and if not the merge mode (N in step S1501). AMVP mode. On the other hand, if it is determined that the mode is the merge mode (Y in step S1501), it is determined whether the mode is the matching mode (step S1502). If it is determined that the mode is the matching mode (Y in step S1502), the mode is the matching mode. If it is determined that the mode is not the matching mode (N in step S1502), the mode is the merge mode.
  • FIG. 45 is a sequence diagram showing the flow of the motion prediction mode determination flow.
  • the matching mode also called FRUC (Frame Rate Up Up Conversion) merge mode
  • the matching motion deriving unit 30373c derives a pattern match vector by bilateral matching when fruc_mode_idx is MODE_BM (eg, 1).
  • fruc_mode_idx is MODE_TM (for example, 2)
  • a pattern match vector is derived by template matching.
  • the parameter fruc_mode_idx indicating the matching mode serves as both a flag indicating whether the matching mode is used and a parameter indicating the matching method in the matching mode, but the present invention is not limited to this. That is, instead of the parameter fruc_mode_idx indicating the matching mode, a flag fruc_merge_flag indicating whether to use the matching mode and a parameter fruc_merge_param indicating the matching method may be used.
  • step S402 the AMVP mode is selected. More specifically, the AMVP prediction parameter derivation unit 3032 decodes the difference vector mvdLX in step S421, and the prediction vector index mvp_LX_idx is decoded in step S422. Further, in step S423, a prediction vector candidate pmvCand is derived. Subsequently, in step S424, a motion vector mvLX is derived from the following equation.
  • FIG. 46 is a flowchart showing the flow of the pattern match vector derivation process.
  • FIG. 46 shows the details of the process in step S405 in the sequence diagram shown in FIG.
  • the processing shown in FIG. 46 is executed by the matching motion derivation unit 30373c.
  • steps S4051 to S4054 are block searches executed at the block level. That is, a motion vector is derived for the entire block (CU or PU) using pattern matching.
  • Steps S4055 to S4060 are sub-block searches executed at the sub-block level constituting the block, and a motion vector is derived for each sub-block constituting the block using pattern matching.
  • a motion vector is derived every 8 ⁇ 8 or 4 ⁇ 4 unit.
  • the first motion vector search unit 303731 in the matching motion derivation unit 30373c derives a block-level initial vector in the target block (initial vector search).
  • the initial vector is a motion vector that serves as a search base.
  • a limited motion vector candidate such as a spatial merge candidate, a temporal merge candidate, a combined merge candidate, a zero vector, and an ATMVP vector of the target block
  • a vector that minimizes is derived as an initial vector.
  • the initial vector candidate is a motion vector derived based on the motion vector of the processed reference point.
  • the ATMVP vector is a vector derived from the average (or weighted average, median) of the motion vector around the target block and the motion vector of the reference image.
  • step S4054 the first motion vector search unit 303731 in the matching motion derivation unit 30373c performs a block level local search (local search) in the target block.
  • a local region centered on the derived initial vector is further searched, a vector having the lowest matching cost is searched, and a final block-level motion vector of the target block is obtained.
  • the local search may be a step search, raster search, or spiral search. Details of the local search will be described later.
  • step S4058 the second motion vector search unit 303732 in the matching motion derivation unit 30373c derives an initial vector of the sub-block in the target block (initial vector search). Specifically, vector candidates (motion vector derived in step S4054, zero vector, center collocated vector of the subblock, lower right collocated vector of the subblock, ATMVP vector of the subblock, upper adjacent vector of the subblock And the vector having the lowest matching cost among the left adjacent vectors of the sub-block and the like is set as the initial vector of the sub-block. Note that the vector candidates used for the initial vector search of the sub-block are not limited to the vectors described above.
  • step S4059 a local search centering on the initial vector of the sub-block selected in step S4058 is performed. Then, the matching cost of vector candidates near the initial vector of the sub-block is derived, and the minimum vector is derived as the sub-block motion vector.
  • fruc_mode_idx is MODE_BM
  • the matching cost is derived by bilateral matching.
  • fruc_mode_idx is MODE_TM
  • template matching is derived by template matching.
  • the matching motion derivation unit 30373c prohibits a search in an oblique direction in at least one of the local search in step S4054 and the local search in step S4059. Details will be described later.
  • FIG. 47 is a diagram for explaining a motion search pattern. Note that the number of steps (stepIter, maximum number of rounds) indicating how many times the method used for motion search (stepMethod) is repeated is set to a predetermined value. As will be described later, the maximum round number stepIterSubPU at the sub-block level may be less than the maximum round number stepIterPU at the block level.
  • the matching motion deriving unit 30373c considers the search candidate point that gives the smallest matching cost among the search candidate points evaluated for the matching cost in the motion search as the optimal search point, and selects the motion vector bestMV of the search candidate point. To do. Examples of functions used for deriving the matching cost include SAD (Sum of Absolute Difference, sum of absolute value errors), SATD (Hadamard transform absolute value error sum), SSD (Sum of Square difference), and the like. .
  • the local search for motion vectors performed by the matching motion deriving unit 30373c is not limited to this.
  • FIG. 47A is a diagram showing a motion search pattern when diamond search is applied.
  • FIG. 47B shows a motion search pattern when a cross search is applied.
  • step search a search candidate point is set around an initial vector (search start point), a matching cost for the set search candidate point is derived and evaluated, and a search candidate point that provides an optimal matching cost is selected. I do.
  • This process is called “step round process”.
  • this “step round process” is repeatedly executed.
  • the search round number numIter is incremented by one.
  • the initial vector startMV at each number of searches is indicated by a white diamond.
  • the optimal vector bestMV in each search round is indicated by a black diamond.
  • search candidate points at each number of searches are indicated by black circles.
  • points that have already been searched at each number of searches are indicated by white circles.
  • the matching motion deriving unit 30373c initializes the search round numIter to 0 before starting the search. Then, at the start time of each search round, the matching cost of the search start point is set to the minimum cost minCost, and the initial value ( ⁇ 1) is set to the optimal candidate index bestIdx.
  • mcost (X) is a function for deriving a matching cost in the search vector X.
  • the matching motion derivation unit 30373c selects and evaluates search candidate points centered on the search start point in each search round. Specifically, for each search candidate index Idx, the matching motion derivation unit 30373c adds the value (offsetCand [Idx]) of the offset candidate (offsetCand) to the coordinate (position) startMV of the search start point. Select point coordinates.
  • candMV startMV + offsetCand [Idx]
  • offsetCand [x] is an offset candidate that is added to the coordinates of the search start point in order to set the search candidate point.
  • the first motion vector search unit 303731 offsetCand [8] ((0, 2), (1, 1), (2, 0), (1, -1), (0, -2), (-1, -1), (-2, 0), (-1, 1) ⁇ is used.
  • the first motion vector search unit 303731 offsetCand [4] ⁇ (0, 2), (2, 0), (0, -2), (-2, 0) ⁇ may be used.
  • the first motion vector search unit 303731 excludes points 1, 3, 5, and 7 from the search candidate points among the points 0 to 7 in FIG. 47A, and sets the search candidate points to 0, 2 4 and 6.
  • the search candidate point indicated by the optimal vector bestMV is used as the search start point of the next round.
  • startMV bestMV (here P (1)) Whether or not the optimal vector bestMV has been updated is determined based on whether or not the optimal vector bestMV is different from the search start point, and whether or not bestIdx is updated to a value other than the initial value ( ⁇ 1), or , MinCost can also be determined based on whether or not the value is updated to a value other than the initial cost of the starting point.
  • search start index nDirectStart and the search end index nDirectEnd used in the next round may be determined by the following formulas depending on the position of the optimal vector bestMV (optimum candidate index bestIdx). This makes it possible to search efficiently without searching again for search points that have already been searched.
  • nStep 2-(bestIdx & 1)
  • nDirectStart bestIdx-nStep
  • nDirectEnd bestIdx + nStep
  • the search candidate point 2 is set as the initial vector startMV (search start point P1) in the current search, and is a plurality of points arranged in a diamond shape with the search start point P1 as the center, and is still selected as the search candidate point. Any of the points that are not used is set as a search candidate point.
  • the first motion vector search unit 303731 uses points 0 to 4 as search candidate points as shown in the second row of FIG.
  • Point 1 that was a search candidate is set as an initial vector startMV (search start point P2) in the current search.
  • the first motion vector search unit 303731 is a plurality of points arranged in a diamond shape with the search start point P2 as the center, and is not yet selected as a search candidate point but is present within the search range. One of them is set as a search candidate point.
  • the first motion vector search unit 303731 may also prohibit a search in an oblique direction when selecting a search candidate point in the second search and the third search.
  • the first motion vector search unit 303731 may prohibit a search in an oblique direction for one or both of the second search and the third search. In this case, the first motion vector search unit 303731 may determine whether or not to prohibit the search in the oblique direction for each search.
  • the first motion vector search unit 303731 limits the offset candidates by the same method as the method in which the search in the oblique direction is prohibited in the first search described above, and sets the search candidate points. limit.
  • the first motion vector search unit 303731 may perform another step search.
  • the following values are used as offset candidates (offsetCand).
  • FIG. 47B shows an example in which the cross search is performed after the diamond search.
  • the first motion vector search unit 303731 uses the search start point (the search start point P2 in the third row in FIG. 47A) as the center, and points at the top, bottom, left, and right (cross) positions as search candidate points. Select in turn.
  • the search candidate points including the search start point P2 that give the smallest matching cost among the search candidate points 0 to 3 on the upper, lower, left, and right sides of the search start point P2 are the points to the right of P2.
  • the first motion vector search unit 303731 selects a point on the right side of P2 as the end point of the optimal vector bestMV for the prediction block PU.
  • the second motion vector search unit 303732 may also prohibit the search in the oblique direction, like the first motion vector search unit 303731.
  • ⁇ Step search change example 1> In the above-described example, the case where the search in the oblique direction is prohibited in the local search (block search) by the first motion vector search unit 303731 and the second motion vector search unit 303732 is described. However, the present embodiment is not limited to this. In the present embodiment, the search in the oblique direction is not prohibited in the block search by the first motion vector search unit 303731, and the search in the oblique direction is performed in the local search (sub-block search) by the second motion vector search unit 303732. It may be prohibited.
  • the first motion vector search unit 303731 arranges in a diamond shape with the search start point as the center, and selects all points that have not yet been selected as search candidate points. It is set as a search candidate point.
  • the second motion vector search unit 303732 is arranged in a diamond shape with the search start point as the center, and searches for points that are oblique to the search start point among the points not yet selected as search candidate points. Exclude from candidate points.
  • the second motion vector search unit 303732 when searching for a motion vector centering on P0, the second motion vector search unit 303732 excludes points that are diagonally located with respect to P0 from the search candidate points among the points arranged in a diamond shape. Limit search candidate points.
  • the sub-block search is more detailed than the block search, so the amount of processing tends to increase.
  • the second motion vector search unit 303732 can reduce the processing amount of the sub-block search.
  • the first motion vector search unit 303731 may prohibit a search in an oblique direction in the step round process after a predetermined number of times among these local searches.
  • the first motion vector search unit 303731 does not prohibit the search in the diagonal direction in the step round processing up to the Mth time (M is a natural number), and prohibits the search in the diagonal direction in the step round processing after the (M + 1) th time. Also good.
  • the search in the oblique direction is allowed and the search in the oblique direction is prohibited in the step round process after approaching the optimum search point while searching for a suitable search point with a low matching cost. , Can reduce the processing amount.
  • the second motion vector search unit 303732 may also prohibit a search in an oblique direction in a step round process after a predetermined number of times.
  • the first motion vector search unit 303731 may prohibit a search in an oblique direction according to a search candidate point in a block search.
  • the first motion vector search unit 303731 may not prohibit the search in the oblique direction when the search candidate point is one pixel position (full-pel position).
  • the first motion vector search unit 303731 may prohibit the search in an oblique direction and limit the search direction to up, down, left, and right. A specific example is shown below.
  • the first motion vector search unit 303731 uses an offset candidate offsetCand [Idx] including all search candidate points as an offset candidate.
  • the first motion vector search unit 303731 uses the offset candidate offsetCand [Idx] to derive a motion vector candidate from the following equation.
  • candMV startMV + offsetCand [Idx]
  • the first motion vector search unit 303731 moves the motion compensated image (predicted image) of the motion vector candidate candMV. And calculate the matching cost.
  • the search candidate point is a decimal pixel position (for example, a position that is not an intersection of each pixel in the first row in FIG. 47A)
  • the first motion vector search unit 303731 Only when the search start point startMV is in the vertical and horizontal directions, the matching cost is calculated.
  • the first motion vector search unit 303731 When the search candidate point is oblique to the search start point startMV, the first motion vector search unit 303731 does not generate a motion compensated image (predicted image) of the motion vector candidate candMV. In this case, the first motion vector search unit 303731 may derive a predetermined large value (for example, 2 15 ⁇ 1) as the matching cost, or may not derive the matching cost. Thereby, the processing amount can be reduced.
  • a predetermined large value for example, 2 15 ⁇ 1
  • the matching cost may be calculated in the sub-block search as in the first motion vector search unit 303731.
  • the first motion vector search unit 303731 may prohibit the search for the motion vector when at least a part of the reference block indicated by the searched motion vector is outside the screen of the reference image. In other words, the first motion vector search unit 303731 may not generate a predicted image when at least a part of the reference block indicated by the motion vector is outside the screen of the reference image.
  • FIG. 48 is a flowchart showing an outline of a flow for determining whether or not to generate a predicted image.
  • the predicted image generation determination process by the first motion vector search unit 303731 includes the following three steps (Step S431) to (Step S433).
  • Step S431 the first motion vector search unit 303731 determines whether at least a part of the reference block is outside the screen. If first motion vector search section 303731 determines that at least a part of the reference block is outside the screen (Y in step S431), the first motion vector search unit 303731 proceeds to step S432. If the first motion vector search unit 303731 determines that at least a part of the reference block is not outside the screen (N in step S431), the process proceeds to step S433.
  • the first motion vector search unit 303731 may determine that the reference block is outside the screen of the reference image when at least one of the following formulas B-1 to B-4 is satisfied.
  • Equation B-1 is an equation used when determining whether or not the left end of the reference block indicated by the motion vector is outside the screen of the reference image.
  • Expression B-2 is an expression used when determining whether the right end of the reference block is outside the screen of the reference image.
  • Expression B-3 is an expression used when determining whether or not the upper end of the reference block is outside the screen of the reference image.
  • Expression B-4 is an expression used when determining whether or not the lower end of the reference block is outside the screen of the reference image.
  • xInt-NTAPS / 2 + 1 ⁇ 0 (Formula B-1) xInt + BLKW + NTAPS / 2-1> pic_width-1 (Formula B-2) yInt-NTAPS / 2 + 1 ⁇ 0 (Formula B-3) yInt + BLKH + NTAPS / 2-1> pic_height-1 (Formula B-4)
  • xInt and yInt in the equations B-1 to B-4 are shifted by the motion vector (mv_x, mv_y) from the upper left block coordinates (xPb, yPb) when the motion vector accuracy is 1 / M pel accuracy. Points to the integer position (xInt, yInt) of the reference image corresponding to the in-block coordinates (x, y).
  • NTAPS in Equations B-1 to B-4 represents the number of filter taps of the motion compensation filter.
  • BLKW and BLKH in the formulas B-1 to B-4 indicate the horizontal width and height of the corresponding block, respectively.
  • pic_width and pic_height in Expressions B-1 to B-4 indicate the horizontal width and height of the reference image, respectively.
  • Step S432 the first motion vector search unit 303731 determines not to generate a motion compensated image (predicted image) of the motion vector candMV.
  • the first motion vector search unit 303731 may derive a predetermined large value (for example, 2 15 ⁇ 1) as the matching cost, or may not derive the matching cost. This eliminates the need for padding processing that occurs when the reference block is outside the screen of the reference image, thereby reducing the amount of processing.
  • Step S433 the first motion vector search unit 303731 determines to generate a motion compensated image (predicted image) and calculate a matching cost.
  • the second motion vector search unit 303732 may also perform the above-described prediction image generation process in the sub-block search, similarly to the first motion vector search unit 303731.
  • the first motion vector search unit 303731 does not determine whether or not the reference block is outside the screen of the reference image in Step S431 of Modification 4 described above, but the reference block is within a certain range from the boundary of the reference image. You may determine whether it is outside.
  • FIG. 49 is a flowchart showing an outline of a flow for determining whether or not to generate a predicted image.
  • the predicted image generation determination process by the first motion vector search unit 303731 includes three steps (step S441) to (step S443). Steps S442 and S443 are the same as steps S432 and S433 described above, respectively, and thus description thereof is omitted.
  • Step S441 the first motion vector search unit 303731 determines whether at least a part of the reference block is outside a certain range from the boundary of the reference image.
  • step S441 determines that at least a part of the reference block is outside the screen (Y in step S441), the process proceeds to step S442. If the first motion vector search unit 303731 determines that at least part of the reference block is not outside the screen (N in step S441), the process proceeds to step S443.
  • the first motion vector search unit 303731 uses the following expressions C-1 to C-4: When at least one of the conditions is satisfied, it may be determined that at least a part of the reference block is outside a certain range from the boundary of the reference image.
  • the following expression C-1 is an expression used when determining whether or not the left end of the reference block indicated by the motion vector is outside a certain range from the boundary of the reference image.
  • Expression C-2 is an expression used when determining whether the right end of the reference block is outside a certain range from the boundary of the reference image.
  • Expression C-3 is an expression used when determining whether or not the upper end of the reference block is outside a certain range from the boundary of the reference image.
  • Expression C-4 is an expression used when determining whether or not the lower end of the reference block is outside a certain range from the boundary of the reference image.
  • padW and padH in the formulas C-1 to C-4 mean padW indicating a predetermined range in the horizontal direction and padH indicating a predetermined range in the vertical direction, respectively.
  • the first motion vector search unit 303731 when at least a part of the reference block protrudes from the boundary of the reference image but does not protrude outside the certain range, the first motion vector search unit 303731 generates a motion compensated image (predicted image). Can be generated.
  • a motion compensated image predicted image
  • the second motion vector search unit 303732 may also perform the above-described prediction image generation process in the sub-block search, similarly to the first motion vector search unit 303731.
  • raster search will be described.
  • the matching motion deriving unit 30373c performs a motion search to which the raster search is applied, the matching motion deriving unit 30373c comprehensively selects search points within the search range at regular intervals, and the matching cost is determined by a raster scan.
  • Evaluate in order the raster scan starts from the upper left of the search range, examines the pixels from the left side to the right until it reaches the right end, and if it reaches the right end, it goes down one row and goes from the left end to the right again. This is an exhaustive search method that sequentially examines the pixels.
  • the matching motion deriving unit 30373c selects a search vector that gives the smallest matching cost among the matching costs calculated for each search vector from the start point to the end point set in the raster scan order.
  • an extended raster scan may be used instead of the raster scan.
  • each point in the block is scanned in a predetermined scan order like the raster scan. For example, a spiral scan that scans spirally from the center toward the periphery is used.
  • At least one of the first motion vector search unit 303731 and the second motion vector search unit 303732 may prohibit the search in the oblique direction as in the above-described step search.
  • the image encoding device 11c includes a prediction parameter encoding unit 111c instead of the prediction parameter encoding unit 111b in the third embodiment.
  • the prediction parameter encoding unit 111c includes an inter prediction parameter encoding unit (motion vector deriving unit) 112c instead of the inter prediction parameter encoding unit 112b in the third embodiment.
  • FIG. 42 is a block diagram illustrating a configuration of the inter prediction parameter encoding unit 112c of the image encoding device 11c according to the fourth embodiment.
  • the inter prediction parameter encoding unit 112c includes a subblock prediction parameter deriving unit 1125c instead of the subblock prediction parameter deriving unit 1125b in the third embodiment.
  • the sub-block prediction parameter deriving unit 1125c includes a matching motion deriving unit 11253c instead of the matching motion deriving unit 11253 in the third embodiment.
  • the inter prediction parameter encoding unit 112c has the same configuration as the inter prediction parameter encoding unit 112b in the third embodiment.
  • the matching motion deriving unit 11253c has the same configuration as the above-described matching motion deriving unit 30373c, description thereof is omitted here.
  • the image encoding devices 11, 11a, 11b, and 11c and part of the image decoding devices 31, 31a, 31b, and 31c in the above-described embodiment for example, the entropy decoding unit 301, the prediction parameter decoding units 302, 302b, and 302c, Loop filter 305, predicted image generation units 308 and 308a, inverse quantization / inverse transformation unit 311, addition unit 312, predicted image generation units 101 and 101a, subtraction unit 102, transformation / quantization unit 103, entropy encoding unit 104,
  • the inverse quantization / inverse transform unit 105, the loop filter 107, the encoding parameter determination unit 110, and the prediction parameter encoding units 111, 111b, and 111c may be realized by a computer.
  • the program for realizing the control function may be recorded on a computer-readable recording medium, and the program recorded on the recording medium may be read by the computer system and executed.
  • the “computer system” is a computer system built in any of the image encoding devices 11, 11a, 11b, and 11c and the image decoding devices 31, 31a, 31b, and 31c. It shall include hardware such as equipment.
  • the “computer-readable recording medium” refers to a storage device such as a portable medium such as a flexible disk, a magneto-optical disk, a ROM, a CD-ROM, or a hard disk built in a computer system.
  • the “computer-readable recording medium” is a medium that holds a program dynamically for a short time, such as a communication line in the case of transmitting a program via a network such as the Internet or a communication line such as a telephone line,
  • a volatile memory inside a computer system serving as a server or a client may be included and a program that holds a program for a certain period of time.
  • the program may be a program for realizing a part of the above-described functions, or may be a program that can be realized by a combination with a program already recorded in the computer system.
  • part or all of the image encoding devices 11, 11a, 11b, and 11c and the image decoding devices 31, 31a, 31b, and 31c in the above-described embodiment are realized as an integrated circuit such as an LSI (Large Scale Integration). May be.
  • LSI Large Scale Integration
  • Each functional block of the image encoding devices 11, 11a, 11b, and 11c and the image decoding devices 31, 31a, 31b, and 31c may be individually converted into a processor, or a part or all of them may be integrated into a processor.
  • the method of circuit integration is not limited to LSI, and may be realized by a dedicated circuit or a general-purpose processor.
  • an integrated circuit based on the technology may be used.
  • the above-described image encoding devices 11, 11a, 11b, and 11c and the image decoding devices 31, 31a, 31b, and 31c can be mounted and used in 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. 50 (a) is a block diagram showing a configuration of a transmission apparatus PROD_A equipped with the image encoding apparatuses 11, 11a, 11b, and 11c.
  • the transmission apparatus 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
  • a transmission unit PROD_A3 that transmits the modulation signal obtained by the modulation unit PROD_A2 are provided.
  • the above-described image encoding devices 11, 11a, 11b, and 11c are used as the encoding unit PROD_A1.
  • Transmission device PROD_A as a source of moving images to be input to the encoding unit PROD_A1, a camera PROD_A4 that captures moving images, a recording medium PROD_A5 that records moving images, an input terminal PROD_A6 for inputting moving images from the outside, and An image processing unit A7 that generates or processes an image may be further provided.
  • FIG. 50A illustrates a configuration in which the transmission apparatus PROD_A includes all of these, but some of them 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 in accordance with the recording encoding method may be interposed between the recording medium PROD_A5 and the encoding unit PROD_A1.
  • FIG. 50 is a block diagram showing a configuration of a receiving device PROD_B equipped with the image decoding devices 31, 31a, 31b, and 31c.
  • 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 above-described image decoding devices 31, 31a, 31b, and 31c are used as the decoding unit PROD_B3.
  • the receiving device PROD_B is a display destination PROD_B4 for displaying a moving image, a recording medium PROD_B5 for recording a 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. 50B a configuration in which all of these are provided in the receiving device PROD_B is illustrated, but a part may be omitted.
  • the recording medium PROD_B5 may be for recording a non-encoded moving image, or is encoded by a recording encoding method different from the transmission encoding method. May be. In the latter case, an encoding unit (not shown) 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, etc.) / Receiving station (television receiver, etc.) is an example of a transmitting device PROD_A / receiving device PROD_B that transmits and receives modulated signals by wireless broadcasting.
  • a broadcasting station (broadcasting equipment, etc.) / Receiving station (television receiver, etc.) 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 wired broadcasting.
  • a server workstation, etc.
  • Client television receiver, personal computer, smartphone, etc.
  • VOD Video On Demand
  • video sharing service using the Internet transmits and receives a modulated signal by communication.
  • PROD_A / receiving 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 moving image 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. 51A is a block diagram showing a configuration of a recording apparatus PROD_C equipped with the above-described image encoding apparatuses 11, 11a, 11b, and 11c.
  • 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 above-described image encoding devices 11, 11a, 11b, and 11c are 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) and SSD (Solid State Drive). Further, (2) an SD memory card, a USB (Universal Serial Bus) flash memory, or the like connected to the recording device PROD_C may be used. Further, (3) DVD (Digital Versatile Disc) and BD (Blu-ray Disc: registered trademark), etc. may be loaded into 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 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 a reception for receiving moving images
  • a unit PROD_C5 and an image processing unit PROD_C6 for generating or processing an image may be further provided.
  • FIG. 51A a configuration in which the recording apparatus PROD_C includes all of these is illustrated, but a part 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 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, the camera PROD_C3 or the reception unit PROD_C5 is a main source of moving images
  • the like is also an example of such a recording apparatus PROD_C.
  • FIG. 51 (b) is a block diagram showing a configuration of a playback device PROD_D equipped with the above-described image decoding devices 31 and 31a.
  • 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 read unit PROD_D1 that reads the encoded data. And a decoding unit PROD_D2 to obtain.
  • the above-described image decoding devices 31, 31a, 31b, and 31c are 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 and SSD. Further, (2) a type connected to the playback device PROD_D, such as an SD memory card and a USB flash memory, may be used. Also, (3) a drive device (not shown) built in the playback device PROD_D, such as a DVD and a BD, may be loaded.
  • the playback device PROD_D has a display unit PROD_D3 that displays a moving image as a supply destination of the moving image output by the decoding unit PROD_D2, an output terminal PROD_D4 that outputs the moving image to the outside, and a transmission unit that transmits the moving image.
  • PROD_D5 may be further provided.
  • FIG. 51B illustrates a configuration in which the playback apparatus PROD_D includes all of these, but some of them may be omitted.
  • the transmission unit PROD_D5 may transmit a non-encoded moving image, or transmits encoded data encoded by a transmission encoding scheme different from the recording encoding scheme. You may do. In the latter case, an encoding unit (not shown) that encodes a moving image by a transmission encoding method may be interposed 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, the output terminal PROD_D4 to which a television receiver or the like is connected is a main moving image supply destination).
  • 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 video)
  • An image is a main supply destination
  • a smartphone in this case, the display PROD_D3 or the transmission unit PROD_D5 is a main supply destination of moving images
  • the like are examples of such a playback device PROD_D.
  • Each block of the above-described image decoding devices 31, 31a, 31b, and 31c and the image encoding devices 11, 11a, 11b, and 11c is realized by hardware by a logic circuit formed on an integrated circuit (IC chip). Alternatively, it may be realized by software using a CPU (Central Processing Unit).
  • IC chip integrated circuit
  • CPU Central Processing Unit
  • each of the above devices includes a CPU that executes instructions of a program that realizes each function, a ROM (Read Memory) that stores the program, a RAM (RandomAccess Memory) that expands the program, the program, and various data
  • a storage device such as a memory for storing the.
  • the object of the embodiment of the present invention is to record the program code (execution format program, intermediate code program, and source program) of the control program for each of the above devices, which is software that realizes the above-described functions, in a computer-readable manner. This can also be achieved by supplying a medium 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 CD-ROMs (Compact Disc Read-Only Memory) / MO discs (Magneto-Optical discs).
  • tapes such as magnetic tapes and cassette tapes
  • magnetic disks such as floppy (registered trademark) disks / hard disks
  • CD-ROMs Compact Disc Read-Only Memory
  • MO discs Magnetic-Optical discs
  • IC cards including memory cards
  • Cards such as optical cards
  • Semiconductor memories such as flash ROM, or PLD (Programmable logic device ) And FPGA (Field Programmable Gate Gate Array) and the like.
  • 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.
  • Internet intranet, extranet, LAN (Local Area Network), ISDN (Integrated Services Digital Network), VAN (Value-Added Network), CATV (Community Area Antenna / television / Cable Television), Virtual Private Network (Virtual Private Network) Network), telephone line network, mobile communication network, satellite communication network, and the like.
  • the transmission medium constituting the communication network may be any medium that can transmit the program code, and is not limited to a specific configuration or type.
  • IEEE Institute of Electrical and Electronic Engineers 1394, USB, power line carrier, cable TV line, telephone line, ADSL (Asymmetric Digital Subscriber Line) line, etc. wired such as IrDA (Infrared Data Association) and remote control , BlueTooth (registered trademark), IEEE802.11 wireless, HDR (High Data Rate), NFC (Near Field Communication), DLNA (Digital Living Network Alliance: registered trademark), mobile phone network, satellite line, terrestrial digital broadcasting network, etc. It can also be used wirelessly.
  • the embodiment of 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.
  • Embodiments of the present invention are preferably applied to an image decoding apparatus that decodes encoded data in which image data is encoded, and an image encoding apparatus that generates encoded data in which image data is encoded. it can. Further, the present invention can be suitably applied to the data structure of encoded data generated by an image encoding device and referenced by the image decoding device.
  • inter prediction parameter encoding unit (motion vector deriving unit) DESCRIPTION OF SYMBOLS 1121 ... Merge prediction parameter derivation
  • AMVP prediction parameter derivation unit 3033 ... vector candidate derivation unit 3036 ... merge prediction parameter derivation unit 3038 ... addition unit 30361 ... merge candidate derivation unit 303611 ... merge candidate storage unit 30362 ... merge candidate selection unit 304 ... intra prediction parameter decoding unit 306 ... Reference picture memory 307 ... Prediction parameter memories 308 and 308a ... Prediction image generation units 309 and 309a ... Inter prediction image generation units 3091 and 3091a ... Motion compensation unit 30911 ... Motion compensation gradient unit 309122 ... Slope correction coefficient derivation unit 309112 ... Slope derivation Unit 3094 ... weight prediction unit 310 ... intra prediction image generation unit 311 ...

Abstract

According to the present invention, a video decoding device (31) is provided with a prediction image generation unit (308) using at least one of a single prediction mode, a double prediction mode and a BIO mode for generating a prediction image. The prediction image generation unit (308) prevents the generation of a prediction image using the BIO mode, when a reference block in at least one of a first reference image and a second reference image is outside a reference image screen.

Description

動画像復号装置、動画像符号化装置、予測画像生成装置及び動きベクトル導出装置Video decoding device, video encoding device, predicted image generation device, and motion vector derivation device
 本発明は、動画像復号装置、動画像符号化装置、予測画像生成装置及び動きベクトル導出装置に関する。 The present invention relates to a video decoding device, a video encoding device, a predicted image generation device, and a motion vector derivation 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/AVC及びHEVC(High-Efficiency Video Coding)にて提案されている方式等が挙げられる。 Specific examples of the moving image encoding method include a method proposed in H.264 / AVC and HEVC (High-Efficiency Video Coding).
 このような動画像符号化方式においては、動画像を構成する画像(ピクチャ)は、画像を分割することにより得られるスライス、スライスを分割することにより得られる符号化ツリーユニット(CTU:Coding Tree Unit)、符号化ツリーユニットを分割することで得られる符号化単位(符号化ユニット(Coding Unit:CU)と呼ばれることもある)、及び、符号化単位を分割することより得られるブロックである予測ユニット(PU)、並びに、変換ユニット(TU)からなる階層構造により管理され、CU毎に符号化/復号される。 In such a moving image coding system, an image (picture) constituting a moving image is a slice obtained by dividing the image, a coding tree unit (CTU: Coding Tree Unit obtained by dividing the slice). ), A coding unit obtained by dividing a coding tree unit (sometimes called a coding unit (Coding Unit: CU)), and a prediction unit which is a block obtained by dividing a coding unit (PU) and a hierarchical structure composed of conversion units (TU), and encoded / decoded for each CU.
 また、このような動画像符号化方式においては、通常、入力画像を符号化/復号することによって得られる局所復号画像に基づいて予測画像が生成され、当該予測画像を入力画像(原画像)から減算して得られる予測残差(「差分画像」又は「残差画像」と呼ぶこともある)が符号化される。予測画像の生成方法としては、画面間予測(インター予測)、及び、画面内予測(イントラ予測)が挙げられる。 In such a moving image coding method, a predicted image is usually generated based on a local decoded image obtained by encoding / decoding an input image, and the predicted image is generated from the input image (original image). A prediction residual obtained by subtraction (sometimes referred to as “difference image” or “residual image”) is encoded. Examples of methods for generating a predicted image include inter-screen prediction (inter prediction) and intra-screen prediction (intra prediction).
 また、近年の動画像符号化及び復号の技術として非特許文献1~3が挙げられる。非特許文献1には、予測画像を生成する際の動き補償処理において、勾配情報を用いて補正するBIO(Bi-directional optical flow;双予測勾配変化)予測に関する技術が記載されている。非特許文献2には、アフィン予測を用いた技術が記載されている。非特許文献3には、符号化装置及び復号装置において、マッチングにより動きベクトルを探索する技術が記載されている。 Also, Non-Patent Documents 1 to 3 can be cited as recent moving picture encoding and decoding techniques. Non-Patent Document 1 describes a technique related to BIO (bi-directional optical flow: bi-predictive gradient change) prediction that is corrected using gradient information in motion compensation processing when generating a predicted image. Non-Patent Document 2 describes a technique using affine prediction. Non-Patent Document 3 describes a technique for searching for a motion vector by matching in an encoding device and a decoding device.
 上述のような技術を用いて予測画像を生成する場合、メモリバンド幅が大きくなるため、メモリバンド幅を削減する技術が求められている。 When a predicted image is generated using the above-described technique, the memory bandwidth becomes large, so a technique for reducing the memory bandwidth is required.
 本発明は、メモリバンド幅を削減することを目的とする。 The present invention aims to reduce the memory bandwidth.
 上記の課題を解決するために、本発明の一態様に係る予測画像生成装置は、1又は複数の参照画像に対して動き補償を行うことによって予測画像を生成する予測画像生成装置であって、第1の参照画像を参照して予測画像を生成する単予測モード、第1の参照画像と第2の参照画像とを参照して予測画像を生成する双予測モード、及び、第1の参照画像と第2の参照画像と勾配補正項とを参照して予測画像を生成するBIOモードの少なくとも何れかを用いて予測画像を生成する予測画像生成部を備え、前記予測画像生成部は、第1の参照画像及び第2の参照画像の少なくとも何れかにおける参照ブロックが参照画像の画面外に係る場合、前記BIOモードを用いた予測画像の生成を禁止する。 In order to solve the above problem, a predicted image generation apparatus according to an aspect of the present invention is a predicted image generation apparatus that generates a predicted image by performing motion compensation on one or more reference images, Single prediction mode for generating a predicted image with reference to the first reference image, bi-prediction mode for generating a predicted image with reference to the first reference image and the second reference image, and the first reference image A predicted image generation unit that generates a predicted image using at least one of the BIO modes for generating a predicted image with reference to the second reference image and the gradient correction term, wherein the predicted image generation unit includes: When the reference block in at least one of the reference image and the second reference image is outside the screen of the reference image, the generation of the predicted image using the BIO mode is prohibited.
 上記の課題を解決するために、本発明の一態様に係る予測画像生成装置は、複数の参照画像に対して動き補償を行うことによって予測画像を生成する予測画像生成装置であって、第1の参照画像と第2の参照画像と勾配補正項とを参照して予測画像を生成するBIOモードを含む複数のモードを少なくとも用いて予測画像を生成する予測画像生成部を備え、前記予測画像生成部は、前記第1の参照画像及び前記第2の参照画像の少なくとも何れかにおける対応ブロックに関する読み込み領域外の画素値である読み込み領域外画素値を生成し、前記BIOモードを用いて予測画像を生成する場合、前記予測画像生成部による垂直方向又は水平方向に沿った読み込み領域外画素値の生成処理を禁止する。 In order to solve the above problem, a predicted image generation apparatus according to an aspect of the present invention is a predicted image generation apparatus that generates a predicted image by performing motion compensation on a plurality of reference images. A predicted image generation unit that generates a predicted image using at least a plurality of modes including a BIO mode that generates a predicted image with reference to the reference image, the second reference image, and the gradient correction term. The unit generates a pixel value outside the reading region that is a pixel value outside the reading region with respect to the corresponding block in at least one of the first reference image and the second reference image, and uses the BIO mode to generate a predicted image When generating, the generation process of the pixel value outside the reading area along the vertical direction or the horizontal direction by the predicted image generation unit is prohibited.
 上記の課題を解決するために、本発明の一態様に係る動きベクトル導出装置は、対象ブロックを構成するサブブロックの各々の動きベクトルを導出する動きベクトル導出装置において、前記対象ブロックに含まれる複数のサブブロックの各々の動きベクトルを、当該対象ブロックと頂点を共有する参照ブロック内に設定された複数の制御点における動きベクトルを参照して算出する動きベクトル導出部を備え、前記動きベクトル導出部は、前記複数の制御点における各々の動きベクトルの差分の範囲を制限する。 In order to solve the above problem, a motion vector deriving device according to an aspect of the present invention is a motion vector deriving device for deriving a motion vector of each of subblocks constituting a target block. A motion vector deriving unit that calculates a motion vector of each sub-block with reference to motion vectors at a plurality of control points set in a reference block sharing a vertex with the target block, Restricts the range of the difference of each motion vector at the plurality of control points.
 上記の課題を解決するために、本発明の一態様に係る動きベクトル導出装置は、動画像の符号化又は復号に用いられる予測画像を生成するために参照される動きベクトルを生成する動きベクトル導出装置において、マッチング処理により予測ブロック毎に動きベクトルを探索する第1の動きベクトル探索部と、前記第1の動きベクトル探索部により選択された動きベクトルを参照して、前記予測ブロック内に含まれる複数のサブブロックの各々について、マッチング処理により動きベクトルを探索する第2の動きベクトル探索部と、を備え、前記第1の動きベクトル探索部は、予測ブロックに関する初期ベクトル探索を行ったうえで、局所的探索を行うことにより動きベクトルを探索するものであり、前記第2の動きベクトル探索部は、サブブロックに関する初期ベクトル探索を行ったうえで、局所的探索を行うことにより動きベクトルを探索するものであり、前記第1の動きベクトル探索部による局所的探索及び前記第2の動きベクトル探索部による局所的探索の少なくとも何れかにおいて、斜め方向の探索を禁止する。 In order to solve the above-described problem, a motion vector derivation device according to an aspect of the present invention provides a motion vector derivation that generates a motion vector referred to in order to generate a prediction image used for encoding or decoding a moving image. In the apparatus, a first motion vector search unit that searches for a motion vector for each prediction block by matching processing and a motion vector selected by the first motion vector search unit are included in the prediction block. A second motion vector search unit that searches for a motion vector by a matching process for each of the plurality of sub-blocks, and the first motion vector search unit performs an initial vector search for a prediction block; The second motion vector search unit searches for a motion vector by performing a local search. A motion vector is searched by performing a local search after performing an initial vector search for a block, and a local search by the first motion vector search unit and a local search by the second motion vector search unit In at least one of the target searches, a search in an oblique direction is prohibited.
 以上の構成によれば、メモリバンド幅を削減することができる。 According to the above configuration, the memory bandwidth can be reduced.
符号化ストリームのデータの階層構造を示す図である。It is a figure which shows the hierarchical structure of the data of an encoding stream. PU分割モードのパターンを示す図である。(a)~(h)は、それぞれ、PU分割モードが、2Nx2N、2NxN、2NxnU、2NxnD、Nx2N、nLx2N、nRx2N、及び、NxNの場合のパーティション形状について示している。It is a figure which shows the pattern of PU division | segmentation mode. (A) to (h) respectively show the partition shapes when the PU partitioning modes are 2Nx2N, 2NxN, 2NxnU, 2NxnD, Nx2N, nLx2N, nRx2N, and NxN. 参照ピクチャ及び参照ピクチャリストの一例を示す概念図である。It is a conceptual diagram which shows an example of a reference picture and a reference picture list. 実施形態1に係る画像符号化装置の構成を示すブロック図である。It is a block diagram which shows the structure of the image coding apparatus which concerns on Embodiment 1. FIG. 実施形態1に係る画像復号装置の構成を示すブロック図である。It is a block diagram which shows the structure of the image decoding apparatus which concerns on Embodiment 1. 実施形態1に係る画像符号化装置のインター予測画像生成部の構成を示すブロック図である。It is a block diagram which shows the structure of the inter estimated image generation part of the image coding apparatus which concerns on Embodiment 1. FIG. 実施形態1に係るマージ予測パラメータ導出部の構成を示すブロック図である。It is a block diagram which shows the structure of the merge prediction parameter derivation | leading-out part which concerns on Embodiment 1. FIG. 実施形態1に係るAMVP予測パラメータ導出部の構成を示すブロック図である。3 is a block diagram illustrating a configuration of an AMVP prediction parameter derivation unit according to Embodiment 1. FIG. 実施形態1に係る画像符号化装置のインター予測パラメータ符号化部の構成を示すブロック図である。It is a block diagram which shows the structure of the inter prediction parameter encoding part of the image coding apparatus which concerns on Embodiment 1. FIG. 実施形態1に係る画像復号装置のインター予測画像生成部の構成を示すブロック図である。It is a block diagram which shows the structure of the inter estimated image generation part of the image decoding apparatus which concerns on Embodiment 1. FIG. 実施形態1に係るインター予測パラメータ復号部の構成を示すブロック図である。It is a block diagram which shows the structure of the inter prediction parameter decoding part which concerns on Embodiment 1. FIG. BIO予測を用いた動き補償機能を備える動き補償部3091が予測画像を導出する処理の流れを説明するフローチャートである。It is a flowchart explaining the flow of the process in which the motion compensation part 3091 provided with the motion compensation function using BIO prediction derives | leads-out a predicted image. 勾配変化の概念を導出する流れの一例を示す図である。It is a figure which shows an example of the flow which derives | leads-out the concept of gradient change. 対象画像及び参照画像に依存して、補正重みベクトルを導出する方法について説明する図である。It is a figure explaining the method to derive | lead-out a correction | amendment weight vector depending on a target image and a reference image. (a)は動き補償フィルタmcFilterの具体例であり、(b)は勾配フィルタの具体例である。(A) is a specific example of the motion compensation filter mcFilter, and (b) is a specific example of the gradient filter. 最小二乗法を用いて補正重みベクトルを導出する方法について説明する図である。It is a figure explaining the method to derive | lead-out a correction | amendment weight vector using the least squares method. 動き補償部の構成例を示すブロック図である。It is a block diagram which shows the structural example of a motion compensation part. 動き補償部が行うBIO予測の処理の流れの一例を示すフローチャートである。It is a flowchart which shows an example of the flow of the process of BIO prediction which a motion compensation part performs. 実施形態1に係る画像復号装置における動き補償部がBIOパディングを実行する領域を示す図である。It is a figure which shows the area | region where the motion compensation part in the image decoding apparatus which concerns on Embodiment 1 performs BIO padding. 実施形態1に係る画像復号装置における動き補償部が画面外パディングを実行する場合の例を示す図である。It is a figure which shows the example in case the motion compensation part in the image decoding apparatus which concerns on Embodiment 1 performs off-screen padding. 実施形態1に係る画像復号装置における動き補償部が予測画像を生成する処理の流れの一例を示すフローチャートである。5 is a flowchart illustrating an example of a flow of processing in which a motion compensation unit in the image decoding device according to Embodiment 1 generates a predicted image. 実施形態1に係る画像復号装置における動き補償部が予測画像を生成する処理の流れの別の例を示すフローチャートである。12 is a flowchart illustrating another example of a flow of processing in which the motion compensation unit in the image decoding device according to Embodiment 1 generates a predicted image. 実施形態2に係る画像復号装置の構成を示すブロック図である。It is a block diagram which shows the structure of the image decoding apparatus which concerns on Embodiment 2. 実施形態2に係る画像符号化装置のインター予測画像生成部の構成を示す概略図である。It is the schematic which shows the structure of the inter estimated image generation part of the image coding apparatus which concerns on Embodiment 2. FIG. 実施形態2に係る画像復号装置における動き補償部がBIOパディングを実行する領域を示す図である。It is a figure which shows the area | region where the motion compensation part in the image decoding apparatus which concerns on Embodiment 2 performs BIO padding. 実施形態2に係る画像復号装置における動き補償部がBIOパディングを実行する領域を示す図である。It is a figure which shows the area | region where the motion compensation part in the image decoding apparatus which concerns on Embodiment 2 performs BIO padding. 隣接するブロックにおける動きベクトルを示す図である。It is a figure which shows the motion vector in an adjacent block. 実施形態2に係る画像復号装置における動き補償部が水平方向におけるBIOパディングを禁止するか否かを判定する処理の流れの一例を示すフローチャートである。12 is a flowchart illustrating an example of a flow of processing in which the motion compensation unit in the image decoding device according to the second embodiment determines whether to prohibit BIO padding in the horizontal direction. 実施形態2に係る画像復号装置における動き補償部が垂直方向におけるBIOパディングを禁止するか否かを判定する処理の流れの一例を示すフローチャートである。10 is a flowchart illustrating an example of a flow of processing for determining whether or not the motion compensation unit in the image decoding device according to the second embodiment prohibits BIO padding in the vertical direction. 実施形態2に係る画像復号装置における動き補償部が水平方向又は垂直方向におけるBIOパディングを禁止するか否かを判定する処理の流れの一例を示すフローチャートである。12 is a flowchart illustrating an example of a flow of processing for determining whether or not the motion compensation unit in the image decoding device according to the second embodiment prohibits BIO padding in the horizontal direction or the vertical direction. 実施形態2に係る画像復号装置における動き補償部がBIOモードを用いる場合に参照する対応ブロックの概略図である。It is the schematic of the corresponding block referred when the motion compensation part in the image decoding apparatus which concerns on Embodiment 2 uses BIO mode. 実施形態3に係る画像復号装置の動きベクトル復号処理の動作を示すフローチャートである。14 is a flowchart illustrating an operation of motion vector decoding processing of the image decoding apparatus according to the third embodiment. 実施形態3に係る画像符号化装置のインター予測パラメータ符号化部の構成を示すブロック図である。It is a block diagram which shows the structure of the inter prediction parameter encoding part of the image coding apparatus which concerns on Embodiment 3. FIG. 実施形態3に係るインター予測パラメータ復号部の構成を示すブロック図である。It is a block diagram which shows the structure of the inter prediction parameter decoding part which concerns on Embodiment 3. FIG. 動きベクトルを予測する対象であるPU(横幅nPbW)を構成する各サブブロックの動きベクトルspMvLX[xi][yj]を導出する例を示す図である。It is a figure which shows the example which derives | leads-out the motion vector spMvLX [xi] [yj] of each subblock which comprises PU (horizontal width nPbW) which is the object which estimates a motion vector. (a)は、バイラテラルマッチング(Bilateral matching)について説明するための図である。(b)は、テンプレートマッチング(Template matching)について説明するための図である。(A) is a figure for demonstrating bilateral matching (Bilateral (matching) matching). (B) is a figure for demonstrating template matching (Template | matching). AMVPモード及びマージモードにおける制御点の動きベクトルの導出のために利用される予測ユニットの位置の例を示す図である。It is a figure which shows the example of the position of the prediction unit utilized for derivation | leading-out of the motion vector of the control point in AMVP mode and merge mode. 動きベクトルを予測する対象である対象ブロック(横幅W、高さH)の制御点V0が左上頂点に位置する、一辺がBWの正方形のサブブロックの例を示す図である。It is a figure which shows the example of the subblock of a square with one side BW in which the control point V0 of the object block (horizontal width W, height H) which is an object which predicts a motion vector is located in an upper left vertex. サブブロックサイズ決定フローの概要を示すフローチャート図である。It is a flowchart figure which shows the outline | summary of a subblock size determination flow. 実施形態4に係る画像符号化装置の構成を示すブロック図である。It is a block diagram which shows the structure of the image coding apparatus which concerns on Embodiment 4. 実施形態4に係る画像復号装置の構成を示すブロック図である。It is a block diagram which shows the structure of the image decoding apparatus which concerns on Embodiment 4. 実施形態4に係る画像符号化装置のインター予測パラメータ符号化部の構成を示すブロック図である。It is a block diagram which shows the structure of the inter prediction parameter encoding part of the image coding apparatus which concerns on Embodiment 4. FIG. 実施形態4に係るインター予測パラメータ復号部の構成を示すブロック図である。It is a block diagram which shows the structure of the inter prediction parameter decoding part which concerns on Embodiment 4. FIG. 動き予測モード決定フローの概要を示すフローチャート図である。It is a flowchart figure which shows the outline | summary of a motion prediction mode determination flow. 動き予測モード決定フローの流れを示すシーケンス図である。It is a sequence diagram which shows the flow of a motion prediction mode determination flow. パターンマッチベクトル導出処理の流れを示すフローチャート図である。It is a flowchart figure which shows the flow of a pattern match vector derivation process. (a)及び(b)は、動き探索パターンを説明するための図である。(A) And (b) is a figure for demonstrating a motion search pattern. 予測画像を生成するか否かを決定するフローの概要を示すフローチャート図である。It is a flowchart figure which shows the outline | summary of the flow which determines whether a prediction image is produced | generated. 予測画像を生成するか否かを決定するフローの概要を示すフローチャート図である。It is a flowchart figure which shows the outline | summary of the flow which determines whether a prediction image is produced | generated. 画像符号化装置を搭載した送信装置、及び、画像復号装置を搭載した受信装置の構成について示した図である。(a)は、画像符号化装置を搭載した送信装置を示しており、(b)は、画像復号装置を搭載した受信装置を示している。It is the figure shown about the structure of the transmitter which mounts an image coding apparatus, and the receiver which mounts an image decoding apparatus. (A) shows a transmission device equipped with an image encoding device, and (b) shows a reception device equipped with an image decoding device. 画像符号化装置を搭載した記録装置、及び、画像復号装置を搭載した再生装置の構成について示した図である。(a)は、画像符号化装置を搭載した記録装置を示しており、(b)は、画像復号装置を搭載した再生装置を示している。It is the figure shown about the structure of the recording device carrying an image coding apparatus, and the reproducing | regenerating apparatus carrying an image decoding apparatus. (A) shows a recording device equipped with an image encoding device, and (b) shows a playback device equipped with an image decoding device. 画像伝送システムの構成を示す概略図である。It is the schematic which shows the structure of an image transmission system.
 〔実施形態1〕
 以下、図面を参照しながら本発明の実施形態について説明する。
Embodiment 1
Hereinafter, embodiments of the present invention will be described with reference to the drawings.
 図52は、実施形態1に係る画像伝送システム1の構成を示す概略図である。 FIG. 52 is a schematic diagram illustrating a configuration of the image transmission system 1 according to the first embodiment.
 画像伝送システム1は、符号化対象画像を符号化した符号を伝送し、伝送された符号を復号し画像を表示するシステムである。画像伝送システム1は、画像符号化装置(動画像符号化装置)11、ネットワーク21、画像復号装置(動画像復号装置)31及び画像表示装置41を含んで構成される。 The image transmission system 1 is a system that transmits a code obtained by encoding an encoding target image, decodes the transmitted code, and displays an image. The image transmission system 1 includes an image encoding device (moving image encoding device) 11, a network 21, an image decoding device (moving image decoding device) 31, and an image display device 41.
 画像符号化装置11には、単一レイヤ又は複数レイヤの画像を示す画像Tが入力される。レイヤとは、ある時間を構成するピクチャが1つ以上ある場合に、複数のピクチャを区別するために用いられる概念である。例えば、同一ピクチャを、画質又は解像度の異なる複数のレイヤによって符号化するとスケーラブル符号化になり、異なる視点のピクチャを複数のレイヤによって符号化するとビュースケーラブル符号化となる。複数のレイヤのピクチャ間で予測(インターレイヤ予測、インタービュー予測)を行う場合には、符号化効率が大きく向上する。また予測を行わない場合(サイマルキャスト)の場合にも、符号化データをまとめることができる。 The image encoding device 11 receives an image T indicating a single layer image or a plurality of layers. A layer is a concept used to distinguish a plurality of pictures when there are one or more pictures constituting a certain time. For example, when the same picture is encoded by a plurality of layers having different image quality or resolution, scalable encoding is performed, and when a picture of a different viewpoint is encoded by a plurality of layers, view scalable encoding is performed. When prediction is performed between pictures of a plurality of layers (inter-layer prediction, inter-view prediction), encoding efficiency is greatly improved. Further, even when prediction is not performed (simultaneous casting), encoded data can be collected.
 ネットワーク21は、画像符号化装置11が生成した符号化ストリームTeを画像復号装置31に伝送する。ネットワーク21は、インターネット(internet)、広域ネットワーク(WAN:Wide Area Network)、小規模ネットワーク(LAN:Local Area Network)又はこれらの組み合わせである。ネットワーク21は、必ずしも双方向の通信網に限らず、地上デジタル放送、衛星放送等の放送波を伝送する一方向の通信網であってもよい。また、ネットワーク21は、DVD(Digital Versatile Disc)、BD(Blue-ray Disc)等の符号化ストリームTeを記録した記憶媒体によって代替されてもよい。 The network 21 transmits the encoded stream Te generated by the image encoding device 11 to the image decoding device 31. The network 21 is the Internet, a wide area network (WAN: Wide Area Network), a small network (LAN: Local Area Network), or a combination thereof. The network 21 is not necessarily limited to a bidirectional communication network, and may be a one-way communication network that transmits broadcast waves such as terrestrial digital broadcast and satellite broadcast. The network 21 may be replaced by a storage medium that records an encoded stream Te such as a DVD (Digital Versatile Disc) or a BD (Blue-ray Disc).
 画像復号装置31は、ネットワーク21が伝送した符号化ストリームTeのそれぞれを復号し、それぞれ復号した1又は複数の復号画像Tdを生成する。 The image decoding device 31 decodes each of the encoded streams Te transmitted by the network 21, and generates one or a plurality of decoded images Td decoded.
 画像表示装置41は、画像復号装置31が生成した1又は複数の復号画像Tdの全部又は一部を表示する。画像表示装置41は、例えば、液晶ディスプレイ又は有機EL(Electro-luminescence)ディスプレイ等の表示デバイスを備える。また、空間スケーラブル符号化及びSNRスケーラブル符号化では、画像復号装置31及び画像表示装置41が高い処理能力を有する場合には、画質の高い拡張レイヤ画像を表示する。より低い処理能力しか有しない場合には、拡張レイヤほど高い処理能力及び表示能力を必要としないベースレイヤ画像を表示する。 The image display device 41 displays all or part of one or a plurality of decoded images Td generated by the image decoding device 31. The image display device 41 includes a display device such as a liquid crystal display or an organic EL (Electro-luminescence) display. Further, in spatial scalable coding and SNR scalable coding, when the image decoding device 31 and the image display device 41 have high processing capability, an enhancement layer image with high image quality is displayed. When the processing capability is lower, the base layer image that does not require higher processing capability and display capability is displayed as the enhancement layer.
 <演算子>
 本明細書において用いる演算子を以下に記載する。
<Operator>
The operators used in this specification are described below.
 >>は右ビットシフト、<<は左ビットシフト、&はビットワイズAND、|はビットワイズOR、|=はOR代入演算子である。 >> is right bit shift, << is left bit shift, & is bitwise AND, | is bitwise OR, | = is OR assignment operator.
 x ? y : zは、xが真(0以外)の場合にy、xが偽(0)の場合にzをとる3項演算子である。 X? Y: z is a ternary operator that takes y when x is true (non-zero) and takes z when x is false (0).
 Clip3(a, b, c) は、cをa以上b以下の値にクリップする関数であり、c<aの場合にはaを返し、c>bの場合にはbを返し、その他の場合にはcを返す関数である(ただし、a<=b)。 Clip3 (a, b, c) is a function that clips c to a value between a and b, but returns a if c <a, returns b if c> b, otherwise Is a function that returns c (where a <= b).
 <符号化ストリームTeの構造>
 実施形態1に係る画像符号化装置11及び画像復号装置31の詳細な説明に先立って、画像符号化装置11によって生成され、画像復号装置31によって復号される符号化ストリームTeのデータ構造について説明する。
<Structure of encoded stream Te>
Prior to detailed description of the image encoding device 11 and the image decoding device 31 according to the first embodiment, a data structure of an encoded stream Te generated by the image encoding device 11 and decoded by the image decoding device 31 will be described. .
 図1は、符号化ストリームTeにおけるデータの階層構造を示す図である。符号化ストリームTeは、例示的に、シーケンス、及びシーケンスを構成する複数のピクチャを含む。図1の(a)~(f)は、それぞれ、シーケンスSEQを既定する符号化ビデオシーケンス、ピクチャPICTを規定する符号化ピクチャ、スライスSを規定する符号化スライス、スライスデータを規定する符号化スライスデータ、符号化スライスデータに含まれる符号化ツリーユニット、及び、符号化ツリーユニットに含まれる符号化ユニット(Coding Unit;CU)を示す図である。 FIG. 1 is a diagram showing a hierarchical structure of data in the encoded stream Te. The encoded stream Te illustratively includes a sequence and a plurality of pictures constituting the sequence. (A) to (f) of FIG. 1 respectively show an encoded video sequence defining a sequence SEQ, an encoded picture defining a picture PICT, an encoded slice defining a slice S, and an encoded slice defining a slice data It is a figure which shows the coding unit (Coding | unit: CU) contained in the coding tree unit contained in data, coding slice data, and a coding tree unit.
 (符号化ビデオシーケンス)
 符号化ビデオシーケンスでは、処理対象のシーケンスSEQを復号するために画像復号装置31が参照するデータの集合が規定されている。シーケンスSEQは、図1の(a)に示すように、ビデオパラメータセット(Video Parameter Set)、シーケンスパラメータセットSPS(Sequence Parameter Set)、ピクチャパラメータセットPPS(Picture Parameter Set)、ピクチャPICT、及び、付加拡張情報SEI(Supplemental Enhancement Information)を含んでいる。ここで#の後に示される値はレイヤIDを示す。図1では、#0と#1すなわちレイヤ0及びレイヤ1の符号化データが存在する例を示すが、レイヤの種類及びレイヤの数はこれによらない。
(Encoded video sequence)
In the encoded video sequence, a set of data referred to by the image decoding device 31 for decoding the sequence SEQ to be processed is defined. As shown in FIG. 1A, the sequence SEQ includes a video parameter set (Video Parameter Set), a sequence parameter set SPS (Sequence Parameter Set), a picture parameter set PPS (Picture Parameter Set), a picture PICT, and an addition. Includes SEI (Supplemental Enhancement Information). Here, the value indicated after # indicates the layer ID. FIG. 1 shows an example in which encoded data of # 0 and # 1, that is, layer 0 and layer 1, exists, but the type of layer and the number of layers are not dependent on this.
 ビデオパラメータセットVPSは、複数のレイヤから構成されている動画像において、複数の動画像に共通する符号化パラメータの集合及び動画像に含まれる複数のレイヤ及び個々のレイヤに関連する符号化パラメータの集合が規定されている。 The video parameter set VPS is a set of coding parameters common to a plurality of moving images, a plurality of layers included in the moving image, and coding parameters related to individual layers in a moving image composed of a plurality of layers. A set is defined.
 シーケンスパラメータセットSPSでは、対象シーケンスを復号するために画像復号装置31が参照する符号化パラメータの集合が規定されている。例えば、ピクチャの幅や高さが規定される。なお、SPSは複数存在してもよい。その場合、PPSから複数のSPSの何れかを選択する。 The sequence parameter set SPS defines a set of encoding parameters that the image decoding device 31 refers to in order to decode the target sequence. For example, the width and height of the picture are defined. A plurality of SPSs may exist. In that case, one of a plurality of SPSs is selected from the PPS.
 ピクチャパラメータセットPPSでは、対象シーケンス内の各ピクチャを復号するために画像復号装置31が参照する符号化パラメータの集合が規定されている。例えば、ピクチャの復号に用いられる量子化幅の基準値(pic_init_qp_minus26)及び重み付き予測の適用を示すフラグ(weighted_pred_flag)が含まれる。なお、PPSは複数存在してもよい。その場合、対象シーケンス内の各ピクチャから複数のPPSの何れかを選択する。 In the picture parameter set PPS, a set of encoding parameters referred to by the image decoding device 31 in order to decode each picture in the target sequence is defined. For example, a reference value (pic_init_qp_minus26) of a quantization width used for picture decoding and a flag (weighted_pred_flag) indicating application of weighted prediction are included. There may be a plurality of PPSs. In that case, one of a plurality of PPSs is selected from each picture in the target sequence.
 (符号化ピクチャ)
 符号化ピクチャでは、処理対象のピクチャPICTを復号するために画像復号装置31が参照するデータの集合が規定されている。ピクチャPICTは、図1の(b)に示すように、スライスS0~SNS-1を含んでいる(NSはピクチャPICTに含まれるスライスの総数)。
(Encoded picture)
In the coded picture, a set of data referred to by the image decoding device 31 in order to decode the picture PICT to be processed is defined. As shown in FIG. 1B, the picture PICT includes slices S0 to S NS-1 (NS is the total number of slices included in the picture PICT).
 なお、以下、スライスS0~SNS-1のそれぞれを区別する必要が無い場合、符号の添え字を省略して記述することがある。また、以下に説明する符号化ストリームTeに含まれるデータであって、添え字を付している他のデータについても同様である。 In the following description, if it is not necessary to distinguish each of the slices S0 to SNS-1 , the subscripts may be omitted. The same applies to data included in an encoded stream Te described below and to which other subscripts are attached.
 (符号化スライス)
 符号化スライスでは、処理対象のスライスSを復号するために画像復号装置31が参照するデータの集合が規定されている。スライスSは、図1の(c)に示すように、スライスヘッダSH、及び、スライスデータSDATAを含んでいる。
(Encoded slice)
In the coded slice, a set of data referred to by the image decoding device 31 for decoding the slice S to be processed is defined. As shown in FIG. 1C, the slice S includes a slice header SH and slice data SDATA.
 スライスヘッダSHには、対象スライスの復号方法を決定するために画像復号装置31が参照する符号化パラメータ群が含まれる。スライスタイプを指定するスライスタイプ指定情報(slice_type)は、スライスヘッダSHに含まれる符号化パラメータの一例である。 The slice header SH includes an encoding parameter group that is referred to by the image decoding device 31 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には、上記符号化ビデオシーケンスに含まれる、ピクチャパラメータセットPPSへの参照(pic_parameter_set_id)を含んでいてもよい。 Note that the slice header SH may include a reference (pic_parameter_set_id) to the picture parameter set PPS included in the encoded video sequence.
 (符号化スライスデータ)
 符号化スライスデータでは、処理対象のスライスデータSDATAを復号するために画像復号装置31が参照するデータの集合が規定されている。スライスデータSDATAは、図1の(d)に示すように、符号化ツリーユニット(CTU:Coding Tree Unit)を含んでいる。CTUは、スライスを構成する固定サイズ(例えば64x64)のブロックであり、最大符号化単位(LCU:Largest Coding Unit)と呼ぶこともある。
(Encoded slice data)
In the encoded slice data, a set of data referred to by the image decoding device 31 for decoding the slice data SDATA to be processed is defined. The slice data SDATA includes a coding tree unit (CTU) as shown in FIG. A CTU is a block of a fixed size (for example, 64x64) that constitutes a slice, and is sometimes called a maximum coding unit (LCU: Large Coding Unit).
 (符号化ツリーユニット)
 図1の(e)に示すように、処理対象の符号化ツリーユニットを復号するために画像復号装置31が参照するデータの集合が規定されている。符号化ツリーユニットは、再帰的な4分木分割により分割される。再帰的な4分木分割により得られる木構造のノードのことを符号化ノード(CN:Coding Node)と称する。4分木の中間ノードは、符号化ノードであり、符号化ツリーユニット自身も最上位の符号化ノードとして規定される。CTUは、分割フラグ(cu_split_flag)を含み、cu_split_flagが1の場合には、4つの符号化ノードCNに分割される。cu_split_flagが0の場合には、符号化ノードCNは分割されず、1つの符号化ユニット(CU:Coding Unit)をノードとして持つ。符号化ユニットCUは符号化ノードの末端ノードであり、これ以上分割されない。符号化ユニットCUは、符号化処理の基本的な単位となる。
(Encoding tree unit)
As shown in (e) of FIG. 1, a set of data referred to by the image decoding device 31 in order to decode the encoding tree unit to be processed is defined. The coding tree unit is divided by recursive quadtree division. A tree-structured node obtained by recursive quadtree partitioning is referred to as a coding node (CN). An intermediate node of the quadtree is an encoding node, and the encoding tree unit itself is defined as the highest encoding node. The CTU includes a split flag (cu_split_flag), and when cu_split_flag is 1, it is split into four coding nodes CN. When cu_split_flag is 0, the coding node CN is not divided and has one coding unit (CU: Coding Unit) as a node. The encoding unit CU is a terminal node of the encoding node and is not further divided. The encoding unit CU is a basic unit of the encoding process.
 また、符号化ツリーユニットCTUのサイズが64x64画素の場合には、符号化ユニットのサイズは、64x64画素、32x32画素、16x16画素、及び、8x8画素の何れかをとり得る。 In addition, when the size of the coding tree unit CTU is 64 × 64 pixels, the size of the coding unit can be any of 64 × 64 pixels, 32 × 32 pixels, 16 × 16 pixels, and 8 × 8 pixels.
 (符号化ユニット)
 図1の(f)に示すように、処理対象の符号化ユニットを復号するために画像復号装置31が参照するデータの集合が規定されている。具体的には、符号化ユニットは、予測ツリー、変換ツリー、及び、CUヘッダCUHから構成される。CUヘッダでは予測モード、及び、分割方法(PU分割モード)等が規定される。
(Encoding unit)
As shown in (f) of FIG. 1, a set of data referred to by the image decoding device 31 in order to decode an encoding unit to be processed is defined. Specifically, the encoding unit includes a prediction tree, a conversion tree, and a CU header CUH. In the CU header, a prediction mode, a division method (PU division mode), and the like are defined.
 予測ツリーでは、符号化ユニットを1又は複数に分割した各予測ユニット(PU)の予測情報(参照ピクチャインデックス及び動きベクトル等)が規定される。別の表現でいえば、予測ユニットは、符号化ユニットを構成する1又は複数の重複しない領域である。また、予測ツリーは、上述の分割により得られた1又は複数の予測ユニットを含む。なお、以下では、予測ユニットを更に分割した予測単位を「サブブロック」と呼ぶ。サブブロックは、複数の画素によって構成されている。予測ユニットとサブブロックのサイズが等しい場合には、予測ユニット中のサブブロックは1つである。予測ユニットがサブブロックのサイズよりも大きい場合には、予測ユニットは、サブブロックに分割される。例えば予測ユニットが8x8、サブブロックが4x4の場合には、予測ユニットは水平に2分割、垂直に2分割からなる、4つのサブブロックに分割される。 In the prediction tree, prediction information (a reference picture index, a motion vector, etc.) of each prediction unit (PU) obtained by dividing the coding unit into one or a plurality of parts is defined. In other words, the prediction unit is one or a plurality of non-overlapping areas constituting the encoding unit. The prediction tree includes one or a plurality of prediction units obtained by the above-described division. Hereinafter, a prediction unit obtained by further dividing the prediction unit is referred to as a “sub-block”. The sub block is composed of a plurality of pixels. When the sizes of the prediction unit and the sub-block are equal, the number of sub-blocks in the prediction unit is one. If the prediction unit is larger than the size of the sub-block, the prediction unit is divided into sub-blocks. For example, when the prediction unit is 8x8 and the sub-block is 4x4, the prediction unit is divided into four sub-blocks that are horizontally divided into two and vertically divided into two.
 予測処理は、この予測ユニット(サブブロック)毎に行ってもよい。 The prediction process may be performed for each prediction unit (sub block).
 予測ツリーにおける分割の種類は、大まかにいえば、イントラ予測の場合と、インター予測の場合との2つがある。イントラ予測とは、同一ピクチャ内の予測であり、インター予測とは、互いに異なるピクチャ間(例えば、表示時刻間又はレイヤ画像間)で行われる予測処理を指す。 There are roughly two types of division in the prediction tree: intra prediction and inter prediction. Intra prediction is prediction within the same picture, and inter prediction refers to prediction processing performed between different pictures (for example, between display times or between layer images).
 イントラ予測の場合、分割方法は、2Nx2N(符号化ユニットと同一サイズ)と、NxNとがある。 In the case of intra prediction, there are 2Nx2N (the same size as the encoding unit) and NxN division methods.
 また、インター予測の場合、分割方法は、符号化データのPU分割モード(part_mode)により符号化され、2Nx2N(符号化ユニットと同一サイズ)、2NxN、2NxnU、2NxnD、Nx2N、nLx2N、nRx2N、及び、NxN等がある。なお、2NxN及びNx2Nは1:1の対称分割を示し、2NxnU、2NxnD、nLx2N及びnRx2Nは、1:3又は3:1の非対称分割を示す。CUに含まれるPUを順にPU0、PU1、PU2、PU3と表現する。 Also, in the case of inter prediction, the division method is encoded by the PU division mode (part_mode) of encoded data, and 2Nx2N (the same size as the encoding unit), 2NxN, 2NxnU, 2NxnD, Nx2N, nLx2N, nRx2N, and NxN etc. 2NxN and Nx2N indicate 1: 1 symmetrical division, and 2NxnU, 2NxnD, nLx2N, and nRx2N indicate 1: 3 or 3: 1 asymmetric division. The PUs included in the CU are expressed as PU0, PU1, PU2, and PU3 in this order.
 図2の(a)~(h)に、それぞれのPU分割モードにおけるパーティションの形状(PU分割の境界の位置)を具体的に図示している。図2の(a)は、2Nx2Nのパーティションを示し、(b)、(c)、(d)は、それぞれ、2NxN、2NxnU、及び、2NxnDのパーティション(横長パーティション)を示す。(e)、(f)、(g)は、それぞれ、Nx2N、nLx2N及びnRx2Nである場合のパーティション(縦長パーティション)を示し、(h)は、NxNのパーティションを示す。なお、横長パーティションと縦長パーティションを総称して長方形パーティション、2Nx2N及びNxNを総称して正方形パーティションと呼ぶ。 (A) to (h) of FIG. 2 specifically illustrate the shape of the partition (the position of the boundary of the PU partition) in each PU partition mode. 2A shows a 2Nx2N partition, and FIGS. 2B, 2C, and 2D show 2NxN, 2NxnU, and 2NxnD partitions (horizontal partitions), respectively. (E), (f), and (g) show partitions (vertical partitions) in the case of Nx2N, nLx2N, and nRx2N, respectively, and (h) shows an NxN partition. The horizontal and vertical partitions are collectively referred to as a rectangular partition, and 2Nx2N and NxN are collectively referred to as a square partition.
 また、変換ツリーにおいては、符号化ユニットが1又は複数の変換ユニットに分割され、各変換ユニットの位置とサイズとが規定される。別の表現でいえば、変換ユニットは、符号化ユニットを構成する1又は複数の重複しない領域のことである。また、変換ツリーは、上述の分割より得られた1又は複数の変換ユニットを含む。 In the conversion tree, the encoding unit is divided into one or a plurality of conversion units, and the position and size of each conversion unit are defined. In other words, the transform unit is one or a plurality of non-overlapping areas constituting the encoding unit. The conversion tree includes one or a plurality of conversion units obtained by the above division.
 変換ツリーにおける分割には、符号化ユニットと同一のサイズの領域を変換ユニットとして割り付けるものと、上述したCUの分割と同様、再帰的な4分木分割によるものがある。 The division in the conversion tree includes a case where an area having the same size as that of the encoding unit is assigned as a conversion unit, and a case where recursive quadtree division is used, as in the case of the CU division described above.
 変換処理は、この変換ユニット毎に行われる。 Conversion processing is performed for each conversion unit.
 (予測パラメータ)
 予測ユニット(PU:Prediction Unit)の予測画像は、PUに付随する予測パラメータによって導出される。予測パラメータには、イントラ予測の予測パラメータ若しくはインター予測の予測パラメータがある。以下、インター予測の予測パラメータ(インター予測パラメータ)について説明する。インター予測パラメータは、予測リスト利用フラグpredFlagL0、predFlagL1と、参照ピクチャインデックスrefIdxL0、refIdxL1と、動きベクトルmvL0、mvL1から構成される。予測リスト利用フラグpredFlagL0、predFlagL1は、各々L0リスト、L1リストと呼ばれる参照ピクチャリストが用いられるか否かを示すフラグであり、値が1の場合に対応する参照ピクチャリストが用いられる。なお、本明細書中「XXであるか否かを示すフラグ」と記す場合、フラグが0以外(例えば1)をXXである場合、0をXXではない場合とし、論理否定、論理積等では1を真、0を偽と扱う(以下同様)。但し、実際の装置及び方法では真値、偽値として他の値を用いることもできる。
(Prediction parameter)
A prediction image of a prediction unit (PU: Prediction Unit) is derived from a prediction parameter associated with the PU. The prediction parameters include a prediction parameter for intra prediction or a prediction parameter for inter prediction. Hereinafter, prediction parameters for inter prediction (inter prediction parameters) will be described. The inter prediction parameter includes prediction list use flags predFlagL0 and predFlagL1, reference picture indexes refIdxL0 and refIdxL1, and motion vectors mvL0 and mvL1. The prediction list use flags predFlagL0 and predFlagL1 are flags indicating whether or not reference picture lists called L0 list and L1 list are used, respectively, and a reference picture list corresponding to a value of 1 is used. In this specification, when “flag indicating whether or not it is XX” is described, when the flag is other than 0 (for example, 1) is XX, 0 is not XX, and logical negation, logical product, etc. 1 is treated as true and 0 is treated as false (the same applies hereinafter). However, in the actual apparatus and method, other values can be used as true values and false values.
 符号化データに含まれるインター予測パラメータを導出するためのシンタックス要素には、例えば、PU分割モードpart_mode、マージフラグmerge_flag、マージインデックスmerge_idx、インター予測識別子inter_pred_idc、参照ピクチャインデックスrefIdxLX、予測ベクトルインデックスmvp_LX_idx、及び、差分ベクトルmvdLXがある。 Syntax elements for deriving inter prediction parameters included in the encoded data include, for example, PU partition mode part_mode, merge flag merge_flag, merge index merge_idx, inter prediction identifier inter_pred_idc, reference picture index refIdxLX, prediction vector index mvp_LX_idx, And there is a difference vector mvdLX.
 (参照ピクチャリスト)
 参照ピクチャリストは、参照ピクチャメモリ306に記憶された参照ピクチャからなるリストである。図3は、参照ピクチャ及び参照ピクチャリストの一例を示す概念図である。図3(a)において、矩形はピクチャ、矢印はピクチャの参照関係、横軸は時間、矩形中のI、P及びBは各々イントラピクチャ、単予測ピクチャ及び双予測ピクチャ、矩形中の数字は復号順を示す。図に示すように、ピクチャの復号順は、I0、P1、B2、B3、B4であり、表示順は、I0、B3、B2、B4、P1である。図3(b)に、参照ピクチャリストの例を示す。参照ピクチャリストは、参照ピクチャの候補を表すリストであり、1つのピクチャ(スライス)が1つ以上の参照ピクチャリストを有してもよい。図の例では、対象ピクチャB3は、L0リストRefPicList0及びL1リストRefPicList1の2つの参照ピクチャリストを持つ。対象ピクチャがB3の場合の参照ピクチャは、I0、P1及びB2であり、参照ピクチャはこれらのピクチャを要素として持つ。個々の予測ユニットでは、参照ピクチャリストRefPicListX中のどのピクチャを実際に参照するか否かを参照ピクチャインデックスrefIdxLXによって指定する。図では、refIdxL0及びrefIdxL1により参照ピクチャP1とB2が参照される例を示す。
(Reference picture list)
The reference picture list is a list including reference pictures stored in the reference picture memory 306. FIG. 3 is a conceptual diagram illustrating an example of a reference picture and a reference picture list. In FIG. 3A, a rectangle is a picture, an arrow is a picture reference relationship, a horizontal axis is time, I, P and B in the rectangle are intra pictures, uni-prediction pictures and bi-prediction pictures, respectively, and numbers in the rectangles are decoded Show the order. As shown in the figure, the decoding order of pictures is I0, P1, B2, B3, and B4, and the display order is I0, B3, B2, B4, and P1. FIG. 3B shows an example of the reference picture list. The reference picture list is a list representing candidate reference pictures, and one picture (slice) may have one or more reference picture lists. In the illustrated example, the target picture B3 has two reference picture lists, an L0 list RefPicList0 and an L1 list RefPicList1. The reference pictures when the target picture is B3 are I0, P1, and B2, and the reference picture has these pictures as elements. In each prediction unit, which picture in the reference picture list RefPicListX is actually referred to is specified by the reference picture index refIdxLX. The figure shows an example in which reference pictures P1 and B2 are referred to by refIdxL0 and refIdxL1.
 (マージ予測とAMVP予測)
 予測パラメータの復号(符号化)方法には、マージ予測(merge)モード及びAMVP(Adaptive Motion Vector Prediction、適応動きベクトル予測)モードがある、マージフラグmerge_flagは、これらを識別するためのフラグである。マージ予測モードは、予測リスト利用フラグpredFlagLX(又はインター予測識別子inter_pred_idc)、参照ピクチャインデックスrefIdxLX及び動きベクトルmvLXを符号化データに含めずに、既に処理した近傍PUの予測パラメータから導出する用いるモードであり、AMVPモードは、インター予測識別子inter_pred_idc、参照ピクチャインデックスrefIdxLX、動きベクトルmvLXを符号化データに含めるモードである。なお、動きベクトルmvLXは、予測ベクトルmvpLXを識別する予測ベクトルインデックスmvp_LX_idxと差分ベクトルmvdLXとして符号化される。
(Merge prediction and AMVP prediction)
The prediction parameter decoding (encoding) method includes a merge prediction (merge) mode and an AMVP (Adaptive Motion Vector Prediction) mode. The merge flag merge_flag is a flag for identifying these. The merge prediction mode is a mode in which the prediction list usage flag predFlagLX (or inter prediction identifier inter_pred_idc), the reference picture index refIdxLX, and the motion vector mvLX are not included in the encoded data and are derived from the prediction parameters of already processed neighboring PUs. The AMVP mode is a mode in which the inter prediction identifier inter_pred_idc, the reference picture index refIdxLX, and the motion vector mvLX are included in the encoded data. The motion vector mvLX is encoded as a prediction vector index mvp_LX_idx for identifying the prediction vector mvpLX and a difference vector mvdLX.
 インター予測識別子inter_pred_idcは、参照ピクチャの種類及び数を示す値であり、PRED_L0、PRED_L1、PRED_BIの何れかの値をとる。PRED_L0、PRED_L1は、各々L0リスト、L1リストの参照ピクチャリストにおいて管理された参照ピクチャを用いることを示し、1枚の参照ピクチャ(第1の参照ピクチャ)を用いること(単予測モード)を示す。PRED_BIは2枚の参照ピクチャ(第1の参照ピクチャ及び第2の参照ピクチャ)を用いること(双予測BiPredモード)を示し、L0リストとL1リストにおいて管理された参照ピクチャを用いる。予測ベクトルインデックスmvp_LX_idxは予測ベクトルを示すインデックスであり、参照ピクチャインデックスrefIdxLXは、参照ピクチャリストにおいて管理された参照ピクチャを示すインデックスである。なお、LXは、L0予測とL1予測を区別しない場合に用いられる記述方法であり、LXをL0又はL1に置き換えることでL0リストに対するパラメータとL1リストに対するパラメータを区別する。 The inter prediction identifier inter_pred_idc is a value indicating the type and number of reference pictures, and takes one of PRED_L0, PRED_L1, and PRED_BI. PRED_L0 and PRED_L1 indicate that reference pictures managed in the reference picture lists of the L0 list and the L1 list are used, respectively, and that one reference picture (first reference picture) is used (single prediction mode). PRED_BI indicates that two reference pictures (first reference picture and second reference picture) are used (bi-prediction BiPred mode), and reference pictures managed in the L0 list and the L1 list are used. The prediction vector index mvp_LX_idx is an index indicating a prediction vector, and the reference picture index refIdxLX is an index indicating a reference picture managed in the reference picture list. Note that LX is a description method used when L0 prediction and L1 prediction are not distinguished from each other. By replacing LX with L0 or L1, parameters for the L0 list and parameters for the L1 list are distinguished.
 マージインデックスmerge_idxは、処理が完了したPUから導出される予測パラメータ候補(マージ候補)のうち、何れかの予測パラメータを復号対象PUの予測パラメータとして用いるか否かを示すインデックスである。 The merge index merge_idx is an index indicating whether or not any prediction parameter is used as a prediction parameter of a decoding target PU among prediction parameter candidates (merge candidates) derived from a PU for which processing has been completed.
 (動きベクトル)
 動きベクトルmvLXは、異なる2つのピクチャ上のブロック間のずれ量を示す。動きベクトルmvLXに関する予測ベクトル、差分ベクトルを、それぞれ予測ベクトルmvpLX、差分ベクトルmvdLXと呼ぶ。
(Motion vector)
The motion vector mvLX indicates a shift amount between blocks on two different pictures. A prediction vector and a difference vector related to the motion vector mvLX are referred to as a prediction vector mvpLX and a difference vector mvdLX, respectively.
 (インター予測識別子inter_pred_idcと予測リスト利用フラグpredFlagLX)
 インター予測識別子inter_pred_idcと、予測リスト利用フラグpredFlagL0、predFlagL1の関係は以下のとおりであり、相互に変換可能である。
(Inter prediction identifier inter_pred_idc and prediction list use flag predFlagLX)
The relationship between the inter prediction identifier inter_pred_idc and the prediction list use flags predFlagL0 and predFlagL1 is as follows and can be converted into each other.
 inter_pred_idc = (predFlagL1<<1) + predFlagL0
 predFlagL0 = inter_pred_idc & 1
 predFlagL1 = inter_pred_idc >> 1
 なお、インター予測パラメータは、予測リスト利用フラグを用いてもよいし、インター予測識別子を用いてもよい。また、予測リスト利用フラグを用いた判定は、インター予測識別子を用いた判定に置き替えてもよい。逆に、インター予測識別子を用いた判定は、予測リスト利用フラグを用いた判定に置き替えてもよい。
inter_pred_idc = (predFlagL1 << 1) + predFlagL0
predFlagL0 = inter_pred_idc & 1
predFlagL1 = inter_pred_idc >> 1
Note that a prediction list use flag or an inter prediction identifier may be used as the inter prediction parameter. Further, the determination using the prediction list use flag may be replaced with the determination using the inter prediction identifier. Conversely, the determination using the inter prediction identifier may be replaced with the determination using the prediction list use flag.
 (双予測biPredモードの判定)
 双予測BiPredモードであるかのフラグbiPredは、2つの予測リスト利用フラグがともに1であるかによって導出できる。例えば以下の式によって導出できる。
(Determination of bi-prediction biPred mode)
The flag biPred as to whether it is in the bi-prediction BiPred mode can be derived based on whether both of the two prediction list use flags are 1. For example, it can be derived by the following equation.
 biPred = (predFlagL0 == 1 && predFlagL1 == 1)
 フラグbiPredは、インター予測識別子が2つの予測リスト(参照ピクチャ)を使うことを示す値であるか否かによっても導出できる。例えば以下の式によって導出できる。
biPred = (predFlagL0 == 1 && predFlagL1 == 1)
The flag biPred can also be derived depending on whether or not the inter prediction identifier is a value indicating that two prediction lists (reference pictures) are used. For example, it can be derived by the following equation.
 biPred = (inter_pred_idc == PRED_BI) ? 1 : 0
上記式は、以下の式でも表現できる。
biPred = (inter_pred_idc == PRED_BI)? 1: 0
The above formula can also be expressed by the following formula.
 biPred = (inter_pred_idc == PRED_BI)
 なお、PRED_BIは例えば3の値を用いることができる。
biPred = (inter_pred_idc == PRED_BI)
For example, a value of 3 can be used for PRED_BI.
 (画像復号装置の構成)
 次に、実施形態1に係る画像復号装置31の構成について説明する。図5は、実施形態1に係る画像復号装置31の構成を示すブロック図である。画像復号装置31は、エントロピー復号部301、予測パラメータ復号部302、ループフィルタ305、参照ピクチャメモリ306、予測パラメータメモリ307、予測画像生成部(予測画像生成装置)308、逆量子化・逆変換部311、及び加算部312を含んで構成される。
(Configuration of image decoding device)
Next, the configuration of the image decoding device 31 according to the first embodiment will be described. FIG. 5 is a block diagram illustrating a configuration of the image decoding device 31 according to the first embodiment. The image decoding device 31 includes an entropy decoding unit 301, a prediction parameter decoding unit 302, a loop filter 305, a reference picture memory 306, a prediction parameter memory 307, a prediction image generation unit (prediction image generation device) 308, and an inverse quantization / inverse conversion unit. 311 and an adder 312.
 また、予測パラメータ復号部302は、インター予測パラメータ復号部303及びイントラ予測パラメータ復号部304を含んで構成される。予測画像生成部308は、インター予測画像生成部309及びイントラ予測画像生成部310を含んで構成される。 The prediction parameter decoding unit 302 includes an inter prediction parameter decoding unit 303 and an intra prediction parameter decoding unit 304. The predicted image generation unit 308 includes an inter predicted image generation unit 309 and an intra predicted image generation unit 310.
 エントロピー復号部301は、外部から入力された符号化ストリームTeに対してエントロピー復号を行って、個々の符号(シンタックス要素)を分離し復号する。分離された符号には、予測画像を生成するための予測情報及び、差分画像を生成するための残差情報等がある。 The entropy decoding unit 301 performs entropy decoding on the coded stream Te input from the outside, and separates and decodes individual codes (syntax elements). The separated codes include prediction information for generating a prediction image, residual information for generating a difference image, and the like.
 エントロピー復号部301は、分離した符号の一部を予測パラメータ復号部302に出力する。分離した符号の一部とは、例えば、予測モードpredMode、PU分割モードpart_mode、マージフラグmerge_flag、マージインデックスmerge_idx、インター予測識別子inter_pred_idc、参照ピクチャインデックスrefIdxLX、予測ベクトルインデックスmvp_LX_idx及び差分ベクトルmvdLXである。どの符号を復号するかの制御は、予測パラメータ復号部302の指示に基づいて行われる。エントロピー復号部301は、量子化係数を逆量子化・逆変換部311に出力する。この量子化係数は、符号化処理において、残差信号に対してDCT(Discrete Cosine Transform:離散コサイン変換)、DST(Discrete Sine Transform:離散サイン変換)、又は、KLT(Karyhnen Loeve Transform:カルーネンレーベ変換)等の周波数変換を行い量子化して得られる係数である。 The entropy decoding unit 301 outputs a part of the separated code to the prediction parameter decoding unit 302. Some of the separated codes are, for example, the prediction mode predMode, the PU partition mode part_mode, the merge flag merge_flag, the merge index merge_idx, the inter prediction identifier inter_pred_idc, the reference picture index refIdxLX, the prediction vector index mvp_LX_idx, and the difference vector mvdLX. Control of which code is decoded is performed based on an instruction from the prediction parameter decoding unit 302. The entropy decoding unit 301 outputs the quantized coefficient to the inverse quantization / inverse transform unit 311. In the encoding process, this quantized coefficient is obtained by performing DCT (Discrete Cosine Transform), DST (Discrete Sine Transform), or KLT (Karyhnen Loeve Transform) in the encoding process. This is a coefficient obtained by performing frequency conversion such as conversion) and quantizing.
 インター予測パラメータ復号部303は、エントロピー復号部301から入力された符号に基づいて、予測パラメータメモリ307に記憶された予測パラメータを参照してインター予測パラメータを復号する。 The inter prediction parameter decoding unit 303 decodes the inter prediction parameter with reference to the prediction parameter stored in the prediction parameter memory 307 based on the code input from the entropy decoding unit 301.
 インター予測パラメータ復号部303は、復号したインター予測パラメータを予測画像生成部308に出力し、また予測パラメータメモリ307に記憶する。インター予測パラメータ復号部303の詳細については後述する。 The inter prediction parameter decoding unit 303 outputs the decoded inter prediction parameter to the prediction image generation unit 308 and stores it in the prediction parameter memory 307. Details of the inter prediction parameter decoding unit 303 will be described later.
 イントラ予測パラメータ復号部304は、エントロピー復号部301から入力された符号に基づいて、予測パラメータメモリ307に記憶された予測パラメータを参照してイントラ予測パラメータを復号する。イントラ予測パラメータとは、CUを1つのピクチャ内で予測する処理において用いられるパラメータ、例えば、イントラ予測モードIntraPredModeである。イントラ予測パラメータ復号部304は、復号したイントラ予測パラメータを予測画像生成部308に出力し、また予測パラメータメモリ307に記憶する。 The intra prediction parameter decoding unit 304 refers to the prediction parameter stored in the prediction parameter memory 307 on the basis of the code input from the entropy decoding unit 301 and decodes the intra prediction parameter. The intra prediction parameter is a parameter used in the process of predicting a CU within one picture, for example, an intra prediction mode IntraPredMode. The intra prediction parameter decoding unit 304 outputs the decoded intra prediction parameter to the prediction image generation unit 308 and stores it in the prediction parameter memory 307.
 イントラ予測パラメータ復号部304は、輝度と色差とで異なるイントラ予測モードを導出してもよい。この場合、イントラ予測パラメータ復号部304は、輝度の予測パラメータとして輝度予測モードIntraPredModeY、色差の予測パラメータとして、色差予測モードIntraPredModeCを復号する。輝度予測モードIntraPredModeYは、35モードであり、プレーナ予測(0)、DC予測(1)、方向予測(2~34)が対応する。色差予測モードIntraPredModeCは、プレーナ予測(0)、DC予測(1)、方向予測(2~34)、LMモード(35)の何れかを用いるものである。イントラ予測パラメータ復号部304は、IntraPredModeCは輝度モードと同じモードであるか否かを示すフラグを復号する。イントラ予測パラメータ復号部304は、フラグが輝度モードと同じモードであることを示せば、IntraPredModeCにIntraPredModeYを割り当てる。イントラ予測パラメータ復号部304は、フラグが輝度モードと異なるモードであることを示せば、IntraPredModeCとして、プレーナ予測(0)、DC予測(1)、方向予測(2~34)及びLMモード(35)を復号してもよい。 The intra prediction parameter decoding unit 304 may derive different intra prediction modes for luminance and color difference. In this case, the intra prediction parameter decoding unit 304 decodes the luminance prediction mode IntraPredModeY as the luminance prediction parameter and the color difference prediction mode IntraPredModeC as the color difference prediction parameter. The luminance prediction mode IntraPredModeY is a 35 mode, and corresponds to planar prediction (0), DC prediction (1), and direction prediction (2 to 34). The color difference prediction mode IntraPredModeC uses one of the planar prediction (0), the DC prediction (1), the direction prediction (2 to 34), and the LM mode (35). The intra prediction parameter decoding unit 304 decodes a flag indicating whether IntraPredModeC is the same mode as the luminance mode. The intra prediction parameter decoding unit 304 assigns IntraPredModeY to IntraPredModeC if it indicates that the flag is the same mode as the luminance mode. If the flag indicates that the flag is different from the luminance mode, the intra prediction parameter decoding unit 304 sets the Plane prediction (0), DC prediction (1), direction prediction (2 to 34), and LM mode (35) as IntraPredModeC. May be decrypted.
 ループフィルタ305は、加算部312が生成したCUの復号画像に対し、デブロッキングフィルタ、サンプル適応オフセット(SAO)、適応ループフィルタ(ALF)等のフィルタを施す。 The loop filter 305 applies filters such as a deblocking filter, a sample adaptive offset (SAO), and an adaptive loop filter (ALF) to the decoded image of the CU generated by the adding unit 312.
 参照ピクチャメモリ306は、加算部312が生成したCUの復号画像を、復号対象のピクチャ及びCU毎に予め定めた位置に記憶する。 The reference picture memory 306 stores the decoded image of the CU generated by the adding unit 312 at a predetermined position for each decoding target picture and CU.
 予測パラメータメモリ307は、予測パラメータを、復号対象のピクチャ及び予測ユニット(又はサブブロック、固定サイズブロック若しくはピクセル)毎に予め定めた位置に記憶する。具体的には、予測パラメータメモリ307は、インター予測パラメータ復号部303が復号したインター予測パラメータ、イントラ予測パラメータ復号部304が復号したイントラ予測パラメータ及びエントロピー復号部301が分離した予測モードpredModeを記憶する。記憶されるインター予測パラメータには、例えば、予測リスト利用フラグpredFlagLX(インター予測識別子inter_pred_idc)、参照ピクチャインデックスrefIdxLX、動きベクトルmvLXがある。 The prediction parameter memory 307 stores the prediction parameter in a predetermined position for each decoding target picture and prediction unit (or sub-block, fixed-size block or pixel). Specifically, the prediction parameter memory 307 stores the inter prediction parameter decoded by the inter prediction parameter decoding unit 303, the intra prediction parameter decoded by the intra prediction parameter decoding unit 304, and the prediction mode predMode separated by the entropy decoding unit 301. . The stored inter prediction parameters include, for example, a prediction list utilization flag predFlagLX (inter prediction identifier inter_pred_idc), a reference picture index refIdxLX, and a motion vector mvLX.
 予測画像生成部308には、エントロピー復号部301から入力された予測モードpredModeが入力され、また予測パラメータ復号部302から予測パラメータが入力される。また、予測画像生成部308は、参照ピクチャメモリ306から参照ピクチャを読み出す。予測画像生成部308は、予測モードpredModeが示す予測モードによって、入力された予測パラメータと読み出した参照ピクチャ(参照ピクチャブロック)を用いてPU若しくはサブブロックの予測画像を生成する。 The prediction image generation unit 308 receives the prediction mode predMode input from the entropy decoding unit 301 and the prediction parameter from the prediction parameter decoding unit 302. Further, the predicted image generation unit 308 reads a reference picture from the reference picture memory 306. The prediction image generation unit 308 generates a prediction image of a PU or sub-block using the input prediction parameter and the read reference picture (reference picture block) according to the prediction mode indicated by the prediction mode predMode.
 ここで、予測モードpredModeがインター予測モードを示す場合、インター予測画像生成部309は、インター予測パラメータ復号部303から入力されたインター予測パラメータと読み出した参照ピクチャ(参照ピクチャブロック)を用いてインター予測によりPU又はサブブロックの予測画像を生成する。 Here, when the prediction mode predMode indicates the inter prediction mode, the inter prediction image generation unit 309 uses the inter prediction parameter input from the inter prediction parameter decoding unit 303 and the read reference picture (reference picture block). To generate a prediction image of the PU or sub-block.
 インター予測画像生成部309は、予測リスト利用フラグpredFlagLXが1である参照ピクチャリスト(L0リスト又はL1リスト)に対し、参照ピクチャインデックスrefIdxLXによって示される参照ピクチャから、復号対象PUを基準として動きベクトルmvLXが示す位置にある参照ピクチャブロックを参照ピクチャメモリ306から読み出す。インター予測画像生成部309は、読み出した参照ピクチャブロックをもとに予測を行ってPUの予測画像を生成する。インター予測画像生成部309は、生成したPUの予測画像を加算部312に出力する。ここで、参照ピクチャブロックとは、参照ピクチャ上の画素の集合(通常矩形であるのでブロックと呼ぶ)であり、PU若しくはサブブロックの予測画像を生成するために参照する領域である。 For the reference picture list (L0 list or L1 list) in which the prediction list use flag predFlagLX is 1, the inter predicted image generation unit 309 performs the motion vector mvLX with reference to the decoding target PU from the reference picture indicated by the reference picture index refIdxLX. The reference picture block at the position indicated by is read from the reference picture memory 306. The inter prediction image generation unit 309 performs prediction based on the read reference picture block to generate a prediction image of the PU. The inter prediction image generation unit 309 outputs the generated prediction image of the PU to the addition unit 312. Here, the reference picture block is a set of pixels on the reference picture (usually called a block because it is a rectangle), and is an area that is referred to in order to generate a predicted image of a PU or sub-block.
 予測モードpredModeがイントラ予測モードを示す場合、イントラ予測画像生成部310は、イントラ予測パラメータ復号部304から入力されたイントラ予測パラメータと読み出した参照ピクチャを用いてイントラ予測を行う。具体的には、イントラ予測画像生成部310は、復号対象のピクチャであって、既に復号されたPUのうち、復号対象PUから予め定めた範囲にある隣接PUを参照ピクチャメモリ306から読み出す。予め定めた範囲とは、復号対象PUがいわゆるラスタースキャンの順序によって順次移動する場合、例えば、左、左上、上及び右上の隣接PUのうちの何れかであり、イントラ予測モードによって異なる。ラスタースキャンの順序とは、各ピクチャにおいて、上端から下端まで各行について、順次左端から右端まで移動させる順序である。 When the prediction mode predMode indicates the intra prediction mode, the intra predicted image generation unit 310 performs intra prediction using the intra prediction parameter input from the intra prediction parameter decoding unit 304 and the read reference picture. Specifically, the intra predicted image generation unit 310 reads, from the reference picture memory 306, neighboring PUs that are pictures to be decoded and are in a predetermined range from the decoding target PUs among the PUs that have already been decoded. The predetermined range is, for example, one of the left, upper left, upper and upper right adjacent PUs when the decoding target PU sequentially moves in the so-called raster scan order, and varies depending on the intra prediction mode. The raster scan order is an order in which each row is sequentially moved from the left end to the right end in each picture from the upper end to the lower end.
 イントラ予測画像生成部310は、読み出した隣接PUに基づいてイントラ予測モードIntraPredModeが示す予測モードによって予測を行ってPUの予測画像を生成する。イントラ予測画像生成部310は、生成したPUの予測画像を加算部312に出力する。 The intra prediction image generation unit 310 generates a prediction image of the PU by performing prediction based on the prediction mode indicated by the intra prediction mode IntraPredMode based on the read adjacent PU. The intra predicted image generation unit 310 outputs the generated predicted image of the PU to the adding unit 312.
 イントラ予測パラメータ復号部304において、輝度と色差とで異なるイントラ予測モードを導出する場合、イントラ予測画像生成部310は、輝度予測モードIntraPredModeYに応じて、プレーナ予測(0)、DC予測(1)及び方向予測(2~34)の何れかによって輝度のPUの予測画像を生成する。イントラ予測画像生成部310は、色差予測モードIntraPredModeCに応じて、プレーナ予測(0)、DC予測(1)、方向予測(2~34)及びLMモード(35)の何れかによって色差のPUの予測画像を生成する。 When the intra prediction parameter decoding unit 304 derives different intra prediction modes for luminance and chrominance, the intra prediction image generation unit 310 performs planar prediction (0), DC prediction (1) and DC prediction according to the luminance prediction mode IntraPredModeY. A prediction image of the luminance PU is generated by any one of the direction predictions (2 to 34). The intra-prediction image generation unit 310 predicts a color difference PU according to any of the planar prediction (0), DC prediction (1), direction prediction (2 to 34), and LM mode (35) according to the color difference prediction mode IntraPredModeC. Generate an image.
 逆量子化・逆変換部311は、エントロピー復号部301から入力された量子化係数を逆量子化して変換係数を求める。逆量子化・逆変換部311は、求めた変換係数について逆DCT、逆DST及び逆KLT等の逆周波数変換を行い、残差信号を算出する。逆量子化・逆変換部311は、算出した残差信号を加算部312に出力する。 The inverse quantization / inverse transform unit 311 inversely quantizes the quantized coefficient input from the entropy decoding unit 301 to obtain a transform coefficient. The inverse quantization / inverse transform unit 311 performs inverse frequency transform such as inverse DCT, inverse DST, and inverse KLT on the obtained transform coefficient, and calculates a residual signal. The inverse quantization / inverse transform unit 311 outputs the calculated residual signal to the adder 312.
 加算部312は、インター予測画像生成部309又はイントラ予測画像生成部310から入力されたPUの予測画像と逆量子化・逆変換部311から入力された残差信号を画素毎に加算して、PUの復号画像を生成する。加算部312は、生成したPUの復号画像を参照ピクチャメモリ306に記憶し、生成したPUの復号画像をピクチャ毎に統合した復号画像Tdを外部に出力する。 The addition unit 312 adds the prediction image of the PU input from the inter prediction image generation unit 309 or the intra prediction image generation unit 310 and the residual signal input from the inverse quantization / inverse conversion unit 311 for each pixel, Generate a decoded PU image. The adding unit 312 stores the generated decoded image of the PU in the reference picture memory 306, and outputs a decoded image Td in which the generated decoded image of the PU is integrated for each picture to the outside.
 (インター予測パラメータ復号部の構成)
 次に、インター予測パラメータ復号部303の構成について説明する。
(Configuration of inter prediction parameter decoding unit)
Next, the configuration of the inter prediction parameter decoding unit 303 will be described.
 図11は、実施形態1に係るインター予測パラメータ復号部303の構成を示すブロック図である。インター予測パラメータ復号部303は、インター予測パラメータ復号制御部3031、AMVP予測パラメータ導出部3032、加算部3038、マージ予測パラメータ導出部3036及びサブブロック予測パラメータ導出部3037を含んで構成される。 FIG. 11 is a block diagram illustrating a configuration of the inter prediction parameter decoding unit 303 according to the first embodiment. The inter prediction parameter decoding unit 303 includes an inter prediction parameter decoding control unit 3031, an AMVP prediction parameter derivation unit 3032, an addition unit 3038, a merge prediction parameter derivation unit 3036, and a sub-block prediction parameter derivation unit 3037.
 インター予測パラメータ復号制御部3031は、インター予測に関連する符号(シンタックス要素)の復号をエントロピー復号部301に指示する。また、インター予測パラメータ復号制御部3031は、符号化データに含まれる符号(シンタックス要素)、例えば、PU分割モードpart_mode、マージフラグmerge_flag、マージインデックスmerge_idx、インター予測識別子inter_pred_idc、参照ピクチャインデックスrefIdxLX、予測ベクトルインデックスmvp_LX_idx又は差分ベクトルmvdLXを抽出する。 The inter prediction parameter decoding control unit 3031 instructs the entropy decoding unit 301 to decode a code (syntax element) related to inter prediction. Also, the inter prediction parameter decoding control unit 3031 includes codes (syntax elements) included in the encoded data, for example, PU partition mode part_mode, merge flag merge_flag, merge index merge_idx, inter prediction identifier inter_pred_idc, reference picture index refIdxLX, prediction Vector index mvp_LX_idx or difference vector mvdLX is extracted.
 インター予測パラメータ復号制御部3031は、まず、マージフラグmerge_flagを抽出する。インター予測パラメータ復号制御部3031が、あるシンタックス要素を抽出すると表現する場合は、あるシンタックス要素の復号をエントロピー復号部301に指示し、該当のシンタックス要素を符号化データから読み出すことを意味する。 The inter prediction parameter decoding control unit 3031 first extracts a merge flag merge_flag. When the inter prediction parameter decoding control unit 3031 expresses that a certain syntax element is to be extracted, it means that the entropy decoding unit 301 is instructed to decode a certain syntax element, and the corresponding syntax element is read from the encoded data. To do.
 マージフラグmerge_flagが0、すなわち、AMVP予測モードを示す場合、インター予測パラメータ復号制御部3031は、エントロピー復号部301を用いて符号化データからAMVP予測パラメータを抽出する。AMVP予測パラメータとして、例えば、インター予測識別子inter_pred_idc、参照ピクチャインデックスrefIdxLX、予測ベクトルインデックスmvp_LX_idx、及び、差分ベクトルmvdLXがある。AMVP予測パラメータ導出部3032は予測ベクトルインデックスmvp_LX_idxから予測ベクトルmvpLXを導出する。詳細は後述する。インター予測パラメータ復号制御部3031は、差分ベクトルmvdLXを加算部3038に出力する。加算部3038では、予測ベクトルmvpLXと差分ベクトルmvdLXを加算し、動きベクトルを導出する。 When the merge flag merge_flag is 0, that is, indicates the AMVP prediction mode, the inter prediction parameter decoding control unit 3031 uses the entropy decoding unit 301 to extract the AMVP prediction parameter from the encoded data. Examples of AMVP prediction parameters include an inter prediction identifier inter_pred_idc, a reference picture index refIdxLX, a prediction vector index mvp_LX_idx, and a difference vector mvdLX. The AMVP prediction parameter derivation unit 3032 derives a prediction vector mvpLX from the prediction vector index mvp_LX_idx. Details will be described later. The inter prediction parameter decoding control unit 3031 outputs the difference vector mvdLX to the addition unit 3038. The adding unit 3038 adds the prediction vector mvpLX and the difference vector mvdLX to derive a motion vector.
 マージフラグmerge_flagが1、すなわち、マージ予測モードを示す場合、インター予測パラメータ復号制御部3031は、マージ予測に係る予測パラメータとして、マージインデックスmerge_idxを抽出する。インター予測パラメータ復号制御部3031は、抽出したマージインデックスmerge_idxをマージ予測パラメータ導出部3036(詳細は後述する)に出力し、サブブロック予測モードフラグsubPbMotionFlagをサブブロック予測パラメータ導出部3037に出力する。サブブロック予測パラメータ導出部3037は、サブブロック予測モードフラグsubPbMotionFlagの値に応じて、PUを複数のサブブロックに分割し、サブブロック単位で動きベクトルを導出する。すなわち、サブブロック予測モードでは、予測ブロックは4x4若しくは8x8という小さいブロック単位毎に予測される。後述の画像符号化装置11においては、CUを複数のパーティション(2NxN、Nx2N及びNxN等のPU)に分割し、パーティション単位毎に予測パラメータのシンタックスを符号化する方法に対して、サブブロック予測モードでは複数のサブブロックを集合(セット)にまとめ、当該集合毎に予測パラメータのシンタックスを符号化するため、少ない符号量によって多くのサブブロックの動き情報を符号化することができる。 When the merge flag merge_flag is 1, that is, indicates the merge prediction mode, the inter prediction parameter decoding control unit 3031 extracts the merge index merge_idx as a prediction parameter related to merge prediction. The inter prediction parameter decoding control unit 3031 outputs the extracted merge index merge_idx to the merge prediction parameter derivation unit 3036 (details will be described later), and outputs the sub-block prediction mode flag subPbMotionFlag to the sub-block prediction parameter derivation unit 3037. The subblock prediction parameter deriving unit 3037 divides the PU into a plurality of subblocks according to the value of the subblock prediction mode flag subPbMotionFlag, and derives a motion vector in units of subblocks. That is, in the sub-block prediction mode, the prediction block is predicted for each small block unit of 4 × 4 or 8 × 8. In the image encoding device 11 to be described later, sub-block prediction is used for a method in which a CU is divided into a plurality of partitions (PUs such as 2NxN, Nx2N, and NxN) and the syntax of a prediction parameter is encoded for each partition unit. In the mode, a plurality of sub-blocks are collected into a set, and the syntax of the prediction parameter is encoded for each set. Therefore, motion information of a large number of sub-blocks can be encoded with a small code amount.
 図7は、実施形態1に係るマージ予測パラメータ導出部3036の構成を示すブロック図である。マージ予測パラメータ導出部3036は、マージ候補導出部30361とマージ候補選択部30362、マージ候補格納部30363を備える。マージ候補格納部30363は、マージ候補導出部30361から入力されたマージ候補を格納する。なお、マージ候補は、予測リスト利用フラグpredFlagLX、動きベクトルmvLX及び参照ピクチャインデックスrefIdxLXを含んで構成されている。マージ候補格納部30363において、格納されたマージ候補には、所定の規則に従ってインデックスが割り当てられる。 FIG. 7 is a block diagram illustrating a configuration of the merge prediction parameter deriving unit 3036 according to the first embodiment. The merge prediction parameter derivation unit 3036 includes a merge candidate derivation unit 30361, a merge candidate selection unit 30362, and a merge candidate storage unit 30363. The merge candidate storage unit 30363 stores the merge candidates input from the merge candidate derivation unit 30361. The merge candidate includes a prediction list use flag predFlagLX, a motion vector mvLX, and a reference picture index refIdxLX. In the merge candidate storage unit 30363, an index is assigned to the stored merge candidate according to a predetermined rule.
 マージ候補導出部30361は、すでに復号処理が行われた隣接PUの動きベクトルと参照ピクチャインデックスrefIdxLXをそのまま用いてマージ候補を導出する。それ以外にアフィン予測を用いてマージ候補を導出してもよい。この方法を以下に詳細に説明する。マージ候補導出部30361は、アフィン予測を、後述する空間マージ候補導出処理、時間マージ候補導出処理、結合マージ候補導出処理、及びゼロマージ候補導出処理に用いてもよい。なお、アフィン予測はサブブロック単位毎に行われ、予測パラメータはサブブロック毎に予測パラメータメモリ307に格納されている。あるいは、アフィン予測は画素単位毎に行われてもよい。 The merge candidate derivation unit 30361 derives a merge candidate using the motion vector of the adjacent PU that has already been decoded and the reference picture index refIdxLX as they are. In addition, merge candidates may be derived using affine prediction. This method will be described in detail below. The merge candidate derivation unit 30361 may use affine prediction for a spatial merge candidate derivation process, a temporal merge candidate derivation process, a combined merge candidate derivation process, and a zero merge candidate derivation process described later. Note that affine prediction is performed for each subblock, and the prediction parameters are stored in the prediction parameter memory 307 for each subblock. Alternatively, the affine prediction may be performed for each pixel unit.
 (空間マージ候補導出処理)
 空間マージ候補導出処理として、マージ候補導出部30361は、所定の規則に従って、予測パラメータメモリ307が記憶している予測パラメータ(予測リスト利用フラグpredFlagLX、動きベクトルmvLX、参照ピクチャインデックスrefIdxLX)を読み出し、読み出した予測パラメータをマージ候補として導出する。読み出される予測パラメータは、復号対象PUから予め定めた範囲内にあるPU(例えば、復号対象PUの左下端、左上端及び右上端にそれぞれ接するPUの全部又は一部)のそれぞれに係る予測パラメータである。
(Spatial merge candidate derivation process)
As the spatial merge candidate derivation process, the merge candidate derivation unit 30361 reads and reads the prediction parameters (prediction list use flag predFlagLX, motion vector mvLX, reference picture index refIdxLX) stored in the prediction parameter memory 307 according to a predetermined rule. The predicted parameters are derived as merge candidates. The prediction parameter to be read is a prediction parameter related to each of the PUs within a predetermined range from the decoding target PU (for example, all or part of the PUs in contact with the lower left end, the upper left end, and the upper right end of the decoding target PU, respectively). is there.
 (時間マージ候補導出処理)
 時間マージ導出処理として、マージ候補導出部30361は、復号対象PUの右下の座標を含む参照画像中のPUの予測パラメータを予測パラメータメモリ307から読みだしマージ候補とする。参照画像の指定方法は、例えば、スライスヘッダにおいて指定された参照ピクチャインデックスrefIdxLXでもよいし、復号対象PUに隣接するPUの参照ピクチャインデックスrefIdxLXのうち最小のものを用いて指定してもよい。
(Time merge candidate derivation process)
As the temporal merge derivation process, the merge candidate derivation unit 30361 reads the prediction parameter of the PU in the reference image including the lower right coordinate of the decoding target PU from the prediction parameter memory 307 and sets it as a merge candidate. The reference picture designation method may be, for example, the reference picture index refIdxLX designated in the slice header, or may be designated using the smallest reference picture index refIdxLX of the PU adjacent to the decoding target PU.
 (結合マージ候補導出処理)
 結合マージ導出処理として、マージ候補導出部30361は、既に導出され、マージ候補格納部30363に格納された2つの異なる導出済マージ候補の動きベクトル及び参照ピクチャインデックスを、それぞれL0及びL1の動きベクトルとして組み合わせることで結合マージ候補を導出する。
(Join merge candidate derivation process)
As a merge merge derivation process, the merge candidate derivation unit 30361 uses two different derived merge candidate motion vectors and reference picture indexes already derived and stored in the merge candidate storage unit 30363 as the motion vectors of L0 and L1, respectively. Combined merge candidates are derived by combining them.
 (ゼロマージ候補導出処理)
 ゼロマージ候補導出処理として、マージ候補導出部30361は、参照ピクチャインデックスrefIdxLXが0であり、動きベクトルmvLXのX成分及びY成分が共に0であるマージ候補を導出する。
(Zero merge candidate derivation process)
As the zero merge candidate derivation process, the merge candidate derivation unit 30361 derives a merge candidate in which the reference picture index refIdxLX is 0 and both the X component and the Y component of the motion vector mvLX are 0.
 マージ候補導出部30361によって導出された上記マージ候補はマージ候補格納部30363に格納される。 The merge candidates derived by the merge candidate deriving unit 30361 are stored in the merge candidate storage unit 30363.
 マージ候補選択部30362は、マージ候補格納部30363に格納されているマージ候補のうち、インター予測パラメータ復号制御部3031から入力されたマージインデックスmerge_idxに対応するインデックスが割り当てられたマージ候補を、対象PUのインター予測パラメータとして選択する。マージ候補選択部30362は選択したマージ候補を予測パラメータメモリ307に記憶するとともに、予測画像生成部308に出力する。 The merge candidate selection unit 30362 selects, from the merge candidates stored in the merge candidate storage unit 30363, a merge candidate to which an index corresponding to the merge index merge_idx input from the inter prediction parameter decoding control unit 3031 is assigned. As an inter prediction parameter. The merge candidate selection unit 30362 stores the selected merge candidate in the prediction parameter memory 307 and outputs it to the prediction image generation unit 308.
 図8は、実施形態1に係るAMVP予測パラメータ導出部3032の構成を示すブロック図である。AMVP予測パラメータ導出部3032は、ベクトル候補導出部3033とベクトル候補選択部3034、及びベクトル候補格納部3035を備える。ベクトル候補導出部3033は、参照ピクチャインデックスrefIdxに基づいて予測パラメータメモリ307が記憶する既に処理済みのPUの動きベクトルmvLXから予測ベクトル候補を導出する。ベクトル候補導出部3033は、導出した予測ベクトル候補をベクトル候補格納部3035予測ベクトル候補リストmvpListLX[]に格納する。 FIG. 8 is a block diagram illustrating a configuration of the AMVP prediction parameter derivation unit 3032 according to the first embodiment. The AMVP prediction parameter derivation unit 3032 includes a vector candidate derivation unit 3033, a vector candidate selection unit 3034, and a vector candidate storage unit 3035. The vector candidate derivation unit 3033 derives a prediction vector candidate from the already processed PU motion vector mvLX stored in the prediction parameter memory 307 based on the reference picture index refIdx. The vector candidate derivation unit 3033 stores the derived prediction vector candidate in the vector candidate storage unit 3035 prediction vector candidate list mvpListLX [].
 ベクトル候補選択部3034は、予測ベクトル候補リストmvpListLX[]の予測ベクトル候補のうち予測ベクトルインデックスmvp_LX_idxが示す動きベクトルmvpListLX[mvp_LX_idx]を予測ベクトルmvpLXとして選択する。ベクトル候補選択部3034は、選択した予測ベクトルmvpLXを加算部3038に出力する。 The vector candidate selection unit 3034 selects the motion vector mvpListLX [mvp_LX_idx] indicated by the prediction vector index mvp_LX_idx from the prediction vector candidates in the prediction vector candidate list mvpListLX [] as the prediction vector mvpLX. The vector candidate selection unit 3034 outputs the selected prediction vector mvpLX to the addition unit 3038.
 なお、予測ベクトル候補は、復号処理が完了したPUであって、復号対象PUから予め定めた範囲のPU(例えば、隣接PU)の動きベクトルをスケーリングすることで導出する。なお、隣接PUは、復号対象PUに空間的に隣接するPU、例えば、左PU及び上PUの他、復号対象PUに時間的に隣接する領域、例えば、復号対象PUと同じ位置を含み、表示時刻が異なるPUの予測パラメータから得られた領域を含む。 Note that a prediction vector candidate is a PU for which decoding processing has been completed, and is derived by scaling a motion vector of a PU (for example, an adjacent PU) within a predetermined range from the decoding target PU. The adjacent PU includes a PU that is spatially adjacent to the decoding target PU, for example, the left PU and the upper PU, and an area that is temporally adjacent to the decoding target PU, for example, the same position as the decoding target PU. It includes areas obtained from prediction parameters of PUs with different times.
 加算部3038は、AMVP予測パラメータ導出部3032から入力された予測ベクトルmvpLXとインター予測パラメータ復号制御部3031から入力された差分ベクトルmvdLXを加算して動きベクトルmvLXを算出する。加算部3038は、算出した動きベクトルmvLXを予測画像生成部308及び予測パラメータメモリ307に出力する。 The addition unit 3038 adds the prediction vector mvpLX input from the AMVP prediction parameter derivation unit 3032 and the difference vector mvdLX input from the inter prediction parameter decoding control unit 3031 to calculate a motion vector mvLX. The adding unit 3038 outputs the calculated motion vector mvLX to the predicted image generation unit 308 and the prediction parameter memory 307.
 (インター予測画像生成部309)
 図10は、実施形態1に係る予測画像生成部308に含まれるインター予測画像生成部309の構成を示すブロック図である。インター予測画像生成部309は、動き補償部3091及び重み予測部3094を含んで構成される。
(Inter prediction image generation unit 309)
FIG. 10 is a block diagram illustrating a configuration of the inter predicted image generation unit 309 included in the predicted image generation unit 308 according to the first embodiment. The inter prediction image generation unit 309 includes a motion compensation unit 3091 and a weight prediction unit 3094.
 (動き補償部3091)
 動き補償部3091は、インター予測パラメータ復号部303から入力された、インター予測パラメータ(予測リスト利用フラグpredFlagLX、参照ピクチャインデックスrefIdxLX及び動きベクトルmvLX)に基づいて、参照ピクチャメモリ306から、参照ピクチャインデックスrefIdxLXで指定された参照ピクチャRefX(参照ピクチャリストに含まれた何れかの参照画像)において、復号対象PUの位置を起点として、動きベクトルmvLXだけずれた位置にある参照ブロックを読み出すことによって補間画像(動き補償画像predSamplesLX)を生成する。ここで、動きベクトルmvLXの精度が整数精度でない場合には、動き補償フィルタと呼ばれる小数位置の画素を生成するためのフィルタを施して、動き補償画像を生成する。
(Motion compensation unit 3091)
The motion compensation unit 3091 receives the reference picture index refIdxLX from the reference picture memory 306 based on the inter prediction parameters (prediction list use flag predFlagLX, reference picture index refIdxLX, and motion vector mvLX) input from the inter prediction parameter decoding unit 303. In the reference picture RefX (any one of the reference pictures included in the reference picture list) specified in (1), an interpolation picture (by reading a reference block at a position shifted by the motion vector mvLX starting from the position of the decoding target PU) Motion compensated image predSamplesLX) is generated. Here, when the accuracy of the motion vector mvLX is not integer accuracy, a motion compensation image is generated by applying a filter for generating a pixel at a decimal position called a motion compensation filter.
 ここで、動き補償部3091は、単予測モードと、双予測モードと、2つの参照画像(第1の参照画像及び第2の参照画像)及び勾配補正項を参照して予測画像を生成するBIO予測を用いるBIOモードと、の少なくとも何れかを用いて予測画像を生成する。また、動き補償部3091は、第1の参照画像及び第2の参照画像の少なくとも何れかにおける参照ブロックが参照画像の画面外に係る場合(換言すると、第1の参照画像における参照ブロックが第1の参照画像の画面外に係る場合、及び第2の参照画像における参照ブロックが第2の参照画像の画面外に係る場合の少なくとも何れかの場合)、BIOモードを用いた予測画像の生成を禁止する。すなわち、上記場合には、動き補償部3091は、BIOモードを用いた予測画像生成を行わない。動き補償部3091が実行する処理の詳細は、後述する。 Here, the motion compensation unit 3091 generates a prediction image by referring to the single prediction mode, the bi-prediction mode, the two reference images (first reference image and second reference image), and the gradient correction term. A predicted image is generated using at least one of the BIO mode using prediction. The motion compensation unit 3091 also determines that the reference block in at least one of the first reference image and the second reference image is outside the screen of the reference image (in other words, the reference block in the first reference image is the first block). Generation of a predicted image using the BIO mode is prohibited when the reference image is outside the screen and / or the reference block in the second reference image is outside the second reference image). To do. That is, in the above case, the motion compensation unit 3091 does not perform prediction image generation using the BIO mode. Details of processing executed by the motion compensation unit 3091 will be described later.
 なお、単予測モードと、双予測モードと、BIOモードとが参照する参照画像は同じであってもよいし、異なってもよい。 Note that the reference images referred to by the single prediction mode, the bi-prediction mode, and the BIO mode may be the same or different.
 (重み予測部3094)
 重み予測部3094は、入力される動き補償画像predSamplesLXに重み係数を乗算することによりPUの予測画像を生成する。
(Weight predictor 3094)
The weight prediction unit 3094 generates a prediction image of the PU by multiplying the input motion compensation image predSamplesLX by a weight coefficient.
 (勾配変化予測を備える動き補償部における予測モードの切り替え)
 図12は、勾配変化(BIO)予測を用いた動き補償機能を備える動き補償部3091が予測画像を導出する処理の流れを説明するフローチャートである。
(Switching prediction mode in motion compensation unit with gradient change prediction)
FIG. 12 is a flowchart for explaining the flow of processing in which the motion compensation unit 3091 having a motion compensation function using gradient change (BIO) prediction derives a predicted image.
 インター予測パラメータ復号部303が双予測モードではないと判定した場合(ステップS101にてNo、すなわち単予測UniPred)、ステップS105に進み、動き補償部3091は単方向動き補償を行う。一方、インター予測パラメータ復号部303が双予測モードであると判定した場合(ステップS101にてYes、BiPred)、続けて、インター予測パラメータ復号部303はステップS102に示す判定を行う。 When it is determined that the inter prediction parameter decoding unit 303 is not in the bi-prediction mode (No in step S101, that is, uni-prediction UniPred), the process proceeds to step S105, and the motion compensation unit 3091 performs unidirectional motion compensation. On the other hand, when it is determined that the inter prediction parameter decoding unit 303 is in the bi-prediction mode (Yes in step S101, BiPred), the inter prediction parameter decoding unit 303 performs the determination shown in step S102.
 参照ピクチャメモリ306から取得したL0参照画像refImgL0及びL1参照画像refImgL1(図12では、「2つの予測ブロック」と記載)が異なる参照画像であれば(ステップS102にてYes)、ステップS103に進み、動き補償部3091は後に説明するBIO予測を用いた動き補償を行う。他方、参照ピクチャメモリ306から取得したL0参照画像refImgL0及びL1参照画像refImgL1が同じ参照画像であれば(ステップS102にてNo)、ステップS104に進み、動き補償部3091はBIO予測を適用しない双方向動き補償を行う。 If the L0 reference image refImgL0 and the L1 reference image refImgL1 (described as “two prediction blocks” in FIG. 12) acquired from the reference picture memory 306 are different reference images (Yes in step S102), the process proceeds to step S103. The motion compensation unit 3091 performs motion compensation using BIO prediction described later. On the other hand, if the L0 reference image refImgL0 and the L1 reference image refImgL1 acquired from the reference picture memory 306 are the same reference image (No in step S102), the process proceeds to step S104, and the motion compensation unit 3091 does not apply BIO prediction. Perform motion compensation.
 (勾配変化の基本概念)
 勾配変化(Optical Flow)では、各点の画素値は変化せず、その位置のみが変化すると仮定する。これは、水平方向の画素値Iの変化(水平勾配値lx)とその位置の変化Vx、及び垂直方向の画素値Iの変化(垂直勾配値ly)とその位置の変化Vy、画素値Iの時間変化ltを用いて、下記のように表すことができる。
(Basic concept of gradient change)
In the gradient change (Optical Flow), it is assumed that the pixel value of each point does not change and only the position changes. This is because the change in the pixel value I in the horizontal direction (horizontal gradient value lx) and the change in the position Vx, the change in the pixel value I in the vertical direction (vertical gradient value ly), the change in the position Vy, and the pixel value I Using time change lt, it can be expressed as follows.
 lx * Vx + ly * Vy + lt = 0
以降では位置の変化(Vx,Vy)を補正重みベクトル(u,v)と呼ぶ。
lx * Vx + ly * Vy + lt = 0
Hereinafter, the change in position (Vx, Vy) is referred to as a correction weight vector (u, v).
 (BIO予測について)
 ここでは、BIO予測を用いた動き補償について、図13から図18を用いて説明する。図17は、動き補償部3091の構成の一例を示すブロック図である。動き補償部3091は、動き補償勾配部30911及び勾配補正係数部30912を備えている。動き補償勾配部30911は、動き補償導出部309111及び勾配導出部309112を備えており、一方、勾配補正係数部30912は、勾配積導出部309121及び勾配補正係数導出部309122を備えている。これらを用いて、動き補償部3091は、双予測(BiPred)画像に対して勾配補正項を適用して動き補正を行うBi-directional optical flow(双予測勾配変化:BIO)予測を適用した動き補償を行う。
(About BIO prediction)
Here, motion compensation using BIO prediction will be described with reference to FIGS. FIG. 17 is a block diagram illustrating an example of the configuration of the motion compensation unit 3091. The motion compensation unit 3091 includes a motion compensation gradient unit 30911 and a gradient correction coefficient unit 30912. The motion compensation gradient unit 30911 includes a motion compensation derivation unit 309111 and a gradient derivation unit 309112, while the gradient correction coefficient unit 30912 includes a gradient product derivation unit 309121 and a gradient correction coefficient derivation unit 309122. Using these, the motion compensation unit 3091 applies bi-directional optical flow (bi-predictive gradient change: BIO) prediction that performs motion correction by applying a gradient correction term to a bi-prediction (BiPred) image. I do.
 すなわち、動き補償部3091は、BIOを適用しない場合は以下の予測式
 Pred = {(P0 + P1) + shiftOffset} >> shiftPred   (式A1)
を用いて、予測画像の各画素値Predを導出する。なお、P0は動き補償画像P0の画素値であり、P1は動き補償画像P1の画素値である。
That is, when the BIO is not applied, the motion compensation unit 3091 uses the following prediction formula Pred = {(P0 + P1) + shiftOffset} >> shiftPred (Formula A1)
Is used to derive each pixel value Pred of the predicted image. Note that P0 is the pixel value of the motion compensated image P0, and P1 is the pixel value of the motion compensated image P1.
 動き補償部3091は、BIOを適用する場合は以下の予測式
 Pred = {(P0 + P1) + modBIO + shiftOffset} >> shiftPred   (式A2)
を用いて、予測画像の画素値Predを導出する。なお、modBIOは、
 modBIO = {((lx0 - lx1) * u + (ly0 - ly1) * v) >> 1} << shiftPred  (式A3)によって導出される勾配補正項である。式A3において、lx0(第1の勾配画像)、ly0(第2の勾配画像)、lx1(第3の勾配画像)、及びly1(第4の勾配画像)はそれぞれ勾配画像である。勾配画像lx0及びlx1は水平方向(x方向又は第1の方向)に沿った勾配を示しており、勾配画像ly0及びly1は垂直方向(y方向又は第2の方向)に沿った勾配を示している。また、u及びvは補正重みベクトルである。
When applying BIO, the motion compensation unit 3091 uses the following prediction formula Pred = {(P0 + P1) + modBIO + shiftOffset} >> shiftPred (Formula A2)
Is used to derive the pixel value Pred of the predicted image. ModBIO is
modBIO = {((lx0-lx1) * u + (ly0-ly1) * v) >> 1} << shiftPred This is a gradient correction term derived by Expression (A3). In Expression A3, lx0 (first gradient image), ly0 (second gradient image), lx1 (third gradient image), and ly1 (fourth gradient image) are gradient images. The gradient images lx0 and lx1 show the gradient along the horizontal direction (x direction or first direction), and the gradient images ly0 and ly1 show the gradient along the vertical direction (y direction or second direction). Yes. U and v are correction weight vectors.
 (BIO予測の処理の概要)
 まず、動き補償部3091が、動き補償画像P0(第1の参照画像)と動き補償画像P1(第2の参照画像)と勾配補正項とを参照して予測画像(インター予測画像)を生成する処理の流れについて、図18を用いて説明する。図18はBIO予測を用いた動き補償における処理の流れを示すフローチャートである。
(Outline of BIO prediction processing)
First, the motion compensation unit 3091 generates a prediction image (inter prediction image) with reference to the motion compensation image P0 (first reference image), the motion compensation image P1 (second reference image), and the gradient correction term. The processing flow will be described with reference to FIG. FIG. 18 is a flowchart showing the flow of processing in motion compensation using BIO prediction.
 図18に示すように、BIO予測を用いた動き補償において、動き補償部3091は下記のSTEP111~113の3段階の処理を行って、予測画像を導出する。 As shown in FIG. 18, in motion compensation using BIO prediction, the motion compensation unit 3091 performs the following three steps of STEP 111 to 113 to derive a predicted image.
 STEP111において、動き補償導出部309111は、参照ピクチャメモリ306から参照画像として使用するL0参照画像refImgL0(第1の参照画像)及びL1参照画像refImgL1(第2の参照画像)を読み出して、動き補償画像P0及びP1を導出する(図18のS111a)。 In STEP 111, the motion compensation deriving unit 309111 reads out the L0 reference image refImgL0 (first reference image) and the L1 reference image refImgL1 (second reference image) to be used as the reference image from the reference picture memory 306, and the motion compensation image. P0 and P1 are derived (S111a in FIG. 18).
 次に、勾配導出部309112は、動き補償導出部309111が導出した動き補償画像P0及びP1に対し、水平勾配画像lx0及びlx1、及び垂直勾配画像ly0及びly1を導出する(図18のS111b)。 Next, the gradient deriving unit 309112 derives horizontal gradient images lx0 and lx1 and vertical gradient images ly0 and ly1 for the motion compensated images P0 and P1 derived by the motion compensation deriving unit 309111 (S111b in FIG. 18).
 なお、refImgL0、refImgL1、P0, P1, lx0、lx1、ly0及びly1は、2次元情報である参照画像refImgL01[x][y]、refImgL1[x][y]、動き補償画像P0[x][y], P1[x][y], 勾配画像lx0[x][y]、lx1[x][y]、ly0[x][y]及びly1[x][y](x及びyは所定のレンジを有する整数)を指す場合と、参照画像値refImgL0、refImgL1、動き補償画像値P0, P1, 勾配値lx0、lx1、ly0及びly1を指す場合とがある。 Note that refImgL0, refImgL1, P0, P1, lx0, lx1, ly0, and ly1 are two-dimensional reference images refImgL01 [x] [y], refImgL1 [x] [y], and motion compensation image P0 [x] [ y], P1 [x] [y], gradient image lx0 [x] [y], lx1 [x] [y], ly0 [x] [y] and ly1 [x] [y] (x and y are predetermined Or a reference image value refImgL0, refImgL1, motion compensation image value P0, P1, gradient values lx0, lx1, ly0, and ly1.
 続いて、STEP112において、勾配積導出部309121は、勾配積を導出する(図18のS112a)。次に、勾配補正係数導出部309122は、勾配積導出部309121が導出した勾配積を用いて、補正重みベクトル(u, v)(勾配補正係数、整数演算ではuh及びvh)を導出する(図18のS112b)。 Subsequently, in STEP 112, the gradient product deriving unit 309121 derives the gradient product (S112a in FIG. 18). Next, the gradient correction coefficient deriving unit 309122 uses the gradient product derived by the gradient product deriving unit 309121 to derive a correction weight vector (u, v) (gradient correction coefficient, uh and vh in integer arithmetic) (see FIG. 18 S112b).
 勾配補正係数導出部309122は、補正重みベクトル(u, v)を図13の式5を用いて導出してもよいし、後述するように、最小二乗法を用いて導出してもよい。 The gradient correction coefficient deriving unit 309122 may derive the correction weight vector (u, v) using Equation 5 in FIG. 13 or may be derived using the least square method as described later.
 図13の式5を用いて補正重みベクトル(u, v)を導出する場合、動き補償部3091は、複数の点での勾配変化dI/dx(すなわち、lx)、dI/dy(すなわち、ly)、及び時間変化dI/dtを用いて、図13の式5の左辺の2乗を最少とする条件を満たすu及びvを導出すればよい。 When the correction weight vector (u, uv) is derived using Equation 5 in FIG. 13, the motion compensation unit 3091 has gradient changes dI / dx (ie, lx) and dI / dy (ie, ly) at a plurality of points. ) And time variation dI / dt, u and v satisfying the condition that minimizes the square of the left side of Equation 5 in FIG. 13 may be derived.
 図14に示すように、対象画像Cur上の点Iの画素値Iと、L0参照画像refImgL0上の点l0(lx0, ly0)の画素値I0と、L1参照画像refImgL1上の点l1(lx1, ly1)の画素値I1とが対応する。なお、図14には、点l0のx成分及び点l1のx成分のみが示されているが、点l0のy成分及び点l1のy成分についても、同様である。対象領域において、勾配変化の仮定(各点の画素値は変化することなくその位置のみが変化する)が成り立つとすると、I=I0=I1が成り立つ。空間的な画素値の変化量である勾配に注目すると、L0参照画像refImgL0上のある点の画素値I0は、別の点の画素値P0、P0での勾配、及びI0とP0の距離を用いて I0 = P0 + 勾配×距離から予測できる。ここで、勾配は(lx0, ly0)、IOとP0の距離は(Vx, Vy)である。同様に、L0参照画像refImgL0上のある点の画素値I1は、別の点の画素値P1、P1での勾配、及びI1とP1の距離を用いて I1 = P0 + 勾配(lx1, ly1) * 距離(-Vx, -Vy)から導出できる。若しくは画素値I0と画素値I1が等しいという仮定から、I0とI1の差分を最小化するパラメータ(Vx, Vy)を導出することにより、距離(Vx, Vy)=補正重みベクトル(u, v)が導出できる。 As shown in FIG. 14, the pixel value I of the point I on the target image Cur, the pixel value I0 of the point 10 (lx0, ly0) on the L0 reference image refImgL0, and the point l1 (lx1, L1 on the L1 reference image refImgL1) This corresponds to the pixel value I1 of ly1). FIG. 14 shows only the x component at the point l0 and the x component at the point l1, but the same applies to the y component at the point l0 and the y component at the point l1. If the assumption of gradient change (only the position of each point changes without changing) in the target region holds, I = I0 = I1 holds. When attention is paid to the gradient that is the amount of change in the spatial pixel value, the pixel value I0 of a certain point on the L0 reference image refImgL0 uses the gradient at the pixel values P0 and P0 of another point and the distance between I0 and P0. Therefore, it can be predicted from I0 = P0 + gradient × distance. Here, the gradient is (lx0, ly0), and the distance between IO and P0 is (Vx, Vy). Similarly, the pixel value I1 of a certain point on the L0 reference image refImgL0 is obtained by using the gradient at the pixel values P1 and P1 of another point and the distance between I1 and P1, I1 = P0 + gradient (lx1, ly1) * It can be derived from the distance (-Vx, -Vy). Alternatively, by deriving a parameter (Vx, Vy) that minimizes the difference between I0 and I1 from the assumption that the pixel value I0 and the pixel value I1 are equal, the distance (Vx, Vy) = correction weight vector (u, v) Can be derived.
 動き補償部3091は、予測対象の画像である対象画像Cur上の点Iの画素値Iを、L0参照画像refImgL0上の点l0の画素値l0及びL1参照画像refImgL1上の点l1の画素値l1の平均、
 I = (l0 + l1) >> 1   (式A4-1)
  = {P0 + P1 + (lx0 - lx1) * u + (ly0 - ly1) * v} >> 1   (式A4-2)
として予測する。ここで、
 l0 = P0 + (lx0 * u + ly0 * v)
 l1 = P1 - (lx1 * u + ly1 * v)
である。
The motion compensation unit 3091 uses the pixel value I of the point I on the target image Cur, which is the prediction target image, as the pixel value l0 of the point 10 on the L0 reference image refImgL0 and the pixel value l1 of the point 11 on the L1 reference image refImgL1. Average of
I = (l0 + l1) >> 1 (Formula A4-1)
= {P0 + P1 + (lx0-lx1) * u + (ly0-ly1) * v} >> 1 (Formula A4-2)
To predict. here,
l0 = P0 + (lx0 * u + ly0 * v)
l1 = P1-(lx1 * u + ly1 * v)
It is.
 補正重みベクトルは、画素値が変化しないという仮定から式A5を最小とする(u,v)である。 The correction weight vector is (u, v) that minimizes Formula A5 from the assumption that the pixel value does not change.
 Σ│l0 - l1│2 =Σ│(P0 - P1) + (lx0 + lx1) * u + (ly0 + ly1) * v│2 (式A5)
 ここでΣは、対象とする画素(x, y)及びその周囲の点(x + dx, y + dy)(例えばdx = -2..2, dy = -2..2)において、P0, P1, lx0, ly0, ly0, ly1を計算し、それらからなる値を足し合わせる演算に相当する。
Σ│l0-l1│ 2 = Σ│ (P0-P1) + (lx0 + lx1) * u + (ly0 + ly1) * v│ 2 (Formula A5)
Here, Σ is P0, at the target pixel (x, y) and its surrounding points (x + dx, y + dy) (for example, dx = -2..2, dy = -2..2). This corresponds to an operation of calculating P1, lx0, ly0, ly0, and ly1 and adding the values made up of them.
 最後に、STEP113において、勾配補正双予測導出部30913は、STEP112において導出した補正重みベクトル(u, v)を用いて(式A3、後述の式A19参照)勾配補正項modBIO[][]を導出する(図18のS113a)。そして、勾配補正双予測導出部30913は、勾配補正双予測画像(予測画像、補正済み予測画像)の画素値Predを、式A2を用いて導出する(図18のS113b)。 Finally, in STEP 113, the gradient correction bi-prediction derivation unit 30913 derives the gradient correction term modBIO [] [] using the correction weight vector (u, v) derived in STEP 112 (see Equation A3 and Equation A19 described later). (S113a in FIG. 18). Then, the gradient correction bi-prediction derivation unit 30913 derives the pixel value Pred of the gradient correction bi-prediction image (prediction image, corrected prediction image) using Expression A2 (S113b in FIG. 18).
 動き補償部3091は、STEP112において導出した補正重みベクトル(u, v)を式A3に代入して勾配補正項modBIOを導出し、予測画像の画素値Predを、
 Pred = {P0 + P1 + (lx0 - lx1) * u + (ly0 - ly1) * v} >> 1  (式A6)
を用いて導出する。なお、勾配補正項modBIOを1/2に弱めて、
 Pred = {P0 + P1 + ((lx0 - lx1) * u + (ly0 - ly1) * v) >> 1} >> 1 (式A7)
のように使用してもよい。
The motion compensation unit 3091 derives the gradient correction term modBIO by substituting the correction weight vector (u, v) derived in STEP 112 into Equation A3, and calculates the pixel value Pred of the predicted image as
Pred = {P0 + P1 + (lx0-lx1) * u + (ly0-ly1) * v} >> 1 (Formula A6)
Derived using In addition, weaken the slope correction term modBIO to 1/2,
Pred = {P0 + P1 + ((lx0-lx1) * u + (ly0-ly1) * v) >> 1} >> 1 (Formula A7)
It may be used as follows.
 続いて、上記の各STEPの処理について詳細に説明する。なお、ここでは、動き補償部3091が動き補償画像及び勾配画像を導出(生成)する場合を例に挙げて説明するが、動き補償部3091が画像ではなく、画像に含まれる画素値を導出する構成であってもよい。すなわち、動き補償部3091が動き補償画像の画素値及び勾配画像の画素値を導出してもよい。 Subsequently, the processing of each of the above STEPs will be described in detail. Here, a case where the motion compensation unit 3091 derives (generates) a motion compensation image and a gradient image will be described as an example, but the motion compensation unit 3091 derives a pixel value included in the image, not an image. It may be a configuration. That is, the motion compensation unit 3091 may derive the pixel value of the motion compensation image and the pixel value of the gradient image.
 以下、動き補償部3091の構成を示す図18を参照しながら、各STEPの詳細を説明する。 Hereinafter, details of each STEP will be described with reference to FIG. 18 showing the configuration of the motion compensation unit 3091.
 (STEP111の詳細)
 動き補償導出部309111は、L0参照画像refImgL0及びL1参照画像refImgL1に基づいて、動き補償画像P0及びP1(基礎動き補償画像ともいう)を導出する(図18のS111a)。更に、勾配導出部309112は、導出した動き補償画像P0及びP1に対して、水平勾配画像lx0及びlx1、及び垂直勾配画像ly0及びly1を導出する(図18のS111b)。
(Details of STEP111)
The motion compensation derivation unit 309111 derives motion compensation images P0 and P1 (also referred to as basic motion compensation images) based on the L0 reference image refImgL0 and the L1 reference image refImgL1 (S111a in FIG. 18). Further, the gradient deriving unit 309112 derives horizontal gradient images lx0 and lx1 and vertical gradient images ly0 and ly1 for the derived motion compensation images P0 and P1 (S111b in FIG. 18).
 (STEP111におけるS111aの詳細)
 動き補償導出部309111は、参照画像に対して垂直動き補償フィルタ(mcFilterVer)を適用する。その後、垂直動き補償フィルタを適用した参照画像に水平動き補償フィルタ(mcFilterHor)をさらに適用することにより、動き補償画像P0及びP1を導出する。
(Details of S111a in STEP111)
The motion compensation deriving unit 309111 applies a vertical motion compensation filter (mcFilterVer) to the reference image. Then, the motion compensation images P0 and P1 are derived by further applying a horizontal motion compensation filter (mcFilterHor) to the reference image to which the vertical motion compensation filter is applied.
 左上ブロック座標(xPb, yPb)のブロック内座標(x, y)の参照画像の整数位置(xInt, yInt)及び位相(xFrac, yFrac)は、
 xInt = xPb + (mvLX[0] >> 2) + x
 xFrac = mvLX[0] & 3
 yInt = yPb + (mvLX[1] >> 2) + y
 yFrac = mvLX[1] & 3
である。ここでは動きベクトルの精度を1/4ペル精度と仮定しているが、動きベクトル精度はこれに限定されず、1/8, 1/16,…, 1/64等でもよい。動きベクトル精度が1/M pel精度の場合には、上述の式において、整数位置xInt, yIntを導出するためのシフト値をlog2(M)、位相xFrac, yFracを導出するための論理和(&)に使う値をM-1とした以下の式A8を用いればよい。
The integer position (xInt, yInt) and phase (xFrac, yFrac) of the reference image of the in-block coordinates (x, y) of the upper left block coordinates (xPb, yPb) are
xInt = xPb + (mvLX [0] >> 2) + x
xFrac = mvLX [0] & 3
yInt = yPb + (mvLX [1] >> 2) + y
yFrac = mvLX [1] & 3
It is. Here, the accuracy of the motion vector is assumed to be 1/4 pel accuracy, but the motion vector accuracy is not limited to this, and may be 1/8, 1/16,. When the motion vector accuracy is 1 / M pel accuracy, in the above formula, the shift value for deriving the integer positions xInt, yInt is log2 (M) and the logical sum for deriving the phases xFrac, yFrac (& The following formula A8 may be used in which the value used for () is M-1.
 xInt = xPb + (mvLX[0] >> (log2(M))) + x
 xFrac = mvLX[0] & (M-1)
 yInt = yPb + (mvLX[1] >> (log2(M))) + y
 yFrac = mvLX[1] & (M-1)   (式A8)
 フィルタ係数のビット深度が例えばMC_ACCUの場合、フィルタ後画像のビット深度は、参照画像のビット深度bitDepthYにMC_ACCUを加算した値であるbitDepthY + MC_ACCUとなる。フィルタ後画像のビット深度を参照画像のビット深度に戻すには、ダイナミックレンジを調整するための右シフトとして、MC_ACCUだけの右シフトが必要になる。ここで、2つのフィルタが直列処理である場合、1回目のフィルタ演算の出力では、bitDepthよりも高い中間ビット深度INTERNAL_BIT_DEPTHを用い、2回目のフィルタ演算の出力において、INTERNAL_BIT_DEPTHからbitDepthに戻すことが適当である。この場合、1回目、及び2回目のフィルタのダイナミックレンジを調整するためのシフト値shift1、shift2は各々、以下に設定すればよい。
xInt = xPb + (mvLX [0] >> (log2 (M))) + x
xFrac = mvLX [0] & (M-1)
yInt = yPb + (mvLX [1] >> (log2 (M))) + y
yFrac = mvLX [1] & (M-1) (Formula A8)
When the bit depth of the filter coefficient is, for example, MC_ACCU, the bit depth of the filtered image is bitDepthY + MC_ACCU, which is a value obtained by adding MC_ACCU to the bit depth bitDepthY of the reference image. In order to return the bit depth of the filtered image to the bit depth of the reference image, a right shift of only MC_ACCU is required as a right shift for adjusting the dynamic range. Here, when the two filters are serial processing, it is appropriate to use the intermediate bit depth INTERNAL_BIT_DEPTH higher than bitDepth in the output of the first filter operation and return from INTERNAL_BIT_DEPTH to bitDepth in the output of the second filter operation. It is. In this case, the shift values shift1 and shift2 for adjusting the dynamic range of the first and second filters may be set as follows.
 shift1 = bitDepthY - (INTERNAL_BIT_DEPTH - MC_ACCU)
 shift2 = MC_ACCU (= 6)    (式A9)
 ここで、bitDepthY は参照画像のビット深度、INTERNAL_BIT_DEPTHは中間ビット深度、MC_ACCUは動き補償フィルタmcFilterの精度をそれぞれ表す。なお、MC_ACCUは6に限定されず、3~10等の値を用いることができる。
shift1 = bitDepthY-(INTERNAL_BIT_DEPTH-MC_ACCU)
shift2 = MC_ACCU (= 6) (Formula A9)
Here, bitDepthY represents the bit depth of the reference image, INTERNAL_BIT_DEPTH represents the intermediate bit depth, and MC_ACCU represents the accuracy of the motion compensation filter mcFilter. Note that MC_ACCU is not limited to 6, and a value such as 3 to 10 can be used.
 垂直動き補償フィルタmcFilterVerにより、x = 0 .. BLKW - 1、y = 0 .. BLKH - 1、k
= 0 .. TAP-1、offset1 = 1 << (shift1 - 1)において、動き補償フィルタの係数mcFilter[][]と参照画像refImg[][]の積和をシフト値shift1により値域(ダイナミックレンジ)を調整した値として、
 temp[x][y] = (ΣmcFilterVer[yFrac][k] * refImg[xInt][yInt + k - NTAPS/2 + 1] +offset1) >> shift1
 bitDepth(temp[][]) = bitDepthY + MC_ACCU - shift1 = INTERNAL_BIT_DEPTH (= 14)   (式A10)
により中間データとして用いられる一時的画像temp[][]が導出される。ここでbitDepth(temp[][])は一時的画像temp[][]のビット深度を示す。一時的画像temp[][]のビット深度は、参照画像のビット深度bitDepthYと動き補償フィルタの精度MC_ACCUの和から、フィルタ処理での右シフト値shift1だけ引いた値となる。この値をここでは、中間ビット深度INTERNAL_BIT DEPTHと呼ぶ。
With vertical motion compensation filter mcFilterVer, x = 0 .. BLKW-1, y = 0 .. BLKH-1, k
= 0 .. TAP-1, offset1 = 1 << (shift1-1), the product sum of the coefficient mcFilter [] [] of the motion compensation filter and the reference image refImg [] [] )
temp [x] [y] = (ΣmcFilterVer [yFrac] [k] * refImg [xInt] [yInt + k-NTAPS / 2 + 1] + offset1) >> shift1
bitDepth (temp [] []) = bitDepthY + MC_ACCU-shift1 = INTERNAL_BIT_DEPTH (= 14) (Formula A10)
Thus, a temporary image temp [] [] used as intermediate data is derived. Here, bitDepth (temp [] []) indicates the bit depth of the temporary image temp [] []. The bit depth of the temporary image temp [] [] is a value obtained by subtracting the right shift value shift1 in the filter processing from the sum of the bit depth bitDepthY of the reference image and the accuracy MC_ACCU of the motion compensation filter. This value is referred to herein as the intermediate bit depth INTERNAL_BIT DEPTH.
 一方、水平動き補償フィルタmcFilterHorにより、x = 0 .. BLKW - 1、y = 0 .. BLKH - 1、k = 0 .. TAP-1、offset2 = 1 << (shift2 - 1) において、垂直動き補償フィルタmcFilterVerで導出された一時的画像temp [][]の積和をシフト値shift2により値域を調整した値として、
 PX[x][y] = (ΣmcFilterHor[xFrac][k] * temp[x + k - NTAPS/2 + 1][y] + offset2) >> shift2
 bitDepth(PX[][]) = INTERNAL_BIT DEPTH + MC_ACCU - shift2 = INTERNAL_BIT_DEPTH   (式A11)
により動き補償画像PX[][]が導出される(PXは、P0若しくはP1)。この処理によって利用される8タップの動き補償フィルタmcFilterVer、mcFilterHorの具体例として、動き補償フィルタmcFilter [nFrac][pos](nFrac=0..NPHASES-1, pos = 0..NTAPS-1)を図15の(a)に示す。NPHASESは位相の個数、NTAPSはタップ数を示す。
On the other hand, the horizontal motion compensation filter mcFilterHor allows vertical motion at x = 0 .. BLKW-1, y = 0 .. BLKH-1, k = 0 .. TAP-1, offset2 = 1 << (shift2-1) The product sum of the temporary image temp [] [] derived by the compensation filter mcFilterVer is used as the value obtained by adjusting the range by the shift value shift2.
PX [x] [y] = (ΣmcFilterHor [xFrac] [k] * temp [x + k-NTAPS / 2 + 1] [y] + offset2) >> shift2
bitDepth (PX [] []) = INTERNAL_BIT DEPTH + MC_ACCU-shift2 = INTERNAL_BIT_DEPTH (Formula A11)
Is used to derive a motion compensated image PX [] [] (PX is P0 or P1). As a specific example of the 8-tap motion compensation filters mcFilterVer and mcFilterHor used by this processing, a motion compensation filter mcFilter [nFrac] [pos] (nFrac = 0..NPHASES-1, pos = 0..NTAPS-1) is used. As shown in FIG. NPHASES indicates the number of phases, and NTAPS indicates the number of taps.
 (STEP111におけるS111bの詳細)
 次に、勾配導出部309112が水平勾配画像lx0及びlx1を導出する場合について説明する。
(Details of S111b in STEP 111)
Next, the case where the gradient deriving unit 309112 derives the horizontal gradient images lx0 and lx1 will be described.
 水平勾配画像lxXは、勾配導出部309112が、垂直動き補償フィルタmcFilterVerをかけた後に水平勾配フィルタgradFilterHorをかけることによって得られる。勾配導出部309112は、上記の式A10によって導出された一時的画像temp[][]に対し、水平勾配フィルタgradFilterHorをかけることにより、以下の式A12のように水平勾配画像lxXを導出する。 The horizontal gradient image lxX is obtained by the gradient derivation unit 309112 applying the horizontal gradient filter gradFilterHor after applying the vertical motion compensation filter mcFilterVer. The gradient deriving unit 309112 applies the horizontal gradient filter gradFilterHor to the temporary image temp [] [] derived by the above equation A10 to derive the horizontal gradient image lxX as in the following equation A12.
 lxX[x][y] = (ΣgradFilterHor[xFrac][k] * temp[x + k - NTAPS/2 + 1][y] + offset2) >> shift2
 bitDepth(lxX[][]) = INTERNAL_BIT DEPTH + GRAD_ACCU - shift2 = INTERNAL_BIT_DEPTH   (式A12)
 ここで、x = 0 .. BLKW - 1、y = 0 .. BLKH - 1、k = 0 .. NTAPS - 1、offset2 = 1 << (shift2 - 1)、lxXは、lx0若しくはlx1である。bitDepth(lxX[][])はフィルタ処理画像lxX[][]のビット深度を示す。GRAD_ACCUは勾配フィルタgradFilter(gradFilterHorもしくはgradFilterVer)の精度を表す。このように設定された8タップの勾配フィルタgradFilterの具体例として、勾配フィルタgradFilter[nFrac][pos](nFrac=0..NPHASES-1, pos = 0..NTAPS-1)を図15の(b)に示す。
lxX [x] [y] = (ΣgradFilterHor [xFrac] [k] * temp [x + k-NTAPS / 2 + 1] [y] + offset2) >> shift2
bitDepth (lxX [] []) = INTERNAL_BIT DEPTH + GRAD_ACCU-shift2 = INTERNAL_BIT_DEPTH (Formula A12)
Here, x = 0..BLKW-1, y = 0..BLKH-1, k = 0..NTAPS-1, offset2 = 1 << (shift2-1), lxX is lx0 or lx1. bitDepth (lxX [] []) indicates the bit depth of the filtered image lxX [] []. GRAD_ACCU represents the accuracy of the gradient filter gradFilter (gradFilterHor or gradFilterVer). As a specific example of the 8-tap gradient filter gradFilter set in this way, the gradient filter gradFilter [nFrac] [pos] (nFrac = 0..NPHASES-1, pos = 0..NTAPS-1) is shown in FIG. Shown in b).
 次に、勾配導出部309112が垂直勾配画像ly0及びly1を導出する場合について説明する。 Next, the case where the gradient deriving unit 309112 derives the vertical gradient images ly0 and ly1 will be described.
 勾配導出部309112は、L0参照画像refImgL0及びL1参照画像refImgL1を参照して垂直勾配フィルタ(gradFilterVer)を適用した後、次に水平動き補償フィルタ(mcFilterHor)を適用することにより、垂直勾配画像ly0及びly1を導出する。 The gradient derivation unit 309112 applies the vertical gradient filter (gradFilterVer) with reference to the L0 reference image refImgL0 and the L1 reference image refImgL1, and then applies the horizontal motion compensation filter (mcFilterHor) to thereby obtain the vertical gradient image ly0 and Derive ly1.
 temp[x][y] = (ΣgradFilterVer[yFrac][i] * refImg[xInt][yInt + i - NTAPS/2 + 1]+ offset1) >> shift1
 bitDepth(temp[][]) = bitDepthY + GRAD_ACCU - shift1 = INTERNAL_BIT DEPTH (= 14)   (式A13)
により、一時的画像temp[][]が導出される。
temp [x] [y] = (ΣgradFilterVer [yFrac] [i] * refImg [xInt] [yInt + i-NTAPS / 2 + 1] + offset1) >> shift1
bitDepth (temp [] []) = bitDepthY + GRAD_ACCU-shift1 = INTERNAL_BIT DEPTH (= 14) (Formula A13)
Thus, a temporary image temp [] [] is derived.
 このtemp[x][y]に対し、一方、水平動き補償フィルタmcFilterHorをかけることにより、垂直勾配画像lyXを導出する。 On the other hand, a vertical gradient image lyX is derived by applying a horizontal motion compensation filter mcFilterHor to this temp [x] [y].
 lxX[x][y] = (ΣmcFilterHor[xFrac][i] * temp[x + i - NTAPS/2 + 1][y] + offset2)>> shift2
 bitDepth(PX[][]) = INTERNAL_BIT_DEPTH + MC_ACCU - shift2 = INTERNAL_BIT_DEPTH   (式A14)
 (STEP112の詳細)
 勾配積導出部309121は、上記の式A5によって得られる値が最小となる補正重みベクトル(u, v)を、最小二乗法を用いて導出してもよい。
lxX [x] [y] = (ΣmcFilterHor [xFrac] [i] * temp [x + i-NTAPS / 2 + 1] [y] + offset2) >> shift2
bitDepth (PX [] []) = INTERNAL_BIT_DEPTH + MC_ACCU-shift2 = INTERNAL_BIT_DEPTH (Formula A14)
(Details of STEP112)
The gradient product deriving unit 309121 may derive the correction weight vector (u, v) that minimizes the value obtained by the above equation A5 using the least square method.
 (STEP112におけるS112bの詳細)
 勾配補正係数導出部309122は、実際には小数点精度の演算が必要な補正重みベクトル(u, v)の代わりに、例えば、uをshiftBIOビット左シフトした整数値であるuh(すなわち、uh = u << shiftBIO)、vをshiftBIOビット左シフトした整数値であるvh(すなわち、vh = v << shiftBIO)を用いて、整数演算を行ってもよい。shiftBIO = 5の場合、1/32の精度となる。例えば、最適化法の一つであるcoordinate descentでは、あるvを仮定する元となるu(uh)を導出し、次に導出されたu(uh)を用いてv(vh)を導出することを繰り返す。最初にv = 0と仮定して式A8にcoordinate descentを適用すると
 uh = (s3 << 5)/s1
 vh = ((s6 << 5) - s2 * uh) / s5   (式A15)
と補正重みベクトル(ここでは、uh, vh)が求められる。
(Details of S112b in STEP112)
The gradient correction coefficient deriving unit 309122 is, for example, an integer value obtained by shifting u to the left by shift BIO bits instead of the correction weight vector (u, v) that actually requires calculation of decimal point precision. << shiftBIO), vh may be an integer value obtained by shifting v to the left by shiftBIO bits (that is, vh = v << shiftBIO). When shiftBIO = 5, the precision is 1/32. For example, in coordinate descent, which is one of the optimization methods, derive u (uh) from which to assume a certain v, and then derive v (vh) using the derived u (uh). repeat. Assuming v = 0 first and applying coordinate descent to equation A8, uh = (s3 << 5) / s1
vh = ((s6 << 5)-s2 * uh) / s5 (Formula A15)
And a correction weight vector (here, uh, vh) are obtained.
 なお、s2 = s4であるから、上記式A15ではs2の代わりにs4を用いてもよい。 Since s2 = s4, s4 may be used instead of s2 in the above formula A15.
 勾配補正係数導出部309122は、uh及びvhを所定の値域(-rangeBIO~rangeBIO)にクリップ処理を行う。すなわち、勾配補正係数導出部309122は、
 rangeBIO = (1 << shiftBIO) * MVTH
 uh = clip3(-rangeBIO, rangeBIO, uh)
 vh = clip3(-rangeBIO, rangeBIO, vh)    (式A16)
という式によって表されるクリップ処理を行う。なお、MVTHは例えば2/3pelである。
The gradient correction coefficient deriving unit 309122 performs clip processing on uh and vh in a predetermined range (-rangeBIO to rangeBIO). That is, the gradient correction coefficient derivation unit 309122
rangeBIO = (1 << shiftBIO) * MVTH
uh = clip3 (-rangeBIO, rangeBIO, uh)
vh = clip3 (-rangeBIO, rangeBIO, vh) (Formula A16)
Clip processing represented by the expression In addition, MVTH is 2 / 3pel, for example.
 (STEP113の詳細)
 勾配補正双予測導出部30913は、STEP112において導出した補正重みベクトル(u, v)を式A3に代入して勾配補正項modBIOを導出し、予測画像の画素値Predを、上記の式A6を用いて導出する。なお、勾配補正項modBIOを1/2に弱めて、上記の式A7のように使用してもよい。
(Details of STEP113)
The gradient correction bi-prediction derivation unit 30913 derives the gradient correction term modBIO by substituting the correction weight vector (u, v) derived in STEP 112 into the equation A3, and the pixel value Pred of the predicted image is calculated using the equation A6. To derive. The slope correction term modBIO may be weakened to 1/2 and used as in the above equation A7.
 勾配補正双予測導出部30913による整数演算においては、上記の式A2に示す予測式を用いて、予測画像の画素値Predを導出する。勾配補正双予測導出部30913は、勾配補正項modBIOを、
 modBIO = {(lx0 - lx1) * uh + (ly0 - ly1) * vh} >> shiftBIO2   (式A17)
という式を用いて導出する。なお、
 shiftBIO2 = shiftBIO + bitDepth(mcImg) - bitDepth(gradImg) + 1 (式A18)
である。
In the integer calculation by the gradient correction bi-prediction derivation unit 30913, the pixel value Pred of the predicted image is derived using the prediction formula shown in the above formula A2. The gradient correction bi-prediction derivation unit 30913 calculates the gradient correction term modBIO,
modBIO = {(lx0-lx1) * uh + (ly0-ly1) * vh} >> shiftBIO2 (Formula A17)
It is derived using the following formula. In addition,
shiftBIO2 = shiftBIO + bitDepth (mcImg)-bitDepth (gradImg) + 1 (Formula A18)
It is.
 ここで、bitDepth(mcImg)は動き補償画像のビット深度であり、bitDepth(gradImg)は、勾配画像のビット深度である。 Here, bitDepth (mcImg) is the bit depth of the motion compensated image, and bitDepth (gradImg) is the bit depth of the gradient image.
 動き補償フィルタの精度MV_ACCUが勾配フィルタの精度GRAD_ACCUに等しい場合には、bitDepth(mcImg)=bitDepth(gradImg)となる。このことから、式A18は、単純化され、
 shiftBIO2 = shiftBIO + 1   (式A19)
となる。
When the accuracy MV_ACCU of the motion compensation filter is equal to the accuracy GRAD_ACCU of the gradient filter, bitDepth (mcImg) = bitDepth (gradImg). From this, equation A18 is simplified and
shiftBIO2 = shiftBIO + 1 (Formula A19)
It becomes.
 (動き補償部3091の機能の具体例)
 上述の動き補償部3091の機能について、以下に図19及び図20を用いてより詳細に説明する。
(Specific example of function of motion compensation unit 3091)
The function of the motion compensation unit 3091 described above will be described in more detail below with reference to FIGS. 19 and 20.
 図19は、動き補償部3091がBIOパディングを実行する領域を示す図である。図20は、動き補償部3091が画面外パディングを実行する場合の例を示す図である。なお、「パディング」とは、画素のない領域に画素を生成する処理を指す。本実施形態では、「パディング」の一例として、読み込み領域及び参照画像の境界の画素を上下左右にコピーして、当該境界の外の画素を生成する方法を用いる。以下では、参照画像の境界の外の画素を生成することを「画面外パディング」と称し、動き補償処理に必要な読み込み領域(MC読み込み領域)の境界の外の画素を生成することを「BIOパディング」と称する。 FIG. 19 is a diagram illustrating an area where the motion compensation unit 3091 performs BIO padding. FIG. 20 is a diagram illustrating an example when the motion compensation unit 3091 performs off-screen padding. Note that “padding” refers to a process of generating a pixel in an area without a pixel. In this embodiment, as an example of “padding”, a method is used in which pixels at the boundary between the reading area and the reference image are copied vertically and horizontally to generate pixels outside the boundary. Hereinafter, generating a pixel outside the boundary of the reference image is referred to as “off-screen padding”, and generating a pixel outside the boundary of the reading area (MC reading area) necessary for motion compensation processing is referred to as “BIO”. This is called “padding”.
 図19におけるNは、参照画像において、符号化対象ブロックと同じ位置のブロックである対応ブロックの幅及び高さを示す。Tは、動き補償フィルタのフィルタタップ数であり、参照画像に動き補償フィルタが施される画素数である。また、(N+T-1)*(N+T-1)の画素の領域は、動き補償に必要なMC読み込み領域を示す。また、TBはBIOモードにおいて用いられる勾配フィルタのフィルタタップ数である。例えば、T=8、TB=6等の値が用いられる。 N in FIG. 19 indicates the width and height of a corresponding block that is a block at the same position as the encoding target block in the reference image. T is the number of filter taps of the motion compensation filter, and is the number of pixels on which the motion compensation filter is applied to the reference image. The pixel area of (N + T-1) * (N + T-1) indicates an MC reading area necessary for motion compensation. TB is the number of filter taps of the gradient filter used in the BIO mode. For example, values such as T = 8 and TB = 6 are used.
 なお、上述の「参照画像の画面外」とは、参照画像の外側を意味し、具体的には、図20に示す参照画像の幅pic_width及び高さpic_hightの領域の外側の領域(例えば、図20の縦線の領域)のことを意味する。また、上述の参照ブロックが参照画像の画面外に係る場合とは、図20に示すように、動きベクトルが指し示す参照ブロックの少なくとも一部が参照画像の境界より外にはみ出す場合と表現することもできる。なお、ここでは対応ブロックの幅と高さとがともにNの例を説明するが、幅と高さとは異なる値でもよい。 The above-mentioned “outside of the reference image” means the outside of the reference image. Specifically, the region outside the reference image width pic_width and height pic_hight shown in FIG. 20 vertical line areas). Further, the case where the above-described reference block is outside the screen of the reference image can also be expressed as a case where at least a part of the reference block indicated by the motion vector protrudes beyond the boundary of the reference image, as shown in FIG. it can. Here, an example in which the width and height of the corresponding block are both N will be described, but the width and height may be different values.
 ここで、単予測モード及び双予測モード等のBIOモード以外の予測モードを用いた動き補償において、参照ブロックが画面内のみに係る場合、動き補償部3091は、図19のMC読み込み領域である(N+T-1)*(N+T-1)の画素を読み込む。 Here, in the motion compensation using a prediction mode other than the BIO mode such as the uni-prediction mode and the bi-prediction mode, when the reference block is only in the screen, the motion compensation unit 3091 is the MC reading area in FIG. N + T-1) * (N + T-1) pixels are read.
 一方、動き補償部3091は、BIOモードを用いて勾配画像を生成する際に、対応ブロックの重み係数(勾配補正係数)を得るために、MC読み込み領域(N+T-1)*(N+T-1)の画素を読み込む。ここで、本来、BIOモードを用いた勾配画像を生成する際には、図19のMC読み込み領域(N+T-1)*(N+T-1)の画素に加えて、図19の斜線部分の領域の画素が必要である。そのため、動き補償部3091は、図19に示すように、参照ブロックの斜線部分に示す領域であるMC読み込み領域外にはみ出す部分は、MC読み込み領域の境界の画素を用いてパディング画素を生成(BIOパディングを実行)して勾配画像を生成する。 On the other hand, when generating a gradient image using the BIO mode, the motion compensation unit 3091 obtains an MC reading area (N + T−1) * (N +) in order to obtain a weight coefficient (gradient correction coefficient) of the corresponding block. Read pixel of T-1). Here, when a gradient image originally using the BIO mode is generated, in addition to the pixels in the MC reading area (N + T-1) * (N + T-1) in FIG. 19, the diagonal lines in FIG. Partial area pixels are required. For this reason, as shown in FIG. 19, the motion compensation unit 3091 generates padding pixels using the pixels at the boundary of the MC reading area in the portion that protrudes outside the MC reading area, which is the area indicated by the hatched portion of the reference block (BIO Execute padding) to generate a gradient image.
 このように、BIOモードでは、参照ブロックが参照画像の画面外にはみ出さない場合であっても、参照ブロックのうち、読み込み領域外にはみ出す領域に対しては、動き補償部3091は、BIOパディングを行う。 As described above, in the BIO mode, even if the reference block does not protrude from the screen of the reference image, the motion compensation unit 3091 performs the BIO padding on the region of the reference block that protrudes outside the reading region. I do.
 そのため、図20に示されるように、参照ブロックが参照画像の画面外にはみ出した際には、画面外の画素を生成するための画面外パディングと、MC読み込み領域外の画素を生成するためのBIOパディングとの両方が必要である。したがって、画面外パディングとBIOパディングとの2つのパディングモジュールが必要となり、実装規模が大きくなる。また、画面外パディングとBIOパディングとの両者が必要であると、パディングの処理量も大きくなる。 Therefore, as shown in FIG. 20, when the reference block protrudes outside the screen of the reference image, off-screen padding for generating a pixel outside the screen and a pixel for generating a pixel outside the MC reading area are generated. Both BIO padding is required. Therefore, two padding modules, that is, off-screen padding and BIO padding are required, and the mounting scale becomes large. Also, if both off-screen padding and BIO padding are required, the amount of padding processing increases.
 これに対し、動き補償部3091は、参照ブロックの一部が参照画像の画面外に係る場合、BIOモードを禁止する。すなわち、参照ブロックの一部が参照画像の画面外に係る場合には、BIOモードを行わないため、動き補償部3091は、画面外パディングとBIOパディングとの両方を行う必要がなくなる。 On the other hand, the motion compensation unit 3091 prohibits the BIO mode when a part of the reference block is outside the screen of the reference image. That is, when a part of the reference block is outside the screen of the reference image, the BIO mode is not performed, and thus the motion compensation unit 3091 does not need to perform both the off-screen padding and the BIO padding.
 以下に、動き補償部3091による予測画像の生成の具体例を説明する。 Hereinafter, a specific example of generation of a predicted image by the motion compensation unit 3091 will be described.
 (動き補償部3091による予測画像の生成の具体例1)
 まず、図18及び図21を用いて動き補償部3091による予測画像の生成の具体例1について説明する。図21は、動き補償部3091がBIOモードを用いた予測画像の生成を実行(許可)するか否かを判定する処理の流れの一例を示すフローチャートである。
(Specific example 1 of generation of predicted image by motion compensation unit 3091)
First, a specific example 1 of generation of a predicted image by the motion compensation unit 3091 will be described with reference to FIGS. FIG. 21 is a flowchart illustrating an example of a flow of processing for determining whether or not the motion compensation unit 3091 executes (permits) generation of a predicted image using the BIO mode.
 STEP121において、動き補償部3091は、参照ブロックの少なくとも一部が参照画像の画面外に係るかどうかを判定する。参照ブロックの少なくとも一部が画面外に係ると動き補償部3091が判定した場合(STEP121のYes)、動き補償部3091は、BIOモードを用いた予測画像の生成を禁止する(STEP123)。この場合、図21の後に続く処理では、動き補償部3091は、図19に示されるようなMC読み込み領域(N+T-1)*(N+T-1)の画素を読み込み、単予測モード又は双予測モードによって予測画像を生成し処理を終了する。 In STEP 121, the motion compensation unit 3091 determines whether at least a part of the reference block is outside the screen of the reference image. When the motion compensation unit 3091 determines that at least a part of the reference block is outside the screen (YES in STEP 121), the motion compensation unit 3091 prohibits generation of a predicted image using the BIO mode (STEP 123). In this case, in the processing following FIG. 21, the motion compensation unit 3091 reads the pixels in the MC reading area (N + T-1) * (N + T-1) as shown in FIG. Alternatively, a prediction image is generated in the bi-prediction mode, and the process ends.
 STEP121において、参照ブロックが参照画像の画面外に係らないと動き補償部3091が判定した場合(STEP121のNo)、すなわち、参照ブロックが参照画像の画面内にあると動き補償部3091が判定した場合、図21のSTEP122に進む。 In STEP 121, when the motion compensation unit 3091 determines that the reference block is not outside the screen of the reference image (No in STEP 121), that is, when the motion compensation unit 3091 determines that the reference block is within the screen of the reference image. The process proceeds to STEP 122 in FIG.
 STEP122において、動き補償部3091は、BIOモードを許可する。この場合、図21の後に続く処理(例えば図18の処理)では、動き補償部3091は、図19に示されるようなMC読み込み領域(N+T-1)*(N+T-1)の画素を読み込み、動き補償画像を生成する(図18のS111a)。続いて、動き補償部3091は、MC読み込み領域の外側のパディング領域(斜線部)の画素を読み込み、図18のS111b~S113bを実行してBIOモードの予測画像を生成して処理を終了する。 In STEP122, the motion compensation unit 3091 permits the BIO mode. In this case, in the processing subsequent to FIG. 21 (for example, the processing in FIG. 18), the motion compensation unit 3091 stores the MC reading area (N + T−1) * (N + T−1) as shown in FIG. Pixels are read and a motion compensated image is generated (S111a in FIG. 18). Subsequently, the motion compensation unit 3091 reads pixels in the padding area (shaded area) outside the MC reading area, executes S111b to S113b in FIG. 18, generates a predicted image in the BIO mode, and ends the process.
 なお、後述の式A20に示すように、動き補償部3091は、以下の(1)~(4)を判定することで、参照ブロックの少なくとも一部が画面外に係るか否かを判定してもよい。
(1)参照ブロックの左上及び左下のx座標が、参照画像の左境界の画素のx座標未満であるか否か
(2)参照ブロックの右上及び右下のx座標が、参照画像の右境界の画素のx座標より大きいか否か
(3)参照ブロックの左上座標及び右上座標のy座標が、参照画像の上境界の画素のy座標未満であるか否か
(4)参照ブロックの左下座標及び右下座標のy座標が、参照画像の下境界の画素のy座標より大きいか否か
 (動き補償部3091による予測画像の生成の具体例2)
 上述の例では、動き補償部3091は、動きベクトルが指し示す参照ブロックの少なくとも一部が参照画像の境界から少しでもはみ出していれば、BIOモードを禁止しているが、本実施形態ではこれに限定されない。
Note that, as shown in Equation A20, which will be described later, the motion compensation unit 3091 determines whether at least a part of the reference block is outside the screen by determining the following (1) to (4). Also good.
(1) Whether the upper left and lower left x coordinates of the reference block are less than the x coordinate of the pixel at the left boundary of the reference image. (2) The upper right and lower right x coordinates of the reference block are the right boundary of the reference image. (3) Whether the upper left coordinate and the upper right coordinate of the reference block are less than the y coordinate of the upper boundary pixel of the reference image (4) The lower left coordinate of the reference block And whether the y coordinate of the lower right coordinate is larger than the y coordinate of the lower boundary pixel of the reference image (specific example 2 of generation of a predicted image by the motion compensation unit 3091)
In the above example, the motion compensation unit 3091 prohibits the BIO mode if at least a part of the reference block indicated by the motion vector protrudes from the boundary of the reference image, but in the present embodiment, the motion compensation unit 3091 is limited to this. Not.
 以下に、図22を用いて動き補償部3091による予測画像の生成の具体例2について説明する。図22は、動き補償部3091がBIOモードを用いた予測画像生成を実行(許可)するか否かを判定する処理の流れの別の例を示すフローチャートである。 Hereinafter, specific example 2 of generation of a prediction image by the motion compensation unit 3091 will be described with reference to FIG. FIG. 22 is a flowchart illustrating another example of a flow of processing for determining whether or not the motion compensation unit 3091 executes (permits) prediction image generation using the BIO mode.
 STEP131において、動き補償部3091は、参照ブロックの少なくとも一部が参照画像の境界から一定範囲よりも外であるか否かを判定する。 In STEP 131, the motion compensation unit 3091 determines whether or not at least a part of the reference block is outside a certain range from the boundary of the reference image.
 例えば、図20のように動きベクトルが指し示す参照ブロックの一部が参照画像の境界からはみ出している場合、動き補償部3091は、参照ブロックが参照画像から水平方向にはみ出している長さoutWと、垂直方向にはみ出している長さoutHとを測定する。続いて、動き補償部3091は、当該水平方向にはみ出している長さoutWと、予め定められた一定範囲の水平方向における長さを示すpadWとを比較する。また、動き補償部3091は、垂直方向にはみ出している長さoutHと、予め定められた一定範囲の垂直方向における長さを示すpadHとを比較する。 For example, as shown in FIG. 20, when a part of the reference block indicated by the motion vector protrudes from the boundary of the reference image, the motion compensation unit 3091 has a length outW that the reference block protrudes from the reference image in the horizontal direction, The length outH protruding in the vertical direction is measured. Subsequently, the motion compensation unit 3091 compares the length outW that protrudes in the horizontal direction with padW that indicates the length in the horizontal direction within a predetermined range. In addition, the motion compensation unit 3091 compares the length outH protruding in the vertical direction with padH indicating the length in a predetermined range in the vertical direction.
 padW及びpadHは、図20に示すような参照画像の境界から一定範囲の水平方向及び垂直方向の距離であり、例えばpadW = 128、padH = 128としてもよい。また、例えばpadW = T/2-1、padH = T/2-1としてもよい。また、参照画像の境界から一定範囲の上側の距離と、下側の距離と、右側の距離と、右側の距離とは、各々異なる値でもよい。例えば、参照画像の境界から一定範囲の上側の距離、下側の距離、右側の距離及び右側の距離を、各々padH_upper、padH_lower、padW_left及びpadW_rightとしたとする。この場合、padH_upper = 64、padH_lower = 63、padW_left = 128及びpadW_right = 127等としてもよい。 PadW and padH are distances in the horizontal and vertical directions within a certain range from the boundary of the reference image as shown in FIG. Further, for example, padW = T / 2-1 and padH = T / 2-1 may be set. Further, the upper distance, the lower distance, the right distance, and the right distance in a certain range from the boundary of the reference image may be different values. For example, assume that the upper distance, lower distance, right distance, and right distance within a certain range from the boundary of the reference image are padH_upper, padH_lower, padW_left, and padW_right, respectively. In this case, padH_upper = 64, padH_lower = 63, padW_left = 128, padW_right = 127, and the like.
 水平方向にはみ出している長さがpadWよりも長い場合(outW > padW)、及び/又は、垂直方向にはみ出している長さがpadHよりも長い場合(outH > padH)、動き補償部3091は、参照ブロックの少なくとも一部が参照画像の境界から一定範囲よりも外であると判定する。 When the length protruding in the horizontal direction is longer than padW (outW> padW) and / or when the length protruding in the vertical direction is longer than padH (outH> padH), the motion compensation unit 3091 is: It is determined that at least a part of the reference block is outside a certain range from the boundary of the reference image.
 なお、後述の式A21に示すように、動き補償部3091は、以下の(1)~(4)を判定することで、参照ブロックの少なくとも一部が参照画像の境界から一定範囲よりも外であるか否かを判定してもよい。
(1)参照ブロックの左上及び左下のx座標が、参照画像の境界から一定範囲よりも外の画素のx座標未満であるか否か
(2)参照ブロックの右上及び右下のx座標が、参照画像の境界から一定範囲よりも外の画素のx座標より大きいか否か
(3)参照ブロックの左上座標及び右上座標のy座標が、参照画像の境界から一定範囲よりも外の画素のy座標未満であるか否か
(4)参照ブロックの左下座標及び右下座標のy座標が、参照画像の境界から一定範囲よりも外の画素のy座標より大きいか否か
 参照ブロックの少なくとも一部が参照画像の境界から一定範囲よりも外であると動き補償部3091が判定した場合(STEP131のYes)、動き補償部3091は、BIOモードを禁止する。すなわち、動き補償部3091はBIOモードを実行しない(STEP133)。この場合、動き補償部3091は、上述の具体例1と同様に、単予測モード又は双予測モードによって予測画像を生成し、処理を終了する。
Note that, as shown in Expression A21 described later, the motion compensation unit 3091 determines the following (1) to (4), so that at least a part of the reference block is outside a certain range from the boundary of the reference image. It may be determined whether or not there is.
(1) Whether the upper left and lower left x coordinates of the reference block are less than the x coordinate of a pixel outside a certain range from the boundary of the reference image (2) the upper right and lower right x coordinates of the reference block are Whether or not the x coordinate of the pixel outside the certain range from the boundary of the reference image is larger than (3) the y coordinate of the upper left coordinate and the upper right coordinate of the reference block is y of the pixel outside the certain range from the boundary of the reference image Whether or not it is less than the coordinates (4) Whether or not the y coordinate of the lower left coordinate and the lower right coordinate of the reference block is larger than the y coordinate of a pixel outside a certain range from the boundary of the reference image At least a part of the reference block When the motion compensation unit 3091 determines that is outside a certain range from the boundary of the reference image (Yes in STEP 131), the motion compensation unit 3091 prohibits the BIO mode. That is, the motion compensation unit 3091 does not execute the BIO mode (STEP 133). In this case, the motion compensation unit 3091 generates a prediction image in the uni-prediction mode or the bi-prediction mode, as in the first specific example, and ends the process.
 STEP131において、参照ブロックの少なくとも一部が参照画像の境界から一定範囲よりも外ではないと動き補償部3091が判定した場合(STEP131のNo)、STEP132に進む。 In STEP 131, when the motion compensation unit 3091 determines that at least a part of the reference block is not out of a certain range from the boundary of the reference image (No in STEP 131), the process proceeds to STEP 132.
 STEP132において、動き補償部3091は、上述の具体例1と同様にBIOモードを用いて予測画像を生成し、処理を終了する。 In STEP132, the motion compensation unit 3091 generates a predicted image using the BIO mode in the same manner as in the first specific example, and ends the process.
 このように、動き補償部3091は、参照ブロックの少なくとも一部が参照画像の境界から一定範囲よりも外である場合にBIOモードを禁止してもよい。すなわち、動き補償部3091はBIOモードを実行しないでもよい。 Thus, the motion compensation unit 3091 may prohibit the BIO mode when at least a part of the reference block is outside a certain range from the boundary of the reference image. That is, the motion compensation unit 3091 may not execute the BIO mode.
 これにより、参照ブロックの少なくとも一部が参照画像の境界からはみ出ていても、一定範囲よりも外側にはみ出ていない場合には、動き補償部3091はBIOモードを用いて高精度の予測画像を生成することができる。また、参照ブロックの少なくとも一部が参照画像の境界から一定範囲よりも外側である場合に、動き補償部3091は、BIOモードを禁止する。そのため、動き補償部3091は、参照画像の境界から一定範囲よりも外側である画面外領域についてパディング領域を予め生成しておけば、パディングを1種類に(BIOモードオンの場合には、BIOパディングのみ)に制限することができる。すなわち、動き補償部3091が、画面外パディングが予め実施されているような拡大参照画像を導出しておくことにより、参照画像の境界から一定範囲よりも外側である場合には、予めBIOが禁止されるため、BIOの処理を簡易化することができる。 As a result, when at least a part of the reference block protrudes from the boundary of the reference image but does not protrude outside the fixed range, the motion compensation unit 3091 generates a highly accurate predicted image using the BIO mode. can do. Further, when at least a part of the reference block is outside a certain range from the boundary of the reference image, the motion compensation unit 3091 prohibits the BIO mode. For this reason, if the motion compensation unit 3091 generates a padding area in advance for an out-of-screen area that is outside a certain range from the boundary of the reference image, the motion compensation unit 3091 reduces the padding to one type (when the BIO mode is on, Only). In other words, the motion compensation unit 3091 derives an enlarged reference image in which off-screen padding is performed in advance, so that the BIO is prohibited in advance when it is outside a certain range from the boundary of the reference image. Therefore, BIO processing can be simplified.
 このように、動き補償部3091は、BIOを行わない場合には、参照画像の境界から一定範囲よりも外側である画面外領域の参照が生じうるが、この場合も、パディングを1つのみ(BIOモードオフの場合には、画面外パディングのみ)に制限することができる。 As described above, when the BIO is not performed, the motion compensation unit 3091 can refer to an off-screen region that is outside a certain range from the boundary of the reference image. In this case, only one padding ( When the BIO mode is off, only off-screen padding can be limited.
 (STEP111における参照ブロックが参照画像の画面外に係るかの判定)
 以下に、動き補償部3091による、参照ブロックが参照画像の画面外に係るか否かの判定について、具体的に説明する。
(Determining whether the reference block in STEP 111 is outside the screen of the reference image)
Hereinafter, the determination by the motion compensation unit 3091 whether or not the reference block is outside the screen of the reference image will be specifically described.
 図21のSTEP121の「参照ブロックの少なくとも一部が画面外」の判定において、動き補償部3091は、以下の式A20-1~A20-4の少なくとも何れかを満たす場合に、参照ブロックが参照画像の画面外に係ると判定する。 In the determination of “at least a part of the reference block is outside the screen” in STEP 121 of FIG. 21, the motion compensation unit 3091 determines that the reference block is a reference image when at least one of the following expressions A20-1 to A20-4 is satisfied. It is determined that it falls outside the screen.
 以下の式A20-1は、動きベクトルの指し示す参照ブロックの左端が参照画像の画面外に係るか否かを判定する場合に用いる式である。また、式A20-2は、当該参照ブロックの右端が参照画像の画面外に係るか否かを判定する場合に用いる式である。式A20-3は、当該参照ブロックの上端が参照画像の画面外に係るか否かを判定する場合に用いる式である。式A20-4は、当該参照ブロックの下端が参照画像の画面外に係るか否かを判定する場合に用いる式である。 The following equation A20-1 is an equation used when determining whether or not the left end of the reference block indicated by the motion vector is outside the screen of the reference image. Expression A20-2 is an expression used when determining whether the right end of the reference block is outside the screen of the reference image. Expression A20-3 is an expression used when determining whether or not the upper end of the reference block is outside the screen of the reference image. Expression A20-4 is an expression used when determining whether or not the lower end of the reference block is outside the screen of the reference image.
 xInt - NTAPS/2 + 1 < 0            (式A20-1)
 xInt + BLKW + NTAPS/2 - 1> pic_width - 1   (式A20-2)
 yInt - NTAPS/2 + 1 < 0            (式A20-3)
 yInt + BLKH + NTAPS/2 - 1> pic_height - 1   (式A20-4)
 ここで、式A20-1~式A20-4におけるxInt及びyIntは、上述の式A8に示されるように、動きベクトル精度が1/M pel精度の場合における、左上ブロック座標(xPb, yPb)のブロック内座標(x, y)の参照画像における整数位置(xInt, yInt)及び位相(xFrac, yFrac)を指す。式A20-1~式A20-4におけるNTAPSは動き補償フィルタのフィルタタップ数を示す。式A20-1~式A20-4におけるBLKW及びBLKHは、それぞれ、対応ブロックの横幅及び高さを示す。また、式A20-1~式A20-4におけるpic_width及びpic_heightは、それぞれ、参照画像の横幅及び高さを示す。
xInt-NTAPS / 2 + 1 <0 (Formula A20-1)
xInt + BLKW + NTAPS / 2-1> pic_width-1 (Formula A20-2)
yInt-NTAPS / 2 + 1 <0 (Formula A20-3)
yInt + BLKH + NTAPS / 2-1> pic_height-1 (Formula A20-4)
Here, xInt and yInt in the equations A20-1 to A20-4 are the upper left block coordinates (xPb, yPb) when the motion vector accuracy is 1 / M pel accuracy, as shown in the above equation A8. Points to the integer position (xInt, yInt) and phase (xFrac, yFrac) in the reference image of the in-block coordinates (x, y). NTAPS in Expressions A20-1 to A20-4 indicates the number of filter taps of the motion compensation filter. BLKW and BLKH in the expressions A20-1 to A20-4 indicate the horizontal width and height of the corresponding block, respectively. Further, pic_width and pic_height in the expressions A20-1 to A20-4 indicate the horizontal width and height of the reference image, respectively.
 例えば、図19の場合、NTAPSはTに相当し、BLKW及びBLKHは、それぞれNに相当する。 For example, in the case of FIG. 19, NTAPS corresponds to T, and BLKW and BLKH each correspond to N.
 (STEP111における参照ブロックが画面境界から一定範囲外にあるかの判定)
 動き補償部3091は、参照ブロックが参照画像の画面外に係るかどうかを判定する代わりに、参照ブロックが参照画像の境界から一定範囲より外にあるかどうかを判定してもよい。
(Determining whether the reference block in STEP 111 is outside a certain range from the screen boundary)
The motion compensation unit 3091 may determine whether the reference block is outside a certain range from the boundary of the reference image, instead of determining whether the reference block is outside the screen of the reference image.
 この場合、図22のSTEP131の「参照ブロックの少なくとも一部が画面境界から一定範囲より外」の判定において、動き補償部3091は、以下の式A21-1~21-4の少なくとも何れかを満たす場合に、参照ブロックの少なくとも一部が参照画像の境界から一定範囲より外にあることを判定してもよい。 In this case, in STEP 131 of FIG. 22, in the determination that “at least a part of the reference block is out of a certain range from the screen boundary”, the motion compensation unit 3091 satisfies at least one of the following formulas A21-1 to 21-4: In this case, it may be determined that at least a part of the reference block is outside a certain range from the boundary of the reference image.
 以下の式A21-1は、動きベクトルの指し示す参照ブロックの左端が参照画像の境界から一定範囲より外にあるか否かを判定する場合に用いる式である。また、式A21-2は、当該参照ブロックの右端が参照画像の境界から一定範囲より外にあるか否かを判定する場合に用いる式である。式A21-3は、当該参照ブロックの上端が参照画像の境界から一定範囲より外にあるか否かを判定する場合に用いる式である。式A21-4は、当該参照ブロックの下端が参照画像の境界から一定範囲より外にあるか否かを判定する場合に用いる式である。 The following expression A21-1 is an expression used when determining whether or not the left end of the reference block indicated by the motion vector is outside a certain range from the boundary of the reference image. Expression A21-2 is an expression used when determining whether or not the right end of the reference block is outside a certain range from the boundary of the reference image. Expression A21-3 is an expression used when determining whether or not the upper end of the reference block is outside a certain range from the boundary of the reference image. Expression A21-4 is an expression used when determining whether or not the lower end of the reference block is outside a certain range from the boundary of the reference image.
 xInt - NTAPS/2 + 1 < -padW              (式A21-1)
 xInt + BLKW + NTAPS/2 - 1> pic_width + padW- 1    (式A21-2)
 yInt - NTAPS/2 + 1 < -padH              (式A21-3)
 yInt + BLKH + NTAPS/2 - 1> pic_height + padH - 1   (式A21-4)
 ここで、式A21-1~式A21-4におけるpadW及びpadHは、それぞれ、予め定められた水平方向における一定範囲を示すpadW、及び、予め定められた垂直方向における一定範囲を示すpadHを意味する。
xInt-NTAPS / 2 + 1 <-padW (Formula A21-1)
xInt + BLKW + NTAPS / 2-1> pic_width + padW-1 (Formula A21-2)
yInt-NTAPS / 2 + 1 <-padH (Formula A21-3)
yInt + BLKH + NTAPS / 2-1> pic_height + padH-1 (Formula A21-4)
Here, padW and padH in formulas A21-1 to A21-4 mean padW indicating a predetermined range in the horizontal direction and padH indicating a predetermined range in the vertical direction, respectively. .
 (画像符号化装置の構成)
 次に、実施形態1に係る画像符号化装置11の構成について説明する。図4は、実施形態1に係る画像符号化装置11の構成を示すブロック図である。画像符号化装置11は、予測画像生成部101、減算部102、変換・量子化部103、エントロピー符号化部104、逆量子化・逆変換部105、加算部106、ループフィルタ107、予測パラメータメモリ108、参照ピクチャメモリ109、符号化パラメータ決定部110及び予測パラメータ符号化部111を含んで構成される。予測パラメータ符号化部111は、インター予測パラメータ符号化部112及びイントラ予測パラメータ符号化部113を含んで構成される。
(Configuration of image encoding device)
Next, the configuration of the image encoding device 11 according to the first embodiment will be described. FIG. 4 is a block diagram illustrating a configuration of the image encoding device 11 according to the first embodiment. The image encoding device 11 includes a predicted image generation unit 101, a subtraction unit 102, a transform / quantization unit 103, an entropy encoding unit 104, an inverse quantization / inverse transform unit 105, an addition unit 106, a loop filter 107, and a prediction parameter memory. 108, a reference picture memory 109, an encoding parameter determination unit 110, and a prediction parameter encoding unit 111. The prediction parameter encoding unit 111 includes an inter prediction parameter encoding unit 112 and an intra prediction parameter encoding unit 113.
 予測画像生成部101は画像Tの各ピクチャについて、そのピクチャを分割した領域である符号化ユニットCU毎に予測ユニットPUの予測画像Pを生成する。ここで、予測画像生成部101は、予測パラメータ符号化部111から入力された予測パラメータに基づいて参照ピクチャメモリ109から復号済のブロックを読み出す。予測パラメータ符号化部111から入力された予測パラメータとは、例えばインター予測の場合、動きベクトルである。予測画像生成部101は、対象PUを起点として動きベクトルが示す参照画像上の位置にあるブロックを読み出す。またイントラ予測の場合、予測パラメータとは例えばイントラ予測モードである。イントラ予測モードにおいて使用される隣接PUの画素値を参照ピクチャメモリ109から読み出し、PUの予測画像Pを生成する。予測画像生成部101は、読み出した参照ピクチャブロックについて複数の予測方式のうちの1つの予測方式を用いてPUの予測画像Pを生成する。予測画像生成部101は、生成したPUの予測画像Pを減算部102に出力する。 The predicted image generation unit 101 generates, for each picture of the image T, a predicted image P of the prediction unit PU for each coding unit CU that is an area obtained by dividing the picture. Here, the predicted image generation unit 101 reads a decoded block from the reference picture memory 109 based on the prediction parameter input from the prediction parameter encoding unit 111. The prediction parameter input from the prediction parameter encoding unit 111 is, for example, a motion vector in the case of inter prediction. The predicted image generation unit 101 reads a block at a position on the reference image indicated by the motion vector with the target PU as a starting point. In the case of intra prediction, the prediction parameter is, for example, an intra prediction mode. A pixel value of an adjacent PU used in the intra prediction mode is read from the reference picture memory 109, and a predicted image P of the PU is generated. The predicted image generation unit 101 generates a predicted image P of the PU using one prediction method among a plurality of prediction methods for the read reference picture block. The predicted image generation unit 101 outputs the generated predicted image P of the PU to the subtraction unit 102.
 なお、予測画像生成部101は、既に説明した予測画像生成部308と同じ動作である。例えば、図6は、予測画像生成部101に含まれるインター予測画像生成部1011の構成を示すブロック図である。インター予測画像生成部1011は、動き補償部10111、重み予測部10112を含んで構成される。動き補償部10111及び重み予測部10112については、上述の動き補償部3091及び重み予測部3094のそれぞれと同様の構成であるためここでの説明を省略する。 Note that the predicted image generation unit 101 performs the same operation as the predicted image generation unit 308 already described. For example, FIG. 6 is a block diagram illustrating a configuration of the inter predicted image generation unit 1011 included in the predicted image generation unit 101. The inter prediction image generation unit 1011 includes a motion compensation unit 10111 and a weight prediction unit 10112. Since the motion compensation unit 10111 and the weight prediction unit 10112 have the same configurations as the motion compensation unit 3091 and the weight prediction unit 3094 described above, description thereof is omitted here.
 予測画像生成部101は、予測パラメータ符号化部から入力されたパラメータを用いて、参照ピクチャメモリから読み出した参照ブロックの画素値をもとにPUの予測画像Pを生成する。予測画像生成部101で生成した予測画像は減算部102、加算部106に出力される。 The prediction image generation unit 101 generates a prediction image P of the PU based on the pixel value of the reference block read from the reference picture memory, using the parameter input from the prediction parameter encoding unit. The predicted image generated by the predicted image generation unit 101 is output to the subtraction unit 102 and the addition unit 106.
 減算部102は、予測画像生成部101から入力されたPUの予測画像Pの信号値を、画像Tの対応するPUの画素値から減算して、残差信号を生成する。減算部102は、生成した残差信号を変換・量子化部103に出力する。 The subtraction unit 102 subtracts the signal value of the predicted image P of the PU input from the predicted image generation unit 101 from the pixel value of the corresponding PU of the image T, and generates a residual signal. The subtraction unit 102 outputs the generated residual signal to the transform / quantization unit 103.
 変換・量子化部103は、減算部102から入力された残差信号について周波数変換を行い、変換係数を算出する。変換・量子化部103は、算出した変換係数を量子化して量子化係数を求める。変換・量子化部103は、求めた量子化係数をエントロピー符号化部104及び逆量子化・逆変換部105に出力する。 The transform / quantization unit 103 performs frequency transform on the residual signal input from the subtraction unit 102 and calculates a transform coefficient. The transform / quantization unit 103 quantizes the calculated transform coefficient to obtain a quantized coefficient. The transform / quantization unit 103 outputs the obtained quantization coefficient to the entropy coding unit 104 and the inverse quantization / inverse transform unit 105.
 エントロピー符号化部104には、変換・量子化部103から量子化係数が入力され、予測パラメータ符号化部111から符号化パラメータが入力される。入力される符号化パラメータには、例えば、参照ピクチャインデックスrefIdxLX、予測ベクトルインデックスmvp_LX_idx、差分ベクトルmvdLX、予測モードpredMode、及びマージインデックスmerge_idx等の符号がある。 The entropy encoding unit 104 receives the quantization coefficient from the transform / quantization unit 103 and receives the encoding parameter from the prediction parameter encoding unit 111. Examples of input encoding parameters include codes such as a reference picture index refIdxLX, a prediction vector index mvp_LX_idx, a difference vector mvdLX, a prediction mode predMode, and a merge index merge_idx.
 エントロピー符号化部104は、入力された量子化係数と符号化パラメータをエントロピー符号化して符号化ストリームTeを生成し、生成した符号化ストリームTeを外部に出力する。 The entropy encoding unit 104 generates an encoded stream Te by entropy encoding the input quantization coefficient and encoding parameter, and outputs the generated encoded stream Te to the outside.
 逆量子化・逆変換部105は、変換・量子化部103から入力された量子化係数を逆量子化して変換係数を求める。逆量子化・逆変換部105は、求めた変換係数について逆周波数変換を行い、残差信号を算出する。逆量子化・逆変換部105は、算出した残差信号を加算部106に出力する。 The inverse quantization / inverse transform unit 105 inversely quantizes the quantization coefficient input from the transform / quantization unit 103 to obtain a transform coefficient. The inverse quantization / inverse transform unit 105 performs inverse frequency transform on the obtained transform coefficient to calculate a residual signal. The inverse quantization / inverse transform unit 105 outputs the calculated residual signal to the addition unit 106.
 加算部106は、予測画像生成部101から入力されたPUの予測画像Pの信号値と逆量子化・逆変換部105から入力された残差信号の信号値を画素毎に加算して、復号画像を生成する。加算部106は、生成した復号画像を参照ピクチャメモリ109に記憶する。 The addition unit 106 adds the signal value of the prediction image P of the PU input from the prediction image generation unit 101 and the signal value of the residual signal input from the inverse quantization / inverse conversion unit 105 for each pixel, and performs decoding. Generate an image. The adding unit 106 stores the generated decoded image in the reference picture memory 109.
 ループフィルタ107は加算部106が生成した復号画像に対し、デブロッキングフィルタ、サンプル適応オフセット(SAO)、適応ループフィルタ(ALF)を施す。 The loop filter 107 performs a deblocking filter, a sample adaptive offset (SAO), and an adaptive loop filter (ALF) on the decoded image generated by the adding unit 106.
 予測パラメータメモリ108は、符号化パラメータ決定部110が生成した予測パラメータを、符号化対象のピクチャ及びCU毎に予め定めた位置に記憶する。 The prediction parameter memory 108 stores the prediction parameter generated by the encoding parameter determination unit 110 at a predetermined position for each encoding target picture and CU.
 参照ピクチャメモリ109は、ループフィルタ107が生成した復号画像を、符号化対象のピクチャ及びCU毎に予め定めた位置に記憶する。 The reference picture memory 109 stores the decoded image generated by the loop filter 107 at a predetermined position for each picture and CU to be encoded.
 符号化パラメータ決定部110は、符号化パラメータの複数のセットのうち、1つのセットを選択する。符号化パラメータとは、上述した予測パラメータ及びこの予測パラメータに関連して生成される符号化の対象となるパラメータである。予測画像生成部101は、これらの符号化パラメータのセットの各々を用いてPUの予測画像Pを生成する。 The encoding parameter determination unit 110 selects one set from among a plurality of sets of encoding parameters. The encoding parameter is a parameter to be encoded that is generated in association with the above-described prediction parameter and the prediction parameter. The predicted image generation unit 101 generates a predicted image P of the PU using each of these encoding parameter sets.
 符号化パラメータ決定部110は、複数のセットの各々について情報量の大きさと符号化誤差を示すコスト値を算出する。コスト値は、例えば、符号量と二乗誤差に係数λを乗じた値との和である。符号量は、量子化誤差と符号化パラメータをエントロピー符号化して得られる符号化ストリームTeの情報量である。二乗誤差は、減算部102において算出された残差信号の残差値の二乗値についての画素間の総和である。係数λは、予め設定されたゼロよりも大きい実数である。符号化パラメータ決定部110は、算出したコスト値が最小となる符号化パラメータのセットを選択する。これにより、エントロピー符号化部104は、選択した符号化パラメータのセットを符号化ストリームTeとして外部に出力し、選択されなかった符号化パラメータのセットを出力しない。符号化パラメータ決定部110は決定した符号化パラメータを予測パラメータメモリ108に記憶する。 The encoding parameter determination unit 110 calculates a cost value indicating the amount of information and the encoding error for each of a plurality of sets. The cost value is, for example, the sum of a code amount and a square error multiplied by a coefficient λ. The code amount is the information amount of the encoded stream Te obtained by entropy encoding the quantization error and the encoding parameter. The square error is the sum between pixels regarding the square value of the residual value of the residual signal calculated by the subtracting unit 102. The coefficient λ is a real number larger than a preset zero. The encoding parameter determination unit 110 selects a set of encoding parameters that minimizes the calculated cost value. As a result, the entropy encoding unit 104 outputs the selected set of encoding parameters to the outside as the encoded stream Te, and does not output the set of unselected encoding parameters. The encoding parameter determination unit 110 stores the determined encoding parameter in the prediction parameter memory 108.
 予測パラメータ符号化部111は、符号化パラメータ決定部110から入力されたパラメータから、符号化するための形式を導出し、エントロピー符号化部104に出力する。符号化するための形式の導出とは、例えば動きベクトルと予測ベクトルから差分ベクトルを導出することである。また予測パラメータ符号化部111は、符号化パラメータ決定部110から入力されたパラメータから予測画像を生成するために必要なパラメータを導出し、予測画像生成部101に出力する。予測画像を生成するために必要なパラメータとは、例えばサブブロック単位の動きベクトルである。 The prediction parameter encoding unit 111 derives a format for encoding from the parameters input from the encoding parameter determination unit 110 and outputs the format to the entropy encoding unit 104. Deriving the format for encoding is, for example, deriving a difference vector from a motion vector and a prediction vector. Also, the prediction parameter encoding unit 111 derives parameters necessary for generating a prediction image from the parameters input from the encoding parameter determination unit 110 and outputs the parameters to the prediction image generation unit 101. The parameter necessary for generating the predicted image is, for example, a motion vector in units of sub-blocks.
 インター予測パラメータ符号化部112は、符号化パラメータ決定部110から入力された予測パラメータに基づいて、差分ベクトルのようなインター予測パラメータを導出する。インター予測パラメータ符号化部112は、予測画像生成部101に出力する予測画像の生成に必要なパラメータを導出する構成として、インター予測パラメータ復号部303(図5等、参照)がインター予測パラメータを導出する構成と一部同一の構成を含む。インター予測パラメータ符号化部112の構成については、後述する。 The inter prediction parameter encoding unit 112 derives an inter prediction parameter such as a difference vector based on the prediction parameter input from the encoding parameter determination unit 110. The inter prediction parameter encoding unit 112 derives parameters necessary for generating a prediction image to be output to the prediction image generating unit 101, and an inter prediction parameter decoding unit 303 (see FIG. 5 and the like) derives inter prediction parameters. Some of the configurations are the same as the configuration to be performed. The configuration of the inter prediction parameter encoding unit 112 will be described later.
 イントラ予測パラメータ符号化部113は、符号化パラメータ決定部110から入力されたイントラ予測モードIntraPredModeから、符号化するための形式(例えばMPM_idx、rem_intra_luma_pred_mode等)を導出する。 The intra prediction parameter encoding unit 113 derives a format (for example, MPM_idx, rem_intra_luma_pred_mode) for encoding from the intra prediction mode IntraPredMode input from the encoding parameter determination unit 110.
 (インター予測パラメータ符号化部の構成)
 次に、インター予測パラメータ符号化部112の構成について説明する。インター予測パラメータ符号化部112は、図11のインター予測パラメータ復号部303に対応する手段であり、図9に構成を示す。
(Configuration of inter prediction parameter encoding unit)
Next, the configuration of the inter prediction parameter encoding unit 112 will be described. The inter prediction parameter encoding unit 112 is a unit corresponding to the inter prediction parameter decoding unit 303 in FIG. 11, and the configuration is shown in FIG. 9.
 インター予測パラメータ符号化部112は、インター予測パラメータ符号化制御部1121、AMVP予測パラメータ導出部1122、減算部1123、サブブロック予測パラメータ導出部1125、及び図示しない、分割モード導出部、マージフラグ導出部、インター予測識別子導出部、参照ピクチャインデックス導出部及びベクトル差分導出部等を含んで構成される。分割モード導出部、マージフラグ導出部、インター予測識別子導出部、参照ピクチャインデックス導出部及びベクトル差分導出部は各々、PU分割モードpart_mode、マージフラグmerge_flag、インター予測識別子inter_pred_idc、参照ピクチャインデックスrefIdxLX及び差分ベクトルmvdLXを導出する。インター予測パラメータ符号化部112は、動きベクトル(mvLX、subMvLX)と参照ピクチャインデックスrefIdxLX、PU分割モードpart_mode、インター予測識別子inter_pred_idc、又はこれらを示す情報を予測画像生成部101に出力する。またインター予測パラメータ符号化部112は、PU分割モードpart_mode、マージフラグmerge_flag、マージインデックスmerge_idx、インター予測識別子inter_pred_idc、参照ピクチャインデックスrefIdxLX、予測ベクトルインデックスmvp_LX_idx、差分ベクトルmvdLX及びサブブロック予測モードフラグsubPbMotionFlagをエントロピー符号化部104に出力する。 The inter prediction parameter encoding unit 112 includes an inter prediction parameter encoding control unit 1121, an AMVP prediction parameter derivation unit 1122, a subtraction unit 1123, a sub-block prediction parameter derivation unit 1125, and a partition mode derivation unit and a merge flag derivation unit (not shown). , An inter prediction identifier deriving unit, a reference picture index deriving unit, a vector difference deriving unit, and the like. The partition mode deriving unit, the merge flag deriving unit, the inter prediction identifier deriving unit, the reference picture index deriving unit, and the vector difference deriving unit are respectively a PU partition mode part_mode, a merge flag merge_flag, an inter prediction identifier inter_pred_idc, a reference picture index refIdxLX, and a difference vector Derives mvdLX. The inter prediction parameter encoding unit 112 outputs the motion vector (mvLX, subMvLX), the reference picture index refIdxLX, the PU partition mode part_mode, the inter prediction identifier inter_pred_idc, or information indicating these to the predicted image generation unit 101. Also, the inter prediction parameter encoding unit 112 entropy PU partition mode part_mode, merge flag merge_flag, merge index merge_idx, inter prediction identifier inter_pred_idc, reference picture index refIdxLX, prediction vector index mvp_LX_idx, difference vector mvdLX and sub-block prediction mode flag subPbMotionFlag. The data is output to the encoding unit 104.
 インター予測パラメータ符号化制御部1121は、マージインデックス導出部11211とベクトル候補インデックス導出部11212を含む。マージインデックス導出部11211は、符号化パラメータ決定部110から入力された動きベクトル及び参照ピクチャインデックスを、予測パラメータメモリ108から読み出したマージ候補のPUが持つ動きベクトル及び参照ピクチャインデックスと比較して、マージインデックスmerge_idxを導出し、エントロピー符号化部104に出力する。マージ候補とは、符号化対象となる符号化対象CUから予め定めた範囲にある参照PU(例えば、符号化対象ブロックの左下端、左上端及び右上端に接する参照PU)であって、符号化処理が完了したPUである。ベクトル候補インデックス導出部11212は予測ベクトルインデックスmvp_LX_idxを導出する。 The inter prediction parameter encoding control unit 1121 includes a merge index deriving unit 11211 and a vector candidate index deriving unit 11212. The merge index derivation unit 11211 compares the motion vector and reference picture index input from the encoding parameter determination unit 110 with the motion vector and reference picture index of the merge candidate PU read from the prediction parameter memory 108, and performs merge An index merge_idx is derived and output to the entropy encoding unit 104. The merge candidate is a reference PU (for example, a reference PU in contact with the lower left end, upper left end, and upper right end of the encoding target block) within a predetermined range from the encoding target CU to be encoded. The PU has been processed. The vector candidate index deriving unit 11212 derives a prediction vector index mvp_LX_idx.
 サブブロック予測パラメータ導出部1125には、符号化パラメータ決定部110がサブブロック予測モードの使用を決定した場合、subPbMotionFlagの値に従って、空間サブブロック予測、時間サブブロック予測、アフィン予測及びマッチング動き導出の何れかのサブブロック予測の動きベクトルと参照ピクチャインデックスを導出する。動きベクトルと参照ピクチャインデックスは、画像復号装置の説明で述べたように、隣接PU及び参照ピクチャブロック等の動きベクトル並びに参照ピクチャインデックスを予測パラメータメモリ108から読み出し、導出する。 When the encoding parameter determination unit 110 determines to use the sub-block prediction mode, the sub-block prediction parameter derivation unit 1125 performs spatial sub-block prediction, temporal sub-block prediction, affine prediction, and matching motion derivation according to the value of subPbMotionFlag. A motion vector and a reference picture index for any sub-block prediction are derived. As described in the description of the image decoding apparatus, the motion vector and the reference picture index are derived by reading out the motion vector such as the adjacent PU and the reference picture block and the reference picture index from the prediction parameter memory 108.
 AMVP予測パラメータ導出部1122は、上述のAMVP予測パラメータ導出部3032(図11参照)と同様な構成を有する。 The AMVP prediction parameter derivation unit 1122 has the same configuration as the AMVP prediction parameter derivation unit 3032 (see FIG. 11).
 すなわち、予測モードpredModeがインター予測モードを示す場合、AMVP予測パラメータ導出部1122には符号化パラメータ決定部110から動きベクトルmvLXが入力される。AMVP予測パラメータ導出部1122は、入力された動きベクトルmvLXに基づいて予測ベクトルmvpLXを導出する。AMVP予測パラメータ導出部1122は、導出した予測ベクトルmvpLXを減算部1123に出力する。なお、参照ピクチャインデックスrefIdx及び予測ベクトルインデックスmvp_LX_idxは、エントロピー符号化部104に出力される。 That is, when the prediction mode predMode indicates the inter prediction mode, the motion vector mvLX is input from the encoding parameter determination unit 110 to the AMVP prediction parameter derivation unit 1122. The AMVP prediction parameter derivation unit 1122 derives a prediction vector mvpLX based on the input motion vector mvLX. The AMVP prediction parameter derivation unit 1122 outputs the derived prediction vector mvpLX to the subtraction unit 1123. Note that the reference picture index refIdx and the prediction vector index mvp_LX_idx are output to the entropy encoding unit 104.
 減算部1123は、符号化パラメータ決定部110から入力された動きベクトルmvLXから、AMVP予測パラメータ導出部1122から入力された予測ベクトルmvpLXを減算して差分ベクトルmvdLXを生成する。差分ベクトルmvdLXはエントロピー符号化部104に出力される。 The subtraction unit 1123 subtracts the prediction vector mvpLX input from the AMVP prediction parameter derivation unit 1122 from the motion vector mvLX input from the coding parameter determination unit 110 to generate a difference vector mvdLX. The difference vector mvdLX is output to the entropy encoding unit 104.
 〔実施形態2〕
 画像復号装置の予測画像生成部におけるインター予測画像生成部の機能は、実施形態1に係る画像伝送システム1の画像復号装置31の予測画像生成部308におけるインター予測画像生成部309の機能に限定されない。当該インター予測画像生成部の機能は、予測画像生成部308の代わりに、又は、加えて、画像伝送システム1a(不図示)の画像復号装置31aの予測画像生成部308aにおけるインター予測画像生成部309aの機能を備えていてもよい。
[Embodiment 2]
The function of the inter prediction image generation unit in the prediction image generation unit of the image decoding device is not limited to the function of the inter prediction image generation unit 309 in the prediction image generation unit 308 of the image decoding device 31 of the image transmission system 1 according to the first embodiment. . The inter-predicted image generation unit functions as an inter-predicted image generation unit 309a in the predicted image generation unit 308a of the image decoding device 31a of the image transmission system 1a (not shown) instead of or in addition to the predicted image generation unit 308. You may have the function of.
 実施形態2について、図23~27を参照して説明する。なお、説明の便宜上、実施形態1にて説明した部材と同じ機能を有する部材については、同じ符号を付記し、その説明を省略する。 Embodiment 2 will be described with reference to FIGS. For convenience of explanation, members having the same functions as those described in the first embodiment are denoted by the same reference numerals and description thereof is omitted.
 (画像伝送システムの構成)
 画像伝送システム1aは、実施形態1における画像符号化装置11及び画像復号装置31の代わりに、画像符号化装置11a(不図示)及び画像復号装置31aを備えている。
(Configuration of image transmission system)
The image transmission system 1a includes an image encoding device 11a (not shown) and an image decoding device 31a instead of the image encoding device 11 and the image decoding device 31 in the first embodiment.
 (画像復号装置の構成)
 図23は、本実施形態に係る画像復号装置31aの要部構成を示すブロック図である。図23に示されるように、本実施形態に係る画像復号装置31aは、実施形態1における予測画像生成部308の代わりに、予測画像生成部308aを備えている。
(Configuration of image decoding device)
FIG. 23 is a block diagram showing a main configuration of the image decoding device 31a according to the present embodiment. As illustrated in FIG. 23, the image decoding device 31a according to the present embodiment includes a predicted image generation unit 308a instead of the predicted image generation unit 308 in the first embodiment.
 また、図23に示されるように、予測画像生成部308aは、実施形態1におけるインター予測画像生成部309の代わりに、インター予測画像生成部309aを備えている。この点以外は、予測画像生成部308aは、実施形態1における予測画像生成部308と同様の構成である。 23, the predicted image generation unit 308a includes an inter predicted image generation unit 309a instead of the inter predicted image generation unit 309 in the first embodiment. Except for this point, the predicted image generation unit 308a has the same configuration as the predicted image generation unit 308 in the first embodiment.
 (インター予測画像生成部309a)
 図24は、実施形態2に係る予測画像生成部308aに含まれるインター予測画像生成部309aの構成を示すブロック図である。
(Inter prediction image generation unit 309a)
FIG. 24 is a block diagram illustrating a configuration of an inter predicted image generation unit 309a included in the predicted image generation unit 308a according to the second embodiment.
 図24に示されるように、インター予測画像生成部309aは、実施形態1における動き補償部3091の代わりに、動き補償部3091aを備えている。 24, the inter prediction image generation unit 309a includes a motion compensation unit 3091a instead of the motion compensation unit 3091 in the first embodiment.
 (動き補償部3091a)
 動き補償部3091aは、第1の参照画像及び第2の参照画像の少なくとも何れかにおける対応ブロックに関するMC読み込み領域外の画素値である読み込み領域外画素値を生成する。ここで、動き補償部3091aは、BIOモードを用いて予測画像を生成する場合、垂直方向又は水平方向に沿ったMC読み込み領域外画素値の生成処理を禁止する。すなわち、動き補償部3091aは、BIOモードを用いて予測画像を生成する場合、垂直方向又は水平方向におけるBIOパディングを禁止する。
(Motion compensation unit 3091a)
The motion compensation unit 3091a generates a pixel value outside the reading region, which is a pixel value outside the MC reading region regarding the corresponding block in at least one of the first reference image and the second reference image. Here, when generating a predicted image using the BIO mode, the motion compensation unit 3091a prohibits the generation process of the pixel value outside the MC reading area along the vertical direction or the horizontal direction. That is, the motion compensation unit 3091a prohibits BIO padding in the vertical direction or the horizontal direction when generating a predicted image using the BIO mode.
 (動き補償部3091aの機能の具体例)
 上述の動き補償部3091aの機能について、以下に図25~27を用いてより詳細に説明する。
(Specific example of function of motion compensation unit 3091a)
The function of the motion compensation unit 3091a described above will be described in more detail below with reference to FIGS.
 図25及び26は、動き補償部3091aがBIOパディングを実行する領域を示す図である。図27は、隣接するブロックにおける動きベクトルを示す図である。 25 and 26 are diagrams illustrating regions in which the motion compensation unit 3091a executes BIO padding. FIG. 27 is a diagram illustrating motion vectors in adjacent blocks.
 例えば、動き補償部3091aが、水平方向に沿ったMC読み込み領域外画素値の生成処理を禁止する場合、動き補償部3091aは、図25に斜線によって示されるパディング領域において垂直方向のみBIOパディングを行う。 For example, when the motion compensation unit 3091a prohibits the generation process of the pixel value outside the MC reading area along the horizontal direction, the motion compensation unit 3091a performs BIO padding only in the vertical direction in the padding region indicated by the diagonal lines in FIG. .
 この構成によれば、水平方向のBIOパディングが行われないため、水平方向に隣接するブロックが同じ動きベクトルを有する場合(図27の(a))、これらのブロックをマージして1つの対応ブロックとみなすことができる。そのため、動き補償部3091aは、水平方向に隣接するブロックが同じ動きベクトルを有する場合に、これらのブロックをマージし、1つの対応ブロックとみなし、当該対応ブロックの参照ブロックを参照して予測画像を生成してもよい。 According to this configuration, since BIO padding in the horizontal direction is not performed, when blocks adjacent in the horizontal direction have the same motion vector ((a) in FIG. 27), these blocks are merged to form one corresponding block. Can be considered. Therefore, when the horizontally adjacent blocks have the same motion vector, the motion compensation unit 3091a merges these blocks, regards them as one corresponding block, and refers to the reference block of the corresponding block to obtain a predicted image. It may be generated.
 このように、動き補償部3091aは、水平方向のBIOパディングを禁止する構成の場合、対応ブロックと、当該対応ブロックに水平方向に隣接するブロックであって、対応ブロックと同じ動きベクトルを有する隣接ブロックとをマージして処理してもよい。これにより、全体の処理量を少なくすることができる。 As described above, the motion compensation unit 3091a, when configured to prohibit horizontal BIO padding, is a corresponding block and a block adjacent to the corresponding block in the horizontal direction and having the same motion vector as the corresponding block. And may be processed by merging. Thereby, the entire processing amount can be reduced.
 また、上述の構成によれば、動き補償部3091aがブロックの境界毎に、別々にBIOパディングを行う場合に比べて、メモリバンド幅を小さくすることができる。すなわち、動き補償部3091aが2つのブロックに対して別々にBIOパディングを行う場合に比べて、メモリバンド幅を小さくすることができる。 Also, according to the above-described configuration, the memory bandwidth can be reduced as compared with the case where the motion compensation unit 3091a performs BIO padding separately for each block boundary. That is, the memory bandwidth can be reduced as compared with the case where the motion compensation unit 3091a performs BIO padding on two blocks separately.
 また、動き補償部3091aは、水平方向におけるBIOパディングを禁止する構成に代えて、垂直方向におけるBIOパディングを禁止してもよい。この場合、動き補償部3091aは、図26に斜線によって示されるパディング領域においてBIOパディングを行う。 Further, the motion compensation unit 3091a may prohibit the BIO padding in the vertical direction instead of the configuration for prohibiting the BIO padding in the horizontal direction. In this case, the motion compensation unit 3091a performs BIO padding in the padding area indicated by hatching in FIG.
 この構成では、垂直方向のBIOパディングが行われないため、垂直方向に隣接するブロックが同じ動きベクトルを有する場合(図27の(b))、これらのブロックをマージして1つの対応ブロックとみなすことができる。そのため、動き補償部3091aは、垂直方向に隣接するブロックが同じ動きベクトルを有する場合に、これらのブロックをマージし、1つの対応ブロックとみなし、当該対応ブロックの参照ブロックを参照して予測画像を生成してもよい。 In this configuration, since BIO padding in the vertical direction is not performed, when adjacent blocks in the vertical direction have the same motion vector ((b) in FIG. 27), these blocks are merged and regarded as one corresponding block. be able to. Therefore, when the adjacent blocks in the vertical direction have the same motion vector, the motion compensation unit 3091a merges these blocks, regards them as one corresponding block, and refers to the reference block of the corresponding block to obtain a predicted image. It may be generated.
 このように、動き補償部3091aは、垂直方向のBIOパディングを禁止する構成の場合、対応ブロックと、対応ブロックに垂直方向に隣接するブロックであって、対応ブロックと同じ動きベクトルを有する隣接ブロックとをマージして処理する。これにより、全体の処理量を少なくすることができる。 As described above, the motion compensation unit 3091a, when configured to prohibit vertical BIO padding, includes a corresponding block and a neighboring block that is adjacent to the corresponding block in the vertical direction and has the same motion vector as the corresponding block. Merge and process. Thereby, the entire processing amount can be reduced.
 なお、動き補償部3091aは、BIOパディングを禁止する方向を水平方向にするか、垂直方向にするか否かを選択する選択部4000(不図示)を備えていてもよい。例えば、当該選択部4000は、以下の具体例に示すように、同じ動きベクトルを有するブロックが水平方向及び垂直方向の何れに隣接するかによって、上述のBIOパディングを禁止する方向を水平方向にするか、垂直方向にするか否かを選択してもよい。 Note that the motion compensation unit 3091a may include a selection unit 4000 (not shown) that selects whether the direction in which BIO padding is prohibited is the horizontal direction or the vertical direction. For example, as shown in the following specific example, the selection unit 4000 sets the direction for prohibiting the BIO padding to the horizontal direction depending on whether the block having the same motion vector is adjacent to the horizontal direction or the vertical direction. Alternatively, it may be selected whether or not the vertical direction is used.
 (動き補償部3091aによる読み込み領域外画素値の生成の具体例1)
 まず、動き補償部3091aによる読み込み領域外画素値の生成の具体例1について図28を用いて説明する。図28は、動き補償部3091aがBIOモードを用いて予測画像を生成する場合、水平方向におけるBIOパディングを禁止するか否かを判定する処理の流れの一例を示すフローチャートである。
(Specific Example 1 of Generation of Pixel Value Outside Reading Area by Motion Compensation Unit 3091a)
First, specific example 1 of generation of a pixel value outside the reading area by the motion compensation unit 3091a will be described with reference to FIG. FIG. 28 is a flowchart illustrating an example of a processing flow for determining whether to prohibit BIO padding in the horizontal direction when the motion compensation unit 3091a generates a predicted image using the BIO mode.
 STEP211において、動き補償部3091aは、水平及び垂直方向の両方のBIOパディングを許可(実行)できる状態にしておく。 In STEP 211, the motion compensation unit 3091a is allowed to execute (permit) both horizontal and vertical BIO padding.
 STEP212において、動き補償部3091aは、対応ブロックの動きベクトルと、当該対応ブロックに水平方向に隣接するブロックの動きベクトルとが同じか否かを判定する。 In STEP 212, the motion compensation unit 3091a determines whether or not the motion vector of the corresponding block is the same as the motion vector of the block adjacent to the corresponding block in the horizontal direction.
 対応ブロックの動きベクトルと、当該対応ブロックに水平方向に隣接するブロックの動きべクトルとが同じであると動き補償部3091aが判定した場合(STEP212のYes)、STEP213に進む。対応ブロックの動きベクトルと、当該対応ブロックに水平方向に隣接するブロックの動きべクトルとが同じでないと動き補償部3091aが判定した場合(STEP212のNo)、動き補償部3091aは、水平方向及び垂直方向の両方においてBIOパディングを行い、処理を終了する。 When the motion compensation unit 3091a determines that the motion vector of the corresponding block and the motion vector of the block adjacent to the corresponding block in the horizontal direction are the same (YES in STEP 212), the process proceeds to STEP 213. When the motion compensation unit 3091a determines that the motion vector of the corresponding block is not the same as the motion vector of a block adjacent to the corresponding block in the horizontal direction (No in STEP 212), the motion compensation unit 3091a BIO padding is performed in both directions, and the process ends.
 STEP213において、動き補償部3091aは、水平方向におけるBIOパディングを禁止し、垂直方向におけるBIOパディングのみを実行し、処理を終了する。 In STEP 213, the motion compensation unit 3091a prohibits BIO padding in the horizontal direction, executes only BIO padding in the vertical direction, and ends the process.
 (動き補償部3091aによる読み込み領域外画素値の生成の具体例2)
 次に、動き補償部3091aによる読み込み領域外画素値の生成の具体例2について図29を用いて説明する。図29は、動き補償部3091aがBIOモードを用いて予測画像を生成する場合、垂直方向におけるBIOパディングを禁止するか否かを判定する処理の流れの一例を示すフローチャートである。図29におけるSTEP221は、図28におけるSTEP211と同じなので説明を省略する。
(Specific Example 2 of Generation of Pixel Value Outside Reading Area by Motion Compensation Unit 3091a)
Next, specific example 2 of generation of a pixel value outside the reading area by the motion compensation unit 3091a will be described with reference to FIG. FIG. 29 is a flowchart illustrating an example of a process flow for determining whether to prohibit BIO padding in the vertical direction when the motion compensation unit 3091a generates a predicted image using the BIO mode. Since STEP 221 in FIG. 29 is the same as STEP 211 in FIG. 28, description thereof is omitted.
 STEP222において、動き補償部3091aは、対応ブロックの動きベクトルと、当該対応ブロックに垂直方向に隣接するブロックの動きべクトルとが同じか否かを判定する。 In STEP 222, the motion compensation unit 3091a determines whether or not the motion vector of the corresponding block is the same as the motion vector of the block adjacent to the corresponding block in the vertical direction.
 対応ブロックの動きベクトルと、当該対応ブロックに垂直方向に隣接するブロックの動きべクトルとが同じであると動き補償部3091aが判定した場合(STEP222のYes)、STEP223に進む。対応ブロックの動きベクトルと、当該対応ブロックに垂直方向に隣接するブロックの動きべクトルとが同じでないと動き補償部3091aが判定した場合(STEP222のNo)、動き補償部3091aは、水平方向及び垂直方向の両方においてBIOパディングを行い、処理を終了する。 When the motion compensation unit 3091a determines that the motion vector of the corresponding block and the motion vector of the block adjacent to the corresponding block in the vertical direction are the same (Yes in STEP 222), the process proceeds to STEP 223. When the motion compensation unit 3091a determines that the motion vector of the corresponding block and the motion vector of the block adjacent to the corresponding block in the vertical direction are not the same (NO in STEP 222), the motion compensation unit 3091a BIO padding is performed in both directions, and the process ends.
 STEP223において、動き補償部3091aは、垂直方向におけるBIOパディングを禁止し、水平方向におけるBIOパディングのみを実行し、処理を終了する。 In STEP 223, the motion compensation unit 3091a prohibits the BIO padding in the vertical direction, executes only the BIO padding in the horizontal direction, and ends the process.
 (動き補償部3091aによる読み込み領域外画素値の生成の具体例3)
 上述の具体例1及び2では、動き補償部3091aは、対応ブロックの動きベクトルと、水平及び垂直方向のうち一方の方向において、当該対応ブロックに隣接するブロックの動きベクトルとが同じであるか否かを判定している。ただし、本実施形態では、これに限定されず、動き補償部3091aは、水平方向に隣接するブロックの動きベクトルが同じであるか否かを判定し、且つ、垂直方向に隣接するブロックの動きベクトルが同じであるか否かを判定してもよい。
(Specific Example 3 of Generation of Pixel Value Outside Reading Area by Motion Compensation Unit 3091a)
In the specific examples 1 and 2 described above, the motion compensation unit 3091a determines whether the motion vector of the corresponding block is the same as the motion vector of the block adjacent to the corresponding block in one of the horizontal and vertical directions. Judging. However, in the present embodiment, the present invention is not limited to this, and the motion compensation unit 3091a determines whether or not the motion vectors of blocks adjacent in the horizontal direction are the same, and the motion vector of blocks adjacent in the vertical direction. It may be determined whether or not the same.
 以下に、動き補償部3091aによる読み込み領域外画素値の生成の具体例3について図30を用いて説明する。図30は、動き補償部3091aがBIOモードを用いて予測画像を生成する場合、水平方向又は垂直方向におけるBIOパディングを禁止するか否かを判定する処理の流れの一例を示すフローチャートである。 Hereinafter, specific example 3 of generation of a pixel value outside the reading area by the motion compensation unit 3091a will be described with reference to FIG. FIG. 30 is a flowchart illustrating an example of a processing flow for determining whether to prohibit BIO padding in the horizontal direction or the vertical direction when the motion compensation unit 3091a generates a predicted image using the BIO mode.
 図30におけるSTEP231及びSTEP233は、図28におけるSTEP211及びSTEP213と同様であるため、説明を省略する。図30におけるSTEP234及びSTEP235は、図29におけるSTEP222及びSTEP223と同様なので説明を省略する。 30 are the same as STEP 211 and STEP 213 in FIG. 28, and thus description thereof is omitted. STEP 234 and STEP 235 in FIG. 30 are the same as STEP 222 and STEP 223 in FIG.
 STEP232において、動き補償部3091aは、対応ブロックの動きベクトルと、当該対応ブロックに水平方向に隣接するブロックの動きベクトルとが同じか否かを判定する。 In STEP232, the motion compensation unit 3091a determines whether or not the motion vector of the corresponding block is the same as the motion vector of the block adjacent to the corresponding block in the horizontal direction.
 対応ブロックの動きベクトルと、当該対応ブロックに水平方向に隣接するブロックの動きべクトルとが同じであると動き補償部3091aが判定した場合(STEP232のYes)、STEP233に進む。対応ブロックの動きベクトルと、当該対応ブロックに水平方向に隣接するブロックの動きべクトルとが同じでないと動き補償部3091aが判定した場合(STEP232のNo)、STEP234に進む。 When the motion compensation unit 3091a determines that the motion vector of the corresponding block and the motion vector of the block adjacent to the corresponding block in the horizontal direction are the same (Yes in STEP 232), the process proceeds to STEP 233. When the motion compensation unit 3091a determines that the motion vector of the corresponding block and the motion vector of the block adjacent to the corresponding block in the horizontal direction are not the same (No in STEP 232), the process proceeds to STEP 234.
 上述の具体例3に示されるように、動き補償部3091aは、水平方向、垂直方向の順に対応ブロックに隣接するブロックの動きベクトルが同じか否かを判定し、水平方向、垂直方向におけるBIOパディングを禁止するか否かを判定してもよい。ここで、水平方向又は垂直方向に隣接するブロックが同じ動きベクトルを有する場合に、動き補償部3091aは、BIOパディングを禁止する。また、この場合、動き補償部3091aは、水平方向又は垂直方向に隣接するブロックを一つの対応ブロックとみなし、マージして、当該対応ブロックの予測画像を生成してもよい。 As shown in the specific example 3 above, the motion compensation unit 3091a determines whether or not the motion vectors of the blocks adjacent to the corresponding block are the same in the order of the horizontal direction and the vertical direction, and the BIO padding in the horizontal direction and the vertical direction. It may be determined whether or not to prohibit. Here, when blocks adjacent in the horizontal direction or the vertical direction have the same motion vector, the motion compensation unit 3091a prohibits BIO padding. In this case, the motion compensation unit 3091a may regard blocks adjacent in the horizontal direction or the vertical direction as one corresponding block and merge them to generate a predicted image of the corresponding block.
 なお、図30では、動き補償部3091aは、水平方向、垂直方向の順に対応ブロックに隣接するブロックの動きベクトルが同じであるか否かを判定しているが、本実施形態では、これに限定されない。動き補償部3091aは、垂直方向、水平方向の順に対応ブロックに隣接するブロックの動きベクトルが同じであるか否かを判定してもよい。 In FIG. 30, the motion compensation unit 3091a determines whether or not the motion vectors of the blocks adjacent to the corresponding block are the same in the order of the horizontal direction and the vertical direction. Not. The motion compensation unit 3091a may determine whether or not the motion vectors of the blocks adjacent to the corresponding block are the same in the order of the vertical direction and the horizontal direction.
 (動き補償部3091aの変形例)
 動き補償部3091aは、図31に示す対応ブロックの参照ブロックを参照する場合に、上述の水平方向又は垂直方向におけるBIOパディングを禁止してもよい。
(Modification of motion compensation unit 3091a)
The motion compensation unit 3091a may prohibit the BIO padding in the horizontal direction or the vertical direction described above when referring to the reference block of the corresponding block illustrated in FIG.
 図31は、動き補償部3091aがBIOモードを用いる場合に利用する対応ブロックと、当該対応ブロックの水平方向又は垂直方向に隣接するブロックとの概略図である。 FIG. 31 is a schematic diagram of a corresponding block used when the motion compensation unit 3091a uses the BIO mode and a block adjacent to the corresponding block in the horizontal direction or the vertical direction.
 例えば、動き補償部3091aは、縦長の対応ブロックに対してBIOモードを用いる場合に、水平方向におけるBIOパディングを禁止してもよい。この場合、動き補償部3091aは、縦長の対応ブロックと、当該縦長の対応ブロックの水平方向に隣接するブロックとが同じ動きベクトルを有れば、これらのブロックをマージし、1つの対応ブロックとみなし、当該対応ブロックの参照ブロックから予測画像を生成してもよい。このように、動き補償部3091aは、当該縦長の対応ブロック及び当該縦長の対応ブロックに水平方向に隣接するブロックに対してBIOモードを用いる場合においても、上述の例と同様に全体の処理量を少なくすることができる。また、メモリバンド幅を小さくすることができる。 For example, the motion compensation unit 3091a may prohibit horizontal BIO padding when using the BIO mode for a vertically corresponding block. In this case, if the vertically corresponding block and the block adjacent in the horizontal direction of the vertically corresponding block have the same motion vector, the motion compensation unit 3091a merges these blocks and regards it as one corresponding block. A predicted image may be generated from the reference block of the corresponding block. Thus, even when the BIO mode is used for the vertical corresponding block and the block horizontally adjacent to the vertical corresponding block, the motion compensation unit 3091a reduces the overall processing amount in the same manner as in the above example. Can be reduced. In addition, the memory bandwidth can be reduced.
 ここで、図31の(a)に示される、縦長の対応ブロック及び、当該縦長の対応ブロックに水平方向に隣接するブロックのサイズの例として、4x8画素が挙げられる。動き補償部3091aは、4x8画素を最小単位のブロックサイズとすることにより、これらのブロックをマージしてBIOモードを用いた場合に8x8画素単位毎に処理することになり、全体の処理量は大きくならずに済む。その結果、メモリバンド幅をより大きくならないように抑えることができる。 Here, as an example of the vertically corresponding block shown in FIG. 31A and the size of the block adjacent to the vertically corresponding block in the horizontal direction, 4 × 8 pixels can be cited. The motion compensation unit 3091a uses 4x8 pixels as the minimum unit block size, and when these blocks are merged and the BIO mode is used, processing is performed for each 8x8 pixel unit, and the overall processing amount is large. You do n’t have to. As a result, the memory bandwidth can be suppressed from becoming larger.
 また、動き補償部3091aは、横長の対応ブロックに対してBIOモードを用いる場合に、垂直方向におけるBIOパディングを禁止してもよい。この場合、動き補償部3091aは、横長の対応ブロックと、当該横長の対応ブロックに垂直方向に隣接するブロックとが同じ動きベクトルを有すれば、これらのブロックをマージし、1つの対応ブロックとみなし、当該対応ブロックの参照ブロックを参照して予測画像を生成してもよい。 Also, the motion compensation unit 3091a may prohibit BIO padding in the vertical direction when the BIO mode is used for a horizontally long corresponding block. In this case, the motion compensation unit 3091a merges the horizontally long corresponding block and the block adjacent to the horizontally long corresponding block in the vertical direction into the same motion vector and regards it as one corresponding block. The predicted image may be generated with reference to the reference block of the corresponding block.
 ここで、図31の(b)に示される、横長の対応ブロック及び当該横長の対応ブロックに垂直方向に隣接するブロックのサイズの例として、8x4画素が挙げられる。動き補償部3091aは、8x4画素を最小単位のブロックサイズとすることにより、これらのブロックをマージしてBIOモードを用いた場合に8x8画素単位毎に処理することになり、全体の処理量は大きくならずに済む。その結果、メモリバンド幅をより大きくならないように抑えることができる。 Here, as an example of the horizontally corresponding block and the size of the block adjacent to the horizontally corresponding block shown in FIG. 31B in the vertical direction, 8 × 4 pixels can be cited. The motion compensation unit 3091a uses 8x4 pixels as the minimum unit block size, and when these blocks are merged and the BIO mode is used, processing is performed for each 8x8 pixel unit, and the overall processing amount is large. It ’s not necessary. As a result, the memory bandwidth can be suppressed from becoming larger.
 なお、動き補償部3091aは、水平パディングを禁止するか、垂直パディングを禁止するか否かを判断する際に、ブロックの分割方法を示すシンタックスを参照してもよい。動き補償部3091aは、ブロックの分割方法を示すシンタックスを参照し、最終的に4x8画素のブロックとなった場合は水平パディングを禁止し、8x4画素のブロックとなった場合は垂直パディングを禁止する構成であってもよい。 Note that the motion compensation unit 3091a may refer to a syntax indicating a block division method when determining whether to prohibit horizontal padding or vertical padding. The motion compensation unit 3091a refers to the syntax indicating the block division method, and prohibits horizontal padding when it finally becomes a block of 4x8 pixels, and prohibits vertical padding when it becomes a block of 8x4 pixels. It may be a configuration.
 (画像符号化装置の構成)
 画像符号化装置11aは、実施形態1における予測画像生成部101の代わりに、予測画像生成部101a(不図示)を備えている。また、予測画像生成部101aは、実施形態1におけるインター予測画像生成部1011の代わりに、インター予測画像生成部1011a(不図示)を備えている。
(Configuration of image encoding device)
The image encoding device 11a includes a predicted image generation unit 101a (not shown) instead of the predicted image generation unit 101 in the first embodiment. Moreover, the predicted image generation unit 101a includes an inter predicted image generation unit 1011a (not shown) instead of the inter predicted image generation unit 1011 in the first embodiment.
 インター予測画像生成部1011aは、実施形態1における動き補償部10111の代わりに、動き補償部10111aを備えている。この点以外は、インター予測画像生成部1011aは、実施形態1におけるインター予測画像生成部1011と同様の構成である。 The inter predicted image generation unit 1011a includes a motion compensation unit 10111a instead of the motion compensation unit 10111 in the first embodiment. Except for this point, the inter prediction image generation unit 1011a has the same configuration as the inter prediction image generation unit 1011 in the first embodiment.
 動き補償部10111aについては、上述の動き補償部3091aと同様の構成であるためここでの説明を省略する。 Since the motion compensation unit 10111a has the same configuration as the motion compensation unit 3091a described above, description thereof is omitted here.
 〔実施形態3〕
 画像復号装置の予測パラメータ復号部の機能は、実施形態1に係る画像伝送システム1の画像復号装置31の予測パラメータ復号部302におけるインター予測パラメータ復号部303の機能に限定されない。当該インター予測パラメータ復号部の機能は、インター予測パラメータ復号部303の代わりに、又は、加えて、画像伝送システム1b(不図示)画像復号装置31b(不図示)のインター予測パラメータ復号部303bの機能を備えていてもよい。
[Embodiment 3]
The function of the prediction parameter decoding unit of the image decoding device is not limited to the function of the inter prediction parameter decoding unit 303 in the prediction parameter decoding unit 302 of the image decoding device 31 of the image transmission system 1 according to the first embodiment. The function of the inter prediction parameter decoding unit is the function of the inter prediction parameter decoding unit 303b of the image transmission system 1b (not shown) image decoding device 31b (not shown) instead of or in addition to the inter prediction parameter decoding unit 303. May be provided.
 実施形態3について、図32~39を参照して説明する。なお、説明の便宜上、実施形態1にて説明した部材と同じ機能を有する部材については、同じ符号を付記し、その説明を省略する。 Embodiment 3 will be described with reference to FIGS. For convenience of explanation, members having the same functions as those described in the first embodiment are denoted by the same reference numerals and description thereof is omitted.
 (画像伝送システムの構成)
 画像伝送システム1bは、実施形態1における画像復号装置31及び画像符号化装置11の代わりに、画像復号装置31b(不図示)及び画像符号化装置11b(不図示)を備えている。本実施形態に係る画像復号装置31bは、実施形態1における予測パラメータ復号部302の代わりに、予測パラメータ復号部302b(不図示)を備えている。また、予測パラメータ復号部302は、実施形態1におけるインター予測パラメータ復号部303の代わりに、インター予測パラメータ復号部303bを備えている。この点以外は、画像復号装置31bは、実施形態1に係る画像復号装置31と同様の構成である。画像符号化装置11bについては後述する。
(Configuration of image transmission system)
The image transmission system 1b includes an image decoding device 31b (not shown) and an image encoding device 11b (not shown) instead of the image decoding device 31 and the image encoding device 11 in the first embodiment. The image decoding device 31b according to the present embodiment includes a prediction parameter decoding unit 302b (not shown) instead of the prediction parameter decoding unit 302 in the first embodiment. Further, the prediction parameter decoding unit 302 includes an inter prediction parameter decoding unit 303b instead of the inter prediction parameter decoding unit 303 in the first embodiment. Except for this point, the image decoding device 31b has the same configuration as the image decoding device 31 according to the first embodiment. The image encoding device 11b will be described later.
 (インター予測パラメータ復号部303b)
 図34は、予測パラメータ復号部302bに含まれるインター予測パラメータ復号部303bの構成を示すブロック図である。図34に示されるように、インター予測パラメータ復号部302bは、実施形態1におけるサブブロック予測パラメータ導出部3037の代わりに、サブブロック予測パラメータ導出部3037bを備えている。この点以外は、インター予測パラメータ復号部302bは、実施形態1におけるインター予測パラメータ復号部302と同様の構成である。図34に示されるように、サブブロック予測パラメータ導出部3037bは、サブブロック予測モードにてサブブロック予測を行う、時空間サブブロック予測部30371、アフィン予測部30372及びマッチング動き導出部30373の少なくとも一つを備える。
 (サブブロック予測モードフラグ)
 ここで、画像復号装置31b及び画像符号化装置11における、あるPUの予測モードがサブブロック予測モードであるか否かを示すサブブロック予測モードフラグsubPbMotionFlagの導出方法について説明する。画像復号装置31b及び画像符号化装置11は、後述する空間サブブロック予測SSUB、時間サブブロック予測TSUB、アフィン予測AFFINE及びマッチング動き導出MATの何れを用いたかに基づいて、サブブロック予測モードフラグsubPbMotionFlagを導出する。例えば、あるPUにおいて選択された予測モードをN(例えばNは選択されたマージ候補を示すラベル)とした場合には、以下の式によりサブブロック予測モードフラグsubPbMotionFlagを導出してもよい。
(Inter prediction parameter decoding unit 303b)
FIG. 34 is a block diagram illustrating a configuration of an inter prediction parameter decoding unit 303b included in the prediction parameter decoding unit 302b. As illustrated in FIG. 34, the inter prediction parameter decoding unit 302b includes a sub-block prediction parameter deriving unit 3037b instead of the sub-block prediction parameter deriving unit 3037 in the first embodiment. Except for this point, the inter prediction parameter decoding unit 302b has the same configuration as the inter prediction parameter decoding unit 302 in the first embodiment. As shown in FIG. 34, the sub-block prediction parameter derivation unit 3037b performs at least one of the spatio-temporal sub-block prediction unit 30371, the affine prediction unit 30372, and the matching motion derivation unit 30373 that performs sub-block prediction in the sub-block prediction mode. With one.
(Subblock prediction mode flag)
Here, a method of deriving a sub-block prediction mode flag subPbMotionFlag indicating whether or not a prediction mode of a certain PU is a sub-block prediction mode in the image decoding device 31b and the image encoding device 11 will be described. The image decoding device 31b and the image encoding device 11 set the sub-block prediction mode flag subPbMotionFlag based on which of spatial sub-block prediction SSUB, temporal sub-block prediction TSUB, affine prediction AFFINE, and matching motion derivation MAT described later is used. To derive. For example, when the prediction mode selected in a certain PU is N (for example, N is a label indicating the selected merge candidate), the sub-block prediction mode flag subPbMotionFlag may be derived by the following equation.
 subPbMotionFlag = (N == TSUB) || (N == SSUB) || (N == AFFINE) || (N == MAT)
 ここで||は、論理和を示す(以下同様)。
subPbMotionFlag = (N == TSUB) || (N == SSUB) || (N == AFFINE) || (N == MAT)
Here, || represents a logical sum (the same applies hereinafter).
 また、画像復号装置31b及び画像符号化装置11は、空間サブブロック予測SSUB、時間サブブロック予測TSUB及びアフィン予測AFFINE及びマッチング動き導出MATのうち、一部の予測を行う構成でもよい。すなわち、画像復号装置31b及び画像符号化装置11が空間サブブロック予測SSUB又はアフィン予測AFFINEを行う構成である場合には、以下のようにサブブロック予測モードフラグsubPbMotionFlagを導出してもよい。 Also, the image decoding device 31b and the image encoding device 11 may be configured to perform some predictions among the spatial sub-block prediction SSUB, temporal sub-block prediction TSUB, affine prediction AFFINE, and matching motion derivation MAT. That is, when the image decoding device 31b and the image encoding device 11 are configured to perform spatial subblock prediction SSUB or affine prediction AFFINE, the subblock prediction mode flag subPbMotionFlag may be derived as follows.
 subPbMotionFlag = (N == SSUB)|| (N == AFFINE)
 (サブブロック予測部)
 次に、サブブロック予測部について説明する。
subPbMotionFlag = (N == SSUB) || (N == AFFINE)
(Sub-block prediction unit)
Next, the sub-block prediction unit will be described.
 (時空間サブブロック予測部30371)
 時空間サブブロック予測部30371は、時間的に対象PUに隣接する参照画像上(例えば直前のピクチャ)のPUの動きベクトル、又は、空間的に対象PUに隣接するPUの動きベクトルから、対象PUを分割して得られるサブブロックの動きベクトルを導出する。具体的には、参照画像上のPUの動きベクトルを対象PUが参照する参照ピクチャに合わせてスケーリングすることにより、対象PU中の各サブブロックの動きベクトルspMvLX[xi][yj] (xi = xPb + nSbW * i, yj = yPb + nSbH * j, i=0, 1, 2,・・・,nPbW / nSbW - 1、j=0, 1, 2,・・・,nPbH / nSbH - 1)を導出する(時間サブブロック予測)。ここで、(xPb, yPb)は対象PUの左上座標、nPbW, nPbHは対象PUのサイズ、nSbW, nSbHはサブブロックのサイズである。
 また、対象PUに隣接するPUの動きベクトルと、対象PUを分割して得られるサブブロックとの距離に応じて、加重平均を計算することで、対象PU中の各サブブロックの動きベクトルspMvLX[xi][yj] (xi = xPb + nSbW * i, yj = yPb + nSbH * j, i=0, 1, 2,・・・,nPbW / nSbW - 1、j=0, 1, 2,・・・,nPbH / nSbH - 1)を導出してもよい(空間サブブロック予測)。
(Spatio-temporal sub-block prediction unit 30371)
The spatio-temporal sub-block prediction unit 30371 calculates the target PU from the motion vector of the PU on the reference image temporally adjacent to the target PU (for example, the immediately preceding picture) or the motion vector of the PU spatially adjacent to the target PU. The motion vector of the sub-block obtained by dividing is derived. Specifically, the motion vector spMvLX [xi] [yj] (xi = xPb) of each sub-block in the target PU is obtained by scaling the motion vector of the PU on the reference image according to the reference picture referenced by the target PU. + nSbW * i, yj = yPb + nSbH * j, i = 0, 1, 2, ..., nPbW / nSbW-1, j = 0, 1, 2, ..., nPbH / nSbH-1) Derived (temporal sub-block prediction). Here, (xPb, yPb) is the upper left coordinate of the target PU, nPbW, nPbH are the size of the target PU, and nSbW, nSbH are the sizes of the sub-blocks.
Also, by calculating a weighted average according to the distance between the motion vector of the PU adjacent to the target PU and the sub-block obtained by dividing the target PU, the motion vector spMvLX [ xi] [yj] (xi = xPb + nSbW * i, yj = yPb + nSbH * j, i = 0, 1, 2, ..., nPbW / nSbW-1, j = 0, 1, 2, ... , NPbH / nSbH-1) may be derived (spatial sub-block prediction).
 上記、時間サブブロック予測の候補TSUB、空間サブブロック予測の候補SSUBを、マージモードの一つのモード(マージ候補)として選択する。 The above-described temporal sub-block prediction candidate TSUB and spatial sub-block prediction candidate SSUB are selected as one mode (merge candidate) of the merge mode.
 (アフィン予測部30372)
 アフィン予測部30372は、対象PUのアフィン予測パラメータを導出する。本実施形態では、アフィン予測パラメータとして、対象PUの2つ又は3つの制御点の動きベクトルを導出する。例えば、3つの制御点(V0、V1及びV2)の場合、動きベクトル(mv0_x, mv0_y)、(mv1_x, mv1_y)及び(mv2_x, mv2_y)を導出する。
(Affine prediction unit 30372)
The affine prediction unit 30372 derives the affine prediction parameters of the target PU. In this embodiment, motion vectors of two or three control points of the target PU are derived as affine prediction parameters. For example, in the case of three control points (V0, V1, and V2), motion vectors (mv0_x, mv0_y), (mv1_x, mv1_y), and (mv2_x, mv2_y) are derived.
 具体的には、対象PUの隣接PUの動きベクトルから予測することにより、各制御点の動きベクトルを導出してもよい。また、制御点の予測ベクトルmvpLXと符号化データから導出される差分ベクトルmvdLXとの和により、各制御点の動きベクトルを導出してもよい。 Specifically, the motion vector of each control point may be derived by predicting from the motion vector of the adjacent PU of the target PU. Alternatively, the motion vector of each control point may be derived from the sum of the control point prediction vector mvpLX and the difference vector mvdLX derived from the encoded data.
 図35は、対象PU(nPbW×nPbH)を構成する各サブブロックの動きベクトルspMvLXを、制御点V0の動きベクトル(mv0_x, mv0_y)及びV1の動きベクトル(mv1_x, mv1_y)から導出する例を示す図である。各サブブロックの動きベクトルspMvLXは、図35に示すように、各サブブロックの中心に位置する点毎の動きベクトルとして導出する。 FIG. 35 shows an example in which the motion vector spMvLX of each sub-block constituting the target PU (nPbW × nPbH) is derived from the motion vector (mv0_x, mv0_y) of the control point V0 and the motion vector (mv1_x, mv1_y) of V1. FIG. The motion vector spMvLX of each subblock is derived as a motion vector for each point located at the center of each subblock, as shown in FIG.
 アフィン予測部30372は対象PUのアフィン予測パラメータに基づいて、対象PU中の各サブブロックの動きベクトルspMvLX[xi][yj] (xi = nSbW * i, yj = nSbH * j, i=0, 1, 2,・・・,nPbW / nSbW - 1、j=0, 1, 2,・・・,nPbH / nSbH - 1)を下記の式を用いて、導出する。 The affine prediction unit 30372 is based on the affine prediction parameters of the target PU, and the motion vector spMvLX [xi] [yj] (xi = nSbW * i, yj = nSbH * j, i = 0, 1 of the target PU , 2,..., NPbW / nSbW-1, j = 0, 1, 2, ..., nPbH / nSbH-1) are derived using the following equations.
 spMvLX[xi][yj][0]=mv0_x + (mv1_x - mv0_x) / nPbW * (xi + nSbW/2) - (mv1_y - mv0_y) / nPbH * (yj + nSbH/2)
 spMvLX[xi][yj][1]=mv0_y + (mv1_y - mv0_y) / nPbW * (xi + nSbW/2) + (mv1_x - mv0_x) / nPbH * (yj + nSbH/2)
 ここで、xPb, yPbは、対象PUの左上座標、nPbW, nPbHは、対象PUの幅と高さ、nSbW, nSbHはサブブロックの幅及び高さである。
spMvLX [xi] [yj] [0] = mv0_x + (mv1_x-mv0_x) / nPbW * (xi + nSbW / 2)-(mv1_y-mv0_y) / nPbH * (yj + nSbH / 2)
spMvLX [xi] [yj] [1] = mv0_y + (mv1_y-mv0_y) / nPbW * (xi + nSbW / 2) + (mv1_x-mv0_x) / nPbH * (yj + nSbH / 2)
Here, xPb and yPb are the upper left coordinates of the target PU, nPbW and nPbH are the width and height of the target PU, and nSbW and nSbH are the width and height of the sub-block.
 〔サブブロックの動きベクトル導出処理〕
 以下、更に具体的な実施構成の例として、アフィン予測部30372又はAMVP予測パラメータ導出部3032がアフィン予測を用いて、各サブブロックの動きベクトルmvLXを導出する処理の流れを、ステップに分けて説明する。アフィン予測部30372又はAMVP予測パラメータ導出部3032がアフィン予測を用いて、サブブロックの動きベクトルmvLXを導出する処理は、下記の(STEP1)~(STEP4)の4つの工程を含んでいる。
[Sub-block motion vector derivation processing]
Hereinafter, as an example of a more specific implementation configuration, the process flow in which the affine prediction unit 30372 or the AMVP prediction parameter derivation unit 3032 derives the motion vector mvLX of each sub-block using affine prediction is described in steps. To do. The process in which the affine prediction unit 30372 or the AMVP prediction parameter derivation unit 3032 derives the sub-block motion vector mvLX using affine prediction includes the following four steps (STEP 1) to (STEP 4).
 (STEP1)制御点ベクトルの導出
 アフィン予測部30372又はAMVP予測パラメータ導出部3032が、候補を導出するためのアフィン予測に用いる2つ以上の制御点として、対象ブロックの代表点(ここではV0及びV1)のそれぞれの動きベクトルを導出する工程である。なお、ブロックの代表点は、対象ブロック上の点、又は、対象ブロックの近傍の点を用いる。本明細書では、アフィン予測の制御点に用いるブロックの代表点を「ブロック制御点」と記載する。
(STEP 1) Derivation of control point vector The affine prediction unit 30372 or the AMVP prediction parameter derivation unit 3032 uses representative points (here, V0 and V1) of the target block as two or more control points used for affine prediction for deriving candidates. ) To derive the respective motion vectors. Note that a point on the target block or a point near the target block is used as the representative point of the block. In this specification, a block representative point used as a control point for affine prediction is referred to as a “block control point”.
 (STEP2)サブブロックベクトルの導出
 アフィン予測部30372又はAMVP予測パラメータ導出部3032が、STEP1で導出された対象ブロックの代表点であるブロック制御点(制御点V0及びV1)の動きベクトルから、対象ブロックに含まれる各サブブロックの動きベクトルを導出する工程である。(STEP1)と(STEP2)によって、各サブブロックの動きベクトルmvLXが導出される。
(STEP2) Derivation of sub-block vector The affine prediction unit 30372 or AMVP prediction parameter derivation unit 3032 determines the target block from the motion vector of the block control points (control points V0 and V1) that are representative points of the target block derived in STEP1. Is a step of deriving a motion vector of each sub-block included in. From (STEP 1) and (STEP 2), the motion vector mvLX of each sub-block is derived.
 (STEP3)サブブロック動き補償
 動き補償部3091が、インター予測パラメータ復号部303から入力された、予測リスト利用フラグpredFlagLX、参照ピクチャインデックスrefIdxLX、動きベクトルmvLXに基づいて、参照ピクチャメモリ306から、参照ピクチャインデックスrefIdxLXにおいて指定された参照ピクチャ上の、対象ブロックの位置を起点として、動きベクトルmvLXだけずれた位置にあるブロックを読み出しフィルタリングすることによって動き補償画像predSamplesLXを生成するサブブロック単位の動き補償を行う工程である。
(STEP 3) Sub-block motion compensation The motion compensation unit 3091 receives the reference picture from the reference picture memory 306 based on the prediction list use flag predFlagLX, the reference picture index refIdxLX, and the motion vector mvLX input from the inter prediction parameter decoding unit 303. Performs motion compensation in units of sub-blocks to generate motion compensated image predSamplesLX by reading out and filtering a block at a position shifted by motion vector mvLX from the position of the target block on the reference picture specified by index refIdxLX It is a process.
 (STEP4)サブブロックの動きベクトルの格納
 AMVPモードの場合は、上記の(STEP2)においてAMVP予測パラメータ導出部3032によって導出された、各サブブロックの動きベクトルmvLXは予測パラメータメモリ307に格納される。同様に、マージモードの場合も、上記の(STEP2)においてアフィン予測部30372によって導出された、各サブブロックの動きベクトルmvLXは予測パラメータメモリ307に格納される。
(STEP 4) Storage of motion vectors of sub-blocks In the case of the AMVP mode, the motion vector mvLX of each sub-block derived by the AMVP prediction parameter deriving unit 3032 in (STEP 2) is stored in the prediction parameter memory 307. Similarly, also in the merge mode, the motion vector mvLX of each sub-block derived by the affine prediction unit 30372 in (STEP 2) is stored in the prediction parameter memory 307.
 なお、アフィン予測を用いたサブブロックの動きベクトルmvLXの導出は、AMVPモード及びマージモードの双方において実施することが可能である。以下では、(STEP1)~(STEP4)のうちのいくつかの処理について、AMVPモードの場合及びマージモードの場合についてそれぞれ説明する。 Note that the derivation of the sub-block motion vector mvLX using affine prediction can be performed in both the AMVP mode and the merge mode. In the following, some processes of (STEP 1) to (STEP 4) will be described for the AMVP mode and the merge mode, respectively.
 (STEP1詳細)
 まず、(STEP1)の処理について、AMVPモード及びマージモードについて、図37を用いてそれぞれ以下に説明する。図37は、AMVPモード及びマージモードにおける制御点の動きベクトルの導出のために利用される予測ユニット(参照ブロック)の位置の例を示す図である。
(STEP1 details)
First, regarding the processing of (STEP 1), the AMVP mode and the merge mode will be described below with reference to FIG. FIG. 37 is a diagram illustrating an example of the position of a prediction unit (reference block) used for deriving a motion vector of a control point in the AMVP mode and the merge mode.
 (AMVPモードにおける制御点の動きベクトルの導出)
 AMVP予測パラメータ導出部3032は、2つ以上の制御点(例えばV0及びV1、又は、V0、V1及びV2)の動きベクトルmvLXを復号する。具体的には、各制御点について予測ベクトルmvpLXと差分ベクトルを加算して導出する。
(Derivation of motion vector of control point in AMVP mode)
The AMVP prediction parameter derivation unit 3032 decodes the motion vector mvLX of two or more control points (for example, V0 and V1, or V0, V1, and V2). Specifically, the prediction vector mvpLX and the difference vector are added for each control point.
 より具体的には、AMVP予測パラメータ導出部3032は、制御点VN(N=0..2)の予測ベクトル候補を導出し、予測ベクトル候補リストmvpListVNLX[]に格納する。更に、AMVP予測パラメータ導出部3032は、符号化データから点VNの予測ベクトルインデックスmvpVN_LX_idx、差分ベクトルmvdVNLXから、制御点VNの動きベクトル(mvi_x, mvi_y)を以下の式で導出する。 More specifically, the AMVP prediction parameter derivation unit 3032 derives a prediction vector candidate of the control point VN (N = 0..2) and stores it in the prediction vector candidate list mvpListVNLX []. Further, the AMVP prediction parameter deriving unit 3032 derives a motion vector (mvi_x, mvi_y) of the control point VN from the encoded data from the prediction vector index mvpVN_LX_idx of the point VN and the difference vector mvdVNLX by the following equation.
 mvi_x = mvLX[0] = mvpListVNLX[mvpVN_LX_idx][0] + mvdVNLX[0]
 mvi_y = mvLX[1] = mvpListVNLX[mvpVN_LX_idx][1] + mvdVNLX[1]
 図37を用いて、各制御点の予測ベクトル導出の詳細を説明する。AMVP予測パラメータ導出部3032は、図37の(a)に示すように、代表点の一つに隣接し、対象ブロックと当該代表点(頂点)を共有するブロックA、B、及びC(参照ブロック)の動きベクトルのうちの何れかをmvp_LX_idxを参照して選択し、代表点V0の予測ベクトルmvpLXとする。更に、AMVP予測パラメータ導出部3032は、ブロックD及びEの動きベクトルのうちの何れかを代表点V1の予測ベクトルmvpLXとする。
mvi_x = mvLX [0] = mvpListVNLX [mvpVN_LX_idx] [0] + mvdVNLX [0]
mvi_y = mvLX [1] = mvpListVNLX [mvpVN_LX_idx] [1] + mvdVNLX [1]
Details of the prediction vector derivation of each control point will be described with reference to FIG. As shown in FIG. 37A, the AMVP prediction parameter derivation unit 3032 is adjacent to one of the representative points, and blocks A, B, and C (reference blocks) that share the representative point (vertex) with the target block. ) Is selected with reference to mvp_LX_idx to obtain a prediction vector mvpLX of the representative point V0. Further, the AMVP prediction parameter derivation unit 3032 sets one of the motion vectors of the blocks D and E as the prediction vector mvpLX of the representative point V1.
 同様に、図37の(b)に示すように、AMVP予測パラメータ導出部3032は、及びブロックF及びG(参照ブロック)の動きベクトルのうちの何れかを、代表点V2の予測ベクトルmvpLXを導出してもよい。 Similarly, as shown in FIG. 37 (b), the AMVP prediction parameter derivation unit 3032 derives a prediction vector mvpLX of the representative point V2 from any of the motion vectors of the blocks F and G (reference block). May be.
 なお、STEP1における制御点の位置は、上記に限定されない。対象ブロックの右下の頂点、又は後述するように対象ブロックの周囲の点を用いてもよい。 In addition, the position of the control point in STEP1 is not limited to the above. A vertex at the lower right of the target block or points around the target block as described later may be used.
 (アフィン予測の一般式)
 4パラメータのアフィンの一般式を以下に説明する。サブブロック座標(xi, yj)の動きベクトル(mvi_x, mvi_y)は、4つのパラメータ(mv_x, mv_y, ev, rv)、すなわち、拡大及び回転中心の動きベクトル(並進ベクトルmv_x, mv_y)と拡大パラメータev及び回転パラメータrvを用いて、以下の一般式(eq1)によって求められ得る。
(General formula for affine prediction)
A general equation for the four-parameter affine will be described below. The motion vector (mvi_x, mvi_y) of the sub-block coordinates (xi, yj) has four parameters (mv_x, mv_y, ev, rv), that is, the motion vector of the expansion and rotation center (translation vector mv_x, mv_y) and the expansion parameter Using ev and the rotation parameter rv, the following general formula (eq1) can be obtained.
 mvi_x=mv_x + ev * xi - rv * yj
 mvi_y=mv_y + rv * xi + ev * yj     (eq1)
 なお、(mv_x, mv_y)は(mv0_x,mv0_y)であってもよい。制御点V0の動きベクトル(mv0_x、mv0_y)及び制御点V1の動きベクトル(mv1_x、mv1_y)を用いて、(ev、rv)は以下の式によって表される。
mvi_x = mv_x + ev * xi-rv * yj
mvi_y = mv_y + rv * xi + ev * yj (eq1)
Note that (mv_x, mv_y) may be (mv0_x, mv0_y). Using the motion vector (mv0_x, mv0_y) of the control point V0 and the motion vector (mv1_x, mv1_y) of the control point V1, (ev, rv) is expressed by the following equation.
 ev = (mv1_x-mv0_x)/W
 rv = (mv1_y-mv0_y)/W
 続いて6パラメータのアフィンの一般式を以下に説明する。位置(0, 0)、動きベクトルmv_x,my_yの点V0を起点とする位置(xi, yj)の点Viの動きベクトル(mvi_x, mvi_y)は、4つのパラメータ(mv_x, mv_y, ev1, rv1, ev2, rv2)を用いて、以下の一般式(eq2)によって求められ得る。
ev = (mv1_x-mv0_x) / W
rv = (mv1_y-mv0_y) / W
Subsequently, a general formula of a six-parameter affine will be described below. The motion vector (mvi_x, mvi_y) of the point Vi at the position (xi, yj) starting from the point V0 of the position (0, 0) and the motion vector mv_x, my_y has four parameters (mv_x, mv_y, ev1, rv1, ev2, rv2) can be obtained by the following general formula (eq2).
 mvi_x=mv_x + ev1 * xi + rv2 * yj
 mvi_y=mv_y + rv1 * xi + ev2 * yj     (eq2)
 (マージモードにおける制御点の動きベクトルの導出)
 アフィン予測部30372は、図37の(c)に示すようなブロックA~Eを含む予測ユニットについて、予測パラメータメモリ307を参照し、アフィン予測が利用されているか否かを確認する。アフィン予測が利用されている最初に見つかった予測ユニット(ここでは図37の(c)の参照ブロックAとする)を隣接ブロック(マージ参照ブロック)として選択し、動きベクトルを導出する。
mvi_x = mv_x + ev1 * xi + rv2 * yj
mvi_y = mv_y + rv1 * xi + ev2 * yj (eq2)
(Derivation of control point motion vectors in merge mode)
The affine prediction unit 30372 refers to the prediction parameter memory 307 for a prediction unit including blocks A to E as shown in (c) of FIG. 37, and confirms whether or not affine prediction is used. A prediction unit that is first found using affine prediction (here, referred to as reference block A in FIG. 37C) is selected as an adjacent block (merge reference block), and a motion vector is derived.
 アフィン予測部30372は、選択されたマージ参照ブロックの2点又は3点(図37の(d)の点v0、点v1、点v2)の動きベクトルから、制御点(例えばV0、V1)の動きベクトルを導出する。なお、図37の(d)に示す例では、動きベクトルを予測する対象であるブロックの横幅はW、高さはHであり、隣接ブロック(図の例では、ブロックAを含む隣接ブロック)の横幅はw、高さはhである。 The affine prediction unit 30372 moves the control point (for example, V0, V1) from the motion vector of the two or three points (point v0, point v1, point v2 in (d) of FIG. 37) of the selected merge reference block. Derive a vector. In the example shown in (d) of FIG. 37, the horizontal width of the block for which the motion vector is predicted is W, the height is H, and adjacent blocks (adjacent blocks including the block A in the example in the figure). The width is w and the height is h.
 具体的には、マージ参照ブロックの2点又は3点からアフィンパラメータ(ev, rv)、(evBW, rvBW)、(evBH, rvBH)、(ev1, rv1, ev2, rv2)及び(ev1BW、rv1BW、ev2BH、rv2BH)を導出し、導出されたアフィンパラメータから、サブブロックの動きベクトルを導出する。導出方法は、(STEP2詳細)で後述する。 Specifically, affine parameters (ev, rv), (evBW, rvBW), (evBH, rvBH), (ev1, rv1, ev2, rv2) and (ev1BW, rv1BW, ev2BH, rv2BH) and sub block motion vectors are derived from the derived affine parameters. The derivation method will be described later in (Step 2 details).
 (動きベクトルの差分の制限)
 画像符号化装置11(より具体的には、符号化パラメータ決定部110)又はアフィン予測部30372は、導出した複数の制御点における各々の動きベクトルの差分の範囲を制限する。
(Limit of motion vector difference)
The image encoding device 11 (more specifically, the encoding parameter determination unit 110) or the affine prediction unit 30372 limits the range of the difference between the motion vectors at the plurality of derived control points.
 以下に、制御点V0の動きベクトル(mv0_x, mv0_y)、及び、制御点V1の動きベクトル(mv1_x, mv1_y)を導出した場合を例に、動きベクトルの差分の範囲の制限についてより具体的に説明する。 Hereinafter, the limitation on the range of motion vector difference will be described in more detail, taking as an example the case where the motion vector (mv0_x, mv0_y) of the control point V0 and the motion vector (mv1_x, mv1_y) of the control point V1 are derived. To do.
 AMVPモードの場合、符号化パラメータ決定部110は、(mv0_x, mv0_y)と(mv1_x, mv1_y)の差分値(dmv_x, dmv_y)が(式XX1)を満たすように動きベクトルを導出し、予測パラメータ符号化部111は差分ベクトルを符号化する。例えば、符号化パラメータ決定部110は、動きベクトル探索において制御点V0及び制御点V1の動きベクトルが式XX1を満たすように、動きベクトルの探索範囲を設定する。 In the case of the AMVP mode, the encoding parameter determination unit 110 derives a motion vector so that the difference value (dmv_x, dmv_y) between (mv0_x, mv0_y) and (mv1_x, mv1_y) satisfies (Formula XX1), and the prediction parameter code The encoding unit 111 encodes the difference vector. For example, the encoding parameter determination unit 110 sets the motion vector search range so that the motion vectors of the control point V0 and the control point V1 satisfy Expression XX1 in the motion vector search.
 dmv_x <= THMVX
 dmv_y <= THMVY   (式XX1)
 ここでTHMVX、THMVYは所定の閾値である。以降では、制御点V1における制限された動きベクトルを(mv1_x’, mv1_y’)と記す。
dmv_x <= THMVX
dmv_y <= THMVY (Formula XX1)
Here, THMVX and THMVY are predetermined threshold values. Hereinafter, the restricted motion vector at the control point V1 is denoted as (mv1_x ′, mv1_y ′).
 AMVP予測パラメータ導出部3032は、画像符号化装置11によって選択された動きベクトルの予測ベクトルを導出する。導出された予測ベクトルと差分ベクトルとを加算部3038が加算することにより、動きベクトルが導出される。 The AMVP prediction parameter derivation unit 3032 derives a prediction vector of the motion vector selected by the image encoding device 11. A motion vector is derived by the addition unit 3038 adding the derived prediction vector and the difference vector.
 マージモードの場合、アフィン予測部30372は、制御点V0及び制御点V1のうち、一方の制御点の動きベクトルの大きさに応じて、もう一方の制御点の動きベクトルを制限する。 In the merge mode, the affine prediction unit 30372 limits the motion vector of the other control point according to the magnitude of the motion vector of one control point of the control point V0 and the control point V1.
 例えば、アフィン予測部30372が、制御点V0の動きベクトル(mv0_x, mv0_y)から(rangeW, rangeH)の範囲に制限前の制御点V1の動きベクトル(mv1_x, mv1_y)を制限する場合について説明する。この場合、制限後の制御点V1の動きベクトル(mv1_x', mv1_y')は、以下の式のように示される。 For example, a case will be described in which the affine prediction unit 30372 restricts the motion vector (mv1_x, mv1_y) of the control point V1 before the restriction to the range from the motion vector (mv0_x, mv0_y) of the control point V0 to (rangeW, rangeH). In this case, the motion vector (mv1_x ′, mv1_y ′) of the control point V1 after the restriction is expressed as the following equation.
 mv1_x' = clip3 (mv0_x - rangeW, mv0_x + rangeW, mv1_x)
 mv1_y' = clip3 (mv0_y - rangeH, mv0_y + rangeH, mv1_y)
 符号化パラメータ決定部110又はアフィン予測部30372がこのような動きベクトルの差分の範囲を制限しない場合、各制御点間の動きベクトルの差分が大きいと、後述する各サブブロックの動きベクトルが指し示す参照ブロックが広い範囲になる。この場合、予測画像生成部101は、各サブブロックの動きベクトルが指し示す参照ブロック毎に読み出して予測画像を生成する必要があり、データ転送の容量、すなわち、メモリバンド幅が大きくなる。
mv1_x '= clip3 (mv0_x-rangeW, mv0_x + rangeW, mv1_x)
mv1_y '= clip3 (mv0_y-rangeH, mv0_y + rangeH, mv1_y)
When the encoding parameter determination unit 110 or the affine prediction unit 30372 does not limit the range of such a motion vector difference, if the motion vector difference between the control points is large, a reference indicated by the motion vector of each sub-block described later The block becomes a wide range. In this case, the predicted image generation unit 101 needs to generate a predicted image by reading for each reference block indicated by the motion vector of each sub-block, which increases the data transfer capacity, that is, the memory bandwidth.
 これに対し、上述のように動きベクトルの差分の範囲を制限する場合、各サブブロックの動きベクトルが指し示す参照ブロックが特定の範囲に収まる。そのため、予測画像生成部101によって、当該参照ブロック群を含む領域を一度に読み出して予測画像を生成することができる。その結果、メモリバンド幅を小さくすることができる。 On the other hand, when the range of motion vector difference is limited as described above, the reference block indicated by the motion vector of each sub-block falls within a specific range. Therefore, the predicted image generation unit 101 can read a region including the reference block group at a time and generate a predicted image. As a result, the memory bandwidth can be reduced.
 (STEP2詳細)
 (STEP2)において、アフィン予測部30372又はAMVP予測パラメータ導出部3032は、アフィンパラメータを算出し、次に導出されたアフィンパラメータを用いて各サブブロックの動きベクトルを導出する。
(STEP2 details)
In (STEP 2), the affine prediction unit 30372 or the AMVP prediction parameter derivation unit 3032 calculates an affine parameter, and derives a motion vector of each sub-block using the derived affine parameter.
 (STEP2:アフィンパラメータの導出)
 アフィン予測部30372又はAMVP予測パラメータ導出部3032は、(STEP1)において導出された、ブロック上の代表点である制御点V0、V1及びV2のうち2つ又は3つの制御点の動きベクトルを参照し、(STEP2)では、まず、アフィンパラメータを算出する。すなわち、アフィン予測部30372又はAMVP予測パラメータ導出部3032は、以下の4パラメータアフィン及び6パラメータアフィンのうちの何れかの処理を行う。
・4パラメータアフィン
 アフィン予測部30372又はAMVP予測パラメータ導出部3032は、制御点V0、V1及びV2のうちの2つの制御点の動きベクトルから、アフィンパラメータ(ev、rv)を導出する。
(STEP2: Derivation of affine parameters)
The affine prediction unit 30372 or the AMVP prediction parameter derivation unit 3032 refers to the motion vectors of two or three control points among the control points V0, V1, and V2, which are representative points on the block, derived in (STEP 1). , (STEP 2), first, affine parameters are calculated. That is, the affine prediction unit 30372 or the AMVP prediction parameter derivation unit 3032 performs any one of the following 4-parameter affine and 6-parameter affine.
-Four-parameter affine The affine prediction unit 30372 or the AMVP prediction parameter derivation unit 3032 derives affine parameters (ev, rv) from the motion vectors of two control points among the control points V0, V1, and V2.
 例えば、アフィン予測部30372は、上述したように、制御点V0の動きベクトル(mv0_x, mv0_y)及び制御点V1の制限後の動きベクトル(mv1_x', mv1_y')の2つの動きベクトルから、アフィンパラメータ(ev、rv)を導出する。
・6パラメータアフィン
 アフィン予測部30372又はAMVP予測パラメータ導出部3032は、制御点V0、V1及びV2の3つの動きベクトルから、アフィンパラメータ(ev1、rv1、ev2、rv2)を導出する。
For example, as described above, the affine prediction unit 30372 calculates the affine parameters from the two motion vectors of the motion vector (mv0_x, mv0_y) of the control point V0 and the motion vector (mv1_x ′, mv1_y ′) after the restriction of the control point V1. Deriving (ev, rv).
6-parameter affine The affine prediction unit 30372 or AMVP prediction parameter derivation unit 3032 derives affine parameters (ev1, rv1, ev2, rv2) from the three motion vectors of the control points V0, V1, and V2.
 ここで、アフィン予測部30372がアフィンパラメータ(ev1、rv1、ev2、rv2)を導出する場合、アフィン予測部30372は、3つのうちの2つの動きベクトルの大きさを、ある制御点の動きベクトルの大きさに応じて制限する。制御の仕方については、上述と同様にclip関数を用いるため、説明を省略する。 Here, when the affine predictor 30372 derives the affine parameters (ev1, rv1, ev2, rv2), the affine predictor 30372 determines the magnitude of two of the three motion vectors as the motion vector of a certain control point. Limit according to size. About the method of control, since a clip function is used similarly to the above-mentioned, description is abbreviate | omitted.
 例えば、アフィン予測部30372は、制御点V0の動きベクトル(mv0_x, mv0_y)、制御点V1の制限後の動きベクトル(mv1_x', mv1_y')及び制御点V2の制限後の動きベクトル(mv2_x', mv2_y')の3つの動きベクトルから、アフィンパラメータ(ev1、rv1、ev2、rv2)を導出する。 For example, the affine prediction unit 30372 includes the motion vector (mv0_x, mv0_y) of the control point V0, the motion vector after restriction of the control point V1 (mv1_x ′, mv1_y ′), and the motion vector after restriction of the control point V2 (mv2_x ′, The affine parameters (ev1, rv1, ev2, rv2) are derived from the three motion vectors mv2_y ′).
 以下の説明においては、並進ベクトル(mv_x, mv_y)とアフィンパラメータ(ev、rv)とからなる変換処理を「4パラメータアフィン」、並進ベクトル(mv_x, mv_y)とアフィンパラメータ(ev1、rv1、ev2、rv2)とからなる変換処理を、「6パラメータアフィン」と称する。 In the following description, the conversion process consisting of the translation vector (mv_x, mv_y) and the affine parameters (ev, rv) is referred to as “4-parameter affine”, the translation vector (mv_x, mv_y) and the affine parameters (ev1, rv1, ev2, rv2) is referred to as “6-parameter affine”.
 (整数精度アフィンパラメータ)
 アフィンパラメータは小数点数ではなく整数で扱うこともできる。以下、小数点数のアフィンパラメータを(ev、rv)、(ev1、rv1、ev2、rv2)、整数のアフィンパラメータを(evBW, rvBW)、(evBH, rvBH)、(ev1BW、rv1BW、ev2BH、rv2BH)と表現する。
(Integer precision affine parameters)
Affine parameters can be handled as integers instead of decimal numbers. The decimal affine parameters are (ev, rv), (ev1, rv1, ev2, rv2), and the integer affine parameters are (evBW, rvBW), (evBH, rvBH), (ev1BW, rv1BW, ev2BH, rv2BH) It expresses.
 なお、整数のアフィンパラメータは、小数点数のアフィンパラメータにサブブロックサイズ(BW, BH)に応じた定数(整数化用定数)を乗じたものである。具体的には、小数点数のアフィンパラメータと整数のアフィンパラメータとの間には、以下の関係がある。 The integer affine parameter is obtained by multiplying the decimal affine parameter by a constant (constant for integerization) according to the sub-block size (BW, BH). Specifically, the following relationship exists between the affine parameters for decimal numbers and the affine parameters for integers.
 evBW = ev * BW = ev << log2(BW)
 rvBW = rv * BW = rv << log2(BW)
 evBH = ev * BH = ev << log2(BH)
 rvBH = rv * BH = rv << log2(BH)
 ev1BW = ev1 * BW = ev1 << log2(BW)
 rv1BW = rv1 * BH = rv1 << log2(BW)
 ev2BH = ev2 * BW = ev2 << log2(BH)
 rv2BH = rv2 * BH = rv2 << log2(BH)
 なお、サブブロックの幅BWと高さBHが等しい場合には、(evBW, rvBW) = (evBH, rvBH)となるので、(evBW, rvBW)と(evBH, rvBH)を区別する必要はない。すなわち、以下のアフィンパラメータの導出においては、(evBW, rvBW)だけ、又は、(evBH, rvBH)だけを導出すれば十分である。
evBW = ev * BW = ev << log2 (BW)
rvBW = rv * BW = rv << log2 (BW)
evBH = ev * BH = ev << log2 (BH)
rvBH = rv * BH = rv << log2 (BH)
ev1BW = ev1 * BW = ev1 << log2 (BW)
rv1BW = rv1 * BH = rv1 << log2 (BW)
ev2BH = ev2 * BW = ev2 << log2 (BH)
rv2BH = rv2 * BH = rv2 << log2 (BH)
When the width BW and the height BH of the sub-block are equal, (evBW, rvBW) = (evBH, rvBH), so it is not necessary to distinguish (evBW, rvBW) from (evBH, rvBH). That is, in derivation of the following affine parameters, it is sufficient to derive only (evBW, rvBW) or only (evBH, rvBH).
 (小数点精度アフィンパラメータ導出)
 以下に、マージモードによる小数点精度アフィンパラメータの導出について説明する。
(Decimal point precision affine parameter derivation)
Hereinafter, derivation of the decimal precision affine parameter by the merge mode will be described.
 アフィン予測部30372又はAMVP予測パラメータ導出部3032は、アフィンパラメータ(ev, rv)を、制御点V0の動きベクトル(mv0_x, mv0_y)、及び、制御点V1における、制御点V0の動きベクトルの大きさに応じて制限された動きベクトル(mv1_x', mv1_y')から
 ev = (mv1_x' - mv0_x) / W
 rv = (mv1_y' - mv0_y) / W
と導出してもよい。
The affine prediction unit 30372 or the AMVP prediction parameter derivation unit 3032 uses the affine parameters (ev, rv), the motion vector (mv0_x, mv0_y) of the control point V0, and the magnitude of the motion vector of the control point V0 at the control point V1. Ev = (mv1_x '-mv0_x) / W from motion vector (mv1_x', mv1_y ') restricted according to
rv = (mv1_y '-mv0_y) / W
May be derived.
 また、アフィン予測部30372又はAMVP予測パラメータ導出部3032は、制御点V0の動きベクトル(mv0_x, mv0_y)、及び、制御点V2における、制御点V0の動きベクトルの大きさに応じて制限された動きベクトル(mv2_x', mv2_y')から
 ev = (mv2_y' - mv0_y) / H
 rv = -(mv2_x' - mv0_x) / H
と導出してもよい。
Further, the affine prediction unit 30372 or the AMVP prediction parameter derivation unit 3032 performs motion limited according to the motion vector (mv0_x, mv0_y) of the control point V0 and the motion vector of the control point V0 at the control point V2. From vector (mv2_x ', mv2_y') to ev = (mv2_y '-mv0_y) / H
rv =-(mv2_x '-mv0_x) / H
May be derived.
 また、アフィン予測部30372又はAMVP予測パラメータ導出部3032は、制御点V1の動きベクトル、及び、制御点V2における、制御点V1の動きベクトルの大きさに応じて制限された動きベクトル(mv2_x', mv2_y')から
 ev = {(mv1_x - mv2_x') - (mv1_y - mv2_y')} / 2W
 rv = {(mv1_x - mv2_x') + (mv1_y - mv2_y')} / 2W
と導出してもよい。
Also, the affine prediction unit 30372 or the AMVP prediction parameter derivation unit 3032 has a motion vector (mv2_x ′, mv2_x ′,) limited according to the motion vector of the control point V1 and the magnitude of the motion vector of the control point V1 at the control point V2. mv2_y ') to ev = ((mv1_x-mv2_x')-(mv1_y-mv2_y ')} / 2W
rv = {(mv1_x-mv2_x ') + (mv1_y-mv2_y')} / 2W
May be derived.
 また、アフィン予測部30372は、制御点V0の動きベクトル(mv0_x, mv0_y)、及び、制御点V3における、制御点V0の動きベクトルの大きさに応じて制限された動きベクトル(mv3_x', mv3_y')から
 ev = (mv3_x' - mv0_x + mv3_y' - mv0_y) / 2W
 rv = (-mv3_x' + mv0_x + mv3_y' - mv0_y) / 2W
と導出してもよい。
Also, the affine prediction unit 30372 has a motion vector (mv3_x ′, mv3_y ′) limited according to the motion vector (mv0_x, mv0_y) of the control point V0 and the magnitude of the motion vector of the control point V0 at the control point V3. ) To ev = (mv3_x '-mv0_x + mv3_y'-mv0_y) / 2W
rv = (-mv3_x '+ mv0_x + mv3_y'-mv0_y) / 2W
May be derived.
 また、アフィン予測部30372又はAMVP予測パラメータ導出部3032は、アフィンパラメータを、制御点V0の動きベクトル(mv0_x, mv0_y)、及び制御点V1及びV2における、制御点V0の動きベクトルの大きさに応じて制限された動きベクトルから(mv1_x',mv1_y'), (mv2_x', mv2_y')から
 ev1 = (mv1_x' - mv0_x) / W
 rv2 = (mv2_x' - mv0_x) / H
 rv1 = (mv1_y' - mv0_y) / W
 ev2 = (mv2_y' - mv0_y) / H
と導出してもよい。
Also, the affine prediction unit 30372 or the AMVP prediction parameter derivation unit 3032 determines the affine parameters according to the motion vector (mv0_x, mv0_y) of the control point V0 and the magnitude of the motion vector of the control point V0 at the control points V1 and V2. (Mv1_x ', mv1_y'), (mv2_x ', mv2_y') to ev1 = (mv1_x '-mv0_x) / W
rv2 = (mv2_x '-mv0_x) / H
rv1 = (mv1_y '-mv0_y) / W
ev2 = (mv2_y '-mv0_y) / H
May be derived.
 なお、制御点の動きベクトルを制限しない場合のアフィンパラメータは、上述の式から「'」を取った式として導出される。 It should be noted that the affine parameter when the motion vector of the control point is not limited is derived as an expression obtained by taking “′” from the above expression.
 (整数精度アフィンパラメータ導出)
 以下に、マージモードによる整数精度アフィンパラメータの導出について説明する。
(Derivation of integer precision affine parameters)
Hereinafter, derivation of integer precision affine parameters by the merge mode will be described.
 アフィン予測部30372又はAMVP予測パラメータ導出部3032は、アフィンパラメータ(evBW, rvBW)、(evBH, rvBH)を、制御点V0の動きベクトル(mv0_x, mv0_y)、及び、制御点V1における、制御点V0の動きベクトルの大きさに応じて制限された制限後の制御点V1の動きベクトルから
 evBW = (mv1_x' - mv0_x) >> shiftWBW
 rvBW = (mv1_y' - mv0_y) >> shiftWBW
 evBH = (mv1_x' - mv0_x) >> shiftWBH
 rvBH = (mv1_y' - mv0_y) >> shiftWBH
 shiftWBW = log2(W) - log2(BW)
 shiftWBH = log2(W) - log2(BH)
と導出してもよい。
The affine prediction unit 30372 or the AMVP prediction parameter derivation unit 3032 uses the affine parameters (evBW, rvBW), (evBH, rvBH), the motion vector (mv0_x, mv0_y) of the control point V0, and the control point V0 at the control point V1. EvBW = (mv1_x '-mv0_x) >> shiftWBW from the motion vector of the restricted control point V1 limited according to the size of the motion vector
rvBW = (mv1_y '-mv0_y) >> shiftWBW
evBH = (mv1_x '-mv0_x) >> shiftWBH
rvBH = (mv1_y '-mv0_y) >> shiftWBH
shiftWBW = log2 (W)-log2 (BW)
shiftWBH = log2 (W)-log2 (BH)
May be derived.
 なお、evBW、rvBW、evBH及びrvBHは、それぞれ以下の式を満たす。
evBW = ev * BW, rvBW = rv * BW, evBH = ev*BH, rvBH = rv*BH
 また、アフィン予測部30372又はAMVP予測パラメータ導出部3032は、制御点V0の動きベクトル(mv0_x, mv0_y)、及び、制御点V2における、制御点V0の動きベクトルの大きさに応じて制限された動きベクトル(mv2_x', mv2_y')から
 evBW = (mv2_y' - mv0_y) >> shiftHBW
 rvBW = -(mv2_x' - mv0_x) >> shiftHBW
 evBH = (mv2_y' - mv0_y) >> shiftHBH
 rvBH = -(mv2_x' - mv0_x) >> shiftHBH
 shiftHBW = log2(H) - log2(BW)
 shiftHBH = log2(H) - log2(BH)
と導出してもよい。
Note that evBW, rvBW, evBH, and rvBH satisfy the following expressions, respectively.
evBW = ev * BW, rvBW = rv * BW, evBH = ev * BH, rvBH = rv * BH
Further, the affine prediction unit 30372 or the AMVP prediction parameter derivation unit 3032 performs motion limited according to the motion vector (mv0_x, mv0_y) of the control point V0 and the motion vector of the control point V0 at the control point V2. From vector (mv2_x ', mv2_y') to evBW = (mv2_y '-mv0_y) >> shiftHBW
rvBW =-(mv2_x '-mv0_x) >> shiftHBW
evBH = (mv2_y '-mv0_y) >> shiftHBH
rvBH =-(mv2_x '-mv0_x) >> shiftHBH
shiftHBW = log2 (H)-log2 (BW)
shiftHBH = log2 (H)-log2 (BH)
May be derived.
 また、アフィン予測部30372又はAMVP予測パラメータ導出部3032は、制御点V1の動きベクトル(mv1_x, mv1_y)、及び、制御点V2における、制御点V1の動きベクトルの大きさに応じて制限された動きベクトル(mv2_x', mv2_y')から
 evBW = {(mv1_x - mv2_x') - (mv1_y - mv2_y')} >> (shiftWBW + 1)
 rvBW = {(mv1_x - mv2_x') + (mv1_y - mv2_y')} >> (shiftWBW + 1)
 evBH = {(mv1_x - mv2_x') - (mv1_y - mv2_y')} >> (shiftWBH + 1)
 rvBH = {(mv1_x - mv2_x') + (mv1_y - mv2_y')} >> (shiftWBH + 1)
と導出してもよい。
Further, the affine prediction unit 30372 or the AMVP prediction parameter derivation unit 3032 performs the motion limited according to the motion vector (mv1_x, mv1_y) of the control point V1 and the motion vector of the control point V1 at the control point V2. From vector (mv2_x ', mv2_y') to evBW = ((mv1_x-mv2_x ')-(mv1_y-mv2_y')} >> (shiftWBW + 1)
rvBW = ((mv1_x-mv2_x ') + (mv1_y-mv2_y')} >> (shiftWBW + 1)
evBH = ((mv1_x-mv2_x ')-(mv1_y-mv2_y')} >> (shiftWBH + 1)
rvBH = ((mv1_x-mv2_x ') + (mv1_y-mv2_y')} >> (shiftWBH + 1)
May be derived.
 また、アフィン予測部30372又はAMVP予測パラメータ導出部3032は、制御点V0の動きベクトル(mv0_x, mv0_y)、及び、制御点V3における、制御点V0の動きベクトルの大きさに応じて制限された動きベクトル(mv3_x', mv3_y')から
 evBW = (mv3_x' - mv0_x + mv3_y' - mv0_y) >> (shiftWBW + 1)
 rvBW = (-mv3_x' + mv0_x + mv3_y' - mv0_y) >> (shiftWBW + 1)
 evBH = (mv3_x' - mv0_x + mv3_y' - mv0_y) >> (shiftHBH + 1)
 rvBH = (-mv3_x' + mv0_x + mv3_y' - mv0_y) >> (shiftHBH + 1)
と導出してもよい。
Further, the affine prediction unit 30372 or the AMVP prediction parameter derivation unit 3032 performs motion limited according to the motion vector (mv0_x, mv0_y) of the control point V0 and the motion vector of the control point V0 at the control point V3. From vector (mv3_x ', mv3_y') to evBW = (mv3_x '-mv0_x + mv3_y'-mv0_y) >> (shiftWBW + 1)
rvBW = (-mv3_x '+ mv0_x + mv3_y'-mv0_y) >> (shiftWBW + 1)
evBH = (mv3_x '-mv0_x + mv3_y'-mv0_y) >> (shiftHBH + 1)
rvBH = (-mv3_x '+ mv0_x + mv3_y'-mv0_y) >> (shiftHBH + 1)
May be derived.
 また、アフィン予測部30372又はAMVP予測パラメータ導出部3032は、アフィンパラメータを、制御点V0の動きベクトル(mv0_x, mv0_y)、及び制御点V1及びV2における、制御点V0の動きベクトルの大きさに応じて制限された動きベクトルから(mv1_x',mv1_y'), (mv2_x', mv2_y')から
 ev1BW = (mv1_x' - mv0_x) >> shiftWBW
 rv2BH = (mv2_x' - mv0_x) >> shiftHBH
 rv1BW = (mv1_y' - mv0_y) >> shiftWBW
 ev2BH = (mv2_y' - mv0_y) >> shiftHBH
と導出してもよい。
Also, the affine prediction unit 30372 or the AMVP prediction parameter derivation unit 3032 determines the affine parameters according to the motion vector (mv0_x, mv0_y) of the control point V0 and the magnitude of the motion vector of the control point V0 at the control points V1 and V2. (Mv1_x ', mv1_y'), (mv2_x ', mv2_y') to ev1BW = (mv1_x '-mv0_x) >> shiftWBW
rv2BH = (mv2_x '-mv0_x) >> shiftHBH
rv1BW = (mv1_y '-mv0_y) >> shiftWBW
ev2BH = (mv2_y '-mv0_y) >> shiftHBH
May be derived.
 なお、制御点の動きベクトルを制限しない場合には、AMVP予測パラメータ導出部3032によって導出される上述の整数精度のアフィンパラメータは、上述の式から「'」を取った式として導出される。 If the motion vector of the control point is not limited, the above-described integer precision affine parameter derived by the AMVP prediction parameter deriving unit 3032 is derived as an expression obtained by taking “′” from the above expression.
 (STEP2:サブブロックの動きベクトルの導出)
 アフィン予測部30372又はAMVP予測パラメータ導出部3032は、上記の式により求めたアフィンパラメータを用いて、サブブロックの動きベクトルを導出する。
(STEP2: Derivation of motion vector of sub-block)
The affine prediction unit 30372 or the AMVP prediction parameter derivation unit 3032 derives the motion vector of the sub-block using the affine parameter obtained by the above formula.
 4パラメータアフィンの場合、上述のAMVPモードとマージモードとでそれぞれ算出したアフィンパラメータ(ev, rv)から、サブブロック座標(xi, yj)のサブブロックの動きベクトル(mvij_x, mvij_y)を以下の式AF4P_floatにより、導出する。 In the case of 4-parameter affine, sub block motion vectors (mvij_x, mvij_y) of subblock coordinates (xi, yj) are calculated from the affine parameters (ev, rv) calculated in the AMVP mode and the merge mode, respectively, as follows: Derived from AF4P_float.
 mvij_x = mv_x + ev * xi - rv * yj
 mvij_y = mv_y + rv * xi + ev * yj (式AF4P_float)
 ここで、画素単位の位置であるサブブロック座標(xi, yj)と、サブブロック単位の位置であるサブブロック位置(i, j)との関係は以下の式XYIJのとおりである。
mvij_x = mv_x + ev * xi-rv * yj
mvij_y = mv_y + rv * xi + ev * yj (Formula AF4P_float)
Here, the relationship between the sub-block coordinates (xi, yj), which is a pixel unit position, and the sub-block position (i, j), which is a sub-block unit position, is as shown in the following formula XYIJ.
 xi = BW / 2 + BW * i
 yj = BH / 2 + BH * j (式XYIJ)
 i = 0, 1, 2,・・・(W/BW)-1、j = 0, 1, 2,・・・(H/BH)-1
 i = (xi - BW/2) /BW
 j = (xj - BH/2) /BH
 並進ベクトルのアフィンパラメータmv_x, mv_yとして制御点V0の動きベクトル(mv0_x、mv0_y)を用いてもよいが、これに限定されない。例えば制御点V0以外の動きベクトルとして、制御点V1の動きベクトル、制御点V2の動きベクトル、制御点V3の動きベクトルを並進ベクトルとしてもよい。
xi = BW / 2 + BW * i
yj = BH / 2 + BH * j (formula XYIJ)
i = 0, 1, 2, ... (W / BW) -1, j = 0, 1, 2, ... (H / BH) -1
i = (xi-BW / 2) / BW
j = (xj-BH / 2) / BH
Although the motion vector (mv0_x, mv0_y) of the control point V0 may be used as the affine parameters mv_x, mv_y of the translation vector, the present invention is not limited to this. For example, as a motion vector other than the control point V0, a motion vector at the control point V1, a motion vector at the control point V2, and a motion vector at the control point V3 may be used as translation vectors.
 また、アフィンパラメータが整数のアフィンパラメータ(evBW, rvBW)、(evBH, rvBH)であれば、サブブロック位置(i, j)のサブブロックの動きベクトル(mvij_x, mvij_y)を以下の式AF4P_integerにより導出する。 If the affine parameters are integer affine parameters (evBW, rvBW) and (evBH, rvBH), the motion vector (mvij_x, mvij_y) of the subblock at the subblock position (i, j) is derived by the following formula AF4P_integer To do.
 mvij_x = mv_x + of_x + evBW * i - rvBH * j
 mvij_y = mv_y + of_y + rvBW * i + evBH * j (式AF4P_integer)
 ここでofx = ((evBW - rvBH) >> 1)、ofy = ((rvBW + evBH) >> 1)
 並進ベクトル(mv_x, mv_y)として(mv0_x, mv0_y)を用いることもできる。
mvij_x = mv_x + of_x + evBW * i-rvBH * j
mvij_y = mv_y + of_y + rvBW * i + evBH * j (expression AF4P_integer)
Where ofx = ((evBW-rvBH) >> 1), ofy = ((rvBW + evBH) >> 1)
(Mv0_x, mv0_y) can also be used as the translation vector (mv_x, mv_y).
 なお、以下に示すように、式AF4P_floatから式AF4P_integerに変形することができる。 Note that, as shown below, the expression AF4P_float can be transformed into the expression AF4P_integer.
 mvij_x = mv_x + ev * xi - rv * yj
 mvij_y = mv_y + rv * xi + ev * yj (式AF4P_float)
 式XYIJから、xi = BW / 2 + BW * i、yj = BH / 2 + BH * jであるため、これらの値を式AF4P_floatに代入して、
 mvij_x = mv_x + ev * (BW/2 + BW*i) - rv * (BH/2 + BH*j)
 mvij_y = mv_y + rv * (BW/2 + BW*i) + ev * (BH/2 + BH*j)
となり、上述の式を変形すると、
 mvij_x = mv_x + (BW * ev - BH * rv)>>1 + BW * ev * i - BH * rv *j
 mvij_y = mv_y + (BW * rv + BH * ev)>>1 + BW * rv * i + BH * ev *j
となる。また、BW * ev = evBW、BH * rv = rvBH、BW * rv = rvBW、BH * ev = evBHであることから、上述の式を更に変形すると、
 mvij_x = mv_x + (evBW - rvBH)>>1 + evBW * i - rvBH * j
 mvij_y = mv_y + (rvBW + evBH)>>1 + rvBW * i + evBH * j (式AF4P_integer)
となる。
mvij_x = mv_x + ev * xi-rv * yj
mvij_y = mv_y + rv * xi + ev * yj (Formula AF4P_float)
From the formula XYIJ, xi = BW / 2 + BW * i, yj = BH / 2 + BH * j, so these values are substituted into the formula AF4P_float,
mvij_x = mv_x + ev * (BW / 2 + BW * i)-rv * (BH / 2 + BH * j)
mvij_y = mv_y + rv * (BW / 2 + BW * i) + ev * (BH / 2 + BH * j)
When the above formula is transformed,
mvij_x = mv_x + (BW * ev-BH * rv) >> 1 + BW * ev * i-BH * rv * j
mvij_y = mv_y + (BW * rv + BH * ev) >> 1 + BW * rv * i + BH * ev * j
It becomes. Also, since BW * ev = evBW, BH * rv = rvBH, BW * rv = rvBW, BH * ev = evBH, if the above equation is further modified,
mvij_x = mv_x + (evBW-rvBH) >> 1 + evBW * i-rvBH * j
mvij_y = mv_y + (rvBW + evBH) >> 1 + rvBW * i + evBH * j (expression AF4P_integer)
It becomes.
 なお、サブブロックの幅BWと高さBHが等しい場合には、
 (evBW, rvBW)= (evBH, rvBH)
となるので、上記の導出式で(evBW, rvBW)と(evBH, rvBH)を区別する必要はない。すなわち、(evBW, rvBW)のみから導出してもよい。
If the width BW and height BH of the sub block are equal,
(evBW, rvBW) = (evBH, rvBH)
Therefore, it is not necessary to distinguish (evBW, rvBW) from (evBH, rvBH) in the above derivation formula. That is, it may be derived only from (evBW, rvBW).
 mvij_x = mv_x +((evBW - rvBW) >> 1) + evBW * i - rvBW * j
 mvij_y = mv_y +((rvBW + evBW) >> 1) + rvBW * i + evBW * j
 また、(evBH, rvBH)のみから導出してもよい。
mvij_x = mv_x + ((evBW-rvBW) >> 1) + evBW * i-rvBW * j
mvij_y = mv_y + ((rvBW + evBW) >> 1) + rvBW * i + evBW * j
Alternatively, it may be derived only from (evBH, rvBH).
 mvij_x = mv_x +((evBH + rvBH) >> 1) + evBH * i - rvBH * j
 mvij_y = mv_y +((rvBH + evBH) >> 1) + rvBH * i + evBH * j
 図38は、対象ブロック(横幅W、高さH)の制御点V0が左上頂点に位置し、幅BW、高さBHのサブブロックに分割した例を示す図である。(W,H)、(BW,BH)は前述の(nPbW, nPbH)、(nSbW, nSbH)に対応する。
mvij_x = mv_x + ((evBH + rvBH) >> 1) + evBH * i-rvBH * j
mvij_y = mv_y + ((rvBH + evBH) >> 1) + rvBH * i + evBH * j
FIG. 38 is a diagram illustrating an example in which the control point V0 of the target block (horizontal width W, height H) is located at the upper left vertex and is divided into sub-blocks having a width BW and a height BH. (W, H) and (BW, BH) correspond to the aforementioned (nPbW, nPbH) and (nSbW, nSbH).
 サブブロック位置(i, j)及びサブブロック座標(xi, yj)の点は、図38におけるx軸に平行な破線とy軸に平行な破線との交点である。図38には、一例として、サブブロック位置(i, j) = (1, 1)の点、及び当該サブブロック位置(1, 1)に対するサブブロック座標(xi, yj) = (x1, y1) = (1*BW+BW/2, 1*BH+BH/2)の点が示されている。 The points of the subblock position (i, j) and the subblock coordinates (xi, yj) are the intersections of the broken line parallel to the x axis and the broken line parallel to the y axis in FIG. In FIG. 38, as an example, the point of the sub-block position (i, j) = (1, 1) and the sub-block coordinates (xi, jyj) = (x1, y1) with respect to the sub-block position (1, 1) = (1 * BW + BW / 2, 1 * BH + BH / 2) is shown.
 6パラメータアフィンの場合、アフィンパラメータ(ev1、rv1、ev2、rv2)から、サブブロック座標(xi, yj)のサブブロックの動きベクトル(mvij_x, mvij_y)を以下の式AF6P_floatにより、
 mvij_x = mv_x + ev1 * xi + rv2 * yj
 mvij_y = mv_y + rv1 * xi + ev2 * yj (式AF6P_float)
と導出する。
In the case of 6-parameter affine, the motion vector (mvij_x, mvij_y) of the sub-block coordinates (xi, yj) from the affine parameters (ev1, rv1, ev2, rv2) is expressed by the following formula AF6P_float:
mvij_x = mv_x + ev1 * xi + rv2 * yj
mvij_y = mv_y + rv1 * xi + ev2 * yj (Formula AF6P_float)
And derived.
 また、アフィンパラメータ(ev1、rv1、ev2、rv2)が整数のアフィンパラメータ(ev1BW、rv1BH、ev2BW、ev2BH)の場合には、サブブロック位置(i, j)のサブブロックの動きベクトル(mvij_x, mvij_y)を以下の式AF6P_integerにより導出する。 When the affine parameters (ev1, rv1, ev2, rv2) are integer affine parameters (ev1BW, rv1BH, ev2BW, ev2BH), the motion vector (mvij_x, mvij_y) of the subblock at the subblock position (i, j) ) Is derived by the following expression AF6P_integer.
 mvij_x = mv_x +((ev1BW + rv2BH) >> 1) + ev1BW * i + rv2BH * j
 mvij_y = mv_y +((rv1BW + ev2BH) >> 1) + rv1BW * i + ev2BH * j (式AF6P_integer)
 〔サブブロックの動きベクトル導出処理の変更例1〕
 上述の例では、マージモードにおけるサブブロックの動きベクトルを導出する際に、アフィン予測部30372又はAMVP予測パラメータ導出部3032が、各制御点間の動きベクトルの差分の範囲を制限しているが、本実施形態ではこれに限定されない。
mvij_x = mv_x + ((ev1BW + rv2BH) >> 1) + ev1BW * i + rv2BH * j
mvij_y = mv_y + ((rv1BW + ev2BH) >> 1) + rv1BW * i + ev2BH * j (expression AF6P_integer)
[Modification Example 1 of Subblock Motion Vector Derivation Processing]
In the above example, when the motion vector of the sub-block in the merge mode is derived, the affine prediction unit 30372 or the AMVP prediction parameter derivation unit 3032 limits the range of the motion vector difference between the control points. The present embodiment is not limited to this.
 本実施形態では、アフィン予測部30372又はAMVP予測パラメータ導出部3032がサブブロックの動きベクトルを導出する際に、サブブロックのサイズを制限してもよい。なお、変更例1及び変更例2では、アフィン予測部30372が処理を実行する場合について説明するが、アフィン予測部30372に代えて、AMVP予測パラメータ導出部3032が処理を実行してもよい。 In this embodiment, when the affine prediction unit 30372 or the AMVP prediction parameter derivation unit 3032 derives the motion vector of the subblock, the size of the subblock may be limited. In the first modification and the second modification, the case where the affine prediction unit 30372 executes the process will be described. However, instead of the affine prediction unit 30372, the AMVP prediction parameter derivation unit 3032 may execute the process.
 例えば、アフィン予測部30372は、複数の制御点における各々の動きベクトルの差分が予め定められた値よりも大きい場合には、当該差分が予め定められた値以下である場合よりも大きいサイズのサブブロックを設定し、動きベクトルを導出してもよい。 For example, when the difference between the motion vectors at the plurality of control points is larger than a predetermined value, the affine prediction unit 30372 has a sub size larger than that when the difference is equal to or smaller than the predetermined value. A block may be set and a motion vector may be derived.
 以下に、アフィン予測部30372がサブブロックのサイズを決定する処理について、図39を用いて説明する。図39は、サブブロックサイズ決定フローの概要を示すフローチャート図である。図39に示されるように、アフィン予測部30372によるサブブロックサイズ決定処理は、下記の(ステップS321)~(ステップS323)の3つの工程を含んでいる。 Hereinafter, the process in which the affine prediction unit 30372 determines the size of the sub-block will be described with reference to FIG. FIG. 39 is a flowchart showing an outline of the sub-block size determination flow. As shown in FIG. 39, the sub-block size determination process by the affine prediction unit 30372 includes the following three steps (Step S321) to (Step S323).
 (ステップS321)動きベクトルの差分の判定
 アフィン予測部30372は、制御点間のベクトル差分が大きいか否かを判定する。例えば、アフィン予測部30372は、図37の制御点V0と制御点V1との間のベクトル差分が、以下の式(eq3)を満たす場合には、制御点V0と制御点V1とのベクトル差分が大きいと判定してもよい。同様に、アフィン予測部30372は、以下の式(eq3)を満たさない場合には、制御点V0と、制御点V1とのベクトル差分が大きくないと判定してもよい。
|mv1_x - mv0_x| + |mv1_y - mv0_y| > M     (eq3)
 なお、上述の式のMは、予め定められた所定の閾値を示す。差分の大きさは上記のように差の絶対値の和として求めてもよいし、差の2乗和として求めてもよい。
(Step S321) Determination of Motion Vector Difference The affine prediction unit 30372 determines whether or not the vector difference between control points is large. For example, when the vector difference between the control point V0 and the control point V1 in FIG. 37 satisfies the following equation (eq3), the affine prediction unit 30372 calculates the vector difference between the control point V0 and the control point V1. You may determine with it being large. Similarly, the affine prediction unit 30372 may determine that the vector difference between the control point V0 and the control point V1 is not large when the following equation (eq3) is not satisfied.
| mv1_x-mv0_x | + | mv1_y-mv0_y |> M (eq3)
Note that M in the above expression represents a predetermined threshold value. The magnitude of the difference may be obtained as the sum of the absolute values of the differences as described above, or may be obtained as the sum of squares of the differences.
 なお、制御点間のベクトル差分は、制御点V0と制御点V1とのベクトル差分で判別する形態に限定されない。制御点間のベクトル差分は、例えば、以下の式(eq3’)に示すように、制御点V0と制御点V2とのベクトル差分で判別してもよいし、以下の式(eq3’’)に示すように、制御点V1と、制御点V2とのベクトル差分で判別してもよい。
|mv2_x - mv0_x| + |mv2_y - mv0_y| > M     (eq3’)
|mv2_x - mv1_x| + |mv2_y - mv1_y| > M     (eq3’’)
 アフィン予測部30372は、制御点間のベクトル差分が大きい(ステップS321にてY)と判定した場合、ステップS322に進む。アフィン予測部30372は、制御点間のベクトル差分を大きくない(ステップS321にてN)と判定した場合、ステップS323に進む。
In addition, the vector difference between control points is not limited to the form discriminate | determined by the vector difference of control point V0 and control point V1. The vector difference between the control points may be determined by the vector difference between the control point V0 and the control point V2, as shown in the following equation (eq3 ′), or the following equation (eq3 ″): As shown, it may be determined by the vector difference between the control point V1 and the control point V2.
| mv2_x-mv0_x | + | mv2_y-mv0_y |> M (eq3 ')
| mv2_x-mv1_x | + | mv2_y-mv1_y |> M (eq3 '')
If the affine prediction unit 30372 determines that the vector difference between the control points is large (Y in step S321), the process proceeds to step S322. If the affine prediction unit 30372 determines that the vector difference between the control points is not large (N in step S321), the process proceeds to step S323.
 (ステップS322)大サブブロックサイズに決定
 アフィン予測部30372は、サブブロックの動きベクトルを導出する際に、当該サブブロックのサイズを大きいサブブロックのサイズ(大サブブロックサイズ)に決定する。例えば、アフィン予測部30372は、サブブロックのサイズを8×8の大サブブロックサイズに決定してもよい。また、大サブブロックサイズは、後述の小さいサブブロックのサイズ(小サブブロックサイズ)よりも大きければよい。例えば、小サブブロックサイズを4×4に設定している場合には、アフィン予測部30372は、大サブブロックのサイズを、8×4又は4×8に決定してもよい。
(Step S322) Determination to Large Subblock Size When the affine prediction unit 30372 derives a motion vector of a subblock, the affine prediction unit 30372 determines the size of the subblock to be the size of a large subblock (large subblock size). For example, the affine prediction unit 30372 may determine the size of the sub-block to be a large sub-block size of 8 × 8. The large sub-block size only needs to be larger than the small sub-block size (small sub-block size) described later. For example, when the small subblock size is set to 4 × 4, the affine prediction unit 30372 may determine the size of the large subblock to be 8 × 4 or 4 × 8.
 (ステップS323)小サブブロックサイズに決定
 アフィン予測部30372は、サブブロックの動きベクトルを導出する際に、当該サブブロックのサイズを小サブブロックサイズに決定する。例えば、アフィン予測部30372は、サブブロックのサイズを4×4の小サブブロックサイズに決定してもよい。また、小サブブロックサイズは、大サブブロックサイズよりも小さければよい。例えば、大サブブロックサイズが8×8という大きいサイズに設定している場合には、アフィン予測部30372は、小サブブロックのサイズを8×4又は4×8に決定してもよい。
(Step S323) Determination to Small Subblock Size When the affine prediction unit 30372 derives a motion vector of a subblock, the size of the subblock is determined to be a small subblock size. For example, the affine prediction unit 30372 may determine the size of the subblock to be a 4 × 4 small subblock size. Further, the small sub-block size only needs to be smaller than the large sub-block size. For example, when the large sub-block size is set to a large size of 8 × 8, the affine prediction unit 30372 may determine the size of the small sub-block as 8 × 4 or 4 × 8.
 なお、アフィン予測部30372は、大サブブロックサイズと、小サブブロックサイズとの組み合わせ、(大サブブロックサイズ、小サブブロックサイズ)を、例えば、(8×8, 4×4)、(8×8 , 8×4)又は(8×4 , 4×4)等に決定してもよい。 Note that the affine prediction unit 30372 sets the combination of the large sub-block size and the small sub-block size (large sub-block size, small sub-block size), for example, (8 × 8, 4 × 4), (8 × 8, に 8 × 4) or (8 × 4, 4 × 4), etc.
 ステップS322又はステップS323の後、アフィン予測部30372は、サブブロックのサイズの決定処理を終了する。 After step S322 or step S323, the affine prediction unit 30372 ends the sub-block size determination process.
 なお、上述の例では、アフィン予測部30372は、式(eq3)を満たす場合に、制御間のベクトル差分が大きいように判定しているが、本実施形態ではこれに限定されない。本実施形態では、アフィン予測部30372は、以下の式(eq4)を満たす場合に、制御点間のベクトル差分が大きいと判定してもよいし、以下の式(eq4’)を満たす場合に、制御点間のベクトル差分が大きいと判定してもよい。 In the above example, the affine prediction unit 30372 determines that the vector difference between the controls is large when the expression (eq3) is satisfied, but the present embodiment is not limited to this. In the present embodiment, the affine prediction unit 30372 may determine that the vector difference between the control points is large when the following equation (eq4) is satisfied, or when the following equation (eq4 ′) is satisfied: It may be determined that the vector difference between the control points is large.
 |evBW| + |rvBW| > M     (eq4)
 |evBH| + |rvBH| > M     (eq4’)
 つまり、アフィンパラメータの大きさが大きい場合には、制御点間のベクトル差分が大きくなる。すなわち、式(eq3)と式(eq4)とは、等価である。そのため、ステップS321においてアフィン予測部30372は、アフィンパラメータが大きいか否かを判定する式として、式(eq3)に代えて、式(eq4)を用いてもよい。
| evBW | + | rvBW |> M (eq4)
| evBH | + | rvBH |> M (eq4 ')
That is, when the affine parameter is large, the vector difference between the control points is large. That is, the expression (eq3) and the expression (eq4) are equivalent. Therefore, in step S321, the affine prediction unit 30372 may use equation (eq4) instead of equation (eq3) as an equation for determining whether or not the affine parameter is large.
 なお、AMVP予測パラメータ導出部3032も、アフィン予測部30372と同様にサブブロックのサイズを決定してもよい。 Note that the AMVP prediction parameter derivation unit 3032 may determine the size of the sub-block in the same manner as the affine prediction unit 30372.
 〔サブブロックの動きベクトル導出処理の変更例2〕
 また、アフィン予測部30372は、上述の例の代わりに、動きベクトルを予測する対象である対象ブロックのアスペクト比に応じて、動きベクトルを導出するのに用いられるサブブロックのアスペクト比を決定してもよい。すなわち、アフィン予測部30372は、対象ブロックのアスペクト比に応じたアスペクト比のサブブロックの動きベクトルを導出してもよい。
[Modification Example 2 of Subblock Motion Vector Derivation Processing]
Also, the affine prediction unit 30372 determines the aspect ratio of the sub-block used for deriving the motion vector according to the aspect ratio of the target block that is the target of motion vector prediction, instead of the above example. Also good. That is, the affine prediction unit 30372 may derive a motion vector of a sub-block having an aspect ratio corresponding to the aspect ratio of the target block.
 (対象ブロックが横長又は縦長の場合におけるサブブロックのアスペクト比の決定)
 例えば、アフィン予測部30372は、対象ブロックが横長の場合、サブブロックのアスペクト比を横長とし、対象ブロックが縦長の場合、サブブロックのアスペクト比を縦長に決定してもよい。
(Determination of the aspect ratio of sub-blocks when the target block is horizontally long or vertically long)
For example, the affine prediction unit 30372 may determine that the aspect ratio of the sub-block is horizontally long when the target block is horizontally long, and may determine the aspect ratio of the sub-block vertically when the target block is vertically long.
 一例として、図37に示される幅Wx高さHの対象ブロックにおいて、対象ブロックの横幅Wが高さHよりも大きい(W>Hである)場合、アフィン予測部30372は、サブブロックのBW及びBHを、それぞれBW = 8、BH = 4に決定してもよい。 As an example, in the target block having the width Wx and the height H shown in FIG. 37, when the horizontal width W of the target block is larger than the height H (W> H), the affine prediction unit 30372 BH may be determined as BW = 8 and BH = 4, respectively.
 また、対象ブロックの高さHが横幅Wよりも大きい(H>Wである)場合、アフィン予測部30372は、サブブロックのBW及びBHを、それぞれBW = 4、BH = 8に決定してもよい。 Further, when the height H of the target block is larger than the width W (H> W), the affine prediction unit 30372 may determine that BW and BH of the sub-block are BW = 4 and BH = 8, respectively. Good.
 対象ブロックが横長の場合、サブブロックのアスペクト比を横長にし、対象ブロックが縦長の場合、縦長のサブブロックのアスペクト比を縦長にすることにより、最適なアスペクト比のサブブロックにすることができる。 When the target block is horizontally long, the aspect ratio of the sub-block is horizontally long. When the target block is vertically long, the aspect ratio of the vertically long sub-block is vertically long, so that the sub-block having the optimum aspect ratio can be obtained.
 (対象ブロックの横幅と高さとが等しい場合におけるサブブロックのアスペクト比の決定1)
 また、対象ブロックの横幅と高さとが等しい場合、アフィン予測部30372は、サブブロックのアスペクト比を横長に決定してもよい。
(Determination of aspect ratio of sub-block when the width and height of the target block are equal 1)
Further, when the horizontal width and the height of the target block are equal, the affine prediction unit 30372 may determine the aspect ratio of the sub-block to be horizontal.
 一例として、図37に示される幅Wx高さHの対象ブロックにおいて、対象ブロックの横幅Wが高さHと等しい(W=Hである)場合、アフィン予測部30372は、サブブロックのBW及びBHを、それぞれBW = 8、BH = 4に決定してもよい。 As an example, in the target block having the width Wx and the height H shown in FIG. 37, when the horizontal width W of the target block is equal to the height H (W = H), the affine prediction unit 30372 May be determined as BW = 8 and BH = 4, respectively.
 サブブロック間の横方向の動きベクトル変化が、縦方向の動きベクトル変化よりも大きい場合、サブブロックが縦長よりも横長のほうが、キャッシュが当たりやすい。そのため、上述の構成によれば、対象ブロックの横幅と高さとが等しい場合にサブブロックの横幅と高さを等しくセットする場合よりも、メモリバンド幅を小さくすることができる。 If the change in the horizontal motion vector between the sub-blocks is larger than the change in the vertical motion vector, the cache is more likely to hit when the sub-block is horizontally long than vertically. Therefore, according to the above configuration, the memory bandwidth can be made smaller when the horizontal width and height of the sub-block are set equal when the horizontal width and height of the target block are equal.
 (対象ブロックの横幅と高さとが等しい場合におけるサブブロックのアスペクト比の決定2)
 逆に、対象ブロックの横幅と高さとが等しい場合、アフィン予測部30372は、サブブロックのアスペクト比を縦長に決定してもよい。
(Determining the aspect ratio of the sub-block when the width and height of the target block are equal 2)
Conversely, when the horizontal width and height of the target block are equal, the affine prediction unit 30372 may determine the aspect ratio of the sub-block to be vertically long.
 一例として、図37に示される幅Wx高さHの対象ブロックにおいて、対象ブロックの横幅Wが高さHと等しい(W=Hである)場合、アフィン予測部30372は、サブブロックのBW及びBHを、それぞれBW = 4、BH = 8に決定してもよい。 As an example, in the target block having the width Wx and the height H shown in FIG. 37, when the horizontal width W of the target block is equal to the height H (W = H), the affine prediction unit 30372 May be determined as BW = 4 and BH = 8, respectively.
 メモリバンド幅を小さくするという観点からは、対象ブロックの横幅と高さとが等しい場合に、サブブロックを横長にしたほうがよい。ただし、一般に、縦長の境界(エッジ)のほうが、横長のエッジよりも検出される頻度が高い。そのため、対象ブロックの横幅と高さとが等しい場合に、サブブロックの横幅と高さとが等しい場合、及び、サブブロックが横長である場合に比べて、サブブロックが縦長である場合のほうが物体の形状に合致しやすい。 From the viewpoint of reducing the memory bandwidth, it is better to make the sub-block horizontally long when the width and height of the target block are equal. However, in general, a vertically long boundary (edge) is detected more frequently than a horizontally long edge. Therefore, when the width and height of the target block are the same, when the width and height of the sub-block are equal, and when the sub-block is vertically long, the shape of the object is better. It is easy to match.
 なお、AMVP予測パラメータ導出部3032も、アフィン予測部30372と同様にサブブロックのアスペクト比を決定してもよい。 Note that the AMVP prediction parameter derivation unit 3032 may also determine the aspect ratio of the sub-block in the same manner as the affine prediction unit 30372.
 (マッチング動き導出部30373)
 マッチング動き導出部30373は、バイラテラルマッチング又はテンプレートマッチングの何れかのマッチング処理を行うことにより、PUを構成するブロック又はサブブロックの動きベクトルspMvLXを導出する。図36は、(a)バイラテラルマッチング(Bilateral matching)、(b)テンプレートマッチング(Template matching)を説明するための図である。マッチング動き導出モードは、マージモードの一つのマージ候補(マッチング候補)として選択される。
(Matching motion deriving unit 30373)
The matching motion deriving unit 30373 derives a motion vector spMvLX of a block or sub-block constituting the PU by performing a matching process of bilateral matching or template matching. FIG. 36 is a diagram for explaining (a) bilateral matching and (b) template matching. The matching motion derivation mode is selected as one merge candidate (matching candidate) in the merge mode.
 マッチング動き導出部30373は、物体が等速運動をすると仮定して、複数の参照画像における領域のマッチングにより動きベクトルを導出する。バイラテラルマッチングでは、ある物体が、参照画像Aのある領域、対象ピクチャCur_Picの対象PU、及び、参照画像Bのある領域を等速運動で通過するものと仮定して、参照画像A及びB間のマッチングにより対象PUの動きベクトルを導出する。テンプレートマッチングでは、対象PUの隣接領域と対象PUの動きベクトルが等しいと仮定して、対象PUの隣接領域Temp_Cur(テンプレート)と参照ピクチャ上の参照ブロックの隣接領域Temp_L0の動き補償画像のマッチングにより動きベクトルを導出する。マッチング動き導出部では、対象PUを複数のサブブロックに分割し、分割したサブブロック単位で後述のバイラテラルマッチング若しくはテンプレートマッチングを行うことにより、サブブロックの動きベクトルspMvLX[xi][yj] (xi = xPb + nSbW * i, yj = yPb + nSbH * j, i=0, 1, 2,・・・,nPbW / nSbW - 1、j=0, 1, 2,・・・,nPbH / nSbH - 1)を導出する。 The matching motion deriving unit 30373 derives a motion vector by matching regions in a plurality of reference images, assuming that the object moves at a constant velocity. In bilateral matching, it is assumed that a certain object passes through a certain region of the reference image A, a target PU of the target picture Cur_Pic, and a certain region of the reference image B with constant velocity motion, and between the reference images A and B. The motion vector of the target PU is derived from the matching. In template matching, it is assumed that the motion vector of the target PU adjacent region and the target PU are equal, and motion is performed by matching motion compensated images between the target PU adjacent region Temp_Cur (template) and the reference block adjacent region Temp_L0 on the reference picture. Derive a vector. The matching motion derivation unit divides the target PU into a plurality of sub-blocks, and performs bilateral matching or template matching (to be described later) in units of the divided sub-blocks, whereby sub-block motion vectors spMvLX [xi] [yj] j (xi = XPb + nSbW * i, yj = yPb + nSbH * j, i = 0, 1, 2, ..., nPbW / nSbW-1, j = 0, 1, 2, ..., nPbH / nSbH-1 ) Is derived.
 図36の(a)に示すように、バイラテラルマッチングでは、対象ピクチャCur_PicにおけるサブブロックCur_blockの動きベクトルを導出するために、2枚の参照画像が参照される。より具体的には、まず、サブブロックCur_blockの座標を(xCur,yCur)と表現したとき、参照ピクチャインデックスrefIdxL0によって指定される参照画像Ref0(参照ピクチャAと呼ぶ)内の領域であって、
  (xPos0,yPos0)=(xCur + mv0_x, yCur + mv0_y)
によって特定される左上座標(xPos0, yPos0)を有するBlock_Aと、例えば参照ピクチャインデックスrefIdxL1によって指定される参照画像Ref1(参照ピクチャBと呼ぶ)内の領域であって、
  (xPos1,yPos1)=(xCur+mv1_x, xCur+mv1_y)=(xCur - mv0_x * TD1/TD0, yCur - mv0_y * TD1/TD0)
によって特定される左上座標(xPos1, yPos1)を有するBlock_Bとが設定される。ここで、TD0、及びTD1は、図36の(a)に示すように、それぞれ、対象ピクチャCur_Picと参照ピクチャAとのピクチャ間距離、及び対象ピクチャCur_Picと参照ピクチャBとのピクチャ間距離を表している。
As shown in FIG. 36 (a), in bilateral matching, two reference images are referred to in order to derive a motion vector of the sub-block Cur_block in the current picture Cur_Pic. More specifically, first, when the coordinates of the sub-block Cur_block are expressed as (xCur, yCur), an area in the reference image Ref0 (referred to as reference picture A) specified by the reference picture index refIdxL0,
(XPos0, yPos0) = (xCur + mv0_x, yCur + mv0_y)
Block_A having the upper left coordinates (xPos0, yPos0) specified by, and a reference image Ref1 (referred to as reference picture B) specified by a reference picture index refIdxL1, for example,
(XPos1, yPos1) = (xCur + mv1_x, xCur + mv1_y) = (xCur-mv0_x * TD1 / TD0, yCur-mv0_y * TD1 / TD0)
Block_B having the upper left coordinates (xPos1, yPos1) specified by is set. Here, TD0 and TD1 represent the inter-picture distance between the target picture Cur_Pic and the reference picture A and the inter-picture distance between the target picture Cur_Pic and the reference picture B, respectively, as shown in FIG. ing.
 次に、Block_AとBlock_Bとのマッチングコストが最小となるように、(mv0_x,mv0_y)が決定される。このようにして導出された(mv0_x,mv0_y)が、サブブロックに付与される動きベクトルとなる。 Next, (mv0_x, mv0_y) is determined so that the matching cost between Block_A and Block_B is minimized. The (mv0_x, mv0_y) derived in this way is a motion vector assigned to the sub-block.
 一方、図36の(b)は、上記マッチング処理のうち、テンプレートマッチング(Template matching)について説明するための図である。 On the other hand, (b) of FIG. 36 is a figure for demonstrating a template matching (Template | matching) among the said matching processes.
 図36の(b)に示すように、テンプレートマッチングでは、対象ピクチャCur_PicにおけるサブブロックCur_blockの動きベクトルを導出するために、一度に1枚の参照ピクチャが参照される。 36 (b), in template matching, one reference picture is referred to at a time in order to derive a motion vector of the sub-block Cur_block in the target picture Cur_Pic.
 より具体的には、まず、例えば参照ピクチャインデックスrefIdxL0によって指定される参照画像Ref0(参照ピクチャAと呼ぶ)内の領域であって、
  (xPos0,yPos0)=(xCur + mv0_x, yCur + mv0_y)
によって特定される左上座標(xPos, yPos)を有する参照ブロックBlock_Aが特定される。ここで、(xCur, yCur)は、サブブロックCur_blockの左上座標である。
More specifically, first, for example, an area in a reference image Ref0 (referred to as reference picture A) designated by a reference picture index refIdxL0,
(XPos0, yPos0) = (xCur + mv0_x, yCur + mv0_y)
The reference block Block_A having the upper left coordinates (xPos, yPos) specified by is specified. Here, (xCur, yCur) is the upper left coordinate of the sub-block Cur_block.
 次に、対象ピクチャCur_PicにおいてサブブロックCur_blockに隣接したテンプレート領域Temp_Curと、参照ピクチャAにおいてBlock_Aに隣接したテンプレート領域Temp_L0とが設定される。図36の(b)に示す例において、テンプレート領域Temp_Curは、サブブロックCur_blockの上側に隣接する領域及びサブブロックCur_blockの左側に隣接する領域とから構成されている。また、テンプレート領域Temp_L0は、Block_Aの上側に隣接する領域及びBlock_Aの左側に隣接する領域とから構成されている。 Next, a template region Temp_Cur adjacent to the sub-block Cur_block in the target picture Cur_Pic and a template region Temp_L0 adjacent to the Block_A in the reference picture A are set. In the example shown in (b) of FIG. 36, the template region Temp_Cur is composed of a region adjacent to the upper side of the sub-block Cur_block and a region adjacent to the left side of the sub-block Cur_block. The template area Temp_L0 is composed of an area adjacent to the upper side of Block_A and an area adjacent to the left side of Block_A.
 次にTemp_CurとTempL0とのマッチングコストが最小になる(mv0_x, mv0_y)が決定され、サブブロックに付与される動きベクトルspMvL0となる。 Next, it is determined that the matching cost between Temp_Cur and TempL0 is minimum (mv0_x, mv0_y), and the motion vector spMvL0 assigned to the sub-block is obtained.
 なお、テンプレートマッチングでは、参照画像Ref0とは異なる参照画像Ref1に対して同様の処理を行ってもよい。この場合、参照ピクチャインデックスrefIdxL1によって指定される参照画像Ref1(参照ピクチャAと呼ぶ)内の領域であって、
  (xPos1, yPos1)=(xCur + mv1_x, yCur + mv1_y)
によって特定される左上座標(xPos1, yPos1)を有する参照ブロックBlock_Aが特定され、参照ピクチャAにおいてBlock_Aに隣接したテンプレート領域Temp_L1とが設定される。最終的にTemp_CurとTempL1とのマッチングコストが最小になる(mv1_x, mv1_y)が決定され、サブブロックに付与される動きベクトルspMvL1となる。
In the template matching, the same processing may be performed on the reference image Ref1 different from the reference image Ref0. In this case, an area in the reference image Ref1 (referred to as reference picture A) designated by the reference picture index refIdxL1,
(XPos1, yPos1) = (xCur + mv1_x, yCur + mv1_y)
The reference block Block_A having the upper left coordinates (xPos1, yPos1) specified by is specified, and the template region Temp_L1 adjacent to Block_A in the reference picture A is set. Finally, it is determined that the matching cost between Temp_Cur and TempL1 is minimum (mv1_x, mv1_y), and the motion vector spMvL1 assigned to the sub-block is obtained.
 また、テンプレートマッチングでも、2枚の参照画像Ref0及びRef1に対して処理してもよい。この場合、上記に説明した1枚の参照画像Ref0のマッチングと、1枚の参照画像Ref1のマッチングを順に行う。 Also, template matching may be performed on two reference images Ref0 and Ref1. In this case, the matching of one reference image Ref0 and the matching of one reference image Ref1 described above are sequentially performed.
 <動きベクトル復号処理>
 以下では、図32を参照して、本実施形態に係る動きベクトル復号処理について具体的に説明する。
<Motion vector decoding process>
Below, with reference to FIG. 32, the motion vector decoding process which concerns on this embodiment is demonstrated concretely.
 上述の説明から明らかなように、本実施形態に係る動きベクトル復号処理は、インター予測に関連するシンタックス要素を復号する処理(動きシンタックス復号処理とも呼ぶ)と、動きベクトルを導出する処理(動きベクトル導出処理)とを含んでいる。 As is clear from the above description, the motion vector decoding process according to the present embodiment includes a process of decoding syntax elements related to inter prediction (also referred to as motion syntax decoding process) and a process of deriving a motion vector ( Motion vector derivation process).
 (動きシンタックス復号処理)
 図32は、インター予測パラメータ復号制御部3031によって行われるインター予測シンタックス復号処理の流れを示すフローチャートである。図32の説明における以下の説明において、特に明示のない場合、各処理はインター予測パラメータ復号制御部3031によって行われる。
(Motion syntax decoding process)
FIG. 32 is a flowchart showing the flow of inter prediction syntax decoding processing performed by the inter prediction parameter decoding control unit 3031. In the following description in the description of FIG. 32, each process is performed by the inter prediction parameter decoding control unit 3031 unless otherwise specified.
 まず、ステップS301において、マージフラグmerge_flagが復号され、ステップS302において、
 merge_flag != 0(merge_flagが0でないか)
が判断される。
First, in step S301, the merge flag merge_flag is decoded, and in step S302,
merge_flag! = 0 (whether merge_flag is not 0)
Is judged.
 merge_flag !=0 が真(ステップS302にてY)の場合、S303においてマージインデックスmerge_idxが復号され、マージモードにおける動きベクトル導出処理(ステップS311)を実行する。 If merge_flag! = 0 is true (Y in step S302), the merge index merge_idx is decoded in step S303, and the motion vector derivation process (step S311) in the merge mode is executed.
 merge_flag!=0 が偽(ステップS302にてN)の場合、ステップS304においてインター予測識別子inter_pred_idcを復号する。 If merge_flag! = 0 is false (N in step S302), the inter prediction identifier inter_pred_idc is decoded in step S304.
 inter_pred_idcがPRED_L1以外(PRED_L0若しくはPRED_BI)の場合、ステップS305、S306及びS307において、参照ピクチャインデックスrefIdxL0、差分ベクトルのパラメータmvdL0及び予測ベクトルインデックスmvp_L0_idxが各々復号される。 When inter_pred_idc is other than PRED_L1 (PRED_L0 or PRED_BI), the reference picture index refIdxL0, the difference vector parameter mvdL0, and the prediction vector index mvp_L0_idx are decoded in steps S305, S306, and S307, respectively.
 inter_pred_idcがPRED_L0以外(PRED_L1若しくはPRED_BI)の場合、S308、S309及びS310において、参照ピクチャインデックスrefIdxL1、差分ベクトルのパラメータmvdL1及び予測ベクトルインデックスmvp_L1_idxが復号される。続いて、AMVPモードにおける動きベクトル導出処理(ステップS312)を実行する。 When inter_pred_idc is other than PRED_L0 (PRED_L1 or PRED_BI), the reference picture index refIdxL1, the difference vector parameter mvdL1 and the prediction vector index mvp_L1_idx are decoded in S308, S309, and S310. Subsequently, a motion vector derivation process (step S312) in the AMVP mode is executed.
 (画像符号化装置の構成)
 次に、本実施形態に係る画像符号化装置11bの構成について説明する。画像符号化装置11bは、実施形態1における予測パラメータ符号化部111の代わりに、予測パラメータ符号化部111b(不図示)を備えている。また、予測パラメータ符号化部111bは、実施形態1におけるインター予測パラメータ符号化部112の代わりに、インター予測パラメータ符号化部(動きベクトル導出部)112bを備えている。この点以外は、画像符号化装置11bは、実施形態1に係る画像符号化装置11と同様の構成である。
(Configuration of image encoding device)
Next, the configuration of the image encoding device 11b according to the present embodiment will be described. The image encoding device 11b includes a prediction parameter encoding unit 111b (not shown) instead of the prediction parameter encoding unit 111 in the first embodiment. Further, the prediction parameter encoding unit 111b includes an inter prediction parameter encoding unit (motion vector deriving unit) 112b instead of the inter prediction parameter encoding unit 112 in the first embodiment. Except for this point, the image encoding device 11b has the same configuration as the image encoding device 11 according to the first embodiment.
 (インター予測パラメータ符号化部112b)
 図33は、実施形態3に係る画像符号化装置11bの予測パラメータ符号化部111bにおけるインター予測パラメータ符号化部112bの構成を示すブロック図である。図33に示されるように、インター予測パラメータ符号化部112bは、実施形態1におけるサブブロック予測パラメータ導出部1125の代わりに、サブブロック予測パラメータ導出部1125bを備えている。この点以外は、インター予測パラメータ符号化部112bは、実施形態1におけるインター予測パラメータ符号化部112と同様の構成である。図33に示されるように、インター予測パラメータ符号化部112bは、時空間サブブロック予測部11251、アフィン予測部11252及びマッチング動き導出部11253の少なくとも一つを備える。時空間サブブロック予測部11251、アフィン予測部11252及びマッチング動き導出部11253は、上述の時空間サブブロック予測部30371、アフィン予測部30372及びマッチング動き導出部30373のそれぞれと同様の構成であるためここでの説明を省略する。
(Inter prediction parameter encoding unit 112b)
FIG. 33 is a block diagram illustrating a configuration of the inter prediction parameter encoding unit 112b in the prediction parameter encoding unit 111b of the image encoding device 11b according to the third embodiment. As illustrated in FIG. 33, the inter prediction parameter encoding unit 112b includes a sub-block prediction parameter deriving unit 1125b instead of the sub-block prediction parameter deriving unit 1125 in the first embodiment. Except this point, the inter prediction parameter encoding unit 112b has the same configuration as the inter prediction parameter encoding unit 112 in the first embodiment. As illustrated in FIG. 33, the inter prediction parameter encoding unit 112b includes at least one of a spatiotemporal sub-block prediction unit 11251, an affine prediction unit 11252, and a matching motion derivation unit 11253. The spatio-temporal sub-block prediction unit 11251, the affine prediction unit 11252, and the matching motion derivation unit 11253 have the same configurations as the spatio-temporal sub-block prediction unit 30371, the affine prediction unit 30372, and the matching motion derivation unit 30373, respectively. The description in is omitted.
 〔実施形態4〕
 画像復号装置の予測パラメータ復号部におけるインター予測パラメータ復号部の機能は、実施形態3に係る画像伝送システム1bの画像復号装置31bの予測パラメータ復号部302bにおけるインター予測パラメータ復号部303bの機能に限定されない。当該インター予測パラメータ復号部の機能は、インター予測パラメータ復号部303bの代わりに、又は、加えて、実施形態4に係る画像伝送システム1c(不図示)の画像復号装置31cの予測パラメータ復号部302cにおけるインター予測パラメータ復号部(動きベクトル導出部)303cの機能を備えていてもよい。
[Embodiment 4]
The function of the inter prediction parameter decoding unit in the prediction parameter decoding unit of the image decoding device is not limited to the function of the inter prediction parameter decoding unit 303b in the prediction parameter decoding unit 302b of the image decoding device 31b of the image transmission system 1b according to Embodiment 3. . The function of the inter prediction parameter decoding unit is performed in the prediction parameter decoding unit 302c of the image decoding device 31c of the image transmission system 1c (not shown) according to Embodiment 4 instead of or in addition to the inter prediction parameter decoding unit 303b. The function of the inter prediction parameter decoding unit (motion vector deriving unit) 303c may be provided.
 実施形態4について、図40~49を参照して説明する。なお、説明の便宜上、実施形態3にて説明した部材と同じ機能を有する部材については、同じ符号を付記し、その説明を省略する。 Embodiment 4 will be described with reference to FIGS. For convenience of explanation, members having the same functions as those described in the third embodiment are denoted by the same reference numerals and description thereof is omitted.
 (画像伝送システムの構成)
 画像伝送システム1cは、実施形態3における画像符号化装置11b及び画像復号装置31bの代わりに、画像符号化装置(動きベクトル導出装置)11c及び画像復号装置(動きベクトル導出装置)31cを備えている。
(Configuration of image transmission system)
The image transmission system 1c includes an image encoding device (motion vector deriving device) 11c and an image decoding device (motion vector deriving device) 31c instead of the image encoding device 11b and the image decoding device 31b in the third embodiment. .
 (画像復号装置の構成)
 図41は、本実施形態に係る画像復号装置31cの要部構成を示すブロック図である。図41に示されるように、本実施形態に係る画像復号装置31cは、実施形態3における予測パラメータ復号部302bの代わりに、予測パラメータ復号部302cを備えている。
(Configuration of image decoding device)
FIG. 41 is a block diagram showing a main configuration of the image decoding device 31c according to the present embodiment. As illustrated in FIG. 41, the image decoding device 31c according to the present embodiment includes a prediction parameter decoding unit 302c instead of the prediction parameter decoding unit 302b according to the third embodiment.
 また、図41に示されるように、予測パラメータ復号部302cは、実施形態3におけるインター予測パラメータ復号部303bの代わりに、インター予測パラメータ復号部303cを備えている。この点以外は、予測パラメータ復号部302cは、実施形態3における予測パラメータ復号部302bと同様の構成である。 Also, as shown in FIG. 41, the prediction parameter decoding unit 302c includes an inter prediction parameter decoding unit 303c instead of the inter prediction parameter decoding unit 303b in the third embodiment. Except for this point, the prediction parameter decoding unit 302c has the same configuration as the prediction parameter decoding unit 302b in the third embodiment.
 (インター予測パラメータ復号部303c)
 図43は、実施形態2における予測パラメータ復号部302cに含まれるインター予測パラメータ復号部303cの構成を示すブロック図である。
(Inter prediction parameter decoding unit 303c)
FIG. 43 is a block diagram illustrating a configuration of an inter prediction parameter decoding unit 303c included in the prediction parameter decoding unit 302c according to the second embodiment.
 図43に示されるように、インター予測パラメータ復号部303cは、実施形態3におけるサブブロック予測パラメータ導出部3037bの代わりに、サブブロック予測パラメータ導出部3037cを備えている。 43, the inter prediction parameter decoding unit 303c includes a subblock prediction parameter derivation unit 3037c instead of the subblock prediction parameter derivation unit 3037b in the third embodiment.
 サブブロック予測パラメータ導出部3037cは、実施形態3におけるマッチング動き導出部30373の代わりに、マッチング動き導出部(第1の動きベクトル探索部、第2の動きベクトル探索部)30373cを備えている。 The sub-block prediction parameter derivation unit 3037c includes a matching motion derivation unit (first motion vector search unit, second motion vector search unit) 30373c instead of the matching motion derivation unit 30373 in the third embodiment.
 (マッチング動き導出部30373c)
 マッチング動き導出部30373cは、第1の動きベクトル探索部303731と、第2の動きベクトル探索部303732と、を備えている。
(Matching motion deriving unit 30373c)
The matching motion derivation unit 30373c includes a first motion vector search unit 303731 and a second motion vector search unit 303732.
 第1の動きベクトル探索部303731は、マッチング処理により予測ブロック毎に動きベクトルを探索するものである。また、第1の動きベクトル探索部303731は、予測ブロックに関する初期ベクトル探索を行ったうえで、局所的探索を行うことにより動きベクトルを探索する。 The first motion vector search unit 303731 searches for a motion vector for each prediction block by matching processing. The first motion vector search unit 303731 searches for a motion vector by performing a local search after performing an initial vector search for a prediction block.
 第2の動きベクトル探索部303732は、第1の動きベクトル探索部303731により選択された動きベクトルを参照して、予測ブロック内に含まれる複数のサブブロックの各々について、マッチング処理により動きベクトルを探索するものである。また、第2の動きベクトル探索部303732は、サブブロックに関する初期ベクトル探索を行ったうえで、局所的探索を行うことにより動きベクトルを探索する。 The second motion vector search unit 303732 refers to the motion vector selected by the first motion vector search unit 303731, and searches for a motion vector by a matching process for each of a plurality of sub-blocks included in the prediction block. To do. The second motion vector search unit 303732 searches for a motion vector by performing a local search after performing an initial vector search for a sub-block.
 マッチング動き導出部30373cは、第1の動きベクトル探索部303731による局所的探索及び第2の動きベクトル探索部303732による局所的探索の少なくとも何れかにおいて、斜め方向の探索を禁止する。すなわち、マッチング動き導出部30373cは、第1の動きベクトル探索部303731及び第2の動きベクトル探索部303732の少なくとも何れかにおける、初期ベクトルを中心として候補ベクトルの探索方向を水平方向及び垂直方向の何れかに限定する。 The matching motion deriving unit 30373c prohibits a search in an oblique direction in at least one of the local search by the first motion vector search unit 303731 and the local search by the second motion vector search unit 303732. That is, the matching motion deriving unit 30373c sets the search direction of the candidate vector in the horizontal direction or the vertical direction centering on the initial vector in at least one of the first motion vector search unit 303731 and the second motion vector search unit 303732. Limit to crab.
 動きベクトルの探索方向を水平方向又は垂直方向に限定した場合に、画像復号装置31aは、既に読み込み済みの画像を再利用して画像を読み込めばよい。そのため、上述の構成によれば、斜め方向の動きベクトルの探索を禁止しない場合に比べて、メモリバンドを減らしつつ、予測画像を生成することができる。 When the search direction of the motion vector is limited to the horizontal direction or the vertical direction, the image decoding device 31a may read an image by reusing an already read image. Therefore, according to the above-described configuration, it is possible to generate a predicted image while reducing the memory band, compared to a case where search for a motion vector in an oblique direction is not prohibited.
 マッチング動き導出部30373cのによる動きベクトルの探索の詳細については後述する。 Details of the motion vector search by the matching motion deriving unit 30373c will be described later.
 (動き予測モードの決定)
 図44は、動き予測モード決定フローの概要を示すフローチャート図である。動き予測モード決定フローは、インター予測パラメータ復号部303cにより実行される。動き予測モードとは、動き補償予測に用いる動きベクトルの導出方法を決定するモードである。
(Determination of motion prediction mode)
FIG. 44 is a flowchart showing an outline of the motion prediction mode determination flow. The motion prediction mode determination flow is executed by the inter prediction parameter decoding unit 303c. The motion prediction mode is a mode for determining a method for deriving a motion vector used for motion compensation prediction.
 図44に示すように、動き予測モード決定フローでは、まず、インター予測パラメータ復号制御部3031によって、マージモードか否かが判断され(ステップS1501)、マージモードでなければ(ステップS1501にてN)、AMVPモードとなる。一方、マージモードであると判断された場合(ステップS1501にてY)、マッチングモードであるか否かが判断される(ステップS1502)。そして、マッチングモードであると判断された場合(ステップS1502にてY)、マッチングモードとなり、マッチングモードではないと判断された場合(ステップS1502にてN)、マージモードとなる。 As shown in FIG. 44, in the motion prediction mode determination flow, first, the inter prediction parameter decoding control unit 3031 determines whether or not the mode is the merge mode (step S1501), and if not the merge mode (N in step S1501). AMVP mode. On the other hand, if it is determined that the mode is the merge mode (Y in step S1501), it is determined whether the mode is the matching mode (step S1502). If it is determined that the mode is the matching mode (Y in step S1502), the mode is the matching mode. If it is determined that the mode is not the matching mode (N in step S1502), the mode is the merge mode.
 次に、図45を参照して、動き予測モード決定フローの詳細を説明する。図45は、動き予測モード決定フローの流れを示すシーケンス図である。 Next, the details of the motion prediction mode determination flow will be described with reference to FIG. FIG. 45 is a sequence diagram showing the flow of the motion prediction mode determination flow.
 まず、インター予測パラメータ復号制御部3031によって、ステップS401において、マージフラグmerge_flagが復号され、ステップS402において、merge_flag==1が判断される。 First, the inter prediction parameter decoding control unit 3031 decodes the merge flag merge_flag in step S401, and determines merge_flag == 1 in step S402.
 merge_flag==1が真(ステップS402にてY)の場合、マッチングモードを示すパラメータfruc_mode_idxが、ステップS403にて復号され、ステップS404において、fruc_mode_idx!=0が判断される。 If merge_flag == 1 is true (Y in step S402), the parameter fruc_mode_idx indicating the matching mode is decoded in step S403, and fruc_mode_idx! = 0 is determined in step S404.
 fruc_mode_idx!=0が真(ステップS404にてY)の場合、動きベクトル導出方法としてマッチングモード(FRUC(Frame Rate Up Conversion)マージモードとも呼ばれる)が選択される。ステップS205では、マッチング動き導出部30373cによって、fruc_mode_idxがMODE_BM(例えば1)の場合、バイラテラルマッチングによりパターンマッチベクトルが導出される。また、ステップS205では、fruc_mode_idxがMODE_TM(例えば2)の場合、テンプレートマッチングによりパターンマッチベクトルが導出される。 When fruc_mode_idx! = 0 is true (Y in step S404), the matching mode (also called FRUC (Frame Rate Up Up Conversion) merge mode) is selected as the motion vector derivation method. In step S205, the matching motion deriving unit 30373c derives a pattern match vector by bilateral matching when fruc_mode_idx is MODE_BM (eg, 1). In step S205, if fruc_mode_idx is MODE_TM (for example, 2), a pattern match vector is derived by template matching.
 上記では、マッチングモードを示すパラメータfruc_mode_idxが、マッチングモードを用いるか否かを示すフラグと、マッチングモードにおけるマッチング方法を示すパラメータを兼ねているが、本発明はこれに限定されない。すなわち、マッチングモードを示すパラメータfruc_mode_idxの代わりに、マッチングモードを用いるか否かを示すフラグfruc_merge_flag、及び、マッチング方法を示すパラメータfruc_merge_paramを用いる構成としてもよい。この場合、fruc_mode_idx!=0の判定はfruc_merge_flag!=0と等価であり、fruc_mode_idx==1の判定は、fruc_merge_param==0と等価である。なお、fruc_merge_paramはfruc_merge_flagが1の場合に復号される。 In the above, the parameter fruc_mode_idx indicating the matching mode serves as both a flag indicating whether the matching mode is used and a parameter indicating the matching method in the matching mode, but the present invention is not limited to this. That is, instead of the parameter fruc_mode_idx indicating the matching mode, a flag fruc_merge_flag indicating whether to use the matching mode and a parameter fruc_merge_param indicating the matching method may be used. In this case, the determination of fruc_mode_idx! = 0 is equivalent to fruc_merge_flag! = 0, and the determination of fruc_mode_idx == 1 is equivalent to fruc_merge_param == 0. Note that fruc_merge_param is decoded when fruc_merge_flag is 1.
 また、ステップS404において、fruc_mode_idx!=0が偽の場合、マージ予測パラメータ導出部3036によって、ステップS411において、マージインデックスmerge_idxを復号する。続いて、ステップS412において、マージ候補mergeCandを導出し、ステップS413において、動きベクトルmvLXを次式により導出する。 In step S404, if fruc_mode_idx! = 0 is false, the merge prediction parameter deriving unit 3036 decodes the merge index merge_idx in step S411. Subsequently, in step S412, merge candidates mergeCand are derived, and in step S413, a motion vector mvLX is derived by the following equation.
  mvLX = mergeCand[merge_idx]
 一方、ステップS402において、merge_flag==1が偽(ステップS402にてN)の場合、AMVPモードが選択される。より具体的には、AMVP予測パラメータ導出部3032によって、ステップS421において、差分ベクトルmvdLXが復号され、ステップS422において、予測ベクトルインデックスmvp_LX_idxが復号される。更に、ステップS423において、予測ベクトル候補pmvCandを導出する。続いて、ステップS424において、動きベクトルmvLXを次式により導出する。
mvLX = mergeCand [merge_idx]
On the other hand, if merge_flag == 1 is false (N in step S402) in step S402, the AMVP mode is selected. More specifically, the AMVP prediction parameter derivation unit 3032 decodes the difference vector mvdLX in step S421, and the prediction vector index mvp_LX_idx is decoded in step S422. Further, in step S423, a prediction vector candidate pmvCand is derived. Subsequently, in step S424, a motion vector mvLX is derived from the following equation.
  mvLX = pmvCand[mvp_LX_idx] + mvdLX
 (マッチング処理による動きベクトル導出処理)
 以下では、マッチングモードにおける動きベクトル導出(パターンマッチベクトル導出)処理の流れについて図46を参照して説明する。図46は、パターンマッチベクトル導出処理の流れを示すフローチャート図である。
mvLX = pmvCand [mvp_LX_idx] + mvdLX
(Motion vector derivation process by matching process)
Hereinafter, a flow of motion vector derivation (pattern match vector derivation) processing in the matching mode will be described with reference to FIG. FIG. 46 is a flowchart showing the flow of the pattern match vector derivation process.
 図46は、図45に示したシーケンス図におけるステップS405における処理の詳細である。図46に示す処理は、マッチング動き導出部30373cにより実行される。 FIG. 46 shows the details of the process in step S405 in the sequence diagram shown in FIG. The processing shown in FIG. 46 is executed by the matching motion derivation unit 30373c.
 なお、図46に示す各ステップのうち、ステップS4051~S4054は、ブロックレベルで実行されるブロックサーチである。すなわち、パターンマッチを用いて、ブロック(CU、又はPU)全体で動きベクトルを導出する。 Of steps shown in FIG. 46, steps S4051 to S4054 are block searches executed at the block level. That is, a motion vector is derived for the entire block (CU or PU) using pattern matching.
 また、ステップS4055~S4060は、ブロックを構成するサブブロックレベルで実行されるサブブロックサーチであり、パターンマッチを用いて、ブロックを構成するサブブロック単位で動きベクトルを導出する。サブブロックサーチは、例えば8x8又は4x4単位毎に動きベクトルを導出する。 Steps S4055 to S4060 are sub-block searches executed at the sub-block level constituting the block, and a motion vector is derived for each sub-block constituting the block using pattern matching. In the sub-block search, for example, a motion vector is derived every 8 × 8 or 4 × 4 unit.
 まず、ステップS4051において、fruc_mode_idx==MODE_TMが判断される。fruc_mode_idx==MODE_TMが真(S4051にてY)の場合、ステップS4052において、テンプレートマッチングを行うためのテンプレートを取得する。より詳細には、テンプレートマッチング用のテンプレートをブロックの周辺領域から取得し、ステップS4053に進む。また、fruc_mode_idx==MODE_TMが偽(ステップS4051にてN)の場合もステップS4053に進む。 First, in step S4051, fruc_mode_idx == MODE_TM is determined. If fruc_mode_idx == MODE_TM is true (Y in S4051), a template for performing template matching is acquired in step S4052. More specifically, a template for template matching is acquired from the peripheral area of the block, and the process proceeds to step S4053. Moreover, also when fruc_mode_idx == MODE_TM is false (N in step S4051), the process proceeds to step S4053.
 ステップS4053において、マッチング動き導出部30373cにおける第1の動きベクトル探索部303731は、対象ブロックにおけるブロックレベルの初期ベクトルを導出(初期ベクトルサーチ)する。なお、初期ベクトルとは、探索のベースとなる動きベクトルであり、限られた動きベクトル候補(空間マージ候補、時間マージ候補、結合マージ候補、ゼロベクトル及び対象ブロックのATMVPベクトル等)から、マッチングコストが最小となるベクトルを導出し、初期ベクトルとする。上述のように、初期ベクトル候補は、処理済みの参照点の動きベクトルに基づいて導出される動きベクトルである。つまり、各種マージ候補のように、すでに処理された点の動きベクトル(処理済み動きベクトル)、処理済み動きベクトルをスケールしたもの、若しくは、ATMVPベクトルのように複数の処理済み動きベクトルから導出される代表値を用いる。なお、ATMVPベクトルとは、対象ブロックの周囲の動きベクトルと、参照画像の動きベクトルとの平均(若しくは加重平均、メジアン)により、導出されるベクトルである。 In step S4053, the first motion vector search unit 303731 in the matching motion derivation unit 30373c derives a block-level initial vector in the target block (initial vector search). The initial vector is a motion vector that serves as a search base. From a limited motion vector candidate (such as a spatial merge candidate, a temporal merge candidate, a combined merge candidate, a zero vector, and an ATMVP vector of the target block), a matching cost is determined. A vector that minimizes is derived as an initial vector. As described above, the initial vector candidate is a motion vector derived based on the motion vector of the processed reference point. That is, it is derived from motion vectors of already processed points (processed motion vectors) like various merge candidates, scales of processed motion vectors, or multiple processed motion vectors like ATMVP vectors. Use representative values. The ATMVP vector is a vector derived from the average (or weighted average, median) of the motion vector around the target block and the motion vector of the reference image.
 ステップS4054において、マッチング動き導出部30373cにおける第1の動きベクトル探索部303731は、対象ブロックにおけるブロックレベルのローカルサーチ(局所的探索)を行う。ローカルサーチでは、ステップS4053において、導出された初期ベクトルを中心とする局所領域を更にサーチし、マッチングコストが最小となるベクトルを探索し、最終的な対象ブロックのブロックレベルの動きベクトルとする。なお、ローカルサーチは、ステップサーチ、ラスタサーチ又はスパイラルサーチでもよい。ローカルサーチの詳細については後述する。 In step S4054, the first motion vector search unit 303731 in the matching motion derivation unit 30373c performs a block level local search (local search) in the target block. In the local search, in step S4053, a local region centered on the derived initial vector is further searched, a vector having the lowest matching cost is searched, and a final block-level motion vector of the target block is obtained. The local search may be a step search, raster search, or spiral search. Details of the local search will be described later.
 続いて、対象ブロックに含まれる各サブブロックについて、以下の処理を行う(ステップS4055~S4060)。 Subsequently, the following processing is performed for each sub-block included in the target block (steps S4055 to S4060).
 まず、ステップS4056において、fruc_mode_idx ==MODE_TMが判断される。fruc_merge_idx== MODE_TMが真(ステップS4056にてY)の場合、ステップS4057において、テンプレートマッチングを行うためのテンプレートを取得する。より詳細には、テンプレートマッチング用のテンプレートをサブブロックの周辺領域から取得する。具体的には、対象サブブロックの上隣接領域又は左隣接領域からテンプレートを取得する。そして、ステップS4058に進む。また、fruc_ mode_idx ==MODE_TMが偽(ステップS4056にてN)の場合もステップS4058に進む。 First, in step S4056, fruc_mode_idx == MODE_TM is determined. If fruc_merge_idx == MODE_TM is true (Y in step S4056), a template for performing template matching is acquired in step S4057. More specifically, a template for template matching is acquired from the peripheral area of the sub-block. Specifically, a template is acquired from the upper adjacent region or the left adjacent region of the target sub block. Then, the process proceeds to step S4058. Also in the case where fruc_ mode_idx == MODE_TM is false (N in step S4056), the process proceeds to step S4058.
 ステップS4058において、マッチング動き導出部30373cにおける第2の動きベクトル探索部303732は、対象ブロックにおけるサブブロックの初期ベクトルを導出(初期ベクトルサーチ)する。詳細には、ベクトル候補(ステップS4054において導出された動きベクトル、ゼロベクトル、当該サブブロックの中心コロケートベクトル、当該サブブロックの右下コロケートベクトル、当該サブブロックのATMVPベクトル、当該サブブロックの上隣接ベクトル及び当該サブブロックの左隣接ベクトル等)のうち、マッチングコストが最小となるベクトルを当該サブブロックの初期ベクトルとする。なお、サブブロックの初期ベクトル探索に利用するベクトル候補は上述のベクトルに限定されない。 In step S4058, the second motion vector search unit 303732 in the matching motion derivation unit 30373c derives an initial vector of the sub-block in the target block (initial vector search). Specifically, vector candidates (motion vector derived in step S4054, zero vector, center collocated vector of the subblock, lower right collocated vector of the subblock, ATMVP vector of the subblock, upper adjacent vector of the subblock And the vector having the lowest matching cost among the left adjacent vectors of the sub-block and the like is set as the initial vector of the sub-block. Note that the vector candidates used for the initial vector search of the sub-block are not limited to the vectors described above.
 次に、ステップS4059では、ステップS4058において選択されたサブブロックの初期ベクトルを中心とするローカルサーチを行う。そして、サブブロックの初期ベクトル付近のベクトル候補のマッチングコストを導出し、最小となるベクトルをサブブロックの動きベクトルとして導出する。 Next, in step S4059, a local search centering on the initial vector of the sub-block selected in step S4058 is performed. Then, the matching cost of vector candidates near the initial vector of the sub-block is derived, and the minimum vector is derived as the sub-block motion vector.
 そして、対象ブロックに含まれる全てのサブブロックについて処理が完了すると、パターンマッチベクトル導出処理が終了する。 Then, when the process is completed for all the sub-blocks included in the target block, the pattern match vector derivation process ends.
 なお、初期ベクトルサーチ、ローカルサーチともに、fruc_mode_idxがMODE_BMの場合は、バイラテラルマッチングによってマッチングコストを導出する。また、fruc_mode_idxがMODE_TMの場合は、テンプレートマッチングによってマッチングコストを導出する。 In both initial vector search and local search, when fruc_mode_idx is MODE_BM, the matching cost is derived by bilateral matching. When fruc_mode_idx is MODE_TM, a matching cost is derived by template matching.
 マッチング動き導出部30373cは、ステップS4054のローカルサーチ、及び、ステップS4059のローカルサーチの少なくとも何れかにおいて、斜め方向の探索を禁止する。詳細については後述する。 The matching motion derivation unit 30373c prohibits a search in an oblique direction in at least one of the local search in step S4054 and the local search in step S4059. Details will be described later.
 (ローカルサーチの具体例)
 次に、図47を参照して、ローカルサーチの具体例について説明する。図47は、動き探索パターンを説明するための図である。なお、動き探索に用いる方法(stepMethod)を何回繰り返すかを示すステップ数(stepIter、最大ラウンド数)は所定の値に設定する。後述するように、サブブロックレベルの最大ラウンド数stepIterSubPUは、ブロックレベルの最大ラウンド数stepIterPU未満とするとよい。
(Specific example of local search)
Next, a specific example of local search will be described with reference to FIG. FIG. 47 is a diagram for explaining a motion search pattern. Note that the number of steps (stepIter, maximum number of rounds) indicating how many times the method used for motion search (stepMethod) is repeated is set to a predetermined value. As will be described later, the maximum round number stepIterSubPU at the sub-block level may be less than the maximum round number stepIterPU at the block level.
 マッチング動き導出部30373cは、動き探索においてマッチングコストを評価した探索候補点のうち、最も小さいマッチングコストを与える探索候補点を最適な探索点と見做し、当該探索候補点の動きベクトルbestMVを選択する。なお、マッチングコストの導出のために用いる関数の例としては、SAD(Sum of Absolute Difference、絶対値誤差和)及びSATD(アダマール変換絶対値誤差和)及びSSD(Sum of Square difference)等が挙げられる。 The matching motion deriving unit 30373c considers the search candidate point that gives the smallest matching cost among the search candidate points evaluated for the matching cost in the motion search as the optimal search point, and selects the motion vector bestMV of the search candidate point. To do. Examples of functions used for deriving the matching cost include SAD (Sum of Absolute Difference, sum of absolute value errors), SATD (Hadamard transform absolute value error sum), SSD (Sum of Square difference), and the like. .
 マッチング動き導出部30373cが行う動きベクトルのローカルサーチは、これに限定されるものではない。例えば、ローカルサーチとしては、他に、ダイヤモンドサーチ(stepMethod = DIAMOND)及びクロスサーチ(stepMethod = CROSS)及びラスタサーチ(ラスタ型の探索:stepMethod = RASTER)等の動き探索アルゴリズムが挙げられる。 The local search for motion vectors performed by the matching motion deriving unit 30373c is not limited to this. For example, the local search includes motion search algorithms such as diamond search (stepMethod = DIAMOND), cross search (stepMethod = CROSS), and raster search (raster type search: stepMethod = RASTER).
 <ステップサーチの具体例>
 まず、ステップサーチの一例として、ダイヤモンドサーチとクロスサーチを説明する。図47の(a)は、ダイヤモンドサーチを適用したときの動き探索パターンを示す図である。図47の(b)は、クロスサーチを適用したときの動き探索パターンを示す図である。
<Specific example of step search>
First, diamond search and cross search will be described as an example of step search. FIG. 47A is a diagram showing a motion search pattern when diamond search is applied. FIG. 47B shows a motion search pattern when a cross search is applied.
 ステップサーチでは、初期ベクトル(探索開始点)を中心に探索候補点を設定し、設定された探索候補点についてのマッチングコストを導出及び評価し、最適なマッチングコストとなる探索候補点を選択する処理を行う。この一通りの処理をここでは「ステップラウンド処理」と呼ぶ。ステップサーチではこの「ステップラウンド処理」を繰り返し実行する。各回のステップラウンド処理では、探索ラウンド数numIterを1だけインクリメントする。 In step search, a search candidate point is set around an initial vector (search start point), a matching cost for the set search candidate point is derived and evaluated, and a search candidate point that provides an optimal matching cost is selected. I do. This process is called “step round process”. In the step search, this “step round process” is repeatedly executed. In each step round process, the search round number numIter is incremented by one.
 図47では、白抜き菱形によって各探索回数での初期ベクトルstartMVを示している。また、黒菱形によって各探索ラウンドでの最適ベクトルbestMVを示している。また、黒丸によって各探索回数での探索候補点を示している。また、白抜き丸によって各探索回数での探索済みの点を示している。 In FIG. 47, the initial vector startMV at each number of searches is indicated by a white diamond. Also, the optimal vector bestMV in each search round is indicated by a black diamond. In addition, search candidate points at each number of searches are indicated by black circles. In addition, points that have already been searched at each number of searches are indicated by white circles.
 マッチング動き導出部30373cは探索を開始する前に探索ラウンドnumIterを0に初期化する。そして、各探索ラウンドの開始時点において、最小コストminCostに探索開始点のマッチングコストを設定し、最適候補インデックスbestIdxに初期値(-1)を設定する。 The matching motion deriving unit 30373c initializes the search round numIter to 0 before starting the search. Then, at the start time of each search round, the matching cost of the search start point is set to the minimum cost minCost, and the initial value (−1) is set to the optimal candidate index bestIdx.
 minCost = mcost (startMV)
 bestIdx = -1
 ここでmcost(X)は、探索ベクトルXでのマッチングコストを導出する関数である。
minCost = mcost (startMV)
bestIdx = -1
Here, mcost (X) is a function for deriving a matching cost in the search vector X.
 マッチング動き導出部30373cは各探索ラウンドにおいて当該探索開始点を中心とする探索候補点を選択し評価する。具体的には、マッチング動き導出部30373cは、各探索候補インデックスIdxについて、探索開始点の座標(位置)startMVにオフセット候補(offsetCand)の値(offsetCand[Idx])を足し合わすことで、探索候補点の座標を選択する。 The matching motion derivation unit 30373c selects and evaluates search candidate points centered on the search start point in each search round. Specifically, for each search candidate index Idx, the matching motion derivation unit 30373c adds the value (offsetCand [Idx]) of the offset candidate (offsetCand) to the coordinate (position) startMV of the search start point. Select point coordinates.
 以下に、図47の(a)に示す7x5画素の探索範囲において、マッチング動き導出部30373cにおける第1の動きベクトル探索部303731がダイヤモンドサーチする一例を示す。 Hereinafter, an example in which the first motion vector search unit 303731 in the matching motion deriving unit 30373c performs a diamond search in the search range of 7 × 5 pixels illustrated in FIG.
 第1の動きベクトル探索部303731は、1回目の探索(numIter = 0)では、探索開始点のP0を中心にダイヤモンド状に配置される8つの点を順に探索候補点(ここでは図47の(a)の一段目の点0~7)として選択する。続いて、第1の動きベクトル探索部303731は、各探索候補点のマッチングコストを評価する。具体的にはIdx = nDirectStart..nDirectEnd(ここではnDirectStart = 0, nDirectEnd = 7)について、順に動きベクトル候補candMVを以下の式により導出し、各candMVにおけるマッチングコストを評価する。 In the first search (numIter は = 0), the first motion vector search unit 303731 sequentially searches for eight points arranged in a diamond shape around the search start point P0 (in this case, (( a) Select as first stage points 0 to 7). Subsequently, the first motion vector search unit 303731 evaluates the matching cost of each search candidate point. Specifically, for Idxand = nDirectStart..nDirectEnd (here nDirectStart = 0, nDirectEnd = 7), motion vector candidates candMV are sequentially derived by the following formula, and the matching cost in each candMV is evaluated.
 candMV = startMV + offsetCand[Idx]
 ここで、offsetCand[x]は、探索候補点を設定するために探索開始点の座標に足し合わせるオフセット候補である。
candMV = startMV + offsetCand [Idx]
Here, offsetCand [x] is an offset candidate that is added to the coordinates of the search start point in order to set the search candidate point.
 ダイヤモンドサーチにおいて、斜め方向の探索を禁止しない場合、第1の動きベクトル探索部303731は、オフセット候補として、
offsetCand[8] = {(0, 2), (1, 1), (2, 0), (1, -1), (0, -2), (-1, -1), (-2, 0), (-1, 1)}を用いる。
In the diamond search, when the search in the oblique direction is not prohibited, the first motion vector search unit 303731
offsetCand [8] = ((0, 2), (1, 1), (2, 0), (1, -1), (0, -2), (-1, -1), (-2, 0), (-1, 1)} is used.
 一方、斜め方向の探索を禁止する場合、第1の動きベクトル探索部303731は、オフセット候補として、
offsetCand[4] = {(0, 2), (2, 0), (0, -2), (-2, 0)}を用いてもよい。この場合、第1の動きベクトル探索部303731は、図47の(a)の点0~7のうち、1、3、5及び7を探索候補点から除外し、探索候補点を、0、2、4及び6に限定する。
On the other hand, when the search in the oblique direction is prohibited, the first motion vector search unit 303731
offsetCand [4] = {(0, 2), (2, 0), (0, -2), (-2, 0)} may be used. In this case, the first motion vector search unit 303731 excludes points 1, 3, 5, and 7 from the search candidate points among the points 0 to 7 in FIG. 47A, and sets the search candidate points to 0, 2 4 and 6.
 第1の動きベクトル探索部303731は、ある探索候補インデックスIdxの探索候補点candMV[Idx]のマッチングコストcandCost (candCost = mcost (candMV[Idx]) )が、その時点の最小コストminCost未満(candCost < minCost)であった場合、最適探索候補インデックスbestIdxをIdxに更新して、以下のように、最適コストminCost、最適ベクトルbestMVを更新する。 The first motion vector search unit 303731 has a matching cost candCost (candCost = mcost (candMV [Idx])) of a search candidate point candMV [Idx] of a search candidate index Idx that is less than the minimum cost minCost (candCost < minCost), the optimal search candidate index bestIdx is updated to Idx, and the optimal cost minCost and the optimal vector bestMV are updated as follows.
 bestIdx = Idx
 minCost = candCost
 bestMV = candMV[Idx]
 全ての探索候補点の処理が終了した時点で、最適ベクトルbestMVの更新があったか否かを判定し、更新がある場合に次のステップラウンド処理を行い、更新がない場合にはこの時点の最適ベクトルbestMVを、ステップサーチで導出される動きベクトルとして選択する。
bestIdx = Idx
minCost = candCost
bestMV = candMV [Idx]
When the processing of all search candidate points is completed, it is determined whether or not the optimal vector bestMV has been updated. If there is an update, the next step round process is performed. If there is no update, the optimal vector at this point is determined. BestMV is selected as a motion vector derived by step search.
 次のステップラウンド処理を行う場合には、最適ベクトルbestMVが示す探索候補点を、次のラウンドの探索開始点として用いられる。 When performing the next step round process, the search candidate point indicated by the optimal vector bestMV is used as the search start point of the next round.
 例えば、図47の(a)では第1の動きベクトル探索部303731は、最初のラウンド(numIter=0)に示す点2が選択され、これを次のラウンドの探索開始点(初期ベクトルstartMV)に設定する。 For example, in FIG. 47A, the first motion vector search unit 303731 selects the point 2 shown in the first round (numIter = 0), and uses this as the search start point (initial vector startMV) of the next round. Set.
 startMV = bestMV (ここではP(1))
 なお、最適ベクトルbestMVの更新があったか否かの判定は、最適ベクトルbestMVが探索開始点とは異なるか否かのほか、bestIdxが初期値(-1)以外の値に更新されたか否か、若しくは、minCostが開始点の初期コスト以外の値に更新された否か等により判定することもできる。なお、次のラウンドにおいて利用される探索開始インデックスnDirectStart、探索終了インデックスnDirectEndを、最適ベクトルbestMVの位置(最適候補インデックスbestIdx)に依存して、以下の式により決定してもよい。これにより、すでに探索した探索点を再度探索することがなく、効率的な探索が可能となる。
startMV = bestMV (here P (1))
Whether or not the optimal vector bestMV has been updated is determined based on whether or not the optimal vector bestMV is different from the search start point, and whether or not bestIdx is updated to a value other than the initial value (−1), or , MinCost can also be determined based on whether or not the value is updated to a value other than the initial cost of the starting point. Note that the search start index nDirectStart and the search end index nDirectEnd used in the next round may be determined by the following formulas depending on the position of the optimal vector bestMV (optimum candidate index bestIdx). This makes it possible to search efficiently without searching again for search points that have already been searched.
 nStep = 2 - (bestIdx & 1)
 nDirectStart = bestIdx - nStep
 nDirectEnd = bestIdx + nStep
 次に、図47の(a)の二段目に示すように、2回目の探索(numIter = 1)において、第1の動きベクトル探索部303731は、1回目の探索(numIter = 0)の最適探索候補であった点2を今回の探索における初期ベクトルstartMV(探索開始点P1)とし、探索開始点P1を中心としてダイヤモンド状に配置される複数の点であって、未だ探索候補点として選択されていない点のうちの何れかを探索候補点とする。
nStep = 2-(bestIdx & 1)
nDirectStart = bestIdx-nStep
nDirectEnd = bestIdx + nStep
Next, as shown in the second row of FIG. 47A, in the second search (numIter = 1), the first motion vector search unit 303731 optimizes the first search (numIter = 0). The search candidate point 2 is set as the initial vector startMV (search start point P1) in the current search, and is a plurality of points arranged in a diamond shape with the search start point P1 as the center, and is still selected as the search candidate point. Any of the points that are not used is set as a search candidate point.
 以下に、一例として、第1の動きベクトル探索部303731が、斜め方向の探索を禁止しない場合について説明する。この場合、第1の動きベクトル探索部303731は、図47の(a)の二段目に示すように点0~4を探索候補点とする。第1の動きベクトル探索部303731は、これらの点を順に選択しマッチングコストを評価する。つまり、Idx = nDirectStart..nDirectEnd(ここではnDirectStart = 0, nDirectEnd = 4)の示す探索候補点を評価する。 Hereinafter, as an example, a case where the first motion vector search unit 303731 does not prohibit a search in an oblique direction will be described. In this case, the first motion vector search unit 303731 uses points 0 to 4 as search candidate points as shown in the second row of FIG. The first motion vector search unit 303731 sequentially selects these points and evaluates the matching cost. That is, the search candidate point indicated by Idx = nDirectStart..nDirectEnd (here nDirectStart = 0, nDirectEnd = 4) is evaluated.
 続けて、図47の(a)の三段目に示すように、3回目の探索(numIter = 2)において、第1の動きベクトル探索部303731は、2回目の探索(numIter = 1)の最適探索候補であった点1を今回の探索における初期ベクトルstartMV(探索開始点P2)とする。また、第1の動きベクトル探索部303731は、探索開始点P2を中心としてダイヤモンド状に配置される複数の点であって、未だ探索候補点として選択されていないが探索範囲内に存在する点のうちの何れかを探索候補点とする。 Subsequently, as shown in the third row of FIG. 47 (a), in the third search (numIter = 2), the first motion vector search unit 303731 selects the optimum for the second search (numIter = 1). Point 1 that was a search candidate is set as an initial vector startMV (search start point P2) in the current search. The first motion vector search unit 303731 is a plurality of points arranged in a diamond shape with the search start point P2 as the center, and is not yet selected as a search candidate point but is present within the search range. One of them is set as a search candidate point.
 以下に、一例として、第1の動きベクトル探索部303731が、斜め方向の探索を禁止しない場合について説明する。この場合、第1の動きベクトル探索部303731は、図47の(a)の三段目の点0~2を探索候補点として選択する(つまりnDirectStart =0, nDirectEnd = 2の示す探索候補点を評価する)。 Hereinafter, as an example, a case where the first motion vector search unit 303731 does not prohibit a search in an oblique direction will be described. In this case, the first motion vector search unit 303731 selects points 0 to 2 in the third row in FIG. 47A as search candidate points (that is, search candidate points indicated by nDirectStart = 0 and nDirectEnd = 2). evaluate).
 図47の(a)の三段目に示すように、3回目の探索(numIter = 2)において評価した探索候補点のマッチングコストが、探索開始点P2のコスト以上である場合、最適ベクトルbestMVを更新されない。最適ベクトルbestMVの更新がない場合、ここで、一通りのステップサーチ処理(ダイヤモンドサーチ)は終了となる。 As shown in the third row of FIG. 47A, when the matching cost of the search candidate point evaluated in the third search (numIterI = 2) is equal to or higher than the cost of the search start point P2, the optimal vector bestMV is Not updated. If the optimum vector bestMV has not been updated, one step search process (diamond search) ends here.
 なお、1回目の探索と同様、2回目の探索及び3回目の探索において探索候補点を選択する際にも、第1の動きベクトル探索部303731が、斜め方向の探索を禁止してもよい。 Note that, similarly to the first search, the first motion vector search unit 303731 may also prohibit a search in an oblique direction when selecting a search candidate point in the second search and the third search.
 また、第1の動きベクトル探索部303731は、2回目の探索及び3回目の探索のうち、一方又は両方とも斜め方向の探索を禁止してもよい。この場合、第1の動きベクトル探索部303731は、各回の探索毎に、斜め方向の探索を禁止するかしないか否かを決定してもよい。 Also, the first motion vector search unit 303731 may prohibit a search in an oblique direction for one or both of the second search and the third search. In this case, the first motion vector search unit 303731 may determine whether or not to prohibit the search in the oblique direction for each search.
 第1の動きベクトル探索部303731は、斜め方向の探索の禁止する場合、上述の1回目の探索において斜め方向の探索を禁止した方法と同様の方法によって、オフセット候補を限定し、探索候補点を限定する。 When the first motion vector search unit 303731 prohibits the search in the oblique direction, the first motion vector search unit 303731 limits the offset candidates by the same method as the method in which the search in the oblique direction is prohibited in the first search described above, and sets the search candidate points. limit.
 第1の動きベクトル探索部303731は、別のステップサーチを行ってもよい。クロスサーチでは、オフセット候補(offsetCand)として以下の値を用いる。 The first motion vector search unit 303731 may perform another step search. In the cross search, the following values are used as offset candidates (offsetCand).
 offsetCand[4] = {(0, 1), (1, 0), (0, -1), (-1, 0)
 図47の(b)は、ダイヤモンドサーチの後に、クロスサーチに移行する例を示している。ここでは、第1の動きベクトル探索部303731は、探索開始点(図47の(a)の三段目の探索開始点P2)を中心として、上下左右(十字)の位置の点を探索候補点として順に選択する。例えば、探索開始点P2の上下左右の点0~3を探索候補点のうち、最も小さいマッチングコストを与える探索候補点(探索開始点P2も含む)がP2の右隣の点であるとする。この場合、第1の動きベクトル探索部303731は、予測ブロックPUに関する最適ベクトルbestMVの終点として、P2の右隣の点を選択する。
offsetCand [4] = ((0, 1), (1, 0), (0, -1), (-1, 0)
FIG. 47B shows an example in which the cross search is performed after the diamond search. Here, the first motion vector search unit 303731 uses the search start point (the search start point P2 in the third row in FIG. 47A) as the center, and points at the top, bottom, left, and right (cross) positions as search candidate points. Select in turn. For example, it is assumed that the search candidate points (including the search start point P2) that give the smallest matching cost among the search candidate points 0 to 3 on the upper, lower, left, and right sides of the search start point P2 are the points to the right of P2. In this case, the first motion vector search unit 303731 selects a point on the right side of P2 as the end point of the optimal vector bestMV for the prediction block PU.
 なお、第2の動きベクトル探索部303732も、第1の動きベクトル探索部303731と同様に、斜め方向の探索を禁止してもよい。 Note that the second motion vector search unit 303732 may also prohibit the search in the oblique direction, like the first motion vector search unit 303731.
 <ステップサーチの変更例1>
 上述の例では、第1の動きベクトル探索部303731及び第2の動きベクトル探索部303732による局所的探索(ブロックサーチ)において斜め方向の探索を禁止する場合について説明している。ただし、本実施形態ではこれに限定されない。本実施形態では、第1の動きベクトル探索部303731によるブロックサーチにおいて斜め方向の探索を禁止せず、第2の動きベクトル探索部303732による局所的探索(サブブロックサーチ)では、斜め方向の探索を禁止してもよい。
<Step search change example 1>
In the above-described example, the case where the search in the oblique direction is prohibited in the local search (block search) by the first motion vector search unit 303731 and the second motion vector search unit 303732 is described. However, the present embodiment is not limited to this. In the present embodiment, the search in the oblique direction is not prohibited in the block search by the first motion vector search unit 303731, and the search in the oblique direction is performed in the local search (sub-block search) by the second motion vector search unit 303732. It may be prohibited.
 例えば、図47の(a)のようにダイヤモンドサーチする場合、第1の動きベクトル探索部303731は、探索開始点を中心としてダイヤモンド状に配置し、未だ探索候補点として選択されていない点全てを探索候補点とする。 For example, when performing a diamond search as shown in FIG. 47A, the first motion vector search unit 303731 arranges in a diamond shape with the search start point as the center, and selects all points that have not yet been selected as search candidate points. It is set as a search candidate point.
 一方、第2の動きベクトル探索部303732は、探索開始点を中心としてダイヤモンド状に配置し、未だ探索候補点として選択されていない点のうち、探索開始点に対して斜め方向にある点を探索候補点から除外する。 On the other hand, the second motion vector search unit 303732 is arranged in a diamond shape with the search start point as the center, and searches for points that are oblique to the search start point among the points not yet selected as search candidate points. Exclude from candidate points.
 例えば、第2の動きベクトル探索部303732は、P0を中心に、動きベクトルを探索する場合、ダイヤモンド状に配置される点のうち、P0に対して斜め方向にある点を探索候補点から除外し、探索候補点を限定する。例えば、第2の動きベクトル探索部303732は、オフセット候補として、
offsetCand[4] = {(0, 2), (2, 0), (0, -2), (-2, 0) }を用いてもよい。
For example, when searching for a motion vector centering on P0, the second motion vector search unit 303732 excludes points that are diagonally located with respect to P0 from the search candidate points among the points arranged in a diamond shape. Limit search candidate points. For example, the second motion vector search unit 307732 has, as offset candidates,
offsetCand [4] = {(0, 2), (2, 0), (0, -2), (-2, 0)} may be used.
 サブブロックサーチでは、ブロックサーチに比べて詳細に探索するため、処理量が多くなりやすい。一方、上記構成を備えることにより、第2の動きベクトル探索部303732は、サブブロックサーチの処理量を減らすことができる。 The sub-block search is more detailed than the block search, so the amount of processing tends to increase. On the other hand, by providing the above configuration, the second motion vector search unit 303732 can reduce the processing amount of the sub-block search.
 <ステップサーチの変更例2>
 また、第1の動きベクトル探索部303731は、これらの局所的探索のうち、所定の回数以降のステップラウンド処理では斜め方向の探索を禁止してもよい。
<Example of step search change 2>
Also, the first motion vector search unit 303731 may prohibit a search in an oblique direction in the step round process after a predetermined number of times among these local searches.
 例えば、第1の動きベクトル探索部303731は、M回目(Mは自然数)までのステップラウンド処理では斜め方向の探索を禁止せず、M+1回目以降のステップラウンド処理では斜め方向の探索を禁止してもよい。 For example, the first motion vector search unit 303731 does not prohibit the search in the diagonal direction in the step round processing up to the Mth time (M is a natural number), and prohibits the search in the diagonal direction in the step round processing after the (M + 1) th time. Also good.
 このように、M回目までは斜め方向の探索を許して最適な探索点に近づいた後のステップラウンド処理において斜め方向の探索を禁止することで、マッチングコストの小さい好適な探索点を探索しつつ、処理量を減らすことができる。 In this way, until the Mth time, the search in the oblique direction is allowed and the search in the oblique direction is prohibited in the step round process after approaching the optimum search point while searching for a suitable search point with a low matching cost. , Can reduce the processing amount.
 なお、第2の動きベクトル探索部303732も、第1の動きベクトル探索部303731と同様に、所定の回数以降のステップラウンド処理において斜め方向の探索を禁止してもよい。 Note that, similarly to the first motion vector search unit 303731, the second motion vector search unit 303732 may also prohibit a search in an oblique direction in a step round process after a predetermined number of times.
 <ステップサーチの変更例3>
 また、第1の動きベクトル探索部303731は、ブロックサーチにおいて、探索候補点に応じて斜め方向の探索を禁止してもよい。
<Step search change example 3>
Further, the first motion vector search unit 303731 may prohibit a search in an oblique direction according to a search candidate point in a block search.
 例えば、第1の動きベクトル探索部303731は、探索候補点が1画素位置(フルペル位置)である場合には、斜め方向の探索を禁止しなくてもよい。一方で、第1の動きベクトル探索部303731は、探索候補点が小数画素位置である場合には、斜め方向の探索を禁止し、探索方向を上下左右に限定してもよい。以下に、具体例を示す。 For example, the first motion vector search unit 303731 may not prohibit the search in the oblique direction when the search candidate point is one pixel position (full-pel position). On the other hand, when the search candidate point is a decimal pixel position, the first motion vector search unit 303731 may prohibit the search in an oblique direction and limit the search direction to up, down, left, and right. A specific example is shown below.
 第1の動きベクトル探索部303731は、オフセット候補として、全ての探索候補点を含めたオフセット候補offsetCand[Idx]を用いる。 The first motion vector search unit 303731 uses an offset candidate offsetCand [Idx] including all search candidate points as an offset candidate.
 また、第1の動きベクトル探索部303731は、オフセット候補offsetCand[Idx]を用いて、以下の式から動きベクトル候補を導出する。 Also, the first motion vector search unit 303731 uses the offset candidate offsetCand [Idx] to derive a motion vector candidate from the following equation.
 candMV = startMV + offsetCand[Idx]
 ここで、図47の(a)の一段目のように、探索候補点がフルペル位置である場合には、第1の動きベクトル探索部303731は、動きベクトル候補candMVの動き補償画像(予測画像)を生成し、マッチングコストを計算する。
candMV = startMV + offsetCand [Idx]
Here, as shown in the first row of FIG. 47A, when the search candidate point is the full-pel position, the first motion vector search unit 303731 moves the motion compensated image (predicted image) of the motion vector candidate candMV. And calculate the matching cost.
 逆に、探索候補点が小数画素位置(例えば、図47の(a)の一段目の各画素の交点でない位置)である際には、第1の動きベクトル探索部303731は、探索候補点が探索開始点startMVに対して上下左右方向である場合のみマッチングコストを計算する。 On the other hand, when the search candidate point is a decimal pixel position (for example, a position that is not an intersection of each pixel in the first row in FIG. 47A), the first motion vector search unit 303731 Only when the search start point startMV is in the vertical and horizontal directions, the matching cost is calculated.
 探索候補点が探索開始点startMVに対して斜め方向である場合には、第1の動きベクトル探索部303731は、動きベクトル候補candMVの動き補償画像(予測画像)を生成しない。この場合、第1の動きベクトル探索部303731は、マッチングコストとして所定の大きな値(例えば、215-1)を導出してもよいし、マッチングコストを導出しなくてもよい。これにより、処理量を減らすことができる。 When the search candidate point is oblique to the search start point startMV, the first motion vector search unit 303731 does not generate a motion compensated image (predicted image) of the motion vector candidate candMV. In this case, the first motion vector search unit 303731 may derive a predetermined large value (for example, 2 15 −1) as the matching cost, or may not derive the matching cost. Thereby, the processing amount can be reduced.
 なお、第2の動きベクトル探索部303732に関しても、サブブロックサーチにおいて、第1の動きベクトル探索部303731と同様に、マッチングコストを計算してもよい。 Note that, with respect to the second motion vector search unit 303732, the matching cost may be calculated in the sub-block search as in the first motion vector search unit 303731.
 <ステップサーチの変更例4>
 また、第1の動きベクトル探索部303731は、ブロックサーチにおいて、探索した動きベクトルが指し示す参照ブロックの少なくとも一部が参照画像の画面外に係る場合、動きベクトルの探索を禁止してもよい。換言すれば、第1の動きベクトル探索部303731は、動きベクトルが指し示す参照ブロックの少なくとも一部が参照画像の画面外に係る場合、予測画像を生成しなくてもよい。
<Example 4 of step search change>
In addition, in the block search, the first motion vector search unit 303731 may prohibit the search for the motion vector when at least a part of the reference block indicated by the searched motion vector is outside the screen of the reference image. In other words, the first motion vector search unit 303731 may not generate a predicted image when at least a part of the reference block indicated by the motion vector is outside the screen of the reference image.
 以下に、第1の動きベクトル探索部303731による予測画像生成決定処理について、図48を用いて説明する。図48は、予測画像を生成するか否かを決定するフローの概要を示すフローチャート図である。図48に示されるように、第1の動きベクトル探索部303731による予測画像生成決定処理は、下記の(ステップS431)~(ステップS433)の3つの工程を含んでいる。 Hereinafter, the predicted image generation determination process performed by the first motion vector search unit 303731 will be described with reference to FIG. FIG. 48 is a flowchart showing an outline of a flow for determining whether or not to generate a predicted image. As shown in FIG. 48, the predicted image generation determination process by the first motion vector search unit 303731 includes the following three steps (Step S431) to (Step S433).
 (ステップS431)
 ステップS431において、第1の動きベクトル探索部303731は、参照ブロックの少なくとも一部が画面外に係るか否かを判定する。第1の動きベクトル探索部303731は、参照ブロックの少なくとも一部が画面外に係ると判定した場合(ステップS431にてY)、ステップS432に進む。第1の動きベクトル探索部303731は、参照ブロックの少なくとも一部が画面外に係らないと判定した場合(ステップS431にてN)、ステップS433に進む。
(Step S431)
In step S431, the first motion vector search unit 303731 determines whether at least a part of the reference block is outside the screen. If first motion vector search section 303731 determines that at least a part of the reference block is outside the screen (Y in step S431), the first motion vector search unit 303731 proceeds to step S432. If the first motion vector search unit 303731 determines that at least a part of the reference block is not outside the screen (N in step S431), the process proceeds to step S433.
 ここで、第1の動きベクトル探索部303731は、以下の式B-1~B-4の少なくとも何れかを満たす場合に、参照ブロックが参照画像の画面外に係ると判定してもよい。 Here, the first motion vector search unit 303731 may determine that the reference block is outside the screen of the reference image when at least one of the following formulas B-1 to B-4 is satisfied.
 以下の式B-1は、動きベクトルの指し示す参照ブロックの左端が参照画像の画面外に係るか否かを判定する場合に用いる式である。式B-2は、当該参照ブロックの右端が参照画像の画面外に係るか否かを判定する場合に用いる式である。式B-3は、当該参照ブロックの上端が参照画像の画面外に係るか否かを判定する場合に用いる式である。また、式B-4は、当該参照ブロックの下端が参照画像の画面外に係るか否かを判定する場合に用いる式である。 The following equation B-1 is an equation used when determining whether or not the left end of the reference block indicated by the motion vector is outside the screen of the reference image. Expression B-2 is an expression used when determining whether the right end of the reference block is outside the screen of the reference image. Expression B-3 is an expression used when determining whether or not the upper end of the reference block is outside the screen of the reference image. Expression B-4 is an expression used when determining whether or not the lower end of the reference block is outside the screen of the reference image.
 xInt - NTAPS/2 + 1 < 0            (式B-1)
 xInt + BLKW + NTAPS/2 - 1> pic_width - 1   (式B-2)
 yInt - NTAPS/2 + 1 < 0            (式B-3)
 yInt + BLKH + NTAPS/2 - 1> pic_height - 1   (式B-4)
 ここで、式B-1~式B-4におけるxInt及びyIntは、動きベクトル精度が1/M pel精度の場合における、左上ブロック座標(xPb, yPb)から動きベクトル(mv_x, mv_y)分シフトしたブロック内座標(x, y)に対応する参照画像の整数位置(xInt, yInt)を指す。
xInt-NTAPS / 2 + 1 <0 (Formula B-1)
xInt + BLKW + NTAPS / 2-1> pic_width-1 (Formula B-2)
yInt-NTAPS / 2 + 1 <0 (Formula B-3)
yInt + BLKH + NTAPS / 2-1> pic_height-1 (Formula B-4)
Here, xInt and yInt in the equations B-1 to B-4 are shifted by the motion vector (mv_x, mv_y) from the upper left block coordinates (xPb, yPb) when the motion vector accuracy is 1 / M pel accuracy. Points to the integer position (xInt, yInt) of the reference image corresponding to the in-block coordinates (x, y).
 また、式B-1~式B-4におけるNTAPSは動き補償フィルタのフィルタタップ数を示す。式B-1~式B-4におけるBLKW及びBLKHは、それぞれ、対応ブロックの横幅及び高さを示す。また、式B-1~式B-4におけるpic_width及びpic_heightは、それぞれ、参照画像の横幅及び高さを示す。 Also, NTAPS in Equations B-1 to B-4 represents the number of filter taps of the motion compensation filter. BLKW and BLKH in the formulas B-1 to B-4 indicate the horizontal width and height of the corresponding block, respectively. In addition, pic_width and pic_height in Expressions B-1 to B-4 indicate the horizontal width and height of the reference image, respectively.
 (ステップS432)
 ステップS432において、第1の動きベクトル探索部303731は、動きベクトルcandMVの動き補償画像(予測画像)を生成しないことを決定する。この場合、第1の動きベクトル探索部303731は、マッチングコストとして所定の大きな値(例えば、215-1)を導出してもよいし、マッチングコストを導出しなくてもよい。これにより、参照ブロックが参照画像の画面外に係ることにより発生するパディング処理が不要になるため、処理量を減らすことができる。
(Step S432)
In step S432, the first motion vector search unit 303731 determines not to generate a motion compensated image (predicted image) of the motion vector candMV. In this case, the first motion vector search unit 303731 may derive a predetermined large value (for example, 2 15 −1) as the matching cost, or may not derive the matching cost. This eliminates the need for padding processing that occurs when the reference block is outside the screen of the reference image, thereby reducing the amount of processing.
 (ステップS433)
 ステップS433において、第1の動きベクトル探索部303731は、動き補償画像(予測画像)を生成し、マッチングコストを計算することを決定する。
(Step S433)
In step S433, the first motion vector search unit 303731 determines to generate a motion compensated image (predicted image) and calculate a matching cost.
 なお、第2の動きベクトル探索部303732に関しても、サブブロックサーチにおいて、第1の動きベクトル探索部303731と同様に、上述の予測画像生成処理を行ってもよい。 Note that the second motion vector search unit 303732 may also perform the above-described prediction image generation process in the sub-block search, similarly to the first motion vector search unit 303731.
 <ステップサーチの変更例5>
 また、第1の動きベクトル探索部303731は、上述の変更例4のステップS431において、参照ブロックが参照画像の画面外に係るかどうかを判定する代わりに、参照ブロックが参照画像の境界から一定範囲より外にあるかどうかを判定してもよい。
<Example 5 of step search change>
The first motion vector search unit 303731 does not determine whether or not the reference block is outside the screen of the reference image in Step S431 of Modification 4 described above, but the reference block is within a certain range from the boundary of the reference image. You may determine whether it is outside.
 以下に、第1の動きベクトル探索部303731による予測画像生成決定処理について、図49を用いて説明する。図49は、予測画像を生成するか否かを決定するフローの概要を示すフローチャート図である。図49に示されるように、第1の動きベクトル探索部303731による予測画像生成決定処理は、(ステップS441)~(ステップS443)の3つの工程を含んでいる。ステップS442及びステップS443は、それぞれ上述のステップS432及びステップS433と同様なので説明を省略する。 Hereinafter, the predicted image generation determination process by the first motion vector search unit 303731 will be described with reference to FIG. FIG. 49 is a flowchart showing an outline of a flow for determining whether or not to generate a predicted image. As shown in FIG. 49, the predicted image generation determination process by the first motion vector search unit 303731 includes three steps (step S441) to (step S443). Steps S442 and S443 are the same as steps S432 and S433 described above, respectively, and thus description thereof is omitted.
 (ステップS441)
 ステップS441において、第1の動きベクトル探索部303731は、参照ブロックの少なくとも一部が参照画像の境界から一定範囲よりも外であるか否かを判定する。
(Step S441)
In step S441, the first motion vector search unit 303731 determines whether at least a part of the reference block is outside a certain range from the boundary of the reference image.
 第1の動きベクトル探索部303731は、参照ブロックの少なくとも一部が画面外に係ると判定した場合(ステップS441のY)、ステップS442に進む。第1の動きベクトル探索部303731は、参照ブロックの少なくとも一部が画面外に係らないと判定した場合(ステップS441のN)、ステップS443に進む。 If the first motion vector search unit 303731 determines that at least a part of the reference block is outside the screen (Y in step S441), the process proceeds to step S442. If the first motion vector search unit 303731 determines that at least part of the reference block is not outside the screen (N in step S441), the process proceeds to step S443.
 ここで、図49のステップS441の「参照ブロックの少なくとも一部が画面境界から一定範囲より外」の判定において、第1の動きベクトル探索部303731は、以下の式C-1~C-4の少なくとも何れかを満たす場合に、参照ブロックの少なくとも一部が参照画像の境界から一定範囲より外にあることを判定してもよい。 Here, in the determination of “at least a part of the reference block is out of a certain range from the screen boundary” in step S441 in FIG. 49, the first motion vector search unit 303731 uses the following expressions C-1 to C-4: When at least one of the conditions is satisfied, it may be determined that at least a part of the reference block is outside a certain range from the boundary of the reference image.
 以下の式C-1は、動きベクトルの指し示す参照ブロックの左端が参照画像の境界から一定範囲より外にあるか否かを判定する場合に用いる式である。また、式C-2は、当該参照ブロックの右端が参照画像の境界から一定範囲より外にあるか否かを判定する場合に用いる式である。式C-3は、当該参照ブロックの上端が参照画像の境界から一定範囲より外にあるか否かを判定する場合に用いる式である。式C-4は、当該参照ブロックの下端が参照画像の境界から一定範囲より外にあるか否かを判定する場合に用いる式である。 The following expression C-1 is an expression used when determining whether or not the left end of the reference block indicated by the motion vector is outside a certain range from the boundary of the reference image. Expression C-2 is an expression used when determining whether the right end of the reference block is outside a certain range from the boundary of the reference image. Expression C-3 is an expression used when determining whether or not the upper end of the reference block is outside a certain range from the boundary of the reference image. Expression C-4 is an expression used when determining whether or not the lower end of the reference block is outside a certain range from the boundary of the reference image.
 xInt - NTAPS/2 + 1 < -padW              (式C-1)
 xInt + BLKW + NTAPS/2 - 1 > pic_width + padW - 1    (式C-2)
 yInt - NTAPS/2 + 1 < -padH              (式C-3)
 yInt + BLKH + NTAPS/2 - 1 > pic_height + padH - 1 (式C-4)
 ここで、式C-1~式C-4におけるpadW及びpadHは、それぞれ、予め定められた水平方向における一定範囲を示すpadW、及び、予め定められた垂直方向における一定範囲を示すpadHを意味する。
xInt-NTAPS / 2 + 1 <-padW (Formula C-1)
xInt + BLKW + NTAPS / 2-1> pic_width + padW-1 (Formula C-2)
yInt-NTAPS / 2 + 1 <-padH (Formula C-3)
yInt + BLKH + NTAPS / 2-1> pic_height + padH-1 (Formula C-4)
Here, padW and padH in the formulas C-1 to C-4 mean padW indicating a predetermined range in the horizontal direction and padH indicating a predetermined range in the vertical direction, respectively. .
 これにより、参照ブロックの少なくとも一部が参照画像の境界からはみ出ていても、一定範囲よりも外側にはみ出ていない場合には、第1の動きベクトル探索部303731によって動き補償画像(予測画像)を生成することができる。また、参照ブロックの少なくとも一部が参照画像の境界から一定範囲よりも外側にある場合、パディング処理を実行する領域を制限することができるので、処理量を減らすことができる。 Accordingly, when at least a part of the reference block protrudes from the boundary of the reference image but does not protrude outside the certain range, the first motion vector search unit 303731 generates a motion compensated image (predicted image). Can be generated. In addition, when at least a part of the reference block is outside a certain range from the boundary of the reference image, it is possible to limit the area where the padding process is performed, and thus the processing amount can be reduced.
 なお、第2の動きベクトル探索部303732に関しても、サブブロックサーチにおいて、第1の動きベクトル探索部303731と同様に、上述の予測画像生成処理を行ってもよい。 Note that the second motion vector search unit 303732 may also perform the above-described prediction image generation process in the sub-block search, similarly to the first motion vector search unit 303731.
 <ラスタサーチの具体例>
 続いて、ラスタサーチについて説明する。マッチング動き導出部30373cがラスタサーチを適用した動き探索を行う場合、マッチング動き導出部30373cは、探索範囲内の探索点を一定間隔で網羅的に選択し、これらのマッチングコストをラスタスキャン(raster scan)順に評価する。ここで、ラスタスキャンとは、探索範囲の左上を起点とし、左側から右へと右端に到達するまで画素を調べ、右端に到達した場合には、行を1つだけ下がってまた左端から右へと順に画素を調べる網羅的な検索方法である。
<Specific example of raster search>
Next, raster search will be described. When the matching motion deriving unit 30373c performs a motion search to which the raster search is applied, the matching motion deriving unit 30373c comprehensively selects search points within the search range at regular intervals, and the matching cost is determined by a raster scan. ) Evaluate in order. Here, the raster scan starts from the upper left of the search range, examines the pixels from the left side to the right until it reaches the right end, and if it reaches the right end, it goes down one row and goes from the left end to the right again. This is an exhaustive search method that sequentially examines the pixels.
 マッチング動き導出部30373cは、ラスタスキャン順に設定された開始点から終点までの探索ベクトルの各々について算出したマッチングコストのうち、最も小さいマッチングコストを与える探索ベクトルを選択する。 The matching motion deriving unit 30373c selects a search vector that gives the smallest matching cost among the matching costs calculated for each search vector from the start point to the end point set in the raster scan order.
 ラスタスキャンとは、blkW×blkHのサイズの領域に対して、最初にY座標y、X座標xを初期値に設定したうえで、xを初期値から終値までスキャンし、xが終値に達したら、xを初期値に戻したうえで、yを増加させ、更新されたyにおいて再度xを初期値から終値までスキャンする処理を繰り返す手順である。疑似コードで示すと、xのループがyのループの内側にあるような以下のような2重ループで行われる。 With raster scan, for the size area of blkW x blkH, first set the Y coordinate y and the X coordinate x to the initial value, then scan x from the initial value to the closing price, and when x reaches the closing price , X is returned to the initial value, y is increased, and the process of repeatedly scanning x from the initial value to the final value in the updated y is repeated. In pseudo code, this is done in the following double loop where the x loop is inside the y loop.
 for (y = 0; y < blkH; y++) { // yに関するループ
  for (x = 0; x < blkW; x++) {  // xに関するループ
   ラスタスキャン内の処理
  }
 }
 なお、ラスタスキャンの代わりに、拡張ラスタスキャンを用いてもよい。拡張ラスタスキャンは、ラスタスキャンのようにあらかじめ定められたスキャン順によって、ブロック内の各点を走査するものである。例えば、中心から周辺に向かって渦巻き状に走査するスパイラルスキャン等である。
for (y = 0; y <blkH; y ++) {// loop for y for (x = 0; x <blkW; x ++) {// loop for x Processing in raster scan}
}
Note that an extended raster scan may be used instead of the raster scan. In the extended raster scan, each point in the block is scanned in a predetermined scan order like the raster scan. For example, a spiral scan that scans spirally from the center toward the periphery is used.
 ラスタサーチにおいても、第1の動きベクトル探索部303731及び第2の動きベクトル探索部303732の少なくとも何れかが、上述のステップサーチと同様に、斜め方向の探索を禁止してよい。 Also in the raster search, at least one of the first motion vector search unit 303731 and the second motion vector search unit 303732 may prohibit the search in the oblique direction as in the above-described step search.
 (画像符号化装置の構成)
 図40に示すように、画像符号化装置11cは、実施形態3における予測パラメータ符号化部111bの代わりに、予測パラメータ符号化部111cを備えている。また、予測パラメータ符号化部111cは、実施形態3におけるインター予測パラメータ符号化部112bの代わりに、インター予測パラメータ符号化部(動きベクトル導出部)112cを備えている。
(Configuration of image encoding device)
As illustrated in FIG. 40, the image encoding device 11c includes a prediction parameter encoding unit 111c instead of the prediction parameter encoding unit 111b in the third embodiment. The prediction parameter encoding unit 111c includes an inter prediction parameter encoding unit (motion vector deriving unit) 112c instead of the inter prediction parameter encoding unit 112b in the third embodiment.
 図42は、実施形態4に係る画像符号化装置11cのインター予測パラメータ符号化部112cの構成を示すブロック図である。図42に示されるように、インター予測パラメータ符号化部112cは、実施形態3におけるサブブロック予測パラメータ導出部1125bの代わりに、サブブロック予測パラメータ導出部1125cを備えている。サブブロック予測パラメータ導出部1125cは、実施形態3におけるマッチング動き導出部11253の代わりに、マッチング動き導出部11253cを備えている。この点以外は、インター予測パラメータ符号化部112cは、実施形態3におけるインター予測パラメータ符号化部112bと同様の構成である。 FIG. 42 is a block diagram illustrating a configuration of the inter prediction parameter encoding unit 112c of the image encoding device 11c according to the fourth embodiment. As illustrated in FIG. 42, the inter prediction parameter encoding unit 112c includes a subblock prediction parameter deriving unit 1125c instead of the subblock prediction parameter deriving unit 1125b in the third embodiment. The sub-block prediction parameter deriving unit 1125c includes a matching motion deriving unit 11253c instead of the matching motion deriving unit 11253 in the third embodiment. Except for this point, the inter prediction parameter encoding unit 112c has the same configuration as the inter prediction parameter encoding unit 112b in the third embodiment.
 マッチング動き導出部11253cについては、上述のマッチング動き導出部30373cと同様の構成であるためここでの説明を省略する。 Since the matching motion deriving unit 11253c has the same configuration as the above-described matching motion deriving unit 30373c, description thereof is omitted here.
 なお、上述した実施形態における画像符号化装置11、11a、11b、11c及び画像復号装置31、31a、31b、31cの一部、例えば、エントロピー復号部301、予測パラメータ復号部302、302b、302c、ループフィルタ305、予測画像生成部308、308a、逆量子化・逆変換部311、加算部312、予測画像生成部101、101a、減算部102、変換・量子化部103、エントロピー符号化部104、逆量子化・逆変換部105、ループフィルタ107、符号化パラメータ決定部110、予測パラメータ符号化部111、111b、111cをコンピュータによって実現するようにしてもよい。その場合、この制御機能を実現するためのプログラムをコンピュータ読み取り可能な記録媒体に記録して、この記録媒体に記録されたプログラムをコンピュータシステムに読み込ませ、実行することによって実現してもよい。なお、ここでいう「コンピュータシステム」とは、画像符号化装置11、11a、11b、11c及び画像復号装置31、31a、31b、31cの何れかに内蔵されたコンピュータシステムであって、OS及び周辺機器等のハードウェアを含むものとする。また、「コンピュータ読み取り可能な記録媒体」とは、フレキシブルディスク、光磁気ディスク、ROM、CD-ROM等の可搬媒体、コンピュータシステムに内蔵されるハードディスク等の記憶装置のことをいう。更に「コンピュータ読み取り可能な記録媒体」とは、インターネット等のネットワーク又は電話回線等の通信回線を介してプログラムを送信する場合の通信線のように、短時間且つ動的にプログラムを保持するもの、その場合のサーバ又はクライアントとなるコンピュータシステム内部の揮発性メモリのように、一定時間プログラムを保持しているものも含んでもよい。また上記プログラムは、前述した機能の一部を実現するためのものであってもよく、更に前述した機能をコンピュータシステムにすでに記録されているプログラムとの組み合わせによって実現できるものであってもよい。 Note that the image encoding devices 11, 11a, 11b, and 11c and part of the image decoding devices 31, 31a, 31b, and 31c in the above-described embodiment, for example, the entropy decoding unit 301, the prediction parameter decoding units 302, 302b, and 302c, Loop filter 305, predicted image generation units 308 and 308a, inverse quantization / inverse transformation unit 311, addition unit 312, predicted image generation units 101 and 101a, subtraction unit 102, transformation / quantization unit 103, entropy encoding unit 104, The inverse quantization / inverse transform unit 105, the loop filter 107, the encoding parameter determination unit 110, and the prediction parameter encoding units 111, 111b, and 111c may be realized by a computer. In that case, the program for realizing the control function may be recorded on a computer-readable recording medium, and the program recorded on the recording medium may be read by the computer system and executed. Here, the “computer system” is a computer system built in any of the image encoding devices 11, 11a, 11b, and 11c and the image decoding devices 31, 31a, 31b, and 31c. It shall include hardware such as equipment. The “computer-readable recording medium” refers to a storage device such as a portable medium such as a flexible disk, a magneto-optical disk, a ROM, a CD-ROM, or a hard disk built in a computer system. Further, the “computer-readable recording medium” is a medium that holds a program dynamically for a short time, such as a communication line in the case of transmitting a program via a network such as the Internet or a communication line such as a telephone line, In such a case, a volatile memory inside a computer system serving as a server or a client may be included and a program that holds a program for a certain period of time. The program may be a program for realizing a part of the above-described functions, or may be a program that can be realized by a combination with a program already recorded in the computer system.
 また、上述した実施形態における画像符号化装置11、11a、11b、11c及び画像復号装置31、31a、31b、31cの一部、又は全部を、LSI(Large Scale Integration)等の集積回路として実現してもよい。画像符号化装置11、11a、11b、11c及び画像復号装置31、31a、31b、31cの各機能ブロックは個別にプロセッサ化してもよいし、一部、又は全部を集積してプロセッサ化してもよい。また、集積回路化の手法はLSIに限らず専用回路、又は汎用プロセッサによって実現してもよい。また、半導体技術の進歩によりLSIに代替する集積回路化の技術が出現した場合、当該技術による集積回路を用いてもよい。 In addition, part or all of the image encoding devices 11, 11a, 11b, and 11c and the image decoding devices 31, 31a, 31b, and 31c in the above-described embodiment are realized as an integrated circuit such as an LSI (Large Scale Integration). May be. Each functional block of the image encoding devices 11, 11a, 11b, and 11c and the image decoding devices 31, 31a, 31b, and 31c may be individually converted into a processor, or a part or all of them may be integrated into a processor. . Further, the method of circuit integration is not limited to LSI, and may be realized by a dedicated circuit or a general-purpose processor. In addition, when an integrated circuit technology that replaces LSI appears due to the advancement of semiconductor technology, an integrated circuit based on the technology may be used.
 以上、図面を参照してこの発明の一実施形態について詳しく説明してきたが、具体的な構成は上述のものに限られることはなく、この発明の要旨を逸脱しない範囲内において様々な設計変更等をすることが可能である。 As described above, the embodiment of the present invention has been described in detail with reference to the drawings. However, the specific configuration is not limited to the above, and various design changes and the like can be made without departing from the scope of the present invention. It is possible to
 〔応用例〕
 上述した画像符号化装置11、11a、11b、11c及び及び画像復号装置31、31a、31b、31cは、動画像の送信、受信、記録、再生を行う各種装置に搭載して利用することができる。なお、動画像は、カメラ等により撮像された自然動画像であってもよいし、コンピュータ等により生成された人工動画像(CG及びGUIを含む)であってもよい。
[Application example]
The above-described image encoding devices 11, 11a, 11b, and 11c and the image decoding devices 31, 31a, 31b, and 31c can be mounted and used in 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.
 まず、上述した画像符号化装置11、11a、11b、11c及び画像復号装置31、31a、31b、31cを、動画像の送信及び受信に利用できることを、図50を参照して説明する。 First, it will be described with reference to FIG. 50 that the above-described image encoding devices 11, 11a, 11b, and 11c and the image decoding devices 31, 31a, 31b, and 31c can be used for transmission and reception of moving images.
 図50の(a)は、画像符号化装置11、11a、11b及び11cを搭載した送信装置PROD_Aの構成を示したブロック図である。図50の(a)に示すように、送信装置PROD_Aは、動画像を符号化することによって符号化データを得る符号化部PROD_A1と、符号化部PROD_A1が得た符号化データによって搬送波を変調することで変調信号を得る変調部PROD_A2と、変調部PROD_A2が得た変調信号を送信する送信部PROD_A3と、を備えている。上述した画像符号化装置11、11a、11b及び11cは、この符号化部PROD_A1として利用される。 FIG. 50 (a) is a block diagram showing a configuration of a transmission apparatus PROD_A equipped with the image encoding apparatuses 11, 11a, 11b, and 11c. As shown in FIG. 50 (a), the transmission apparatus 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 above-described image encoding devices 11, 11a, 11b, and 11c are used as the encoding unit PROD_A1.
 送信装置PROD_Aは、符号化部PROD_A1に入力する動画像の供給源として、動画像を撮像するカメラPROD_A4、動画像を記録した記録媒体PROD_A5、動画像を外部から入力するための入力端子PROD_A6、及び、画像を生成又は加工する画像処理部A7を更に備えていてもよい。図50の(a)においては、これら全てを送信装置PROD_Aが備えた構成を例示しているが、一部を省略しても構わない。 Transmission device PROD_A, as a source of moving images to be input to the encoding unit PROD_A1, a camera PROD_A4 that captures moving images, a recording medium PROD_A5 that records moving images, an input terminal PROD_A6 for inputting moving images from the outside, and An image processing unit A7 that generates or processes an image may be further provided. FIG. 50A illustrates a configuration in which the transmission apparatus PROD_A includes all of these, but some of them may be omitted.
 なお、記録媒体PROD_A5は、符号化されていない動画像を記録したものであってもよいし、伝送用の符号化方式とは異なる記録用の符号化方式によって符号化された動画像を記録したものであってもよい。後者の場合、記録媒体PROD_A5と符号化部PROD_A1との間に、記録媒体PROD_A5から読み出した符号化データを記録用の符号化方式に従って復号する復号部(不図示)を介在させるとよい。 Note that 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 in accordance with the recording encoding method may be interposed between the recording medium PROD_A5 and the encoding unit PROD_A1.
 図50の(b)は、画像復号装置31、31a、31b及び31cを搭載した受信装置PROD_Bの構成を示したブロック図である。図50の(b)に示すように、受信装置PROD_Bは、変調信号を受信する受信部PROD_B1と、受信部PROD_B1が受信した変調信号を復調することによって符号化データを得る復調部PROD_B2と、復調部PROD_B2が得た符号化データを復号することによって動画像を得る復号部PROD_B3と、を備えている。上述した画像復号装置31、31a、31b及び31cは、この復号部PROD_B3として利用される。 (B) of FIG. 50 is a block diagram showing a configuration of a receiving device PROD_B equipped with the image decoding devices 31, 31a, 31b, and 31c. As shown in FIG. 50B, 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 above-described image decoding devices 31, 31a, 31b, and 31c are used as the decoding unit PROD_B3.
 受信装置PROD_Bは、復号部PROD_B3が出力する動画像の供給先として、動画像を表示するディスプレイPROD_B4、動画像を記録するための記録媒体PROD_B5、及び、動画像を外部に出力するための出力端子PROD_B6を更に備えていてもよい。図50の(b)においては、これら全てを受信装置PROD_Bが備えた構成を例示しているが、一部を省略しても構わない。 The receiving device PROD_B is a display destination PROD_B4 for displaying a moving image, a recording medium PROD_B5 for recording a 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. 50B, a configuration in which all of these are provided in the receiving device PROD_B is illustrated, but a part may be omitted.
 なお、記録媒体PROD_B5は、符号化されていない動画像を記録するためのものであってもよいし、伝送用の符号化方式とは異なる記録用の符号化方式によって符号化されたものであってもよい。後者の場合、復号部PROD_B3と記録媒体PROD_B5との間に、復号部PROD_B3から取得した動画像を記録用の符号化方式に従って符号化する符号化部(不図示)を介在させるとよい。 Note that the recording medium PROD_B5 may be for recording a non-encoded moving image, or is encoded by a recording encoding method different from the transmission encoding method. May be. In the latter case, an encoding unit (not shown) 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, etc.) / Receiving station (television receiver, etc.) is an example of a transmitting device PROD_A / receiving device PROD_B that transmits and receives modulated signals by wireless broadcasting. A broadcasting station (broadcasting equipment, etc.) / Receiving station (television receiver, etc.) 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 wired broadcasting.
 また、インターネットを用いたVOD(Video On Demand)サービス及び動画共有サービス等のサーバ(ワークステーション等)/クライアント(テレビジョン受像機、パーソナルコンピュータ及びスマートフォン等)は、変調信号を通信によって送受信する送信装置PROD_A/受信装置PROD_Bの一例である(通常、LANにおいては伝送媒体として無線又は有線の何れかが用いられ、WANにおいては伝送媒体として有線が用いられる)。ここで、パーソナルコンピュータには、デスクトップ型PC、ラップトップ型PC、及びタブレット型PCが含まれる。また、スマートフォンには、多機能携帯電話端末も含まれる。 Also, a server (workstation, etc.) / Client (television receiver, personal computer, smartphone, etc.) such as a VOD (Video On Demand) service and a video sharing service using the Internet transmits and receives a modulated signal by communication. This is an example of PROD_A / receiving 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 moving image 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.
 次に、上述した画像符号化装置11、11a、11b、11c及び画像復号装置31、31a、31b、31cを、動画像の記録及び再生に利用できることを、図51を参照して説明する。 Next, it will be described with reference to FIG. 51 that the above-described image encoding devices 11, 11a, 11b, and 11c and the image decoding devices 31, 31a, 31b, and 31c can be used for recording and reproduction of moving images.
 図51の(a)は、上述した画像符号化装置11、11a、11b及び11cを搭載した記録装置PROD_Cの構成を示したブロック図である。図51の(a)に示すように、記録装置PROD_Cは、動画像を符号化することによって符号化データを得る符号化部PROD_C1と、符号化部PROD_C1が得た符号化データを記録媒体PROD_Mに書き込む書込部PROD_C2と、を備えている。上述した画像符号化装置11、11a、11b及び11cは、この符号化部PROD_C1として利用される。 FIG. 51A is a block diagram showing a configuration of a recording apparatus PROD_C equipped with the above-described image encoding apparatuses 11, 11a, 11b, and 11c. As shown in (a) of FIG. 51, 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 above-described image encoding devices 11, 11a, 11b, and 11c are 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) and SSD (Solid State Drive). Further, (2) an SD memory card, a USB (Universal Serial Bus) flash memory, or the like connected to the recording device PROD_C may be used. Further, (3) DVD (Digital Versatile Disc) and BD (Blu-ray Disc: registered trademark), etc. may be loaded into a drive device (not shown) built in the recording device PROD_C. .
 また、記録装置PROD_Cは、符号化部PROD_C1に入力する動画像の供給源として、動画像を撮像するカメラPROD_C3、動画像を外部から入力するための入力端子PROD_C4、動画像を受信するための受信部PROD_C5、及び、画像を生成又は加工する画像処理部PROD_C6を更に備えていてもよい。図51の(a)においては、これら全てを記録装置PROD_Cが備えた構成を例示しているが、一部を省略しても構わない。 In addition, the recording device PROD_C is a camera PROD_C3 that captures moving images as a 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 a reception for receiving moving images A unit PROD_C5 and an image processing unit PROD_C6 for generating or processing an image may be further provided. In FIG. 51A, a configuration in which the recording apparatus PROD_C includes all of these is illustrated, but a part 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 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), and a smartphone ( In this case, the camera PROD_C3 or the reception unit PROD_C5 is a main source of moving images) and the like is also an example of such a recording apparatus PROD_C.
 図51の(b)は、上述した画像復号装置31、31aを搭載した再生装置PROD_Dの構成を示したブロックである。図51の(b)に示すように、再生装置PROD_Dは、記録媒体PROD_Mに書き込まれた符号化データを読み出す読出部PROD_D1と、読出部PROD_D1が読み出した符号化データを復号することによって動画像を得る復号部PROD_D2と、を備えている。上述した画像復号装置31、31a、31b及び31cは、この復号部PROD_D2として利用される。 FIG. 51 (b) is a block diagram showing a configuration of a playback device PROD_D equipped with the above-described image decoding devices 31 and 31a. As shown in FIG. 51 (b), 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 read unit PROD_D1 that reads the encoded data. And a decoding unit PROD_D2 to obtain. The above-described image decoding devices 31, 31a, 31b, and 31c are 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 and SSD. Further, (2) a type connected to the playback device PROD_D, such as an SD memory card and a USB flash memory, may be used. Also, (3) a drive device (not shown) built in the playback device PROD_D, such as a DVD and a BD, may be loaded.
 また、再生装置PROD_Dは、復号部PROD_D2が出力する動画像の供給先として、動画像を表示するディスプレイPROD_D3、動画像を外部に出力するための出力端子PROD_D4、及び、動画像を送信する送信部PROD_D5を更に備えていてもよい。図51の(b)においては、これら全てを再生装置PROD_Dが備えた構成を例示しているが、一部を省略しても構わない。 In addition, the playback device PROD_D has a display unit PROD_D3 that displays a moving image as a supply destination of the moving image output by the decoding unit PROD_D2, an output terminal PROD_D4 that outputs the moving image to the outside, and a transmission unit that transmits the moving image. PROD_D5 may be further provided. FIG. 51B illustrates a configuration in which the playback apparatus PROD_D includes all of these, but some of them may be omitted.
 なお、送信部PROD_D5は、符号化されていない動画像を送信するものであってもよいし、記録用の符号化方式とは異なる伝送用の符号化方式によって符号化された符号化データを送信するものであってもよい。後者の場合、復号部PROD_D2と送信部PROD_D5との間に、動画像を伝送用の符号化方式によって符号化する符号化部(不図示)を介在させるとよい。 Note that the transmission unit PROD_D5 may transmit a non-encoded moving image, or transmits encoded data encoded by a transmission encoding scheme different from the recording encoding scheme. You may do. In the latter case, an encoding unit (not shown) that encodes a moving image by a transmission encoding method may be interposed 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, the output terminal PROD_D4 to which a television receiver or the like is connected is a main moving image supply destination). . In addition, a television receiver (in this case, the display 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 video) An image is a main supply destination, a smartphone (in this case, the display PROD_D3 or the transmission unit PROD_D5 is a main supply destination of moving images), and the like are examples of such a playback device PROD_D.
 (ハードウェア的実現及びソフトウェア的実現)
 また、上述した画像復号装置31、31a、31b、31c及び画像符号化装置11、11a、11b、11cの各ブロックは、集積回路(ICチップ)上に形成された論理回路によってハードウェア的に実現してもよいし、CPU(Central Processing Unit)を用いてソフトウェア的に実現してもよい。
(Hardware implementation and software implementation)
Each block of the above-described image decoding devices 31, 31a, 31b, and 31c and the image encoding devices 11, 11a, 11b, and 11c is realized by hardware by a logic circuit formed on an integrated circuit (IC chip). Alternatively, it may be realized by software using a CPU (Central Processing Unit).
 後者の場合、上記各装置は、各機能を実現するプログラムの命令を実行するCPU、上記プログラムを格納したROM(Read Only Memory)、上記プログラムを展開するRAM(RandomAccess Memory)、上記プログラム及び各種データを格納するメモリ等の記憶装置(記録媒体)等を備えている。そして、本発明の実施形態の目的は、上述した機能を実現するソフトウェアである上記各装置の制御プログラムのプログラムコード(実行形式プログラム、中間コードプログラム及びソースプログラム)をコンピュータで読み取り可能に記録した記録媒体を、上記各装置に供給し、そのコンピュータ(又はCPU若しくはMPU)が記録媒体に記録されているプログラムコードを読み出し実行することによっても、達成可能である。 In the latter case, each of the above devices includes a CPU that executes instructions of a program that realizes each function, a ROM (Read Memory) that stores the program, a RAM (RandomAccess Memory) that expands the program, the program, and various data A storage device (recording medium) such as a memory for storing the. The object of the embodiment of the present invention is to record the program code (execution format program, intermediate code program, and source program) of the control program for each of the above devices, which is software that realizes the above-described functions, in a computer-readable manner. This can also be achieved by supplying a medium 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(Compact Disc Read-Only Memory)/MOディスク(Magneto-Optical disc)/MD(Mini Disc)/DVD(Digital Versatile Disc)/CD-R(CD Recordable)/ブルーレイディスク(Blu-ray Disc:登録商標)等の光ディスクを含むディスク類、ICカード(メモリカードを含む)/光カード等のカード類、マスクROM/EPROM(Erasable Programmable Read-Only Memory)/EEPROM(Electrically Erasable and Programmable Read-Only Memory:登録商標)/フラッシュROM等の半導体メモリ類、あるいはPLD(Programmable logic device)及びFPGA(Field Programmable Gate Array)等の論理回路類等を用いることができる。 Examples of the recording medium include tapes such as magnetic tapes and cassette tapes, magnetic disks such as floppy (registered trademark) disks / hard disks, and CD-ROMs (Compact Disc Read-Only Memory) / MO discs (Magneto-Optical discs). ) / MD (Mini Disc) / DVD (Digital Versatile Disc) / CD-R (CD Recordable) / Blu-ray Disc (Blu-ray Disc: registered trademark) and other optical disks, IC cards (including memory cards) / Cards such as optical cards, Mask ROM / EPROM (Erasable Programmable Read-Only Memory) / EEPROM (Electrically Erasable and Programmable Read-Only Memory: registered trademark) / Semiconductor memories such as flash ROM, or PLD (Programmable logic device ) And FPGA (Field Programmable Gate Gate Array) and the like.
 また、上記各装置を通信ネットワークと接続可能に構成し、上記プログラムコードを、通信ネットワークを介して供給してもよい。この通信ネットワークは、プログラムコードを伝送可能であればよく、特に限定されない。例えば、インターネット、イントラネット、エキストラネット、LAN(Local Area Network)、ISDN(Integrated Services Digital Network)、VAN(Value-Added Network)、CATV(Community Antenna television/Cable Television)通信網、仮想専用網(Virtual Private Network)、電話回線網、移動体通信網及び衛星通信網等が利用可能である。また、この通信ネットワークを構成する伝送媒体も、プログラムコードを伝送可能な媒体であればよく、特定の構成又は種類のものに限定されない。例えば、IEEE(Institute of Electrical and Electronic Engineers)1394、USB、電力線搬送、ケーブルTV回線、電話線及びADSL(Asymmetric Digital Subscriber Line)回線等の有線でも、IrDA(Infrared Data Association)及びリモコンのような赤外線、BlueTooth(登録商標)、IEEE802.11無線、HDR(High Data Rate)、NFC(Near Field Communication)、DLNA(Digital Living Network Alliance:登録商標)、携帯電話網、衛星回線及び地上デジタル放送網等の無線でも利用可能である。なお、本発明の実施形態は、上記プログラムコードが電子的な伝送で具現化された、搬送波に埋め込まれたコンピュータデータ信号の形態でも実現され得る。 Further, 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, Internet, intranet, extranet, LAN (Local Area Network), ISDN (Integrated Services Digital Network), VAN (Value-Added Network), CATV (Community Area Antenna / television / Cable Television), Virtual Private Network (Virtual Private Network) Network), telephone line network, mobile communication network, satellite communication network, and the like. The transmission medium constituting the communication network may be any medium that can transmit the program code, and is not limited to a specific configuration or type. For example, IEEE (Institute of Electrical and Electronic Engineers) 1394, USB, power line carrier, cable TV line, telephone line, ADSL (Asymmetric Digital Subscriber Line) line, etc. wired such as IrDA (Infrared Data Association) and remote control , BlueTooth (registered trademark), IEEE802.11 wireless, HDR (High Data Rate), NFC (Near Field Communication), DLNA (Digital Living Network Alliance: registered trademark), mobile phone network, satellite line, terrestrial digital broadcasting network, etc. It can also be used wirelessly. The embodiment of 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 embodiments of the present invention are not limited to the above-described embodiments, and various modifications are possible within the scope of 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.
 (関連出願の相互参照)
 本出願は、2017年6月14日に出願された日本国特許出願:特願2017-117273及び2017年6月23日に出願された日本国特許出願:特願2017-123731に対して優先権の利益を主張するものであり、それを参照することにより、その内容の全てが本書に含まれる。
(Cross-reference of related applications)
This application has priority over Japanese patent application filed on June 14, 2017: Japanese Patent Application No. 2017-117273 and Japanese patent application filed on June 23, 2017: Japanese Patent Application No. 2017-123731. The contents of which are hereby incorporated by reference in their entirety.
 本発明の実施形態は、画像データが符号化された符号化データを復号する画像復号装置、及び、画像データが符号化された符号化データを生成する画像符号化装置に好適に適用することができる。また、画像符号化装置によって生成され、画像復号装置によって参照される符号化データのデータ構造に好適に適用することができる。 Embodiments of the present invention are preferably applied to an image decoding apparatus that decodes encoded data in which image data is encoded, and an image encoding apparatus that generates encoded data in which image data is encoded. it can. Further, the present invention can be suitably applied to the data structure of encoded data generated by an image encoding device and referenced by the image decoding device.
1、1a、1b、1c…画像伝送システム
11、11a、11b、11c…画像符号化装置(動画像符号化装置、動きベクトル導出装置)
101、101a…予測画像生成部
1011、1011a…インター予測画像生成部
10111、10111a…動き補償部
102…減算部
103…変換・量子化部
104…エントロピー符号化部
105…逆量子化・逆変換部
106…加算部
108…予測パラメータメモリ
109…参照ピクチャメモリ
110…符号化パラメータ決定部
111、111b、111c…予測パラメータ符号化部
112、112b、112c…インター予測パラメータ符号化部(動きベクトル導出部)
1121…マージ予測パラメータ導出部
1122…AMVP予測パラメータ導出部
1123…減算部
1125、1125b、1125c…サブブロック予測パラメータ導出部
113…イントラ予測パラメータ符号化部
21…ネットワーク
31、31a…画像復号装置(予測画像生成装置、動画像復号装置、動きベクトル導出装置)
301…エントロピー復号部
302、302b、302c…予測パラメータ復号部
303、303b、303c…インター予測パラメータ復号部(動きベクトル導出部)
3032…AMVP予測パラメータ導出部
3033…ベクトル候補導出部
3036…マージ予測パラメータ導出部
3038…加算部
30361…マージ候補導出部
303611…マージ候補格納部
30362…マージ候補選択部
304…イントラ予測パラメータ復号部
306…参照ピクチャメモリ
307…予測パラメータメモリ
308、308a…予測画像生成部
309、309a…インター予測画像生成部
3091、3091a…動き補償部
30911…動き補償勾配部
309122…勾配補正係数導出部
309112…勾配導出部
3094…重み予測部
310…イントラ予測画像生成部
311…逆量子化・逆変換部
312…加算部
41…画像表示装置
11253、11253c、30373、30373c マッチング動き導出部(第1の動きベクトル探索部、第2の動きベクトル探索部)
303731 第1の動きベクトル探索部
303732 第2の動きベクトル探索部
1, 1a, 1b, 1c... Image transmission system 11, 11a, 11b, 11c... Image encoding device (moving image encoding device, motion vector deriving device)
DESCRIPTION OF SYMBOLS 101, 101a ... Predictive image generation part 1011, 1011a ... Inter prediction image generation part 10111, 10111a ... Motion compensation part 102 ... Subtraction part 103 ... Transform / quantization part 104 ... Entropy encoding part 105 ... Inverse quantization / inverse conversion part 106 ... adder 108 ... prediction parameter memory 109 ... reference picture memory 110 ... encoding parameter determination unit 111, 111b, 111c ... prediction parameter encoding unit 112, 112b, 112c ... inter prediction parameter encoding unit (motion vector deriving unit)
DESCRIPTION OF SYMBOLS 1121 ... Merge prediction parameter derivation | leading-out part 1122 ... AMVP prediction parameter derivation | leading-out part 1123 ... Subtraction part 1125, 1125b, 1125c ... Sub-block prediction parameter derivation | leading-out part 113 ... Intra prediction parameter encoding part 21 ... Network 31, 31a ... Image decoding apparatus (prediction) Image generating device, moving image decoding device, motion vector deriving device)
301: Entropy decoding units 302, 302b, 302c ... Prediction parameter decoding units 303, 303b, 303c ... Inter prediction parameter decoding unit (motion vector deriving unit)
3032 ... AMVP prediction parameter derivation unit 3033 ... vector candidate derivation unit 3036 ... merge prediction parameter derivation unit 3038 ... addition unit 30361 ... merge candidate derivation unit 303611 ... merge candidate storage unit 30362 ... merge candidate selection unit 304 ... intra prediction parameter decoding unit 306 ... Reference picture memory 307 ... Prediction parameter memories 308 and 308a ... Prediction image generation units 309 and 309a ... Inter prediction image generation units 3091 and 3091a ... Motion compensation unit 30911 ... Motion compensation gradient unit 309122 ... Slope correction coefficient derivation unit 309112 ... Slope derivation Unit 3094 ... weight prediction unit 310 ... intra prediction image generation unit 311 ... inverse quantization / inverse conversion unit 312 ... addition unit 41 ... image display devices 11253, 11253c, 30373, 30373c matching motion deriving unit (first motion) Vector search unit, the second motion vector search unit)
303731 First motion vector search unit 303732 Second motion vector search unit

Claims (21)

  1.  1又は複数の参照画像に対して動き補償を行うことによって予測画像を生成する予測画像生成装置であって、
      第1の参照画像を参照して予測画像を生成する単予測モード、
      第1の参照画像と第2の参照画像とを参照して予測画像を生成する双予測モード、及び、
      第1の参照画像と第2の参照画像と勾配補正項とを参照して予測画像を生成するBIOモード
    の少なくとも何れかを用いて予測画像を生成する予測画像生成部を備え、
     前記予測画像生成部は、
      第1の参照画像及び第2の参照画像の少なくとも何れかにおける参照ブロックが参照画像の画面外に係る場合、前記BIOモードを用いた予測画像の生成を禁止することを特徴とする予測画像生成装置。
    A prediction image generation device that generates a prediction image by performing motion compensation on one or a plurality of reference images,
    A single prediction mode for generating a prediction image with reference to the first reference image;
    A bi-prediction mode for generating a predicted image with reference to the first reference image and the second reference image; and
    A prediction image generation unit that generates a prediction image using at least one of the BIO modes that generate a prediction image with reference to the first reference image, the second reference image, and the gradient correction term;
    The predicted image generation unit
    A prediction image generation device that prohibits generation of a prediction image using the BIO mode when a reference block in at least one of the first reference image and the second reference image is outside the screen of the reference image .
  2.  前記予測画像生成部は、
      第1の参照画像及び第2の参照画像の少なくとも何れかにおける参照ブロックが参照画像の境界から一定範囲より外に係る場合、前記BIOモードを用いた予測画像の生成を禁止することを特徴とする請求項1に記載の予測画像生成装置。
    The predicted image generation unit
    Producing a predicted image using the BIO mode is prohibited when a reference block in at least one of the first reference image and the second reference image is outside a certain range from the boundary of the reference image. The predicted image generation apparatus according to claim 1.
  3.  複数の参照画像に対して動き補償を行うことによって予測画像を生成する予測画像生成装置であって、
      第1の参照画像と第2の参照画像と勾配補正項とを参照して予測画像を生成するBIOモードを含む複数のモードを少なくとも用いて予測画像を生成する予測画像生成部を備え、
     前記予測画像生成部は、
      前記第1の参照画像及び前記第2の参照画像の少なくとも何れかにおける対応ブロックに関する読み込み領域外の画素値である読み込み領域外画素値を生成し、
      前記BIOモードを用いて予測画像を生成する場合、前記予測画像生成部による垂直方向又は水平方向に沿った読み込み領域外画素値の生成処理を禁止することを特徴とする予測画像生成装置。
    A predicted image generation device that generates a predicted image by performing motion compensation on a plurality of reference images,
    A prediction image generation unit that generates a prediction image using at least a plurality of modes including a BIO mode that generates a prediction image with reference to the first reference image, the second reference image, and the gradient correction term;
    The predicted image generation unit
    Generating a pixel value outside the reading region, which is a pixel value outside the reading region with respect to a corresponding block in at least one of the first reference image and the second reference image;
    When a predicted image is generated using the BIO mode, the predicted image generation apparatus prohibits a generation process of a pixel value outside a reading area along a vertical direction or a horizontal direction by the predicted image generation unit.
  4.  前記予測画像生成部は、前記予測画像生成部が縦長の対応ブロックと、当該縦長の対応ブロックに水平方向に隣接するブロックとに対してBIOモードを用いる場合に、前記予測画像生成部による水平方向に沿った読み込み領域外画素値の生成処理を禁止することを特徴とする請求項3に記載の予測画像生成装置。 When the predicted image generation unit uses the BIO mode with respect to a vertically corresponding block and a block adjacent to the vertically corresponding block in the horizontal direction, the predicted image generation unit uses the horizontal direction by the predicted image generation unit. The prediction image generation device according to claim 3, wherein the generation processing of the pixel value outside the reading area along the line is prohibited.
  5.  前記縦長の対応ブロック及び前記縦長の対応ブロックに水平方向に隣接するブロックのブロックサイズは、4x8画素であることを特徴とする請求項4に記載の予測画像生成装置
    The predicted image generation apparatus according to claim 4, wherein a block size of the vertically corresponding block and a block adjacent to the vertically corresponding block in the horizontal direction is 4 × 8 pixels.
  6.  前記予測画像生成部は、前記予測画像生成部が横長の対応ブロックと、当該横長の対応ブロックに垂直方向に隣接するブロックとに対してBIOモードを用いる場合に、前記予測画像生成部による垂直方向に沿った読み込み領域外画素値の生成処理を禁止することを特徴とする請求項3に記載の予測画像生成装置。 The predicted image generation unit uses the BIO mode for the horizontally corresponding block and a block adjacent to the horizontally corresponding block in the vertical direction. The prediction image generation device according to claim 3, wherein the generation processing of the pixel value outside the reading area along the line is prohibited.
  7.  前記横長の対応ブロック及び前記横長の対応ブロックに垂直方向に隣接するブロックのブロックサイズは、8x4画素であることを特徴とする請求項6に記載の予測画像生成装置。 The predicted image generation apparatus according to claim 6, wherein a block size of the horizontally corresponding block and a block adjacent to the horizontally corresponding block in the vertical direction is 8x4 pixels.
  8.  請求項1~7の何れか1項に記載の予測画像生成装置を備え、
     予測画像に対して、残差画像を加算又は減算することによって符号化対象画像を復号することを特徴とする動画像復号装置。
    A predictive image generation apparatus according to any one of claims 1 to 7,
    A moving picture decoding apparatus that decodes an encoding target picture by adding or subtracting a residual picture to a predicted picture.
  9.  請求項1~7の何れか1項に記載の予測画像生成装置を備え、
     予測画像と符号化対象画像との残差を符号化することを特徴とする動画像符号化装置。
    A predictive image generation apparatus according to any one of claims 1 to 7,
    A moving picture coding apparatus which codes a residual between a predicted picture and a picture to be coded.
  10.  対象ブロックを構成するサブブロックの各々の動きベクトルを導出する動きベクトル導出装置において、
     前記対象ブロックに含まれる複数のサブブロックの各々の動きベクトルを、当該対象ブロックと頂点を共有する参照ブロック内に設定された複数の制御点における動きベクトルを参照して算出する動きベクトル導出部を備え、
     前記動きベクトル導出部は、前記複数の制御点における各々の動きベクトルの差分の範囲を制限する
    ことを特徴とする動きベクトル導出装置。
    In the motion vector deriving device for deriving the motion vectors of the sub-blocks constituting the target block,
    A motion vector deriving unit that calculates a motion vector of each of a plurality of sub-blocks included in the target block with reference to motion vectors at a plurality of control points set in a reference block sharing a vertex with the target block; Prepared,
    The motion vector deriving unit, wherein the motion vector deriving unit limits a range of a difference between motion vectors at the plurality of control points.
  11.  前記動きベクトル導出部は、前記複数の制御点における各々の動きベクトルの差分が、予め定められた値よりも大きい場合には、当該差分が予め定められた値以下である場合よりも大きいサイズのサブブロックの動きベクトルを導出する
    ことを特徴とする請求項10に記載の動きベクトル導出装置。
    When the difference between the motion vectors at the plurality of control points is larger than a predetermined value, the motion vector deriving unit has a size larger than that when the difference is not more than a predetermined value. The motion vector deriving device according to claim 10, wherein a motion vector of a sub-block is derived.
  12.  前記動きベクトル導出部は、
      前記対象ブロックのアスペクト比に応じたアスペクト比のサブブロックの動きベクトルを導出する
    ことを特徴とする請求項請求項10又は11に記載の動きベクトル導出装置。
    The motion vector deriving unit
    The motion vector deriving device according to claim 10 or 11, wherein a motion vector of a sub-block having an aspect ratio corresponding to an aspect ratio of the target block is derived.
  13.  動画像の符号化又は復号に用いられる予測画像を生成するために参照される動きベクトルを生成する動きベクトル導出装置において、
     マッチング処理により予測ブロック毎に動きベクトルを探索する第1の動きベクトル探索部と、
     前記第1の動きベクトル探索部により選択された動きベクトルを参照して、前記予測ブロック内に含まれる複数のサブブロックの各々について、マッチング処理により動きベクトルを探索する第2の動きベクトル探索部と、
    を備え、
     前記第1の動きベクトル探索部は、予測ブロックに関する初期ベクトル探索を行ったうえで、局所的探索を行うことにより動きベクトルを探索するものであり、
     前記第2の動きベクトル探索部は、サブブロックに関する初期ベクトル探索を行ったうえで、局所的探索を行うことにより動きベクトルを探索するものであり、
     前記第1の動きベクトル探索部による局所的探索及び前記第2の動きベクトル探索部による局所的探索の少なくとも何れかにおいて、斜め方向の探索を禁止する
    ことを特徴とする動きベクトル導出装置。
    In a motion vector deriving device for generating a motion vector referred to for generating a predicted image used for encoding or decoding a moving image,
    A first motion vector search unit that searches for a motion vector for each prediction block by matching processing;
    A second motion vector search unit that searches for a motion vector by a matching process for each of a plurality of sub-blocks included in the prediction block with reference to the motion vector selected by the first motion vector search unit; ,
    With
    The first motion vector search unit searches for a motion vector by performing a local search after performing an initial vector search for a prediction block;
    The second motion vector search unit searches for a motion vector by performing a local search after performing an initial vector search for a sub-block,
    An apparatus for deriving a motion vector, wherein a search in an oblique direction is prohibited in at least one of a local search by the first motion vector search unit and a local search by the second motion vector search unit.
  14.  前記第1の動きベクトル探索部による局所的探索では、斜め方向の探索を禁止せず、前記第2の動きベクトル探索部による局所的探索では、斜め方向の探索を禁止する
    ことを特徴とする請求項13に記載の動きベクトル導出装置。
    The local search by the first motion vector search unit does not prohibit an oblique search, and the local search by the second motion vector search unit prohibits an oblique search. Item 14. The motion vector deriving device according to Item 13.
  15.  前記第1の動きベクトル探索部による局所的探索及び前記第2の動きベクトル探索部による局所的探索は、それぞれ、複数のステップラウンド処理から構成され、
     前記第1の動きベクトル探索部による局所的探索及び前記第2の動きベクトル探索部による局所的探索の少なくとも何れかにおいて、M回目(Mは自然数)までのステップラウンド処理では斜め方向の探索を禁止せず、M+1回目以降のステップラウンド処理では斜め方向の探索を禁止する
    ことを特徴とする請求項13に記載の動きベクトル導出装置。
    Each of the local search by the first motion vector search unit and the local search by the second motion vector search unit includes a plurality of step round processes,
    In at least one of the local search by the first motion vector search unit and the local search by the second motion vector search unit, a diagonal search is prohibited in the step round process up to the Mth (M is a natural number). 14. The motion vector deriving device according to claim 13, wherein a search in an oblique direction is prohibited in the M + 1th and subsequent step round processes.
  16.  前記第1の動きベクトル探索部による局所的探索及び前記第2の動きベクトル探索部による局所的探索による少なくとも何れかにおいて、
     前記第1の動きベクトル探索部及び前記第2の動きベクトル探索部の少なくとも何れかは、前記動きベクトルの探索先の候補点となる探索候補点が1画素位置である場合には、斜め方向の探索を禁止せず、
     前記第1の動きベクトル探索部及び前記第2の動きベクトル探索部の少なくとも何れかは、前記探索候補点が小数画素位置である場合には、斜め方向の探索を禁止する
    ことを特徴とする請求項13に記載の動きベクトル導出装置。
    In at least one of the local search by the first motion vector search unit and the local search by the second motion vector search unit,
    When at least one of the first motion vector search unit and the second motion vector search unit is a one-pixel position as a search candidate point to be a search destination candidate point of the motion vector, Do not ban search,
    The at least one of the first motion vector search unit and the second motion vector search unit prohibits a search in an oblique direction when the search candidate point is a decimal pixel position. Item 14. The motion vector deriving device according to Item 13.
  17.  前記第1の動きベクトル探索部による局所的探索及び前記第2の動きベクトル探索部による局所的探索による少なくとも何れかにおいて、
     前記第1の動きベクトル探索部及び第2の動きベクトル探索部の少なくとも何れかによって探索された動きベクトルが指し示す参照ブロックの少なくとも一部が参照画像の画面外に係る場合、前記動きベクトルの探索を禁止する
    ことを特徴とする請求項13に記載の動きベクトル導出装置。
    In at least one of the local search by the first motion vector search unit and the local search by the second motion vector search unit,
    When at least a part of the reference block indicated by the motion vector searched by at least one of the first motion vector search unit and the second motion vector search unit is outside the screen of the reference image, the motion vector search is performed. The motion vector deriving device according to claim 13, wherein the motion vector deriving device is prohibited.
  18.  前記第1の動きベクトル探索部及び第2の動きベクトル探索部の少なくとも何れかは、前記第1の動きベクトル探索部及び第2の動きベクトル探索部の少なくとも何れかによって探索された動きベクトルが指し示す参照ブロックの少なくとも一部が参照画像の境界から一定範囲より外に係る場合、前記動きベクトルの探索を禁止する
    ことを特徴とする請求項17に記載の動きベクトル導出装置。
    At least one of the first motion vector search unit and the second motion vector search unit is indicated by a motion vector searched by at least one of the first motion vector search unit and the second motion vector search unit. 18. The motion vector deriving device according to claim 17, wherein search of the motion vector is prohibited when at least a part of the reference block is outside a certain range from a boundary of the reference image.
  19.  請求項10~18の何れか1項に記載の動きベクトル導出装置を備え、
     前記動きベクトル導出装置によって生成された動きベクトルを参照して予測画像を生成する予測画像生成装置。
    A motion vector deriving device according to any one of claims 10 to 18,
    A predicted image generation device that generates a predicted image with reference to a motion vector generated by the motion vector deriving device.
  20.  請求項19に記載の予測画像生成装置を備え、
     前記予測画像に対して、残差画像を加算又は減算することによって符号化対象画像を復元することを特徴とする動画像復号装置。
    A prediction image generation device according to claim 19,
    A moving picture decoding apparatus, wherein a coding target picture is restored by adding or subtracting a residual picture to the predicted picture.
  21.  請求項19に記載の予測画像生成装置を備え、
     前記予測画像と符号化対象画像との残差を符号化することを特徴とする動画像符号化装置。
    A prediction image generation device according to claim 19,
    A moving picture coding apparatus, wherein a residual between the predicted picture and a picture to be coded is coded.
PCT/JP2018/022196 2017-06-14 2018-06-11 Video decoding device, video encoding device, prediction image generation device and motion vector derivation device WO2018230493A1 (en)

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
JP2017117273 2017-06-14
JP2017-117273 2017-06-14
JP2017123731 2017-06-23
JP2017-123731 2017-06-23

Publications (1)

Publication Number Publication Date
WO2018230493A1 true WO2018230493A1 (en) 2018-12-20

Family

ID=64658656

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2018/022196 WO2018230493A1 (en) 2017-06-14 2018-06-11 Video decoding device, video encoding device, prediction image generation device and motion vector derivation device

Country Status (1)

Country Link
WO (1) WO2018230493A1 (en)

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019082985A1 (en) * 2017-10-27 2019-05-02 パナソニック インテレクチュアル プロパティ コーポレーション オブ アメリカ Encoding device, decoding device, encoding method and decoding method
WO2020130020A1 (en) * 2018-12-21 2020-06-25 パナソニック インテレクチュアル プロパティ コーポレーション オブ アメリカ Encoding device, decoding device, encoding method, and decoding method
WO2020142762A1 (en) * 2019-01-06 2020-07-09 Beijing Dajia Internet Information Technology Co., Ltd. Bit-width control for bi-directional optical flow
JP2020145644A (en) * 2019-03-08 2020-09-10 株式会社Jvcケンウッド Image encoding device
WO2020181997A1 (en) * 2019-03-08 2020-09-17 Huawei Technologies Co., Ltd. An encoder, a decoder and corresponding methods for inter prediction
JP2021506178A (en) * 2017-12-08 2021-02-18 パナソニック インテレクチュアル プロパティ コーポレーション オブ アメリカPanasonic Intellectual Property Corporation of America Image coding device, image decoding device, image coding method, and image decoding method
JPWO2020045050A1 (en) * 2018-08-27 2021-08-10 パナソニック インテレクチュアル プロパティ コーポレーション オブ アメリカPanasonic Intellectual Property Corporation of America Coding device, decoding device, coding method and decoding method
CN113498607A (en) * 2019-03-13 2021-10-12 腾讯美国有限责任公司 Method and apparatus for small sub-block affine inter prediction
CN113615197A (en) * 2019-03-26 2021-11-05 北京达佳互联信息技术有限公司 Method and apparatus for bit depth control of bi-directional optical flow
JP2022506161A (en) * 2018-11-05 2022-01-17 北京字節跳動網絡技術有限公司 Interpolation for inter-prediction with refinement
EP3874756A4 (en) * 2019-03-19 2022-01-26 Tencent America LLC Method and apparatus for video coding
US20220038727A1 (en) * 2020-08-03 2022-02-03 Alibaba Group Holding Limited Systems and methods for bi-directional gradient correction
TWI840475B (en) 2018-12-21 2024-05-01 美商松下電器(美國)知識產權公司 Coding device, decoding device, coding method and decoding method

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2016195451A (en) * 2014-02-21 2016-11-17 パナソニック株式会社 Image encoding method

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2016195451A (en) * 2014-02-21 2016-11-17 パナソニック株式会社 Image encoding method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
CHEN, J. L. ET AL.: "Algorithm description of joint exploration test model 4", JVET-C1001_V3, ITU-T, 26 May 2016 (2016-05-26), pages 12 - 22, Retrieved from the Internet <URL:http://phenix.it-sudparis.eu/jvet/doc_end_user/documents/4_Chengdu/wg11/JVET-D0002-v1.zip> *

Cited By (49)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2021180494A (en) * 2017-10-27 2021-11-18 パナソニック インテレクチュアル プロパティ コーポレーション オブ アメリカPanasonic Intellectual Property Corporation of America Decoding device, decoding method, and non-temporary storage medium
WO2019082985A1 (en) * 2017-10-27 2019-05-02 パナソニック インテレクチュアル プロパティ コーポレーション オブ アメリカ Encoding device, decoding device, encoding method and decoding method
JPWO2019082985A1 (en) * 2017-10-27 2020-11-12 パナソニック インテレクチュアル プロパティ コーポレーション オブ アメリカPanasonic Intellectual Property Corporation of America Encoding device, decoding device, coding method and decoding method
US10856005B2 (en) 2017-10-27 2020-12-01 Panasonic Intellectual Property Corporation Of America Encoder, decoder, encoding method, and decoding method
US11240530B2 (en) 2017-10-27 2022-02-01 Panasonic Intellectual Property Corporation Of America Encoder, decoder, encoding method, and decoding method
JP7389282B2 (en) 2017-10-27 2023-11-29 パナソニック インテレクチュアル プロパティ コーポレーション オブ アメリカ Decoding device and decoding method
JP2022082608A (en) * 2017-12-08 2022-06-02 パナソニック インテレクチュアル プロパティ コーポレーション オブ アメリカ Encoding device and decoding device
US11601669B2 (en) 2017-12-08 2023-03-07 Panasonic Intellectual Property Corporation Of America Image encoding device, image decoding device, image encoding method, and image decoding method
JP7046186B2 (en) 2017-12-08 2022-04-01 パナソニック インテレクチュアル プロパティ コーポレーション オブ アメリカ Image coding device, image decoding device, image coding method, and image decoding method
JP2021506178A (en) * 2017-12-08 2021-02-18 パナソニック インテレクチュアル プロパティ コーポレーション オブ アメリカPanasonic Intellectual Property Corporation of America Image coding device, image decoding device, image coding method, and image decoding method
JP7286832B2 (en) 2017-12-08 2023-06-05 パナソニック インテレクチュアル プロパティ コーポレーション オブ アメリカ Encoder and decoder
US11218717B2 (en) 2017-12-08 2022-01-04 Panasonic Intellectual Property Corporation Of America Image encoding device, image decoding device, image encoding method, and image decoding method
US11785243B2 (en) 2018-08-27 2023-10-10 Panasonic Intellectual Property Corporation Of America Encoder, decoder, encoding method, and decoding method
JP7461885B2 (en) 2018-08-27 2024-04-04 パナソニック インテレクチュアル プロパティ コーポレーション オブ アメリカ Decoding device and decoding method
JPWO2020045050A1 (en) * 2018-08-27 2021-08-10 パナソニック インテレクチュアル プロパティ コーポレーション オブ アメリカPanasonic Intellectual Property Corporation of America Coding device, decoding device, coding method and decoding method
US11212549B2 (en) 2018-08-27 2021-12-28 Panasonic Intellectual Property Corporation Of America Encoder, decoder, encoding method, and decoding method
JP2022506161A (en) * 2018-11-05 2022-01-17 北京字節跳動網絡技術有限公司 Interpolation for inter-prediction with refinement
US11706421B2 (en) 2018-11-05 2023-07-18 Beijing Bytedance Network Technology Co., Ltd. Inter prediction with refinement in video processing
US11902535B2 (en) 2018-11-05 2024-02-13 Beijing Bytedance Network Technology Co., Ltd Prediction precision improvements in video coding
JP7231727B2 (en) 2018-11-05 2023-03-01 北京字節跳動網絡技術有限公司 Interpolation for inter-prediction with refinement
JPWO2020130020A1 (en) * 2018-12-21 2021-09-30 パナソニック インテレクチュアル プロパティ コーポレーション オブ アメリカPanasonic Intellectual Property Corporation of America Coding device, decoding device, coding method and decoding method
JP7189234B2 (en) 2018-12-21 2022-12-13 パナソニック インテレクチュアル プロパティ コーポレーション オブ アメリカ Encoding device and decoding device
CN113170179A (en) * 2018-12-21 2021-07-23 松下电器(美国)知识产权公司 Encoding device, decoding device, encoding method, and decoding method
US11743484B2 (en) 2018-12-21 2023-08-29 Panasonic Intellectual Property Corporation Of America Encoder, decoder, encoding method, and decoding method
TWI840475B (en) 2018-12-21 2024-05-01 美商松下電器(美國)知識產權公司 Coding device, decoding device, coding method and decoding method
WO2020130020A1 (en) * 2018-12-21 2020-06-25 パナソニック インテレクチュアル プロパティ コーポレーション オブ アメリカ Encoding device, decoding device, encoding method, and decoding method
US11425411B2 (en) 2018-12-21 2022-08-23 Panasonic Intellectual Property Corporation Of America Encoder, decoder, encoding method, and decoding method
CN113613019B (en) * 2019-01-06 2022-06-07 北京达佳互联信息技术有限公司 Video decoding method, computing device, and medium
CN113613019A (en) * 2019-01-06 2021-11-05 北京达佳互联信息技术有限公司 Bit width control of bi-directional optical flow
WO2020142762A1 (en) * 2019-01-06 2020-07-09 Beijing Dajia Internet Information Technology Co., Ltd. Bit-width control for bi-directional optical flow
CN116708772B (en) * 2019-01-06 2024-01-23 北京达佳互联信息技术有限公司 Video decoding method, computing device and medium
US11388436B2 (en) 2019-01-06 2022-07-12 Beijing Dajia Internet Information Technology Co., Ltd. Bit-width control for bi-directional optical flow
CN116708772A (en) * 2019-01-06 2023-09-05 北京达佳互联信息技术有限公司 Video decoding method, computing device and medium
US11743493B2 (en) 2019-01-06 2023-08-29 Beijing Dajia Internet Information Technology Co., Ltd. Bit-width control for bi-directional optical flow
WO2020181997A1 (en) * 2019-03-08 2020-09-17 Huawei Technologies Co., Ltd. An encoder, a decoder and corresponding methods for inter prediction
US11968387B2 (en) 2019-03-08 2024-04-23 Huawei Technologies Co., Ltd. Encoder, a decoder and corresponding methods for inter prediction using bidirectional optical flow
JP2020145644A (en) * 2019-03-08 2020-09-10 株式会社Jvcケンウッド Image encoding device
JP7215243B2 (en) 2019-03-08 2023-01-31 株式会社Jvcケンウッド image coding device
CN113498607A (en) * 2019-03-13 2021-10-12 腾讯美国有限责任公司 Method and apparatus for small sub-block affine inter prediction
CN113498607B (en) * 2019-03-13 2024-04-05 腾讯美国有限责任公司 Video encoding method, decoding method, apparatus, and readable medium
US11343525B2 (en) 2019-03-19 2022-05-24 Tencent America LLC Method and apparatus for video coding by constraining sub-block motion vectors and determining adjustment values based on constrained sub-block motion vectors
US11683518B2 (en) 2019-03-19 2023-06-20 Tencent America LLC Constraining sub-block motion vectors and determining adjustment values based on the constrained sub-block motion vectors
EP3874756A4 (en) * 2019-03-19 2022-01-26 Tencent America LLC Method and apparatus for video coding
CN113615197A (en) * 2019-03-26 2021-11-05 北京达佳互联信息技术有限公司 Method and apparatus for bit depth control of bi-directional optical flow
CN113615197B (en) * 2019-03-26 2023-03-07 北京达佳互联信息技术有限公司 Method and apparatus for bit depth control of bi-directional optical flow
US11582474B2 (en) * 2020-08-03 2023-02-14 Alibaba Group Holding Limited Systems and methods for bi-directional gradient correction
CN115699744B (en) * 2020-08-03 2024-03-26 阿里巴巴达摩院(杭州)科技有限公司 Bi-directional predictive correction system and method
US20220038727A1 (en) * 2020-08-03 2022-02-03 Alibaba Group Holding Limited Systems and methods for bi-directional gradient correction
CN115699744A (en) * 2020-08-03 2023-02-03 阿里巴巴集团控股有限公司 Bidirectional predictive correction system and method

Similar Documents

Publication Publication Date Title
WO2018230493A1 (en) Video decoding device, video encoding device, prediction image generation device and motion vector derivation device
JP7421586B2 (en) Decoding device and encoding device
JP7026049B2 (en) Affine motion vector derivation device, predictive image generator, motion image decoding device, and motion image coding device
US11722690B2 (en) Motion vector generation device, a prediction image generation device, a video decoding device and a video coding device
WO2018221368A1 (en) Moving image decoding device, and moving image encoding device
WO2018110203A1 (en) Moving image decoding apparatus and moving image encoding apparatus
WO2018116802A1 (en) Image decoding device, image coding device, and image predicting device
WO2019221072A1 (en) Image encoding device, encoded stream extraction device, and image decoding device
JP2021005741A (en) Image coding device and image decoding device
WO2017195608A1 (en) Moving image decoding device
WO2020184487A1 (en) Dynamic image decoding device
WO2020116456A1 (en) Moving image decoding device
WO2018173895A1 (en) Predicted-image generation device, video decoding device, and video coding device
WO2019139013A1 (en) Motion vector derivation device, moving image decoding device, and moving image encoding device
WO2018110180A1 (en) Motion-vector generating device, predicted-image generating device, moving-image decoding device, and moving-image coding device
JP2020043500A (en) Video encoding device and video decoding device
JP2020108012A (en) Image decoding device and image encoding device
JP2020088660A (en) Moving picture coding apparatus and moving picture decoding apparatus
JP2020145650A (en) Image decoding device and image coding device
WO2018173432A1 (en) Prediction image generation device, moving image decoding device, and moving image encoding device
JP2020096279A (en) Prediction image generation device, moving image decoding device, and moving image encoding device
WO2018061550A1 (en) Image decoding device and image coding device
JP2020036101A (en) Image decoder, and image encoder
WO2018037919A1 (en) Image decoding device, image coding device, image decoding method, and image coding method
WO2019065537A1 (en) Motion compensation filter device, image decoding device, and moving image coding device

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: 18817591

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: 18817591

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: JP