Image encoding / decoding method and image data transmission method

By using the reference prediction mode and interval selection strategy in the multi-candidate mode set judged and encoded in the intra prediction mode, the problem of the intra prediction mode accounting for the majority of the bit count is solved, and the encoding and decoding efficiency of the image is improved.

CN118900324APending Publication Date: 2024-11-05LX SEMICON CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411317985.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2016-07-14
Filing Date
2016-11-18
Publication Date
2024-11-05

AI Technical Summary

Technical Problem

In a low bit rate environment, the bit amount of the intra prediction mode accounts for most of the total bit amount, and as the number of intra prediction modes increases, the encoding efficiency decreases, making it difficult to effectively encode and decode images.

Method used

By determining whether the intra prediction mode of the current block is in a set of multiple candidate modes, different encoding strategies are adopted, including encoding indication information to reduce the bit quantity, selecting the candidate mode using the reference prediction mode and a predetermined interval, and optimizing the intra prediction mode Encoding and decoding.

Benefits of technology

The bit amount required for the intra prediction mode is effectively reduced, and the encoding efficiency is improved, especially when the number of intra prediction modes increases, efficient encoding and decoding performance is maintained.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118900324A_ABST
    Figure CN118900324A_ABST
Patent Text Reader

Abstract

The invention provides an image encoding / decoding method and an image data transmission method. An image encoding method according to one embodiment of the present invention may comprise: a first determination step for determining whether an intra prediction mode of a current block is included in a first candidate mode set comprising M number of candidate modes, M being an integer 1 or more; a second determination step for optionally determining, on the basis of a first determination result indicating a result of the first determination step, whether the intra prediction mode of the current block is included in a second candidate mode set including N number of candidate modes, N being an integer 1 or more; and an intra prediction mode encoding step for encoding an intra prediction mode for the current block on the basis of the first determination result or a second determination result indicating the result of the second determination step.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application of the invention patent application with the original application number 201680063833.X (International application number: PCT / KR2016 / 013363, application date: November 18, 2016, invention name: Method and device for encoding / decoding intra-screen prediction mode). Technical Field

[0002] The present invention generally relates to a method and apparatus for encoding / decoding for signaling an intra-frame prediction mode in image encoding / decoding. Background Art

[0003] As broadcasts with high definition (HD) resolution are expanded and provided nationwide and worldwide, many users have become accustomed to images with high resolution and high picture quality. Therefore, many organizations are providing momentum for the development of next-generation image devices. In addition, with the growing interest in ultra-high definition (UHD) with a resolution several times higher than HDTV, technology capable of compressing and processing images with higher resolution and higher picture quality is required.

[0004] As image compression techniques, there are various techniques such as an inter-frame prediction technique for predicting pixel values ​​included in a current picture from a picture before or after the current picture, an intra-frame prediction technique for predicting pixel values ​​included in the current picture using pixel information in the current picture, a transform and quantization technique for compressing energy of a residual signal, and an entropy encoding technique for assigning a short code to a value with a high frequency of occurrence and a long code to a value with a low frequency of occurrence. Image data can be transmitted and stored in a state where the image data is effectively compressed using these image compression techniques.

[0005] In order to send all the information generated at the time of encoding / decoding, the amount of bits required for transmission can be increased. In particular, when encoding slices in intra mode in a low bit rate environment, the amount of bits for predicting the intra prediction mode will occupy a large part of the total amount of bits, so an improved plan is needed. Summary of the invention

[0006] Technical issues

[0007] The present invention aims to provide a method and apparatus for efficiently encoding / decoding an image.

[0008] Furthermore, the present invention provides a method and apparatus for efficiently encoding / decoding an intra prediction mode.

[0009] Furthermore, the present invention provides a method and apparatus for reducing the amount of bits required to transmit an intra prediction mode.

[0010] In addition, the present invention provides a method and apparatus for reducing the amount of bits generated for sending an intra-frame prediction mode as the number of intra-frame prediction modes increases when determining the intra-frame prediction mode of a current coding block through rate-distortion optimization processing.

[0011] Technical Solutions

[0012] According to one aspect of the present invention, a method for encoding an image is provided, the method comprising: a first determination step for determining whether the intra-frame prediction mode of a current block is included in a first candidate mode set, the first candidate mode set comprising M candidate modes (M is an integer equal to or greater than 1); a second determination step for determining whether the intra-frame prediction mode of the current block is included in a second candidate mode set based on a first determination result representing the determination result of the first determination step, the second candidate mode set comprising N candidate modes (N is an integer equal to or greater than 1); and an intra-frame prediction mode encoding step for encoding the intra-frame prediction mode of the current block based on the first determination result or the second determination result representing the determination result of the second determination step.

[0013] According to the encoding method of the present invention, when it is determined in the first decision step that the intra-frame prediction mode of the current block is included in the first candidate mode set, the intra-frame prediction mode encoding step can encode result information about the first determination result and first indication information, and the first indication information is used to indicate a candidate mode that is the same as the intra-frame prediction mode of the current block among the M candidate modes included in the first candidate mode set.

[0014] According to the encoding method of the present invention, when it is determined in the first determination step that the intra-frame prediction mode of the current block is not included in the first candidate mode set, and when it is determined in the second determination step that the intra-frame prediction mode of the current block is included in the second candidate mode set, the intra-frame prediction mode encoding step can encode information about the first determination result, information about the second determination result, and second indication information, and the second indication information is used to indicate a candidate mode that is the same as the intra-frame prediction mode of the current block among the N candidate modes included in the second candidate mode set.

[0015] According to the encoding method of the present invention, when it is determined in the first determination step that the intra-frame prediction mode of the current block is not included in the first candidate mode set, and when it is determined in the second determination step that the intra-frame prediction mode of the current block is not included in the second candidate mode set, the encoding step can encode information about the first determination result, information about the second determination result, and third indication information, and the third indication information is used to indicate a mode among multiple modes that is the same as the intra-frame prediction mode of the current block, and each mode of the multiple modes is not included in the first candidate mode set or the second candidate mode set.

[0016] According to the encoding method of the present invention, the candidate mode included in the second candidate mode set can be determined based on at least one reference prediction mode, wherein the at least one reference prediction mode is selected from the candidate modes included in the first candidate mode set, and the reference prediction mode is an angle mode.

[0017] According to the encoding method of the present invention, when the first candidate mode set includes multiple angle modes, the reference prediction mode can be at least one of the following: the maximum value, the minimum value, the average value, the median value derived from multiple angle modes, or the intra-frame prediction mode derived from the available blocks adjacent to the current block.

[0018] According to the encoding method of the present invention, the candidate mode included in the second candidate mode set can be selected from the prediction mode smaller than the reference prediction mode and the prediction mode larger than the reference prediction mode according to a predetermined interval.

[0019] According to the encoding method of the present invention, the method may further include: an encoding step of encoding information indicating whether the second candidate mode set is used for encoding the intra prediction mode of the block included in the image.

[0020] According to the encoding method of the present invention, the method may further include encoding for encoding information about a number M indicating the number of candidate modes included in the first candidate mode set, or information about a number N indicating the number of candidate modes included in the second candidate mode.

[0021] According to the encoding method of the present invention, the method may further include: in addition to the first determination step and the second determination step, there is an additional determination step, and the intra-frame prediction mode encoding step is performed based on a determination result of the additional determination step.

[0022] According to another aspect of the present invention, a method for decoding an image is provided, the method comprising: decoding candidate mode set selection information and candidate mode selection information; selecting a candidate mode set based on the candidate mode set selection information; and selecting, based on the candidate mode selection information, a candidate mode among at least one candidate mode included in the candidate mode set as an intra-frame prediction mode of a current block, wherein the candidate mode set selection information is information for selecting a candidate mode set for deriving the intra-frame prediction mode of the current block from at least one candidate mode set.

[0023] According to the decoding method of the present invention, at least one candidate mode set may include at least one of the following: a first candidate mode set including M candidate modes (M is an integer equal to or greater than 1), and a second candidate mode set including N candidate modes (N is an integer equal to or greater than 1).

[0024] According to the decoding method of the present invention, when the first candidate mode set is selected based on the candidate mode selection information, the candidate mode selection information may be information for indicating one candidate mode among M candidate modes included in the first candidate mode set.

[0025] According to the decoding method of the present invention, when the second candidate mode set is selected based on the candidate mode selection information, the candidate mode selection information may be information for indicating one candidate mode among N candidate modes included in the second candidate mode set.

[0026] According to the decoding method of the present invention, when neither the first candidate mode set nor the second candidate mode set is selected based on the candidate mode selection information, the candidate mode selection information is information for indicating a candidate mode in at least one candidate mode that is not included in the first or second candidate mode group.

[0027] According to the decoding method of the present invention, the candidate mode included in the second candidate mode set can be determined based on at least one reference prediction mode selected from the candidate modes included in the first candidate mode set, and the reference prediction mode is an angular mode.

[0028] According to the decoding method of the present invention, when the first candidate mode set includes multiple angle modes, the reference prediction mode can be at least one of the following: the maximum value, the minimum value, the average value, the median value derived from multiple angle modes, or the intra-frame prediction mode derived from the available blocks adjacent to the current block.

[0029] According to the decoding method of the present invention, the candidate mode included in the second candidate mode set can be selected from the prediction mode smaller than the reference prediction mode and the prediction mode larger than the reference prediction mode according to a predetermined interval.

[0030] According to the decoding method of the present invention, the method may further include: decoding information indicating whether the second candidate mode set is used for decoding the intra prediction mode of the block included in the image.

[0031] According to the decoding method of the present invention, the method may further include: decoding information about a number M indicating the number of candidate modes included in the first candidate mode set, or information about a number N indicating the number of candidate modes included in the second candidate mode.

[0032] Beneficial Effects

[0033] According to the present invention, images can be efficiently encoded / decoded.

[0034] Furthermore, according to the present invention, the intra prediction mode can be efficiently encoded / decoded during.

[0035] Furthermore, according to the present invention, the amount of bits required for transmitting an intra prediction mode can be reduced.

[0036] Furthermore, according to the present invention, when the number of intra prediction modes increases, encoding efficiency for transmitting the intra prediction modes can be improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Figure 1 is a block diagram showing the configuration of an image encoding device to which an embodiment of the present invention is applied.

[0038] Figure 2 is a block diagram showing the configuration of an image decoding device to which an embodiment of the present invention is applied.

[0039] Figure 3 is a diagram schematically showing a partition structure of an image when encoding the image.

[0040] Figure 4 is a diagram illustrating a form of a prediction unit (PU) that may be included in a coding unit (CU).

[0041] Figure 5 is a diagram illustrating a form of a transform unit (TU) that may be included in a coding unit (CU).

[0042] Figure 6 is a diagram illustrating an example of an intra prediction process.

[0043] Figure 7 is a diagram for explaining an example of an inter prediction process.

[0044] Figure 8 is a flowchart illustrating an encoding method of an intra-frame prediction mode according to an embodiment of the present invention.

[0045] Fig. 9 is a flowchart illustrating a method for decoding an intra prediction mode according to an embodiment of the present invention.

[0046] Fig.10 is a diagram explaining an intra prediction mode in which up to 35 intra prediction modes are supported as an intra prediction mode of an image.

[0047] Fig.11 is a diagram explaining an intra prediction mode in which up to 67 intra prediction modes are supported as intra prediction modes of an image.

[0048] Fig.12 is a diagram for explaining a configuration example of 6 MPM candidate modes when up to 67 intra prediction modes are supported.

[0049] Fig.13 The explanation is based on Fig.12FIG. 1 is a diagram of various embodiments of configuring auxiliary IPM candidates by configuring an MPM candidate in the first case (Case 1).

[0050] Fig.14 The explanation is based on Fig.12 2 and 3. A diagram of various embodiments of configuring auxiliary IPM candidates based on the MPM candidates configured in the second case (Case 2) and the fifth case (Case 5).

[0051] Fig.15 The explanation is based on Fig.12 FIG. 4 is a diagram of various embodiments of configuring auxiliary IPM candidates by configuring MPM candidates according to the fourth case (Case 4). DETAILED DESCRIPTION

