Image encoding / decoding method and image data transmission method

By determining and encoding the intra prediction mode in multiple sets of candidate modes, the problem of excessive bit quantity of intra prediction mode in a low bit rate environment is solved, and efficient image encoding and decoding is achieved.

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

Patent Information

Application Number
CN202411317982.7
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-08

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 high-resolution 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 CN118921454A_ABST
    Figure CN118921454A_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 original invention patent application with 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] With the expansion and availability of high-definition (HD) resolution broadcasts nationwide and worldwide, many users have become accustomed to images with high resolution and high picture quality. Consequently, many organizations are driving the development of next-generation image devices. Furthermore, with growing interest in ultra-high definition (UHD), which has a resolution several times higher than HDTV, there is a need for technologies capable of compressing and processing images with even higher resolution and higher picture quality.

[0004] As image compression technologies, there are various technologies, such as inter-frame prediction technology that predicts pixel values ​​included in the current picture from pictures before or after the current picture, intra-frame prediction technology that predicts pixel values ​​included in the current picture using pixel information in the current picture, transform and quantization technology for compressing the energy of a residual signal, and entropy coding technology that assigns short codes to values ​​with high frequency of occurrence and long codes to values ​​with low frequency of occurrence. Image data can be transmitted and stored in a state where it is effectively compressed using these image compression technologies.

[0005] In order to transmit all the information generated during encoding / decoding, the number of bits required for transmission can be increased. In particular, when encoding slices in intra mode in a low bitrate environment, the number of bits required to predict the intra prediction mode will occupy a large part of the total number of bits, so an improved scheme 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 intra prediction modes.

[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 transmitting 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 including 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 including 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 judgment 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, which 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, which is used to indicate a mode that is the same as the intra-frame prediction mode of the current block among multiple modes, and each 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 mode 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, minimum value, average value, 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 may be selected from prediction modes smaller than the reference prediction mode and prediction modes 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 the number M indicating the number of candidate modes included in the first candidate mode set, or information about the 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: an additional determination step in addition to the first determination step and the second determination step, and performing the intra-frame prediction mode encoding step 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, one candidate mode from at least one candidate mode included in the candidate mode set as the intra-frame prediction mode of the 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 pattern set may include at least one of the following: a first candidate pattern set including M candidate patterns (M is an integer equal to or greater than 1), and a second candidate pattern set including N candidate patterns (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 indicating one candidate mode among the 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 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 among 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 modes included in the second candidate mode set may 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, minimum value, average value, 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 set.

[0032] Beneficial effects

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

[0034] Furthermore, according to the present invention, intra prediction modes 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 It 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 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] Figure 9 is a flowchart illustrating a method for decoding intra prediction modes according to an embodiment of the present invention.

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

[0047] Figure 11 It 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] Figure 12 is a diagram explaining a configuration example of 6 MPM candidate modes when supporting up to 67 intra prediction modes.

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

[0050] Figure 14 The explanation is based on Figure 12 FIG. 5 is 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] Figure 15 The explanation is based on Figure 12 FIG. 4 is a diagram illustrating various embodiments of configuring auxiliary IPM candidates based on an MPM candidate configured in the fourth case (Case 4). DETAILED DESCRIPTION

[0052] Since the present invention can be modified in various ways and there are various embodiments of the present invention, examples thereof will now be provided and described in detail with reference to the accompanying drawings. However, the present invention is not limited thereto, and the exemplary embodiments should be construed to include all modifications, equivalents, or alternatives within 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 drawings, the shapes and dimensions of elements may be exaggerated for clarity, and the same reference numerals will be used throughout to represent the same or similar elements. In the following detailed description of the present invention, reference is made to the accompanying drawings, which illustrate, by way of example, specific embodiments in which the present invention may 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, while different, are not necessarily mutually exclusive. For example, herein, specific features, structures, and characteristics described in connection with one embodiment may be implemented in other embodiments without departing from the spirit and scope of the present disclosure. Furthermore, 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 taken in a limiting sense, and the scope of the present disclosure is limited solely by the appended claims, with the full scope of equivalents thereto being appropriately interpreted.

