A video encoding / decoding method and device

By extracting flags from the bitstream and determining candidate groups of intra prediction modes, the problem of intra prediction mode in the prior art is solved, and more efficient encoding and decoding is achieved, and image transmission and storage costs are reduced.

CN113170117BActive Publication Date: 2024-11-26KONINKLIJKE PHILIPS NV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN201980076799.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2018-12-17
Filing Date
2019-12-11
Publication Date
2024-11-26
Estimated Expiration
2039-12-11

AI Technical Summary

Technical Problem

Prior art In high resolution and high quality image encoding/decoding, the intra prediction mode is less efficient, resulting in increased transmission and storage costs.

Method used

By extracting flags from the bitstream, a candidate group of intra prediction mode is determined, and intra prediction is performed based on the derived mode and reference area, multiple candidate groups are selectively used to improve encoding/decoding efficiency and reduce the number of non-MPMs Or change its layout.

Benefits of technology

Improve the encoding/decoding efficiency of intra prediction mode and reduce transmission and storage costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113170117B_ABST
    Figure CN113170117B_ABST
Patent Text Reader

Abstract

The video encoding / decoding apparatus according to the present invention may determine an intra prediction mode of a current block based on a most probable mode (MPM) of the current block or an intra prediction mode of a neighboring block, determine a reference area for intra prediction of the current block, and perform intra prediction on the current block by using the intra prediction mode and the reference area.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to a method and apparatus for encoding / decoding a video signal. Background Art

[0002] In various application fields, the demand for high-resolution and high-quality images has increased. As image data becomes high-resolution and high-quality, the amount of data increases relatively compared to existing image data, so when the image data is transmitted by using a medium (such as an existing wired and wireless broadband circuit) or stored by using an existing storage medium, the transmission cost and storage cost increase. These problems generated as image data becomes high-resolution and high-quality can be solved by using efficient image compression technology. Summary of the invention

[0003] Technical issues

[0004] The present disclosure aims to improve the encoding / decoding efficiency of intra prediction.

[0005] The present disclosure aims to improve the encoding / decoding efficiency of intra prediction mode.

[0006] Technical Solution

[0007] According to the video signal decoding method and device disclosed in the present invention, a flag can be obtained from a bit stream, a candidate group of intra-frame prediction modes for a current block can be determined based on the flag, the intra-frame prediction mode of the current block can be derived based on the determined candidate group, and intra-frame prediction can be performed on the current block based on the derived intra-frame prediction mode and a predetermined reference area.

[0008] In the video signal decoding method and apparatus according to the present disclosure, the flag may indicate a predetermined candidate group for deriving an intra prediction mode of the current block.

[0009] In the video signal decoding method and apparatus according to the present disclosure, the candidate group may be determined as a first candidate group or a second candidate group, the first candidate group may be configured with a default mode, and the second candidate group may be configured by using an intra-frame prediction mode of a neighboring block adjacent to the current block.

[0010] In the video signal decoding method and apparatus according to the present disclosure, the default mode may include at least one of a DC mode or a planar mode.

[0011] In the video signal decoding method and device according to the present disclosure, at least one candidate mode belonging to the second candidate group can be derived by adding the intra-frame prediction mode of the neighboring block to a value n or subtracting the value n from the intra-frame prediction mode of the neighboring block, and n can be a natural number greater than or equal to 2.

[0012] In the video signal decoding method and apparatus according to the present disclosure, the number of candidate modes belonging to the second candidate group may be m, and m may be a natural number (such as 1, 2, 3, 4, 5, 6 or more).

[0013] In the video signal decoding method and apparatus according to the present disclosure, the second candidate group may not include the default mode included in the first candidate group.

[0014] According to the video signal encoding method and apparatus of the present disclosure, an intra-frame prediction mode of a current block can be determined, a flag indicating a candidate group to which the intra-frame prediction mode of the current block belongs is encoded, and intra-frame prediction is performed on the current block based on the intra-frame prediction mode of the current block and a predetermined reference area.

[0015] In the video signal encoding method and apparatus according to the present disclosure, the candidate group may include at least one of a first candidate group or a second candidate group, the first candidate group may be configured with a default mode, and the second candidate group may be configured by using an intra-frame prediction mode of a neighboring block adjacent to the current block.

[0016] In the video signal encoding method and apparatus according to the present disclosure, the default mode may include at least one of a DC mode or a planar mode.

[0017] In the video signal encoding method and device according to the present disclosure, at least one candidate mode belonging to the second candidate group can be derived by adding the intra-frame prediction mode of the neighboring block to a value n or subtracting the value n from the intra-frame prediction mode of the neighboring block, and n can be a natural number greater than or equal to 2.

[0018] In the video signal encoding method and apparatus according to the present disclosure, the number of candidate modes belonging to the second candidate group may be m, and m may be a natural number (such as 1, 2, 3, 4, 5, 6 or more).

[0019] In the video signal encoding method and apparatus according to the present disclosure, the second candidate group may not include the default mode included in the first candidate group.

[0020] According to the present disclosure, a computer-readable recording medium may include: a data stream, including encoding information encoded by intra-frame prediction of a current block, wherein the encoding information may include a flag indicating a candidate group for deriving an intra-frame prediction mode of the current block, and the candidate group for the intra-frame prediction mode of the current block may be determined as any one of a first candidate group or a second candidate group based on the flag.

[0021] In the computer-readable recording medium according to the present disclosure, the first candidate group may be configured with a default mode, and the second candidate group may be configured by using an intra prediction mode of a neighboring block adjacent to a current block.

[0022] In the computer-readable recording medium according to the present disclosure, the default mode may include at least one of a DC mode or a planar mode.

[0023] In a computer-readable recording medium according to the present disclosure, at least one candidate mode belonging to the second candidate group can be derived by adding the intra-frame prediction mode of the neighboring block to a value n or subtracting the value n from the intra-frame prediction mode of the neighboring block, and n can be a natural number greater than or equal to 2.

[0024] In the computer-readable recording medium according to the present disclosure, the number of candidate patterns belonging to the second candidate group may be m, and m may be a natural number (such as 1, 2, 3, 4, 5, 6 or more).

[0025] In the computer-readable recording medium according to the present disclosure, the second candidate group may not include the default mode included in the first candidate group.

[0026] Beneficial Effects

[0027] According to the present disclosure, the encoding / decoding efficiency of the intra prediction mode can be improved by selectively using any one of a plurality of candidate groups.

[0028] In addition, according to the present disclosure, the encoding / decoding efficiency of the intra prediction mode can be improved by reducing the number of non-MPMs or changing the arrangement of non-MPMs.

[0029] In addition, according to the present disclosure, encoding / decoding efficiency of intra prediction can be improved by determining a predetermined reference area for intra prediction. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] Figure 1 A rough block diagram of an encoding device as an embodiment of the present disclosure is shown.

[0031] Figure 2 A rough block diagram of a decoding device as an embodiment of the present disclosure is shown.

[0032] Figure 3 An intra prediction method is shown as an embodiment to which the present disclosure is applied.

[0033] Figure 4 and Figure 5 A method of determining a second candidate group is shown as an embodiment to which the present disclosure is applied.

[0034] Figure 6A method for encoding / decoding remaining mode information based on removing a second candidate group as an embodiment to which the present disclosure is applied is provided.

[0035] Figure 7 A method for encoding / decoding remaining mode information based on re-arranging a second candidate group as an embodiment to which the present disclosure is applied is provided.

[0036] Best Mode

[0037] According to the video signal decoding method and device disclosed in the present invention, a flag can be obtained from a bit stream, a candidate group of intra-frame prediction modes of a current block can be determined based on the flag, the intra-frame prediction mode of the current block can be derived based on the determined candidate group, and intra-frame prediction can be performed on the current block based on the derived intra-frame prediction mode and a predetermined reference area.

[0038] In the video signal decoding method and apparatus according to the present disclosure, the flag may indicate a predetermined candidate group for deriving an intra prediction mode of the current block.

[0039] In the video signal decoding method and apparatus according to the present disclosure, the candidate group may be determined as a first candidate group or a second candidate group, the first candidate group may be configured with a default mode, and the second candidate group may be configured by using an intra-frame prediction mode of a neighboring block adjacent to the current block.

[0040] In the video signal decoding method and apparatus according to the present disclosure, the default mode may include at least one of a DC mode or a planar mode.

[0041] In the video signal decoding method and device according to the present disclosure, at least one candidate mode belonging to the second candidate group can be derived by adding the intra-frame prediction mode of the neighboring block to a value n or subtracting the value n from the intra-frame prediction mode of the neighboring block, and n can be a natural number greater than or equal to 2.

[0042] In the video signal decoding method and apparatus according to the present disclosure, the number of candidate modes belonging to the second candidate group may be m, and m may be a natural number (such as 1, 2, 3, 4, 5, 6 or more).

[0043] In the video signal decoding method and apparatus according to the present disclosure, the second candidate group may not include the default mode included in the first candidate group.