[0052] Since various modifications can be made to the present invention and there are various embodiments of the present invention, examples thereof will now be provided with reference to the accompanying drawings and will be described in detail. However, the present invention is not limited thereto, and the exemplary embodiments may be interpreted as including all modifications, equivalents or substitutes in the technical concept and technical scope of the present invention. In various aspects, similar reference numerals refer to the same or similar functions. In the accompanying drawings, for the sake of clarity, the shapes and dimensions of the elements may be enlarged, and the same reference numerals will always be used to represent the same or similar elements. In the following detailed description of the present invention, reference is made to the accompanying drawings, which show, by way of example, specific embodiments in which the present invention can be implemented. These embodiments are described in sufficient detail to enable those skilled in the art to implement the present disclosure. It should be understood that the various embodiments of the present disclosure, although different, are not necessarily mutually exclusive. For example, herein, without departing from the spirit and scope of the present disclosure, the specific features, structures and characteristics described in conjunction with one embodiment may be implemented in other embodiments. In addition, it should be understood that the position or arrangement of the various elements within each disclosed embodiment may be modified without departing from the spirit and scope of the present disclosure. Therefore, the following detailed description should not be regarded as having a limiting meaning, and the scope of the present disclosure is limited only by the appended claims, and the full range equivalent to the scope claimed by the claims is appropriately interpreted.

[0053] The terms "first", "second", etc. used in the specification can be used to describe various components, but these components should not be interpreted as limited to these terms. These terms are only used to distinguish one component from other components. For example, a "first" component can be referred to as a "second" component without departing from the scope of the present invention, and the "second" component can also be similarly referred to as a "first" component. The term "and / or" includes a combination of multiple items or any one of the multiple items.

[0054] When it is mentioned that an element is "coupled" or "connected" to another element, this may mean that it is directly coupled or connected to another element, but it should be understood that there is another element between them. On the other hand, when it is mentioned that an element is "directly coupled" or "directly connected" to another element, it should be understood that there are no other elements between them.

[0055] In addition, the components shown in the embodiments of the present invention are shown independently to represent the characteristic functions that are different from each other. Therefore, this does not mean that each component is composed of a component unit of separate hardware or software. In other words, for convenience, each component includes each enumerated component. Therefore, at least two components of each component can be combined to form a component, or a component can be divided into multiple components to perform each function. Without departing from the essence of the present invention, the embodiment of combining each component and the embodiment of separating one of the components are also included in the scope of the present invention.

[0056] The terms used in this specification are only used to describe specific embodiments, and are not intended to limit the present invention. Unless there is a clearly different consciousness in the context, the expression used in the singular form includes the expression in the plural form. In this specification, it will be understood that the terms such as "including", "having" and the like are used to indicate the existence of the features, numbers, steps, actions, elements, parts or combinations thereof disclosed in the specification, and are not intended to exclude the possibility that one or more other features, numbers, steps, actions, elements, parts or combinations thereof may exist or may be added. In other words, when a particular element is referred to as "comprising", the elements outside the corresponding elements are not excluded, but additional elements may be included in an embodiment of the present invention or in the scope of the present invention.

[0057] In addition, some components may not be indispensable components for performing the basic functions of the present invention, but are selective components that only improve their performance. In addition to components for improving performance, the present invention can be implemented by only including indispensable components for realizing the essence of the present invention. In addition to selective components that are only used to improve performance, structures that only include indispensable components are also included in the scope of the present invention.

[0058] Hereinafter, exemplary embodiments of the present invention will be described in detail with reference to the accompanying drawings. In describing the exemplary embodiments of the present invention, well-known functions or configurations will not be described in detail because they may unnecessarily obscure the understanding of the present invention. The same constituent elements in the accompanying drawings are represented by the same reference numerals, and repeated descriptions of the same elements will be omitted.

[0059] In addition, hereinafter, an image may refer to a picture constituting a video, or may refer to a video. For example, "encoding and / or decoding an image" may refer to "encoding and / or decoding a video", or may refer to "encoding and / or decoding a single image of the images constituting a video". Herein, a picture may refer to an image.

[0060] Encoder: may refer to an encoding device.

[0061] Decoder: can refer to a decoding device.

[0062] Parsing: may refer to determining syntax element values ​​by performing entropy decoding, or may refer to an entropy decoder.

[0063] Block: can refer to an MxN matrix of samples. In this article, M and N are positive integers. Block can refer to a two-dimensional matrix of samples.

[0064] Unit: may refer to a unit of encoding or decoding an image. When encoding and decoding an image, a unit may be a region generated by partitioning an image. Alternatively, when an image is subdivided and encoded or decoded, a unit may refer to a segmented unit of an image. While encoding and decoding, a predetermined process may be performed on each unit. A single unit may be divided into smaller sub-units. Depending on its function, the unit may also refer to: a block, a macroblock (MB), a code unit (CU), a prediction unit (PU), a transform unit (TU), a code block (CB), a prediction block (PB), or a transform block (TB). A unit may refer to a luminance component block to be distinguished from a block, a chrominance component block in response to a luminance component block, and may refer to each block including its syntax elements. A unit may have various sizes and shapes. In particular, the shape of a unit may include a two-dimensional form such as a rectangle, a cube, a trapezoid, a triangle, a pentagon, etc. In addition, the shape of a unit may include a geometric figure. In addition, the unit information may include at least one of the following: a unit type such as a code unit, a prediction unit, a transform unit, etc.; a unit size; a unit depth; and a coding and decoding unit sequence, etc.

[0065] Reconstruction neighboring unit: may refer to a reconstructed unit that has been encoded or decoded in space / time and is adjacent to the encoding / decoding target unit.

[0066] Depth: represents the degree of partitioning of a unit. In a tree structure, the highest node may refer to the root node, and the lowest node may refer to the leaf node.

[0067] Codeword: It can refer to the syntax element and code parameter of the encoding / decoding target unit, the value of the transformation coefficient, etc.

[0068] Parameter setting: may correspond to header information in a structure within a bitstream. At least one of a video parameter set, a sequence parameter set, a picture parameter set, and an adaptation parameter set may be included in a parameter set. In addition, a parameter set may include information of a slice header and a tile header.

[0069] Bitstream: May refer to a string of bits that includes encoded image information.

[0070] Code parameters: may include not only information encoded by the encoder and then sent to the decoder together with syntax elements, but also information that can be derived during the encoding or decoding process, or may refer to parameters necessary for encoding and decoding. For example, code parameters may include at least one value and / or statistical data of the following: intra prediction mode, inter prediction mode, intra prediction direction, motion information, motion vector, reference image index, inter prediction direction, inter prediction indicator, reference image list, motion vector predictor, motion merge candidate, transform type, transform size, information on whether to use additional transform, filter information within the loop, information on whether there is a residual signal, quantization parameter, context model, transform coefficient, transform coefficient amplitude, coding block pattern, coding block flag, image display / output order, slice information, tile information, picture type, information on whether to use motion merge mode, information on whether to use skip mode, block size, block depth, block partition information, unit size, unit partition information, etc.

[0071] Prediction unit: may refer to a basic unit when performing inter-frame prediction or intra-frame prediction, and when performing prediction compensation. A prediction unit may be divided into a plurality of partitions. When performing inter-frame prediction or intra-frame prediction, and when performing prediction compensation, each partition may also be a basic unit. A partitioned prediction unit may also refer to a prediction unit. In addition, a single prediction unit may be divided into smaller sub-units. A prediction unit may have various sizes and shapes. In particular, the shape of the unit may include a two-dimensional form, such as a rectangle, a square, a trapezoid, a triangle, a pentagon, etc. In addition, the shape of the unit may include a geometric figure.

[0072] Prediction unit partition: may refer to the partition form of the prediction unit.

[0073] Reference picture list: may refer to a list including at least one reference picture used for inter prediction or motion compensation. The types of reference lists may include: combined list (LC), L0 (list 0), L1 (list 1), L2 (list 2), L3 (list 3), etc. At least one reference picture list may be used for inter prediction.

[0074] Inter prediction indicator: may refer to the inter prediction direction (unidirectional prediction, bidirectional prediction) of the encoding / decoding target block. Alternatively, the indicator may refer to the number of reference pictures used to generate the prediction block of the encoding / decoding target block, or may refer to the number of prediction blocks used when the encoding / decoding target block performs motion compensation.

[0075] Reference picture index: may refer to the index of a specific picture within a reference picture list.

[0076] Reference picture: may refer to a reference picture referred to by a specific unit for inter-frame prediction or motion compensation. Alternatively, a reference image may refer to a reference picture.

[0077] Motion vector: refers to a two-dimensional matrix used for inter-frame prediction or motion compensation, or can be an offset between a coding / decoding target image and a reference image. For example, (mvX, mvY) can indicate a motion vector, mvX can be a horizontal component, and mvY can be a vertical component.

[0078] Motion vector candidate: may refer to a unit that becomes a prediction candidate when predicting a motion vector, or may refer to a motion vector of the unit.

[0079] Motion vector candidate list: may refer to a list configured with motion vector candidates.

[0080] Motion vector candidate index: may refer to an indicator indicating a motion vector candidate within a motion vector candidate list, or may refer to an index of a motion vector predictor.

[0081] Motion information: may refer to information including at least one of the following: a motion vector, a reference image index, an inter prediction indicator, reference image list information, a reference image, a motion vector candidate, a motion vector candidate index, and the like.

[0082] Transform unit: may refer to a basic unit when performing encoding / decoding of a residual signal (such as transform, inverse transform, quantization, inverse quantization, and encoding / decoding of transform coefficients). A single unit may be divided into smaller sub-units. The unit may have various sizes and shapes. In particular, the shape of the unit may include a two-dimensional form, such as a rectangle, square, trapezoid, triangle, pentagon, etc. In addition, the shape of the unit may also include a geometric figure.

[0083] Scaling: may refer to the process of multiplying a factor by the magnitude of a transform coefficient, and thus, may generate a transform coefficient. Scaling may also refer to inverse quantization.

[0084] Quantization parameter: may refer to a value used to scale the magnitude of transform coefficients in quantization and inverse quantization. Herein, the quantization parameter may be a value mapped to a quantization step size.

[0085] Delta quantization parameter: may refer to a residual value between a predicted quantization parameter and a quantization parameter of an encoding / decoding target unit.

[0086] Scan: can refer to the method of reordering the order of coefficients within a block or matrix. For example, reordering a two-dimensional matrix into a one-dimensional matrix can be referred to as scanning or inverse scanning.

[0087] Transform coefficient: may refer to a coefficient value generated after performing transformation. In the present invention, a transform coefficient magnitude quantized by applying quantization to the transform coefficient may be included in the transform coefficient.

[0088] Non-zero transform coefficient: may refer to a transform coefficient whose value or magnitude is not zero.

[0089] Quantization matrix: can refer to a matrix used for quantization and inverse quantization to improve image quality. Quantization matrix can also refer to a scaling list.

[0090] Quantization matrix coefficient: can refer to each element of the quantization matrix. Quantization matrix coefficient can also refer to matrix coefficient.

[0091] Default matrix: may refer to a predetermined quantization matrix defined in advance in an encoder and a decoder.

[0092] Non-default matrix: may refer to a quantization matrix sent from / received by a user and is not defined in advance in the encoder and decoder.

[0093] Figure 1 is a block diagram showing the configuration of an image encoding device to which an embodiment of the present invention is applied.

[0094] The encoding device 100 may be a video encoding device or an image encoding device. A video may include at least one image. The encoding device 100 may encode at least one image of a video in time sequence.

[0095] Reference Figure 1 The encoding device 100 may include a motion prediction unit 111, a motion compensation unit 112, an intra-frame prediction unit 120, a switch 115, a subtractor 125, a transform unit 130, a quantization unit 140, an entropy encoding unit 150, an inverse quantization unit 160, an inverse transform unit 170, an adder 175, a filter unit 180, and a reference picture buffer 190.