[0053] The terms "first," "second," and the like used in the specification may be used to describe various components, but these components should not be construed as being limited to these terms. These terms are used only to distinguish one component from other components. For example, a "first" component may be referred to as a "second" component without departing from the scope of the present invention, and a "second" component may similarly be 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 referring to an element being "coupled" or "connected" to another element, this may mean that it is directly coupled or connected to the other element, but it should be understood that another element may exist between them. On the other hand, when referring to an element being "directly coupled" or "directly connected" to another element, it should be understood that there are no other elements between them.

[0055] In addition, the constituent parts shown in the embodiments of the present invention are shown independently to represent characteristic functions that are different from each other. Therefore, this does not mean that each component is composed of a separate hardware or software component unit. 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, embodiments that combine each component and embodiments that separate 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 be present 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 may be optional components that only improve its performance. In addition to the components used to improve performance, the present invention can be implemented by only including the components that are indispensable for achieving the essence of the present invention. In addition to the optional 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. When describing 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 components in the drawings are denoted by the same reference numerals, and repeated descriptions of the same components will be omitted.

[0059] In addition, in the following text, 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 among the images constituting a video." In this document, a picture may refer to an image.

[0060] Encoder: can 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: This refers to an MxN matrix of samples. In this article, M and N are positive integers. A block can also refer to a two-dimensional matrix of samples.

[0064] Unit: This refers to the unit used to encode or decode an image. When encoding or decoding an image, a unit may be a region generated by partitioning the image. Alternatively, when an image is subdivided and encoded or decoded, a unit may refer to a partitioned unit of an image. During encoding or decoding, predetermined processing may be performed on each unit. A single unit may be partitioned into smaller sub-units. Depending on its function, a unit may also refer to a block, macroblock (MB), code unit (CU), prediction unit (PU), transform unit (TU), code block (CB), prediction block (PB), or transform block (TB). A unit may refer to a luma component block, distinguished from a block, a chroma component block corresponding to a luma component block, and each block including its syntax elements. A unit may have various sizes and shapes. Specifically, the shape of a unit may include two-dimensional forms such as rectangles, cubes, trapezoids, triangles, pentagons, etc. Furthermore, the shape of a unit may include geometric figures. Furthermore, unit information may include at least one of the following: unit type, such as code unit, prediction unit, transform unit, etc.; unit size; unit depth; and encoding and decoding unit sequence.

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

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

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

[0068] Parameter set: This may correspond to header information in a structure within a bitstream. A parameter set may include at least one of a video parameter set, a sequence parameter set, a picture parameter set, and an adaptation parameter set. Furthermore, a parameter set may include information about a slice header and a tile header.

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

[0070] Code parameters: can include not only information encoded by the encoder and then sent to the decoder together with the syntax elements, but also information that can be derived during the encoding or decoding process, or can refer to parameters necessary for encoding and decoding. For example, code parameters can include at least one value and / or statistical data of the following: intra-frame prediction mode, inter-frame prediction mode, intra-frame prediction direction, motion information, motion vector, reference image index, inter-frame prediction direction, inter-frame 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 multiple 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. Prediction units 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 include a geometric figure.

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

[0073] Reference picture list: This may refer to a list that includes at least one reference picture used for inter prediction or motion compensation. Reference list types 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-frame prediction indicator: can refer to the inter-frame prediction direction (unidirectional prediction, bidirectional prediction) of the encoding / decoding target block. Alternatively, the indicator can refer to the number of reference pictures used to generate the prediction block of the encoding / decoding target block, or can 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 referenced 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 the offset between the encoding / decoding target image and the reference image. For example, (mvX, mvY) can indicate a motion vector, mvX can be the horizontal component, and mvY can be the 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: This refers to the basic unit when performing encoding / decoding of the residual signal (such as transformation, inverse transformation, quantization, inverse quantization, and encoding / decoding of transform coefficients). A single unit can be divided into smaller sub-units. The unit can have various sizes and shapes. In particular, the shape of the unit can include two-dimensional forms such as rectangles, squares, trapezoids, triangles, pentagons, etc. In addition, the shape of the unit can also include geometric figures.