[0044] According to the video signal encoding method and apparatus of the present disclosure, an intra-frame prediction mode of a current block can be determined, a flag indicating a candidate group to which the intra-frame prediction mode of the current block belongs is encoded, and intra-frame prediction is performed on the current block based on the intra-frame prediction mode of the current block and a predetermined reference area.

[0045] In the video signal encoding method and apparatus according to the present disclosure, the candidate group may include at least one of a first candidate group or a second candidate group, the first candidate group may be configured with a default mode, and the second candidate group may be configured by using an intra-frame prediction mode of a neighboring block adjacent to the current block.

[0046] In the video signal encoding method and apparatus according to the present disclosure, the default mode may include at least one of a DC mode or a planar mode.

[0047] In the video signal encoding method and device according to the present disclosure, at least one candidate mode belonging to the second candidate group can be derived by adding the intra-frame prediction mode of the neighboring block to a value n or subtracting the value n from the intra-frame prediction mode of the neighboring block, and n can be a natural number greater than or equal to 2.

[0048] In the video signal encoding method and apparatus according to the present disclosure, the number of candidate modes belonging to the second candidate group may be m, and m may be a natural number (such as 1, 2, 3, 4, 5, 6 or more).

[0049] In the video signal encoding method and apparatus according to the present disclosure, the second candidate group may not include the default mode included in the first candidate group.

[0050] According to the present disclosure, a computer-readable recording medium may include: a data stream, including encoding information encoded by intra-frame prediction of a current block, wherein the encoding information may include a flag indicating a candidate group for deriving an intra-frame prediction mode of the current block, and the candidate group for the intra-frame prediction mode of the current block may be determined as any one of a first candidate group or a second candidate group based on the flag.

[0051] In the computer-readable recording medium according to the present disclosure, the first candidate group may be configured with a default mode, and the second candidate group may be configured by using an intra prediction mode of a neighboring block adjacent to a current block.

[0052] In the computer-readable recording medium according to the present disclosure, the default mode may include at least one of a DC mode or a planar mode.

[0053] In a computer-readable recording medium according to the present disclosure, at least one candidate mode belonging to the second candidate group can be derived by adding the intra-frame prediction mode of the neighboring block to a value n or subtracting the value n from the intra-frame prediction mode of the neighboring block, and n can be a natural number greater than or equal to 2.

[0054] In the computer-readable recording medium according to the present disclosure, the number of candidate patterns belonging to the second candidate group may be m, and m may be a natural number (such as 1, 2, 3, 4, 5, 6 or more).

[0055] In the computer-readable recording medium according to the present disclosure, the second candidate group may not include the default mode included in the first candidate group. DETAILED DESCRIPTION

[0056] Since the present disclosure can be variously changed and has several embodiments, specific embodiments will be shown in the drawings and described in detail. However, it is not intended to limit the present disclosure to specific embodiments, and it should be understood that it includes all changes, equivalents or substitutions included in the concept and technical scope of the present disclosure. When explaining each of the drawings, similar reference numerals are used for similar components.

[0057] Terms such as first, second, etc. can be used to describe various components, but these components should not be limited by these terms. These terms are only used to distinguish one component from other components. For example, without exceeding the scope of the present disclosure, a first component can be referred to as a second component, and similarly, a second component can also be referred to as a first component. The term "and / or" includes a combination of multiple related input items or any item in the multiple related input items.

[0058] When a component is referred to as being "linked" or "connected" to another component, it should be understood that it can be directly linked or connected to another component, but other components may exist in between. On the other hand, when a component is referred to as being "directly linked" or "directly connected" to another component, it should be understood that other components do not exist in between.

[0059] Since the terms used in this application are only used to describe specific embodiments, they are not intended to limit the present disclosure. Unless the representation of the singular and the representation of the plural clearly have different meanings in the context, the representation of the singular includes the representation of the plural. In this application, it should be understood that terms (such as "including" or "having", etc.) refer to the presence of features, numbers, stages, movements, components, parts or combinations thereof entered in the specification, but do not exclude the presence or possibility of adding one or more other features, numbers, stages, movements, components, parts or combinations thereof in advance.

[0060] Hereinafter, with reference to the accompanying drawings, a desired embodiment of the present disclosure will be described in more detail. Hereinafter, the same reference numerals are used for the same components in the accompanying drawings, and repeated description of the same components is omitted.

[0061] Figure 1 A rough block diagram of an encoding device as an embodiment of the present disclosure is shown.

[0062] Reference Figure 1 The encoding device may include a picture partition unit 110, prediction units 120, 125, a transform unit 130, a quantization unit 135, a rearrangement unit 160, an entropy encoding unit 165, a dequantization unit 140, an inverse transform unit 145, a filter unit 150 and a memory 155.

[0063] because Figure 1 Each construction unit shown in is independently shown to represent a different characteristic function in the video encoding device, which may mean that each construction unit is configured with separate hardware. However, since each construction unit is included by enumerating each construction unit for the convenience of description, at least two construction units in each construction unit can be combined to construct one construction unit, or one construction unit can be divided into multiple construction units to perform functions, and such integrated embodiments and separate embodiments of each construction unit are also included in the scope of the rights of the present disclosure, as long as they do not exceed the essence of the present disclosure.

[0064] In addition, some components may be only selective components for improving performance, rather than basic components for performing basic functions in the present disclosure. The present disclosure may be implemented by including only structural units required for embodying the essence of the present disclosure except for components only for improving performance, and a structure including only basic components except for selective components only for improving performance is also included in the scope of rights of the present disclosure.

[0065] The picture partition unit 110 may partition the input picture into at least one block. In this case, the block may represent a coding unit (CU), a prediction unit (PU), or a transform unit (TU). The coding unit (CU) may be set to be the same as the prediction unit (PU) and / or the transform unit (TU). Optionally, a coding unit (CU) may be partitioned into multiple prediction units (PUs) or transform units (TUs). A prediction unit (PU) may be partitioned into / configured with multiple transform units (TUs). Conversely, a transform unit (TU) may be partitioned into / configured with multiple prediction units (PUs).

[0066] Partitioning may be performed based on at least one of a quadtree, a binary tree, or a ternary tree. A quadtree is a method of partitioning a higher layer block into 4 lower layer blocks whose width and height are half of the higher layer block. A binary tree is a method of partitioning a higher layer block into 2 lower layer blocks whose width or height is half of the higher layer block. In a binary tree, through the above-mentioned binary tree-based partitioning, a block may have a non-square shape as well as a square shape.

[0067] Hereinafter, in an embodiment of the present disclosure, a coding unit may be used as a unit that performs coding, or may be used as a unit that performs decoding.

[0068] The prediction units 120 and 125 may include an inter-frame prediction unit 120 that performs inter-frame prediction and an intra-frame prediction unit 125 that performs intra-frame prediction. It may be determined whether inter-frame prediction or intra-frame prediction is performed on the prediction unit, and specific information (e.g., intra-frame prediction mode, motion vector, reference picture, etc.) according to each prediction method may be determined. In this case, the processing unit that performs the prediction may be different from the processing unit that determines the prediction method and specific content. For example, the prediction method, prediction mode, etc. may be determined in the prediction unit, and the prediction may be performed in the transform unit. The residual value (residual block) between the generated prediction block and the original block may be input into the transform unit 130. In addition, the prediction mode information, motion vector information, etc. used for prediction may be encoded in the entropy encoding unit 165 together with the residual value and sent to the decoding device. When a specific encoding mode is used, the original block may be encoded as it is without generating a prediction block through the prediction units 120 and 125 and sent to the decoding unit.

[0069] The inter-frame prediction unit 120 may predict the prediction unit based on information of at least one of the previous or subsequent pictures of the current picture, or in some cases, may predict the prediction unit based on information of some regions that have been encoded in the current picture. The inter-frame prediction unit 120 may include a reference picture interpolation unit, a motion prediction unit, and a motion compensation unit.

[0070] In the reference picture interpolation unit, the reference picture information may be provided from the memory 155, and pixel information equal to or less than an integer pixel may be generated in the reference picture. In the case of luma pixels, an 8-tap interpolation filter based on DCT with different filter coefficients may be used to generate pixel information equal to or less than an integer pixel in a 1 / 4 pixel unit. In the case of chroma pixels, a 4-tap interpolation filter based on DCT with different filter coefficients may be used to generate pixel information equal to or less than an integer pixel in a 1 / 8 pixel unit.

[0071] The motion prediction unit may perform motion prediction based on the reference picture interpolated by the reference picture interpolation unit. Various methods such as FBMA (block matching algorithm based on complete search), TSS (three-step search), NTS (new three-step search algorithm) may be used as a method for calculating a motion vector. The motion vector may have a motion vector value based on a 1 / 2 or 1 / 4 pixel unit of the interpolated pixel. In the motion prediction unit, the current prediction unit may be predicted by making the motion prediction method different. Various methods such as a skip method, a merge method, an AMVP (Advanced Motion Vector Prediction) method, etc. may be used as a motion prediction method.