[0096] The encoding device 100 may encode the input image in intra mode or inter mode or both. In addition, the encoding device 100 may generate a bit stream by encoding the input image, and may output the generated bit stream. When the intra mode is used as the prediction mode, the switch 115 may be switched to intra. When the inter mode is used as the prediction mode, the switch 115 may be switched to inter. Herein, the intra mode may be referred to as the intra prediction mode, and the inter mode may be referred to as the inter prediction mode. The encoding device 100 may generate a prediction signal for an input block of the input image. The prediction signal as a block unit may be referred to as a prediction block. In addition, after generating the prediction block, the encoding device 100 may encode the residual value between the input block and the prediction block. The input image may be referred to as the current image as the target of the current encoding. The input block may be referred to as the current block, or the encoding target block as the target of the current encoding.

[0097] When the prediction mode is intra mode, the intra prediction unit 120 may use the pixel value of the previously encoded block adjacent to the current block as a reference pixel. The intra prediction unit 120 may perform spatial prediction by using the reference pixel of spatial prediction, and may generate a prediction sample of the input block by using spatial prediction. Herein, intra prediction may mean prediction within a frame.

[0098] When the prediction mode is the inter mode, the motion prediction unit 111 may search for an area that best matches an input block of a reference image during motion prediction and may derive a motion vector by using the searched area. The reference image may be stored in the reference picture buffer 190.

[0099] The motion compensation unit 112 may generate a prediction block by performing motion compensation using a motion vector. Herein, a motion vector may be a two-dimensional vector used for inter-frame prediction. In addition, a motion vector may indicate an offset between a current image and a reference image. Herein, inter-frame prediction may refer to prediction between frames.

[0100] When the value of the motion vector is not an integer, the motion prediction unit 111 and the motion compensation unit 112 may generate a prediction block by applying an interpolation filter to a partial area in the reference image. In order to perform inter-frame prediction or motion compensation, based on the code unit, a motion prediction method of a prediction unit included in the code unit and a compensation method of motion prediction may be determined among the skip mode, the merge mode, and the AMVP mode. In addition, inter-frame prediction or motion compensation may be performed according to the mode.

[0101] The subtractor 125 may generate a residual block by using a residual value between the input block and the prediction block. The residual block may be referred to as a residual signal.

[0102] The transform unit 130 may generate a transform coefficient by transforming the residual block, and may output the transform coefficient. Herein, the transform coefficient may be a coefficient value generated by transforming the residual block. In the transform skip mode, the transform unit 130 may skip the transform of the residual block.

[0103] The quantized transform coefficient magnitudes may be generated by applying quantization to the transform coefficients. Hereinafter, the quantized transform coefficient magnitudes may be referred to as transform coefficients in the embodiments of the present invention.

[0104] The quantization unit 140 may generate quantized transform coefficient magnitudes by quantizing the transform coefficients according to the quantization parameters, and may output the quantized transform coefficient magnitudes. Herein, the quantization unit 140 may quantize the transform coefficients by using a quantization matrix.

[0105] The entropy coding unit 150 may generate a bit stream by performing entropy coding on the value calculated by the quantization unit 140 or the code parameter value calculated in the encoding process, etc., according to the probability distribution, and may output the bit stream. The entropy coding unit 150 may entropy code the information for decoding the image and the information of the pixels of the image. For example, the information for decoding the image may include syntax elements, etc.

[0106] When entropy coding is applied, a small amount of bits are allocated to symbols with a high probability of occurrence and a large amount of bits are allocated to symbols with a low probability of occurrence to represent symbols, thereby reducing the size of the bit stream of the encoded target symbols. Therefore, the compression performance of image coding can be increased by entropy coding. For entropy coding, the entropy coding unit 150 can use a coding method such as exponential Golomb, context adaptive variable length coding (CAVLC), and context adaptive binary arithmetic coding (CABAC). For example, the entropy coding unit 150 can perform entropy coding by using a variable length coding / coding (VLC) table. In addition, the entropy coding unit 150 can derive a binarization method of the target symbol and a probability model of the target symbol / bin, and can perform arithmetic coding using the derived binarization method or the derived probability model afterwards.

[0107] In order to encode the transform coefficient amplitude, the entropy coding unit 150 can change the two-dimensional block form coefficient into a one-dimensional vector form by using a transform coefficient scanning method. For example, by scanning the coefficients of the block using an upper right scan, the two-dimensional block form coefficient can be changed into a one-dimensional vector form. Depending on the size of the transform unit and the intra-frame prediction mode, a vertical scan that scans the two-dimensional block form coefficient along the column direction and a horizontal scan that scans the two-dimensional block form coefficient along the row direction can be used instead of an upper right scan. In other words, the scanning method among the upper right scan, the vertical direction scan, and the horizontal direction scan can be determined according to the size of the transform unit and the intra-frame prediction mode.

[0108] The coding parameters may include not only information encoded by the encoder and then transmitted to the decoder together with the syntax elements, but also information that can be derived during the encoding or decoding process, or may refer to parameters necessary for encoding and decoding. For example, the coding parameters may include at least one value or statistical data of the following: intra prediction mode, inter prediction mode, intra prediction direction, motion information, motion vector, reference image index, inter prediction direction, inter prediction indicator, reference image list, motion vector predictor, motion merge candidate, transform type, transform size, information on whether to use additional transform, filter information within the loop, information on whether there is a residual signal, quantization parameter, context model, transform coefficient, transform coefficient amplitude, coding block pattern, coding block flag, image display / output order, slice information, tile information, picture type, information on whether to use motion merge mode, information on whether to use skip mode, block size, block depth, block partition information, unit size, unit partition information, etc.

[0109] The residual signal may mean the difference between the original signal and the prediction signal. Alternatively, the residual signal may be a signal generated by transforming the difference between the original signal and the prediction signal. Alternatively, the residual signal may be a signal generated by transforming and quantizing the difference between the original signal and the prediction signal. The residual block may be a residual signal as a block unit.

[0110] When the encoding device 100 performs encoding by using inter-frame prediction, the encoded current image can be used as a reference image for (multiple) other images to be processed later. Therefore, the encoding device 100 can decode the encoded current image and store the decoded image as a reference image. In order to perform decoding, inverse quantization and inverse transformation can be performed on the encoded current image.

[0111] The quantized coefficients may be dequantized by the inverse quantization unit 160, and may be inversely transformed by the inverse transform unit 170. The dequantized and inversely transformed coefficients may be added to the prediction block by the adder 175, whereby a reconstructed block may be generated.

[0112] The reconstructed block may pass through the filter unit 180. The filter unit 180 may apply at least one of a deblocking filter, a sample adaptive offset (SAO), and an adaptive loop filter (ALF) to the reconstructed block or the reconstructed image. The filter unit 180 may be referred to as an in-loop filter.

[0113] The deblocking filter can remove block distortion that occurs at the boundary between blocks. In order to determine whether to operate the deblocking filter, it can be determined whether to apply the deblocking filter to the current block based on the pixels in several rows or columns included in the block. When the deblocking filter is applied to the block, a strong filter or a weak filter can be applied according to the required deblocking filter strength. In addition, when applying the deblocking filter, horizontal direction filtering and vertical direction filtering can be processed in parallel when performing vertical filtering and horizontal filtering.

[0114] Sample adaptive offset can add the optimal offset value to the pixel value to compensate for the coding error. Sample adaptive offset can use pixels to correct the offset between the deblocking filtered image and the original image. In order to perform offset correction on a specific picture, a method of applying offset correction considering the edge information of each pixel or a method of partitioning the pixels of the image into a predetermined number of regions can be used to determine the area to be subjected to offset correction, and the offset correction can be applied to the determined area.

[0115] The adaptive loop filter can filter based on the value obtained by comparing the reconstructed image and the original image. The pixels of the image can be partitioned into predetermined groups, a single filter applied to each group is determined, and different filtering can be performed in each group. Information about whether to apply the adaptive loop filter can be sent to each code unit (CU). The shape and filter coefficients of the adaptive loop filter applied to each block can vary. In addition, an adaptive loop filter with the same form (fixed form) can be applied regardless of the characteristics of the target block.

[0116] The reconstructed block passed through the filter unit 180 may be stored in the reference picture buffer 190 .

[0117] Figure 2 is a block diagram showing the configuration of an image decoding device to which an embodiment of the present invention is applied.

[0118] The decoding device 200 may be a video decoding device or an image decoding device.

[0119] Reference Figure 2 , the decoding device 200 may include an entropy decoding unit 210, an inverse quantization unit 220, an inverse transform unit 230, an intra-frame prediction unit 240, a motion compensation unit 250, an adder 255, a filter unit 260, and a reference picture buffer 270.

[0120] The decoding device 200 may receive the bitstream output from the encoding device 100. The decoding device 200 may decode the bitstream in an intra mode or an inter mode. In addition, the decoding device 200 may generate a reconstructed image through decoding, and may output the reconstructed image.

[0121] When the intra mode is used as the prediction mode used in decoding, the switch can be switched to intra. When the inter mode is used as the prediction mode used in decoding, the switch can be switched to inter.

[0122] The decoding apparatus 200 may obtain a reconstructed residual block from an input bit stream, and may generate a prediction block.

[0123] When the reconstructed residual block and the prediction block are obtained, the decoding apparatus 200 may generate a reconstructed block as a decoding target block by adding the reconstructed residual block and the prediction block. The decoding target block may be referred to as a current block.

[0124] The entropy decoding unit 210 may generate symbols by entropy decoding the bitstream according to the probability distribution. The generated symbols may include symbols in the form of quantized transform coefficient magnitudes.

[0125] Herein, the entropy decoding method may be similar to the entropy encoding method described above. For example, the entropy decoding method may be the inverse process of the entropy encoding method described above.

[0126] In order to decode the transform coefficient amplitude, the entropy decoding unit 210 can change the one-dimensional block form coefficient into a two-dimensional vector form by using a transform coefficient scanning method. For example, by scanning the coefficient of the block using an upper right scan, the one-dimensional block form coefficient can be changed into a two-dimensional vector form. Depending on the size of the transform unit and the intra-frame prediction mode, vertical scanning and horizontal scanning can be used instead of upper right scanning. In other words, the scanning method among upper right scanning, vertical direction scanning and horizontal direction scanning can be determined according to the size of the transform unit and the intra-frame prediction mode.

[0127] The quantized transform coefficient magnitudes may be dequantized by the inverse quantization unit 220 and may be inversely transformed by the inverse transform unit 230. The quantized transform coefficient magnitudes are dequantized and inversely transformed to generate a reconstructed residual block. Herein, the inverse quantization unit 220 may apply a quantization matrix to the quantized transform coefficient magnitudes.

[0128] When the intra mode is used, the intra prediction unit 240 may generate a prediction block by performing spatial prediction using pixel values ​​of a previously decoded block near a decoding target block.

[0129] When the inter-frame mode is used, the motion compensation unit 250 can generate a prediction block by performing motion compensation using both the motion vector and the reference image stored in the reference picture buffer 270. When the value of the motion vector is not an integer, the motion compensation unit 250 can generate a prediction block by applying an interpolation filter to a partial area in the reference image. In order to perform motion compensation, based on the code unit, the motion prediction method of the prediction unit included in the code unit and the compensation method of the motion prediction can be determined among the skip mode, the merge mode, the AMVP mode, and the current picture reference mode. In addition, inter-frame prediction or motion compensation can be performed according to the mode. Herein, the current picture reference mode may mean a prediction mode using a previously reconstructed area within the current picture with a decoding target block. The previously reconstructed area may not be adjacent to the decoding target block. In order to specify the previously reconstructed area, a fixed vector may be used for the current picture reference mode. In addition, a flag or index indicating whether the decoding target block is a block decoded in the current picture reference mode may be notified by a signal, and the flag or index may be derived by using the reference picture index of the decoding target block. The current picture used for the current picture reference mode may exist at a fixed position (e.g., a position of refIdx=0 or the last position) within the reference picture list for the decoding target block. In addition, it may be variably located within the reference picture list, and for this purpose, an additional reference picture index for indicating the position of the current picture may be signaled.

[0130] The reconstructed residual block may be added to the prediction block by the adder 255. A block generated by adding the reconstructed residual block and the prediction block may pass through the filter unit 260. The filter unit 260 may apply at least one of a deblocking filter, a sample adaptive offset, and an adaptive loop filter to the reconstructed block or to the reconstructed image. The filter unit 260 may output the reconstructed image. The reconstructed image may be stored in the reference picture buffer 270 and may be used for inter-frame prediction.