[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, a 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: This can refer to a 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 transformation is performed. 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: This 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 not defined in advance in the encoder and decoder.

[0093] Figure 1 It 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 the video in a temporal order.

[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 can encode the input image in intra mode or inter mode or both. In addition, the encoding device 100 can generate a bit stream by encoding the input image, and can output the generated bit stream. When the intra mode is used as the prediction mode, the switch 115 can be switched to intra. When the inter mode is used as the prediction mode, the switch 115 can 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 can 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 a current image that is the target of current encoding. The input block may be referred to as a current block, or a coding target block that is the target of current encoding.

[0097] When the prediction mode is intra mode, the intra prediction unit 120 may use pixel values ​​of a previously encoded block adjacent to the current block as reference pixels. The intra prediction unit 120 may perform spatial prediction using reference pixels for spatial prediction and may generate prediction samples for the input block using spatial prediction. In this article, intra prediction may refer to prediction within a frame.

[0098] When the prediction mode is 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. Furthermore, 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. To perform inter-frame prediction or motion compensation, the motion prediction method and the compensation method of the prediction unit included in the code unit may be determined based on the code unit, among skip mode, merge mode, and 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 transforming the residual block.

[0103] 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 embodiments of the present invention.

[0104] The quantization unit 140 may quantize the transform coefficients according to the quantization parameter to generate quantized transform coefficient magnitudes 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 bitstream by performing entropy coding on the values ​​calculated by the quantization unit 140 or on the code parameter values ​​calculated during the encoding process, based on the probability distribution, and may output the bitstream. The entropy coding unit 150 may entropy code information used to decode the image and information about the pixels of the image. For example, the information used to decode the image may include syntax elements, etc.

[0106] When entropy coding is applied, a small number of bits are allocated to symbols with a high probability of occurrence and a large number of bits are allocated to symbols with a low probability of occurrence to represent the symbols, thereby reducing the size of the bit stream for encoding the 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 coding methods 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 for the target symbol and a probability model for the target symbol / bin, and can then use the derived binarization method or the derived probability model to perform arithmetic coding.

[0107] To encode the transform coefficient magnitudes, the entropy coding unit 150 may convert the two-dimensional block-shaped coefficients 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-shaped coefficients may be converted into a one-dimensional vector form. Depending on the size of the transform unit and the intra-frame prediction mode, vertical scanning, which scans the two-dimensional block-shaped coefficients along the column direction, and horizontal scanning, which scans the two-dimensional block-shaped coefficients along the row direction, may be used instead of an upper right scan. In other words, the scanning method among upper right scanning, vertical scanning, and horizontal scanning may be determined according to the size of the transform unit and the intra-frame prediction mode.

[0108] Coding parameters may include not only information encoded by the encoder and then transmitted 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, 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 refer to the difference between the original signal and the predicted signal. Alternatively, the residual signal may be a signal generated by transforming the difference between the original signal and the predicted signal. Alternatively, the residual signal may be a signal generated by transforming and quantizing the difference between the original signal and the predicted signal. The residual block may be a residual signal as a block unit.

[0110] When the encoding device 100 performs encoding using inter-frame prediction, the encoded current image can be used as a reference image for (a plurality of) other images to be processed thereafter. Therefore, the encoding device 100 can decode the encoded current image and store the decoded image as a reference image. To perform decoding, the encoded current image can be inversely quantized and inversely transformed.

[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, thereby generating a reconstructed block.

[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] A deblocking filter can remove block distortion that occurs at block boundaries. To determine whether to operate the deblocking filter, a determination can be made based on the pixels in a number of rows or columns included in the block whether to apply the deblocking filter to the current block. When applying the deblocking filter to a block, a strong or weak filter can be applied depending on the desired deblocking filter strength. Furthermore, when applying the deblocking filter, horizontal filtering and vertical filtering can be processed in parallel while performing vertical filtering and horizontal filtering.

[0114] Sample adaptive offset can add an optimal offset value to pixel values ​​to compensate for encoding errors. Sample adaptive offset can use pixels to correct the offset between the deblocking filtered image and the original image. To perform offset correction on a specific picture, a method can be used to apply offset correction by considering edge information for each pixel, or a method can be used to partition the pixels of the image into a predetermined number of regions, determine the region to be offset corrected, and apply the offset correction to the determined region.

[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 on 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 passing 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 apparatus 200 may include an entropy decoding unit 210 , an inverse quantization unit 220 , an inverse transform unit 230 , an intra prediction unit 240 , a motion compensation unit 250 , an adder 255 , a filter unit 260 , and a reference picture buffer 270 .

[0120] The decoding apparatus 200 may receive the bitstream output from the encoding apparatus 100. The decoding apparatus 200 may decode the bitstream in intra mode or inter mode. In addition, the decoding apparatus 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 bitstream 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] To decode the transform coefficient magnitudes, the entropy decoding unit 210 may convert the one-dimensional block coefficients into a two-dimensional vector form using a transform coefficient scanning method. For example, by scanning the coefficients of a block using an upper right scan, the one-dimensional block coefficients may be converted into a two-dimensional vector form. Depending on the size of the transform unit and the intra-frame prediction mode, vertical scanning or horizontal scanning may be used instead of an upper right scan. In other words, the scanning method among upper right scanning, vertical scanning, and horizontal scanning may be determined based on 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 inversely transformed by the inverse transform unit 230. The quantized transform coefficient magnitudes are dequantized and inversely transformed to generate a reconstructed residual block. Here, 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 using inter-frame mode, the motion compensation unit 250 can generate a prediction block by performing motion compensation using both the motion vector stored in the reference picture buffer 270 and the reference image. When the motion vector value is not an integer, the motion compensation unit 250 can generate the prediction block by applying an interpolation filter to a partial area in the reference image. To perform motion compensation, based on the code unit, the motion prediction method and the compensation method for the prediction unit included in the code unit can be determined among skip mode, merge mode, AMVP mode, and current picture reference mode. In addition, inter-frame prediction or motion compensation can be performed depending on the mode. Herein, current picture reference mode may refer to a prediction mode that uses a previously reconstructed area within the current picture containing the decoding target block. The previously reconstructed area may not be adjacent to the decoding target block. 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 current picture reference mode may be signaled, and this 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 be located at a fixed position (e.g., at a position where refIdx = 0 or at the last position) within the reference picture list used to decode the target block. Furthermore, it may be variably located within the reference picture list, and for this purpose, an additional reference picture index 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 encoding and decoding the image. Figure 3 An example of partitioning a single cell into a plurality of cells in a lower layer is schematically shown.

[0132] To efficiently partition an image, coding units (CUs) can be used during encoding and decoding. A unit can refer to 1) a syntax element and 2) a block containing a sample image. For example, "a partition of a unit" can refer to "a partition of a block corresponding to the unit." Block partition information can include depth information for the unit. The depth information can indicate the number of partitions in the unit and / or the degree of partitioning.

[0133] Reference Figure 3, the image 300 is sequentially partitioned 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 (positive integers greater than 2, including 2, 4, 8, 16, etc.). The width and height dimensions of each partitioned CU may be half the width and half the height of a single CU. Alternatively, the width and height dimensions of each partitioned CU may be smaller than the width and height dimensions of a single CU, depending on the number of partitioned units. Similarly, a partitioned CU may be recursively partitioned into multiple CUs, each CU being reduced by half in width and height from the partitioned CU.

[0135] Here, the partitioning of the CU may be performed recursively up to 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 coding unit (SCU) may be a predetermined maximum depth. Here, the LCU may be the CU with the largest CU size as described above, and the SCU may be the CU with the smallest 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 that has not yet been partitioned may have a size of 2N×2N for each depth, and a CU that has already been partitioned may be partitioned from a CU having a size of 2N×2N into a plurality of CUs each having a size of N×N. 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 is partitioned can be represented by 1 bit of partition information for each CU. All CUs except the 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 the CU 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) can be a basic unit of prediction. A PU can be encoded and decoded in any of skip mode, inter prediction mode, and intra prediction mode. A PU can be partitioned in various ways 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 inter prediction mode, 8 partition types can 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 illustrating 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 can be partitioned once or multiple times so that the CU 510 is formed of TUs of various sizes. Alternatively, a single CU 510 can be partitioned into at least one TU based on the number of horizontal lines and / or vertical lines that partition the CU. The CU can be partitioned into TUs that are symmetrical to each other, or can 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 can be signaled, or the information can be derived from information on the size and form of the CU.