[0072] The intra prediction unit 125 may generate a prediction unit based on reference pixel information around the current block as pixel information in the current picture. When the peripheral block of the current prediction unit is a block where inter prediction is performed and the reference pixel is a pixel where inter prediction is performed, the reference pixel information of the peripheral block where intra prediction is performed may be used to replace the reference pixel included in the block where inter prediction is performed. In other words, when the reference pixel is unavailable, at least one reference pixel among the available reference pixels may be used to replace the unavailable reference pixel information.

[0073] In intra prediction, the prediction mode may have a directional prediction mode using reference pixel information according to a prediction direction and a non-directional mode not using directional information when performing prediction. The mode for predicting luminance information may be different from the mode for predicting chrominance information, and the chrominance information may be predicted using the intra prediction mode information for predicting luminance information or the predicted luminance signal information.

[0074] The intra prediction method may generate a prediction block after applying an AIS (Adaptive Intra Smoothing) filter to reference pixels according to a prediction mode. The type of the AIS filter applied to the reference pixels may be different. The intra prediction mode of the current prediction unit may be predicted from the intra prediction modes of the prediction units surrounding the current prediction unit to perform the intra prediction method. When the prediction mode of the current prediction unit is predicted by using the mode information predicted from the peripheral prediction unit, if the intra prediction mode of the current prediction unit is the same as the intra prediction mode of the peripheral prediction unit, the information that the prediction mode of the current prediction unit is the same as the prediction mode of the peripheral prediction unit may be sent by using predetermined flag information. If the prediction mode of the current prediction unit is different from the prediction mode of the peripheral prediction unit, the prediction mode information of the current block may be encoded by performing entropy coding.

[0075] In addition, a residual block including residual value information based on a difference value between a prediction unit predicted by the prediction unit generated in the prediction units 120 and 125 and an original block of the prediction unit may be generated. The generated residual block may be input to the transform unit 130.

[0076] The transform unit 130 may transform the residual block including the residual data by using a transform type such as DCT, DST, etc. In this case, a transform method may be determined based on an intra prediction mode of a prediction unit used to generate the residual block.

[0077] The quantization unit 135 may perform quantization on the value transformed to the frequency domain in the transform unit 130. The quantization coefficient may be changed according to the block or according to the image importance. The value calculated in the quantization unit 135 may be provided to the inverse quantization unit 140 and the rearrangement unit 160.

[0078] The rearrangement unit 160 may perform rearrangement on coefficient values ​​of the quantized residual value.

[0079] The rearrangement unit 160 can change the coefficients of the two-dimensional block shape into a one-dimensional vector shape by a coefficient scanning method. For example, in the rearrangement unit 160, the DC coefficient can be scanned to the coefficients in the high frequency domain by using a predetermined scanning type, and the DC coefficient can be changed into a one-dimensional vector shape.

[0080] The entropy encoding unit 165 may perform entropy encoding based on the value calculated by the rearrangement unit 160. For example, the entropy encoding may use various encoding methods such as Exponential Golomb, CAVLC (Context Adaptive Variable Length Coding), CABAC (Context Adaptive Binary Arithmetic Coding).

[0081] The entropy coding unit 165 may encode various information from the rearrangement unit 160 and the prediction units 120 and 125 (such as residual value coefficient information and block type information of the coding unit, prediction mode information, partition unit information, prediction unit information and transmission unit information, motion vector information, reference frame information, interpolation information of the block, filtering information, etc.).

[0082] In the entropy encoding unit 165 , the coefficient values ​​of the coding unit input in the rearrangement unit 160 may be entropy encoded.

[0083] In the inverse quantization unit 140 and the inverse transform unit 145, the value quantized in the quantization unit 135 is inversely quantized, and the value transformed in the transform unit 130 is inversely transformed. A reconstructed block may be generated by combining the residual values ​​generated in the inverse quantization unit 140 and the inverse transform unit 145 with a prediction unit predicted by a motion prediction unit, a motion compensation unit, and an intra prediction unit included in the prediction units 120 and 125.

[0084] The filter unit 150 may include at least one of a deblocking filter, an offset modification unit, or an ALF (Adaptive In-Loop Filter).

[0085] The deblocking filter can remove block distortion caused by the boundary between blocks in the reconstructed picture. It can be determined whether the deblocking filter will be applied to the current block based on the pixels included in several columns or rows included in the block, so as to determine whether to perform deblocking. When the deblocking filter is applied to the block, a strong filter or a weak filter can be applied according to the necessary strength of the deblocking filter. In addition, when applying the deblocking filter, when performing vertical filtering and horizontal filtering, horizontal direction filtering and vertical direction filtering can be processed in parallel.

[0086] The offset modification unit can modify the offset from the original image in units of pixels for the image to be deblocked. The offset modification can be performed on a specific picture using a method of dividing the pixels included in the image into a specific number of regions, determining the regions to be offset and applying the offset to the corresponding regions, or a method of applying the offset by considering edge information of each pixel.

[0087] ALF (Adaptive In-Loop Filter) may be performed based on a value obtained by comparing a filtered reconstructed image with an original image. Pixels included in an image may be divided into predetermined groups, a filter to be applied to the corresponding group may be determined, and filtering may be performed separately for each group. Information related to whether ALF is applied may be sent for each coding unit (CU) for a luminance signal, and the shape and filter coefficient of the ALF filter to be applied may differ for each block. In addition, an ALF filter of the same shape (fixed shape) may be applied regardless of the characteristics of the target block to be applied.

[0088] The memory 155 may store the reconstructed block or picture calculated in the filter unit 150 , and may provide the stored reconstructed block or picture to the prediction units 120 and 125 when performing inter prediction.

[0089] Figure 2 A rough block diagram of a decoding device as an embodiment of the present disclosure is shown.

[0090] Reference Figure 2 , the decoding apparatus may include an entropy decoding unit 210 , a rearrangement unit 215 , an inverse quantization unit 220 , an inverse transform unit 225 , prediction units 230 and 235 , a filter unit 240 , and a memory 245 .

[0091] because Figure 2 Each construction unit shown in is independently shown to represent a different characteristic function in the decoding device, so this can mean that each construction unit is configured with separate hardware. However, since each construction unit is included by enumerating each construction unit for the convenience of description, at least two construction units in each construction unit can be combined to construct one construction unit, or one construction unit can be divided into multiple construction units to perform functions, and such integrated embodiments and separate embodiments of each construction unit are also included in the scope of the rights of the present disclosure, as long as they do not exceed the essence of the present disclosure.

[0092] The entropy decoding unit 210 may perform entropy decoding on the input bit stream. For example, for entropy decoding, various methods such as Exponential Golomb, CAVLC (Context Adaptive Variable Length Coding), and CABAC (Context Adaptive Binary Arithmetic Coding) may be applied.

[0093] In the entropy decoding unit 210, information related to intra prediction and inter prediction performed in the encoding device may be decoded.

[0094] The rearrangement unit 215 may perform rearrangement on the bitstream entropy-decoded in the entropy decoding unit 210. The coefficients expressed in a one-dimensional vector shape may be rearranged by reconstructing the coefficients into a two-dimensional block shape. In the rearrangement unit 215, information related to coefficient scanning performed in the encoding device may be provided, and the rearrangement may be performed in an inverse scanning method based on a scanning order performed in the corresponding encoding device.

[0095] The inverse quantization unit 220 may perform inverse quantization based on the quantization parameter and the coefficient value of the rearranged block.

[0096] The inverse transform unit 225 may perform inverse transform on the inverse quantized transform coefficient in a predetermined transform method. In this case, the transform method may be determined based on information about a prediction method (inter / intra prediction), a size / shape of a block, an intra prediction mode, and the like.

[0097] The prediction units 230 and 235 may generate a prediction block based on the information related to prediction block generation provided in the entropy decoding unit 210 and the pre-decoded block or picture information provided in the memory 245 .

[0098] The prediction units 230 and 235 may include a prediction unit determination unit, an inter prediction unit, and an intra prediction unit. The prediction unit determination unit may receive various information (such as prediction unit information, prediction mode information of an intra prediction method, information related to motion prediction of an inter prediction method, etc.) input from the entropy decoding unit 210, distinguish the prediction unit from the current coding unit (CU), and determine whether the prediction unit performs inter prediction or intra prediction. The inter prediction unit 230 may perform inter prediction on the current prediction unit based on information included in at least one of the previous or subsequent pictures of the current picture including the current prediction unit, by using information required for inter prediction of the current prediction unit provided by the encoding device. Alternatively, inter prediction may be performed based on information of some areas of the current prediction unit included in the current picture that are pre-reconstructed.

[0099] In order to perform inter prediction, whether a motion prediction method of a prediction unit included in a corresponding coding unit is a skip mode, a merge mode, or an AMVP mode may be determined in a coding unit.