[0131] Figure 3 is a diagram schematically illustrating a partition structure of an image when the image is encoded and decoded. Figure 3 An example of partitioning a single cell into a plurality of cells in a lower layer is schematically shown.

[0132] In order to effectively partition an image, a coding unit (CU) may be used while encoding and decoding. A unit may refer to 1) a syntax element, and 2) a block including a sample image. For example, "a partition of a unit" may refer to "a partition of a block corresponding to the unit". Block partition information may include depth information of the unit. The depth information may indicate the number of partitions in the unit and / or the degree of partition.

[0133] Reference Figure 3, the image 300 is partitioned sequentially in maximum code units (hereinafter referred to as LCUs), and the partition structure is determined based on the LCUs. Herein, the LCU may be used as a coding tree unit (CTU). A single unit may include depth information based on a tree structure and may be partitioned hierarchically. Each of the partition units of the lower layer may include depth information. The depth information indicates the number of partitions in the unit and / or the degree of partitioning, and thus may include unit size information of the lower layer.

[0134] The partition structure may refer to the distribution of code units (CUs) within the LCU 310. A CU may be a unit for efficiently encoding an image. The distribution may be determined based on whether a single CU is to be partitioned into multiple (including 2, 4, 8, 16, etc., positive integers greater than 2). The width dimension and height dimension of each partitioned CU may be half the width dimension and half the height dimension of a single CU. Alternatively, depending on the number of partitioned units, the width dimension and height dimension of each partitioned CU may be smaller than the width dimension and height dimension of a single CU. Similarly, a partitioned CU may be recursively partitioned into multiple CUs, each CU being reduced by half in width and height dimensions from the partitioned CU.

[0135] Here, the partitioning of the CU may be performed recursively until a predetermined depth. The depth information may be information indicating the size of the CU. The depth information of each CU may be stored therein. For example, the depth of the LCU may be 0, and the depth of the smallest code unit (SCU) may be a predetermined maximum depth. Here, the LCU may be a CU with a maximum CU size as described above, and the SCU may be a CU with a minimum CU size.

[0136] Whenever the LCU 310 is partitioned and its width and height dimensions are reduced, the depth of the CU increases by 1. A CU on which partitioning has not been performed may have a 2N×2N size for each depth, and a CU on which partitioning has been performed may be partitioned from a CU having a 2N×2N size into a plurality of CUs each having an N×N size. Whenever the depth increases by 1, the size of N is halved.

[0137] refer to Figure 3 , the size of an LCU with a minimum depth of 0 may be 64×64 pixels, and the size of an SCU with a maximum depth of 3 may be 8×8 pixels. Here, an LCU with 64×64 pixels may be represented by depth 0, a CU with 32×32 pixels may be represented by depth 1, a CU with 16×16 pixels may be represented by depth 2, and an SCU with 8×8 pixels may be represented by depth 3.

[0138] In addition, information about whether a particular CU will be partitioned can be represented by 1-bit partition information for each CU. All CUs except SCU can contain partition information. For example, when the CU is not partitioned, the partition information can be 0. Alternatively, when the CU is partitioned, the partition information can be 1.

[0139] Figure 4 is a diagram showing a form of a prediction unit (PU) that can be included in a CU.

[0140] A CU that is no longer partitioned from among the CUs partitioned from the LCU may be partitioned into at least one PU. Such a process may also be referred to as partitioning.

[0141] A prediction unit (PU) may be a basic unit of prediction. A PU may be encoded and decoded in any of a skip mode, an inter prediction mode, and an intra prediction mode. A PU may be partitioned in various forms according to each mode.

[0142] like Figure 4 As shown, in skip mode, there may be no partitions within a CU. In addition, a 2N×2N mode 410 having the same size as a CU may be supported without partitions within the CU.

[0143] In the inter prediction mode, 8 partitioning types may be supported within the CU, for example, 2N×2N mode 410, 2N×2N mode 415, N×2N mode 420, N×N mode 425, 2N×nU mode 430, 2N×nD mode 435, nL×2N mode 440 and nR×2N mode 445.

[0144] Figure 5 is a diagram showing a form of a transform unit (TU) that can be included in a CU.

[0145] A transform unit (TU) may be a basic unit for transform, quantization, inverse transform, and inverse quantization processes within a CU. A TU may have a rectangular or square form. A TU may be independently determined by the size and / or form of a CU.

[0146] A CU that is no longer partitioned from a CU partitioned from an LCU may be partitioned into one or more TUs. Here, the partition structure of the TU may be a quad-tree structure. For example, Figure 5As shown, depending on the quadtree structure, a single CU 510 may be partitioned once or multiple times so that the CU 510 is formed of TUs of various sizes. Alternatively, a single CU 510 may be partitioned into at least one TU based on the number of horizontal lines and / or vertical lines that partition the CU. The CU may be partitioned into TUs that are symmetrical to each other, or may be partitioned into TUs that are asymmetrical to each other. In order to be partitioned into asymmetric TUs, information on the size and form of the TU may be signaled, or the information may be derived from information on the size and form of the CU.

[0147] While performing the transformation, the residual block may be transformed by using one of the predetermined methods. For example, the predetermined method may include a discrete cosine transform (DCT), a discrete sine transform (DST), or a Karhunen-Loève transform (KLT). In order to determine the method of transforming the residual block, the method may be determined by using at least one of the inter-frame prediction mode information of the prediction unit, the intra-frame prediction mode information of the prediction unit, or the size and form of the transform block. Alternatively, information indicating the method may be signaled in some cases.

[0148] Figure 6 is a diagram showing an example of an intra prediction mode.

[0149] The number of intra prediction modes may vary according to the size of the prediction unit (PU), or may be fixed to N regardless of the size of the prediction unit (PU). Here, N may include 35 and 67, or may be a positive integer greater than 1. For example, the predetermined intra prediction modes of the encoder / decoder may include two non-angular modes and 65 angular modes, such as Figure 6 The two non-angle modes may include a DC mode and a planar mode.

[0150] The number of intra prediction modes may vary depending on the type of color component. For example, the number of intra prediction modes may vary depending on whether the color component is a luminance signal or a chrominance signal.

[0151] The PU may have a square form having an NxN or 2Nx2N size. The NxN size may include 4x4, 8x8, 16x16, 32x32, 64x64, 128x128, etc. Alternatively, the PU may have an M×N size. Here, M and N may be positive integers greater than 2, and M and N may be different numbers. The unit of the PU may be the size of at least one of a CU, a PU, and a TU.

[0152] Intra-frame encoding and / or decoding may be performed by using sample values ​​or encoding parameters included in adjacent reconstruction units.

[0153] In intra prediction, a prediction block may be generated by applying a reference sampling filter to a reference pixel using at least one of the sizes of the encoding / decoding target block. The type of reference filter applied to the reference pixel may be different. For example, the reference filter may be different depending on the intra prediction mode of the encoding / decoding target block, the size / form of the encoding / decoding target block, or the position of the reference pixel. "The type of reference filter may be different" may refer to that the filter coefficients of the reference filter, the number of filter taps, and the filter strength, or the number of filtering processes may be different.

[0154] In order to perform intra prediction, the intra prediction mode of the current prediction unit may be predicted by the intra prediction mode of the neighboring prediction unit adjacent to the current prediction unit. When the intra prediction mode of the current prediction unit is predicted by using the intra prediction mode information of the neighboring prediction unit, and the two modes are the same, the information that the two modes are the same may be sent by using a predetermined flag. Alternatively, when the modes are different, all prediction mode information within the encoding / decoding target block may be encoded by entropy coding.

[0155] Figure 7 is a diagram illustrating an example of inter-frame prediction processing.

[0156] Figure 7 The rectangle can refer to an image (or picture). In addition, Figure 7 The arrow may indicate the prediction direction. In other words, the image may be encoded and / or decoded according to the arrow direction. According to the encoding type, each image may be classified into an I picture (intra picture), a P picture (unidirectional prediction picture), a B picture (bidirectional prediction picture), etc. Each picture may be encoded and decoded according to the encoding type of each picture.

[0157] When the encoding target image is an I picture, the target image itself can be intra-encoded while performing inter-frame prediction. When the encoding target image is a P picture, the target image can be encoded by using inter-frame prediction or motion compensation of a reference image in the forward direction. When the encoding target image is a B picture, the target image can be encoded by using inter-frame prediction or motion compensation of reference images in the forward and reverse directions. Alternatively, the target image can be encoded by using inter-frame prediction of reference images in the forward direction or the reverse direction. Here, in the case of the inter-frame prediction mode, the encoder can perform inter-frame prediction or motion compensation, and the decoder can perform motion compensation in response to the encoder. Images of P pictures and B pictures encoded and / or decoded using reference images are used for inter-frame prediction.

[0158] Hereinafter, inter prediction according to an embodiment is described in detail.

[0159] Inter prediction or motion compensation can be performed by using a reference image and motion information. In addition, inter prediction can use the skip mode described above.

[0160] The reference picture may be at least one of a previous picture of the current picture or a subsequent picture of the current picture. Here, in inter-frame prediction, a block of the current picture based on the reference picture may be predicted. Here, an area within the reference picture may be specified by using a reference picture index refIdx indicating the reference picture and a motion vector to be described later.

[0161] In inter-frame prediction, a reference block corresponding to a current block within a reference picture may be selected. A prediction block of the current block may be generated by using the selected reference block. The current block may be a current encoding or decoding target block among blocks of the current picture.

[0162] The motion information may be derived from the inter-frame prediction process of the encoding device 100 and the decoding device 200. In addition, the derived motion information may be used for inter-frame prediction. Here, the encoding device 100 and the decoding device 200 may improve the efficiency of encoding and / or decoding by using the motion information of the reconstructed adjacent blocks and / or the motion information of the collocated blocks (col blocks). The collocated blocks may be blocks that spatially correspond to the encoding / decoding target blocks within the reconstructed collocated pictures (col pictures). The reconstructed adjacent blocks may be blocks within the current pictures, and reconstructed blocks by encoding and / or decoding. In addition, the reconstructed blocks may be blocks adjacent to the encoding / decoding target blocks, and / or blocks located at the outer corners of the encoding / decoding target blocks. Here, the blocks located at the outer corners of the encoding / decoding target blocks may be blocks adjacent in the vertical direction, and the blocks adjacent in the vertical direction may be adjacent to the encoding / decoding target blocks in the horizontal direction. Alternatively, the blocks located at the outer corners of the encoding / decoding target blocks may be blocks adjacent in the horizontal direction, and the blocks adjacent in the horizontal direction may be adjacent to the encoding / decoding target blocks in the vertical direction.

[0163] Each of the encoding device 100 and the decoding device 200 may determine a predetermined relative position based on a block existing at a position spatially corresponding to the current block within the collocated picture. The predetermined relative position may be located inside and / or outside the block existing at a position spatially corresponding to the current block. In addition, the encoding device 100 and the decoding device 200 may derive the collocated block based on the determined relative position. Here, the collocated picture may be at least one picture among the reference pictures included in the reference picture list.

[0164] The method of deriving motion information may vary according to the prediction mode of the encoding / decoding target block. For example, the prediction mode applied to inter-frame prediction may include an advanced motion vector predictor (AMVP) mode, a merge mode, etc. Here, the merge mode may refer to a motion merge mode.

[0165] For example, in the case of applying the Advanced Motion Vector Predictor (AMVP) mode, the encoding device 100 and the decoding device 200 may generate a prediction motion vector candidate list by using the motion vector of the restored neighboring block and / or the motion vector of the collocated block. In other words, the motion vector of the restored neighboring block and / or the motion vector of the collocated block may be used as a prediction motion vector candidate. Here, the motion vector of the collocated block may refer to a temporal motion vector candidate, and the motion vector of the restored neighboring block may refer to a spatial motion vector candidate.