[0147] While performing the transformation, the residual block may be transformed using one of the predetermined methods. For example, the predetermined method may include discrete cosine transform (DCT), discrete sine transform (DST), or Karhunen-Loève transform (KLT). To determine the method for transforming the residual block, the method may be determined by using at least one of inter-frame prediction mode information of the prediction unit, 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 illustrating 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] A PU may have a square form with an NxN or 2Nx2N size. NxN sizes may include 4x4, 8x8, 16x16, 32x32, 64x64, 128x128, and the like. Alternatively, a PU may have an MxN size. Here, M and N may be positive integers greater than 2, and M and N may be different numbers. The unit of a 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-frame prediction, a prediction block can 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-frame 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, the number of filter taps, and the filter strength, or the number of filtering processes, of the reference filter may be different.

[0154] In order to perform intra prediction, the intra prediction mode of the current prediction unit can be predicted by the intra prediction mode of the adjacent prediction unit. When the intra prediction mode of the current prediction unit is predicted by using the intra prediction mode information of the adjacent prediction unit, and the two modes are the same, the information that the two modes are the same can be sent by using a predetermined flag. Alternatively, when the modes are different, all prediction mode information within the encoding / decoding target block can 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 arrows in the image may indicate the prediction direction. In other words, the image may be encoded and / or decoded according to the direction of the arrows. According to the encoding type, each image may be classified as an I picture (intra picture), a P picture (unidirectionally predicted picture), a B picture (bidirectionally predicted picture), etc. Each image may be encoded and decoded according to the encoding type of each image.