[0100] The intra prediction unit 235 may generate a prediction block based on pixel information in the current picture. When the prediction unit is a prediction unit that performs intra prediction, intra prediction may be performed based on intra prediction mode information of the prediction unit provided by the encoding device. The intra prediction unit 235 may include an AIS (Adaptive Intra Smoothing) filter, a reference pixel interpolation unit, and a DC filter. The AIS filter is a component that performs filtering on the reference pixels of the current block, and the AIS filter may be applied by determining whether to apply the filter according to the prediction mode of the current prediction unit. AIS filtering may be performed on the reference pixels of the current block by using the prediction mode of the prediction unit and the AIS filter information provided by the encoding device. In the case where the prediction mode of the current block is a mode in which AIS filtering is not performed, the AIS filter may not be applied.

[0101] When the prediction mode of the prediction unit is a prediction unit that performs intra-frame prediction based on a pixel value interpolated from a reference pixel, the reference pixel interpolation unit may interpolate the reference pixel in a pixel unit equal to or less than an integer value to generate the reference pixel. In the case where the prediction mode of the current prediction unit is a prediction mode that generates a prediction block without interpolating the reference pixel, the reference pixel may not be interpolated. When the prediction mode of the current block is a DC mode, the DC filter may generate a prediction block by filtering.

[0102] The reconstructed block or picture may be provided to the filter unit 240. The filter unit 240 may include a deblocking filter, an offset modification unit, and an ALF.

[0103] The encoding device may provide information about whether the deblocking filter is applied to the corresponding block or picture and information about whether a strong filter or a weak filter is applied when the deblocking filter is applied. The deblocking filter of the decoding device may receive information related to the deblocking filter provided by the encoding device and perform deblocking filtering on the corresponding block in the decoding device.

[0104] The offset modification unit may perform offset modification on the reconstructed image based on the type of offset modification applied to the image in encoding, offset value information, and the like.

[0105] ALF may be applied to a coding unit based on information provided by an encoder regarding whether ALF is applied, ALF coefficient information, etc. Such ALF information may be provided by being included in a specific parameter set.

[0106] The memory 245 may store the reconstructed picture or block to be used as a reference picture or a reference block, and also provide the reconstructed picture to the output unit.

[0107] Figure 3 An intra prediction method is shown as an embodiment to which the present disclosure is applied.

[0108] Reference Figure 3 , the intra prediction mode of the current block can be determined (S300).

[0109] Specifically, the decoding device may obtain a first flag from the bitstream. The first flag may indicate whether the intra prediction mode of the current block is derived from a candidate mode list (a first candidate group). The candidate mode list may include k candidate modes (MPMs), and k may be an integer (such as 1, 2, 3, 4, 5, 6 or more).

[0110] When the first flag is the first value (i.e., when the intra prediction mode of the current block is derived from the first candidate group), the decoding device may obtain index information (mpm_idx) from the bitstream. In this case, the index information may specify any one of a plurality of MPMs belonging to the candidate mode list. The intra prediction mode of the current block may be determined based on the candidate mode list and the index information. In other words, the MPM specified by the index information may be set as the intra prediction mode of the current block. However, the index information may be used only when a plurality of MPMs are included in the candidate mode list. For example, when only one MPM is included in the candidate mode list, the signaling of the index information may be omitted and the corresponding MPM may be set as the intra prediction mode of the current block.

[0111] The MPM can be determined by using the neighboring blocks of the current block. The neighboring blocks may represent blocks adjacent to at least one of the left side, top, top left, top right, or bottom right of the current block. The number of neighboring blocks may be 1, 2, 3, 4, 5, or more. The number may be a fixed number predefined in the encoding / decoding device. The number may be variably determined based on predetermined encoding parameters. The encoding parameters may include information about block attributes. Here, the block attributes may represent the position, size, shape, ratio of width and height, length values ​​of width and height, partition method (e.g., quadtree, binary tree, ternary tree), partition depth, value of intra-frame prediction mode, whether the intra-frame prediction mode is a directional mode, angle of the intra-frame prediction mode, component type (luminance, chrominance), etc. Signaling may be performed at at least one level in a video sequence, picture, strip, parallel block, or predetermined partial area (e.g., CTU row, CTU, CU, PU, ​​etc.).

[0112] The MPM can be determined based on at least one of the following: (A) whether the intra-frame prediction mode between the above-mentioned neighboring blocks is the same, (B) whether the intra-frame prediction mode of the neighboring blocks is a directional mode, (C) whether the intra-frame prediction mode of the first neighboring block is greater than the intra-frame prediction mode of the second neighboring block, (D) whether the difference between the intra-frame prediction modes between the neighboring blocks is the same as a predetermined threshold, or (E) the position of the reference line used for intra-frame prediction of the current block. The threshold value can be any natural number ranging from 1 to (NumIntraAngMode-1). NumIntraAngMode represents the total number of directional modes predefined in the encoding / decoding device, where the total number can be 65.

[0113] The MPM may be configured with at least one of the following: an intra prediction mode of one or more neighboring blocks, a mode derived by adding a value of n to an intra prediction mode of a neighboring block or subtracting a value of n from an intra prediction mode of a neighboring block, or a default mode. Here, the value of n may be an integer (such as 1, 2, 3 or greater). The value of n may be variably determined based on at least one of (A) to (D) above. The default mode may include at least one of a planar mode or a DC mode.

[0114] Hereinafter, for convenience of description, a method of determining 6 MPMs by using 2 neighboring blocks (an upper block and a left block) will be described. The intra prediction mode of the upper block and the intra prediction mode of the left block are respectively referred to as intraPredModeA and intraPredModeL.

[0115] 1. When intraPredModeL and intraPredModeA are the same

[0116] The MPM of the current block may include intraPredModeL, a default mode, a mode derived by subtracting 1 from intraPredModeL, a mode derived by adding 1 to intraPredModeL, and a mode derived by adding 2 to intraPredModeL or subtracting 2 from intraPredModeL. An index may be assigned to the MPM based on a predetermined priority. For example, as shown in Table 1 below, an index may be assigned to each MPM. However, the priority of the present disclosure is not limited to Table 1, and the position of the MPM in the candidate mode list may be different from Table 1.

[0117] [Table 1]

[0118] mpm[0] intraPredModeL mpm[1] flat mpm[2] DC mpm[3] 2+((intraPredModeL+62)%65) mpm[4] 2+((intraPredModeL-1)%65) mpm[5] 2+((intraPredModeL+61)%65)

[0119] 2. When intraPredModeL and intraPredModeA are different

[0120] (1) When intraPredModeL and intraPredModeA are both directional modes, intraPredModeL is greater than intraPredModeA, and the difference between intraPredModeL and intraPredModeA is not 1 or 64

[0121] The MPM of the current block may include intraPredModeL, intraPredModeA, a default mode, a mode derived by subtracting 1 from intraPredModeL, and a mode derived by adding 1 to intraPredModeL. An index may be assigned to the MPM based on a predetermined priority. For example, as shown in Table 2 below, an index may be assigned to each MPM. However, the priority of the present disclosure is not limited to Table 2, and the position of the MPM in the candidate mode list may be different from Table 2.

[0122] [Table 2]

[0123] mpm[0] intraPredModeL mpm[1] intraPredModeA mpm[2] flat mpm[3] DC mpm[4] 2+((intraPredModeL+62)%65) mpm[5] 2+((intraPredModeL-1)%65)

[0124] (2) When intraPredModeL and intraPredModeA are both directional modes, intraPredModeL is greater than intraPredModeA, and the difference between intraPredModeL and intraPredModeA is 1 or 64

[0125] The MPM of the current block may include intraPredModeL, intraPredModeA, and a default mode. The MPM of the current block may additionally include at least one of a mode derived by subtracting 1 from intraPredModeL, a mode derived by adding 1 to intraPredModeL, a mode derived by subtracting 2 from intraPredModeL, or a mode derived by adding 2 to intraPredModeL. When the mode derived by subtracting 1 from intraPredModeL or adding 1 to intraPredModeL is the same as intraPredModeA, it may be excluded from the MPM. In this case, the mode derived by subtracting 2 from intraPredModeL or adding 2 to intraPredModeL may be added / included as the MPM.

[0126] The index may be assigned to the MPM based on a predetermined priority. For example, as shown in Table 3 below, the index may be assigned to each MPM. However, the priority of the present disclosure is not limited to Table 3, and the position of the MPM in the candidate mode list may be different from Table 3.

[0127] [Table 3]

[0128] mpm[0] intraPredModeL mpm[1] intraPredModeA mpm[2] flat mpm[3] DC mpm[4] 2+((intraPredModeL+61)%65) mpm[5] 2+((intraPredModeL)%65)

[0129] (3) When intraPredModeL and intraPredModeA are both directional modes, intraPredModeL is less than intraPredModeA, and the difference between intraPredModeL and intraPredModeA is not 1 or 64

[0130] The MPM of the current block may include intraPredModeL, intraPredModeA, a default mode, a mode derived by subtracting 1 from intraPredModeA, and a mode derived by adding 1 to intraPredModeA. An index may be assigned to the MPM based on a predetermined priority. For example, as shown in Table 4 below, an index may be assigned to each MPM. However, the priority of the present disclosure is not limited to Table 4, and the position of the MPM in the candidate mode list may be different from Table 4.