[0166] The encoding device 100 may generate a bitstream, and the bitstream may include a motion vector candidate index. In other words, the encoding device 100 may entropy encode the motion vector candidate index to generate a bitstream. The motion vector candidate index may indicate that the optimal prediction motion vector is selected among the prediction motion vector candidates included in the motion vector candidate list. The motion vector candidate index may be sent from the encoding device 100 to the decoding device 200 via a bitstream.

[0167] The decoding device 200 may entropy-decode the motion vector candidate index through the bitstream, and select the motion vector candidate of the decoding target block from among the motion vector candidates included in the motion vector candidate list by using the entropy-decoded motion vector candidate index.

[0168] The encoding device 100 may calculate a motion vector difference (MVD) between a motion vector of a coding target block and a motion vector candidate, and may entropy encode the motion vector difference (MVD). The bitstream may include the entropy-encoded MVD. The MVD is sent to the decoding device 200 through the bitstream. Here, the decoding device 200 may entropy decode the MVD from the bitstream. The decoding device 200 may derive the motion vector of the decoding target block by decoding the sum of the MVD and the motion vector candidate.

[0169] The bitstream may include a reference picture index indicating a reference picture. The reference picture index may be entropy encoded and transmitted from the encoding device 100 to the decoding device 200 through the bitstream. The decoding device 200 may predict the motion vector of the current block by using the motion information of the adjacent blocks, and may derive the motion vector of the decoding target block by using the predicted motion vector and the residual value of the predicted motion vector. The decoding device 200 may generate a prediction block of the decoding target block based on the derived motion vector and the reference picture index information.

[0170] As another method of deriving motion information, a merge mode may be used. The merge mode may refer to motion merging of multiple blocks. The merge mode may also refer to applying the motion information of a single block to another block. When the merge mode is applied, the encoding device 100 and the decoding device 200 may generate a merge candidate list by using the motion information of the restored adjacent blocks and / or the motion information of the collocated blocks. Here, the motion information may include at least one of 1) a motion vector, a reference picture index, and 3) an inter-frame prediction indicator. The prediction indicator may indicate unidirectional (LO prediction, L1 prediction) or bidirectional.

[0171] Here, the merge mode can be applied in a code unit or a prediction unit (PU). In the case where the merge mode is performed by a CU unit or a PU unit, the encoding device 100 can generate a bitstream by entropy encoding predetermined information and send the bitstream to the decoding device 200. The bitstream may include predetermined information. The predetermined information may include 1) a merge flag indicating whether the merge mode is used for each block partition, and 2) a merge index including information on which block among the adjacent blocks adjacent to the encoding target block is merged. For example, the adjacent blocks adjacent to the encoding target block may include the left adjacent block of the current block, the upper adjacent block of the encoding target block, the temporal adjacent block of the encoding target block, etc.

[0172] The merge candidate list may represent a list in which motion information is stored. The merge candidate list may be generated before the merge mode is executed. The motion information stored in the merge candidate list may be at least one of the following: motion information of a neighboring block adjacent to the encoding / decoding target block, or motion information of a collocated block corresponding to the encoding / decoding target block in a reference picture, motion information newly generated by combining the motion information present in the merge motion candidate list in advance, and a zero merge candidate. Here, the motion information of the neighboring block adjacent to the encoding / decoding target block may refer to a spatial merge candidate, and the motion information of the collocated block corresponding to the encoding / decoding target block in the reference picture may refer to a temporal merge candidate.

[0173] In the case of the skip mode, the skip mode applies motion information of the neighboring blocks to the encoding / decoding target block. The skip mode may be one of the other modes for inter-frame prediction. When the skip mode is used, the encoding device 100 may generate a bit stream by entropy encoding information of the neighboring blocks that may be used for the encoding target block, and send the bit stream to the decoding device 200. The encoding device 100 may not send other information such as syntax information to the decoding device 200. The syntax information may include at least one of residual information of the motion vector, a coding block flag, and a transform coefficient level.

[0174] In the following, reference will be made to Figures 8 to 15An encoding / decoding method of an intra prediction mode is described. Hereinafter, an intra prediction mode is defined as an IPM. In the present invention, a secondary IPM (SIPM: secondary IPM) and a secondary MPM (SMPM: secondary MPM) are used in the same meaning.

[0175] Figure 8 is a flowchart explaining an encoding method of an intra prediction mode according to an embodiment of the present invention.

[0176] In step S801, the encoding method may construct a first candidate mode set. The first candidate mode set may include M (M is an integer equal to or greater than 1) candidate modes. The encoding method may perform the construction of the first candidate mode set based on the available intra prediction modes of the upper block and / or the left block adjacent to the current block.

[0177] In step S802, the encoding method may determine whether the intra prediction mode of the current block is included in the first candidate mode set.

[0178] In step S806, when it is determined in step S802 that the intra prediction mode of the current block is included in the first candidate mode set, the encoding method encodes the intra prediction mode of the current block. Here, the encoding method may encode information about a first determination result indicating that the intra prediction mode of the current block is included in the first candidate mode set, and first indication information indicating a candidate mode that is the same as the intra prediction mode of the current block among the M candidate modes included in the first candidate mode set.

[0179] The first candidate mode set including the M candidate modes may correspond to an MPM candidate mode set to be described later. In addition, the information about the first determination result and the first indication information may correspond to an MPM flag and an MPM index to be described later, respectively.

[0180] When it is determined in step S802 that the intra prediction mode of the current block is not included in the first candidate mode set, the encoding method may move to step S803.

[0181] In step S803, the encoding method may construct a second candidate mode set including N (N is an integer equal to or greater than 1) candidate modes. The encoding method may perform construction of the second candidate mode set based on at least one reference prediction mode selected from the candidate modes included in the first candidate mode set.

[0182] In step S804, the encoding method may determine whether the intra prediction mode of the current block is included in the second candidate mode set.

[0183] In step S806, when it is determined in step S804 that the intra prediction mode of the current block is included in the second candidate mode set, the encoding method may encode information about the second determination result indicating that the intra prediction mode of the current block is included in the second candidate mode set, and second indication information indicating a candidate mode that is the same as the intra prediction mode of the current block among the N candidate modes included in the second candidate mode set. Alternatively, the encoding method may encode the information about the first determination result together.

[0184] The second candidate mode set including N candidate modes may correspond to the second IPM candidate (candidate mode set) to be described later. In addition, the information about the second determination result and the second indication information may correspond to the secondary MPM tag (secondary MPM tag) and the secondary MPM index (secondary MPM index) to be described later, respectively.

[0185] When it is determined in step S804 that the intra prediction mode of the current block is not included in the second candidate mode set, the encoding method may move to step S805.

[0186] In step S805, the encoding method may construct a remaining candidate mode set including the remaining modes, wherein the remaining modes are modes that are not included in the first candidate mode set and the second candidate mode set. Here, in step S806, the encoding method may encode information indicating that the intra-frame prediction mode of the current block is not included in the first candidate mode set and the second candidate mode set, and third indication information indicating a candidate mode that is the same as the intra-frame prediction mode of the current block among the intra-frame prediction modes included in the remaining candidate mode set. The information indicating that the intra-frame prediction mode of the current block is not included in the first candidate mode set and the second candidate mode set may be encoded by using information about the first determination result and information about the second determination result.

[0187] The third indication information may correspond to an IPM index (rem_intra_luma_pred_mode) to be described later.

[0188] When encoding the IMP of the current block, the encoding method may perform at least one additional decision step in addition to steps S802 and / or S804. The encoding method may perform the additional decision step in any order between steps S801 to S806. The encoding method may perform the additional decision step based on the IPM of the current block, the IPM of (multiple) neighboring blocks, the sample value of the current block, the sample value of (multiple) neighboring blocks, the statistics of the IPM of the neighboring blocks (such as distribution, mean, median, distribution value, norm value, etc.), the variation of the sample values ​​of the current block and / or the neighboring blocks, the IPM value (multiple) included in the first candidate mode set, and the IPM value (multiple) included in the second candidate mode set. At least one of the above. Alternatively, when 3 or more candidate mode sets are provided, the encoding method may determine in the additional decision step whether the IPM of the current block is included in the nth candidate mode set. When 3 or more candidate mode sets are provided, Figure 8 The encoding method shown may include constructing an nth candidate mode set. Here, n is an integer equal to or greater than 3.

[0189] Fig. 9 is a flowchart explaining a decoding method of an intra prediction mode according to an embodiment of the present invention.

[0190] In step S901, the decoding method may decode the candidate mode set selection information and the candidate mode selection information. The candidate mode set selection information may include the first candidate mode set selection information and / or the second candidate mode set selection information. The candidate mode set selection information may correspond to the reference Figure 8 The information about the first determination result and / or the information about the second determination result explained. The information about the candidate mode set selection may be decoded from a single syntax element or from multiple syntax elements. The description of the first candidate mode set and the second candidate mode set may be the same as that of the reference Figure 8 The candidate mode selection information may be information for selecting a mode from among the candidate modes included in the candidate mode set. The candidate mode selection information may correspond to the reference Figure 8 The first, second and / or third indication information explained. The candidate mode selection information may be an index indicating one of the candidate modes included in the candidate mode set. Alternatively, the candidate mode selection information may be information directly indicating the intra prediction mode of the current block.

[0191] In step S902, the decoding method may determine whether the candidate mode set selection information indicates the first candidate mode set. When the candidate mode set selection information indicates the first candidate mode set (yes), the first candidate mode set may be used to decode the intra prediction mode of the current block.

[0192] In step S904, when the candidate mode set selection information indicates the first candidate mode set, the decoding method may derive the intra prediction mode of the current block from the first candidate mode set based on the candidate mode selection information.

[0193] In step S903, when the candidate mode set selection information does not indicate the first candidate mode set in step S902 (No), the decoding method may determine whether the candidate mode set selection information indicates the second candidate mode set. When the candidate mode set selection information indicates the second candidate mode set (Yes), the second candidate mode set may be used to decode the intra prediction mode of the current block.

[0194] In step S905 , when the candidate mode set selection information indicates the second candidate mode set, the decoding method may derive the intra prediction mode of the current block from the second candidate mode set based on the candidate mode selection information.

[0195] When the candidate mode set selection information does not indicate the second candidate mode set in step S903 (No), the remaining candidate mode sets not included in the first candidate mode set and the second candidate mode set may be used to decode the intra prediction mode of the current block.

[0196] When the candidate mode set selection information does not indicate the second candidate mode set in step S903 (No), in step S906, the decoding method may derive the intra prediction mode of the current block from the remaining candidate mode sets based on the candidate mode selection information.

[0197] When decoding the IPM of the current block, the decoding method may perform at least one additional decision step in addition to steps S902 and / or S903. The decoding method may perform the additional decision step in any order between steps S901 to S904 or between steps S905 or S906. The decoding method may perform the additional decision step based on the IPM of the current block, the IPM of (multiple) neighboring blocks, the sample value of the current block, the sample value of (multiple) neighboring blocks, the statistics of the IPM of the neighboring blocks (such as distribution, mean value, median, distribution value, norm value, etc.), the variation of the sample values ​​of the current block and / or the neighboring blocks, the IPM value (multiple) included in the first candidate mode set, and the IPM value (multiple) included in the second candidate mode set. Alternatively, when 3 or more candidate mode sets are provided, the decoding method may determine whether the IPM of the current block is included in the nth candidate mode set in the additional decision step. When 3 or more candidate mode sets are provided, Fig. 9 The decoding method shown in may include constructing an nth candidate pattern set. Here, n is an integer equal to or greater than 3.

[0198] The encoding / decoding method of the intra prediction mode according to the present invention is described in detail.

[0199] The encoding / decoding method of the intra prediction mode can be performed by using at least one of a method based on MPM described later, a method based on secondary IPM (SIPM), and a method based on the remaining intra prediction modes other than MPM and / or SIPM. However, not limited to the secondary IPM, a third or more MPM candidate mode sets can be used by considering the total number of predefined intra prediction modes in the encoder / decoder, the range of intra prediction modes available for the encoding / decoding target block, and the like.

[0200] 1. Encoding / decoding method of the intra prediction mode based on MPM.