[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 inter-frame prediction or motion compensation using a reference image in the forward direction. When the encoding target image is a B picture, the target image can be encoded by inter-frame prediction or motion compensation using reference images in the forward and reverse directions. Alternatively, the target image can be encoded by inter-frame prediction using 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-frame prediction or motion compensation can be performed by using a reference image and motion information. In addition, inter-frame prediction can use the skip mode described above.

[0160] The reference picture may be at least one of a previous picture and 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 using a reference picture index refIdx indicating the reference picture and a motion vector, which will be described later.

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

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

[0163] Each of the encoding apparatus 100 and the decoding apparatus 200 may determine a predetermined relative position based on a block located 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 located at a position spatially corresponding to the current block. Furthermore, the encoding apparatus 100 and the decoding apparatus 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 depending on the prediction mode of the encoding / decoding target block. For example, the prediction mode applied to inter-frame prediction may include Advanced Motion Vector Predictor (AMVP) mode, Merge mode, etc. Here, Merge mode may refer to Motion Merge mode.

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

[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 perform entropy encoding on the motion vector candidate index to generate the bitstream. The motion vector candidate index may indicate the optimal predicted motion vector selected from among the predicted motion vector candidates included in the motion vector candidate list. The motion vector candidate index may be transmitted from the encoding device 100 to the decoding device 200 via the bitstream.

[0167] The decoding apparatus 200 may entropy-decode a motion vector candidate index through a bitstream, and select a motion vector candidate of a decoding target block from among motion vector candidates included in a 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 the motion vector of the encoding target block and the motion vector candidate, and may entropy encode the motion vector difference (MVD). The bitstream may include the entropy-encoded MVD. The MVD is transmitted to the decoding device 200 via 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 via the bitstream. The decoding device 200 may predict the motion vector of the current block using motion information of adjacent blocks, and may derive the motion vector of the decoding target block using the predicted motion vector and the residual value of the predicted motion vector. The decoding device 200 may generate a prediction block for 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 can 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 of performing the merge mode by a CU unit or a PU unit, the encoding device 100 can generate a bit stream by entropy encoding predetermined information and send the bit stream to the decoding device 200. The bit stream 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 performed. 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 motion information existing 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 skip mode, the skip mode applies motion information of neighboring blocks to the encoding / decoding target block. Skip mode may be one of other modes for inter-frame prediction. When using skip mode, the encoding device 100 may generate a bitstream by entropy encoding information of neighboring blocks that can be used to encode the target block, and transmit the bitstream to the decoding device 200. The encoding device 100 may not transmit other information such as syntax information to the decoding device 200. The syntax information may include at least one of residual information of a motion vector, a coded block flag, and a transform coefficient level.

[0174] In the following, reference will be made to Figures 8 to 15The encoding / decoding method of the intra prediction mode is described. Hereinafter, the intra prediction mode is defined as IPM. In the present invention, auxiliary IPM (SIPM: auxiliary IPM) and auxiliary MPM (SMPM: auxiliary MPM) are used with 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 available intra-frame 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 a 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 on 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 the 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 that the candidate mode 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 pattern set including N candidate patterns may correspond to the second IPM candidate (candidate pattern 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 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 the information about the first determination result and the 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) adjacent blocks, the sample value of the current block, the sample value of (multiple) adjacent blocks, the statistics of the IPM of the adjacent blocks (such as distribution, mean, median, distribution value, norm value, etc.), the variation of the sample values ​​of the current block and / or adjacent blocks, the IPM value (s) included in the first candidate mode set, and the IPM value (s) included in the second candidate mode set. 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 pattern set, where n is an integer equal to or greater than 3.

[0189] Figure 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 can be selected from a single syntax element or from a plurality of syntax elements. The description of the first candidate mode set and the second candidate mode set can 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 mode. 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 at least one of 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(s) included in the first candidate mode set, and the IPM value(s) included in the second candidate mode set. Alternatively, when 3 or more candidate mode sets are provided, the decoding 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 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 (for example, 67). Hereinafter, for the sake of explanation, T is assumed to be 35. The intra prediction mode 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 Figure 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 Figure 10 shown, and their IPM indices can be set to

[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 blocks exactly placed in the left part and the upper part based on the current block 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] can be the same as Planar, DC, and Vertical. Therefore, after determining whether to copy, another IPM can be allocated to MPM[2] according to a predetermined order (Planar->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 two identical modes are planar or DC modes, the index of the MPM candidates can be set as follows: MPM[0] = planar, MPM[1] = DC, MPM[2] = vertical. Or, when two identical modes are angular modes When , 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] can 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 using 3 bits. (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 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 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 using at least one of the various entropy coding methods used in video standards.

[0217] D. The flag and index information may be encoded using at least one of the following entropy coding methods: After binarization, the flag and index information may be 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] -Unary Binarization Method

[0223] -Truncated unary binarization method

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

[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 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 MPM flag, the decoder can obtain the IPM value required for 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 modes, the value range of the IPM index value is 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 value is not the actual IPM value of the current decoding unit. The following table may be constructed to not include the three MPM candidate modes, and the encoder may transmit 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 that matches 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 instead 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, obtain the IPM value of the current block by increasing it 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 to be 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-frame prediction mode of the current coding intra-frame prediction mode is the same as one of the auxiliary IPM candidate modes, and the current coding intra-frame prediction mode is binarized by the FLC codeword, the current coding intra-frame 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-frame 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-frame 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] -Unary Binarization Method

[0245] - Truncated unary binarization method

[0246] The above method is not limited to using the secondary 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 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-frame prediction modes other than existing MPM candidate modes can be included in the auxiliary IPM candidate modes within the allowed number. The auxiliary IPM candidate modes can be obtained by subsampling N candidate modes from the entire intra-frame prediction mode excluding 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-frame prediction mode values ​​can be encoded.

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

[0250] Generally speaking, intra prediction modes of planar mode, DC mode, vertical mode, horizontal mode, and diagonal mode can 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 side component of the current block is strong to the diagonal.

[0251] For example, when 35 intra prediction modes are supported, Figure 11 In the case of MPEG-4 intra prediction modes, the intra prediction indices for vertical, horizontal, and diagonal modes may correspond to 26, 10, 18, and 34, respectively. When 67 intra prediction modes are supported, the intra prediction indices for vertical, horizontal, and diagonal modes may correspond to 50, 18, 34, and 66, respectively. Here, the intra prediction indices for planar mode and 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, auxiliary IPM candidate patterns 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 (Mid) 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 angular modes, where S <= M, the auxiliary IPM candidate modes can be constructed to include adjacent modes of each angular mode or intra-frame prediction modes corresponding to the maximum, minimum, average, and median values ​​of the angular modes. 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 deriving adjacent modes by using the angle mode information of the MPM candidate mode, each must have a different intra-frame 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. The intra-frame 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-frame prediction mode index range. (In Figure 11 In

[15] , when 67 intra prediction modes are supported and Max+2 is greater than 66, intra prediction mode 2 or greater 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 mode 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: Figure 12 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] Figure 12 The leftmost column of corresponds to the value indicating the intra prediction mode. Angle mode in intra prediction mode The non-angle modes O (planar mode) and 1 (DC mode) are shown in light grey and white.

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

[0262] Figure 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] Figure 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] Figure 12 The third case (case 3) is L! = A; however, neither of the corresponding modes is a planar mode, but one of them is a DC mode. Here, the 6 MPM candidate modes may include L, A, planar, Max-1, Max+1, and Max+2 modes.

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