[0131] [Table 4]

[0132]

[0133]

[0134] (4) When intraPredModeL and intraPredModeA are both directional modes, intraPredModeL is less than intraPredModeA, and the difference between intraPredModeL and intraPredModeA is 1 or 64

[0135] The MPM of the current block may include intraPredModeL, intraPredModeA, and a default mode. The MPM of the current block may additionally include at least one of a mode derived by subtracting 1 from intraPredModeA, a mode derived by adding 1 to intraPredModeA, a mode derived by subtracting 2 from intraPredModeA, or a mode derived by adding 2 to intraPredModeA. When a mode derived by subtracting 1 from intraPredModeA or adding 1 to intraPredModeA is the same as intraPredModeA, it may be excluded from the MPM. In this case, a mode derived by subtracting 2 from intraPredModeA or adding 2 to intraPredModeA may be added / included as the MPM.

[0136] The index may be assigned to the MPM based on a predetermined priority. For example, as shown in Table 5 below, an index may be assigned to each MPM. However, the priority of the present disclosure is not limited to Table 5, and the position of the MPM in the candidate mode list may be different from Table 5.

[0137] [Table 5]

[0138] mpm[0] intraPredModeL mpm[1] intraPredModeA mpm[2] flat mpm[3] DC mpm[4] 2+((intraPredModeA+61)%65) mpm[5] 2+((intraPredModeA)%65)

[0139] (5) When either intraPredModeL or intraPredModeA is in directional mode and the other is in DC mode

[0140] The MPM of the current block may include a directional mode (intraPredModeX) of intraPredModeL or intraPredModeA, a default mode, a mode derived by subtracting 1 from intraPredModeX, a mode derived by adding 1 to intraPredModeX, and a mode derived by subtracting 2 from intraPredModeX or adding 2 to intraPredModeX.

[0141] The index may be assigned to the MPM based on a predetermined priority. For example, as shown in Table 6 below, an index may be assigned to each MPM. However, the priority of the present disclosure is not limited to Table 6, and the position of the MPM in the candidate mode list may be different from Table 6. For example, DC may have a higher priority than intraPredModeX. Plane may have a higher priority than DC. Plane may have a higher priority than intraPredModeX.

[0142] [Table 6]

[0143] mpm[0] intraPredModeX mpm[1] DC mpm[2] flat mpm[3] 2+((intraPredModeX+62)%65) mpm[4] 2+((intraPredModeX-1)%65) mpm[5] 2+((intraPredModeX+61)%65)

[0144] (6) When either intraPredModeL or IntraPredModelA is a directional mode and the other is a planar mode

[0145] The MPM of the current block may include a directional mode (intraPredModeX) of intraPredModeL or intraPredModeA, a default mode, a mode derived by subtracting 1 from intraPredModeX, a mode derived by adding 1 to intraPredModeX, and a mode derived by subtracting 2 from intraPredModeX or adding 2 to intraPredModeX.

[0146] The index may be assigned to the MPM based on a predetermined priority. For example, as shown in Table 7 below, an index may be assigned to each MPM. However, the priority of the present disclosure is not limited to Table 7, and the position of the MPM in the candidate mode list may be different from Table 7. For example, plane may have a higher priority than intraPredModeX. DC may have a higher priority than plane. DC may have a higher priority than intraPredModex.

[0147] [Table 7]

[0148] mpm[0] intraPredModeX mpm[1] flat mpm[2] DC mpm[3] 2+((intraPredModeX+62)%65) mpm[4] 2+((intraPredModeX-1)%65) mpm[5] 2+((intraPredModeX+61)%65)

[0149] (7) When intraPredModeL and intraPredModeA are both non-directional modes

[0150] The MPM of the current block may include a default mode, a horizontal mode (intraPredModeH), and a vertical mode (intraPredModeV). In addition, the MPM of the current block may further include at least one of a mode derived by subtracting 1 from intraPredModeH or adding 1 to intraPredModeH or a mode derived by subtracting 1 from intraPredModeV or adding 1 to intraPredModeV.

[0151] The index may be assigned to the MPM based on a predetermined priority. For example, as shown in Table 8 below, an index may be assigned to each MPM. However, the priority of the present disclosure is not limited to Table 8, and the position of the MPM in the candidate mode list may be different from Table 8.

[0152] [Table 8]

[0153] mpm[0] flat mpm[1] DC mpm[2] 2+((intraPredModeH+62)%65) mpm[3] 2+((intraPredModeH-1)%65) mpm[4] 2+((intraPredModeV+62)%65) mpm[5] 2+((intraPredModeV-1)%65)

[0154] In addition, the MPM of the current block can be determined based on the reference area to be described later. When the reference area of ​​the current block is the kth reference line, the non-directional mode can be used, otherwise, it can be restricted to not use the non-directional mode. When the current block is allowed to use reference lines other than the kth reference line, the non-directional mode may not be included in the MPM of the current block. k can be 1, 2, 3 or 4. In this case, in the above embodiments (1) to (7), the non-directional mode belonging to the MPM can be replaced by a predetermined intra-frame prediction mode. Here, the predetermined intra-frame prediction mode can be at least one of the intra-frame prediction modes of the neighboring block or the mode derived by adding the value of n to the intra-frame prediction mode of the neighboring block / subtracting the value of n from the intra-frame prediction mode of the neighboring block. n can be an integer (such as 1, 2, 3 or greater). The addition / subtraction process can be repeatedly performed by increasing the value of n by 1 until the candidate mode list is configured with 6 MPMs. However, 6 is only an example, and the maximum number of MPMs configuring the candidate mode list can be 3, 4, 5, 7, 8, 9 or more. The maximum number may be a fixed value pre-committed in the encoder / decoder, or may be variably determined based on encoding parameters (eg, information related to block properties, positions of reference lines, etc.).

[0155] When the first flag is the second value (ie, when the intra prediction mode of the current block is not derived from the first candidate group), the decoding device may obtain the remaining mode information from the bitstream. The decoding device may determine the intra prediction mode of the current block based on the remaining mode information.

[0156] The remaining mode information may be encoded based on the remaining modes (hereinafter referred to as non-MPM) other than the above-mentioned MPM in the intra prediction mode predefined in the encoding / decoding device. The predefined intra prediction modes may include 2 non-directional modes (planar mode, DC mode) and 65 directional modes. For example, the encoding device may generate the remaining mode information by encoding the mode corresponding to the intra prediction mode of the current block among the non-MPM.

[0157] In encoding, the remaining mode information can be encoded based on the truncated binary coding method. When assuming that 67 intra-frame prediction modes and 6 MPMs are used, as shown in the following table, among the 61 non-MPMs, the intra-frame prediction modes with indexes of 0 to 2 can be encoded with 5 bits, and the intra-frame prediction modes with indexes of 3 to 60 can be encoded with 6 bits. However, in the following table, the number of bits and the number of intra-frame prediction modes encoded with 5 bits / 6 bits can be variably determined based on at least one of the number of predefined intra-frame prediction modes or the number of MPMs. In addition, the remaining mode information can be encoded based on FLC (fixed length code), VLC (variable length code), etc.

[0158]

[0159] Optionally, the non-MPM may be classified into at least 2 or more groups. For example, the non-MPM may include a second candidate group and a third candidate group. When the intra prediction mode of the current block is not derived from the first candidate group, the intra prediction mode of the current block may be derived by selectively using any one of the second candidate group or the third candidate group.

[0160] In this case, the second candidate group may be configured with a mode derived based on the MPM, and the third candidate group may be configured with the remaining modes other than the second candidate group in the non-MPM. Optionally, the second candidate group may be configured based on the intra-frame prediction mode of the neighboring block and / or a mode adjacent to the intra-frame prediction mode of the neighboring block. In other words, the second candidate group can be derived in the same / similar method as the first candidate group described above, but the second candidate group may not include the MPM belonging to the first candidate group. For example, the second candidate group may include at least one of the modes whose mode value is +1, -1, +2, -2, +3, -3, ..., +1, -1 different from the intra-frame prediction mode of the neighboring block, and hereinafter, it will be described assuming that the second candidate group is configured with 5 candidate modes. However, it is not limited to this, and the number of candidate modes belonging to the second candidate group may be an integer (such as 1, 2, 3, 4, 6 or more).

[0161] Specifically, the second candidate group may be determined by considering at least one of the following: whether the intra prediction mode of the left block (candIntraPredModeA) and the intra prediction mode of the upper block (candIntraPredModeB) are the same or whether candIntraPredModeA and candIntraPredModeB are non-directional modes.

[0162] For example, when candIntraPredModeA and candIntraPredModeB are the same and candIntraPredModeA is not a non-directional mode, the second candidate group may include at least one of candIntraPredModeA, (candIntraPredModeA-n), (candIntraPredModeA+n), or a non-directional mode. Here, n may be an integer (such as 1, 2, or greater). The non-directional mode may include at least one of a planar mode or a DC mode. In an example, the candidate mode of the second candidate group may be determined as shown in Table 9 below. The index in Table 9 specifies the position or priority of the candidate mode, but is not limited thereto.

