Image decoding apparatus and image encoding apparatus
Patent Information
- Application Number
- JP2022153696
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2022-09-27
- Publication Date
- 2025-09-19
- Estimated Expiration
- 2042-09-27
AI Technical Summary
Template-based intra mode derivation in video encoding methods requires extensive calculations due to the derivation of multiple intra prediction mode candidates and cost calculations, leading to high computational complexity.
A parameter decoding unit decodes a template-based intra prediction flag, a reference sample deriving unit derives reference samples by shifting pixel values, and an intra prediction mode selection unit selects the mode based on these samples, reducing complexity while maintaining accuracy by limiting the bit depth and reference sample usage.
This approach reduces the computational complexity of template-based intra mode derivation while maintaining the accuracy of predicted images, improving processing efficiency.
Smart Images

Figure 00000000_0000_ABST
Abstract
Description
[Technical field]
[0001] An embodiment of the present invention relates to an image decoding device and an image encoding 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 the 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 coding scheme includes a parameter decoding unit that decodes a template-based intra prediction flag from encoded data, a reference sample derivation unit that derives a reference sample using an image of a template reference area 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 template cost derivation unit that derives a cost from the template prediction image and a template image which is an image near the target block, and an intra prediction mode selection unit that selects an intra prediction mode for the target block based on the cost, and when the prediction flag has a predetermined value, generates a prediction image for the target block using the selected intra prediction mode.
[0011] The reference sample derivation unit derives pixel values of the reference sample by right-shifting pixel values of a template reference area near the target block in accordance with a bit depth of the image, and the cost derivation unit derives pixel values of the template image by right-shifting pixel values around the target block in accordance with the bit depth of the image.
[0012] The intra-prediction image generation unit is characterized in that when generating the template prediction image, it refers to MTAP reference samples, and when generating a prediction image of the target block, it refers to NTAP reference samples, and MTAP is smaller than NTAP.
[0013] The coding unit includes a parameter coding unit which codes a template-based intra prediction flag from coded data, a reference sample derivation unit which derives a reference sample using an image of a template reference region near a target block, an intra prediction image generation unit which generates a template prediction image for a predetermined intra prediction mode candidate using the reference sample, a template cost derivation unit which derives a cost from the template prediction image and a template image which is an image near the target block, and an intra prediction mode selection unit which selects an intra prediction mode for the target block based on the cost, and when the prediction flag has a predetermined value, generates a prediction image for the target block using the selected intra prediction mode.
[0014] The reference sample derivation unit derives pixel values of the reference sample by right-shifting pixel values of a template reference area near the target block in accordance with a bit depth of the image, and the cost derivation unit derives pixel values of the template image by right-shifting pixel values around the target block in accordance with the bit depth of the image.
[0015] The intra-prediction image generation unit is characterized in that when generating the template prediction image, it refers to MTAP reference samples, and when generating a prediction image of the target block, it refers to NTAP reference samples, and MTAP is smaller than NTAP. Effect of the Invention
[0016] 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]
[0017] [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. 13 illustrates the configuration of a TIMD prediction unit that realizes the derivation of template regions and template reference regions that limit the bit depth of an image. [Figure 10] 13 is a diagram showing switching of the number of filter taps in generating a template predicted image during intra-prediction mode search for TIMD prediction. FIG. [Figure 11] FIG. 1 is a block diagram showing a configuration of a video encoding device. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0018] (First embodiment) Hereinafter, an embodiment of the present invention will be described with reference to the drawings.
[0019] FIG. 1 is a schematic diagram showing the configuration of an image transmission system 1 according to this embodiment.
[0020] 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.
[0021] An image T is input to the video encoding device 11 .
[0022] 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).
[0023] 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.
[0024] 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.
[0025] <operator> The operators used in this specification are listed below.
[0026] >> 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.
[0027] x?y:z is a ternary operator that takes y when x is true (non-zero) and z when x is false (0).
[0028] Clip3(a, b, c) is a function that clips c to a value between a and b, inclusive. That is, it returns a if c < a, b if c > b, and c otherwise (assuming a <= b).
[0029] Clip1Y(c) is an operator where Clip3(a, b, c) is set with a = 0 and b = (1 << BitDepthY) - 1. BitDepthY is the bit depth of luminance.
[0030] abs(a) is a function that returns the absolute value of a.
[0031] Int(a) is a function that returns the integer value of a.
[0032] Floor(a) is a function that returns the largest integer less than or equal to a.
[0033] Log2(a) is a function that returns the logarithm base 2 of a.
[0034] Ceil(a) is a function that returns the smallest integer greater than or equal to a.
[0035] a / d represents the division of a by d, rounded down to the nearest integer.
[0036] Min(a, b) is a function that returns the smaller of a and b.
[0037] <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.
[0038] 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.
[0039] (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).
[0040] 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.
[0041] 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.
[0042] 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.
[0043] (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).
[0044] 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.
[0045] (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.
[0046] 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.
[0047] 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.
[0048] In addition, the slice header may include a reference to the picture parameter set PPS (pic_parameter_set_id).
[0049] (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).
[0050] (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.
[0051] (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.
[0052] 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.
[0053] 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).
[0054] 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.
[0055] (Prediction parameters) The predicted image is derived from prediction parameters associated with the block, which include intra-prediction and inter-prediction parameters.
[0056] 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.
[0057] (Configuration of a video decoding device) The configuration of a video decoding device 31 (FIG. 4) according to this embodiment will be described.
[0058] 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.
[0059] The parameter decoding unit 302 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.
[0060] 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.
[0061] The predicted image generating unit 308 includes an inter predicted image generating unit 309 and an intra predicted image generating unit 310 .
[0062] 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 .
[0063] 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.
[0064] 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 the ctxInc derivation and CABAC state are omitted.
[0065] 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.
[0066] (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.
[0067] The intra prediction parameter derivation unit 304 decodes syntax elements related to intra prediction as shown in FIG.
[0068] 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.
[0069] 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.
[0070] 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.
[0071] 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.
[0072] (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 .
[0073] 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.
[0074] 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.
[0075] 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).
[0076] (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).
[0077] 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).
[0078] Below, each unit included in the intra-predicted image generation unit 310 will be described.
[0079] (Reference sample filter unit 3103) The reference sample filter unit 3103 derives a reference sample s[x][y] at each position (x, y) on the reference region R by referring to the reference image. In addition, the reference sample filter unit 3103 applies a reference pixel filter (first filter) to the reference sample s[x][y] according to the intra prediction mode to update the reference sample s[x][y] at each position (x, y) on the reference region R (derives a filtered reference image s[x][y]). Specifically, a low-pass filter is applied to the position (x, y) and the reference image 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)".
[0080] (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
[0081] (Planar forecast) The planar prediction unit 31041 linearly adds reference samples s[x][y] according to the distance between the pixel position to be predicted and the reference pixel position to generate a temporary predicted image, and outputs the temporary predicted image to the predicted image correction unit 3105. Note that s[][] may also be referred to as p[][].
[0082] (DC forecast) The DC prediction unit 31042 derives a DC predicted value equivalent to the average value of the reference samples s[x][y], and outputs a temporary predicted image q[x][y] whose pixel values are the DC predicted values.
[0083] (Angular prediction) The angular prediction unit 31043 derives a predicted image predSamples[][] (= provisional predicted image q[][]) using reference samples s[x][y] in the prediction direction (reference direction) indicated by the intra prediction mode, and outputs it to the predicted image correction unit 3105. If IntraPredMode >= DIR ref[x] = s[-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] = s[-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. In the case of normal angular prediction, the value of refIdx may be set by decoding the syntax of the encoded data. In the case of generating a predicted image for TIMD prediction described later, refIdx may be fixed at 0. In addition, in the case of deriving a template predicted image, refIdx=2 or 4 may be used.
[0084] (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.
[0085] (Matrix intra prediction) The MIP unit 31045 generates a temporary predicted image q[x][y] by performing a product-sum operation on the reference sample s[x][y] derived from the adjacent region and a weighting matrix, and outputs the generated image to the predicted image correction unit 3105.
[0086] (TIMD forecast) The TIMD prediction unit 31047 is a prediction method that generates a predicted image using an intra prediction mode that is not explicitly signaled (also called a template-based intra mode). 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.
[0087] (Configuration of predicted image correction unit 3105) The predicted image correction unit 3105 corrects the temporary 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 temporary 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 sample s[][] and the temporary predicted image q[x][y] to derive a predicted image (corrected predicted image) Pred[][] obtained by correcting the temporary predicted image. Note that in some intra prediction modes, the predicted image correction unit 3105 may set the temporary predicted image q[x][y] as a predicted image without correcting it.
[0088] Example 1 FIG. 8 shows an example of the syntax of the coded data related to TIMD. The parameter decoding unit 302 decodes the template-based intra prediction 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 parameter decoding unit 302 decodes intra_luma_mpm_reminder. The intra_not_planar_flag is a flag indicating whether or not to perform planar prediction. The intra_luma_mpm_idx is an index specifying a prediction candidate in the MPM list candModeList[]. The intra_luma_mpm_reminder is an index for selecting a prediction candidate from candidates other than the MPM list.
[0089] 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).
[0090] 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.
[0091] 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.
[0092] 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.
[0093] 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 image derivation 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.
[0094] 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.
[0095] 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.
[0096] 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.
[0097] 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.
[0098] 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.
[0099] refIdxW = refIdxH = (bW >= 8) && (bH >= 8) ? 4 : 2 Where refW = bW*2 and refH = bH*2.
[0100] Furthermore, the reference sample refUnit[x][y] may be filtered to derive the reference sample p[x][y].
[0101] 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.
[0102] 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 predicted image derivation unit 4703. The intra predicted image derivation unit 4703 generates a template predicted image tpredSamples[][] corresponding to tIntraPredMode, and outputs it to the template predicted image generation unit 4712.
[0103] The template predicted image generating unit 4712 generates ref[], for example, according to the following (equation TIMD-ANGULAR-REF). The following generates tpredSamples[][] from p[][], but refUnit[][] may be used instead of p[][].
[0104] (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.
[0105] refIdx = (bW >= 8) && (bH >= 8) 4 : 2 The template predicted image generation unit 4712 (intra predicted image derivation unit 4703) generates a template predicted image tpredSamples[][] corresponding to tIntraPredMode, for example, as in the following (equation TIMD-ANGULAR-PRED). 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.
[0106] Here, Σ is the sum of i=0..MTAP-1, and fT is the 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.
[0107] 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).
[0108] 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).
[0109] 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.
[0110] The intra-predicted image derivation unit 4703 derives the intra-predicted image predSamples[ ][ ] corresponding to the IntraPredMode derived above. Note that the intra-predicted image may also be derived by the prediction unit 3104. If IntraPredMode >= DIR ref[x] = p[-1-refIdx+x][-1-refIdx], (x=0..bW+refIdx+1) Otherwise (IntraPredMode < DIR) ref[x] = p[-1-refIdx][-1-refIdx+x], (x=0..bH+refIdx+1) 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.
[0111] 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] Alternatively, IntraPredMode may select a filter coefficient from fG and fC according to minDistVerHor, the difference between the horizontal and vertical directions, and a predetermined threshold value THRES, as follows. fT[j] = minDistVerHor > THRES : fG[iFact][j] : fC[iFact][j
[0112] (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.
[0113] 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 prediction image generating unit 4712 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 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.
[0114] (Summary of examples of changing the number of taps) 10 is a diagram showing switching of the number of filter taps when searching for an intra prediction mode in TIMD prediction and when generating an intra predicted image. The intra predicted image derivation unit 4703 is composed of an MTAPS filter 47031, an NTAPS filter 47032, and a memory 47033.
[0115] When the template predicted image generation unit 4712 derives a template predicted image, the MTAPS filter 47031 of the intra predicted image derivation unit 4703 refers to tIntraPredMode and the reference samples p[][] stored in the memory 47032, and derives a template predicted image tpredSamples[][] according to (equation TIMD-ANGULAR-PRED). tIntraPredMode is an intra prediction mode candidate input from the template predicted image generation unit 4712.
[0116] When the TIMD prediction unit 31047 derives an intra-predicted image, the NTAPS filter 47033 of the intra-predicted image derivation unit 4703 references the IntraPredMode selected by the intra-prediction mode selection unit 4714 and the reference samples p[][] stored in the memory 47032, and generates an intra-predicted image predSamples[][] according to (equation INTRA-ANGULAR-PRED). Then, predSamples[][] is output as the intra-predicted image of the current block.
[0117] As described above, when generating the template predicted image, the template predicted image generating unit 4712 (the prediction unit 3104, the intra predicted image derivation unit 4703) generates a predicted image using the sum of products of ref[i] for i=0..MTAP-1 and the filter coefficient filt. That is, it refers to MTAP reference samples p(refUnit). When generating a predicted image of a target block, the TIMD prediction unit 31047 (the prediction unit 3104, the intra predicted image derivation unit 4703) generates a predicted image using the sum of products of ref[i] for i=0..NTAP-1 and the filter coefficient fT. That is, it refers to NTAP reference samples p(refUnit). In this embodiment, the filter used to generate the template predicted image and the filter used to generate a predicted image of the target block are switched. Then, the number of taps MTAP of the filter used to generate the template predicted image may be set to be smaller than the number of taps NTAPS of the filter used to generate a predicted image of the target block. For example, it may be any of {MTAP=2, NTAP=4}, {MTAP=2, NTAP=6}, {MTAP=4, NTAP=6}, {MTAP=2, NTAP=8}, or {MTAP=4, NTAP=8}.
[0118] Also, in the generation of the template prediction image by the intra prediction image generation unit 4712, fixed filter coefficients filt[][] are used without switching the filter according to tIntraPredMode. According to the configuration in which fG[][] and fC[][] are switched according to IntraPredMode in the generation of the prediction image of the target block by the TIMD prediction unit 31047, the effect of reducing the processing load of generating the template prediction image using a fixed filter is achieved.
[0119] According to the above configuration, in the TIMD prediction in which a plurality of intra prediction candidates are used for the target block to repeatedly derive the template prediction image (intra prediction image), the effect of reducing the processing amount of deriving the prediction image of the template image is achieved.
[0120] <Summary of TIMD Prediction Configuration> A parameter decoding unit that decodes a decoder-side intra prediction flag indicating whether to generate a prediction image by the decoder deriving an intra prediction mode number using pixels in the adjacent region from the encoded data, a reference sample derivation unit 4701 that derives a reference sample using the image of the template reference region near the target block, a template intra prediction image generation unit 4712 that generates a template prediction image for a predetermined intra prediction mode candidate using the reference sample, a template cost derivation unit 4713 that derives a cost from the template prediction image and the template image that is the image near the target block of the TIMD prediction, and an intra prediction mode selection unit 4714 that selects an intra prediction mode (TIMD intra prediction mode) based on the cost. When the decoder-side intra prediction flag has a predetermined value, a prediction image of the target block is generated using the selected intra prediction mode.
[0121] <Another Configuration Example 1> 9 is a diagram showing a configuration of a TIMD predictor 31047 that realizes template-based intra mode derivation by limiting the bit depth in derivation of the template region and the template reference sample region. The TIMD predictor 31047 of this configuration example includes a bit shift derivation unit 4704 in the above-mentioned configuration.
[0122] The bit shift derivation unit 4704 derives a shift value bitShift according to the bit depth bitDepth of the image. For example, if bitDepth exceeds a predetermined bit depth TIMD_DEPTH, bitShift is set to 1 or more, and otherwise bitShift is set to 0.
[0123] bitShift = max(bitDepth-TIMD_DEPTH, 0) Here, TIMD_DEPTH is a predetermined value, for example, 10.
[0124] The template derivation unit 4702a may derive a template image of the target block according to the bit depth bitDepth of the image. For example, when the bit depth exceeds a predetermined bit depth TIMD_DEPTH, the template image tempSamples may be derived from the image recSamples of the template region by using the right shift by bitShift described above.
[0125] tempSamples[x+i][y+j] = (recSamples[xC-1+i][yC-1+j] + bitOffset) >> bitShift (i=0..bW, j=0), (i=0, j=0..bH) bitOffset = (bitShift>0) ? 1<<(bitShift-1) : 0 Note that bitOffset = (1<<bitShift)> >1 and you will get the same value.
[0126] When the bit depth of the image exceeds a predetermined bit depth TIMD_DEPTH, the reference sample derivation unit 4701a may derive a reference sample refUnit from the image of the template reference region by using the right shift by bitShift described above.
[0127] refUnit[x][y] = (recSamples[xNbCmp+x][yNbComp+y]+bitOffset)>>bitShift where xNbCmp=xC, yNbCmp=yC and the ranges are x=-1-tempWidth, y=-1-tempHeight..refH-1 and x=-tempWidth..refW-1, y=-1-tempHeight. Note that the shift calculation may be performed in the template image derivation unit (intra-prediction image unit 4703) instead of the reference sample derivation unit 4701a by changing the equation (TIMD-ANGULAR-REF) as follows. If tIntraPredMode(IntraPredMode) >= DIR ref[x] = (p[-1-refIdx+x][-1-refIdx]+bitOffet)>>bitOffset, (x=0..bW+refIdx+1) Otherwise (tIntraPredMode < DIR) ref[x] = (p[-1-refIdx][-1-refIdx+x]+bitOffet)>>bitOffset, (x=0..bH+refIdx+1) As already explained, refUnit is used to generate the template predicted image tpredSamples. When TIMD prediction is used, the bit depth (and corresponding range) of refUnit is limited in advance, which makes it easier to derive the template predicted image tpredSamples. In addition, the range of tempSamples is also limited in bit depth (and corresponding range) by the same bit shift amount bitShift, so the derivation of tempCost is also simplified because it is performed at a predetermined range.
[0128] As described above, the reference sample derivation unit 4701 derives the reference sample by right-shifting an image in a template reference region near the target block according to the bit depth of the image. The cost derivation unit may also derive the template image by right-shifting pixel values in an image near the target block according to the bit depth of the image. This allows processing at a fixed bit depth even for images with a bit depth greater than a predetermined bit depth, thereby reducing the amount of processing.
[0129] 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.
[0130] (Configuration of a video encoding device) Next, the configuration of the video encoding device 11 according to this embodiment will be described. Fig. 11 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.
[0131] 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 310. 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.
[0132] 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.
[0133] 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.
[0134] 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 .
[0135] 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.
[0136] The header encoding unit 1110 performs encoding processing of parameters such as header information, division information, prediction information, and quantized transform coefficients.
[0137] The CT information encoding unit 1111 encodes the QT, MT (BT, TT) division information and the like.
[0138] The CU encoding unit 1112 encodes the CU information, prediction information, division information, and so on.
[0139] When a prediction error is included in a TU, the TU encoding unit 1114 encodes the QP update information and the quantized prediction error.
[0140] 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.
[0141] 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.
[0142] 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.
[0143] (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.
[0144] 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.
[0145] 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.
[0146] 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.
[0147] 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.
[0148] 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.
[0149] 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.
[0150] 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.
[0151] 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.
[0152] 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]
[0153] 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]
[0154] 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 image derivation unit 47031 NTAPS Filter 47032 Memory 47033 MTAPS Filter 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 112 Inter-prediction parameter coding unit 113 Intra prediction parameter coding unit 1110 Header encoding part 1111 CT information encoder 1112 CU encoding unit (prediction mode encoding unit) 1114 TU encoding section
Claims
1. a parameter decoding unit that decodes a template-based intra prediction flag from the encoded data; a reference sample derivation unit that derives a reference sample using an image of a template reference region near a target block; a template derivation unit that derives a template image by right-shifting pixel values of pixels adjacent to the target block according to a bit depth of the image; an intra-prediction image derivation unit that derives a template prediction image by right-shifting pixel values of the template reference area near the target block according to a bit depth of the image; an intra-prediction image generation unit that generates the template predicted image for one of predetermined intra-prediction mode candidates using the reference sample; a template cost derivation unit that derives a cost from the template predicted image and the template image that is the image in the vicinity of the target block; an intra-prediction mode selection unit that selects a template-based intra-prediction mode for the current block from the predetermined intra-prediction mode candidates based on the cost; an image decoding device, characterized in that, when the template-based intra prediction flag is a predetermined value, the intra prediction image generation unit generates a prediction image of the current block using the template-based intra mode.
2. The image decoding device according to claim 1, characterized in that the intra-prediction image generation unit refers to MTAP reference samples when generating the template predicted image for one of the predetermined intra-prediction mode candidates, and refers to NTAP reference samples when generating the predicted image for the current block using a template-based intra mode selected from the predetermined intra-prediction mode candidates, and MTAP is smaller than NTAP.
3. A reference sample derivation unit that derives a reference sample using an image of a template reference region near a target block; a template derivation unit that derives a template image by right-shifting pixel values of pixels adjacent to the target block according to a bit depth of the image; an intra-prediction image derivation unit that derives a template prediction image by right-shifting pixel values of the template reference area near the target block according to a bit depth of the image; an intra-prediction image generation unit that generates the template predicted image for one of predetermined intra-prediction mode candidates using the reference sample; a template cost derivation unit that derives a cost from the template predicted image and the template image that is the image in the vicinity of the target block; an intra-prediction mode selection unit that selects a template-based intra-prediction mode for the current block from the predetermined intra-prediction mode candidates based on the cost; a parameter coding unit that codes a template-based intra prediction flag from the template-based intra mode, an intra-prediction image generating unit that generates a predicted image of the current block using the template-based intra-prediction mode when the template-based intra-prediction flag is a predetermined value;
4. The image encoding device according to claim 3, characterized in that the intra-prediction image generation unit refers to MTAP reference samples when generating the template predicted image for one of the predetermined intra-prediction mode candidates, and refers to NTAP reference samples when generating the predicted image for the current block using a template-based intra mode selected from the predetermined intra-prediction mode candidates, wherein MTAP is smaller than NTAP.