[0266] Figure 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] Figure 12 The sixth case (case 6) is L!=A, one of the corresponding modes is the planar mode and the other is the 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 the auxiliary IPM candidate mode can be performed using at least the intra 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 prediction mode included in the MPM. Alternatively, it can be one or more angle modes in the intra prediction mode included in the MPM. At least one of the minimum value, maximum value, average value, median value of the angle mode or intra 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 prediction modes other than the MPM candidate mode as the reference prediction mode. In one embodiment, the minimum value among the remaining intra prediction modes can be set as the reference prediction mode.

[0269] Figure 13 It is the basis for explanation Figure 12 FIG. 1 is a diagram of various embodiments of constructing auxiliary IPM candidate patterns based on the construction of MPM candidate patterns.

[0270] exist Figure 13 middle, is the index of 67 intra prediction modes. Here, 0 and 1 can represent planar mode and DC mode. The auxiliary IPM candidate mode is set to 16 candidate modes. In addition, according to Figure 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 Figure 12In the first case, the intra prediction mode derived from the left and upper parts has a single angular mode (C), and in order to construct an MPM candidate mode with M modes (6 modes in this embodiment), the plane, C+1, C-1, C+2, and DC modes are added to the MPM candidate mode. Here, the reference prediction mode for constructing the subsampling of the N auxiliary IPM candidate modes can be the angular mode C. In other words, the N auxiliary IPM candidate modes can be subsampled based on C-1 and C+2 according to the following various 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 can be selected, or different numbers can be selected. In addition, while performing subsampling, the index interval can be set to 2, such as Figure 13 Alternatively, the index interval can be set to 1, as shown in (1) and (2). Figure 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. Figure 13 (4) and (5) 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. Figure 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 different prediction mode values. When the prediction mode value is saturated, the corresponding value can be replaced by another value. For example, when the value is greater than Figure 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 to another intra-frame prediction mode having a value smaller than 66, or may be changed to an intra-frame prediction mode having a value larger than 2. Alternatively, when an intra-frame prediction mode having an arbitrary value smaller than C-1 is obtained as an auxiliary IPM candidate mode, and the arbitrary value is smaller than 2, the intra-frame prediction mode may be changed to an intra-frame prediction mode having a value of 2 or larger, or having a value smaller than 66.