[0163] [Table 9]

[0164] index Candidate Mode 0 candIntraPredModeA 1 2+((candIntraPredModeA+61)%64) 2 2+((candIntraPredModeA-1)%64) 3 2+((candIntraPredModeA+60)%64) 4 2+(candIntraPredModeA%64)

[0165] Optionally, when candIntraPredModeA and candIntraPredModeB are not the same and neither candIntraPredModeA nor candIntraPredModeB is a non-directional mode, the second candidate group may include at least one of candIntraPredModeA, candIntraPredModeB, (maxAB-n), (maxAB+n), (minAB-n), (minAB+n), or a non-directional mode. Here, maxAB and minAB may represent the maximum and minimum values ​​of candIntraPredModeA and candIntraPredModeB, respectively, and n may be an integer (such as 1, 2 or greater). The non-directional mode may include at least one of a planar mode or a DC mode. In an example, the candidate mode of the second candidate group may be determined based on the difference (D) between candIntraPredModeA and candIntraPredModeB as shown in Table 10 below.

[0166] [Table 10]

[0167]

[0168]

[0169] Optionally, when candIntraPredModeA and candIntraPredModeB are not the same and only any one of candIntraPredModeA and candIntraPredModeB is a non-directional mode, the second candidate group may include at least one of maxAB, (maxAB-n), (maxAB+n) or a non-directional mode. Here, maxAB may represent the maximum value of candIntraPredModeA and candIntraPredModeB, and n may be an integer (such as 1, 2 or greater). The non-directional mode may include at least one of a planar mode or a DC mode. In an example, as shown in Table 11 below, the candidate mode of the second candidate group may be determined. The index in Table 11 specifies the position or priority of the candidate mode, but is not limited thereto.

[0170] [Table 11]

[0171] index Candidate Mode 0 maxAB 1 2+((maxAB+61)%64) 2 2+((maxAB-1)%64) 3 2+((maxAB+60)%64) 4 2+(maxAB%64)

[0172] Optionally, when candIntraPredModeA and candIntraPredModeB are not the same and candIntraPredModeA and candIntraPredModeB are both non-directional modes, the second candidate group may include at least one of a non-directional mode, a vertical mode, a horizontal mode, (vertical mode-m), (vertical mode+m), (horizontal mode-m) or (horizontal mode+m). Here, m may be an integer (such as 1, 2, 3, 4 or greater). The non-directional mode may include at least one of a planar mode or a DC mode. In an example, as shown in Table 12 below, the candidate modes of the second candidate group may be determined. The index in Table 12 specifies the position or priority of the candidate mode, but is not limited thereto. For example, index 1 may be assigned to a horizontal mode, or a maximum index may be assigned. In addition, the candidate mode may include at least one of a diagonal mode (e.g., mode 2, mode 34, mode 66), (diagonal mode-m) or (diagonal mode+m).

[0173] [Table 12]

[0174] index· Candidate Mode 0 INTRA_DC 1 Vertical Mode 2 Horizontal Mode 3 (Vertical Mode - 4) 4 (Vertical mode +4)

[0175] As described above, the second candidate group may include multiple candidate modes. The first remaining mode information specifying any one of the multiple candidate modes may be sent by a signal. The candidate mode specified by the first remaining mode information sent by the signal may be set as the intra-frame prediction mode of the current block. Optionally, when the first candidate group and the second candidate group are not used, the second remaining mode information may be sent by a signal. The second remaining mode information may specify any one of the remaining modes other than the candidate modes belonging to the first candidate group and the second candidate group in the intra-frame prediction mode predefined in the encoding / decoding device. The candidate mode specified by the second remaining mode information may be set as the intra-frame prediction mode of the current block.

[0176] By reference Figure 4 and Figure 5 A method of determining the second candidate group is described.

[0177] The remaining mode information may be encoded based on the remaining modes in the non-MPM except the second candidate group, or may be encoded based on at least one rearranged non-MPM in the second candidate group or the third candidate group, which will be encoded by referring to Figure 6 and Figure 7 is described.

[0178] Reference Figure 3 , a reference region for intra prediction of a current block may be determined ( S310 ).

[0179] The reference area may represent a peripheral area spatially adjacent to the current block and a pre-reconstructed area before the current block. The reference area may include one or more reference lines. For example, the reference area may include at least one of a first reference line, a second reference line, a third reference line, or a fourth reference line. Here, the first reference line may represent a reference line adjacent to the left side and / or the top of the current block, and the second reference line may represent a reference line adjacent to the left side and / or the top of the first reference line. The third reference line may represent a reference line adjacent to the left side and / or the top of the second reference line, and the fourth reference line may represent a reference line adjacent to the left side and / or the top of the third reference line.

[0180] The current block may be intra-predicted by using a predetermined number of reference lines. The number of reference lines (1) may be a fixed number pre-committed in the encoding / decoding device, or (2) may be a number derived based on encoding parameters in the decoding device, or (3) information about the number may be encoded in the encoding device and sent with a signal. The number may be determined by using any one of the above-mentioned embodiments (1) to (3), or may be derived based on a combination of at least two of the embodiments (1) to (3). The determined number of reference lines may be 0, 1, 2, 3, 4 or more.

[0181] The encoding parameters may include the same information about block attributes as described above. Here, the block attributes may represent the position, size, shape, ratio of width and height, length values ​​of width and height, partition method, partition depth, value of intra prediction mode, whether the intra prediction mode is a directional mode, angle of the intra prediction mode, component type (luminance, chrominance), etc.

[0182] In an example, whether the current block is located on a boundary in an image may be considered. Here, as described above, the boundary may represent a boundary between partial images, and the partial image may be a strip, a tile, a CTU row, a CTU, etc. If the current block contacts the boundary in an image, the current block may be restricted so that the upper reference area of ​​the current block includes only p reference lines.

[0183] In an example, the number of reference lines may be determined based on a comparison between an intra prediction mode of a current block and a predetermined first threshold. For example, when the intra prediction mode of the current block is less than a predetermined first threshold, p reference lines may be used, and when the intra prediction mode of the current block is greater than or equal to the predetermined first threshold, q reference lines may be used. The comparison may be a comparison with a mode value or a comparison with an angle of the intra prediction mode. The first threshold may be a predefined value in an encoding / decoding device. For example, the first threshold may represent information about at least one of a planar mode, a DC mode, a vertical mode, or a horizontal mode.

[0184] In an example, the number of reference lines may be determined based on the length values ​​of the width and height of the current block. For example, when the width of the current block is greater than the height, the upper reference area may include q reference lines, and the left reference area may include p reference lines. Optionally, when the width of the current block is greater than a predetermined second threshold, the upper reference area may include q reference lines, otherwise, the upper reference area may include p reference lines. The above p may be 0, 1, or 2, and q may be 1, 2, 3, or 4. p may be less than q.

[0185] The current block may perform intra-frame prediction by selecting one or more reference lines from among the first to fourth reference lines. In this case, the position of the reference line (1) may be a pre-committed position in the encoding / decoding device, or (2) may be derived from the decoding device based on the number information of the reference lines, or (3) may be encoded in the encoding device and information (mrl_idx) specifying the position of the reference line may be signaled. The information (mrl_idx) may be signaled by considering at least one of the number information of the reference lines or the information about the block attributes. The position may be determined by using any one of the above-mentioned embodiments (1) to (3), or may be determined based on a combination of at least two of the embodiments (1) to (3).

[0186] There may be a case where the reference line is not available for intra prediction of the current block. The unavailable case may mean (1) a case where there is no reference line at the corresponding position, (2) a case where the reference line is located in a part of the image different from the current block, (3) a case where the reference line at the corresponding position has a coding order after the current block.

[0187] When the reference line is unavailable, the reference line at the corresponding position may be excluded from the reference area. Optionally, the unavailable reference line may be replaced by using an available reference line. Here, the available reference line may include peripheral samples of the unavailable reference line, peripheral samples of the current block, etc. Here, the peripheral samples may refer to samples adjacent to at least one of the left direction, the right direction, the upper direction, the lower direction, or the diagonal direction.

[0188] Reference Figure 3 , intra prediction of the current block may be performed by using the intra prediction mode of the current block and the reference region (S320).

[0189] Figures 4 to 5 A method of determining a second candidate group is shown as an embodiment to which the present disclosure is applied.

[0190] The second candidate group can be determined by subtracting a predetermined value of m from the MPM / adding a predetermined value of m to the MPM (Example 1). The operation can be performed for multiple MPMs respectively. It can be restricted so that the operation is not performed on the planar mode or DC mode in the MPM. Here, the value of m can be an integer (such as 2, 3, 4 or more). The value of m can be greater than Figure 3 The value of n mentioned in .

[0191] The above subtraction / addition operation may be performed based on a comparison result between the mode value of the MPM and the basic mode value. The basic mode value may represent mode 2, mode 18 (horizontal mode), mode 34 (diagonal mode), mode 50 (vertical mode), or mode 66. In this specification, mode A may represent an intra prediction mode having a mode value A.