[0201] A. The intra prediction can support up to T (T is a positive integer greater than 0) intra prediction modes. Here, T can be an integer greater than 35 (e.g., 67). Hereinafter, for ease of explanation, T is assumed to be 35. The intra prediction modes using more than 35 intra prediction modes can be encoded / decoded similarly or identically by the method described below. In one embodiment, when supporting up to 35 intra prediction modes, two non - angular modes and 33 angular modes can be supported, as Fig.10 shown.

[0202] The two non - angular modes can be the planar mode and the DC mode, and their IPM indices can be set to 0 and 1 respectively. The 33 angular modes are as Fig.10 shown, and their IPM indices can be set to 2 to 34 respectively.

[0203] B. To send the intra prediction mode determined at the encoder, an encoding method based on MPM (Most Probable Mode) derived from pre - encoded / decoded adjacent intra prediction blocks can be used first.

[0204] (1) The prediction modes of the adjacent intra prediction blocks are obtained as MPM candidates. The adjacent intra prediction blocks can include at least one of the left block, the upper block, or the corner block of the current block. When obtaining the left intra prediction block and / or the upper intra prediction block based on the current block, the intra prediction mode of the block with the highest occurrence frequency in the adjacent intra prediction blocks based on the size of the current block can be obtained, or the intra prediction mode of the block where the current block is exactly placed in the left part and the upper part can be obtained.

[0205] (2) When the intra prediction modes obtained from the left part and the upper part based on the current block are different, the MPM candidates can be constructed as up to M (M < T, M is a positive integer greater than 0) candidates. In one embodiment, when M is 3, the indices of the MPM candidates can be assigned as follows.

[0206] MPM[0] = Left_IPM, MPM[1] = Above_IPM, MPM[2] = Planar / DC / Vertical