[0275] Figure 12The distribution of the MPM candidate patterns for Case 3 and Case 6 shown is the same as that for 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 value as the current intra-frame prediction mode can be sent.

[0277] In one embodiment, Figure 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, Figure 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 based on the unique value of the intra prediction mode according to the angle.

[0279] In one embodiment, Figure 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 the encoder / decoder.

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

[0282] exist Figure 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 indices.

[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, to construct 16 auxiliary IPM candidate modes, as in Case 1, the 16 auxiliary IPM candidate modes may include intra prediction modes with the same number or different numbers around the MPM candidate mode, or may be subsampled by applying an arbitrary index interval (1 or 2). Herein, the subsampling method for constructing the auxiliary IPM candidate mode may be performed using various methods as in Case 1 above. In this case, the entire prediction mode 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] Figure 15 The explanation is based on Figure 12 A block diagram of an example of constructing N auxiliary IPM candidate patterns in case 4. Figure 15 , the patterns represented in light gray correspond to patterns determined as MPM candidate patterns, and the patterns represented in dark gray correspond to auxiliary IPM candidate patterns.

[0287] exist Figure 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 can be constructed using the neighboring intra prediction modes adjacent to the corresponding angular modes.

[0288] Here, 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, to construct 16 auxiliary IPM candidate modes, intra prediction modes with the same number or different numbers around the angular prediction mode included in the MPM may be subsampled. Alternatively, as in Case 1, a portion of adjacent intra prediction modes using two different intra prediction modes and another portion of adjacent intra prediction modes using a planar mode or a DC mode may be used to construct the entire 16 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 embodiment, the N auxiliary IPM candidate modes can be subsampled based on the distribution and characteristics of the MPM. Alternatively, the N auxiliary IPM candidate modes can be subsampled based on an arbitrary index interval by sorting the remaining intra prediction modes excluding the MPM candidate modes in ascending or descending order. Herein, the arbitrary index interval can 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, the 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 each have an index range from 0 to 60. The 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 indices 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] When encoding the intra-frame prediction mode using the auxiliary IPM candidate mode, the information to be transmitted 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, when entropy encoding / decoding at least one of the above information, the information may be encoded 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] -Unary Binarization 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-frame prediction mode value can be decoded by decoding the SMPM index value.