[0192] For example, when the mode value of MPM is greater than or equal to the basic mode value, an operation of subtracting a predetermined value of m from MPM may be performed, otherwise, an operation of adding the predetermined value of m to MPM may be performed. Conversely, when the mode value of MPM is greater than or equal to the basic mode value, an operation of adding the predetermined value of m to MPM may be performed, otherwise, an operation of subtracting the predetermined value of m from MPM may be performed.

[0193] In addition, i basic mode values ​​may be used. Here, the value of i may be 1, 2, 3, 4, or 5. For example, when the value of i is 2, the basic mode value may include a first basic mode value and a second basic mode value. In this case, the first basic mode value may be any one of the above five modes, and the second basic mode value may be another one of the five modes.

[0194] In the example, refer to Figure 4 A, when the MPM is greater than mode 34, the second candidate group may include a mode corresponding to a value that subtracts 32 from the mode value of the MPM. Figure 4 B, when the MPM is mode 34, the second candidate group may include mode 2 and mode 66. When the MPM is less than mode 34, the second candidate group may include a mode corresponding to a value obtained by adding 32 to the mode value of the MPM.

[0195] In addition to the pattern derived based on MPM, the second candidate group may also include its neighboring patterns (Example 2). The neighboring pattern may be determined by adding an integer (such as 1, 2, 3 or more) to the pattern derived based on MPM or subtracting an integer (such as 1, 2, 3 or more) from the pattern derived based on MPM.

[0196] The second candidate group can also be determined based on the location of the region to which the MPM belongs (Example 3). The predefined intra prediction modes in the encoding / decoding device can be classified into multiple regions. For ease of description, Figure 5 It is shown that the predefined intra prediction modes are classified into 4 areas.

[0197] Reference Figure 5 , the first region (R1) may include modes 2 to 17, the second region (R2) may include modes 18 to 33, the third region (R3) may include modes 34 to 49, and the fourth region (R4) may include modes 50 to 66.

[0198] The second candidate group may be determined based on the intra-frame prediction mode of the region adjacent to the region to which the MPM belongs. For example, when the MPM belongs to the first region, the second candidate group may be determined from at least one of the second region or the fourth region. In this case, the second candidate group may be determined based on the minimum value, maximum value, center value, or basic mode value of the intra-frame prediction mode belonging to the corresponding region.

[0199] Alternatively, the second candidate group may be determined based on an intra-frame prediction mode of an area that is not adjacent to the area to which the MPM belongs. For example, when the MPM belongs to the second area, the second candidate group may be determined from the fourth area. Alternatively, when the MPM belongs to the third area, the second candidate group may be determined from the first area. In this case, the second candidate group may be determined based on the minimum value, maximum value, center value, or basic mode value of the intra-frame prediction mode belonging to the corresponding area.

[0200] The second candidate group may be determined based on at least one of the above-described embodiments (1) to (3), or may be determined based on a combination of at least two of the embodiments (1) to (3).

[0201] In addition, the second candidate group determined above may include a mode overlapping with the MPM determined above. The mode overlapping with the MPM may be removed from the second candidate group. As a result of the removal, the number of intra-frame prediction modes belonging to the second candidate group may be less than the maximum number (MaxNumNonMPM) of the second candidate group. In this case, the intra-frame prediction mode according to the above-mentioned embodiment 2 or 3 may be added to the second candidate group. The addition may be performed repeatedly until the number of intra-frame prediction modes belonging to the second candidate group is the same as MaxNumNonMPM. MaxNumNonMPM may be a fixed number pre-committed in the encoding / decoding device, or may be variably determined based on the number of MPMs belonging to the candidate mode list.

[0202] Figure 6 A method for encoding / decoding remaining mode information based on removing a second candidate group as an embodiment to which the present disclosure is applied is provided.

[0203] The encoding apparatus may encode the remaining mode information based on the remaining modes (third candidate group) excluding the second candidate group in the non-MPM.

[0204] In encoding, the remaining mode information may be encoded based on a truncated binary encoding method. For ease of description, it is assumed that 67 intra prediction modes and 6 MPMs are used.

[0205] Reference Figure 6 , when the number of the second candidate groups is 4, the number of the third candidate groups is 57. In the third candidate group, intra prediction modes with indexes 0 to 6 may be encoded with 5 bits, and intra prediction modes with indexes 7 to 56 may be encoded with 6 bits.

[0206]

[0207] Optionally, when the number of the second candidate groups is 5, the number of the third candidate groups is 56. In the third candidate group, intra prediction modes with indexes 0 to 7 may be encoded with 5 bits, and intra prediction modes with indexes 8 to 55 may be encoded with 6 bits.

[0208]

[0209] Optionally, when the number of the second candidate groups is 13, the number of the third candidate groups is 48. In the third candidate group, intra prediction modes with indexes 0 to 15 may be encoded with 5 bits, and intra prediction modes with indexes 16 to 47 may be encoded with 6 bits.

[0210]

[0211] However, the above embodiment is only an example, and the number of bits and the number of intra-frame prediction modes encoded with 5 bits / 6 bits can be variably determined based on at least one of the number of predefined intra-frame prediction modes, the number of MPMs, or the number of second candidate groups. In addition, the remaining mode information can be encoded based on FLC (fixed length code), VLC (variable length code), etc.

[0212] The decoding device can obtain the remaining mode information through the bit stream.

[0213] The decoding device may reorder the MPMs in the candidate mode list in ascending order. The reordered MPM may be compared with the remaining mode information. As a result of the comparison, when the remaining mode information is greater than or equal to the MPM, a first process of adding 1 to the remaining mode information may be performed. The first process may be performed sequentially for each reordered MPM. In addition, the second candidate group belonging to the first group of non-MPMs may be reordered in ascending order. The reordered second candidate group may be compared with the mode value obtained by the first process. As a result of the comparison, when the mode value is greater than or equal to the second candidate group, a second process of adding 1 to the mode value may be performed. The second process may be performed sequentially for each of the reordered second candidate groups. The decoding device may set the mode value obtained by the first process and the second process as the intra prediction mode of the current block.

[0214] Optionally, the decoding device may generate a list by combining the candidate mode list with the first group of non-MPM. The generated list may be configured with intra-frame prediction modes including MPM and the second candidate group, and may be rearranged in ascending order. The rearranged intra-frame prediction mode may be compared with the remaining mode information. As a result of the comparison, when the remaining mode information is greater than or equal to the rearranged intra-frame prediction mode, a process of adding 1 to the remaining mode information may be performed. The process may be performed sequentially for each rearranged intra-frame prediction mode. The decoding device may set the mode value obtained by the process as the intra-frame prediction mode of the current block.

[0215] Figure 7 A method for encoding / decoding remaining mode information based on re-arranging a second candidate group as an embodiment to which the present disclosure is applied is provided.

[0216] The encoding device may encode the remaining mode information based on the remaining modes (non-MPM) other than the MPM in the predefined intra prediction mode. The encoding device may rearrange the second candidate group of the non-MPM list at a predetermined position and encode the remaining mode information based on the rearranged non-MPM list. The position may be a pre-committed position in the encoding / decoding device.

[0217] Reference Figure 7 , the second candidate group can be rearranged to be located after the third candidate group. Thus, the intra prediction mode corresponding to the second candidate group can be encoded with a codeword longer than the third candidate group.

[0218] Alternatively, the second candidate group can be rearranged to be located before the third candidate group. Thus, the intra-frame prediction mode corresponding to the second candidate group can be encoded with a codeword shorter than the third candidate group. In other words, the intra-frame prediction mode corresponding to the second candidate group can be encoded with a short codeword, and the third candidate group can be encoded with a relatively long codeword.

[0219] In the above-mentioned embodiment, only some of the third candidate group can be selectively arranged before or after the second candidate group. For example, some of the third candidate group can represent a mode in which the mode value in the intra-frame prediction mode included in the third candidate group is an even number, or can represent a mode in which the mode value in the intra-frame prediction mode included in the third candidate group is an odd number. Alternatively, some of the third candidate group can represent a mode in which the mode value in the intra-frame prediction mode included in the third candidate group is a multiple of k. Here, k can be an integer (such as 2, 3, 4, 5 or more). In the present disclosure, it is disclosed that some of the third candidate group is selected based on the mode value of the intra-frame prediction mode belonging to the third candidate group, but this is only an example. For example, the third candidate group can be grouped with i intra-frame prediction modes. Some of the third candidate group can be determined by selecting at least one intra-frame prediction mode in each group. Here, i can be an integer (such as 2, 3, 4, 5, 6 or more). The intra-frame prediction mode corresponding to the minimum value, maximum value or center value in the mode belonging to each group can be selected. Optionally, some of the third candidate group may be determined based on a comparison result between the intra prediction mode of the third candidate group and the intra prediction mode of the second candidate group (or the intra prediction mode of the MPM). For example, a mode satisfying that the difference between the mode values ​​is less than or equal to a predetermined threshold may be selected.

