Image decoding device and image encoding device
Patent Information
- Application Number
- JP2022153695
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2022-09-27
- Publication Date
- 2025-09-30
AI Technical Summary
Template-based intra mode derivation in video encoding methods requires significant computational resources due to the need to derive multiple intra prediction mode candidates and calculate costs, leading to high complexity.
An image decoding device that includes a parameter decoding unit, a reference sample derivation unit, an intra predicted image generation unit, a cost derivation unit, and an intra prediction mode selection unit, which reduces complexity by using a variable incremented by a value larger than 1 to calculate costs and select the intra prediction mode based on a predetermined flag.
The proposed solution effectively reduces the computational complexity of template-based intra mode derivation while maintaining the accuracy of predicted images.
Smart Images

Figure 00000000_0000_ABST
Abstract
Description
[Technical field]
[0001] An embodiment of the present invention relates to an image decoding device. [Background technology]
[0002] In order to efficiently transmit or record moving images, a moving image encoding device is used that generates encoded data by encoding moving images, and a moving image decoding device is used that generates a decoded image by decoding the encoded data.
[0003] Specific examples of video coding methods include the methods proposed in H.264 / AVC and High-Efficiency Video Coding (HEVC).
[0004] In such a video coding method, images (pictures) constituting a video are managed in a hierarchical structure consisting of slices obtained by dividing images, coding tree units (CTUs) obtained by dividing slices, coding units (sometimes called coding units: CUs) obtained by dividing coding tree units, and transform units (TUs) obtained by dividing coding units, and are coded / decoded for each CU.
[0005] In such a video coding method, a predicted image is usually generated based on a locally decoded image obtained by encoding / decoding an input image, and a prediction error (sometimes called a "difference image" or "residual image") obtained by subtracting the predicted image from the input image (original image) is coded. Methods for generating a predicted image include inter-prediction and intra-prediction.
[0006] Furthermore, a recent example of a video encoding and decoding technique is Non-Patent Document 1. Non-Patent Document 1 discloses template-based intra mode derivation (TIMD) prediction in which a decoder generates a predicted image by deriving an intra direction prediction mode number using pixels in a neighboring region. [Prior art documents] [Non-patent literature]
[0007] [Non-Patent Document 1] K. Cao, N. Hu, V. Seregin, M. Karczewicz, Y. Wang, K. Zhang, L. Zhang, “EE2-related: Fusion for template-based intra mode derivation”, JVET-W0123 Summary of the Invention [Problem to be solved by the invention]
[0008] In the template-based intra mode derivation as described in Non-Patent Document 1, a template prediction image is generated from an adjacent image (template image) of the target block for an intra prediction mode candidate using an image of a template reference region near the target block. Then, an intra prediction mode candidate that reduces the cost of the template image and the template prediction image is selected as the intra prediction mode of the target block. However, there is a problem in that it is necessary to derive a template prediction image and calculate the cost for a plurality of intra prediction mode candidates, which results in a very large amount of calculation.
[0009] The present invention aims to reduce the complexity of template-based intra mode derivation while maintaining the accuracy of the predicted image. [Means for solving the problem]
[0010] The image decoding device includes a parameter decoding unit that decodes a template-based intra mode derivation flag from encoded data, a reference sample derivation unit that derives a reference sample using an image of a template reference region near a target block, an intra prediction image generation unit that generates a template prediction image for a predetermined intra prediction mode candidate using the reference sample, a cost derivation unit that derives a cost from the template prediction image and a template image that is an image near the target block, and an intra prediction mode selection unit that selects the intra prediction mode of the target block based on the cost, and is characterized in that when the template-based intra mode derivation flag is a predetermined value, a prediction image of the target block is generated using the selected intra prediction mode.
[0011] The intra-prediction image generation unit of the image decoding device is characterized in that it derives a cost using pixel values of sampling positions of the template prediction image and pixel values of sampling positions of the template image, using a variable that increments by a value greater than 1. Effect of the Invention
[0012] According to one aspect of the present invention, it is possible to reduce the complexity of template-based intra mode derivation while maintaining the accuracy of the predicted image. [Brief description of the drawings]
[0013] [Figure 1] 1 is a schematic diagram showing a configuration of an image transmission system according to an embodiment of the present invention. [Diagram 2] FIG. 2 is a diagram showing a hierarchical structure of data in an encoded stream. [Diagram 3] FIG. 13 is a schematic diagram showing types of intra-prediction modes (mode numbers). [Figure 4] FIG. 1 is a schematic diagram showing a configuration of a video decoding device. [Diagram 5] FIG. 13 is a diagram illustrating a configuration of an intra-prediction image generating unit. [Figure 6]11 is a diagram showing the relationship between a target block, a template region, and a template reference region. [Figure 7] FIG. 2 is a diagram illustrating details of a TIMD prediction unit. [Figure 8] 1 is an example of syntax for TIMD prediction. [Figure 9] FIG. 1 illustrates TIMD prediction using subsampling. [Figure 10] 13 is a flowchart showing a multi-stage intra-prediction mode search in TIMD prediction. [Figure 11] 13 is a flowchart illustrating early termination of intra-prediction mode search in TIMD prediction. [Figure 12] FIG. 1 is a block diagram showing a configuration of a video encoding device. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0014] (First embodiment) Hereinafter, an embodiment of the present invention will be described with reference to the drawings.
[0015] FIG. 1 is a schematic diagram showing the configuration of an image transmission system 1 according to this embodiment.
[0016] The image transmission system 1 is a system that transmits an encoded stream obtained by encoding an image to be encoded, decodes the transmitted encoded stream, and displays an image. The image transmission system 1 includes a video encoding device (image encoding device) 11, a network 21, a video decoding device (image decoding device) 31, and a video display device (image display device) 41.
[0017] An image T is input to the video encoding device 11 .
[0018] The network 21 transmits the encoded stream Te generated by the video encoding device 11 to the video decoding device 31. The network 21 is the Internet, a wide area network (WAN), a local area network (LAN), or a combination of these. The network 21 is not necessarily limited to a bidirectional communication network, and may be a unidirectional communication network that transmits broadcast waves such as terrestrial digital broadcasting and satellite broadcasting. The network 21 may also be replaced by a storage medium on which the encoded stream Te is recorded, such as a DVD (Digital Versatile Disc: registered trademark) or a BD (Blu-ray Disc: registered trademark).
[0019] The video decoding device 31 decodes each of the coded streams Te transmitted by the network 21, and generates one or more decoded images Td.
[0020] The video display device 41 displays all or part of one or more decoded images Td generated by the video decoding device 31. The video display device 41 includes a display device such as a liquid crystal display or an organic EL (Electro-luminescence) display. The display may be in the form of a stationary display, a mobile display, an HMD, or the like. When the video decoding device 31 has high processing power, it displays high quality images, and when it has only low processing power, it displays images that do not require high processing power or display power.
[0021] <operator> The operators used in this specification are listed below.
[0022] >> indicates a right bit shift, << indicates a left bit shift, & indicates a bitwise AND, | indicates a bitwise OR, ^ indicates a bitwise XOR, |= is the OR assignment operator, ! indicates logical negation (NOT), && indicates logical AND, and || indicates logical OR.
[0023] x?y:z is a ternary operator that takes y when x is true (non-zero) and z when x is false (0).
[0024] Clip3(a, b, c) is a function that clips c to a value between a and b (inclusive). If c < a, it returns a; if c > b, it returns b; otherwise, it returns c (assuming a <= b).
[0025] Clip1Y(c) is an operator where in Clip3(a, b, c), a is set to 0 and b is set to (1 << BitDepthY) - 1. BitDepthY is the bit depth of luminance. abs(a) is a function that returns the absolute value of a.
[0026] Int(a) is a function that returns the integer value of a.
[0027] Floor(a) is a function that returns the largest integer less than or equal to a.
[0028] Log2(a) is a function that returns the logarithm base 2 of a.
[0029] Ceil(a) is a function that returns the smallest integer greater than or equal to a.
[0030] a / d represents the division of a by d (truncating the fractional part).
[0031] Min(a, b) is a function that returns the smaller value of a and b.
[0032] <Structure of the encoded stream Te> Prior to the detailed description of the moving image encoding device 11 and the moving image decoding device 31 according to this embodiment, the data structure of the encoded stream Te generated by the moving image encoding device 11 and decoded by the moving image decoding device 31 will be described.
[0033] Fig. 2 is a diagram showing a hierarchical structure of data in an encoded stream Te. The encoded stream Te illustratively includes a sequence and a plurality of pictures constituting the sequence. Fig. 2 shows diagrams showing an encoded video sequence that defines a sequence SEQ, an encoded picture that defines a picture PICT, an encoded slice that defines a slice S, encoded slice data that defines slice data, an encoding tree unit included in the encoded slice data, and an encoding unit included in the encoding tree unit.
[0034] (Coded Video Sequence) The coded video sequence defines a set of data that the video decoding device 31 refers to in order to decode the sequence SEQ to be processed. As shown in the coded video sequence of Fig. 2, the sequence SEQ includes a video parameter set VPS (Video Parameter Set), a sequence parameter set SPS (Sequence Parameter Set), a picture parameter set PPS (Picture Parameter Set), a picture PICT, and supplemental enhancement information SEI (Supplemental Enhancement Information).
[0035] The video parameter set VPS specifies a set of coding parameters common to multiple videos composed of multiple layers, as well as a set of coding parameters related to multiple layers and each individual layer included in the video.
[0036] The sequence parameter set SPS specifies a set of coding parameters that the video decoding device 31 refers to in order to decode the target sequence. For example, the width and height of a picture are specified. Note that there may be multiple SPSs. In that case, one of the multiple SPSs is selected from the PPS.
[0037] The picture parameter set PPS specifies a set of coding parameters that the video decoding device 31 refers to in order to decode each picture in the target sequence. For example, the picture parameter set PPS includes a reference value of the quantization width (pic_init_qp_minus26) used in decoding the picture and a flag (weighted_pred_flag) indicating the application of weighted prediction. Note that there may be multiple PPSs. In that case, one of the multiple PPSs is selected for each picture in the target sequence.
[0038] (Encoded Picture) The coded picture defines a set of data to be referenced by the video decoding device 31 in order to decode the picture PICT to be processed. As shown in the coded picture of FIG. 2, the picture PICT includes slices 0 to NS-1 (NS is the total number of slices included in the picture PICT).
[0039] In the following description, when there is no need to distinguish between slices 0 to NS-1, the subscripts of the symbols may be omitted. The same applies to other data that are included in the coded stream Te and that are to be described below and that are to be given subscripts.
[0040] (Coded Slice) An encoded slice defines a set of data to be referenced by the video decoding device 31 in order to decode a slice S to be processed. As shown in the encoded slice of Fig. 2, a slice includes a slice header and slice data.
[0041] The slice header includes a group of coding parameters to be referred to by the video decoding device 31 in order to determine a decoding method for the current slice. Slice type designation information (slice_type) that designates the slice type is an example of a coding parameter included in the slice header.
[0042] Slice types that can be specified by the slice type specification information include (1) an I slice that uses only intra prediction when encoding, (2) a P slice that uses unidirectional prediction or intra prediction when encoding, and (3) a B slice that uses unidirectional prediction, bidirectional prediction, or intra prediction when encoding. Note that inter prediction is not limited to uni-prediction or bi-prediction, and a predicted image may be generated using more reference pictures. Hereinafter, when referring to P or B slice, it refers to a slice including a block that can use inter prediction.
[0043] In addition, the slice header may include a reference to the picture parameter set PPS (pic_parameter_set_id).
[0044] (Encoded slice data) The coded slice data specifies a set of data to be referenced by the video decoding device 31 in order to decode the slice data to be processed. The slice data includes a CTU, as shown in the coded slice header in Fig. 2. A CTU is a block of a fixed size (e.g., 64x64) that constitutes a slice, and is also called a Largest Coding Unit (LCU).
[0045] (coding tree unit) 2 specifies a set of data that the video decoding device 31 refers to in order to decode the CTU to be processed. The CTU is divided into coding units CU, which are basic units of the encoding process, by recursive quad tree division (QT (Quad Tree) division), binary tree division (BT (Binary Tree) division), or ternary tree division (TT (Ternary Tree) division). BT division and TT division are collectively called multi tree division (MT (Multi Tree) division). A node of a tree structure obtained by recursive quad tree division is called a coding node. Intermediate nodes of the quad tree, binary tree, and ternary tree are coding nodes, and the CTU itself is specified as the top coding node.
[0046] (Encoding Unit) As shown in the coding unit of Fig. 2, a set of data to be referenced by the video decoding device 31 in order to decode the coding unit to be processed is defined. Specifically, the CU is composed of a CU header CUH, prediction parameters, transformation parameters, quantization transformation coefficients, etc. The CU header defines a prediction mode, etc.
[0047] The prediction process may be performed in units of CUs, or in units of sub-CUs obtained by further dividing a CU. When the size of a CU and a sub-CU are equal, there is one sub-CU in the CU. When the size of a CU is larger than that of a sub-CU, the CU is divided into sub-CUs. For example, when a CU is 8x8 and a sub-CU is 4x4, the CU is divided into 2 parts horizontally and 2 parts vertically, into 4 sub-CUs.
[0048] There are two types of prediction (prediction modes): intra prediction and inter prediction. Intra prediction is a prediction within the same picture, while inter prediction refers to a prediction process performed between different pictures (for example, between display times or between layer images).
[0049] The transform and quantization processes are performed in units of CUs, but the quantized transform coefficients may be entropy coded in units of sub-blocks such as 4x4.
[0050] (Prediction parameters) The predicted image is derived from prediction parameters associated with the block, which include intra-prediction and inter-prediction parameters.
[0051] The prediction parameters of intra prediction will be described below. The intra prediction parameters are composed of a luminance prediction mode IntraPredModeY and a color difference prediction mode IntraPredModeC. FIG. 3 is a schematic diagram showing types of intra prediction modes (mode numbers). As shown in the figure, there are, for example, 67 types (0 to 66) of intra prediction modes. For example, they are planar prediction (0), DC prediction (1), and angular prediction (2 to 66). In addition, linear model (LM) prediction such as cross component linear model (CCLM) prediction and multi-mode linear model (MMLM) prediction may be used. Furthermore, an LM mode may be added for color difference.
[0052] (Configuration of a video decoding device) The configuration of a video decoding device 31 (FIG. 4) according to this embodiment will be described.
[0053] The video decoding device 31 includes an entropy decoding unit 301, a parameter decoding unit (prediction image decoding device) 302, a loop filter 305, a reference picture memory 306, a prediction parameter memory 307, a prediction image generating unit (prediction image generating device) 308, an inverse quantization and inverse transform unit 311, an adder 312, and a prediction parameter derivation unit 320. Note that, in accordance with the video encoding device 11 described below, the video decoding device 31 may also be configured not to include the loop filter 305.
[0054] The parameter decoding unit 302 further includes a header decoding unit 3020, a CT information decoding unit 3021, and a CU decoding unit 3022 (prediction mode decoding unit), and the CU decoding unit 3022 further includes a TU decoding unit 3024. These may be collectively referred to as a decoding module. The header decoding unit 3020 decodes parameter set information such as VPS, SPS, PPS, and APS, and slice header (slice information) from the encoded data. The CT information decoding unit 3021 decodes the CT from the encoded data. The CU decoding unit 3022 decodes the CU from the encoded data. The TU decoding unit 3024 decodes QP update information (quantization correction value) and quantization prediction error (residual_coding) from the encoded data when a prediction error is included in the TU.
[0055] In cases other than the skip mode (skip_mode==0), the TU decoding unit 3024 decodes the QP update information and the quantized prediction error from the encoded data. More specifically, in cases of skip_mode==0, the TU decoding unit 3024 decodes a flag cu_cbp indicating whether or not the current block includes a quantized prediction error, and decodes the quantized prediction error when cu_cbp is 1. When cu_cbp does not exist in the encoded data, it derives 0.
[0056] The predicted image generating unit 308 includes an inter predicted image generating unit 309 and an intra predicted image generating unit 310 .
[0057] The prediction parameter derivation unit 320 is configured to include an inter prediction parameter derivation unit 303 and an intra prediction parameter derivation unit 304 .
[0058] In addition, although an example in which CTU and CU are used as processing units will be described below, the present invention is not limited to this example, and processing may be performed in sub-CU units. Alternatively, CTU and CU may be read as blocks, and sub-CU as sub-blocks, and processing may be performed in block or sub-block units.
[0059] The entropy decoding unit 301 performs entropy decoding on the externally inputted coded stream Te to decode individual codes (syntax elements). Entropy coding includes a method called CABAC (Context Adaptive Binary Arithmetic Coding) that performs variable-length coding on syntax elements using a context (probability model) adaptively selected according to the type of syntax element and surrounding circumstances, and a method that performs variable-length coding on syntax elements using a predetermined table or formula. The entropy decoding unit 301 initializes all CABAC states at the beginning of a segment (tile, CTU row, slice). The entropy decoding unit 301 converts the syntax elements into a binary string (Bin String) and decodes each bit of the Bin String. When a context is used, a context index ctxInc is derived for each bit of the syntax element, the bit is decoded using the context, and the CABAC state of the used context is updated. Bits without context are decoded with equal probability (EP, bypass) and ctxInc derivation and CABAC state are omitted.
[0060] The entropy decoding unit 301 outputs the decoded code to the parameter decoding unit 302. Control of which code to decode is performed based on an instruction from the parameter decoding unit 302.
[0061] (Configuration of the intra prediction parameter derivation unit 304) The intra prediction parameter derivation unit 304 decodes intra prediction parameters, for example, an intra prediction mode IntraPredMode, with reference to prediction parameters stored in the prediction parameter memory 307, based on the code input from the entropy decoding unit 301. The intra prediction parameter derivation unit 304 outputs the decoded intra prediction parameters to the predicted image generation unit 308, and also stores them in the prediction parameter memory 307. The intra prediction parameter derivation unit 304 may derive different intra prediction modes for luminance and chrominance.
[0062] The intra prediction parameter derivation unit 304 decodes syntax elements related to intra prediction as shown in FIG.
[0063] The loop filter 305 is a filter provided in the encoding loop, which removes block distortion and ringing distortion to improve image quality. The loop filter 305 applies a filter 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 adder 312.
[0064] The reference picture memory 306 stores the decoded image of the CU generated by the adder 312 in a location that is determined in advance for each current picture and current CU.
[0065] The prediction parameter memory 307 stores prediction parameters at a predetermined position for each CTU or CU to be decoded. Specifically, the prediction parameter memory 307 stores the parameters decoded by the parameter decoding unit 302 and the prediction mode predMode separated by the entropy decoding unit 301.
[0066] The prediction image generating unit 308 receives a prediction mode predMode, prediction parameters, and the like. The prediction image generating unit 308 also reads a reference picture from the reference picture memory 306. The prediction image generating unit 308 generates a prediction image of a block or sub-block using the prediction parameters and the read reference picture (reference picture block) in the prediction mode indicated by the prediction mode predMode. Here, the reference picture block is a set of pixels on the reference picture (usually rectangular, so called a block), and is an area to be referenced for generating a prediction image.
[0067] (Intra-prediction image generation unit 310) When the prediction mode predMode indicates an intra prediction mode, the intra prediction image generation unit 310 performs intra prediction using the intra prediction parameters input from the intra prediction parameter derivation unit 304 and reference pixels read from the reference picture memory 306 .
[0068] Specifically, the intra-prediction image generation unit 310 reads adjacent blocks in a predetermined range from a target block on a target picture from the reference picture memory 306. The predetermined range refers to adjacent blocks to the left, upper left, upper, and upper right of the target block, and the area to be referenced differs depending on the intra-prediction mode.
[0069] The intra-prediction image generation unit 310 generates a prediction image of the current block by referring to the read decoded pixel values and the prediction mode indicated by IntraPredMode. The intra-prediction image generation unit 310 outputs the generated prediction image of the block to the addition unit 312.
[0070] Generation of a predicted image based on an intra prediction mode will be described below. In planar prediction, DC prediction, and angular prediction, a decoded surrounding area adjacent (close) to the prediction target block is set as a reference area R. Then, a predicted image is generated by extrapolating pixels in the reference area R in a specific direction. For example, the reference area R may be set as an L-shaped area including the left and top of the prediction target block (or further, the top left, top right, and bottom left).
[0071] (Details of predicted image generation unit) Next, the configuration of the intra-prediction image generation unit 310 will be described in detail with reference to Fig. 5. The intra-prediction image generation unit 310 includes a reference sample filter unit 3103 (second reference image setting unit), a prediction unit 3104, and a prediction image correction unit 3105 (prediction image correction unit, filter switching unit, weighting coefficient changing unit).
[0072] The prediction unit 3104 generates a prediction image (temporary predicted image, pre-corrected predicted image) of the block to be predicted based on each reference pixel (reference image) in the reference region R, a filtered reference image generated by applying a reference pixel filter (first filter), and an intra prediction mode, and outputs the prediction image to the prediction image correction unit 3105. The prediction image correction unit 3105 corrects the temporary predicted image according to the intra prediction mode, and generates and outputs a prediction image (corrected predicted image).
[0073] Below, each unit included in the intra-predicted image generation unit 310 will be described.
[0074] (Reference sample filter unit 3103) The reference sample filter unit 3103 derives reference samples recSamples[x][y] at each position (x, y) on the reference region R by referring to the reference image. Furthermore, the reference sample filter unit 3103 applies a reference pixel filter (first filter) to the reference samples recSamples[x][y] according to the intra prediction mode to update the reference samples recSamples[x][y] at each position (x, y) on the reference region R (derives filtered reference images recSamples[x][y]). Specifically, a low-pass filter is applied to the position (x, y) and the reference images therearound to derive a filtered reference image. Note that it is not necessarily necessary to apply a low-pass filter to all intra prediction modes, and a low-pass filter may be applied to some intra prediction modes. Note that the filter applied to the reference image on the reference region R in the reference sample filter unit 3103 is referred to as the "reference pixel filter (first filter)", whereas the filter that corrects the provisional predicted image in the predicted image correction unit 3105 described below is referred to as the "position-dependent filter (second filter)".
[0075] (Configuration of prediction unit 3104) The prediction unit 3104 generates a provisional prediction image (provisional prediction pixel value, pre-correction prediction image) of a prediction target block based on an intra prediction mode, a reference image, and a filtered reference pixel value, and outputs the generated image to a prediction image correction unit 3105. The prediction unit 3104 includes a planar prediction unit 31041, a DC prediction unit 31042, an angular prediction unit 31043, an LM prediction unit 31044, a MIP (Matrix-based Intra Prediction) unit 31045, and a TIMD prediction unit 31047 (Template-based Intra Mode Derivation, TIMD). The prediction unit 3104 selects a specific prediction unit according to the intra prediction mode, and inputs the reference image and the filtered reference image. The relationship between the intra prediction mode and the corresponding prediction unit is as follows. ·Planar prediction ···Planar prediction section 31041 ·DC prediction ···DC prediction section 31042 ·Angular prediction ···Angular prediction part 31043 ·LM prediction ···LM prediction section 31044 · Matrix intra prediction · MIP section 31045 TIMD prediction: TIMD prediction unit 3104
[0076] (Planar forecast) The planar prediction unit 31041 generates a provisional predicted image by linearly adding the reference samples recSamples[x][y] according to the distance between the pixel position to be predicted and the reference pixel position, and outputs the provisional predicted image to the predicted image correction unit 3105.
[0077] (DC forecast) The DC prediction unit 31042 derives a DC predicted value equivalent to the average value of the reference samples recSamples[x][y], and outputs a provisional predicted image predSamples[x][y] whose pixel values are the DC predicted values.
[0078] (Angular prediction) The angular prediction unit 31043 generates a provisional predicted image predSamples[x][y] using reference samples recSamples[x][y] in the prediction direction (reference direction) indicated by the intra prediction mode, and outputs the provisional predicted image predSamples[x][y] to the predicted image correction unit 3105. If IntraPredMode >= DIR ref[x] = recSamples[-1-refIdx+x][-1-refIdx] (x=0..bW+refIdx+1) Furthermore, for x = 0..bW-1, y = 0..bH-1, do the following: iIdx = (((y+1+refIdx) * intraPredAngle) >> 5) + refIdx iFact = ((y + 1 + refIdx) * intraPredAngle) & 31 predSamples[x][y] = Clip1(((Σ(fT[i]*ref[x+iIdx+i])) + 32) >> 6) Otherwise (IntraPredMode < DIR) ref[x] = recSamples[-1-refIdx][-1-refIdx+x] (x=0..bH+refIdx+1) Furthermore, for x = 0..bW-1, y = 0..bH-1, do the following: iIdx = (((x+1+refIdx) * intraPredAngle) >> 5) + refIdx iFact = ((x + 1 + refIdx) * intraPredAngle) & 31 predSamples[x][y] = Clip1(((Σ(fT[i]*ref[y+iIdx+i])) + 32) >> 6) DIR and refIdx are predetermined constants, for example, DIR=34, 66, etc. refIdx=0, 1, 2, etc. refIdx may be set by decoding the syntax of the encoded data in the case of normal angular prediction. Also, in the case of generating a predicted image in TIMD prediction described later, refIdx may be fixed at refIdx=0. Also, when used to generate a template predicted image, refIdx=2 or 4 may be used.
[0079] (LM forecast) The LM prediction unit 31044 predicts pixel values of chrominance based on pixel values of luminance. Specifically, this is a method of generating a predicted image of a chrominance image (Cb, Cr) using a linear model based on a decoded luminance image. One type of LM prediction is CCLM (Cross-Component Linear Model) prediction. CCLM prediction is a prediction method that uses a linear model to predict chrominance from luminance for one block.
[0080] (Matrix intra prediction) The MIP unit 31045 generates a provisional predicted image predSamples[x][y] by performing a product-sum operation on the reference samples recSamples[x][y] derived from the adjacent region and a weighting matrix, and outputs the generated image to the predicted image correction unit 3105.
[0081] (TIMD forecast) The TIMD prediction unit 31047 is a prediction method that generates a provisional predicted image using an intra prediction mode that is not explicitly signaled. The intra prediction parameter derivation unit 304 first generates a template predicted image of a template image that is an adjacent region of a target block from which an intra prediction mode candidate is derived. Next, the intra prediction parameter derivation unit 304 generates template predicted images for a plurality of intra prediction mode candidates using an image of a reference region (template reference region) near the target block. Then, the intra prediction mode candidate used to derive the template predicted image that minimizes the cost (e.g., the sum of absolute differences) between the template image and the template predicted image is selected as the intra prediction mode of the TIMD of the target block. The TIMD prediction unit 31047 generates a predicted image (provisional predicted image) using the intra prediction mode of this TIMD. Details will be described later.
[0082] (Configuration of predicted image correction unit 3105) The predicted image correction unit 3105 corrects the provisional predicted image output from the prediction unit 3104 according to the intra prediction mode. Specifically, the predicted image correction unit 3105 derives a position-dependent weighting coefficient for each pixel of the provisional predicted image according to the reference region R and the position of the target predicted pixel. Then, the predicted image correction unit 3105 performs weighted addition (weighted averaging) of the reference samples recSamples[][] and the provisional predicted image predSamples[x][y] to derive a predicted image (corrected predicted image) Pred[][] obtained by correcting the provisional predicted image. Note that in some intra prediction modes, the predicted image correction unit 3105 may set the provisional predicted image predSamples[x][y] as a predicted image without correcting it.
[0083] Example 1 FIG. 8 shows an example of the syntax of the coded data related to TIMD. The parameter decoding unit 302 decodes a flag timd_flag indicating whether or not TIMD is used for each block from the coded data. When timd_flag is 1, the parameter decoding unit 302 may not need to decode some syntax elements related to the intra prediction mode from the coded data. When timd_flag is 0, the parameter decoding unit 302 decodes intra_luma_mpm_flag. The intra_luma_mpm_flag is a flag indicating whether or not the intra prediction mode is derived from the prediction candidate list candModeList (Most Probable Mode (MPM) list). When the intra_luma_mpm_flag is 1, the intra_luma_not_planar_flag and intra_luma_mpm_idx are decoded. When the intra_luma_mpm_flag is 0, the intra_luma_mpm_reminder is decoded. The intra_not_planar_flag is a flag indicating whether or not planar prediction is performed. The intra_luma_mpm_idx is an index that specifies a prediction candidate in the MPM list candModeList[]. The intra_luma_mpm_reminder is an index that selects a prediction candidate from candidates other than the MPM list.
[0084] For example, the top left coordinates of the target block are (xC, yC), the block width is bW, and the block height is bH. The intraPredMode of block A adjacent to the left of the target block may be intraPredModeA, and the intraPredMode of block B adjacent to the top may be intraPredModeB, which may be derived as follows. Block A (hereinafter A) is a block that includes coordinates (xC-1, yC+bH-1). Block B (hereinafter B) is a block that includes coordinates (xC+bW-1, yC-1).
[0085] candModePredModeA = (A is not available || A is not MODE_INTRA) ? INTRA_PLANAR : intraPredModeA candModePredModeB = (B is not available || B is not in MODE_INTRA || B is above the upper CTU boundary of the target block) ? INTRA_PLANAR : intraPredModeB Note that being above the CTU boundary can be determined by whether yC-1 < ((yC >> CtbLog2SizeY ) << CtbLog2SizeY) is true, where CtbLog2SizeY = Log2 (CTU size). It may also be derived by decoded the syntax element sps_log2_ctu_size_minus5 in the encoded data and deriving CtbLog2SizeY = sps_log2_ctu_size_minus5 + 5. It is also possible to derive the value for candModePredModeX by setting X = A or B.
[0086] candModeList[0] = candIntraPredModeA candModeList[1] = candIntraPredModeB minAB = Min(candIntraPredModeA, candIntraPredModeB) candModeList[2] = 2 + ((minAB + 61) % 64) candModeList[3] = 2 + ((minAB - 1) % 64) candModeList[4] = 2 + ((minAB + 60) % 64) When timd_flag is 1, the TIMD prediction unit 31047 generates a template prediction image for an intra prediction mode candidate using an image of a template reference region near the current block, and selects an intra prediction mode suitable as a prediction image for the template image of the current block.
[0087] Figure 6 shows the template region RT and template reference region (template reference sample region) RTRS referenced in TIMD prediction. The template region is the region of the template image. The template reference image region is the region referenced when generating a template predicted image, which is a predicted image of the template image.
[0088] 7 shows the configuration of the TIMD prediction unit 31047 in this embodiment. The TIMD prediction unit 31047 is composed of a reference sample derivation unit 4701, a template derivation unit 4702, an intra prediction unit 4703, an intra prediction mode candidate derivation unit 4711, a template predicted image generation unit 4712, a template cost derivation unit 4713, and an intra prediction mode selection unit 4714. Note that the intra prediction mode candidate derivation unit 4711, the template predicted image generation unit 4712, and the template cost derivation unit 4713 may be collectively referred to as a template intra prediction mode derivation device 4710.
[0089] The intra prediction mode candidate derivation unit 4711 derives a list of intra prediction mode candidates timdModeList[] from the intra prediction modes of blocks adjacent to the current block. For example, the MPM list candModeList[] may be used as timdModeList.
[0090] timdModeList[i] = candModeList[i] (i=0..number of elements in candModeList-1) The template derivation unit 4702 derives a template image tempSamples of the current block. As shown in Fig. 6, the template image may be derived from a template region RT of L-shaped decoded pixels recSamples having a width of one pixel adjacent to the current block.
[0091] tempSamples[x+i][y+j] = recSamples[xC+i][yC+j] (i=-1..bW-1, j=-1), (i=-1, j=-1..bH-1) The region on recSamples used to derive tempSamples is called the template region RT, and is expressed as a set of coordinates (i, j). In other words, RT={{i=-1..bW-1, j=-1}, {i=-1, j=-1..bH-1}}. It is also possible to use the array of decoded images recSamples corresponding to the template region as the template image without using tempSamples (in this case, the region where tempSamples is located is called the template region). Alternatively, the template region may be an L-shaped set of previously decoded pixels that is two pixels wide and adjacent to the current block.
[0092] tempSamples[x+i][y+j] = recSamples[xC+i][yC+j] (i=-2..bW-1, j=-2..-1), (i=-2..-1, j=-2..bH-1) The reference sample derivation unit 4701 derives a reference sample refUnit from the template reference region RTRS. Note that the operation of the reference sample derivation unit 4701 may be performed by the reference sample filter unit 3103.
[0093] refUnit[x][y] = recSamples[xNbCmp+x][yNbComp+y] Here, xNbCmp=xC, yNbCmp=yC, and the ranges are x=-1-refIdxW, y=-1-refIdxH..refH-1 and x=-refIdxW..refW-1, y=-1-refIdxH. Here, refIdxW and refIdxH are the distances of the template reference area from the target block boundary. refIdxW = refIdxH = 2 or 4 may be used, or may be changed according to the block size.
[0094] refIdxW = refIdxH = (bW >= 8) && (bH >= 8) ? 4 : 2 Where refW = bW*2 and refH = bH*2.
[0095] Furthermore, the reference sample refUnit[x][y] may be filtered to derive the reference sample p[x][y].
[0096] The template predicted image generation unit 4712 generates a predicted image (template predicted image) of the intra prediction mode IntraPredMode from the template reference region. The operation of deriving a predicted image by the template predicted image generation unit 4712 may be performed by the prediction unit 3104. For example, the planar prediction unit 31041, the DC prediction unit 31042, and the angular prediction unit 31043 may derive both the template predicted image and the predicted image of the current block.
[0097] Specifically, for each intra mode intraPredMode included in timdModeList[i] (tIntraPredMode=timdModeList[i]), a one-dimensional reference pixel array ref[] is generated from the reference sample refUnit[x][y] or the filtered reference sample p[x][y]. Then, tIntraPredMode and ref[] are transmitted to the intra prediction unit 4703. The intra prediction unit 4703 generates a template predicted image tpredSamples[][] corresponding to tIntraPredMode, and outputs it to the template predicted image generation unit 4712.
[0098] The template predicted image generating unit 4712 generates ref[], for example, as shown in the following (equation TIMD-ANGULAR-REF): In the following, tpredSamples[][] is generated from p[][], but refUnit[][] may be used instead of p[][].
[0099] (Formula TIMD-ANGULAR-REF) If tIntraPredMode >= DIR ref[x] = p[-1-refIdx+x][-1-refIdx], (x=0..bW+refIdx+1) Otherwise (tIntraPredMode < DIR) ref[x] = p[-1-refIdx][-1-refIdx+x], (x=0..bH+refIdx+1) DIR is a predetermined constant, for example, DIR=34, 66, etc. Here, refIdx is the distance from the target block, the template region is refIdx=0 (or 1), and the template reference region that uses the image of the template region for prediction uses refIdx>0 (for example, refIdx=2, 4, etc.). Refidx may be changed depending on the block size.
[0100] refIdx = (bW >= 8) && (bH >= 8) 4 : 2 The template predicted image generation unit 4712 (intra prediction unit 4703) generates a template predicted image tpredSamples[][] corresponding to tIntraPredMode as in the following (equation TIMD-ANGULAR-PRED), for example. If tIntraPredMode >= DIR (expression TIMD-ANGULAR-PRED) iIdx = (((y + 1 + refIdx) * intraPredAngle) >> 5) + refIdx iFact = ((y + 1 + refIdx) * intraPredAngle) & 31 tpredSamples[x][y] = Clip1((Σ(filt[i] * ref[x+iIdx+i]) + 32) >> 6) Otherwise (tIntraPredMode < DIR) iIdx = (((x + 1 + refIdx) * intraPredAngle) >> 5) + refIdx iFact = ((x + 1 + refIdx) * intraPredAngle) & 31 tpredSamples[x][y] = Clip1((Σ(filt[i] * ref[y+iIdx+i]) + 32) >> 6) x=-1..bW-1,y=-1 and x=-1,y=-1..bH-1.
[0101] Here, Σ is the sum of i=0..MTAP-1, and filt is an interpolation filter coefficient for the template predicted image. The number of taps MTAP of the interpolation filter used to derive the template predicted image is, for example, 4. The intraPredAngle is an angle parameter for each intra prediction mode. filt may be derived from iFast as follows: filtG[phase][j] is the coefficient of the interpolation filter for generating the template predicted image.
[0102] filt[j] = filtG[iFact][j] The template cost derivation unit 4713 derives a cost tempCost of the intra prediction mode candidate from the difference between the template predicted image tpredSamples of each intra prediction mode candidate and the template image tempSamples of the current block. The cost may be SAD (Sum of Absolute Difference).
[0103] tempCost = Σabs(tpredSamples[i][j] - tempSamples[i][j]) (i, j) is, for example, (i=-1..bW-1, j=-1), (i=-1, j=-1..bH-1) Alternatively, the cost may be the Sum of Absolute Transformed Difference (SATD).
[0104] The intra prediction mode selection unit 4714 derives the intra prediction mode corresponding to the minimum value of tempCost as the intra prediction mode IntraPredMode of the TIMD mode.
[0105] The intra prediction unit 4703 derives an intra prediction image predSamples[][] corresponding to the IntraPredMode derived above. Then, it outputs it as an intra prediction image of the current block. Note that calculation can be omitted by storing ref[] corresponding to each intra prediction mode input from the template prediction image generation unit in ref[]. Note that it may be derived by the prediction unit 3104.
[0106] if (intraPredMode >= DIR) (expression INTRA-ANGULAR-PRED) iIdx = (((y + 1) * intraPredAngle) >> 5) iFact = ((y + 1) * intraPredAngle) & 31 predSamples[x][y] = Clip1((Σ(fT[i] * ref[x+iIdx+i]) + 32) >> 6) else / * intraPredMode < DIR* / iIdx = (((x + 1) * intraPredAngle) >> 5) iFact = ((x + 1) * intraPredAngle) & 31 predSamples[x][y] = Clip1((Σ(fT[i] * ref[y+iIdx+i]) + 32) >> 6) Here, Σ is the sum from i=0 to NTAP-1, and fT is an interpolation filter coefficient for an intra-prediction image. The number of taps NTAP of the interpolation filter used to derive the intra-prediction image is, for example, 6.
[0107] fT may be derived from iFast as follows: fG[phase][j] is the coefficient of the interpolation filter for generating the intra-predicted image. fT[j] = fG[iFact][j
[0108] (Template reference area by block size) As another configuration, the distance from the template reference region RTRS of the reference sample derivation unit 4701 and the distance from the target block of ref of the template predicted image generation unit 4712 may be changed in the horizontal direction and the vertical direction.
[0109] refIdxW = (bW >= 8) ? 4 : 2 refIdxH = (bH >= 8) ? 4 : 2 If tIntraPredMode >= DIR ref[x] = p[-1-refIdxW+x][-1-refIdxH], (x=0..bW+refIdxW+1) Otherwise (tIntraPredMode < DIR) ref[x] = p[-1-refIdxW][-1-refIdxH+x], (x=0..bH+refIdxH+1) The template predicted image generator 4712 may perform the following. If tIntraPredMode >= DIR (expression TIMD-ANGULAR-PRED) iIdx = (((y + 1 + refIdxH) * intraPredAngle) >> 5) + refIdxH iFact = ((y + 1 + refIdxH) * intraPredAngle) & 31 tpredSamples[x][y] = Clip1((Σ(filt[i] * ref[x+iIdx+i]) + 32) >> 6) Otherwise (tIntraPredMode < DIR) iIdx = (((x + 1 + refIdxW) * intraPredAngle) >> 5) + refIdxW iFact = ((x + 1 + refIdxW) * intraPredAngle) & 31 tpredSamples[x][y] = Clip1((Σ(filt[i] * ref[y+iIdx+i]) + 32) >> 6) x=-1..bW-1,y=-1 and x=-1,y=-1..bH-1.
[0110] According to the above configuration, the area referenced by the template predicted image is made variable depending on the size of the current block, which improves the accuracy of the template predicted image and enhances the accuracy of the TIMD intra predicted image.
[0111] According to the above configuration, in TIMD prediction in which a template predicted image (intra-predicted image) is repeatedly derived for a current block using a plurality of intra-prediction candidates, an effect of reducing the amount of processing for deriving a predicted image of a template image is achieved.
[0112] <Subsampling configuration> FIG. 9 is a diagram illustrating TIMD prediction using subsampling.
[0113] The template cost derivation unit 3712 may derive the cost of each intra prediction mode candidate from the difference between the pixel value of the sub-sampling position of tpredSamples and the pixel value of the same sub-sampling position of the template region of tempSamples. tpredSamples is a template prediction image, and tempSamples is a template of the current block. The template region of tempSamples may be, for example, (i=-1..bW-1, j=-1) or (i=-1, j=-1..bH-1) as shown in FIG. 9(a). The sub-sampled positions refer to discrete positions, or positions where pixels are not consecutive. The cost may be SAD (Sum of Absolute Difference).
[0114] tempCost = Σabs(tpredSamples[is][js] - tempSamples[is][js]) For example, (is, js)=(-1+2*i, -1) and (-1, -1+2*j), where i=0..bW / 2 and j=0..bH / 2.
[0115] In this case, when deriving tpredSamples[][] from ref[] shown in the formula TIMD-ANGULAR-PRED, it is sufficient to derive intra-predicted images only at the subsampled positions, so the amount of processing is reduced. The above can also be expressed as follows. Of the pixels in the template image, only the pixels (-1+2*i, -1) and (-1, -1*2j) are used in cost calculation.
[0116] tempCost = Σabs(tpredSamples[-1+2*i][-1] - tempSamples[-1+2*i][-1]) + Σabs(tpredSamples[-1][-1+2*j] - tempSamples[-1][-1+2*j]) where i=0..bW / 2 and j=0..bH / 2.
[0117] Alternatively, processing may be performed in units of four pixels as follows. Of the pixels in the template image, only the pixels (-1+4*i, -1) and (-1, -1+4*j) are used in cost calculation.
[0118] tempCost = Σabs(tpredSamples[-1+4*i][-1] - tempSamples[-1+4*i][-1]) + Σabs(tpredSamples[-1][-1+4*j] - tempSamples[-1][-1+4*j]) where i=0..bW / 4 and j=0..bH / 4. Alternatively, as shown in Fig. 9(b), multiple points in the vicinity of the target block may be used as the template region. In this case, (is, js) = (xC-2, yC) and (xC, yC-1). The subsampling rate may be changed according to the block size. If bH==4 then it is (-1,-1+2*j), otherwise (for example bH>4) it is (-1,-1+4*j), if bW==4 then it is (-1+2i,-1), otherwise (for example bW>4) it is (-1+4*i,-1).
[0119] In this way, the template predicted image generation unit 4712 may derive the cost using pixel values at sampling positions (discrete) of the template predicted image and pixel values at sampling positions (discrete) of the template image, using variables (e.g., is and js) that increment by a value greater than 1.
[0120] As described above, by deriving the cost of the template image from pixels at subsampled positions, the amount of processing can be reduced compared to the case where costs are derived for all pixels in a continuous area.
[0121] <Another configuration example 1> FIG. 10 is a flowchart showing a multi-stage intra-prediction mode search in TIMD prediction.
[0122] The TIMD prediction unit 31047 generates a template predicted image for an intra prediction mode candidate in a template predicted image generation unit 4712, derives a cost from the template predicted image and the template image in a template cost derivation unit 4713, and derives a TIMD intra prediction mode. Here, the TIMD prediction unit 31047 may set intra prediction mode candidates and select a TIMD intra prediction mode using multiple steps as follows.
[0123] (S1000) Derive timdModeList from the MPM list candModeList[].
[0124] (S1001) For intra prediction mode candidates separated from each other by a predetermined value D1 (e.g., D1=4), a template predicted image is generated and a cost is derived. For example, among tIntraPredMode=2..66, template predicted images are generated only for the directions of 5+4N (N=0..N0-1, N0=16) modes, and costs are calculated.
[0125] (S1002) A first intra prediction mode candidate is selected based on the cost in S1001. For example, only N1 intra prediction mode candidates with small costs (for example, N1=2) are selected.
[0126] (S1003) A template predicted image of a nearby prediction mode that is a predetermined value D2 (e.g., D2=2) away from the first intra prediction mode derived in S1002 is generated, and a cost is derived. For example, a template predicted image of a prediction mode ±2 is created.
[0127] (S1004) A second intra prediction mode candidate is selected based on the cost in S1003. For example, only N2 intra prediction mode candidates with small costs (for example, N2=1 or 2) are selected.
[0128] (S1005) A template prediction image of a nearby prediction mode that is a predetermined value D3 (e.g., D3=1) away from the second intra prediction mode derived in S1002 is generated to derive a cost. For example, a template prediction image of a prediction mode that is ±1 of the second intra prediction mode is created.
[0129] (S1006) The prediction direction that minimizes the cost in S1005 is derived as the TIMD intra prediction mode.
[0130] (S1007) An intra-prediction image of the TIMD intra-prediction mode derived in S1006 is generated. Overall, the smallest prediction direction (intra-prediction mode) is calculated from the N0+2*N1+2*N2 prediction directions with the smallest cost. When the total number of intra-prediction directions is NN, N0=NN / 4, N1=2, and N2=1, The total number of searches is NN / 4+6, which is about a quarter of the number required for searching all NN items.
[0131] The template predicted image generation unit 4712 generates a template predicted image from intra prediction mode candidates separated by a predetermined difference value D1, derives a cost in the cost derivation unit, and derives a first intra prediction mode. A template predicted image is generated from intra prediction mode candidates separated by a difference value D2 smaller than the predetermined difference value D1, derives a cost in the cost derivation unit, and derives a second intra prediction mode. This is characterized in that the intra prediction mode selection unit 4714 calculates costs for only a small number of intra prediction modes.
[0132] As described above, a search for the smallest cost is performed in the order of low-precision intra prediction mode candidates separated by a large difference value D1 to high-precision intra prediction mode candidates separated by small differences D2 or D3. This has the effect of reducing the amount of processing required to select an intra prediction mode, compared to the case where costs are derived for all consecutive intra prediction modes.
[0133] Here, the number of search stages is not limited to three, and is also not limited to D1 = 4, D2 = 2, and D3 = 1. The number of search stages may be two, or D1 = 2, and D2 = 1.
[0134] For example, the following configuration may be used. · Create template prediction images only for the directions of intra prediction modes with odd values (IntraPredMode = 2 * i + 1, i = 0.. 32) among IntraPredMode = 2.. 66, and calculate the cost. Create template prediction images of prediction modes ± 1 only for the N1 with the smallest cost. Since the smallest prediction direction (prediction mode) is calculated from the NN / 2+2 lowest-cost options, the number of searches can be reduced by approximately half compared to a full search. Note that even values (IntraPredMode=2*i, i=0..33) may be used instead of odd values.
[0135] <Another configuration example 2> In the calculation of the cost of a template predicted image generated from limited intra prediction mode candidates, whether to continue the process or not may be switched depending on whether there is an intra prediction mode with a lower cost than a specific intra prediction mode (early termination). In other words, whether to continue generating a template predicted image for each intra prediction mode candidate tIntraPredMode and deriving the cost may be switched. For example, a first list primary MPM list (e.g., the above candModeList) is generated that limits intra prediction mode candidates. If the primary MPM list contains an intra prediction mode candidate intraPredMode_min1 that has a cost tempCostMin1 that is smaller than the cost tempCostDC_Planar of DC and planar, a second list secondary MPM list (e.g., candModeList2) is generated. tempCostDC_Planar is the smaller cost of DC and planar. The secondary MPM list does not include intra prediction modes included in the primary MPM list. The secondary MPM list may be some of the intra prediction modes not included in the primary MPM list. Then, a template prediction image is generated for each intra prediction mode candidate included in this list, and its cost is derived. That is, if the cost tempCostMin2 of the intra prediction mode candidate intraPredMode_min2 included in the secondary MPM list is less than the smallest cost tempCostMin1 so far, the TIMD intra prediction mode is replaced with intraPredMode_min2. Otherwise (if there is no intra prediction mode candidate with a cost smaller than that of DC or planar in the primary MPM list), the secondary MPM list is not generated, and planar or DC is selected as the TIMD intra prediction mode.
[0136] FIG. 11 is a flowchart showing the operation of the template predicted image generating unit 4712 of this embodiment.
[0137] (S2000) Generate a primary MPM list.
[0138] (S2001) Derive the cost of the template prediction image for each intra prediction mode candidate in the primary MPM list.
[0139] (S2002) If tempCostMin1 < tempCostDC_Planar, transfer to (S2003). Otherwise, transfer to (S2008).
[0140] (S2003) Generate a secondary MPM list.
[0141] (S2004) Derive the cost of the template prediction image for each intra prediction mode candidate in the secondary MPM list.
[0142] (S2005) If tempCostMin2 < tempCostMin1, transfer to (S2006). Otherwise, transfer to (S2007).
[0143] (S2006) Set the TIMD intra prediction mode to intraPredMode_min2.
[0144] (S2007) Set the TIMD intra prediction mode to intraPredMode_min1.
[0145] (S2008) Set the TIMD intra prediction mode to DC or planar (set to the intra prediction mode with the cost of tempCostDC_Planar). For example, the primary MPM list is a list of DC, planar, and odd intra prediction mode candidates, and the secondary MPM list is a list of even intra prediction mode candidates other than DC and planar.
[0146] Alternatively, the primary MPM list is a list of odd intra prediction mode candidates, and the secondary MPM list is a list of even intra prediction mode candidates. In this case, since the planar is not included in the primary MPM list, the above tempCostDC_Planar is the cost of the template prediction image corresponding to DC.
[0147] Alternatively, the primary MPM list is a list of even intra prediction mode candidates, and the secondary MPM list is a list of odd intra prediction mode candidates. In this case, since the DC is not included in the primary MPM list, the above tempCostDC_Planar is the cost of the template prediction image corresponding to the planar.
[0148] As follows, in the search for a list with limited intra prediction mode candidates, a predetermined offset offset may be used to switch whether to perform subsequent processing. That is, it may be switched whether to perform the search for the intra prediction mode using the subsequent secondary MPM list (generation of the template prediction image, derivation of the cost using the same, and update of the intra prediction mode with the minimum cost). For example, if there is an intra prediction mode candidate in the primary MPM list with a cost smaller than the cost of the DC, planar + offset, the cost of the template prediction image corresponding to the intra prediction mode candidate included in the secondary MPM list is derived. That is, (S2002) in FIG. 11 is replaced with tempCostMin1 < tempCostDC_Planar + offset. Otherwise, the template prediction image corresponding to the intra prediction mode candidate included in the secondary MPM list is not generated, and the cost is not derived either.
[0149] As described above, early termination is performed using the cost of the template predicted image, limited to intra prediction mode candidates that are likely to obtain a suitable predicted image. This makes it possible to avoid template predicted image generation and cost derivation for intra prediction modes that are unlikely to obtain a suitable predicted image, thereby reducing the amount of processing required to select an intra prediction mode.
[0150] A TIMD intra prediction mode with a small cost may be derived by combining the above-mentioned rough search using intra prediction mode candidates (step search, <Another Configuration Example 1>) with a search using a list of limited intra prediction mode candidates (early termination, <Another Configuration Example 2>). Specifically, a template prediction image corresponding to only odd intra prediction modes other than DC in the MPM list is generated, and the cost is checked. The cost of intra prediction mode candidates that are ±1 to the intra prediction mode candidate intraPredMode_min1 corresponding to the minimum cost tempCostMin1 is checked. Then, the intra prediction mode candidate intraPredMode_min2 corresponding to tempCostMin1 may be derived as the TIMD intra prediction mode.
[0151] The adder 312 generates a decoded image of the block by adding, for each pixel, the predicted image of the block input from the predicted image generation unit 308 and the prediction error input from the inverse quantization and inverse transform unit 311. The adder 312 stores the decoded image of the block in the reference picture memory 306, and also outputs it to the loop filter 305.
[0152] (Configuration of a video encoding device) Next, the configuration of the video encoding device 11 according to this embodiment will be described. Fig. 12 is a block diagram showing the configuration of the video encoding device 11 according to this embodiment. The video encoding device 11 includes a prediction image generating unit 101, a subtraction unit 102, a transformation and quantization unit 103, an inverse quantization and inverse transformation unit 105, an addition unit 106, a loop filter 107, a prediction parameter memory (prediction parameter storage unit, frame memory) 108, a reference picture memory (reference image storage unit, frame memory) 109, an encoding parameter determining unit 110, a parameter encoding unit 111, a prediction parameter derivation unit 120, and an entropy encoding unit 104.
[0153] The predicted image generation unit 101 generates a predicted image for each CU, which is an area obtained by dividing each picture of the image T. The predicted image generation unit 101 includes an intra predicted image generation unit 122 and an inter predicted image generation unit 123. The predicted image generation unit 101 operates in the same manner as the predicted image generation unit 308 already described, and therefore a description thereof will be omitted.
[0154] The subtraction unit 102 generates a prediction error by subtracting the pixel values of the predicted image of the block input from the predicted image generation unit 101 from the pixel values of the image T. The subtraction unit 102 outputs the prediction error to the transformation and quantization unit 103.
[0155] The transform / quantization unit 103 calculates transform coefficients by frequency transforming the prediction errors input from the subtraction unit 102, and derives quantized transform coefficients by quantizing the prediction errors. The transform / quantization unit 103 outputs the quantized transform coefficients to the parameter coding unit 111 and the inverse quantization / inverse transform unit 105.
[0156] The inverse quantization and inverse transform unit 105 is the same as the inverse quantization and inverse transform unit 311 (FIG. 4) in the video decoding device 31, and a description thereof will be omitted. The calculated prediction error is output to the addition unit .
[0157] The parameter coding unit 111 includes a header coding unit 1110, a CT information coding unit 1111, and a CU coding unit 1112 (prediction mode coding unit). The CU coding unit 1112 further includes a TU coding unit 1114. The following describes an outline of the operation of each module.
[0158] The header encoding unit 1110 performs encoding processing of parameters such as header information, division information, prediction information, and quantized transform coefficients.
[0159] The CT information encoding unit 1111 encodes the QT, MT (BT, TT) division information and the like.
[0160] The CU encoding unit 1112 encodes the CU information, prediction information, division information, and so on.
[0161] When a prediction error is included in a TU, the TU encoding unit 1114 encodes the QP update information and the quantized prediction error.
[0162] The CT information encoding unit 1111 and the CU encoding unit 1112 supply syntax elements such as inter prediction parameters, intra prediction parameters, and quantized transform coefficients to the parameter encoding unit 111.
[0163] The entropy coding unit 104 receives the quantized transform coefficients and the coding parameters from the parameter coding unit 111. The entropy coding unit 104 entropy codes these to generate and output a coded stream Te.
[0164] The prediction parameter derivation unit 120 is a means including an inter-prediction parameter encoding unit 112 and an intra-prediction parameter encoding unit 113, and derives intra-prediction parameters and intra-prediction parameters from the parameters input from the encoding parameter determination unit 110. The derived intra-prediction parameters and intra-prediction parameters are output to the parameter encoding unit 111.
[0165] (Configuration of the intra-prediction parameter encoding unit 113) The intra prediction parameter encoding unit 113 encodes the IntraPredMode and the like input from the encoding parameter determination unit 110. The intra prediction parameter encoding unit 113 includes a part of the same configuration as the configuration in which the intra prediction parameter derivation unit 304 derives intra prediction parameters.
[0166] The adder 106 generates a decoded image by adding, for each pixel, the pixel value of the predicted block input from the predicted image generation unit 101 and the prediction error input from the inverse quantization and inverse transform unit 105. The adder 106 stores the generated decoded image in a reference picture memory 109.
[0167] The loop filter 107 performs deblocking filtering, SAO, and ALF on the decoded image generated by the adder 106. Note that the loop filter 107 does not necessarily have to include the above three types of filters, and may be configured, for example, as only a deblocking filter.
[0168] The prediction parameter memory 108 stores the prediction parameters generated by the coding parameter determination unit 110 in a predetermined location for each current picture and CU.
[0169] The reference picture memory 109 stores the decoded image generated by the loop filter 107 at a predetermined position for each current picture and CU.
[0170] The coding parameter determination unit 110 selects one set from among a plurality of sets of coding parameters. The coding parameters are the above-mentioned QT, BT or TT division information, prediction parameters, or parameters to be coded that are generated in relation to these. The predicted image generation unit 101 generates a predicted image using these coding parameters.
[0171] The coding parameter determination unit 110 calculates an RD cost value indicating the amount of information and the coding error for each of the multiple sets. The coding parameter determination unit 110 selects the set of coding parameters that minimizes the calculated cost value. As a result, the entropy coding unit 104 outputs the selected set of coding parameters as a coded stream Te. The coding parameter determination unit 110 stores the determined coding parameters in the predicted parameter memory 108.
[0172] In addition, a part of the video encoding device 11 and the video decoding device 31 in the above-mentioned embodiment, for example, the entropy decoding unit 301, the parameter decoding unit 302, the loop filter 305, the predicted image generating unit 308, the inverse quantization and inverse transform unit 311, the addition unit 312, the predicted image generating unit 101, the subtraction unit 102, the transform and quantization unit 103, the entropy encoding unit 104, the inverse quantization and inverse transform unit 105, the loop filter 107, the encoding parameter determination unit 110, and the parameter encoding unit 111 may be realized by a computer. In this case, a program for realizing this control function may be recorded in a computer-readable recording medium, and the program recorded in the recording medium may be read and executed by a computer system. In addition, the "computer system" referred to here is a computer system built into either the video encoding device 11 or the video decoding device 31, and includes hardware such as an OS and peripheral devices. In addition, the term "computer-readable recording medium" refers to portable media such as flexible disks, optical magnetic disks, ROMs, and CD-ROMs, and storage devices such as hard disks built into computer systems. Furthermore, the term "computer-readable recording medium" may also include devices that dynamically hold a program for a short period of time, such as a communication line when transmitting a program via a network such as the Internet or a communication line such as a telephone line, and devices that hold a program for a certain period of time, such as volatile memory inside a computer system that serves as a server or client in such cases. Furthermore, the above-mentioned program may be one that realizes part of the above-mentioned functions, or may be one that can realize the above-mentioned functions in combination with a program already recorded in the computer system.
[0173] In addition, a part or the whole of the video encoding device 11 and the video decoding device 31 in the above-mentioned embodiment may be realized as an integrated circuit such as an LSI (Large Scale Integration). Each functional block of the video encoding device 11 and the video decoding device 31 may be individually processed, or a part or the whole may be integrated and processed. The integrated circuit method 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 progress of semiconductor technology, an integrated circuit based on that technology may be used.
[0174] Although one embodiment of the present invention has been described in detail above with reference to the drawings, the specific configuration is not limited to the above, and various design changes, etc. are possible within the scope that does not deviate from the gist of the present invention. [Industrial Applicability]
[0175] The embodiments of the present invention can be suitably applied to a video decoding device that decodes coded data in which image data is coded, and a video coding device that generates coded data in which image data is coded, and can also be suitably applied to the data structure of coded data that is generated by a video coding device and referenced by the video decoding device. [Explanation of symbols]
[0176] 31 Image Decoding Device 301 Entropy Decoding Unit 302 Parameter Decoding Unit 303 Inter-prediction parameter derivation unit 304 Intra prediction parameter derivation unit 308 Prediction Image Generation Unit 309 Inter-prediction image generation unit 310 Intra-prediction image generation unit 31047 TIMD Forecasting Department 4701 Reference sample derivation part 4702 Template Derivation Unit 4703 Intra prediction unit 4704 Bit shift derivation part 4711 Intra prediction mode candidate derivation unit, 4712 Template Prediction Image Generation Unit 4713 Template Cost Derivation Unit 4714 Intra prediction mode selection unit 311 Inverse quantization and inverse transformation unit 312 Addition section 11 Image encoding device 101 Prediction image generation unit 102 Subtraction section 103 Transformation and Quantization Section 104 Entropy coding unit 105 Inverse quantization and inverse transformation unit 107 Loop Filter 110 Encoding parameter determination unit 111 Parameter Encoding Unit 1110 Header encoding part 1111 CT information encoder 1112 CU encoding unit (prediction mode encoding unit) 1114 TU encoder
Claims
1. a parameter decoding unit that decodes a template-based intra mode derivation flag from the encoded data; a reference sample derivation unit that derives reference samples in the current image using an image of a template reference region near a target block in the current image; an intra-prediction image generation unit that generates a template predicted image for a predetermined intra-prediction mode candidate using the reference sample; a template cost derivation unit that derives a cost from the template predicted image and a template image that is an image in the vicinity of the target block; an intra prediction mode selection unit that selects a template intra prediction mode for the current block based on the cost; generating a predicted image of the current block using the template intra prediction mode when the template-based intra mode derivation flag has a predetermined value; The template image is located in at least one region, and the at least one region includes regions that are not adjacent to each other and are located in the same direction. An image decoding device comprising:
2. 2. The image decoding device according to claim 1, wherein the template cost derivation unit derives the cost using a variable that increments by a value greater than 1, and pixel values at sampling positions of the template predicted image and the template image.
3. The intra-prediction image generation unit generating a first template predicted image from intra prediction mode candidates that are separated by a predetermined difference value D1, and deriving a cost between the first template predicted image and the template image in the template cost derivation unit to derive a first intra prediction mode; generating a second template predicted image from an intra prediction mode candidate that is separated from the first intra prediction mode by a difference value D2 that is smaller than the predetermined difference value D1, and deriving a cost between the second template predicted image and the template image in the template cost derivation unit to derive a second intra prediction mode; generating a third template predicted image from an intra prediction mode candidate that is separated from the second intra prediction mode by a difference value D3 that is smaller than the difference value D2; 2. The image decoding device according to claim 1, wherein the template cost derivation unit derives a cost between the third template predicted image and the template image, and derives a third intra prediction mode, so that the intra prediction mode selection unit selects the third intra prediction mode as the template intra prediction mode.
4. The intra-prediction image generation unit generating a plurality of template predicted images including the template predicted image from limited intra prediction mode candidates among a plurality of intra prediction mode candidates including the predetermined intra prediction mode candidate; the template cost derivation unit derives costs between the plurality of template predicted images and the template image; 2. The image decoding device according to claim 1, wherein, depending on whether or not there is another template predicted image among the plurality of template predicted images corresponding to an intra prediction mode with a lower cost than a specific intra prediction mode, it is determined whether or not to generate the another template predicted image and derive a cost for the remaining intra prediction mode candidate among the plurality of intra prediction mode candidates.
5. The positions of the regions that are not adjacent to each other and are located in the same direction are (x, y) = (-1, -1 + k * j) and (x, y) = (-1 + k * i, -1), The above i=0..bW / k, the above j=0..bH / k, where bW is the width of the target block, bH is the height of the target block, and k is the subsampling rate, which is a positive integer greater than 1.
2. The image decoding device according to claim 1.
6. The above k is 2 or 4 6. The image decoding device according to claim 5.
7. The number of positions of the regions located in the same direction that are not adjacent to each other is two.
2. The image decoding device according to claim 1.
8. The sub-sampling rate or the number of positions of the regions that are not adjacent to each other and located in the same direction is changed according to the block size of the target block.
2. The image decoding device according to claim 1.
9. A reference sample derivation unit that derives reference samples in a current image using an image of a template reference region near a target block in the current image; an intra-prediction image generation unit that generates a template predicted image for a predetermined intra-prediction mode candidate using the reference sample; a template cost derivation unit that derives a cost from the template predicted image and a template image that is an image in the vicinity of the target block; an intra-prediction mode selection unit that selects a template intra-prediction mode for the current block based on the cost; a parameter encoding unit that encodes the template intra prediction mode as a template-based intra mode derivation flag, generating a predicted image of the current block using the template intra prediction mode when the template-based intra mode derivation flag has a predetermined value; The template image is located in at least one region, and the at least one region includes regions that are not adjacent to each other and are located in the same direction. An image encoding device comprising:
10. The image encoding device described in Claim 9, characterized in that the template cost derivation unit derives the cost using a variable that increments by a value greater than 1, and the pixel value of the sampling position of the template predicted image and the pixel value of the sampling position of the template image.
11. The intra-prediction image generation unit generating a first template predicted image from intra prediction mode candidates that are separated by a predetermined difference value D1, and deriving a cost between the first template predicted image and the template image in the template cost derivation unit to derive a first intra prediction mode; generating a second template predicted image from an intra prediction mode candidate that is separated from the first intra prediction mode by a difference value D2 that is smaller than the predetermined difference value D1, and deriving a cost between the second template predicted image and the template image in the template cost derivation unit to derive a second intra prediction mode; generating a third template predicted image from an intra prediction mode candidate that is separated from the second intra prediction mode by a difference value D3 that is smaller than the difference value D2; 10. The image encoding device according to claim 9, wherein the template cost derivation unit derives a cost between the third template predicted image and the template image, and derives a third intra prediction mode, so that the intra prediction mode selection unit selects the third intra prediction mode as the template intra prediction mode.
12. The intra-prediction image generation unit generating a plurality of template predicted images including the template predicted image from limited intra prediction mode candidates among a plurality of intra prediction mode candidates including the predetermined intra prediction mode candidate; the template cost derivation unit derives costs between the plurality of template predicted images and the template image; 10. The image encoding device according to claim 9, wherein, depending on whether or not there is another template predicted image among the plurality of template predicted images corresponding to an intra prediction mode with a lower cost than a specific intra prediction mode, it is determined whether or not to generate the another template predicted image and derive a cost for the remaining intra prediction mode candidate among the plurality of intra prediction mode candidates.