[0310] In one embodiment, when the above two flags are "0", the intra-frame prediction mode value can then 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 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 values ​​and / or SIPM candidate values ​​can be sorted in ascending order or in descending order. In one embodiment, the MPM candidate values ​​and / or SIPM candidate values ​​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 SIPM candidate value, the decoded IPM index is increased 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, the 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 notifying flag information with a signal, one of the decoding methods of the intra prediction mode may be selectively used among the intra prediction mode decoding method based on the MPM candidate (first method), the intra prediction mode decoding method based on the auxiliary IPM candidate (second method), and the intra prediction mode decoding method based on the 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] -Unary Binarization Method

[0318] - Truncated unary binarization method

[0319] In one embodiment, the SMPM index and the IPM index can be entropy coded in the FLC or TU. In one embodiment, the SMPM index can be binarized in the FLC, and the IPM index can be encoded / decoded in the TU. In one embodiment, the SMPM index can be binarized in the TU, and the IPM index can 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 can be changed. For example, the following "log2_secondary_IPM_number_minus2" can be sent through the SPS or slice header, and in addition to the entropy coding defined in Table 3, at least one of the above-mentioned binarization methods can be used.

[0320] [Table 3]

[0321]

[0322] In the above embodiments, 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 may be performed simultaneously or in a different order than other steps. 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 may be added to the flowchart, or some of the steps may 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 methodologies 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 encompass all such substitutions, modifications, and variations that fall within the spirit and scope of the appended claims.

[0324] Computer-readable storage media may include program instructions, data files, data structures, and the like, either alone or in combination. The program instructions recorded in the computer-readable storage medium may be any program instructions specifically 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 memory (ROM), random access memory (RAM), and flash memory, which are specifically 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. A hardware device can be configured to be operated by one or more software modules, and vice versa, to perform the process 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 understood 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 should not be limited to the above-described embodiments, and the full scope of the appended claims and their equivalents should 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 comprising the following steps: 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 by 50 of the vertical mode and a second intra-frame prediction mode corresponding to an index value less than 4 by 50 of the vertical mode, wherein 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, and Among them, the second candidate mode set derived when the left mode is not equal to the upper mode, the left mode is a plane mode, and the upper mode is a DC 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 a plane mode.

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

3. An image encoding method performed by an encoding device, the image encoding method comprising the following steps: 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 by 50 of the vertical mode and a second intra-frame prediction mode corresponding to an index value less than 4 by 50 of the vertical mode, wherein 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, and Among them, the second candidate mode set derived when the left mode is not equal to the upper mode, the left mode is a plane mode, and the upper mode is a DC 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 a plane mode.

4. The image encoding method according to claim 3, wherein: 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 method comprising the following steps: 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 by 50 of the vertical mode and a second intra-frame prediction mode corresponding to an index value less than 4 by 50 of the vertical mode, wherein 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, and Among them, the second candidate mode set derived when the left mode is not equal to the upper mode, the left mode is a plane mode, and the upper mode is a DC 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 a plane mode.

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