[0220] Optionally, the non-MPM can be rearranged / reconfigured to include only the second candidate group by removing the remaining modes (i.e., the third candidate group) from the non-MPM. Since the third candidate group is not used, the number of intra-frame prediction modes belonging to the non-MPM list can be reduced, and the second candidate group can be encoded with a shorter codeword.

[0221] The decoding device may obtain the residual mode information through the bit stream. The intra prediction mode of the current block may be decoded based on the residual mode information. The decoding may be performed based on at least one of the number of the second candidate groups, the arrangement position of the second candidate groups in the non-MPM, or the value of the residual mode information. In addition, if Figure 6 As shown, decoding may further include a process in which the MPM / second candidate groups are arranged in ascending order and compared.

[0222] In the example, it is assumed that the number of the second candidate groups is 5, and the second candidate group is located after the third candidate group.

[0223] If the remaining mode information has a value of 56 to 60, the decoding apparatus may determine an intra prediction mode corresponding to the value of the remaining mode information. The determined intra prediction mode may be set as an intra prediction mode of the current block.

[0224] On the other hand, when the remaining pattern information has a value of 0 to 55, the decoding device may re-arrange the MPMs in the candidate pattern list in ascending order. The re-arranged MPM may be compared with the remaining pattern information. As a result of the comparison, when the remaining pattern information is greater than or equal to the MPM, a first process of adding the remaining pattern information to 1 may be performed. The first process may be performed sequentially for each re-arranged MPM. In addition, the second candidate group belonging to the first group of non-MPMs may be re-arranged in ascending order. The re-arranged second candidate group may be compared with the pattern value obtained by the first process. As a result of the comparison, when the pattern value is greater than or equal to the second candidate group, a second process of adding the pattern value to 1 may be performed. The second process may be performed sequentially for each of the re-arranged second candidate groups. The decoding device may set the pattern value obtained by the first process and the second process as the intra prediction mode of the current block.

[0225] Optionally, the decoding device may generate a list by combining the candidate mode list with the first group of non-MPM. The generated list may be configured with intra-frame prediction modes including MPM and the second candidate group, and may be rearranged in ascending order. The rearranged intra-frame prediction mode may be compared with the remaining mode information. As a result of the comparison, when the remaining mode information is greater than or equal to the rearranged intra-frame prediction mode, a process of adding the remaining mode information to 1 may be performed. The process may be performed sequentially for each rearranged intra-frame prediction mode. The decoding device may set the mode value obtained by the process as the intra-frame prediction mode of the current block.

[0226] In the example, it is assumed that the number of second candidate groups is 5, and the second candidate group is located before the third candidate group.

[0227] When the remaining mode information has a value of 0 to 4, the decoding apparatus may determine an intra prediction mode corresponding to the value of the remaining mode information in the second candidate group. The determined intra prediction mode may be set as the intra prediction mode of the current block.

[0228] On the other hand, when the remaining pattern information has a value of 5 to 60, the decoding device may re-arrange the MPM of the candidate pattern list in ascending order. The re-arranged MPM may be compared with the remaining pattern information. As a result of the comparison, when the remaining pattern information is greater than or equal to the MPM, a first process of adding the remaining pattern information to 1 may be performed. The first process may be performed sequentially for each re-arranged MPM. In addition, the second candidate group belonging to the first group of non-MPMs may be re-arranged in ascending order. The re-arranged second candidate group may be compared with the pattern value obtained by the first process. As a result of the comparison, when the pattern value is greater than or equal to the second candidate group, a second process of adding the pattern value to 1 may be performed. The second process may be performed sequentially for each of the re-arranged second candidate groups. The decoding device may set the pattern value obtained by the first process and the second process as the intra prediction mode of the current block.

[0229] Optionally, the decoding device may generate a list by combining the candidate mode list with the first group of non-MPM. The generated list may be configured with intra-frame prediction modes including MPM and the second candidate group, and may be rearranged in ascending order. The rearranged intra-frame prediction mode may be compared with the remaining mode information. As a result of the comparison, when the remaining mode information is greater than or equal to the rearranged intra-frame prediction mode, a process of adding the remaining mode information to 1 may be performed. The process may be performed sequentially for each rearranged intra-frame prediction mode. The decoding device may set the mode value obtained by the process as the intra-frame prediction mode of the current block.

[0230] For the sake of clarity of description, the illustrative method of the present disclosure is represented as an action sequence, but the order of execution of the stages is not limited, and each stage can be executed simultaneously or in a different order if necessary. In order to implement the method according to the present disclosure, other stages can be included in the stages shown, or the remaining stages except some stages can be included, or other other stages except some stages can be included.

[0231] The various embodiments of the present disclosure do not list all possible combinations but describe representative aspects of the present disclosure, and the contents described in the various embodiments may be applied independently or may be applied in combination of two or more.

[0232] In addition, various embodiments of the present disclosure may be implemented by hardware, firmware, software, or a combination thereof, etc. For implementation by hardware, the implementation may be performed by one or more ASICs (application specific integrated circuits), DSPs (digital signal processors), DSPDs (digital signal processing devices), PLDs (programmable logic devices), FPGAs (field programmable gate arrays), general purpose processors, controllers, microcontrollers, microprocessors, etc.

[0233] The scope of the present disclosure includes software or machine-executable instructions (e.g., operating systems, applications, firmware, programs, etc.) that perform actions in a device or computer according to the methods of various embodiments, as well as non-transitory computer-readable media in which such software or instructions are stored and executed in a device or computer.

[0234] Industrial availability

[0235] The present disclosure may be used to encode / decode video signals.

Claims

1. A video decoding method, comprising: Obtaining a flag from a bitstream, wherein the flag indicates a predetermined candidate group for deriving an intra prediction mode for a current block; Determine a candidate group of intra prediction modes for the current block based on the flag; deriving an intra prediction mode of a current block based on the determined candidate group; and Performing intra prediction on the current block based on the derived intra prediction mode and a predetermined reference area, wherein the candidate group is determined to be the first candidate group or the second candidate group, wherein the first candidate group is configured in a default mode, and The second candidate group is configured by using the intra prediction mode of a neighboring block adjacent to the current block.

2. The method of claim 1, wherein: The default mode includes at least one of a DC mode or a planar mode.

3. The method of claim 1, wherein: At least one candidate mode belonging to the second candidate group is derived by adding a value n to the intra prediction mode of the neighboring block or subtracting a value n from the intra prediction mode of the neighboring block, and Here, n is a natural number greater than or equal to 2.

4. The method of claim 3, wherein: The number of candidate patterns belonging to the second candidate group is 5.

5. The method of claim 4, wherein: The second candidate group does not include the default mode included in the first candidate group.

6. A video encoding method, comprising: Determining an intra prediction mode for a current block; encoding a flag for indicating a candidate group to which an intra prediction mode of a current block belongs; as well as Performing intra prediction on the current block based on the intra prediction mode of the current block and a predetermined reference area, The candidate group includes at least one of the first candidate group or the second candidate group, wherein the first candidate group is configured using a default mode, and The second candidate group is configured by using the intra prediction mode of a neighboring block adjacent to the current block.

7. The method of claim 6, wherein: The default mode includes at least one of a DC mode or a planar mode.

8. The method of claim 6, wherein: At least one candidate mode belonging to the second candidate group is derived by adding a value n to the intra prediction mode of the neighboring block or subtracting a value n from the intra prediction mode of the neighboring block, and Here, n is a natural number greater than or equal to 2.

9. The method of claim 8, wherein: The number of candidate patterns belonging to the second candidate group is 5.

10. The method of claim 9, wherein: The second candidate group does not include the default mode included in the first candidate group.

11. A computer-readable recording medium for storing instructions related to video decoding, wherein when the instructions are executed by a device or a computer, the device or the computer performs the following operations: Get the flags from the bitstream, where The flag indicates a predetermined candidate group for deriving an intra prediction mode for a current block; Determine a candidate group of intra prediction modes for the current block based on the flag; deriving an intra prediction mode of a current block based on the determined candidate group; as well as Performing intra prediction on the current block based on the derived intra prediction mode and a predetermined reference area, wherein the candidate group is determined to be the first candidate group or the second candidate group, wherein the first candidate group is configured in a default mode, and The second candidate group is configured by using the intra prediction mode of a neighboring block adjacent to the current block.

12. The computer-readable recording medium according to claim 11, wherein: The default mode includes at least one of a DC mode or a planar mode.

13. The computer-readable recording medium according to claim 11, wherein: At least one candidate mode belonging to the second candidate group is derived by adding a value n to the intra prediction mode of the neighboring block or subtracting a value n from the intra prediction mode of the neighboring block, and Here, n is a natural number greater than or equal to 2.

14. The computer-readable recording medium according to claim 13, wherein: The number of candidate patterns belonging to the second candidate group is 5.

15. The computer-readable recording medium according to claim 14, wherein: The second candidate group does not include the default mode included in the first candidate group.