[0207] (Here, in the case of MPM[2], MPM[0] or MPM[1] may be the same as Plane, DC, and Vertical. Therefore, after determining whether to copy, another IPM may be allocated to MPM[2] according to a predetermined order (Plane->DC->Vertical).

[0208] (3) When the intra prediction modes obtained from the left and upper parts based on the current block are the same,

[0209] When the two identical modes are planar mode or DC mode, the index of the MPM candidate can be set as follows: MPM[0] = Planar, MPM[1] = DC, MPM[2] = Vertical. Alternatively, when the two identical modes are angular modes (IPM = 2 to 34), the index of the MPM candidate can be set as follows: MPM[0] = Left_IPM, MPM[1] = Left_IPM-1, MPM[2] = Left_IPM+1.

[0210] (4) In the case of MPM[2] of (2) and (3), in addition to the above-described embodiments, MPM[2] may be assigned to an arbitrary intra prediction mode block different from the intra prediction mode obtained from the neighboring blocks.

[0211] C. When up to T intra prediction modes are binarized, at least one entropy encoding method among various entropy encoding methods may be used to encode corresponding information.

[0212] In one embodiment, when IPM information including 35 intra prediction modes is encoded by using fixed length coding (FLC), up to 6 bits are required to binarize the IPM. However, by encoding based on MPM using IPM correlation of adjacent blocks, a minimum of 3 bits or a maximum of 6 bits are encoded. Here, when the number of MPMs is M, M may be equal to or less than T. When M is set to 3,

[0213] (1) When the current IPM matches one of the three candidate modes included in the MPM, the IPM may be binarized by using 3 bits. (The flag information (MPM flag, 1 bit) indicates that the current IPM of the current coding unit matches one of the three candidate modes included in the MPM, and the index information (MPM index, 2 bits) indicates one of the three candidate modes.)

[0214] (2) When the current IPM does not match any of the three candidate modes included in the MPM, the IPM may be binarized by using 6 bits (flag information (MPM flag, 1 bit) indicates that the current IPM of the current coding unit does not match any of the three candidate modes included in the MPM, and index information (MPM index, 5 bits) indicates the IPM of the current coding unit among the remaining 32 IPMs excluding 3 MPM modes among a total of 35 IPM modes.)

[0215] (3) When the MPM is actually selected according to the above embodiment method, the number of bits can be reduced when using FLC codeword encoding because the candidate mode of the MPM is binarized by 3 bits instead of 6 bits.

[0216] (4) The above embodiments follow the binarization step when encoding using FLC codewords. The IPM may be binarized by using at least one of various entropy encoding methods used in video standards.

[0217] D. The flag and index information may use at least one of the following entropy coding methods. After binarization, the flag and index information may be finally encoded in CABAC (ae(v)).

[0218] -A truncated Rice binarization method

[0219] - Kth order Exp_Golomb binarization method

[0220] -Restricted K-th order Exp_Golomb binarization method

[0221] -A fixed-length binarization method

[0222] -One-dimensional binary method

[0223] - Truncated unary binarization method

[0224] The decoder can construct M (eg, 3, 4, 5, 6, etc.) MPM candidate modes by obtaining adjacent IPM values ​​similar to the encoder.

[0225] When the IPM of the current block is identical to at least one of the MPM candidate modes according to the decoded value of the above-mentioned MPM flag, the decoder can obtain the IPM value required for current decoding among the MPM candidate modes by using the MPM index.

[0226] When the IPM of the current block is different from any of the MPM candidate modes according to the decoded value of the above-mentioned MPM flag, the decoder can obtain the IPM value required for the current decoding among the MPM candidate modes by using the IPM index.

[0227] In one embodiment, when the total number of intra prediction modes is 35 and the number of MPM candidate modes is 3, and when the IPM of the current block is not included in the MPM candidate mode, the IPM index value ranges from 0 to 31. However, the IPM index value needs to be modified because the IPM index value is not the actual IPM value of the current decoding unit. For example, when the three MPM candidate modes actually have angle modes 3, 25, and 28 and the IPM of the current decoding block has mode 17, the IPM index (0 to 31) can be constructed as the following table that does not include the three MPM candidate modes, and the encoder can send it by entropy encoding the IPM index corresponding to mode 16.

[0228] As shown in Table 1, the decoder can construct a revised IPM table (Revised (Rev.) IPM table) in which the actual IPM value matching the IPM index is reflected. Therefore, the decoder can derive the IPM value (17) of the currently decoded intra-frame prediction block by using Table 1. Here, the decoder may not construct the table when decoding, but obtain the IPM index value (16) and sort the corresponding MPM candidate values ​​(3, 25, and 28) in ascending order, and when the currently decoded IPM index value is greater than the MPM candidate value, the IPM value of the current block is obtained by increasing by 1. Therefore, since the current IPM index value of 16 is greater than only one of the three MPM candidates (3), the original IPM value of 17 can be obtained by increasing the current IPM index value by 1 (16+1=17).

[0229] [Table 1]

[0230]

[0231]

[0232] 2. Encoding / decoding method of intra-frame prediction mode based on auxiliary IPM.

[0233] [Step 1] The encoder may perform encoding by using the auxiliary MPM by generating an auxiliary intra prediction candidate mode list including N candidate modes when the intra prediction mode of the current encoded intra block is not equal to any of the M candidate modes of the MPM.

[0234] Here, the generated N auxiliary IPM candidate modes include another prediction mode different from the M MPM candidate modes.

[0235] The encoder and decoder may have the same number of generated N auxiliary IPM candidate modes. The number N may be any positive integer and may be set equal to or less than the total number of intra prediction modes - M.

[0236] In one embodiment, the number of N auxiliary IPM candidate modes may be 4. When the intra prediction mode of the current coding intra prediction mode is the same as one of the auxiliary IPM candidate modes, and the current coding intra prediction mode is binarized by the FLC codeword, the current coding intra prediction mode may be represented by 4 bits. (MPM flag (1 bit, "0") + auxiliary MPM flag (1 bit, "1") + SMPM index (2 bits)).

[0237] In one embodiment, the number of N auxiliary IPM candidate modes may be 16. When the intra prediction mode of the current coding intra prediction mode is the same as one of the auxiliary candidate modes and the current coding intra prediction mode is binarized by the FLC codeword, the current coding intra prediction mode may be expressed as 6 bits (MPM flag (1 bit, "0") + auxiliary MPM flag (1 bit, "1") + SMPM index (4 bits)).

[0238] The number of candidate modes and which candidate modes are to be included in the auxiliary IPM candidate modes can be determined based on various coding parameters (e.g., predefined intra-prediction related syntax, coding parameters, the size of the current coding unit, the prediction unit and the transform unit, information about whether the coding unit is partitioned, M MPM candidate modes, and the intra-prediction modes of neighboring blocks not included in the MPM).

[0239] The number of auxiliary IPM candidate modes and whether to use the auxiliary IPM candidate mode can be entropy encoded / decoded in at least one of a video parameter set, a sequence parameter set, a picture parameter set, an adaptation parameter set, a slice header, a code unit, a prediction unit, and a transform unit, or can be implicitly set in the encoder / decoder according to the same method. Alternatively, while entropy encoding / decoding at least one of the above information, at least one of the following binarization methods can be used:

[0240] - A truncated Rice binarization method

[0241] - Kth order Exp_Golomb binarization method

[0242] -Restricted K-th order Exp_Golomb binarization method

[0243] -A fixed-length binarization method

[0244] -One-dimensional binary method

[0245] - Truncated unary binarization method

[0246] The above method is not limited to using the auxiliary IPM candidate mode in addition to the MPM, and the flag information and the intra prediction mode information may be encoded / decoded according to the above method by forming a third or more IPM candidate mode groups.

[0247] The auxiliary IPM candidate mode can be constructed according to various methods to be described below. The encoder can determine any auxiliary IPM candidate mode based on the following various methods. The decoder can derive the auxiliary IPM candidate mode according to predefined rules like the encoder.

[0248] When the number of auxiliary IPM candidate modes is N, intra prediction modes other than existing MPM candidate modes may be included in the auxiliary IPM candidate modes within the allowed number. The auxiliary IPM candidate modes may be obtained by subsampling N candidate modes from the entire intra prediction mode except the MPM candidate mode. Here, for the N auxiliary IPM candidate modes, corresponding index values ​​from 0 to N-1 that are not unique intra prediction mode values ​​may be encoded.

[0249] (1) The auxiliary IPM candidate modes may be constructed to include modes having high occurrence frequencies selected as intra prediction modes.

[0250] Generally speaking, intra prediction modes of planar mode, DC mode, vertical mode, horizontal mode, and diagonal mode may be included in the auxiliary IPM candidate modes because they have a high probability of being selected when the current block is homogeneous or the edge component of the current block is strong to the diagonal.

[0251] For example, when 35 intra prediction modes are supported, Fig.11 In the embodiment, the intra prediction indexes of the vertical, horizontal, and diagonal modes may correspond to 26, 10, 18, and 34, respectively. When 67 intra prediction modes are supported, the intra prediction indexes of the vertical, horizontal, and diagonal modes may correspond to 50, 18, 34, and 66, respectively. Here, the intra prediction indexes of the planar mode and the DC mode may generally correspond to 0 and 1, respectively.

[0252] (2) When M candidate patterns included in the MPM are constructed by at least one angular pattern other than the planar pattern and the DC pattern, an auxiliary IPM candidate pattern may be constructed by using adjacent patterns of the corresponding angular pattern.

[0253] In one embodiment, when the M MPM candidate patterns include an angle pattern and the index of the angle pattern is K, the auxiliary IPM candidate patterns can be constructed to include up to N candidate patterns, such as K-1, K+1, K-2, K+2, . . .

[0254] In one embodiment, as described above, when two angle patterns L and A are included in M ​​MPM candidate patterns, auxiliary IPM candidate patterns may be constructed, including L-1, L+1, L-2, L+2, ... and A-1, A+1, A-2, A+2, .... Alternatively, the auxiliary IPM candidate patterns may be constructed to include up to N candidate patterns, which are patterns corresponding to the maximum value (Max), minimum value (Min), average value (Avg), median (median) of the two angle patterns and / or adjacent patterns of the above-mentioned derived patterns, such as Max-1, Max+1, Max-2, Max+2, ... or Min-1, Min+1, Min-2, Min+2, ... or Avg-1, Avg+1, Avg-2, Avg+2, ....

[0255] In one embodiment, when the M MPM candidate modes include S different angle modes, where S<=M, the auxiliary IPM candidate modes can be constructed to include adjacent modes of each angle mode or intra-frame prediction modes corresponding to the maximum value, minimum value, average value, and median value of the angle mode. Here, the order of constructing the auxiliary IPM candidate modes can be freely performed; however, the encoder / decoder can follow the same rules, and the number of auxiliary IPM candidate modes cannot exceed N.

[0256] As described above, when neighboring modes are derived using the angle mode information of the MPM candidate mode, each must have a different intra-prediction mode. For example, when Max-1 and Min+1 are the same mode, only one of them can be included in the auxiliary IPM candidate mode. An intra-prediction mode constructed to include a value calculated by addition / subtraction (e.g., Min-1, Min+1, Max+1, Max+2, etc.) can be replaced with another mode when the calculated value exceeds the intra-prediction mode index range. (In Fig.11 In the case where 67 intra prediction modes are supported and Max+2 is greater than 66, intra prediction mode 2 or greater than 2 may be included in the auxiliary IPM candidate modes.

[0257] (3) The auxiliary IPM candidate modes may include up to N candidate modes according to intra prediction modes having high occurrence frequencies by deriving statistics of actual intra prediction modes encoded in previously encoded pictures or slices.

[0258] (4) The auxiliary IPM candidate mode can be derived by subsampling up to N candidate modes from intra-frame prediction modes other than the intra-frame prediction modes included in the MPM candidate mode based on MPM construction information (for example, information about the intra-frame prediction mode included in the MPM (angle mode)), information about whether the same intra-frame prediction mode appears, distribution of intra-frame prediction mode indices included in the MPM, errors between adjacent reference samples according to angles and reconstructed, etc.).

[0259] In one embodiment, when intra prediction supports 67 intra prediction modes (planar mode, DC mode and 65 angular modes), 6 MPM modes and 16 auxiliary IPM candidate modes can be constructed according to the following criteria. Here, the distribution of the intra prediction mode of the MPM in the entire intra prediction mode can be as follows: Fig.12 As shown. In the above criteria, L and A can be obtained from the intra prediction mode with the highest occurrence frequency in the left block and the upper block based on the current block, and have been encoded. As mentioned above, Max and Min represent the maximum and minimum values ​​of L and A.

[0260] Fig.12 The leftmost column of corresponds to a value indicating an intra prediction mode. Angular modes (2 to 66) in the intra prediction mode are represented in light gray, and non-angular modes O (planar mode) and 1 (DC mode) are represented in white.

[0261] Fig.12 The second to last columns of correspond to various cases (case 1 to case 6) of selecting MPM candidate modes based on L and A. According to each column, the selected MPM candidate mode is represented in light gray.

[0262] Fig.12 The first case (case 1) is L=A (denoted by C); however, the corresponding mode is neither planar mode nor DC mode. Here, the 6 MPM candidate modes may include C, planar, C+1, C-1, C+2, and DC modes.

[0263] Fig.12 The second case (case 2) is L=A (denoted by C); however, the corresponding mode is planar mode or DC mode. Here, the 6 MPM candidate modes may include planar, DC, vertical (50), horizontal (18), 2, and 34 modes.

[0264] Fig.12 The third case (case 3) is L! = A; however, neither of the corresponding modes is a planar mode, but one of the two is a DC mode. Here, the 6 MPM candidate modes may include L, A, planar, Max-1, Max+1, and Max+2 modes.

[0265] Fig.12 The fourth case (Case 4) is L! = A; however, the corresponding modes are neither planar mode nor DC mode. Here, the 6 MPM candidate modes may include L, A, planar, DC, Max+1, and Min-1 modes.

[0266] Fig.12 The fifth case (case 5) is L! = A, one of the corresponding modes is the planar mode and the other is the DC mode. Here, the 6 MPM candidate modes may include L, A, vertical (50), horizontal (18), 2 and 34 modes.

[0267] Fig.12 The sixth case (case 6) is L!=A, one of the corresponding modes is a planar mode and the other is a non-DC mode. Here, the 6 MPM candidate modes may include L, A, DC, Max-1, Max+1 and Max+2 modes.

[0268] Subsampling for constructing an auxiliary IPM candidate mode can be performed using at least an intra-frame prediction mode included in the MPM candidate mode as a reference prediction mode. Here, the reference prediction mode can be a predetermined position angle mode in the intra-frame prediction mode included in the MPM. Alternatively, it can be one or more angle modes in the intra-frame prediction mode included in the MPM. At least one of the minimum value, maximum value, average value, and median value of the angle mode or intra-frame prediction mode derived from the adjacent prediction block (L or A) can be set to the reference prediction mode. Alternatively, subsampling can be performed by setting at least one of the intra-frame prediction modes other than the MPM candidate mode as a reference prediction mode. In one embodiment, the minimum value among the remaining intra-frame prediction modes can be set as the reference prediction mode.

[0269] Fig.13 It is the basis for explanation Fig.12 In the first case, a diagram of various embodiments of constructing auxiliary IPM candidate patterns based on the construction of MPM candidate patterns.

[0270] exist Fig.13 In , 0 to 66 are the indexes of 67 intra prediction modes. Here, 0 and 1 can represent the planar mode and DC mode. The auxiliary IPM candidate mode is set to 16 candidate modes. In addition, according to Fig.12 In the first case, the MPM candidate mode is represented in light gray. In addition, the mode selected as the auxiliary IPM candidate mode is represented in dark gray.

[0271] exist Fig.12In the first case, the intra prediction mode derived from the left and upper parts has a single angle mode (C), and in order to construct an MPM candidate mode with M modes (6 modes in this embodiment), plane, C+1, C-1, C+2, DC mode are added to the MPM candidate mode. Here, the sub-sampled reference prediction mode for constructing the N auxiliary IPM candidate modes can be the angle mode C. In other words, the N auxiliary IPM candidate modes can be sub-sampled based on C-1 and C+2 according to the following embodiments.

[0272] In one embodiment, in order to construct 16 auxiliary IPM candidate modes in addition to the 6 MPM candidate modes, the same number (N / 2) of intra prediction modes less than C-1 and intra prediction modes greater than C+1 may be selected, or different numbers may be selected. In addition, while performing subsampling, the index interval may be set to 2, such as Fig.13 Alternatively, the index interval can be set to 1, as shown in (1) and (2). Fig.13 Alternatively, the auxiliary IPM candidate patterns can be constructed at larger intervals.

[0273] In one embodiment, a portion of the auxiliary IPM candidate modes may be constructed by using the above method, and a portion of the remaining auxiliary IPM candidate modes may be constructed using intra prediction modes adjacent to the planar mode and the DC mode. Fig.13 (4) and (5) of are examples in which auxiliary IPM candidate modes are constructed using 4 intra prediction modes adjacent to the planar and DC modes and the remaining 12 intra prediction modes adjacent to the angular mode. Fig.13 In the configurations shown in (4) and (5), the index interval of the intra prediction modes adjacent to the planar mode and the DC mode can be set to 1, 2, or more, as described above.

[0274] N auxiliary IPM candidate modes can be constructed using prediction mode values ​​that are different from each other. When the prediction mode value is saturated, the corresponding value can be replaced by another value. Fig.13 When an intra-frame prediction mode having an arbitrary value of C+2 in (1) is obtained as an auxiliary IPM candidate mode, and the arbitrary value exceeds 66, the arbitrary value may be changed in another intra-frame prediction mode having a value less than 66, or may be changed in an intra-frame prediction mode having a value greater than 2. Alternatively, when an intra-frame prediction mode having an arbitrary value less than C-1 is obtained as an auxiliary IPM candidate mode, and the arbitrary value is less than 2, the intra-frame prediction mode may be changed to an intra-frame prediction mode having a value of 2 or greater, or having a value less than 66.

[0275] Fig.12The distribution of the MPM candidate patterns of Case 3 and Case 6 shown is the same as that of Case 1. Therefore, N auxiliary IPM candidate patterns can be constructed by using the above method.

[0276] When the intra-frame prediction mode of the current coding block is the same as one of the N auxiliary IPM candidate modes, the N auxiliary IPM candidate modes can be indexed as 0, 1, 2, ..., N-1, and the index values ​​of the N auxiliary IPM candidate modes indicating the same intra-frame prediction mode values ​​as the current intra-frame prediction mode can be sent.

[0277] In one embodiment, Fig.13 While defining the indexes for the N auxiliary IPM candidate modes in , the auxiliary IPM candidate modes that are less than C-1 or greater than C+2 can be indexed sequentially from 0 to N-1.

[0278] In one embodiment, Fig.13 While defining the indexes for the selected N auxiliary IPM candidate modes, the N auxiliary IPM candidate modes can be indexed from 0 to N-1 in ascending or descending order according to the angle and based on the unique value of the intra prediction mode.

[0279] In one embodiment, Fig.13 While defining indexes for the selected N auxiliary IPM candidate modes in , the auxiliary IPM candidate modes selected in the neighbors of the planar / DC mode are indexed first, and the remaining auxiliary IPM candidate modes can be indexed in any order.

[0280] In addition to the above-described embodiments, the auxiliary IPM candidate modes may be indexed from 0 to N-1 according to encoding parameter information or a method derived identically in an encoder / decoder.

[0281] Fig.14 The explanation is based on Fig.12 A block diagram of an example of constructing N auxiliary IPM candidate modes in case 2 or case 5. Fig.14 , the modes indicated in light gray correspond to the modes determined as the MPM candidate modes, and the modes indicated in dark gray correspond to the auxiliary IPM candidate modes.

[0282] exist Fig.12 In case 2 and case 5, the intra prediction modes derived from the neighbors are planar and DC modes. In this paper, since there is no angle information, vertical (50), horizontal (18), and diagonal (2, and 34) modes are included in the MPM candidate modes based on 67 intra prediction mode indexes.

[0283] Herein, in order to construct N auxiliary IPM candidate modes, intra prediction mode values ​​adjacent to the pre-selected MPM intra prediction mode may be selected.

[0284] In one embodiment, in order to construct 16 auxiliary IPM candidate modes, as in case 1, the 16 auxiliary IPM candidate modes may include intra prediction modes having the same number or having different numbers around the MPM candidate mode, or may be sub-sampled by applying an arbitrary index interval (1 or 2). Herein, the sub-sampling method for constructing the auxiliary IPM candidate mode may be performed by using various methods as in the above case 1. In this case, the entire prediction modes should be different from each other, and the maximum number should not exceed the number N.

[0285] When the intra prediction mode of the current coding block is the same as one of the auxiliary MPM candidate modes, as described above, the N auxiliary MPM candidate modes may be indexed as 0, 1, 2, ..., N-1.

[0286] Fig.15 The explanation is based on Fig.12 A block diagram of an example of constructing N auxiliary IPM candidate modes in case 4. Fig.15 , the modes indicated in light gray correspond to the modes determined as the MPM candidate modes, and the modes indicated in dark gray correspond to the auxiliary IPM candidate modes.

[0287] exist Fig.12 In case 4 shown in , the neighboring intra prediction modes (L, A) are angular modes different from each other, and thus N auxiliary IPM candidate modes may be constructed using the neighboring intra prediction modes adjacent to the corresponding angular modes.

[0288] Herein, in order to construct N auxiliary IPM candidate modes, intra prediction modes adjacent to the prediction mode based on the pre-selected MPM may be selected.

[0289] In one embodiment, in order to construct 16 auxiliary IPM candidate modes, intra prediction modes having the same number or having different numbers around the angular prediction mode included in the MPM may be sub-sampled. Alternatively, as in Case 1, a portion of adjacent intra prediction modes using two different intra prediction modes and another portion of intra prediction modes using adjacent planar mode or DC mode may be used to construct the entire 16 number of auxiliary IPM candidate modes.

[0290] When the intra prediction mode of the current coding block is the same as one of the auxiliary MPM candidate modes, as described above, the N auxiliary MPM candidate modes may be indexed as 0, 1, 2, ..., N-1.

[0291] As in the above-mentioned embodiment, the N auxiliary IPM candidate modes may be subsampled according to the distribution and characteristics of the MPM. Alternatively, the N auxiliary IPM candidate modes may be subsampled according to an arbitrary index interval by sorting the remaining intra prediction modes except the MPM candidate modes in ascending or descending order. Herein, the arbitrary index interval may be a positive integer equal to or greater than 1.

[0292] In one embodiment, when 67 intra prediction modes are supported and 6 MPM candidate modes are included, 61 intra prediction modes other than the 6 MPM candidate modes are sorted in ascending or descending order based on their unique angle values. The 61 sorted intra prediction modes can have an index range from 0 to 60, respectively. N auxiliary IPM candidate modes can be constructed according to any index interval. Herein, the intra prediction modes can be sorted identically in the encoder / decoder.

[0293] When the intra prediction modes are sorted as described above, and, for example, the index interval is set to 2, then N auxiliary IPM candidate modes can be constructed using intra prediction modes with indexes 0, 2, 4, 8, 10, ... The final encoded intra prediction mode index can be indexed as 0, 1, 2, ..., N-1, and the corresponding information can be encoded.

[0294] When the intra prediction modes are sorted as described above, and, for example, the index interval is set to 4, then N auxiliary IPM candidate modes can be constructed using intra prediction modes with indices 0, 4, 8, 16, ... The final encoded intra prediction mode index can be indexed as 0, 1, 2, ... N-1, and the corresponding information can be encoded.

[0295] [Step 2] When the current intra prediction mode is the same as one of the auxiliary IPM candidate modes, then its index (SMPM index) can be encoded.

[0296] [Step 3] When the current intra prediction mode is different from any of the auxiliary IPM candidate modes, the IPM index may be encoded in the conventional manner.

[0297] The entire pseudo code can be shown in Table 2.

[0298] [Table 2]

[0299]

[0300] While encoding the intra-frame prediction mode using the auxiliary IPM candidate mode, the information to be sent may be entropy encoded / decoded in at least one of a video parameter set, a sequence parameter set, a picture parameter set, an adaptation parameter set, a slice header, a code unit, a prediction unit, and a transform unit, or may be implicitly set in the encoder / decoder according to the same method. Alternatively, while entropy encoding / decoding at least one of the above information, the information may be encoded by using one of the following binarization methods.

[0301] - Truncated Rice binarization method

[0302] -K-order Exponential Golomb (Exp_Golomb) binarization method

[0303] -Restricted K-order Exp_Golomb binarization method

[0304] -Fixed-length binarization method

[0305] -One-dimensional binary method

[0306] - Truncated unary binarization method

[0307] According to a series of procedures that occur during the encoding process, the decoding process can be performed as follows.

[0308] In one embodiment, when the MPM flag is '1', then the intra prediction mode value may be decoded through the MPM candidate list and the LPK index.

[0309] In one embodiment, when the MPM flag is '0' but the auxiliary MPM flag is '1', then the auxiliary IPM candidate mode can be generated based on the same criteria set for the encoder / decoder, and the intra prediction mode value can be decoded by decoding the SMPM index value.

[0310] In one embodiment, when the above two flags are "0", then the intra-frame prediction mode value can be decoded by the IPM index. The intra-frame prediction mode corresponding to the decoded IPM index can be set as the intra-frame prediction mode of the current block. Alternatively, by comparing the decoded IPM index with the MPM candidate value and / or the SIPM candidate value, the intra-frame prediction mode of the current block can be derived by adding a predetermined value to the IPM index. The predetermined value can be determined based on the number of MPM candidate values ​​equal to or less than the decoded IPM index, and / or the number of SIPM candidate values ​​equal to or less than the decoded IPM index. For the above comparison, the MPM candidate value and / or the SIPM candidate value can be sorted in ascending order or in descending order. In one embodiment, the MPM candidate value and / or the SIPM candidate value can be sorted in ascending order, and the sorted values ​​can be compared with the decoded IPM index in sequence. When the decoded IPM index is equal to or greater than the MPM candidate value and / or the SIPM candidate value, the decoded IPM index increases by 1. Such a process may be repeated as many times as the number of MPM candidate values ​​and / or SIPM candidate values ​​that are equal to or less than the decoded IPM index. When the decoded IPM index is less than the MPM candidate value and / or SIPM candidate value, the step of increasing the IPM index by 1 may be completed.

[0311] In the above embodiment, a flag of "1" may indicate that the current intra prediction mode is the same as one of the MPM candidate mode or the auxiliary IPM candidate mode. The flag may be expressed as 1 or 0. As described above, by sequentially signaling flag information, one of the intra prediction mode decoding methods may be selectively used among an intra prediction mode decoding method based on an MPM candidate (first method), an intra prediction mode decoding method based on an auxiliary IPM candidate (second method), and an intra prediction mode decoding method based on a remaining IPM mode (third method). However, this is not limited to this, and an identifier indicating one of the three methods may be used.

[0312] While entropy encoding at least one of the above information, the information may be encoded by using one of the following binarization methods:

[0313] - Truncated Rice binarization method

[0314] -K-order Exp_Golomb binarization method

[0315] -Restricted K-order Exp_Golomb binarization method

[0316] -Fixed-length binarization method

[0317] -One-dimensional binary method

[0318] - Truncated unary binarization method

[0319] In one embodiment, the SMPM index and the IPM index may be entropy encoded in the FLC or TU. In one embodiment, the SMPM index may be binarized in the FLC, and the IPM index may be encoded / decoded in the TU. In one embodiment, the SMPM index may be binarized in the TU, and the IPM index may be encoded / decoded in the FLC. The syntax required for applying the present invention is indicated in Table 3 below, and the area including each syntax may be changed. For example, the following "log2_secondary_IPM_number_minus2" may be sent via an SPS or a slice header, and in addition to the entropy coding defined in Table 3, at least one of the above-mentioned binarization methods may be used.

[0320] [Table 3]

[0321]

[0322] In the above-mentioned embodiment, the method is described based on a flowchart having a series of steps or units, but the present invention is not limited to the order of the steps, and some steps and other steps can be performed simultaneously or in different orders. In addition, it should be understood by those skilled in the art that the steps in the flowchart do not exclude each other, and other steps can be added to the flowchart, or some of the steps can be deleted from the flowchart without affecting the scope of the present invention.

[0323] What has been described above includes examples of various aspects. Of course, it is not possible to describe every conceivable combination of components or methodology for the purpose of describing various aspects, but one of ordinary skill in the art will recognize that many further combinations and permutations are possible. Therefore, the subject specification is intended to cover all such substitutions, modifications, and variations that fall within the spirit and scope of the appended claims.

[0324] The computer-readable storage medium may include program instructions, data files, data structures, etc., either alone or in combination. The program instructions recorded in the computer-readable storage medium may be any program instructions specially designed and constructed for the present invention or known to those skilled in the art of computer software. Examples of computer-readable storage media include magnetic recording media, such as hard disks, floppy disks, and magnetic tapes; optical data storage media, such as CD-ROMs or DVD-ROMs; magneto-optical media, such as optical magnetic disks; and hardware devices, such as read-only memories (ROMs), random access memories (RAMs), and flash memories, etc., which are specially constructed to store and implement program instructions. Examples of program instructions include not only machine language codes formatted by a compiler, but also high-level language codes that can be implemented by a computer using an interpreter. Hardware devices can be configured to be operated by one or more software modules, and vice versa to perform processes according to the present invention.

[0325] Although the present invention has been described with specific items such as detailed elements and limited embodiments and drawings, they are only provided to help a more general understanding of the present invention, and the present invention is not limited to the above embodiments. It will be appreciated by those skilled in the art that various modifications and changes can be made from the above description.

[0326] Therefore, the spirit of the present invention will not be limited to the above-described embodiments, and the full scope of the appended claims and their equivalents will fall within the scope and spirit of the present invention.

[0327] Industrial Applicability

[0328] The present invention can be used for encoding / decoding images.

Claims

1. An image decoding method performed by a decoding device, the image decoding method The following steps are involved: Decoding candidate mode set selection information; selecting a candidate mode set based on the candidate mode set selection information; In case the selected candidate mode set includes two or more candidate modes, decoding candidate mode selection information; as well as Based on the candidate mode selection information, select a candidate mode from at least one candidate mode included in the candidate mode set as the intra prediction mode of the current block, The candidate mode set selection information is information for selecting a candidate mode set for deriving the intra prediction mode of the current block from a candidate mode set including a first candidate mode set and a second candidate mode set, each candidate mode set including one or more candidate modes, wherein the left mode is an intra-frame prediction mode of a left block adjacent to the current block, and the upper mode is an intra-frame prediction mode of an upper block adjacent to the current block, Among them, the intra prediction mode includes 2 non-directional intra prediction modes and 65 directional intra prediction modes. wherein, when the left mode is equal to the top mode and the left mode is a planar mode, the second candidate mode set includes a first intra-frame prediction mode corresponding to an index value greater than 4 of the index value 50 of the vertical mode and a second intra-frame prediction mode corresponding to an index value less than 4 of the index value 50 of the vertical mode, and Among them, the second candidate mode set derived when the left mode is equal to the upper mode and the left mode is the planar mode is equal to the second candidate mode set derived when the left mode is equal to the upper mode and the left mode is the DC mode.

2. The image decoding method according to claim 1, in, The information including the candidate mode set selection information and the candidate mode selection information is configured by a maximum of 6 bits.

3. A method for encoding an image performed by an encoding device, the method comprising: The following steps are involved: determining a candidate mode set including an intra prediction mode of a current block among candidate mode sets including a first candidate mode set and a second candidate mode set, each candidate mode set including one or more candidate modes; encoding candidate mode set selection information for selecting the candidate mode set including the intra prediction mode of the current block; and encoding candidate mode selection information for selecting the intra prediction mode of the current block from among the two or more candidate modes, in a case where the candidate mode set including the intra prediction mode of the current block includes two or more candidate modes, wherein the left mode is an intra-frame prediction mode of a left block adjacent to the current block, and the upper mode is an intra-frame prediction mode of an upper block adjacent to the current block, Among them, the intra prediction mode includes 2 non-directional intra prediction modes and 65 directional intra prediction modes. wherein, when the left mode is equal to the top mode and the left mode is a planar mode, the second candidate mode set includes a first intra-frame prediction mode corresponding to an index value greater than 4 of the index value 50 of the vertical mode and a second intra-frame prediction mode corresponding to an index value less than 4 of the index value 50 of the vertical mode, and Among them, the second candidate mode set derived when the left mode is equal to the upper mode and the left mode is the planar mode is equal to the second candidate mode set derived when the left mode is equal to the upper mode and the left mode is the DC mode.

4. The image encoding method according to claim 3, in, The information including the candidate mode set selection information and the candidate mode selection information is configured by a maximum of 6 bits.

5. A method for transmitting image data, the transmission method The following steps are involved: Obtaining a bit stream generated by an image encoding method, wherein the image encoding method comprises the following steps: determining a candidate mode set including an intra-frame prediction mode of a current block from among a candidate mode set including a first candidate mode set and a second candidate mode set, each candidate mode set including one or more candidate modes; encoding candidate mode set selection information for selecting the candidate mode set including the intra-frame prediction mode of the current block; and encoding candidate mode selection information for selecting the intra-frame prediction mode of the current block from among the two or more candidate modes when the candidate mode set including the intra-frame prediction mode of the current block includes two or more candidate modes; and transmitting said image data comprising said bit stream, wherein the left mode is an intra-frame prediction mode of a left block adjacent to the current block, and the upper mode is an intra-frame prediction mode of an upper block adjacent to the current block, Among them, the intra prediction mode includes 2 non-directional intra prediction modes and 65 directional intra prediction modes. wherein, when the left mode is equal to the top mode and the left mode is a planar mode, the second candidate mode set includes a first intra-frame prediction mode corresponding to an index value greater than 4 of the index value 50 of the vertical mode and a second intra-frame prediction mode corresponding to an index value less than 4 of the index value 50 of the vertical mode, and Among them, the second candidate mode set derived when the left mode is equal to the upper mode and the left mode is the planar mode is equal to the second candidate mode set derived when the left mode is equal to the upper mode and the left mode is the DC mode.

6. The transmission method according to claim 5, in, The information including the candidate mode set selection information and the candidate mode selection information is configured by a maximum of 6 bits.