Intra prediction method and apparatus

By deriving intra-frame prediction modes and using filtering correction techniques, the problem of low intra-frame prediction efficiency is solved, thereby improving the efficiency of image encoding/decoding.

CN116456096BActive Publication Date: 2026-02-27GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202310352558.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2018-07-02
Filing Date
2019-06-25
Publication Date
2026-02-27
Estimated Expiration
2039-06-25

AI Technical Summary

Technical Problem

Existing image encoding and decoding techniques are inefficient in intra-frame prediction, making it difficult to effectively improve encoding/decoding efficiency.

Method used

By deriving the intra-prediction mode of the current block, determining multiple pixel lines, performing intra-prediction, and improving encoding/decoding efficiency based on techniques such as filtering, correction, and sub-block segmentation.

Benefits of technology

By using sub-block unit prediction, intra-frame prediction across multiple pixel lines, reference pixel filtering, and correction, the encoding/decoding efficiency of intra-frame prediction is significantly improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116456096B_ABST
    Figure CN116456096B_ABST
Patent Text Reader

Abstract

According to the intra prediction method and device, the intra prediction mode of the current block can be derived, and the pixel line for the intra prediction of the current block in the multiple pixel lines is determined, and the intra prediction of the current block is performed based on the intra prediction mode and the pixel line. In addition, the filtering can be selectively performed on the first reference pixel of the determined pixel line, and the prediction pixel of the current block is selectively modified, so that the accuracy of the intra prediction is improved.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] Divisional Explanation

[0002] This application is a divisional application of PCT / KR2019 / 007651, filed on June 25, 2019, entered into Chinese National Phase as Chinese Patent Application No. 201980042368.5, with the title of "Intra prediction method and apparatus", the disclosure of which is incorporated herein by reference in its entirety.

[0003] Cross Reference to Related Applications

[0004] This application is based on and claims priority under Article 8 of the Patent Cooperation Treaty to Korean Patent Application No. 10-2018-0072558, filed on June 25, 2018, the disclosure of which is incorporated herein by reference in its entirety.

[0005] This application is based on and claims priority under Article 8 of the Patent Cooperation Treaty to Korean Patent Application No. 10-2018-0076783, filed on July 2, 2018, the disclosure of which is incorporated herein by reference in its entirety. TECHNICAL FIELD

[0006] The present application relates to an image encoding and decoding technique, and more particularly, to a method and apparatus for encoding / decoding of intra prediction. BACKGROUND

[0007] Recently, in various application fields, there is an increasing demand for high resolution, high quality images such as High Definition (HD) images and Ultra High Definition (UHD) images, and thus, high-efficiency image compression techniques are being developed.

[0008] As image compression techniques, there are inter prediction techniques of predicting pixel values included in a current picture from pictures before or after the current picture, intra prediction techniques of predicting pixel values included in a current picture using pixel information in the current picture, entropy encoding techniques of assigning short codes to information having a high frequency of occurrence and assigning long codes to information having a low frequency of occurrence, and the like, and image data can be efficiently compressed and transmitted or stored using these image compression techniques. SUMMARY

[0009] TECHNICAL PROBLEM

[0010] The present application relates to an image encoding and decoding technique, and more particularly, to a method and apparatus for encoding / decoding of intra prediction.

[0011] TECHNICAL SOLUTION

[0012] According to the intra prediction method and apparatus, the intra prediction mode of the current block can be derived, and a pixel line of the multiple pixel lines for the intra prediction of the current block can be determined, and the intra prediction of the current block can be performed based on the derived intra prediction mode and the determined pixel line.

[0013] According to the intra prediction method and apparatus, the filtering can be performed on the first reference pixel of the determined pixel line.

[0014] According to the intra prediction method and apparatus, the filtering can be selectively performed based on a first flag indicating whether the filtering is performed on the first reference pixel for the intra prediction.

[0015] According to the intra prediction method and apparatus, the first flag can be derived from a decoding apparatus based on an encoding parameter of the current block, and the encoding parameter can include at least one of a block size, a component type, an intra prediction mode, or whether the intra prediction in a sub-block unit is applied.

[0016] According to the intra prediction method and apparatus, the predicted pixel of the current block according to the intra prediction can be corrected.

[0017] According to the intra prediction method and apparatus, the correction can further include determining at least one of a second reference pixel or a weighting value for the correction based on a position of the predicted pixel of the current block.

[0018] According to the intra prediction method and apparatus, the correction step can be selectively performed considering at least one of a position of the pixel line of the current block, an intra prediction mode of the current block, or whether the intra prediction in a sub-block unit of the current block is performed.

[0019] According to the intra prediction method and apparatus, the intra prediction can be performed in a sub-block unit of the current block, and the sub-block can be determined based on at least one of a second flag regarding whether the partitioning is performed, partitioning direction information, or partitioning number information.

[0020] According to the intra prediction method and apparatus, the intra prediction mode can be derived based on a predetermined default mode or multiple MPM candidates.

[0021] Technical Effects

[0022] According to the present application, the encoding / decoding efficiency can be improved through the prediction in a sub-block unit.

[0023] According to the present application, the encoding / decoding efficiency of the intra prediction can be improved through the intra prediction based on multiple pixel lines.

[0024] According to the present application, the encoding / decoding efficiency of intra prediction can be improved by performing filtering on reference pixels.

[0025] According to the present application, the encoding / decoding efficiency of intra prediction can be improved by correcting intra prediction pixels.

[0026] According to the present application, the encoding / decoding efficiency of intra prediction mode can be improved by deriving the intra prediction mode based on default mode or MPM candidates. BRIEF DESCRIPTION OF DRAWINGS

[0027] Figure 1 is a block diagram of an image encoding apparatus according to an embodiment of the present application.

[0028] Figure 2 is a block diagram of an image decoding apparatus according to an embodiment of the present application.

[0029] Figure 3 is a schematic diagram showing a tree-based block shape.

[0030] Figure 4 is a schematic diagram showing a type-based block shape.

[0031] Figure 5 is a schematic diagram showing various block shapes that can be obtained by a partitioning block section of the present application.

[0032] Figure 6 is a schematic diagram for explaining tree-based partitioning according to an embodiment of the present application.

[0033] Figure 7 is a schematic diagram for explaining tree-based partitioning according to an embodiment of the present application.

[0034] Figure 8 is shown a partitioning block process according to an embodiment of the present application.

[0035] Figure 9 is a schematic diagram showing intra prediction modes predefined in an image encoding / decoding apparatus.

[0036] Figure 10 is shown an example of comparing pixels between color spaces in order to obtain correlation information.

[0037] Figure 11 is a schematic diagram for explaining reference pixel configuration for intra prediction.

[0038] Figure 12 is a schematic diagram for explaining reference pixel range for intra prediction.

[0039] Figure 13 is a diagram showing a block neighboring a current block with respect to generating a prediction block.

[0040] Figure 14 and Figure 15 are part examples for confirming the partition information of each block.

[0041] Figure 16 are schematic diagrams showing various cases of partitioned blocks.

[0042] Figure 17 Examples of partitioned blocks according to embodiments of the present application are shown.

[0043] Figure 18 Various examples of intra prediction mode candidate groups with respect to a block for which prediction information is generated (in this example, the prediction block is 2N x N) are shown.

[0044] Figure 19 Various examples of intra prediction mode candidate groups with respect to a block for which prediction information is generated (in this example, the prediction block is N x 2N) are shown.

[0045] Figure 20 Examples of partitioned blocks according to embodiments of the present application are shown.

[0046] Figure 21 and Figure 22 Various examples of intra prediction mode candidate groups with respect to a block for which prediction information is generated are shown.

[0047] Figure 23 to Figure 25 Examples of generating a prediction block according to the prediction mode of a neighboring block are shown.

[0048] Figure 26 is a schematic diagram of the relationship between a current block and neighboring blocks.

[0049] Figure 27 and 28 Intra prediction considering the directionality of the prediction mode is shown.

[0050] Figure 29 is a schematic diagram for explaining the configuration of reference pixels for intra prediction.

[0051] Figure 30 to Figure 35 is a schematic diagram with respect to the configuration of reference pixels. DETAILED DESCRIPTION

[0052] According to the intra prediction method and apparatus of the present application, the intra prediction mode of a current block can be derived, and a pixel line for intra prediction of the current block from a plurality of pixel lines is determined, and based on the intra prediction mode and the determined pixel line, intra prediction of the current block is performed.

[0053] According to the intra prediction method and apparatus of the present application, filtering can be performed on the first reference pixel of the determined pixel line.

[0054] The intra prediction method and apparatus according to the present application can selectively perform filtering of a first reference pixel for intra prediction based on a first flag indicating whether to perform the filtering.

[0055] The intra prediction method and apparatus according to the present application derives the first flag from a decoding apparatus based on an encoding parameter of a current block, which can include at least one of a block size, a component type, an intra prediction mode, or whether to apply intra prediction in a sub-block unit.

[0056] The intra prediction method and apparatus according to the present application can correct a prediction pixel of the current block according to the intra prediction.

[0057] The intra prediction method and apparatus according to the present application can further include determining at least one of a second reference pixel or a weighting value for the correction based on a position of the prediction pixel of the current block.

[0058] The intra prediction method and apparatus according to the present application can selectively perform the correction step considering at least one of a position of a pixel line of the current block, an intra prediction mode of the current block, or whether to perform intra prediction in a sub-block unit of the current block.

[0059] The intra prediction method and apparatus according to the present application can perform the intra prediction in a sub-block unit of a current block, and determine the sub-block based on at least one of a second flag regarding whether to perform partitioning, partitioning direction information, or partitioning number information.

[0060] The intra prediction method and apparatus according to the present application can derive the intra prediction mode based on a predetermined default mode or a plurality of MPM candidates.

[0061] The present application can perform various modifications and have various embodiments, and a specific embodiment is explained in detail with reference to the accompanying drawings. However, this is not intended to limit the present application to a specific embodiment, but to be understood as including all modifications, equivalents, or substitutes within the spirit and technical scope of the present application.

[0062] Terms such as first, second, A, B, etc. can be used to describe various elements, but the elements should not be limited by the terms. The purpose of the terms is only to distinguish one element from another element. For example, without departing from the scope of the present application, a first element can be referred to as a second element, and similarly, a second element can be referred to as a first element. The term "and / or" can include a combination of a plurality of related items or any item of a plurality of related items.

[0063] It will be understood that when an element as a means plus function is recited in the disclosure, such disclosure is intended to convey that the element is equivalent to a combination of the means plus function recited and the corresponding functions recited.

[0064] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the present application. Unless otherwise defined, all terms of art, including technical and scientific terms, used herein have the same meaning as commonly understood by one of ordinary skill in the art. Terms such as "comprising," "having," "containing," or "including" are to be construed as specifying the presence of what follows the term, but not precluding the presence of additional features, numbers, steps, actions, elements, components, or combinations thereof, unless otherwise indicated.

[0065] Unless otherwise defined, all terms of art, including technical and scientific terms, used herein have the same meaning as commonly understood by one of ordinary skill in the art. Terms such as "comprising," "having," "containing," or "including" are to be construed as specifying the presence of what follows the term, but not precluding the presence of additional features, numbers, steps, actions, elements, components, or combinations thereof, unless otherwise indicated.

[0066] The video encoding apparatus and the decoding apparatus can be a user terminal such as a personal computer (PC), a notebook computer, a personal digital assistant (PDA), a portable multimedia player (PMP), a Play Station Portable (PSP), a wireless communication terminal, a smart phone, a television, a virtual reality (VR) device, an augmented reality (AR) device, a mixed reality (MR) device, a head mounted display (HMD), smart glasses, etc., or a server terminal such as an application server and a service server, etc., and can include various apparatuses such as a communication apparatus including a communication modem or the like for performing communication with various devices or wired and wireless networks, a memory for storing various programs and data for intra- or inter-prediction in order to encode or decode an image or to perform encoding or decoding, and a processor for performing computation and control by executing the programs. Also, the image encoded into a bitstream by the image encoding apparatus can be transmitted to the image decoding apparatus in real time or non-real time through a wired and wireless communication network such as the Internet, a local area network, a wireless LAN network, a WiBro network, a mobile communication network, etc., or through various communication interfaces such as a cable, a universal serial bus (USB), etc., and then decoded by the image decoding apparatus, restored into an image, and reproduced.

[0067] In addition, the image encoded into a bitstream by the image encoding apparatus can be transmitted from the encoding apparatus to the decoding apparatus through a computer-readable storage medium.

[0068] The aforementioned image encoding apparatus and image decoding apparatus can be separate apparatuses, but can be composed as one image encoding / decoding apparatus according to circumstances. In this case, some configurations of the image encoding apparatus can be implemented in a manner at least including the same structure or at least performing the same function as some configurations of the image decoding apparatus as substantially the same technical elements.

[0069] Therefore, in the following detailed description of technical elements and operation principles thereof, etc., repeated descriptions of the corresponding technical elements will be omitted.

[0070] Also, since the image decoding apparatus corresponds to a computing apparatus to which an image encoding method performed by the image encoding apparatus is applied for decoding, the image encoding apparatus will be mainly described below.

[0071] The computing apparatus can include a memory storing a program or a software module for implementing the image encoding method and / or the image decoding method, and a processor connected to the memory to execute the program. The image encoding apparatus can be referred to as an encoder, and the image decoding apparatus can be referred to as a decoder.

[0072] Generally, an image can be configured as a series of still images, and the still images can be classified as a group of pictures (GOP), and each still image can be referred to as a picture. In this case, the picture can denote any one of a frame and a field in a progressive signal and an interlace signal, and when encoding / decoding is performed in units of frames, the image can be denoted by 'frame', and when encoding / decoding is performed in units of fields, the image can be denoted by 'field'. Although the present application assumes and describes a progressive signal, it can also be applicable to an interlace signal. As a higher concept, there can be a unit such as a GOP or a sequence, and each picture can be divided into predetermined areas such as a slice, a tile, a block, etc. In addition, one GOP can include units such as an I picture, a P picture, and a B picture. The I picture can refer to a picture encoded / decoded by itself without using a reference picture, and the P picture and the B picture can refer to pictures encoded / decoded by using a reference picture through motion estimation and motion compensation. Generally, in the case of the P picture, the I picture and the P picture can be used as a reference picture, and in the case of the B picture, the I picture and the P picture can be used as a reference picture, but the above definitions can also change depending on the settings of encoding / decoding.

[0073] Here, the picture to be encoded / decoded is referred to as a reference picture (Reference Picture), and the block or pixel to be referenced is referred to as a reference block (Reference Block) and a reference pixel (Reference Pixel). Also, the reference data (Reference Data) can be not only pixel values in the spatial domain (Spatial Domain) but also coefficient values in the frequency domain (Frequency Domain) and various encoding / decoding information generated and determined in the encoding / decoding process. For example, it can be intra prediction-related information or motion-related information in the prediction section, transform-related information in the transform section / inverse transform section, quantization information in the quantization section / inverse quantization section, and encoding / decoding-related information (context information) in the encoding section / decoding section, filtering-related information in the loop filter section, and the like.

[0074] The minimum unit constituting an image can be a pixel (Pixel), and the number of bits used to represent one pixel is referred to as bit depth (Bit Depth). Generally, the bit depth can be 8 bits, and more bit depths can be supported according to the encoding settings. According to the color space (Color Space), the bit depth can support at least one bit depth. In addition, at least one color space can be configured according to the color format (Color Format) of the image. According to the color format, it can be composed of one or more pictures having a certain size or one or more pictures having other sizes. For example, in the case of YCbCr 4:2:0, it can be composed of one luminance component (Y in this example) and two chrominance components (Cb / Cr in this example), and in this case, the composition ratio of the chrominance component to the luminance component can be 1:2 horizontally and vertically. As another example, in the case of 4:4:4, it can have the same composition ratio horizontally and vertically. As in the above-described example, when a picture is composed of more than one color space, the picture can be divided into each color space.

[0075] In the present invention, some color spaces (Y in this example) based on some color formats (YCbCr in this example) will be described, and similar applications can be performed for other color spaces according to the color format (depending on the settings of the specific color space). However, it is also possible to generate partial differences in each color space (independent of the settings of the specific color space). That is, depending on the settings of each color space can mean proportional to the composition ratio of each component, or have settings dependent on the composition ratio thereof (for example, 4:2:0, 4:2:2, 4:4:4, etc.), and independent of the settings of each color space can mean regardless of the composition ratio of each component, or have settings only for the corresponding color space. In the present invention, there can be independent settings or dependent settings for some compositions according to the encoder / decoder.

[0076] Setting information or syntax elements required in an image encoding process can be determined in units of video, sequence, picture, slice, tile, block, etc., which can be included in a bitstream in units of a video parameter set (VPS), a sequence parameter set (SPS), a picture parameter set (PPS), a slice header, a tile header, a block header, etc., and transmitted to an encoder, and a decoder can perform parsing in the same level units to restore the setting information transmitted from the encoder for use in an image decoding process. In addition, related information can be transmitted to a bitstream in the form of supplement enhancement information (SEI) or meta data, etc., for parsing for use. Each parameter set has a unique ID value, and a lower parameter set can have an ID value of an upper parameter set to be referred to. For example, a lower parameter set can refer to information of an upper parameter set having the same ID value among one or more upper parameter sets. In a case where one unit among examples of the various units described above includes one or more other units, the unit can be referred to as an upper unit, and the included units can be referred to as lower units.

[0077] Setting information generated in the units can include contents independently set for each corresponding unit or contents of dependent settings depending on a previous, subsequent, or upper unit. Here, the dependent settings can be understood as indicating setting information of a corresponding unit with flag information (e.g., if the 1-bit flag is 1, it is performed, and if it is 0, it is not performed), which indicates settings of a previous, subsequent, or upper unit. In the present disclosure, setting information will be described based on an example of independent settings, but can also include an example in which contents of setting information depending on a previous, subsequent, or upper unit of a current unit are added or replaced.

[0078] Figure 1 is a block diagram of an image encoding apparatus according to an embodiment of the present disclosure. Figure 2 is a block diagram of an image decoding apparatus according to an embodiment of the present disclosure.

[0079] Referring to Figure 1 The image encoding apparatus can include a prediction section, a subtraction section, a transform section, a quantization section, an inverse quantization section, an inverse transform section, an addition section, a loop filter section, a memory, and / or an encoding section, and some of the above-described structures can not necessarily be included, some or all of them can be selectively included as needed, and some other configurations not shown can be included.

[0080] Referring toFigure 2 The image decoding apparatus can include a decoding section, a prediction section, an inverse quantization section, an inverse transform section, an addition section, a loop filter section, and / or a memory, and some of the above-described structures can not necessarily be included, some or all can be selectively included as needed, and some other configurations not shown can be included.

[0081] The image encoding apparatus and the image decoding apparatus can be separate apparatuses, respectively, but can be configured as one image encoding / decoding device as needed. In this case, some configurations of the image encoding apparatus can be implemented as substantially the same technical elements as some configurations of the image decoding apparatus, in a manner including at least the same structures or at least performing the same functions. Therefore, in the following detailed description of technical elements and operation principles thereof, repetitive descriptions of the corresponding technical elements will be omitted. Since the image decoding apparatus corresponds to a computing apparatus to which an image encoding method to be performed by the image encoding apparatus is applied for decoding, the image encoding apparatus will be primarily described below. The image encoding apparatus can be referred to as an encoder, and the image decoding apparatus can be referred to as a decoder.

[0082] The prediction section can include an intra prediction section to perform intra prediction and an inter prediction section to perform inter prediction. Intra prediction can determine an intra prediction mode by configuring pixels of a neighboring block of a current block as reference pixels, and can generate a prediction block using the intra prediction mode, and inter prediction can determine motion information of the current block by using one or more reference images, and generate a prediction block by performing motion compensation using the motion information. It is determined whether to use intra prediction or inter prediction for a current block (coding unit or prediction unit), and specific information according to each prediction method (e.g., intra prediction mode, motion vector, reference image, etc.) can be determined. At this time, the processing unit to perform prediction and the processing unit to determine the prediction method and the specific content can be determined according to the encoding / decoding setting. For example, the prediction method, the prediction mode, etc. are determined by the prediction unit (or the encoding section), and the prediction is performed by the prediction block unit (or the encoding unit, the transform unit).

[0083] The subtraction section subtracts the prediction block from the current block to generate a residual block. That is, the subtraction section calculates a difference between a pixel value of each pixel of the current block to be encoded and a prediction pixel value of each pixel of the prediction block generated by the predictor to generate a residual block, which is a residual signal in an image.

[0084] The transform unit can transform a signal belonging to a spatial domain into a signal belonging to a frequency domain, and a signal obtained through the transform process is referred to as a Transformed Coefficient. For example, a transform block having a Transformed Coefficient can be obtained by performing a transform on a residual block having a residual signal received from the subtraction unit, but the input signal is not limited to a residual signal according to an encoding setting.

[0085] The transform unit can transform the residual block using a transform technique such as a Hadamard Transform, a Discrete Sine Transform (DST Based-Transform: Discrete Sine Transform), or a Discrete Cosine Transform (DCT Based-Transform: Discrete Cosine Transform), and the present application is not limited thereto, and various transform techniques to which improvements and modifications are performed can be used.

[0086] For example, at least one of the transform techniques can be supported, and at least one detailed transform technique can be supported in each transform technique. At this time, the at least one detailed transform technique can be a transform technique in which a part of a basis vector is differently configured in each transform method. For example, a DST-based transform and a DCT-based transform can be supported as a transform technique, and for the DST, a detailed transform technique of DST-I, DST-II, DST-III, DST-V, DST-VI, DST-VII, DST-VIII, etc. can be supported, and for the DCT, a detailed transform technique of DCT-I, DCT-II, DCT-III, DCT-V, DCT-VI, DCT-VII, DCT-VIII, etc. can be supported.

[0087] One of the transforms (for example, one transform technique and one detailed transform technique) can be set as a basic transform technique, and thus additional transform techniques (for example, a plurality of transform techniques, a plurality of detailed transform techniques) can be supported. Whether the additional transform techniques are supported can be determined in units of a sequence, a picture, a slice, a tile, etc., and thus related information can be generated in the unit, and when the additional transform techniques are supported, transform technique selection information can be determined in units of a block, etc., and related information is generated.

[0088] The transform can be performed in a horizontal / vertical direction. For example, a two-dimensional transform can be performed by performing a one-dimensional transform in a horizontal direction and a one-dimensional transform in a vertical direction using a basis vector in the transform, thereby transforming a pixel value of a spatial domain to a frequency domain.

[0089] In addition, the conversion in the horizontal / vertical direction can be adaptively performed. In detail, whether to perform the adaptive conversion can be determined according to at least one encoding setting. For example, in the case of intra prediction, when the prediction mode is a horizontal mode, DCT-I can be applied in the horizontal direction and DST-I can be applied in the vertical direction, when the prediction mode is a vertical mode, DST-VI can be applied in the horizontal direction and DCT-VI can be applied in the vertical direction, when Diagonal down left, DCT-II can be applied in the horizontal direction and DCT-V can be applied in the vertical direction, and when Diagonal down right, DST-I can be applied in the horizontal direction and DST-VI can be applied in the vertical direction.

[0090] The size and shape of each transform block can be determined according to the encoding cost of each candidate of the size and shape of the transform block, and the image data of each determined transform block and information on the size and shape of each determined transform block can be encoded.

[0091] The square transform in the transform form can be set as a basic transform form, and an additional transform form (for example, a rectangular shape) can be supported. Whether to support the additional transform form can be determined in units of a sequence, a picture, a slice, a tile, etc., and related information can be generated in the units, and the transform form selection information can be determined in units of a block, etc., and related information can be generated.

[0092] In addition, the support of the transform block form can be determined according to the encoding information. At this time, the encoding information can correspond to a slice type, an encoding mode, a size and shape of a block, a partitioning block method, etc. That is, one transform form can be supported according to at least one encoding information, and a plurality of transform forms can be supported according to at least one encoding information. The former can be an implicit case, and the latter can be an explicit case. In the explicit case, adaptive selection information indicating the best candidate group among a plurality of candidate groups can be generated and included in a bitstream. It can be understood that, in the present application including the present example, when the encoding information is generated explicitly, the corresponding information is included in the bitstream in various units, and the decoder parses the related information in various units to reproduce the decoded information. In addition, it can be understood that, when the encoding / decoding information is processed implicitly, the encoder and the decoder process through the same process and rule.

[0093] As one example, the support of the rectangular shape transform can be determined according to the slice type. In the case of an I slice, the supported transform can be a square transform, and in the case of a P / B slice, the transform can be a square or rectangular shape transform.

[0094] As one example, transform support of a rectangular shape can be determined according to a coding mode. In the case of Intra, the supported transform form can be a square-shaped transform, and in the case of Inter, the supported transform form can be a square or rectangular-shaped transform.

[0095] As one example, transform support of a rectangular shape can be determined according to a size and shape of a block. The supported transform form can be a square-shaped transform in a block of a predetermined size or more, and the supported transform form can be a square or rectangular-shaped transform in a block smaller than the predetermined size.

[0096] As one example, transform support of a rectangular shape can be determined according to a split block method. When a block on which a transform is performed is a block obtained through a Quard Tree split method, the supported transform form can be a square-shaped transform, and when a block obtained through a Binary Tree split method, the supported transform form can be a square or rectangular-shaped transform.

[0097] The above examples are examples of transform form support according to one coding information, and a plurality of information can be combined to participate in setting support of an additional transform form. The above examples are not limited to the above-described examples, but are directed to examples of supporting an additional transform form according to various coding settings, and various modification examples can be implemented.

[0098] According to a coding setting or a characteristic of an image, a transform process can be omitted. For example, according to a coding setting (assuming a lossless compression environment in this example), a transform process (including an inverse process) can be omitted. As another example, when a compression performance through a transform is not exerted according to a characteristic of an image, a transform process can be omitted. At this time, the omitted transform can be the entire unit, or one of a horizontal and vertical unit can be omitted, and whether to support such omission can be determined according to a size and shape of a block.

[0099] For example, in a setting in which omission of horizontal and vertical transforms is bundled, when a transform omission flag is 1, a transform is not performed in horizontal and vertical directions, and when 0, a transform can be performed in horizontal and vertical directions. In a setting in which horizontal and vertical transforms are independently operated, when a first transform omission flag is 1, a transform is not performed in a horizontal direction, and when 0, a transform is performed in a horizontal direction, when a second transform omission flag is 1, a transform is not performed in a vertical direction, and when 0, a transform is performed in a vertical direction.

[0100] In case the block size corresponds to Range A, transform omission can be supported, in case of Range B, transform omission cannot be supported. For example, if the horizontal length of the block is greater than M or the vertical length of the block is greater than N, transform omission flag cannot be supported, and if the horizontal length of the block is smaller than m or the vertical length of the block is smaller than n, transform omission flag can be supported. M (m) and N (n) can be the same or different. The settings related to transform can be determined in units of sequence, picture, slice, etc.

[0101] If additional transform techniques are supported, transform technique settings can be determined according to at least one encoding information. In this case, the encoding information can correspond to slice type, coding mode, size and shape of the block, prediction mode, etc.

[0102] As one example, support for transform techniques can be determined according to coding mode. If Intra, the supported transform techniques can be DCT-I, DCT-III, DCT-VI, DST-II, DST-III, and if Inter, the supported transform techniques are DCT-II, DCT-III, DST-III.

[0103] As one example, support for transform scheme can be determined according to slice type. In case of I slice, the supported transform techniques can be DCT-I, DCT-II, DCT-III, in case of P slice, the supported transform techniques can be DCT-V, DST-V, DST-VI, and in case of B slice, the supported transform techniques can be DCT-I, DCT-II, DST-III.

[0104] As one example, support for transform techniques can be determined according to prediction mode. The supported transform techniques in prediction mode A can be DCT-I, DCT-II, the supported transform techniques in prediction mode B can be DCT-I, DST-I, and the supported transform techniques in prediction mode C can be DCT-I. In this case, prediction modes A and B can be Directional Mode, and prediction mode C can be Non-Directional Mode.

[0105] As an example, support of transform techniques can be determined according to the size and shape of a block. A transform technique supported on a block above a certain size can be DCT-II, a transform scheme supported on a block smaller than a certain size can be DCT-II, DST-V, and a transform technique supported on a block above a certain size and a block smaller than a certain size can be DCT-I, DCT-II, DST-I. In addition, a transform technique supported in a square shape can be DCT-1, DCT-II, and a transform technique supported in a rectangular shape can be DCT-1, DST-1.

[0106] The above example is an example of support of transform techniques according to one encoding information, and multiple information can be combined to participate in setting support of additional transform techniques. It is not limited only to the above example, but can be transformed into other examples. In addition, the transform section can transmit information required to generate a transform block to the encoding section to perform encoding on the information, and include the information in a bitstream, and then transmit the information to a decoder, and a decoding section of the decoder parses the information and uses it for an inverse transform process.

[0107] The quantization section can quantize an input signal, and a signal obtained through a quantization process is referred to as a quantized coefficient. For example, a quantized block having a quantized coefficient can be obtained by performing quantization on a residual block having a residual transform coefficient received from the transform section, at this time, the input signal is determined according to an encoding setting, which is not limited to a residual transform coefficient.

[0108] The quantization section can perform quantization on a transformed residual block by using a quantization technique such as dead zone uniform threshold quantization, quantization weighted matrix, etc., but is not limited thereto, and various quantization techniques to which improvements and modifications are performed can be used.

[0109] In addition, the quantization section can transmit information required to generate a quantized block to the encoding section to perform encoding on the information, and include the information in a bitstream, and then transmit the information to a decoder, and a decoding section of the decoder parses the information and uses it for an inverse quantization process.

[0110] Although the above example has been described on the assumption that a transform and quantization are performed on a residual block by a transform section and a quantization section, a residual signal of a residual block can be transformed to generate a residual block having a transform coefficient, and a quantization process can not be performed. Not only can a quantization process be performed only in a case where a residual signal of a residual block is not transformed into a transform coefficient, but a transform and quantization process can not be performed. This can be determined according to an encoder setting.

[0111] The encoding section scans the generated quantized coefficients, transform coefficients, or residual signal of the residual block according to at least one scan order (e.g., zigzag scan, vertical scan, horizontal scan, etc.), generates a sequence of quantized coefficients, transform coefficients, or signal, and can perform encoding by using at least one entropy coding technique. At this time, information about the scan order can be determined according to an encoding setting (e.g., encoding mode, prediction mode, etc.), and the relevant information can be generated implicitly or explicitly. For example, one of a plurality of scan orders can be selected according to an intra prediction mode. At this time, the scan pattern can be set to one of various patterns such as zigzag, diagonal, raster, etc.

[0112] Also, encoded data including the encoded information transmitted from each of the constituent sections can be generated and output to a bitstream, which can be implemented by a multiplexer (MUX). At this time, the encoding technique can perform encoding using methods such as exponential Golomb, context adaptive variable length coding (CAVLC), context adaptive binary arithmetic coding (CABAC), etc., and the present application is not limited thereto, and various encoding techniques improved and modified can be used.

[0113] When entropy encoding (in this example, it is assumed that the syntax is CABAC) is performed on the residual block data and information such as syntax elements generated in the encoding / decoding process, the entropy encoding apparatus can include a binarizer, a context modeler, a binary arithmetic coder. At this time, the binary arithmetic coder can include a regular coding engine and a bypass coding engine. At this time, the regular coding engine can be a component executed with respect to the context modeler, and the bypass coding engine can be a component executed independently of the context modeler.

[0114] Since the syntax elements input to the entropy encoding apparatus can not be binary values, when the syntax elements are not binary values, the binarization section can output a bin string (BinString) consisting of 0 or 1 by performing binarization on the syntax elements. At this time, bin means a bit consisting of 0 or 1, and encoding can be performed by a binary arithmetic encoder. At this time, one of a regular encoding section or a bypass encoding section can be selected based on the generation probability of 0 and 1, which can be determined according to the encoding / decoding setting. If the syntax elements are data in which the frequencies of 0 and 1 are the same, the bypass encoding section can be used, and if it is different data, the regular encoding section can be used, and by context modeling (or updating context information), it can be used as a reference when performing the next regular encoding section.

[0115] At this time, the context is information about the generation probability of the bin, and the context modeling is a process of estimating the probability of the bin required for binary arithmetic encoding by inputting the bin as a result of binarization. In order to perform probability estimation, the syntax elements of the bin, the position index of the bin in the bin string, and the probability that the bin is included in the surrounding block, etc. can be used, and for this at least one context table can be used. For example, according to whether the surrounding block uses a combination of flags, a plurality of context tables can be used as some information for the flags.

[0116] When binarization is performed on the syntax elements, various methods can be used. For example, it can be divided into fixed length binarization (Fixed Length Binarization) and variable length binarization (Variable Length Binarization), and in the case of variable length binarization, unary binarization (Unary Binarization, Truncated Unary Binarization), truncated rice binarization (Truncated Rice Binarization), K-th Exp-Golomb binarization (K-th Exp-Golomb Binarization), and truncated binary binarization (Truncated binary) can be used. In addition, signed or unsigned binarization can be performed according to the range of values of the syntax elements. The binarization process of the syntax elements in the present invention includes not only the binarization mentioned in the above examples, but also other additional binarization methods.

[0117] The inverse quantization section and the inverse transform section can be implemented by inversely performing the processes of the transform section and the quantization section. For example, the inverse quantization section can perform inverse quantization on the quantized transform coefficients generated by the quantization section, and the inverse transform section can perform inverse transform on the inverse quantized transform coefficients to generate a restored residual block.

[0118] The adder reconstructs the current block by adding the predicted block and the reconstructed residual block. The reconstructed block can be stored in memory and used as reference data (prediction section, filter section, etc.).

[0119] The in-loop filtering unit may include at least one post-processing filtering component, such as a deblocking filter, a Sample Adaptive Offset (SAO), an Adaptive Loop Filter (ALF), etc. The deblocking filter can remove block distortion generated at the boundaries between blocks in the restored image. The ALF can perform filtering based on values ​​obtained by comparing the restored image with the input image. Specifically, filtering can be performed based on values ​​obtained by comparing the restored image after block filtering with the deblocking filter with the input image. Furthermore, filtering can be performed based on values ​​obtained by comparing the restored image after block filtering with the SAO with the input image.

[0120] The memory can store restored blocks or images. These restored blocks or images stored in memory can be provided to the prediction unit that performs intra-frame or inter-frame prediction. Specifically, the encoder can treat the storage space in the form of a queue of compressed bitstreams as a Coded Picture Buffer (CPB), and the space storing decoded images in picture units as a Decoded Picture Buffer (DPB). In the case of the CPB, decoded units are stored in decoding order, and the decoding operation can be simulated in the decoder. The compressed bitstream can be stored during the simulation, and the bitstream output from the CPB is restored through the decoding process. The restored image is stored in the DPB, and the images stored in the DPB can be referenced in subsequent image encoding and decoding processes.

[0121] The decoding unit can be implemented by reversing the processes in the encoding unit. For example, a quantization coefficient sequence, a transform coefficient sequence, or a signal sequence can be received from a bitstream and decoded, or decoded data including decoding information can be parsed and sent to each component unit.

[0122] On the other hand, although Figure 1 and Figure 2The image encoding apparatus and the image decoding apparatus are not shown in the above-described examples, but can further include a partitioning block section. Information on a basic coding unit can be obtained from the picture partitioning section, and the basic coding unit can represent a basic (or start) unit used for prediction, transform, quantization, etc. in the image encoding / decoding process. At this time, the coding unit can be composed of one luminance coding block and two chrominance coding blocks according to a color format (YCbCr in this example), and the size of each block can be determined according to the color format. In the examples described later, a description will be made based on a block (luminance component in this example). At this time, it is assumed that a description will be made on the premise that the block is a unit that can be obtained after determining each unit, and on the premise that a similar setting will be applied to other types of blocks.

[0123] The partitioning block section can be provided with respect to each element of the image encoding apparatus and the decoding apparatus, and the size and shape of the block can be determined through this process. At this time, the setting block can be defined differently according to the configuration section, and can correspond to a prediction block when the prediction section, a transform block when the transform section, and a quantization block when the quantization section. The present application is not limited thereto, and a block unit according to other constituent sections can be further defined. The size and shape of the block can be defined by the horizontal and vertical lengths of the block.

[0124] In the partitioning block section, the block can be represented as MxN, and can be obtained within the range of the maximum value and the minimum value of each block. For example, the shape of the block supports a square, and if the maximum value of the block is 256x256 and the minimum value is 8x8, blocks of 2 m ×2 m size (in this example, m is an integer of 3 to 8, for example, 8x8, 16x16, 32x32, 64x64, 128x128, 256x256), or 2m x 2m size (in this example, m is an integer of 4 to 128) or mxm size (in this example, m is an integer of 8 to 256) can be obtained. Alternatively, the shape of the block supports a square and a rectangle, and if the block has the same range as the above-described example, blocks of 2 m ×2 nblocks of 2m x 2n size (in this example, m and n are integers of 4 to 128). Or, blocks of m x n size (in which m and n are integers of 8 to 256) can be obtained.

[0125] The obtainable blocks can be determined according to the encoding / decoding settings (e.g., the type of blocks, the partitioning, the partitioning settings, etc.). For example, a coding block is a block of 2m x 2n size, a prediction block is a block of 2m x 2n or m x n size, and a transform block is a block of 2m x 2n size. Based on the settings, information such as the block size and the range (e.g., index and multiple related information) can be generated. m n × 2m x 2n size. Based on the settings, information such as the block size and the range (e.g., index and multiple related information) can be generated. m n The above range (in this example, the maximum and minimum values) can be determined according to the type of blocks. Also, in some blocks, the range information of the blocks can be generated explicitly, and in some blocks, the range information of the blocks can be determined implicitly. For example, the related information can be generated explicitly in the coding blocks and the transform blocks, and the related information can be processed implicitly in the prediction blocks.

[0126] The above range (in this example, the maximum and minimum values) can be determined according to the type of blocks. Also, in some blocks, the range information of the blocks can be generated explicitly, and in some blocks, the range information of the blocks can be determined implicitly. For example, the related information can be generated explicitly in the coding blocks and the transform blocks, and the related information can be processed implicitly in the prediction blocks.

[0127] In the explicit case, at least one range information can be generated. For example, in the case of the coding blocks, the information about the range can generate information about the maximum and minimum values. Or, it can be generated based on the difference between the maximum value and a preset minimum value (e.g., 8) (e.g., information based on the difference between the index of the generated maximum value and the minimum value, etc.). Also, information about multiple ranges of the horizontal and vertical lengths of the rectangular blocks can be generated.

[0128] ​​In the case of implicit, the range information can be obtained based on the encoding / decoding setting (e.g., type of block, partitioning method, partitioning setting, etc.). For example, in the case of a prediction block, in an encoding block as a higher unit (in this example, the maximum size of the encoding block is MxN and the minimum size is mxn), the maximum and minimum value information can be obtained from the candidate groups (in this example, MxN and mxn / 2x n / 2) available by the partitioning setting (in this example, quadtree partitioning + partitioning depth of 0) of the prediction block.

[0129] The size and shape of the initial (or starting) block of the partitioned block section can be determined by the higher unit. In the case of an encoding block, the basic encoding block obtained from the picture partitioning section can be the initial block, in the case of a prediction block, the encoding block can be the initial block, and in the case of a transform block, the encoding block or the prediction block can be the initial block, which can be determined according to the encoding / decoding setting. For example, when the encoding mode is Intra, the prediction block can be the higher unit of the transform block, and when Inter, the prediction block can be a unit independent of the transform block. The initial block can be partitioned into small blocks as the starting unit of partitioning. When the optimal size and shape according to the partitioning of each block are determined, the block can be determined as the initial block of the lower unit. For example, the former case can be an encoding block, and the latter case (lower unit) can be a prediction block or a transform block. As in the above example, when the initial block of the lower unit is determined, a partitioning process for searching for a block (e.g., higher unit) having an optimal size and shape can be performed.

[0130] In summary, the partitioned block unit can partition the basic encoding unit (or maximum encoding unit) into at least one encoding unit (or lower encoding unit). In addition, the encoding unit can be partitioned into at least one prediction unit, and can be partitioned into at least one transform unit. The encoding unit can be partitioned into at least one encoding block, the encoding block can be partitioned into at least one prediction block, and can be partitioned into at least one transform block. The prediction unit can be partitioned into at least one prediction block, and the transform unit can be partitioned into at least one transform block.

[0131] As shown in the above example, when a block having an optimal size and shape is found through a mode determination process, mode information (e.g., partitioning information) for the mode can be generated. The mode information can be included in the bitstream together with the information (e.g., prediction-related information, transform-related information, etc.) generated in the constituent section to which the block belongs, and is transmitted to the decoder, and is parsed in the decoder in the same level unit for the image decoding process.

[0132] Examples regarding the partitioning method will be described below, and will be described assuming that the initial block has a square shape, but the same or similar examples can be applied in the case of a rectangle.

[0133] The partitioning block part can support various partitioning methods. For example, tree-based partitioning or type-based partitioning can be supported, and other methods can be applied. In the case of tree-based partitioning, partitioning information can be generated using a partitioning flag, and in the case of type-based partitioning, partitioning information can be generated using index information for block shapes included in a preset candidate group.

[0134] Figure 3 is a schematic diagram showing tree-based block shapes.

[0135] Referring to Figure 3 , a denotes an example of obtaining one 2N×2N without partitioning, b denotes an example of obtaining 2N×N by a part of the partitioning flag (horizontal partitioning of a binary tree in this example), c denotes an example of obtaining two N×2N by the partitioning flag (vertical partitioning of a binary tree in this example), and d denotes an example of obtaining four N×N by a part of the partitioning flag (four partitioning of a quadtree or horizontal and vertical partitioning of a binary tree in this example). The shape of the block to be obtained can be determined according to the tree type used for partitioning. For example, when quadtree partitioning is performed, the candidate blocks that can be obtained can be a and d. When binary tree partitioning is performed, the candidate blocks that can be obtained can be a, b, c, and d. In the case of a quadtree, one partitioning flag is supported, and if the corresponding flag is '0', a can be obtained, and if the corresponding flag is '1', d can be obtained. In the case of a binary tree, a plurality of partitioning flags are supported, one of which can be a flag indicating whether to partition, one of which can be a flag indicating whether to perform horizontal / vertical partitioning, and one of which can be a flag indicating whether to allow overlapping horizontal / vertical partitioning. When overlapping is allowed, the candidate blocks that can be obtained can be a, b, c, and d, and when overlapping is not allowed, the candidate blocks that can be obtained can be a, b, and c. The quadtree can be a basic tree-based partitioning method, and in addition, a tree partitioning method (a binary tree in this example) can be included in the tree-based partitioning method. When a flag allowing additional tree partitioning is implicitly or explicitly activated, a plurality of tree partitioning can be performed. The tree-based partitioning can be a method that can perform recursive partitioning. That is, the partitioned block can be reset to the initial block, and tree-based partitioning can be performed, which can be determined according to partitioning settings such as a partitioning range and a partitioning allowed depth. This can be an example of a hierarchical partitioning method.

[0136] Figure 4 is a schematic diagram showing type-based block shapes.

[0137] As Figure 4As shown, the divided blocks can have 1 partition shape (a in this example), 2 partition shapes (b, c, d, e, f, and g in this example), and 4 partition shapes (h in this example) according to the type. The candidate group can be configured by various configurations. For example, the candidate group can be configured by a, b, c, n, or a, b to g, n, or a, n, q, etc. but is not limited thereto, and also includes examples described later, so that various modifications can be performed. When a flag allowing symmetric partition is activated, the supported block can be a, b, c, h in Figure 5 , and when a flag allowing asymmetric partition is activated, the supported block can be all of a to h in Figure 4 . In the former case, the related information (in this example, the flag allowing symmetric partition) can be activated implicitly, and in the latter case, the related information (in this example, the flag allowing asymmetric partition) can be generated explicitly. The type-based partition can be a manner supporting one-time partition. The block obtained through the type-based partition can not be able to perform further partitioning compared to the tree-based partition. This can be an example in which the partition allows a depth of zero (e.g., single-layer partitioning). Figure 4

[0138] Figure 5 is a schematic diagram showing various block shapes that can be obtained by the partition block part of the present application.

[0139] Referring to Figure 5 , blocks a to s can be obtained according to the partition setting and the partition manner, and can also have additional block shapes not shown.

[0140] As one example, for the tree-based partition, asymmetric partitioning can be allowed. For example, in the case of a binary tree, blocks like b, c in Figure 5 (in this example, the case of being divided into a plurality of blocks) can allow asymmetric partitioning, or blocks like b to g in Figure 5 (in this example, the case of being divided into a plurality of blocks) can allow asymmetric partitioning. If the flag allowing asymmetric partitioning is explicitly or implicitly deactivated according to the encoding / decoding setting, the obtainable candidate blocks can be b or c (this example assumes that horizontal and vertical overlapping partitioning is not allowed), and when the flag allowing asymmetric partitioning is activated, the obtainable candidate blocks can be b, d, e (in this example, horizontal partitioning) or c, f, g (in this example, vertical partitioning). This example can correspond to a case in which the partition direction is determined by a horizontal or vertical partitioning flag, and the block shape is determined according to the flag allowing asymmetric, however, the present application is not limited thereto, and can be transformed into other examples.

[0141] ​As an example, additional tree partitioning can be applied to tree-based partitioning. For example, a ternary tree, a quadtree, an octree, etc. partitioning can be performed, thereby obtaining n partitioned blocks (in this example, n is 3, 4, 8, n is an integer). In the case of a ternary tree, supported blocks (in this example, in the case of partitioning into a plurality of blocks) can be h to m, in the case of a quadtree, supported blocks can be n to p, and for an octree, supported blocks can be q. Depending on the encoding / decoding setting, it can be implicitly determined whether partitioning based on the tree is supported, or the relevant information can be explicitly generated. In addition, depending on the encoding / decoding setting, a binary tree or a quadtree partitioning can be used alone, or a binary tree and a quadtree partitioning can also be used in combination. For example, in the case of a binary tree, blocks such as b, c in FIG. 6A can be obtained, and when a binary tree and a ternary tree are used in combination (this example assumes the case where the usage range of a partial overlap binary tree and the usage range of a ternary tree are mixed), blocks such as b, c, i, l in FIG. 6B can be obtained. If a flag that allows further partitioning in addition to the existing tree is explicitly or implicitly deactivated according to the encoding / decoding setting, the obtainable candidate blocks can be b or c, and when activated, the obtainable candidate blocks are b, i or b, h, i, j (in this example, horizontal partitioning) or c, l or c, k, l, m (in this example, vertical partitioning). This example can correspond to the case where the partitioning direction is determined by a horizontal or vertical partitioning flag, and the block shape is determined according to a flag that allows additional partitioning, however, the present application is not limited thereto, and transformation into other examples is possible. Figure 5

[0142] As an example, a type-based block can allow non-rectangular partitioning. For example, partitioning in the shape of r, s is possible. When combined with the above-described type-based block candidate group, blocks such as a, b, c, h, r, s or a to h, r, s can be supported blocks. In addition, blocks that support n partitioning such as h to m (for example, n is an integer, in this example, 3 other than 1, 2, and 4) can be included in the candidate group.

[0143] The partitioning method can be determined according to the encoding / decoding setting.

[0144] As an example, the partitioning method can be determined according to the type of the block. For example, an encoding block and a transform block can use tree-based partitioning, and a prediction block can use type-based partitioning. Also, a combination of the two types of partitioning methods can be used. For example, a prediction block can use a partitioning method that mixes tree-based partitioning and type-based partitioning, and the partitioning method differs according to at least one range applied to the block.

[0145] ​For example, the splitting manner can be determined according to the size of the block. For example, certain ranges (e.g., a x b to c x d, the latter case is larger) between the maximum and minimum values of the block can perform splitting based on a tree, and certain ranges (e.g., e x f to g x h) can perform splitting based on a type. In this case, the range information according to the splitting manner can be explicitly generated or can be implicitly determined.

[0146] As one example, the splitting manner can be determined according to the shape of the block (or the block before splitting). For example, if the block shape is a square, splitting based on a tree and splitting based on a type can be performed. Or, when the block is rectangular, splitting based on a tree can be performed.

[0147] The splitting setting can be determined according to the encoding / decoding setting.

[0148] As one example, the splitting setting can be determined according to the type of the block. For example, in splitting based on a tree, a coding block and a prediction block can use a quad tree, and a transform block can use a binary tree. Or, in a coding block, the splitting allowed depth can be m, in a prediction block, the splitting allowed depth is n, and in a transform block, the splitting allowed depth can be set to o, and m, n and o can be the same or different.

[0149] For example, the splitting setting can be determined according to the size of the block. For example, in certain ranges (e.g., a x b to c x d), quad tree splitting can be performed, and in certain ranges (e.g., e x f to g x h, in this example, it is assumed that c x d is larger than g x h), binary tree splitting can be performed. In this case, the ranges can include all ranges between the maximum and minimum values of the block, and the ranges can have settings that do not overlap each other or can have overlapping settings. For example, the minimum value of certain ranges can be equal to the maximum value of certain ranges, or the minimum value of certain ranges can be smaller than the maximum value of certain ranges. If there are overlapping ranges, the splitting manner with a higher maximum value can have priority. That is, whether to perform the splitting manner with a lower priority according to the splitting result can be determined in the splitting manner with priority. In this case, the range information according to the tree type can be explicitly generated or can be implicitly determined.

[0150] As another example, in certain ranges (the same as the example) of the block, splitting based on a type with some candidate groups can be performed, and in certain ranges (the same as the example above), splitting based on a type with some candidate groups (at least one configuration in this example is different from the previous candidate group) can be performed. At this time, the ranges can include all ranges between the maximum and minimum values of the block, and the ranges can have settings that do not overlap each other.

[0151] As an example, the partitioning setting can be determined according to the shape of the block. For example, when the block has a square shape, quad-tree partitioning can be performed. Also, when the block is rectangular, binary-tree splitting can be performed.

[0152] For example, the partitioning setting can be determined according to the encoding / decoding information (e.g., slice type, color component, coding mode, etc.). For example, if the slice type is I, quad-tree (or binary-tree) partitioning can be performed in certain ranges (e.g., a x b to c x d), if P, in certain ranges (e.g., e x f to g x h), if B, in certain ranges (e.g., i x j to k x l). Also, when the slice type is I, the partitioning allowed depth of quad-tree (or binary-tree) partitioning can be set to m, when the slice type is P, to n, and when the slice type is B, to o, m and o can be the same or different. Some slice types can have the same setting as other slices (e.g., P and B slices).

[0153] As another example, when the color component is a luma component, the partitioning allowed depth of quad-tree (or binary-tree) partitioning can be set to m, and in the case of a chroma component, to n, m and n can be the same or different. Also, the partitioning range of quad-tree (or binary-tree) if the color component is a luma component (e.g., from a x b to c x d), and the partitioning range of quad-tree (or binary-tree) if the color component is a chroma component (e.g., e x f to g x h) can be the same or different.

[0154] As another example, if the coding mode is Intra, the partitioning depth of quad-tree (or binary-tree) can be m, if Inter, n (in this example, it is assumed that n is greater than m), and m and n can be the same or different. Also, the range of quad-tree (or binary-tree) partitioning when the coding mode is Intra and the range of quad-tree (or binary-tree) partitioning when the coding mode is Inter can be the same or different.

[0155] In the above examples, information about whether adaptive partitioning candidate group configuration is supported based on the encoding / decoding information can be explicitly generated or implicitly determined.

[0156] Through the above examples, a case where the partitioning manner and the partitioning setting are determined according to the encoding / decoding setting has been described. The above examples show some cases according to each element, and can be transformed into other forms. Also, the partitioning manner and the partitioning setting can be determined according to a combination of multiple elements. For example, the partitioning manner and the partitioning setting can be determined based on the type, size, shape, encoding / decoding information, etc. of the block.

[0157] In addition, in the above example, an element related to the division method, setting, or the like can be implicitly determined or information can be explicitly generated to determine whether to allow adaptation as in the above example.

[0158] In the division setting, the division depth refers to the number of spatial divisions based on the initial block (in this example, the division depth of the initial block is 0), and the more the division depth is increased, the smaller the block can be divided into. This can vary the setting related to the depth according to the division method. For example, in the tree-based division method, the quadtree division depth and the binary tree division depth can use one common depth or separate depths according to the tree type.

[0159] In the above example, when separate division depths are used according to the type of tree, the division depth can be set to 0 at the division start position of the tree (in this example, the block before division). The division depth can be calculated with the division start position as the center, without having to be based on the division range of each tree (the maximum value in this example).

[0160] Figure 6 is a diagram for explaining a tree-based division according to an embodiment of the present application.

[0161] a indicates an example of quadtree and binary tree division. Specifically, the upper left block of a shows quadtree division, the upper right and lower left blocks show division of quadtree and binary tree, and the lower right block shows binary tree division. In the diagram, a solid line (Quad1 in this example) indicates a boundary line that is divided into a quadtree, a dashed line (Binary1 in this example) indicates a boundary line that is divided into a binary tree, and a thick solid line (Binin2 in this example) indicates a boundary line that is divided into a binary tree. The difference between the dashed line and the thick solid line is the difference in the division method.

[0162] As one example, the quadtree division of the upper left block allows a depth of 3, and if the current block is NxN, division is performed until one of the horizontal or vertical reaches (N>>3), and division information is generated up to the division information of (N>>2). This is commonly applicable to the example described later. Assuming that the maximum and minimum values of the quadtree are NxN, (N>>3)x(N>>3)), when the tree division is performed, it can be divided into four blocks having a horizontal and vertical length of 1 / 2. When the division is activated, the value of the division flag can be '1', and when the division is deactivated, the value of the division flag can be '0'. According to this setting, the division flag of the upper left block can be generated together with the upper left block of b.

[0163] As an example, (assuming that the quad-tree partitioning allows a depth of 0, the binary tree partitioning allows a depth of 4, the maximum and minimum values of the quad-tree partitioning are NxN, (N»2)x(N»2), the maximum and minimum values of the binary tree are (N»1)x(N»1), (N»3)x(N»3), and the upper-right block is partitioned into four blocks having a length of 1 / 2 of the horizontal and vertical lengths in the case where the initial block performs the quad-tree partitioning), the upper-right block can be partitioned into four blocks having a length of 1 / 2 of the horizontal and vertical lengths. The size of the partitioned blocks is (N»1)x(N»), which means that the binary tree partitioning can be performed (in this example, greater than the minimum value of the quad-tree partitioning, but the case where the partitioning depth is limited). That is, this example can be an example in which the quad-tree partitioning and the binary tree partitioning cannot be used in overlap. The partitioning information of the binary tree of this example can be configured by a plurality of partitioning flags. Some flags can be horizontal partitioning flags (in this example, corresponding to x in x / y), and certain flags can be vertical partitioning flags (in this example, corresponding to y in x / y), and the configuration of the partitioning flags can have a setting similar to that of the quad-tree partitioning (for example, whether to perform activation). In this example, two flags can be repeatedly activated. When the flag information is generated with ‘-’ in the diagram, ‘-’ can correspond to implicit processing of the flag, in which implicit processing of the flag can occur when additional partitioning cannot be performed according to the maximum value, the minimum value, and the partitioning depth of the tree partitioning, and the like. According to this setting, the partitioning flags of the upper-right block can be generated together with the upper-left block of b.

[0164] As an example, (assuming that the quad-tree partitioning allows a depth of 3, the binary tree partitioning allows a depth of 2, the maximum and minimum values of the quad-tree partitioning are NxN, (N>>3)x(N>>3), the maximum and minimum values of the binary tree partitioning are (N>>2)x(N>>2), (N>>4)x(N>>4), and the partitioning priority is given to the quad-tree partitioning in the overlapping range), the lower-left block can be partitioned into four blocks having a length of 1 / 2 of the horizontal and vertical lengths when the quad-tree partitioning is performed in the initial block. The size of the partitioned block is (N>>1)x(N>>1), which means that the binary tree partitioning and the quad-tree partitioning can be performed according to the settings of this example. That is, this example can be an example in which the quad-tree partitioning and the binary tree partitioning can be used in overlap. In this case, whether to perform the binary tree partitioning can be determined according to the quad-tree partitioning result given the priority. When the quad-tree partitioning is performed, the binary tree partitioning is not performed, and if the quad-tree partitioning is not performed, the binary tree partitioning can be performed. If the quad-tree partitioning is not performed, even if the condition for performing the partitioning is satisfied according to the above settings, the quad-tree partitioning can not be performed. The partitioning information of the binary tree of this example can be configured by a plurality of partitioning flags. Some flags can be partitioning flags (in this example, corresponding to x in x / y), and some flags can be partitioning direction flags (in this example, corresponding to y in x / y, whether y information is generated can be determined according to x), and the partitioning flags can have settings similar to those of the quad-tree partitioning. In this example, the horizontal partitioning and the vertical partitioning cannot be activated in overlap with each other. When the flag information is generated as '-' in the diagram, '-' can have settings similar to those of the above example. According to the settings, the partitioning flags of the lower-left block can be generated together with the lower-left block of b.

[0165] As an example, (assuming that the binary tree partitioning allows a depth of 5, the maximum and minimum values of the binary tree partitioning are NxN, (N>>2)x(N>>3) for the right-bottom block), the right-bottom block can be partitioned into two blocks having a length of 1 / 2 of the horizontal and vertical lengths when the binary tree partitioning is performed in the initial block. The partitioning flag settings of this example can be the same as those of the lower-left block. When the flag information is generated as '-' in the diagram, '-' can have settings similar to those of the above example. This example shows a case in which the minimum values of the horizontal and vertical of the binary tree are set differently. According to the settings, the partitioning flags of the right-bottom block can be generated together with the right-bottom block of b.

[0166] As shown in the above examples, after confirming the block information (e.g., type, size, shape, position, slice type, color component, etc.), the partitioning method and the partitioning settings according thereto can be determined, and the partitioning process can be performed accordingly.

[0167] Figure 7 is a diagram for explaining the tree-based partitioning according to an embodiment of the present application.

[0168] Referring to blocks a and b, the thick solid line L0 represents the largest coding block, and the blocks divided by the thick solid line and other lines L1 to L5 represent divided coding blocks, and the numbers within the blocks represent the positions of the divided sub-blocks (in this example, in Raster Scan order), the number of '-'s represents the division depth that the corresponding block has, and the numbers of the boundary lines between the blocks represent the number of divisions. For example, if it is divided into four (in this example, quad-tree), it has the order of UL(0)-UR(1)-DL(2)-DR(3), if it is divided into two (in this example, binary tree), it has the order of L or U(0)-R or D(1), which can be defined at each division depth. The example described later shows the case where the available coding blocks are limited.

[0169] As one example, assume that the largest coding block of a is 64x64, the minimum coding block is 16x16, and quad-tree division is used. In this case, because the 2-0, 2-1, 2-2 blocks (in this example, 16x16 size) are equal to the size of the minimum coding block, it is possible not to be divided into smaller blocks such as 2-3-0, 2-3-1, 2-3-2, 2-3-3 blocks (in this example, 8x8 size). In this case, because the blocks available in the blocks 2-0, 2-1, 2-2, and 2-3 have 16x16 blocks, i.e., one candidate group, block division information is not generated.

[0170] As one example, assume that the largest coding block of b is 64x64, the minimum coding block is 8 in the horizontal or vertical direction, and the allowed division depth is 3. In this case, because the 1-0-1-1 block (in this example, 16x16 size, division depth 3) satisfies the minimum coding block condition, it is possible to divide it into smaller blocks. However, because it is equal to the allowable division depth, it is possible not to be divided into blocks having a deeper division depth (in this example, 1-0-1-0-0, 1-0-1-0-1 blocks). In this case, in the 1-0-1-0 and 1-0-1-1 blocks, because the available blocks have 16x8 blocks, i.e., one candidate group, block division information is not generated.

[0171] As shown in the above example, quad-tree partitioning or binary-tree partitioning can be supported according to encoding / decoding. Alternatively, quad-tree partitioning and binary-tree partitioning can be supported in a mixed manner. For example, one or two of the above-described manners can be supported according to block size, partition depth, and the like. If a block belongs to a first block range, quad-tree can be supported, and if the block belongs to a second block range, binary-tree partitioning can be supported. When a plurality of partitioning manners are supported, at least one of a maximum coding block size, a minimum coding block size, an allowable partition depth, and the like according to each manner can be set. The ranges can be set to overlap each other or can not overlap. Alternatively, it is also possible that one range includes a setting of another range. The above-described setting can be determined according to a single or mixed factor such as a slice type, an encoding mode, a color component, and the like.

[0172] As one example, the partitioning setting can be determined according to a slice type. In the case of an I slice, the supportable partitioning setting is that the supportable partitioning range is 128x128 to 32x32 in the case of a quad-tree, and the supportable partitioning range is 32x32 to 8x8 in the case of a binary-tree. In the case of a P / B slice, the supportable partitioning setting is that the supportable partitioning range is 128x128 to 32x32 in the case of a quad-tree, and the supportable partitioning range is 64x64 to 8x8 in the case of a binary-tree.

[0173] As one example, the partitioning setting can be determined according to an encoding mode. When the encoding mode is Intra, for the supportable partitioning setting, 64x64 to 8x8 partitioning range and an allowable partition depth of 2 can be supported in the case of a binary-tree. When the encoding mode is Inter, for the supportable partitioning setting, 32x32 to 8x8 partitioning range and an allowable partition depth of 3 can be supported in the case of a binary-tree.

[0174] As one example, the partitioning setting can be determined according to a color component. In the case of a luma component, the supportable partitioning range is 256x256 to 64x64 in the case of a quad-tree, and the supportable partitioning range is 64x64 to 16x16 in the case of a binary-tree. In the case of a chroma component, the same setting as the luma component is supported in the case of a quad-tree (in this example, the length ratio of each block is set according to a chroma format), and the supportable partitioning range is 64x64 to 4x4 in the case of a binary-tree (in this example, assuming that the range in the luma component is 128x128 to 8x8, 4:2:0).

[0175] The examples describe setting different cases according to the type of the block. In addition, some blocks can be combined with other blocks to perform one segmentation process. For example, when combining the coding block and the transform block into one unit, a segmentation process is performed to obtain the optimal block size and shape, which can not only be the optimal size and shape of the coding block, but also the optimal size and shape of the transform block. Alternatively, the coding block and the transform block can be combined into one unit, the prediction block and the transform block can be combined into one unit, the coding block, the prediction block, and the transform block can be combined into one unit, and combinations can be performed on other blocks.

[0176] In the present disclosure, cases where a separate segmentation setting is provided in each block are described, but a plurality of units can also be combined into one unit to have one segmentation setting.

[0177] In the above process, the generated information will be included in the bitstream in at least one unit of the sequence, picture, slice, tile, etc. in the encoder, and the decoder will parse the relevant information from the bitstream.

[0178] In the image encoding / decoding process, cases where the input pixel value and the output pixel value are different can occur, and an adjustment process of the pixel value can be performed to prevent distortion due to an operation error. The pixel value adjustment method is a process of adjusting the pixel value that exceeds the range of the pixel value to within the range of the pixel value, and can be referred to as clipping.

[0179] pixel_val' = Clip_x(pixel_val, minl, maxl) Clip_x(A, B, C) { if (A < B) output = B; else output = C; Figure 8 }

[0180] Table 1

[0181] Table 1 is an example code for a clipping function (Clip_x) for performing pixel value adjustment. Referring to Table 1, an input pixel value (pixel_val) and a minimum value (minI) and a maximum value (maxI) of an allowed pixel value range can be input as parameters of the clipping function (Clip_x). At this time, if described based on a bit depth (bit_depth), the minimum value (minI) can be 0 and the maximum value (maxI) can be (2bit_depth-1). When the clipping function (Clip_x) is executed, the input pixel value (pixel_val, parameter A) less than the minimum value (minI) is changed to the minimum value (minI), and the input pixel value greater than the maximum value maxI (parameter C is ) can be changed to the maximum value (maxI). Accordingly, the output value (output) can be returned as an output pixel value (pixel_val') that completes the pixel value adjustment.

[0182] At this time, the range of pixel values is determined according to the bit depth, but according to the kind and characteristics of an image, pixel values constituting an image (e.g., picture, slice, tile, block, etc.) are different, and thus are not necessarily generated in all pixel value ranges. According to an embodiment of the present application, the range of pixel values constituting an actual image can be referred to, and thus used for an image encoding / decoding process.

[0183] For example, in the pixel value adjustment method according to Table 1, the minimum value (minl) of the clipping function can be used as the minimum value among pixel values constituting an actual image, and the maximum value (maxl) of the clipping function can be used as the maximum value among pixel values constituting an actual image.

[0184] In summary, an image encoding / decoding apparatus can include a pixel value adjustment method based on a bit depth and / or a pixel value adjustment method based on the range of pixel values constituting an image. In an encoder / decoder, flag information for determining whether to support an adaptive pixel value adjustment method can be supported, when the flag information is '1', pixel value adjustment method selection information can be generated, and when the flag information is '0', a preset pixel value adjustment method (in this example, a method based on a bit depth) can be used as a basic pixel value adjustment method. When the pixel value adjustment method selection information indicates a pixel value adjustment method based on the range of pixel values constituting an image, pixel value related information of an image can be included. For example, information on the minimum value and the maximum value of each image according to a color component and a median value to be described later can be included. Information generated when adjusted can be recorded and transmitted in units of video, sequence, picture, slice, tile, block, etc. of an encoder, and the information recorded in a decoder can be parsed to reproduce related information in the same unit.

[0185] On the other hand, through the process, and through pixel value adjustment based on a bit depth or pixel value adjustment based on the range of pixel values constituting an image, the range of pixel values including the minimum value and the maximum value of pixel values can be changed (determined or defined), and additional pixel value range information can also be changed (determined or defined). For example, the maximum value and the minimum value of pixel values constituting an actual image can be changed, and a median value for configuring pixel values can also be changed.

[0186] That is, in the pixel value adjustment process according to the bit depth, minI can represent a minimum pixel value of an image, maxI can represent a maximum pixel value of the image, I can represent a color component, and medianI can represent a center pixel value of the image. minI can be 0, maxI can be (1 « bit_depth - 1) - 1, midI can be 1 « (bit_depth - 1), and medianI can be obtained in other forms including the above examples according to the encoding / decoding setting. The median is only a term used for description in the present invention, and can refer to one information of a pixel value range information which can be changed (determined or defined) according to the pixel value adjustment process in the image encoding / decoding process.

[0187] For example, in the pixel value adjustment process according to the range of pixel values constituting an image, minI can be a minimum pixel value of the image, maxI can be a maximum pixel value of the image, and medianI can be a center pixel value of the image. medianI can be an average of pixel values in the image, can be a value located at the center when aligning pixels of the image, can be a value obtained according to the pixel value range information of the image. medianI can be derived in at least one of minI and maxI. That is, medianI can be one pixel value existing within the pixel value range of the image.

[0188] Specifically, medianI can be a value obtained according to the pixel value range information (minI and maxI in this example) of the image, for example, (minI + maxI) / 2 or (minI + maxI) » 1, (minI + maxI + 1) / 2, (minI + maxI + 1) » 1, and medianI can be obtained in other forms including the above examples according to the encoding / decoding setting.

[0189] Next, an embodiment of the pixel value adjustment process (median in this example) will be described.

[0190] As one example, the base bit depth is 8 bits (0 to 255), and the pixel value adjustment process based on the range of pixel values constituting an image (in this example, a minimum value of 10, a maximum value of 190; a median value of 100 derived (averaged) from the minimum value and the maximum value) is selected, and if the current block position is the first block in the image (picture in this example), the neighboring blocks (left, lower left, upper left, upper, upper right in this example) for encoding / decoding do not exist, and thus the reference pixels can be filled with the median value of 100. The intra prediction process can be performed using the reference pixels according to the prediction mode.

[0191] As an example, the basic bit depth is 10 bits (0 to 1023), and a pixel value adjustment process is chosen based on the range of pixel values ​​constituting the image (in this example, the median value is 600, and relevant syntax elements exist). The current block is the first block within the image (in this example, a slice, a tile). Neighboring blocks for encoding / decoding (in this example, left, bottom left, top left, top, top right) do not exist, so the reference pixel can be filled with the median value 600. Intra-frame prediction can be performed using this reference pixel according to the prediction mode.

[0192] As an example, the basic bit depth is 10 bits, and a pixel value adjustment process based on the range of pixel values ​​constituting the image is selected (in this example, the median value is 112, and there is a relevant syntax element). Depending on the encoding mode of adjacent blocks (intra-prediction / inter-prediction), a setting is activated to determine whether pixels from the corresponding block can be used in the prediction of the current block (in this example, when the encoding mode of the corresponding block is intra-prediction, it can be used as a reference pixel for the current block; it is not available during intra-prediction. When this setting is deactivated, it can be used as a pixel for the current block, regardless of the encoding mode of the corresponding block; the relevant syntax element is constrained_intra_pred_flag, which may appear in P or B image types). If the current block is located on the left side of the image, there are no adjacent blocks for encoding / decoding (in this example, left, bottom left, top left). If there are adjacent blocks (in this example, right and top right) for encoding / decoding, but because the encoding mode of that block is inter-prediction and is disabled by the above setting, there are no usable reference pixels, then the reference pixels can be filled with the median value (112 in this example). That is, since there are no usable reference pixels, the median of the image pixel value range can be used to fill the gap. The reference pixels can then be used to perform an intra-frame prediction process based on the prediction mode.

[0193] In the above embodiments, the prediction unit has illustrated various cases related to the median, but this can be included in another configuration of video encoding / decoding. Furthermore, the present invention is not limited to the above embodiments and can be modified and extended in various cases.

[0194] In the present application, the pixel value adjustment process can be applied to the encoding / decoding process of the prediction section, the transform section, the quantization section, the inverse quantization section, the inverse transform section, the filter section, the memory, etc. For example, the input pixel in the pixel value adjustment method can be a reference pixel (Reference Sample) or a prediction pixel (Prediction Sample) in the prediction process, and can be a reconstructed pixel (Reconstructed Sample) in the transform, quantization, inverse transform, and inverse quantization processes. Also, the pixel can be a reconstructed pixel in the loop filter process, or can be a stored pixel in the memory. In this case, the reconstructed pixel in the transform, quantization, and inverse transform, inverse quantization processes can refer to the reconstructed pixel before applying the loop filter. The reconstructed pixel in the loop filter can refer to the reconstructed pixel after applying the loop filter. The reconstructed pixel in the deblocking filter process can refer to the reconstructed pixel after applying the decoding filter. The reconstructed pixel in the SAO process can refer to the reconstructed pixel after applying the SAO. The reconstructed pixel in the ALF process can refer to the reconstructed pixel after applying the ALF. Examples of various cases as described above have been described, but the present application is not limited thereto, and can be applied to the input, intermediate, output steps of all encoding / decoding processes that call the pixel value adjustment process.

[0195] In the examples described later, it is described under the assumption that the clipping function Clip_Y of the luminance component Y and the clipping functions Clip_Cb, Clip_Cr of the color difference components Cb, Cr are supported.

[0196] In the present application, the prediction section can be classified into intra prediction and inter prediction, and the intra prediction and the inter prediction can be defined as follows.

[0197] The intra prediction can be a technique of generating a prediction value from a region for which the encoding / decoding of the current image (for example, a picture, a slice, a tile, etc.) is completed, and the inter prediction can be a technique of generating a prediction value from an image (for example, a picture, a slice, a tile, etc.) for which the encoding / decoding is completed before the current image.

[0198] Also, the intra prediction can be a technique of generating a prediction value from a region for which the encoding / decoding of the current image is completed, but there are some prediction methods that can be a method of excluding, for example, a prediction of generating a prediction value from a reference image, block matching (Block Matching), template matching (Template Matching), etc., and the inter prediction can be a technique of generating a prediction value from an image for which the encoding / decoding is completed, the image for which the encoding / decoding is completed can be configured to include the current image.

[0199] One of the above definitions can be followed according to the encoding / decoding setting, and the following examples will be described assuming that the first definition is followed. In addition, although the description is made under the assumption that the predicted value is a value obtained by prediction in the spatial domain, the present application is not limited thereto.

[0200] QT A split block process according to an embodiment of the present application is shown. In detail, examples of the size and shape of a block that can be obtained from a basic coding block according to one or more split methods are shown.

[0201] In the figure, the thick solid line indicates a basic coding block, the thick dashed line indicates a quad-tree split boundary, the double solid line indicates a symmetric binary tree split boundary, the solid line indicates a ternary tree split boundary, and the thin dashed line indicates an asymmetric binary tree split boundary. The lines other than the thick solid line all indicate boundaries split according to each split method. The split settings (e.g., split type, split information, split information configuration order, etc.) described below are not limited to the corresponding examples, and can have various alternative examples.

[0202] For ease of explanation, it is assumed that the description is made based on a basic coding block (2Nx2N, 128x128) after the left upper, right upper, left lower, and right lower blocks (NxN, 64x64) have separate split block settings. First, in the initial block, a state in which four sub-blocks are obtained due to one split operation (split depth 0 -> 1. That is, the split depth is increased by 1), and it is assumed that the case of the split setting with respect to the quad-tree, the maximum coding block is 128x128, the minimum coding block is 8x8, and the maximum split depth is 4, which is a setting commonly applied to each block.

[0203] (1st, left upper block, A1-A6)

[0204] In this example, when a single tree split (quad-tree in this example) is supported, the size and shape of the obtainable block can be determined by one split block setting (e.g., maximum coding block, minimum coding block, split depth block, etc.). In this example, when one block is obtainable according to a split (2 splits of horizontal and vertical, respectively), the split information required for one split operation (based on 4Mx4N before split, the split depth is increased by 1) is a flag indicating whether or not to perform split (in this example, if 0, split x, if 1, split o), and the obtainable candidates can be 4Mx4N and 2Mx2N.

[0205] (2nd, right upper block, A7-A11)

[0206] In this example, when supporting multi-tree partitioning (in this example, quad-tree, binary-tree), the size and shape of the block obtainable can be determined by the multiple partitioning block setting. In this example, it is assumed that the maximum coding block is 64x64 in the case of binary-tree, and the length of the minimum coding block is 4, and the maximum partitioning depth is 4.

[0207] In this example, when the number of blocks obtainable according to partitioning is two or more (in this example, 2 or 4), the partitioning information required for one partitioning operation (quad-tree partitioning depth increase by 1) is a flag indicating whether or not to partition, a flag indicating the partitioning type, a flag indicating the partitioning shape, a flag indicating the partitioning direction, and the candidates obtainable are 4Mx4N, 4Mx2N, 2Mx4N, 4MxN / 4Mx3N, 4Mx3N / 4MxN, Mx4N / 3Mx4N, 3Mx4N / Mx4N.

[0208] If the quad-tree and binary-tree partitioning ranges overlap (i.e., in the current step, the range for which both quad-tree partitioning and binary-tree partitioning are available), and the current block (state before partitioning) is a block obtained by quad-tree partitioning (parent block <in the case where the partitioning depth is less than 1 than the current> is a block obtained by quad-tree partitioning), then the partitioning information can be partitioned into the following cases. That is, when a block supported according to each partitioning setting can be obtained by multiple partitioning methods, the partitioning information can be generated by classification as follows.

[0209] (1) Case where quad-tree partitioning and binary-tree partitioning overlap

[0210] a b c d e No Split 1 SBT hor 0 0 ABT hor 1 / 4 0 1 0 0 ABT hor 3 / 4 0 1 0 1 0 SBT ver 0 1 0 1 1 ABT ver 1 / 4 0 1 1 0 ABT ver 3 / 4 0 1 1 1 0 Figure 8 0 1 1 1 1

[0211] In the above table, a is a flag indicating whether or not to perform quad-tree partitioning, and if it is 1, quad-tree partitioning (QT) is performed. If the flag is 0, b is confirmed, b is a flag indicating whether or not to perform binary-tree partitioning. If b is 0, no further partitioning is performed in the block (no partitioning), and if b is 1, binary-tree partitioning is performed.

[0212] c is a flag indicating the partitioning direction, and if it is 0, it indicates horizontal partitioning (hor), and if it is 1, it indicates vertical partitioning (ver), and d indicates a partitioning form flag, and if it is 0, it indicates symmetric partitioning (SBT, Symmetric BinaryTree), and if it is 1, it indicates asymmetric partitioning (ABT, Asymmetric Binary Tree). Only when d is 1, information on the sub-division ratio (1 / 4 or 3 / 4) in asymmetric partitioning is confirmed, and when 0, in the left / right block or the upper / lower block, the left block has a 1 / 4 ratio and the upper block has a 3 / 4 ratio, and when 1, the opposite ratio is had.

[0213] (2) In the case where only binary tree partitioning is performed

[0214] In the above table, the partitioning information can be expressed using the flags b to e other than a.

[0215] In QT In the case of the A7 block, it is the case where quad tree partitioning can be performed in the pre-partitioning block (A7 to Al l) (i.e., when quad tree partitioning can be performed but has become binary tree partitioning instead of quad tree partitioning), and corresponds to the case where the partitioning information in (1) is generated.

[0216] On the other hand, in the cases of A8 to Al l, if quad tree partitioning has not been performed in the pre-partitioning block (A8 to Al l) and binary tree partitioning has been performed (i.e., in the case where quad tree partitioning has become impossible in the corresponding block <A8 to Al l> ), it corresponds to the case where the partitioning information in (2) is generated.

[0217] (3 times. Lower left block, A12 to Al 5)

[0218] In this example, when multi-tree partitioning (in this example, quad tree, binary tree, and ternary tree) is supported, and the size and shape of the obtainable block can be determined by the multiple partitioning block setting. In this example, it is assumed that in the case of binary tree / ternary tree, the maximum coding block is 64 x 64, and the length of one side of the minimum coding block is 4, and the maximum partitioning depth is 4.

[0219] In this example, when two or more (in this example, 2, 3, 4) blocks are obtainable according to partitioning, the partitioning information required for one partitioning operation is a flag indicating whether or not to partition, a flag indicating the partitioning type, a flag indicating the partitioning shape, and a flag indicating the partitioning direction, and the obtainable candidates can be 4M x 4N, 4M x 2N, 2M x 4N, 4M x N / 4M x 2N / 4M x N, M x 4N / 2M x 4N / M x 4N.

[0220] If the partitioning ranges of the quad tree and the binary tree / ternary tree overlap and the current block is a block obtained by quad tree partitioning, the partitioning information can be classified into the following cases.

[0221] (1) In the case where quad tree partitioning and binary tree / ternary tree partitioning overlap

[0222] a b c d No Split 1 BT hor 0 0 TT hor 0 1 0 0 Bt ver 0 1 0 1 TT ver 0 1 1 0 Figure 8 0 1 1 1

[0223] In the above table, a is a flag indicating whether or not to perform quadtree partitioning, and if it is 1, quadtree partitioning is performed. If the flag is 0, a flag b indicating whether to perform binary tree partitioning or ternary tree partitioning is determined. If b is 0, no further partitioning is performed for the block. If it is 1, binary tree partitioning or ternary tree partitioning is performed.

[0224] c is a flag indicating a partitioning direction, and if it is 0, it indicates horizontal partitioning, and if it is 1, it indicates vertical partitioning, and d is a flag indicating a partitioning type, and if it is 0, it indicates binary tree partitioning (BT), and if it is 1, it indicates ternary tree partitioning (TT).

[0225] (2) Case where only binary tree / ternary tree partitioning can be performed

[0226] In the above table, flags b to d other than a can be used to indicate partitioning information.

[0227] In QT , the A12, A15 blocks correspond to a case where quadtree partitioning can be performed in the pre-partitioned blocks A12 to A15, and thus correspond to a case where the partitioning information in (1) is generated.

[0228] On the other hand, A13 and A14 correspond to a case where, since partitioning is performed as a ternary tree rather than a quadtree in the pre-partitioned blocks A13, A14, a case where the partitioning information in (2) is generated.

[0229] (4th. Lower left block. A16-A20)

[0230] In this example, multi-tree partitioning (in this example, quadtree, binary tree, ternary tree) is supported, and the size and shape of the blocks that can be obtained can be determined by a plurality of partitioned block settings. In this example, it is assumed that, in the case of binary tree / ternary tree, the maximum coding block is 64x64, and the length of one side of the minimum coding block is 4, and the maximum partitioning depth is 4.

[0231] In this example, when two or more blocks can be obtained according to partitioning (in this example, 2, 3, 4), the partitioning information required for one partitioning operation is a flag indicating whether or not to perform partitioning, a flag indicating a partitioning type, a flag indicating a partitioning form, a flag indicating a partitioning direction, and the candidate values that can be obtained are 4Mx4N, 4Mx2N, 2Mx4N, 4MxN / 4Mx3N, 4Mx3N / 4MxN, Mx4N / 3Mx4N, 3Mx4N / Mx4N, 4MxN / 4Mx2N / 4MxN, Mx4N / 2Mx4N / Mx4N.

[0232] If the partitioning ranges of the quadtree and the binary tree / ternary tree overlap and the current block is a block obtained by quadtree partitioning, the partitioning information can be classified into the following cases.

[0233] (1) The case where quad-tree partitioning and binary-tree / triple-tree partitioning overlap

[0234] a b c d e f No Split 1 TT hor 0 0 SBT hor 0 1 0 0 ABT hor 1 / 4 0 1 0 1 0 ABT hor 3 / 4 0 1 0 1 1 0 TT ver 0 1 0 1 1 1 SBT ver 0 1 1 0 ABT ver 1 / 4 0 1 1 1 0 ABT ver 3 / 4 0 1 1 1 1 0 Figure 8 0 1 1 1 1 1

[0235] In the above table, a is a flag indicating whether or not quad-tree partitioning is performed, and if it is 1, quad-tree partitioning is performed. If the flag is 0, a flag b indicating whether or not binary-tree partitioning is performed is confirmed. If b is 0, no further partitioning is performed for the block. If it is 1, binary-tree partitioning or triple-tree partitioning is performed.

[0236] c is a flag indicating the partitioning direction, and if it is 0, it indicates horizontal partitioning, and if it is 1, it indicates vertical partitioning, d is a flag indicating the partitioning type, and if it is 0, it indicates triple-tree partitioning, and if it is 1, it indicates binary-tree partitioning. When d is 1, a flag e corresponding to the partitioning form is confirmed, and when e is 0, symmetric partitioning is performed, and when e is 1, asymmetric partitioning is performed. When e is 1, information on the fine partitioning ratio in asymmetric partitioning is confirmed, and this is the same as in the previous example.

[0237] (2) The case where only binary-tree / triple-tree partitioning can be performed

[0238] In the above table, flags b to f other than a can be used to indicate the partitioning information.

[0239] In Figure 9 , the A20 block corresponds to the case where quad-tree partitioning is performed in the pre-partitioning blocks A16 to A19, and thus corresponds to the case where the partitioning information in (1) is generated.

[0240] On the other hand, in the case of A16 to A19, the case where binary-tree partitioning is performed since quad-tree partitioning is not performed in the pre-partitioning blocks A16 to A19 corresponds to the case where the partitioning information in (2) is generated.

[0241] Next, intra prediction of the prediction section in the present application will be described.

[0242] Figure 9 is an example diagram showing intra prediction modes predefined in an image encoding / decoding apparatus.

[0243] Referring to Figure 2, 67 prediction modes are configured as a prediction mode candidate group for intra prediction, of which 65 are directional modes (2 to 66) and two are non-directional modes (DC, Planar). In this case, the directional modes can be classified as a slope (e.g., dy / dx) or angle information (degree). All or part of the prediction modes described in the above example can be included in the prediction mode candidate group of the luma component or the color difference component, and other additional modes can be included in the prediction mode candidate group.

[0244] In addition, where a restored block of another color space, which is completed by using the correlation between color spaces, can be used for prediction of the current block, and a prediction mode supporting the same can be included. For example, in the case of the color difference component, a restored block of the luma component corresponding to the current block can be used to generate a prediction block of the current block. That is, the prediction block can be generated based on the restored block considering the correlation between color spaces.

[0245] The prediction mode candidate group can be adaptively determined according to the encoding / decoding setting. In order to increase the accuracy of prediction, the number of the candidate group can be increased, and in order to reduce the bit amount according to the prediction mode, the number of the candidate group can be reduced.

[0246] For example, one of the A candidate group (67, 65 directional modes and 2 non-directional modes), the B candidate group (35, 33 directional modes and 2 non-directional modes), and the C candidate group (18, 17 directional modes and 1 non-directional mode) can be selected, and the candidate group can be adaptively selected or determined according to the size and shape of the block.

[0247] In addition, the prediction mode candidate group can have various configurations according to the encoding / decoding setting. For example, as shown in Figure 9 , in Figure 9 , the prediction mode candidate group is configured in an equal manner between modes, or in Figure 9 , the candidate group can be configured in a manner that the number of modes between 18 and 34 is greater than the number of modes between 2 and 18. Or, it can be the opposite case, and the candidate group can be adaptively configured according to the shape of the block (i.e., the square, the rectangular_horizontal_long case, the rectangular_vertical_long case). For example, if the width of the current block is greater than the height, the intra prediction modes belonging to 2 to 15 are not used, and can be replaced with the intra prediction modes belonging to 67 to 80. On the other hand, if the width of the current block is less than the height, the intra prediction modes belonging to 53 to 66 are not used, and can be replaced with the intra prediction modes belonging to -14 to -1.

[0248] In this invention, unless otherwise stated, it is assumed that intra-frame prediction is performed using a preset prediction mode candidate group (candidate group A) with equal mode intervals. However, the main elements of this invention can also be modified to set the above-described adaptive intra-frame prediction.

[0249] Figure 9 The prediction patterns supported can be those when the block shape is square or rectangular. Additionally, when the block shape is rectangular, the supported prediction patterns can be different from the examples above. For example, prediction patterns with different numbers of candidate groups or the same number of candidate groups but longer block lengths may be densely packed; conversely, it could be cases where the prediction patterns are dispersed or the opposite. In this invention, as... Figure 9 The prediction mode is described under the premise of supporting prediction mode settings (equal intervals between orientation modes) regardless of the shape of the block, but it can also be applied to other cases.

[0250] Various methods can be used to set the indices assigned to prediction patterns. In the case of directional patterns, the indices assigned to each pattern can be determined based on pre-set priority information, according to the angle or tilt information of the prediction patterns. For example, patterns corresponding to the x-axis or y-axis ( Figure 9 Modes 18 and 50 may have a higher priority, and diagonal modes (modes 2, 34, and 66) with an angle difference of 45 degrees or -45 degrees based on the horizontal or vertical modes may have a lower priority, and diagonal modes with an angle difference of 22.5 degrees or -22.5 degrees based on the diagonal modes may have a lower priority. Priority information can be set in this way (the next one is 11.25 degrees or -11.25 degrees, etc.) or other various methods.

[0251] Alternatively, indexes can be allocated in a specific directional order based on a preset prediction pattern. For example, such as... Index As shown, indices can be assigned clockwise from a certain diagonal pattern (pattern 2). The examples described later will be based on the assumption that indices are assigned clockwise according to a preset prediction pattern.

[0252] Furthermore, non-directional prediction modes can allocate index information preferentially over directional modes, or they can allocate index information among directional modes, or they can allocate index information at the end, which can be determined according to the encoding / decoding settings. In this example, we assume an example where non-directional modes are allocated indexes with the highest priority among prediction modes (using low index allocation, mode 0 is the plane, and mode 1 is the DC).

[0253] Although various examples of the index assigned to the prediction mode have been described through the above examples, the index can be assigned under other settings without being limited to the above examples, or can have various transformation examples.

[0254] In the above examples, the priority information has been described in the example of assigning the index to the prediction mode, but the priority information is not only used in the prediction mode assigning the index, but also can be used in the encoding / decoding process of the prediction mode. For example, the priority information can be used for MPM configuration or the like, and a plurality of priority information sets can be supported in the encoding / decoding process of the prediction mode.

[0255] Hereinafter, a method of deriving an intra prediction mode of a current block (particularly, a luma component) will be explained.

[0256] The current block can use a default mode predefined in an image encoding / decoding apparatus. The default mode can be a directional mode or a non-directional mode. For example, the directional mode can include at least one of a vertical mode, a horizontal mode, or a diagonal mode. The non-directional mode can include at least one of a planar mode or a DC mode. If it is determined that the current block uses the default mode, the intra prediction mode of the current block can be set to the default mode.

[0257] Alternatively, the intra prediction mode of the current block can be derived based on a plurality of MPM candidates. First, a predetermined MPM candidate can be selected among the aforementioned prediction mode candidate groups. The number of MPM candidates can be three, four, five, or more. The MPM candidate can be derived based on the intra prediction modes of neighboring blocks adjacent to the current block. The neighboring blocks can be blocks adjacent to at least one of a left side, an upper end, an upper left end, a lower left end, or an upper right end of the current block.

[0258] Specifically, the MPM candidate can be determined by considering whether the intra prediction mode of the left side block (candIntraPredModeA) and the intra prediction mode of the upper end block (candIntraPredModeB) are the same and whether candIntraPredModeA and candIntraPredModeB are non-directional modes.

[0259] For example, if candIntraPredModeA and candIntraPredModeB are identical and candIntraPredModeA is not a non-directional mode, the MPM candidates of the current block can include at least one of candIntraPredModeA, (candIntraPredModeA-n), (candIntraPredModeA+n), or a non-directional mode. Here, n can be an integer of 1, 2, or more. The non-directional mode can include at least one of a planar mode or a DC mode. For example, the MPM candidates of the current block can be determined as shown in Table 2 below. The index of Table 2 specifies the position or priority of the MPM candidate, but is not limited thereto. For example, the DC mode can be assigned index 1, or index 4 can be assigned.

[0260] MPM candidate candIntraPredModeA 0 2 + ((candIntraPredModeA + 61) % 64) 1 2 + ((candIntraPredModeA - 1) % 64) 2 INTRA DC 3 2 + ((candIntraPredModeA + 60) % 64) 4 Index

[0261] Table 2

[0262] Alternatively, if candIntraPredModeA and candIntraPredModeB are different and neither candIntraPredModeA nor candIntraPredModeB is a non-directional mode, the MPM candidates of the current block can include at least one of candIntraPredModeA, candIntraPredModeB, (maxAB-n), (maxAB+n), or a non-directional mode. Here, maxAB denotes the maximum value of candIntraPredModeA and candIntraPredModeB, and n can be an integer of 1, 2, or more. The non-directional mode can include at least one of a planar mode and a DC mode. For example, the MPM candidates of the current block can be determined as shown in Table 3 below. The index of Table 3 specifies the position or priority of the MPM candidate, but is not limited thereto. For example, the DC mode can be assigned the largest index. When the difference between candIntraPredModeA and candIntraPredModeB is within a predetermined threshold range, MPM candidate 1 in Table 3 will be applied, otherwise MPM candidate 2 can be applied. Here, the threshold range can be a range greater than or equal to 2 and less than or equal to 62.

[0263] MPM candidate 1 MPM candidate 2 candIntraPredModeA 0 candIntraPredModeA candIntraPredModeB 1 candIntraPredModeB INTRA DC 2 INTRA DC 2 + ((maxAB + 61) % 64) 3 2 + ((maxAB + 60) % 64) 2 + ((maxAB - 1) % 64) 4 2 + ((maxAB) % 64) Index

[0264] Table 3

[0265] Or, if candIntraPredModeA and candIntraPredModeB are not identical, and only one of candIntraPredModeA and candIntraPredModeB is in the non-directional mode, the MPM candidates of the current block can include at least one of maxAB, (maxAB-n), (maxAB+n), or the non-directional mode. Here, maxAB denotes the maximum value of candIntraPredModeA and candIntraPredModeB, and n can be an integer of 1, 2, or more. The non-directional mode can include at least one of the planar mode and the DC mode. For example, the MPM candidates of the current block can be determined as shown in Table 4 below. The index of Table 4 specifies the position or priority of the MPM candidate, but is not limited thereto. For example, the DC mode can be assigned an index 0, or the maximum index can be assigned.

[0266]

[0267]

[0268] Table 4

[0269] Or, if candIntraPredModeA and candIntraPredModeB are not identical, and both candIntraPredModeA and candIntraPredModeB are in the non-directional mode, the MPM candidates of the current block can include at least one of the non-directional mode, the vertical mode, the horizontal mode, (vertical mode-m), (vertical mode+m), (horizontal mode-m), or (horizontal mode+m). Here, m can be an integer of 1, 2, 3, 4, or more. The non-directional mode can include at least one of the planar mode and the DC mode. For example, the MPM candidates of the current block can be determined as shown in Table 5 below. The index of Table 5 specifies the position or priority of the MPM candidate, but is not limited thereto. For example, the horizontal mode can be assigned an index 1, or the maximum index can be assigned.

[0270] MPM candidate INTRA DC 0 Vertical mode 1 Horizontal mode 2 (Vertical mode - 4) 3 (Vertical mode + 4) 4 Figure 9

[0271] Table 5

[0272] Among the aforementioned plurality of MPM candidates, the MPM candidate specified by the MPM index can be set as the intra prediction mode of the current block. The MPM index can be encoded and signaled by the image encoding apparatus.

[0273] As described above, the intra prediction mode can be derived by selectively using any one of the default mode or the MPM candidates. The selection can be performed based on a flag signaled by the encoding apparatus. In this case, the flag can indicate whether the intra prediction mode of the current block is set to the default mode. If the flag is a first value, the intra prediction mode of the current block is set to the default mode, and if not, information about whether the intra prediction mode of the current block is derived from the MPM candidates, an MPM index, etc. can be signaled.

[0274] The chrominance component can have the same candidate set as the prediction mode candidate set of the luminance component, or can include a candidate set configured by part of the modes in the prediction mode candidate set of the luminance component. At this time, the prediction mode candidate set of the chrominance component can have a fixed configuration or a variable (or adaptive) configuration.

[0275] (Fixed candidate set configuration vs. variable candidate set configuration)

[0276] As an example of the fixed configuration, part of the modes in the prediction mode candidate set of the luminance component (for example, assuming that it is the DC mode, the planar mode, the vertical mode, the horizontal mode, the diagonal mode <assuming that it is at least one mode of DL, UL, and UR, DL is a prediction from the lower right to the upper right, UL is a prediction from the upper left to the lower right, and UR is a prediction from the upper right to the lower left, assuming that it is mode 2, 34, and 66 in Figure 10 , in addition to other diagonal modes>) is configured as the prediction mode candidate set of the chrominance component to perform intra prediction.

[0277] As an example of the variable configuration, part of the modes in the prediction mode candidate set of the luminance component (for example, assuming that it is the DC mode, the planar mode, the vertical mode, the horizontal mode, the diagonal UR mode, assuming that a mode that is more likely to be selected is generally configured as the basic prediction mode candidate set) is configured as the basic prediction mode candidate set of the chrominance component, but a situation in which the mode included in the candidate set can not properly reflect the characteristics of the chrominance component can occur. To improve this, the prediction mode candidate set configuration of the chrominance component can be changed.

[0278] For example, at least one prediction mode of a block or sub-block of the luminance component at the same or corresponding position as the block of the color difference component can be included in the basic prediction mode candidate group (Example 1 described later), or some modes can be replaced to configure a new prediction mode candidate group (Example 2 described later). For example, in the case where the corresponding position corresponding to the color difference component in the luminance component cannot be configured by one block, but is configured as a plurality of sub-blocks by dividing the block, etc., a block indicating a predetermined position is configured. At this time, the position of the predetermined block is determined in the upper left, upper right, lower left, lower right, center, upper middle, lower middle, left middle, right middle, etc. of the block of the luminance component corresponding to the block of the color difference component; if distinguished as an in-picture coordinate, it can be the upper left as a position including the (0, 0) coordinate, the upper right as a position including the (blk_width-1, 0) coordinate, the lower left as a position including the (0, blk_height-1) coordinate, the lower right as a position including the (blk_width-1, blk_height-1) coordinate, the center as a position including one of the (blk_width / 2-1, blk_height / 2-1), (blk_width / 2, blk_height / 2-1), (blk_width / 2-1, blk_height / 2), (blk_width / 2, blk_height / 2) coordinates, the upper middle as a position including one of the (blk_width / 2-1, 0), (blk_width / 2, 0) coordinates, the lower middle as a position including one of the (blk_width / 2-1, blk_height-1), (blk_width / 2, blk_height-1) coordinates, the left middle as a position including one of the (0, blk_height / 2-1), (0, blk_height / 2) coordinates, and the right middle as a position including one of the (blk_width-1, blk_height / 2-1), (blk_width-1, blk_height / 2) coordinates. That is, it means a block including the coordinate position. The above blk_width and blk_height refer to the horizontal and vertical lengths of the luminance block, and the coordinates are not limited to the above cases, and can include other cases. In the following description, the prediction mode of the luminance component added to the prediction mode candidate group of the color difference component is added at least one prediction mode according to a predetermined priority (for example, assuming upper left-right upper-left lower-right center). If two prediction modes are added, the mode of the upper left block and the mode of the upper right block are added according to the above setting. At this time, when the blocks of the upper left and upper right positions are configured by one block, the mode of the lower left block of the next priority is added.

[0279] Alternatively, at least one prediction mode of the current block-centered neighboring blocks located at left, above, upper-left, upper-right, lower-left, etc., or sub-blocks of the corresponding blocks (when the neighboring blocks are configured in multiple blocks) can be included in the basic prediction mode candidate group (a block adjacent to the block at a preset position can be designated, when multiple modes are included in the prediction mode candidate group of the color difference component, a prediction mode of a block at a preset priority and a sub-block at a preset priority within the sub-block can be included as a candidate set according to the priority), or a new prediction mode candidate group can be configured by replacing part of the modes.

[0280] If additional content is added in the above description, not only the prediction mode of the block of the luminance component or the neighboring block (of the luminance block) but also at least one mode derived from the prediction mode can be included as the prediction mode of the color difference component. In the examples described later, examples in which the prediction mode of the luminance component is included as the prediction mode of the color difference component will be cited, and detailed descriptions of examples in which the prediction mode derived from the prediction mode of the luminance component (for example, if the neighboring mode, directional mode of the mode is taken as an example, when the horizontal mode 18 is the prediction mode of the luminance component, the modes of modes 17, 19, 16, etc. correspond to the derived prediction mode, and if multiple prediction modes are configured as the prediction mode candidate group of the color difference component, the priority of the candidate group configuration can be set in the order from the prediction mode of the luminance component to the mode derived from the prediction mode of the luminance component) or the prediction mode derived from the prediction mode of the neighboring block is included as the prediction mode candidate group of the color difference component will be omitted, but the same or changed settings in the following description can be applied.

[0281] As one example (1), when the prediction mode of the luminance component matches one of the prediction mode candidate group of the color difference component, the configuration of the candidate group is the same (the number of candidate groups is not changed), and when none of the prediction modes match, the configuration of the candidate group is not the same (the number of candidate groups is increased).

[0282] When the configuration of the candidate group in the above example is the same, the index of the prediction mode can be the same or can be assigned to other indexes, which can be determined according to the encoding / decoding settings. For example, when the index of the prediction mode candidate group of the color difference component is planar 0, DC 1, vertical 2, horizontal 3, diagonal UR 4, in the case where the luminance component is horizontal, the configuration of the prediction mode candidate group remains the same, and the index of each prediction mode remains the same, or other indexes can be assigned (in this example, horizontal 0, planar 1, DC 2, vertical 3, diagonal UR 4). The above index reset can be an example of a process performed in order to generate fewer mode bits (assuming that fewer bits are assigned to small indexes) in the prediction mode encoding / decoding process.

[0283] When the configuration of the candidate group in the above example is not the same, the index of the prediction mode can be added while keeping the same, or a different index can be assigned. For example, when the prediction mode candidate group index setting is the same as the previous example, when the prediction mode of the luma component is diagonal DL, the configuration of the prediction mode candidate group is increased by 1, and the prediction mode index of the existing candidate group remains the same, and the index of the newly added mode can be the last (diagonal DL5 in this example) or other index (diagonal DL0, planar 1, DC2, vertical 3, horizontal 4, diagonal UL5 in this example) can be assigned.

[0284] As an example (2), when the prediction mode of the luma component matches one of the prediction mode candidate groups of the chroma component, the configuration of the candidate group is the same (the mode of the candidate group is not changed), and when none of them matches, the configuration of the candidate group is not the same (at least one of the modes of the candidate group is replaced).

[0285] When the configuration of the candidate group in the above example is the same, the index of the prediction mode can be the same or can be assigned to other index. For example, when the index of the prediction mode candidate group of the chroma component is planar 0, DC1, vertical 2, horizontal 3, diagonal UR4, when the prediction mode of the luma component is vertical, the configuration of the prediction mode candidate group remains the same, and the index of each prediction mode remains the same, or other index can be assigned (in this example, vertical 0, horizontal 1, diagonal UL2, planar 3, DC4; when the mode of the luma component is directional, the example of the directional mode in the front, the example of the non-directional mode in the front when the luma component is non-directional, but not limited thereto).

[0286] When the configuration of the candidate group in the above example is not the same, the mode whose index of the prediction mode remains the same remains the same, and the index of the replacement mode can be assigned to the changed mode, or a different index from the existing one can be assigned to the multiple prediction modes. For example, when the prediction mode candidate group index setting is the same as the previous example, when the prediction mode of the luma component is diagonal DL, one mode (diagonal UL in this example) in the replacement prediction mode candidate group is replaced, and the prediction mode index of the existing candidate group remains the same, the index of the mode to be replaced is assigned as the index of the newly added mode (for example, diagonal DL4) or other index (diagonal DL0, planar 1, DC2, vertical (3), horizontal 4 in this example) can be assigned.

[0287] In the foregoing description, an example of performing resetting of an index is cited for the purpose of allocating fewer mode bits, but this is only an example according to encoding / decoding settings, and there can be other cases as well. If the index of a prediction mode does not change, binarization of allocating a small number of bits to a small index can be performed, or binarization of allocating bits regardless of the size of the index can be performed. For example, when the reset prediction mode candidate group is planar 0, DC 1, vertical 2, horizontal 3, and diagonal line DL 4, even if a large index is allocated to the diagonal line DL, it is a mode obtained from a luminance component, and thus can be set to allocate fewer mode bits than other prediction modes.

[0288] The prediction mode can be a mode supported in a manner independent of the image type, or a mode determined to be supported or not supported according to some image (e.g., a mode supported for image type I but not supported for image types P or B) type.

[0289] The contents described through the above examples are limited to the present examples, and there can be additional or other changed examples as well. In addition, the encoding / decoding settings described through the above examples can be implicitly determined, or can explicitly include relevant information in units of video, sequence, picture, slice, tile, etc.

[0290] (Obtaining a prediction value in the same color space vs. obtaining a prediction value in another color space)

[0291] In the case of the intra prediction mode described through the above examples, a prediction mode regarding a method of obtaining data for generating a prediction block from a neighboring region within the same time and the same space (e.g., extrapolation, interpolation, averaging, etc.) is described.

[0292] In addition, a prediction mode regarding a method of obtaining data for generating a prediction block from a region located within the same time and a different space can be supported.

[0293] For example, the above example can be a prediction mode regarding a method of using the correlation between color spaces to obtain data for generating a prediction block in other color spaces. At this time, when YCbCr is taken as an example, the correlation between color spaces can mean the correlation between Y and Cb, Y and Cr, and Cb and Cr. That is, in the case of a color difference component Cb or Cr, a restored block of a luminance component corresponding to the current block can be generated as a prediction block of the current block (color difference vs. luminance is a basic setting of the example described later). Or, a restored block of some color difference component (Cb or Cr) corresponding to the current block of some color difference component (Cr or Cb) can be generated as a prediction block of the color difference component (Cr or Cb). At this time, a restored block of other color spaces can be directly generated as a prediction block (i.e., without performing correction) or a block obtained by considering the correlation between colors (e.g., performing correction on an existing restored block, in P = a * R + b, a and b represent values for correction, and R and P represent values obtained in different color spaces and prediction values of the current color space, respectively) can be generated as a prediction block.

[0294] In this example, the case where data obtained by using the correlation of color spaces is used as a prediction value of the current block is described, but it is also possible when the data is used as a correction value for correcting an existing prediction value of the current block (e.g., using a residual value of other color spaces as a correction value; that is, there is another prediction value, and the prediction value is corrected; although these prediction values are added, it is a prediction value, but it is described in detail for distinction). In the present invention, the former case is described, but the present invention is not limited thereto, and the correction value can be used as it is or transformed.

[0295] The prediction mode can be a mode supported in a manner independent of the image type, or a mode determined to be supported or not supported depending on some image (e.g., a mode supported for image type I but not supported for image types P or B).

[0296] (Parts compared to obtain correlation information)

[0297] In the above example, the correlation information (a, b, etc.) between color spaces can be explicitly included in the correlation information, or can be implicitly obtained. At this time, the area compared to obtain the correlation information can be 1) a current block of a color difference component and a corresponding block of a luminance component, or 2) a neighboring area (e.g., a left block, an upper block, a left upper block, a right upper block, a left lower block, etc.) of the current block of the color difference component and a corresponding block neighboring area of the luminance component. The former can be an example of an explicit case and the latter can be an example of an implicit case.

[0298] For example, the correlation information is obtained by comparing at least one pixel value of each color space, etc. (At this time, the pixel value to be compared can be a pixel value obtained from one pixel in each color space, and can be a pixel value obtained from a plurality of pixels. The pixel value derived through a filtering process such as a weighted average, i.e., the number of pixels referred to or used for comparing one pixel value of each color space can be one pixel vs. one pixel, one pixel vs. a plurality of pixels, etc. At this time, the former can be a color space for generating a prediction value, and the latter can be a color space for reference. The above examples can be a case that can occur according to a color format, or it can be possible to compare the pixel value of one pixel of the color difference component with the pixel value of the corresponding one pixel of the luminance component in a manner independent of the color format, and it can be possible to compare the pixel value of one pixel of the color difference component with the pixel value obtained by performing a filtering <a-tap separate 1D filter, b x c mask non-separable 2D filter, d-tap directional filter, etc.> on a plurality of pixels of the luminance component, and according to an encoding / decoding setting, one of the two methods can be used; the above describes an example of color difference and luminance, but there can also be like color difference <cb>and chromatic aberration <cr>transformed example of the above).

[0299] In the above example, the region compared when the related information is implicitly obtained can be the nearest pixel line of the current block of the current color component (e.g., including the pixels of p[-1,-1] to p[blk_width-1,-1], p[-1,0] to p[-1,blk_height-1]) and the pixel line of the other color space corresponding thereto or multiple pixel lines of the current block of the current color component (e.g., in the above case, the multiple pixel lines including p[-2,-2] to p[blk_width-1,2], p[-2,-1] to p[-2,blk_height-1] include the pixels) and the pixel line of the other color space corresponding thereto.

[0300] Specifically, assuming that the color format is 4:2:0, in order to compare the pixel value of one pixel in the current color space (in this example, the chroma), one pixel in a preset position (in this example, selecting from the upper left, upper right, lower left, and lower right in 2x2) of the corresponding 4 pixels in the other color space (in this example, the luma) (one pixel of the chroma component corresponds to 4 pixels within 2x2 of the luma component) can be used. Alternatively, in order to compare the pixel value of one pixel in the chroma space, a pixel value obtained by performing filtering on multiple pixels (e.g., at least two pixels in the corresponding 2x2 pixels, etc.) in the luma space can be used.

[0301] In summary, the parameter information can be derived from the restored pixels of the neighboring region of the current block and the restored pixels of the other color space corresponding thereto. That is, at least one parameter (e.g., a or b, a1, b1, or a2, b2, etc.) can be generated based on the related information, and can be used as a value (e.g., a, a1, a2 / b, b1, b2) multiplied or added to the pixels of the restored block in the other color space.

[0302] In this case, the comparison process can be performed after confirming the availability of the pixels compared in the above example. For example, when the neighboring region is available, it can be used as the pixel for comparison, and when the neighboring region is not available, it can be determined according to the encoding / decoding setting. For example, when the pixel in the neighboring region is not available, it can be excluded from the process of obtaining the related information of the color space, or it can be included in the comparison process after filling the unavailable region, which can be determined according to the encoding / decoding setting.

[0303] For example, this can be an example of a case in which a region corresponding to pixels of at least one color space is unavailable when excluded from a process for acquiring correlation information between color spaces. In detail, this can be an example of a case in which pixels corresponding to one of the two color spaces or pixels of both color spaces are unavailable, which can be determined according to an encoding / decoding setting.

[0304] Alternatively, when a process for obtaining correlation information between color spaces is performed after filling data for comparison in an unavailable region (or an operation similar to a reference pixel filling process), various filling methods can be used. For example, it can be filled with a preset pixel value (e.g., a middle value of a bit depth of 1 « (bit_depth - 1), a value between a minimum value and a maximum value of actual pixels of an image, an average of actual pixels of an image, a middle value, etc.), or can be filled with a value of a neighboring pixel or obtained by performing filtering on a neighboring pixel (an operation similar to a reference pixel filtering process), or other methods can be employed.

[0305] Figure 10 An example of comparing pixels between color spaces in order to obtain correlation information is illustrated. For ease of explanation, it is assumed that a color format of 4:4:4 is employed. At this time, it is considered that a process described later (i.e., including a conversion process according to a component ratio) is described according to a component ratio of a color format.

[0306] R0 indicates an example in which both of the color space regions on both sides can be used. Since both of the color space regions on both sides are available regions, pixels of the corresponding regions can be used in a comparison process to obtain correlation information.

[0307] R1 indicates an example in which one of the color space regions on both sides is unavailable (in this example, a neighboring region of the current color space is available, and the corresponding region of the other color space is unavailable). After filling the region-unavailable region using various methods, the unavailable region can be used in a comparison process.

[0308] R2 indicates an example in which one of the color space regions on both sides is unavailable (in this example, a neighboring region of the current color space is unavailable, and the corresponding region of the other color space is available). Since there is an unavailable region on one side, corresponding regions of both color spaces cannot be used in a comparison process.

[0309] R3 indicates an example in which both of the color space regions on both sides are unavailable. By filling the unavailable regions using various methods, they can be used in a comparison process.

[0310] R4 indicates an example in which both of the color space regions on both sides are unavailable. Since there are unavailable regions on both sides, corresponding regions of both color spaces on both sides cannot be used in a comparison process.

[0311] In addition, unlike Figure 9 Various settings can be made when neither the neighboring region of the current block nor the corresponding region of the other color space is available.

[0312] As one example, a preset value (in this example, a is 1 and b is 0) can be assigned to a and b. This case can mean that a mode of filling data of the other color space with the prediction block of the current block is maintained. Also, this case can allow a setting or priority of the occurrence (or selection) probability of the mode to be different from that of the existing case when performing prediction mode encoding / decoding (for example, the probability of selection is considered to be low or the priority is set to be low; in other words, because the correlation information is low in accuracy, the accuracy of the prediction block obtained through the prediction mode can be low, so that the final prediction mode cannot be selected as the best prediction mode).

[0313] For example, a mode of filling data of the other color space with the prediction block of the current block can not be supported because there is no data to be compared. That is, the mode can be a mode supported when there is at least one available region. At this time, when performing prediction mode encoding / decoding, it can be set to allow or not to allow the mode to be replaced with other modes. The former case can be a setting of maintaining the number of prediction mode candidates, and the latter case is a setting of reducing the number of prediction mode candidates.

[0314] Not limited to the above example, various modifications can be made.

[0315] In the above example, the case where the region is not completed encoding / decoding when the region is located outside the boundary of the image (for example, picture, slice, tile, etc.) (that is, the current block and the region are not included in the same image) is not available. In addition, the case where the encoding / decoding setting (for example, constrained_intra_pred_flag, etc., for example, when P or B slice / type, the above flag is 1, and the encoding mode of the corresponding region is Inter) can be added.

[0316] In the example described later, when the prediction block of the current block is generated by using the restored data of the other color space after obtaining the correlation information through the comparison of the color spaces, the above restriction can occur. That is, as described above, when it is judged that the corresponding region of the other color space corresponding to the current block is not available, the use of the mode can be restricted or not available.

[0317] The prediction value of the current block can be generated using the parameters representing the correlation information between the color spaces obtained through the above-described processes and the restoration data of the other color space corresponding to the current block. At this time, the restoration data of the other color space used for the prediction of the current block can be the pixel value of the pixel at a predetermined position or the pixel value obtained through a filtering process.

[0318] For example, in the case of 4:4:4, in order to generate a prediction value of one pixel of the chroma space, the pixel value of one corresponding pixel can be used in the luma space. Alternatively, in order to generate a prediction value of one pixel of the chroma space, the pixel values obtained by performing filtering on a plurality of pixels (for example, pixels located in the left, right, upper, lower, upper left, upper right, lower left, lower right, etc. directions from the corresponding pixel) in the luma space can be used. When 5-tap and 7-tap filters are applied, for example, it can be understood that there are two, three, etc. pixels in the left, right, upper, lower, etc. directions from the corresponding pixel.

[0319] For example, in the case of 4:2:0, in order to generate a prediction value of one pixel of the chroma space, the pixel value of one pixel at a predetermined position (selected from among the upper left, upper right, lower left, and lower right) among the corresponding four pixels (one pixel of the color difference component corresponds to 2x2 pixels of the luma component) in the luma space can be used. Alternatively, in order to generate a prediction value of one pixel of the chroma space, the pixel values obtained by performing filtering on a plurality of pixels (for example, at least two pixels of the corresponding 2x2 pixels, or pixels located in the left, right, upper, lower, upper left, upper right, lower left, lower right, etc. directions from the center of the 2x2 pixels) in the luma space can be used.

[0320] In summary, the parameters representing the correlation information obtained through the above-described processes can be applied (multiplied or added, etc.) to the pixel values obtained in the other color space to obtain the pixel values, and used as the prediction values of the pixels in the current color space.

[0321] In the above examples, some color formats, some pixel value acquisition processes, etc. have been described, however, are not limited thereto, and the same or modified examples can be used in other cases.

[0322] The contents described in (obtaining prediction values in the same color space vs. obtaining prediction values in different color spaces) can be applied to the fixed candidate group configuration vs. the variable candidate group configuration. For example, when the prediction values cannot be obtained in the other color space, a replacement mode of the prediction values can be included in the candidate group.

[0323] Through the above-described examples, in the case of the above-described prediction modes, the correlation information (for example, information about support or non-support, parameter information, etc.) can be included in units of an image, a sequence, a picture, a slice, a tile, etc.

[0324] As described above, the prediction mode candidate group is configured using the prediction mode (Mode A) related to the method (the method described above is a method of acquiring data for generating a prediction block from a neighboring region in the same time, the same space) according to the encoding / decoding setting, or the prediction mode other than the prediction mode, and the prediction mode candidate group can include the prediction mode (B_mode) related to the method (the method described above is a method of acquiring data for generating a prediction block from a region in the same time, a different space).

[0325] In the above example, the prediction mode candidate group can be configured using only Mode A or only Mode B, and the prediction mode candidate group can be configured by mixed use of Mode A and Mode B. In relation to this, the setting information about the prediction mode candidate group configuration can be explicitly generated, or the information about the prediction mode candidate group configuration can be implicitly determined in advance.

[0326] For example, there can be the same configuration regardless of some encoding / decoding settings (in this example, the image type), or a single configuration according to some encoding / decoding settings (for example, the prediction mode candidate group is configured using Mode A, Mode B_1<color mode>, Mode B_2<color copy mode> in the I image type, the prediction mode candidate group is configured using Mode A, Mode B_1 in the P image type, and the prediction mode candidate group is configured using Mode A and Mode B_2 in the B image type, etc.).

[0327] In the present application, the prediction mode candidate group for the luminance component is configured as shown in Figure 9 The prediction mode candidate group for the color difference component is configured as horizontal, vertical, diagonal mode (Mode A) in Figure 9 The prediction mode candidate group in Mode A is described under the assumption of a plane, DC, color mode 1, color mode 2, color mode 3, color copy mode 1, color copy mode 2, adjacent block mode 1 (left block), adjacent mode 2 (upper block) in Figure 11 However, there can be settings of the remaining various prediction mode candidate groups.

[0328] In the image encoding method according to the embodiment of the present application, the intra prediction of the prediction unit can include a reference pixel configuration step, a prediction block generation step, a prediction mode determination step, and a prediction mode encoding step. In addition, the image encoding apparatus can be configured to include a reference pixel configuration unit, a prediction block generation unit, a prediction mode encoding unit for implementing the reference pixel configuration step, the prediction block generation step, the prediction mode determination step, and the prediction mode encoding step. Some of the above processes can be omitted, or other steps can be added, and other sequences other than the above sequence can be transformed.

[0329] In addition, in the image decoding method according to the embodiment of the present application, the intra prediction of the prediction unit can include a prediction mode decoding step, a reference pixel configuration step, and a prediction block generation step. Furthermore, the image decoding apparatus can be configured to include a prediction mode decoding unit, a reference pixel configuration unit, and a prediction block generation unit for implementing the prediction mode decoding step, the reference pixel configuration step, and the prediction block generation step. Some of the above steps can be omitted, or other steps can be added, and the order can be changed to an order other than the above order.

[0330] In the prediction block generation step, intra prediction can be performed on a current block (e.g., a coding block, a prediction block, a transform block, etc.) unit, or intra prediction can be performed on a predetermined sub-block unit. For this purpose, a flag indicating whether the current block is partitioned into sub-blocks to perform intra prediction can be used. The flag can be encoded and signaled by the encoding apparatus. If the flag is a first value, the current block is partitioned into a plurality of sub-blocks, otherwise, the current block is not partitioned into a plurality of sub-blocks. The partitioning here can be additional partitioning performed after the partitioning based on the tree structure described above. The sub-blocks belonging to the current block share one intra prediction mode, but different reference pixels can be configured for each sub-block. Alternatively, the sub-blocks can use the same intra prediction mode and reference pixels. Alternatively, the sub-blocks can use the same reference pixels, but different intra prediction modes can be used for each sub-block.

[0331] The partitioning can be performed in a vertical or horizontal direction. The partitioning direction can be determined based on a flag signaled by the encoding apparatus. For example, when the flag is a first value, the partitioning can be performed in a horizontal direction, otherwise, the partitioning can be performed in a vertical direction. Alternatively, the partitioning direction can be determined based on the size of the current block. For example, when the height of the current block is greater than a predetermined threshold size, the partitioning can be performed in a horizontal direction, and when the width of the current block is greater than a predetermined threshold size, the partitioning can be performed in a vertical direction. Here, the threshold size can be a fixed value defined in advance in the encoding / decoding apparatus, or the threshold size can be determined based on information about the block size (e.g., the size of the maximum transform block, the size of the maximum coding block, etc.). The information about the block size can be signaled in at least one of the sequence, picture, slice, tile, brick, or CTU row levels.

[0332] The number of sub-blocks can be variably determined based on the size, shape, partitioning depth, intra prediction mode, etc. of the current block. For example, when the current block is 4x8 or 8x4, the current block can be partitioned into two sub-blocks. Alternatively, if the current block is greater than or equal to 8x8, the current block can be partitioned into four sub-blocks.

[0333] In the present application, the encoder will be described mainly, and in the case of the decoder, since it can be deduced inversely from the contents of the encoder, the detailed description is omitted.

[0334] Figure 11 is a schematic diagram for explaining a reference pixel configuration for intra prediction. The size and shape (MxN) of the current block for prediction can be obtained from the partition block section, and will be described under the assumption that intra prediction will be supported in the range of 4x4 to 128x128. In general, intra prediction can be performed using a prediction block unit, but according to the setting of the partition block section, intra prediction of a coding block, a transform block unit can be performed. After confirming the block information, the reference pixel configuration section can configure the reference pixels for the prediction of the current block. At this time, the reference pixels can be temporarily stored in a memory (for example, an array <array>The temporary storage can manage the reference pixels, generate and delete the reference pixels in each intra prediction process of the current block, and the size of the temporary storage can be determined according to the configuration of the reference pixels.

[0335] In the present example, assuming that the left block, the above block, the top-left block, the top-right block, and the bottom-left block are used for the prediction of the current block, however, it is not limited thereto, and a block candidate group having other configurations can be used for the prediction of the current block. For example, the candidate group for the neighboring blocks of the reference pixels can be one example according to a raster or Z scan, and a part of the candidate group can be removed according to a scan order or can be configured to include other block candidate groups (e.g., an additionally configured above block, a below block, a bottom-right block, etc.).

[0336] Alternatively, a block corresponding to the current block in other color spaces (e.g., corresponding to Y or Cb if the current block belongs to Cr) can be used for the prediction of the current block (e.g., with a corresponding coordinate in the case of a composition ratio according to the same coordinates or color component in each color space). In addition, for convenience of description, it is described by assuming that one block is configured in the preset positions (left, above, top-left, top-right, bottom-left), but there can be at least one block in the corresponding positions. That is, there can be a plurality of sub-blocks according to the partitioned blocks of the corresponding block in the preset positions.

[0337] In summary, the neighboring area of the current block can be the position of the reference pixel for the intra prediction of the current block, and according to the prediction mode, it can be considered to further consider the area corresponding to the current block of another color space as the position of the reference pixel. In addition to the above examples, the position of the reference pixel defined according to the prediction mode, method, etc. can be determined. For example, when the prediction block is generated by a method such as block matching, the reference pixel position can be considered as an area of a previously completed encoding / decoding of the current block of the current image or an area included in the search range in the area of the completed encoding / decoding (e.g., included in the left side or the upper side or the upper left side, the upper right side, etc. of the current block).

[0338] As Figure 11 shown in FIG. 1, the reference pixels for the prediction of the current block can be configured by the neighboring pixels (Ref_L, Ref_T, Ref_TL, Ref_TR, Ref_BL) in the left block, the above block, the top-left block, the top-right block, and the bottom-left block. Figure 11 At this time, the reference pixels are usually composed of the pixels (a) in the neighboring blocks closest to the current block, but other pixels (b) can also be included. Figure 11 Figure 11 ​b and other outer lines of pixels). That is, one of the first pixel line a adjacent to the current block, the second pixel line b adjacent to the first pixel line, the third pixel line adjacent to the second pixel line, or the fourth pixel line adjacent to the third pixel line can be used. For example, according to an encoding / decoding setting, the plurality of pixel lines can include all of the first to fourth pixel lines, or can include only the remaining pixel lines except for the third pixel line. Alternatively, the plurality of pixel lines can include only the first pixel line and the fourth pixel line.

[0339] The current block can perform intra prediction by selectively referring to any one of the plurality of pixel lines. At this time, the selection can be performed based on an index (refld) signaled by the encoding apparatus. Alternatively, any one of the plurality of pixel lines can be selectively used based on the size, shape, partition type of the current block, whether the intra prediction mode is a non-directional mode, the angle of the intra prediction mode, etc. For example, when the intra prediction mode is a planar mode or a DC mode, only the first pixel line can be used. Alternatively, when the size (width or height) of the current block is less than or equal to a predetermined threshold, only the first pixel line can be used. Alternatively, when the intra prediction mode is greater than a predetermined threshold angle (or less than a predetermined threshold angle), only the first pixel line can be used. The threshold angle can be an angle of the intra prediction mode corresponding to mode 2, mode 66 of the aforementioned prediction mode candidate group.

[0340] On the other hand, the pixels adjacent to the current block can be classified into at least one reference pixel layer, and the pixel closest to the current block can be classified as ref_0 (a pixel having a pixel value difference of 1 from the boundary pixel of the current block; p(-1,-1) to p(2m-1,-1), p(-1,0) to p(-1,2n-1)), the next adjacent pixel (the boundary pixel of the current block and the pixel value difference of 2; p(-2,-2) to p(2m,-2), p(-2,-1) to p(-2,2n)) is ref_1, the next adjacent pixel (the difference between the boundary pixel of the current block and the pixel value of 3; p(-3,-3) to p(2m+1,-3), p(-3,-2) to p(-3,2n+1)) is ref_2, etc. That is, the reference pixels can be classified into a plurality of reference pixel layers according to the distance of the pixels adjacent to the boundary pixel of the current block.

[0341] In addition, here, the reference pixel layer can be differently set for each adjacent neighboring block. For example, when the current block and the block adjacent to the upper end are used as reference blocks, the reference pixels according to the layer ref_0 can be used, and when the block adjacent to the upper end is used as a reference block, the reference pixels according to the layer ref_1 can be used.

[0342] At this time, the reference pixel set usually referred to when performing intra prediction belongs to an adjacent block neighboring the current block, which is located at the lower left, left, upper left, upper end, upper right end, and is a pixel belonging to the layer ref_0 (the pixel of the nearest boundary), and unless otherwise stated, the pixels belonging to each other are considered to be these pixels. However, only a part of the pixels belonging to the above-mentioned adjacent blocks can be used as the reference pixel set, or pixels belonging to two or more layers can be used as the reference pixel set. Here, the reference pixel set or layer can be determined implicitly (preset in the encoding / decoding device), or can be determined explicitly (information for determining can be received from the encoding device).

[0343] Here, the description is made on the premise that the maximum number of supported reference pixel layers is 3, but it can also have a value greater than that number, and the number of reference pixel layers and the number of reference pixel sets (or can be referred to as reference pixel candidate groups) according to the position of the adjacent block that can be referred to can be differently set according to the size, shape, prediction mode, image type (I / P / B, at this time, image is picture, slice, tile, etc.), color component, etc. of the block, and can be included in the related information in units of sequence, picture, slice, tile.

[0344] The present application describes the present application on the premise that a low index (increasing 1 from 0) is assigned from the reference pixel layer nearest to the current block, but the present application is not limited thereto. In addition, the related information of the reference pixel configuration described later can be generated under the index setting (binarization of assigning a short bit to a low index, etc. in the case of selecting one of a plurality of reference pixel sets) as above.

[0345] In addition, when two or more reference pixel layers are supported, each reference pixel included in two or more reference pixel layers can be used for weighted averaging.

[0346] For example, a prediction block can be generated using reference pixels obtained by a weighted sum of pixels in the layer ref_0 (the nearest pixel layer) and the layer ref_1 (the next pixel layer) located at Figure 12 At this time, depending on the prediction mode (for example, prediction mode direction), the pixels to which the weighted sum is applied in each reference pixel layer can not only be integer unit pixels, but also decimal unit pixels. In addition, a weighted value (for example, 7:1, 3:1, 2:1, 1:1) is applied to a prediction block obtained by using a first reference pixel layer reference pixel and a prediction block obtained by using a second reference pixel layer reference pixel, respectively, to obtain one prediction block. At this time, if the weighted value is a prediction block according to the reference pixel layer adjacent to the current block, it can have a higher weighted value.

[0347] Generally, for the above example, the nearest pixels of the neighboring block can be used as the reference pixels, but not limited to this, for example, there can be various cases (for example, the case of selecting ref_0 and ref_1 as the reference pixel layer, and generating the prediction pixel value by the weighted sum and the like method through ref_0 and ref_1, that is, the implicit case).

[0348] In addition, the reference pixel configuration related information (for example, the selection information for the reference pixel layer or set, etc.) can not include the preset information (for example, when the reference pixel layer is preset as ref_0), for example, can be configured as ref_1, ref_2, ref_3, etc., but not limited to this.

[0349] Some cases of the reference pixel configuration have been described through the above examples, which can be combined with various encoding / decoding information and the like to determine the intra prediction setting. At this time, the encoding / decoding information includes the image type, the color component, the size of the current block, the shape, the prediction mode (the kind of the prediction mode (directional, non-directional), the direction of the prediction mode (vertical, horizontal, diagonal line 1, diagonal line 2, etc.), etc., and the intra prediction setting (the reference pixel configuration setting in this example) can be determined according to the encoding / decoding information of the neighboring block and the combination of the encoding / decoding information of the current block and the neighboring block.

[0350] Figure 12 is a schematic diagram for explaining the reference pixel range for intra prediction. In detail, the reference pixel range is determined according to the size, shape, prediction mode configuration (angle information of the prediction mode in this example) of the block, etc. Figure 12 The position pointed by the arrow in is the pixel used for prediction.

[0351] Reference Figure 9 , A, A', B, B', C pixels refer to the pixels at the right lower end of the 8x2, 2x8, 8x4, 4x8, 8x8 blocks, in order to perform the prediction of the pixels, the reference pixel range of each block can be confirmed by using the pixels AT, AL, BT, BL, CT, CL in the upper and left blocks.

[0352] For example, when the reference pixels are A and A' pixels (rectangular block), the range of p(0,-1) to p(9,-1), p(-1,0) to p(-1,9), p(-1,-1) is located, when the reference pixels are B and B' pixels (rectangular block), the range of p(0,-1) to p(11,-1), p(-1,0) to p(-1,11), p(-1,-1) is located, when the reference pixels are C pixels (square block), the range of p(0,-1) to p(15,-1), p(-1,0) to p(-1,15), p(-1,-1) is located.

[0353] The range information of the reference pixels (e.g., P(-1,-1), P(M+N-1,-1), P(-1,N+M-1), etc.) obtained through the above process can be used for an intra prediction process (e.g., reference pixel filtering, a prediction pixel generation process, etc.). In addition, the reference pixel support case can not be limited to the above case, and there can be various other cases.

[0354] The reference pixel configuration section for intra prediction can include a reference pixel generation section, a reference pixel interpolation section, a reference pixel filtering section, etc., and can include all or a part of the above configuration.

[0355] The reference pixel configuration section can confirm the availability of the reference pixels to classify available reference pixels and unavailable reference pixels. For example, if a block (or a reference pixel candidate block) at a predetermined position can be used, the corresponding block can be used as a reference pixel, and if it is not available, the block cannot be used as a reference pixel.

[0356] When at least one of the following conditions is satisfied, the availability of the reference pixel is determined to be unavailable. For example, if any one of the cases of being located outside the picture boundary, not belonging to the same partition unit (e.g., slice, tile, etc.) as the current block, not being completed in encoding / decoding, and being limited in use according to the encoding / decoding setting is satisfied, it can be determined to be unavailable. That is, when none of the above conditions is satisfied, it can be determined to be available.

[0357] In addition, the use of the reference pixel can be limited by the encoding / decoding setting. For example, the use of the reference pixel can be limited according to whether or not a constrained intra prediction (e.g., constrained_intra_pred_flag) is performed. When error robustness encoding / decoding is to be performed with respect to external factors such as a communication environment, when it is attempted to prohibit the use of a block restored from another image as a reference pixel, the constrained intra prediction can be performed.

[0358] When the constrained intra prediction is deactivated (e.g., constrained_intra_pred_flag = 0 in an I picture type or a P or B picture type), all reference pixel candidate blocks are available, and when it is activated (e.g., constrained_intra_pred_flag = 1 in a P or B picture type), whether or not to use the reference pixel of the corresponding block can be determined according to the encoding mode (intra or inter) of the reference pixel candidate block. That is, if the encoding mode of the block is Intra, the block can be used regardless of whether or not the constrained intra prediction is activated. In the case of Inter, according to whether or not the constrained intra prediction is activated, it is determined to be usable (deactivated) or unavailable (activated).

[0359] Additionally, restricted intra-frame prediction can be applied based on the encoding mode of the reconstructed block corresponding to the current block in another color space. For example, if the current block belongs to some color difference components Cb, Cr, its availability can be determined based on the encoding mode of the block that has completed encoding / decoding of the luminance component Y corresponding to the current block. The above example could be an example of using a reconstructed block from another color space as a reference pixel. Alternatively, it could be an example of determining the encoding mode independently based on the color space.

[0360] At this point, when the reference pixel candidate block is encoded / decoded using some prediction method (e.g., in the current image, predicted by block matching or template matching, etc.), it can be determined whether to use the reference pixel based on the encoding / decoding settings.

[0361] As an example, when performing encoding / decoding using the prediction method, setting the encoding mode to Intra can determine that the corresponding block is available. Alternatively, even with Intra, special cases can be allowed to make it unavailable.

[0362] For example, when performing encoding / decoding using the prediction method, a corresponding block can be determined to be unavailable when the encoding mode is set to Inter. Alternatively, even with Inter, special cases can be allowed to make it available.

[0363] That is, it can be determined whether to make exceptions for cases where the use is determined by the encoding mode, based on the encoding / decoding settings.

[0364] Restricted intra-frame prediction can be a setting applied to some image types (e.g., P or B slice / tile types, etc.).

[0365] Based on reference pixel availability, candidate reference pixels can be categorized into three cases: all candidate reference pixels are usable, some reference pixels are usable, and none of the candidate reference pixels are usable. Except for the case where all candidate reference pixels are usable, in all other cases, unavailable reference pixels can be used to fill or generate candidate pixel locations.

[0366] When a candidate reference pixel block is available, the pixel at a preset position in that block (assuming in this example that the pixel is adjacent to the current block) can be stored in the reference pixel memory of the current block. At this time, the pixel data at the corresponding block position can be stored in the reference pixel memory through processes such as direct copying or reference pixel filtering.

[0367] When a reference pixel candidate block is unavailable, the pixels obtained through the reference pixel generation process can be stored in the reference pixel memory of the current block.

[0368] In summary, the reference pixels can be configured when the reference pixel candidate block is in the available state, and the reference pixels can be generated when the reference pixel candidate block is in the unavailable state.

[0369] Examples of filling the reference pixels at the unavailable block position using various methods are shown below.

[0370] For example, the reference pixels can be generated using arbitrary pixel values, and can be a pixel value belonging to a pixel value range (e.g., a value derived from a minimum value, a maximum value, a median value, etc. of a pixel value adjustment process based on a bit depth or a pixel value adjustment process based on image-based pixel value range information, etc.). In detail, this can be an example applied when all the reference pixel candidate blocks are unavailable.

[0371] Alternatively, the reference pixels can be generated from the completion of encoding / decoding of the image. In detail, the reference pixels can be generated from at least one available block adjacent to the unavailable block. At this time, at least one of an extrapolation, an interpolation, a copy, etc. can be used, and the reference pixel generation (or copy, extrapolation) direction can be a clockwise direction or a counterclockwise direction, and can be determined according to the encoding / decoding setting. For example, the reference pixel generation direction within the block can be along one preset direction or along a direction adaptively determined according to the position of the unavailable block. Alternatively, in the case of a region corresponding to the current block in other color spaces, the same method as the above example can be used. The difference is that, if it is a process of filling the adjacent reference pixels of the current block in the current color space, it is a process of filling a block MxN corresponding to the current block mxn in other color spaces, and thus the corresponding region can be generated by using other various methods including the method (e.g., extrapolation in the vertical, horizontal, diagonal, etc. direction of the surrounding pixels, interpolation such as Planar, averaging, etc. at this time, the filling direction refers to a direction from the surrounding pixels of the block corresponding to the current block to the inside of the block),. This example can be a case where the prediction mode for generating the prediction block from other color spaces is included in the candidate group without excluding it from the candidate group.

[0372] In addition, after the configuration of the reference pixels is completed through the confirmation process of the availability of the reference pixels, the reference pixels of a decimal unit can be generated through the linear interpolation of the reference pixels. Alternatively, the reference pixel interpolation process can be performed after the reference pixel filtering process is performed. Alternatively, only the filtering process for the configured reference pixels can be performed. In summary, this can be performed before the prediction block generation process.

[0373] At this time, in the case of horizontal, vertical, some diagonal mode (for example, diagonal right down, diagonal left down, diagonal right up) and non-directional mode, color mode, color copy mode, etc., the interpolation process is not performed, and in the case of other modes (other diagonal modes), the interpolation can be performed.

[0374] The interpolation accuracy can be determined according to the supported prediction mode candidate group (or the total number of prediction modes), the prediction mode configuration (for example, prediction mode direction angle, prediction mode interval), etc.

[0375] For the interpolation of the reference pixel of the decimal unit, one preset filter (for example, 2-tap linear interpolation filter) can be used, and one of a plurality of filter candidate groups (for example, 4-tap cubic filter, 4-tap Gaussian filter, 6-tap Wiener filter, 8-tap Kalman filter) can be used.

[0376] When one of a plurality of filter candidate groups is used, the filter selection information can be explicitly generated or implicitly determined, and can be determined according to the encoding / decoding setting (for example, interpolation accuracy, block size, shape, prediction mode, etc.).

[0377] For example, the interpolation filter to be used can be determined according to the range of the block size, the interpolation filter to be used can be determined according to the interpolation accuracy, and the interpolation filter can be determined according to the characteristics of the prediction mode (for example, directional information, etc.).

[0378] In detail, according to the block size range, a preset interpolation filter a can be used in some range A, a preset interpolation filter b can be used in some range B, and one of a plurality of interpolation filters C can be used in some range C, and one of a plurality of interpolation filters D can be used in some range D, and a preset interpolation filter can be used in some range, and one of a plurality of interpolation filters can be used in some range. At this time, when one interpolation filter is used, it belongs to the implicit case, one of a plurality of interpolation filters is used, it belongs to the explicit case, and the size of the block to which the division of the block size range is performed can be MxN (in this example, M and N are 4, 8, 16, 32, 64, 128, etc.; that is, M and N can be the minimum or maximum value of each block size range).

[0379] The interpolation-related information can be included in units of video, sequence, picture, slice, tile, block, etc. The interpolation process can be a process performed at the reference pixel configuration section, or can be a process performed at the prediction block generation section.

[0380] In addition, after the reference pixels are configured, filtering can be performed on the reference pixels to reduce the remaining degradation after the encoding / decoding process to improve the prediction accuracy, at this time, the filter used can be a low-pass filter. Whether to apply filtering can be determined according to the encoding / decoding setting, and if filtering is applied, fixed filtering or adaptive filtering can be applied, and the decoding / decoding setting can be defined according to the size, shape, prediction mode, etc. of the block.

[0381] Fixed filtering refers to the case where one preset filter is applied to the reference pixel filtering section, and adaptive filtering refers to the case where one filter among a plurality of filters is applied to the reference pixel filtering section. At this time, in the case of adaptive filtering, one among the plurality of filters can be implicitly determined according to the encoding / decoding setting, or selection information can be explicitly generated, and as a filter candidate group, a 3-tap (for example, [1, 2, 1] / 4) or 5-tap (for example, [2, 3, 6, 3, 2]) filter, etc. can be included.

[0382] As one example, filtering can not be applied in some settings (block range A).

[0383] As one example, filtering can not be applied in some settings (block range B, some modes C), and filtering can be applied by a preset filter (3-tap filter) in some settings (block range B, some modes D).

[0384] For example, filtering can not be applied in some settings (block range E, some modes F), and filtering can be applied by a preset filter (3-tap filter) in some settings (block range E, some modes G), filtering can be applied by a preset filter (5-tap filter) in some settings (block range E, some modes H), and one among a plurality of filters can be selected and filtering can be performed in some settings (block range E, some modes I).

[0385] As one example, filtering can be applied by a predetermined filter (5-tap filter) in some settings (block range J, some modes K), and filtering can be further applied by a preset filter (3-tap filter). That is, a plurality of filtering processes can be performed. In detail, filtering can be further applied based on the result of the previous filtering.

[0386] In the above example, the size of the block performing the partitioning of the block size range can be MxN (in this example, M and N are 4, 8, 16, 32, 64, 128, etc., i.e., M and N can be a minimum or maximum value for each block size range). In addition, the prediction mode can be roughly classified as a directional mode, a non-directional mode, a color mode, a color copy mode, etc., and in detail, a horizontal or vertical mode / diagonal mode (45 degree interval) / a mode 1 adjacent to a horizontal or vertical mode / a mode 2 adjacent to a horizontal or vertical mode (a mode interval is slightly longer than the previous one), etc. That is, as described above, it can be determined whether to apply filtering, the type of filtering according to the classified mode.

[0387] In addition, in the above example, a case where adaptive filtering is applied according to a plurality of factors such as a block range, a prediction mode, etc. is shown, however, the plurality of factors are not always required, and there can also be an example where adaptive filtering is performed according to at least one factor. In addition, there can be various transformation examples without being limited to the above-described example, and reference pixel filter related information can be included in units of a video, a sequence, a picture, a slice, a tile, a block.

[0388] The above-described filtering can be selectively performed based on a predetermined flag. Here, the flag can indicate whether to perform filtering on a reference pixel to perform intra prediction. The flag can be encoded and signaled by an encoding apparatus. Or, the flag can be derived in a decoding apparatus based on an encoding parameter of a current block. The encoding parameter can include at least one of a position / region of a reference pixel, a block size, a component type, whether to apply intra prediction in a sub-block unit, and an intra prediction mode.

[0389] For example, the reference pixels of the current block can be filtered when the reference pixels are a first line of pixels adjacent to the current block, otherwise, the reference pixels can not be filtered. Or, the reference pixels can be filtered if the number of pixels belonging to the current block is greater than a predetermined threshold number, otherwise, the reference pixels can not be filtered. The threshold is a value agreed upon in advance by the encoding / decoding apparatus, and can be an integer of 16, 32, 64 or more. Or, the reference pixels can be filtered if the current block is greater than a predetermined threshold size, otherwise, the reference pixels can not be filtered. The threshold size can be expressed as MxN, and is a value agreed upon in advance by the encoding / decoding apparatus, M and N can be integers of 8, 16, 32 or more. The threshold number or the threshold size can be set to determine whether to filter the reference pixels by one or mix them separately. Or, the reference pixels can be filtered if the current block is a luma component, otherwise, the reference pixels can not be filtered. Or, the reference pixels can be filtered if the current block does not perform the above-described intra prediction in a sub-block unit (i.e., the current block is not divided into a plurality of sub-blocks), otherwise, the reference pixels can not be filtered. Or, the reference pixels can be filtered when the intra prediction mode of the current block is a non-directional mode or a predetermined directional mode, otherwise, the reference pixels can not be filtered. Here, the non-directional mode can be a planar mode or a DC mode. However, in the DC mode among the non-directional modes, it can be limited not to perform filtering of the reference pixels. The directional mode can mean an intra prediction mode referring to an integer pixel. For example, the directional mode can include at least one of the intra prediction modes corresponding to modes -14, -12, -10, -6, 2, 18, 34, 50, 66, 72, 78, 80 as shown in FIG. 2. However, the directional mode can be limited so as not to include the horizontal mode and the vertical mode corresponding to modes 18 and 50, respectively. Figure 13

[0390] ​When filtering is performed on the reference pixels according to the flag, the filtering can be performed based on a filter pre-defined in the encoding / decoding apparatus. The number of taps of the filter can be 1, 2, 3, 4, 5, or more. The number of filter taps can be variably determined according to the positions of the reference pixels. For example, a 1-tap filter can be applied to the reference pixels corresponding to at least one of the lowermost end, the uppermost end, the leftmost side, and the rightmost side of the pixel line, and a 3-tap filter can be applied to the remaining reference pixels. In addition, filter strengths can be variably determined according to the positions of the reference pixels. For example, a filter strength s1 can be applied to the reference pixels corresponding to at least one of the lowermost end, the uppermost end, the leftmost side, and the rightmost side of the pixel line, and a filter strength s2 can be applied to the remaining reference pixels (s1 < s2). The filter strengths can be signaled in the encoding apparatus, or can be determined based on the above-described encoding parameters. When an n-tap filter is applied to a reference pixel, the filter can be applied to the current reference pixel and (n-1) surrounding reference pixels. The surrounding reference pixels can denote pixels located in at least one of the upper end, the lower end, the left side, or the right side of the current reference pixel. The surrounding reference pixels can belong to the same pixel line as the current reference pixel, and a part of the surrounding reference pixels can belong to a different pixel line from the current reference pixel.

[0391] For example, when the current reference pixel is located at the left side of the current block, the surrounding reference pixels can be pixels adjacent in at least one of the upper end or the lower end of the current reference pixel. Or, when the current reference pixel is located at the upper end of the current block, the surrounding reference pixels can be pixels adjacent in at least one of the left side and the right side of the current reference pixel. Or, when the current reference pixel is located at the upper left end of the current block, the surrounding reference pixels can be pixels adjacent in at least one of the lower end or the right side of the current reference pixel. The ratio between the coefficients of the filter can be [1:2:1], [1:3:1], or [1:4:1].

[0392] The prediction block generating section can generate a prediction block according to at least one prediction mode, and use reference pixels based on an intra prediction mode. At this time, the reference pixels can be used in an extrapolation method (directional mode), and can be used in a method such as interpolation or average value (DC) or copy (non-directional mode). Meanwhile, as described above, the current block can use filtered reference pixels or can use unfiltered reference pixels.

[0393] Figure 13 is a diagram showing a block adjacent to the current block with respect to generating a prediction block.

[0394] For example, in directional mode, the pattern between horizontal mode and some diagonal modes (top right diagonal, including diagonals other than horizontal) can use bottom left block + left block ( Figure 13 In Ref_BL and Ref_L, the horizontal mode can use the left block, and the mode between horizontal and vertical can use the left block + top-left block + top block. Figure 13 In the Ref_L, Ref_TL, Ref_T blocks, vertical mode can use the upper block ( Figure 13 In the Ref_L section, the pattern between vertical and some diagonal patterns (bottom left diagonal, including diagonals other than vertical) can use the top block + top right block ( Figure 13 The reference pixels for Ref_T and Ref_TR in the model. Alternatively, in non-directional mode, the left and top blocks (Ref_T and Ref_TR) can be used. Figure 13 Reference pixels of the middle (Ref_L, Ref_T) or the bottom left block, left block, top left block, top block, and top right block ( Figure 12 The Ref_BL, Ref_L, Ref_TL, Ref_T, and Ref_TR are mentioned. Alternatively, in the case of using a color space-dependent mode (color reproduction mode), a restoration block from another color space can be used. Figure 13 Not shown in the text, but referred to as Ref_Col in this invention; representing the collocated reference of blocks in different spaces at the same time as the reference pixel.

[0395] Reference pixels used for intra-frame prediction can be categorized into several concepts. For example, reference pixels used for intra-frame prediction can be distinguished into a first reference pixel and a second reference pixel, where the first reference pixel can be a pixel directly used to generate the prediction value for the current block, and the second reference pixel can be a pixel indirectly used to generate the prediction value for the current block. Alternatively, the first reference pixel can be a pixel used to generate the prediction values ​​for all pixels in the current block, and the second reference pixel can be a pixel used to generate the prediction values ​​for some pixels in the current block. Alternatively, the first reference pixel can be a pixel used to generate the primary prediction value for the current block, and the second reference pixel can be a pixel used to generate the secondary prediction value for the current block. Or, the first reference pixel (unconditionally) can be a pixel located in a region at the start of the prediction direction of the current block, and the second reference pixel can be a pixel not located at the start of the prediction direction of the current block (must).

[0396] As in the example above, although reference pixels can be distinguished using various definitions, there are also cases where some definitions do not apply depending on the prediction mode. That is, it should be noted that the definitions used to distinguish reference pixels can vary depending on the prediction mode.

[0397] The reference pixel described through the above example can be a first reference pixel, and a second reference pixel can further participate in the generation of the prediction block. Among some diagonal modes (diagonal right-up, including diagonal lines other than horizontal), a mode can use reference pixels of the top-left block + top block + top-right block (Ref_TL, Ref_T, Ref_TR in Figure 13 ), a horizontal mode can use reference pixels of the top-left block + top block + top-right block (Ref_TL, Ref_T, Ref_TR in Figure 13 ), a vertical mode is reference pixels of the top-left + left + bottom-left block (Ref_TL, Ref_T, Ref_TR in Figure 13 ), a vertical mode can use reference pixels of the top-left block + left block + bottom-left block (Ref_TL, Ref_L, Ref_BL in Figure 13 ), and a mode between a vertical and some diagonal modes (diagonal left-down, including diagonal lines other than vertical) can use reference pixels of the top-left block + left block + bottom-left block (Ref_TL, Ref_L, Ref_BL in Figure 13 ). In detail, the reference pixels can be used as second reference pixels. Also, the first reference pixel or the first and second reference pixels can be used to generate a prediction block in the non-directional mode and the color copy mode.

[0398] In addition, it can be considered that the second reference pixel includes not only a pixel that has completed encoding / decoding but also a pixel (in this example, a prediction pixel) in the current block. That is, the main prediction value can be a pixel used to generate an auxiliary prediction value. In the present application, an example in which a pixel that has completed encoding / decoding is considered as a second reference pixel will be mainly described, but is not limited thereto, and a transformed example in which a pixel that has not completed encoding / decoding (a prediction pixel in this example) is used can also be possible.

[0399] The generation or correction of a prediction block using multiple reference pixels can be performed for the purpose of compensating for disadvantages of an existing prediction mode.

[0400] For example, the directional mode is a mode used for the purpose of predicting directionality of a corresponding block by using some reference pixels (first reference pixels), but can not accurately reflect a change in the block, which can lead to a situation in which prediction accuracy is lowered. At this time, when a prediction block is generated or corrected by using additional reference pixels (second reference pixels), the accuracy of prediction can be improved.

[0401] For this, examples of a case in which a prediction block is generated using various reference pixels as in the above examples will be described in the following examples, but the present application is not limited to the case of the above examples, and even if terms such as first and second reference pixels are not used, it can be derived and understood from the above definitions.

[0402] Settings for generating prediction blocks using additional reference pixels can be explicitly determined or implicitly set. In the explicit case, units can include video, sequence, image, slice, tile, etc. The following examples will describe the implicit processing case, but the invention is not limited thereto, and other modifications (explicit or mixed cases) are possible.

[0403] Prediction blocks can be generated in various ways depending on the prediction mode. Specifically, the prediction method can be determined based on the position of the reference pixels used in the prediction mode. Alternatively, the prediction method can be determined based on the pixel positions within the block.

[0404] The following explains the horizontal mode.

[0405] For example, when the left block is used as a reference pixel ( Figure 13 When using Ref_L), the nearest neighbor pixel is used (e.g., extrapolation, etc.). Figure 13 In the 1300, prediction blocks are generated in the horizontal direction.

[0406] Alternatively, a prediction block can be generated (or corrected; generation may involve the final prediction value; correction may not involve all pixels) using reference pixels adjacent to the current block corresponding to the horizontal direction. Specifically, the nearest neighbor pixel of the corresponding block can be used. Figure 13 1310 in the example; alternatively, 1320 and 1330 can be considered to correct the predicted value, and the degree of change or gradient information of the pixel (e.g., the degree of change or gradient information of pixel values ​​such as R0-T0, T0-TL, T2-TL, T2-T0, T2-T1, etc.) can be fed back to the correction process.

[0407] At this point, the pixels for correction can be all pixels in the current block, or limited to a subset of pixels (e.g., they can be determined on a unit basis, such as individual pixels without a specific shape or existing in irregular positions, as in the examples described later, or on a unit basis, such as pixels with a certain shape, like lines; for ease of description, in the examples described later, the pixel unit is assumed to be a line). If the correction pixels are restricted to a subset of pixels, the unit can be determined as at least one line corresponding to the direction of the prediction mode. For example, pixels corresponding to a through d can be included in the correction target, and further, pixels corresponding to e through h can also be included in the correction target. Additionally, correction information obtained from neighboring pixels in the block can be applied identically regardless of the position of the line, or the correction information can be applied differently on a line-by-line basis, and the greater the distance from the neighboring pixels, the less correction information may be applied (e.g., a larger segmentation value, such as L1-TL, L0-TL, etc., can be set based on the distance).

[0408] At this point, the pixels included in the object to be corrected can have only one setting in an image, or can be adaptively determined based on various encoding / decoding elements.

[0409] Taking the adaptive determination case as an example, the pixels to be corrected can be determined based on the block size. In blocks smaller than 8×8, no lines are corrected; for blocks larger than 8×8 and smaller than 32×32, only one pixel line can be corrected; and for blocks larger than 32×32, two pixel lines can be corrected. The definition of the block size range can be derived from the previous description of this invention.

[0410] Alternatively, the pixels to be corrected can be determined based on the shape of the block (e.g., square, rectangle; specifically, a rectangle that is longer horizontally or vertically). For example, in the case of an 8×4 block, two pixel lines ( Figure 13 In the middle, (a to h) corrections are performed, and in the case of a 4×8 block, a pixel line ( Figure 13 In section a through d), corrections are performed. This is because if the shape of a horizontally stretched block in an 8×4 configuration is determined to be horizontal, the orientation of the current block may depend more on the upper block. Conversely, if the shape of a vertically stretched block in a 4×8 configuration is determined to be horizontal, the orientation of the current block may not depend as much on the upper block. Furthermore, the opposite setting is also possible.

[0411] Alternatively, the pixels to be corrected can be determined based on the prediction mode. In horizontal or vertical modes, a pixel line can be the correction target, while in other modes, b pixel lines can be the correction target. As mentioned above, in some modes (e.g., non-directional DC mode, color reproduction mode, etc.), the pixels to be corrected are not rectangular in shape, but are specified in pixels (e.g., a to d, e, i, m). This will be described in detail in the examples described later.

[0412] In addition to the above descriptions, adaptive settings can be applied based on additional encoding / decoding elements. While the above descriptions focus on the limitations of the horizontal mode, the same or similar settings can be applied to other modes, not just the examples above. Furthermore, the above examples can be achieved through combinations of multiple elements, rather than a single encoding / decoding element.

[0413] In the case of the vertical mode, since it can be derived by applying different directions to the prediction method used for the horizontal mode, a detailed description of it is omitted. Additionally, in the examples below, content that overlaps with the description of the horizontal mode is omitted.

[0414] Next, a case of a diagonal mode (Diagonalupright) is explained.

[0415] For example, when the left block and the lower-left block are used as the reference pixels (the first reference pixels or the main reference pixels. Figure 13 Ref_L and Ref_BL) in the Ref_L and the Ref_BL), the prediction block is generated in the diagonal direction by using the (e.g., the outermost pixels, etc.) nearest pixels of the corresponding block (1300 and 1340 in the Ref_L and the Ref_BL). Figure 13

[0416] In addition, the prediction block can be generated (or corrected) by using the reference pixels (the second reference pixels or the auxiliary reference pixels; Figure 13 Ref_T and Ref_TR) adjacent to the current block existing at the diagonally opposite position. Figure 13 In detail, the prediction value can be corrected by using the nearest pixels of the corresponding block (1310 and 1330 in the Ref_T and the Ref_TR), and the feedback to the correction process can be additionally considered from the auxiliary reference pixels and the main reference pixels (1320). At this time, the different weighting values are determined according to the proximity of the inclination information, etc. in the current prediction mode direction with the corresponding prediction pixel as the center, that is, the gradient of the corresponding prediction pixel and each auxiliary reference pixel is confirmed, and which current prediction mode gradient is closer.

[0417] At this time, the filter has one setting in one image or is adaptively determined according to various encoding / decoding elements.

[0418] In the case of adaptive determination, the pixels to which the filter is applied (e.g., the number of pixels, etc.) can be determined according to the position of the pixel to be corrected. If the prediction mode is the diagonal mode (mode 2 in this example) and the pixel to be corrected is c, prediction is performed using L3 (the first reference pixel in this example), and correction is performed using T3 (the second reference pixel in this example). That is, it can be a case in which one first reference pixel and one second reference pixel are used for one pixel prediction.

[0419] ​Or, when the prediction mode is a diagonal mode (mode 3 in this example) and the pixel to be corrected is b, the prediction is performed using L1* (or L2*, the first reference pixel in this example) obtained by performing interpolation on the decimal unit pixels between L1 and L2, and the correction can be performed using T2 (the second reference pixel in this example), or the correction can be performed using T3. Or, the correction can be performed using T2 and T3, or the correction can be performed using T2* (or T3*) obtained by performing interpolation on the decimal unit pixels between T2 and T3 obtained based on the directionality of the prediction mode. That is, to predict one pixel, it can be using one first reference pixel (in this example, assuming L1* when the pixel to be used directly is considered as L1 and L2, it can be considered as two pixels; or according to the filter used to perform interpolation on L1*, it can be considered as two or more pixels) and two second reference pixels (in this example, assuming the case of T2 and T3, L1* can be considered as one pixel).

[0420] In summary, at least one first reference pixel and at least one second reference pixel can be used for one pixel prediction, which can be determined according to the prediction mode and the position of the predicted pixel.

[0421] If it is the case that the correction pixel is applied to some pixels restrictively, the corrected pixel can be determined according to the intra prediction mode direction, in units of at least one horizontal line or vertical line. For example, the pixels corresponding to a, e, i, m or the pixels corresponding to a to d can be included in the correction target, further, the pixels corresponding to b, f, j, n or the pixels corresponding to e to h can also be included in the correction target. In some diagonal up right (Diagonal up right) cases, the pixels in the horizontal line unit can be corrected, and in some diagonal down left (Diagonal down left) cases, the pixels in the vertical line unit can be corrected, but not limited thereto.

[0422] In addition to the above description, according to additional encoding / decoding elements, adaptive settings can be applied, in the above description, the restrictive case of diagonal up right (Diagonal up right) is mainly described, however, not only in the above example, the same or similar settings can be applied to other modes. And, the above example can be realized according to the combination of multiple elements rather than one encoding / decoding element.

[0423] In the case of diagonal down left (Diagonal down left), since only a different direction can be derived for the prediction method of diagonal up right, detailed description is omitted.

[0424] The following explains the case of the top left diagonal.

[0425] For example, when the left block, top-left block, and top block are used as reference pixels (first reference pixel or main reference pixel). Figure 13 When using Ref_L, Ref_TL, Ref_T in the block, the nearest pixel (e.g., extrapolation, etc.) is used. Figure 13 The prediction blocks (1300, 1310, 1320) are generated in the diagonal direction.

[0426] Alternatively, a reference pixel (second reference pixel or auxiliary reference pixel) adjacent to the current block that exists at a position matching the diagonal can be used. Figure 13 The Ref_L, Ref_TL, and Ref_T pixels (located in the same position as the main reference pixel) are used to generate (or correct) prediction blocks. Specifically, pixels other than the nearest neighbor pixel of the corresponding block can be used. Figure 13 The predicted value is corrected by the pixels to the left of 1300, the pixels to the left, top, and upper left of 1320, the pixels above 1310, etc., and can be fed back to the correction process by a weighted average of the auxiliary reference pixels and the main reference pixels (for example, the ratio of the weights applied to the main reference pixels and auxiliary reference pixels can be 7:1 to 4:4, etc. If there are more than two auxiliary reference pixels, examples of weighted values ​​can be such as 14:1:1, 12:2:2, 10:3:3, 8:4:4, etc., where the auxiliary reference pixels have the same weight, or such as 12:3:1, 10:4:2, 8:6:2, etc., where the auxiliary reference pixels can have different weights; in this case, the weights applied differently can be determined based on whether they are adjacent to the main reference pixel) or linear extrapolation, etc.

[0427] If the correction is applied restrictively to a limited number of pixels, the pixels to be corrected can be determined on a unit of horizontal or vertical lines adjacent to the reference pixels used in the prediction mode. In this case, both horizontal and vertical lines can be considered simultaneously, and overlap can be allowed. For example, pixels corresponding to a through d and pixels corresponding to a, e, i, and m (a overlap) can be included in the correction target. Further, pixels corresponding to e through h and pixels corresponding to b, f, j, and n (a, b, e, and f overlap) can be included in the correction target.

[0428] The following describes the case of non-directional mode (DC).

[0429] For example, when at least one of the left block, top block, top-left block, top-right block, and bottom-left block is used as a reference pixel, the nearest neighbor pixel of that block can be used (e.g., averaged, etc.) (assuming in this example). Figure 9 a pixel in the current block (e.g., a pixel in 1300, 1310 in the current block) generates a prediction block.

[0430] Alternatively, neighboring pixels of the reference pixel (second reference pixel or auxiliary reference pixel of the reference pixel) can be used; Figure 9 Ref_L and Ref_T in the current example are located at the same position as the primary reference pixel or outside the primary reference pixel, and also include pixels located at the next adjacent position; similar to the case of diagonal up left (Diagonal up left), a prediction block is generated (or corrected). In detail, the prediction value can be corrected by using the same or similar position pixels as the primary reference pixel of the corresponding block, and the auxiliary reference pixel and the primary reference pixel are fed back to the correction process by weighted average (for example, the ratio of the weight value applied to the primary reference pixel and the auxiliary reference pixel can have 15:1 to 8:8, etc.; if there are more than 2 auxiliary reference pixels, the weight value can have the same weight value in the auxiliary reference pixel, such as 14:1:1, 12:2:2, 10:3:3, 8:4:4, etc., or different weight values between auxiliary reference pixels, such as 12:3:1, 10:4:2, 8:6:2, etc.).

[0431] At this time, the filter has one setting for one image or is adaptively determined according to various encoding / decoding elements.

[0432] Taking the case of adaptive determination as an example, the filter can be determined according to the size of the block. For the pixels located at the top left end, top end, and left end of the current block (in this example, it is assumed that the pixel located at the top left end is filtered on the left and top of the pixel, the pixel located at the top end is filtered on the top of the pixel, and the pixel located at the left end is filtered on the left of the pixel), in the block smaller than 16x16, some filter settings can be adopted (in this example, the filter is applied according to the weight ratio of 8:4:4, 12:4), and in the block larger than 16x16, some filter settings can be adopted (in this example, the filter is applied according to the weight ratio of 10:3:3, 14:2).

[0433] Alternatively, the filter can be determined based on the shape of the block. For example, for a 16x8 block, the pixel at the top of the current block can be filtered (in this example, assuming the pixels to the top left, top, and top right of that pixel are filtered, this can be considered an example where even the pixels to which the filter is applied are altered; the weighting ratio for the filter is 10:2:2:2), and the pixel at the left end of the current block can be filtered (in this example, assuming the pixels to the left of that pixel are filtered, the weighting ratio for the filter is 12:4). This is an example assuming it can be applied to multiple pixels at the top of a block in a block shape that is longer in the horizontal direction. Furthermore, the opposite settings can also be implemented.

[0434] If the pixels to be corrected are limited to a few pixels, the corrected pixels can be determined on a unit of horizontal or vertical lines adjacent to the reference pixels used in the prediction mode. In this case, both horizontal and vertical lines can be considered simultaneously, and overlap can be allowed. For example, pixels corresponding to a through d and pixels corresponding to a, e, i, m (a overlap) can be included in the correction target. Further, pixels corresponding to e through h and pixels corresponding to b, f, j, n (a, b, e, f overlap) can be included in the correction target.

[0435] In addition to the above description, adaptive settings are implemented based on additional encoding / decoding elements. While the above description focuses on the limitations of non-directional modes, these limitations are not limited to the examples above; similar or identical settings can be applied to other modes. Furthermore, the example described above can be implemented using a combination of multiple elements instead of a single encoding / decoding element.

[0436] The following describes the color copying mode.

[0437] For the color reproduction mode, prediction blocks are generated using a different method than that used in existing prediction modes, but reference pixels can be used in the same or similar way to generate (or correct) the prediction blocks. Since the content of obtaining the prediction blocks can be derived from the examples above and those described later, the details of obtaining the prediction blocks are omitted.

[0438] For example, a prediction block can be generated by using (e.g., copying) a block in a different color space that corresponds to the current block as a reference pixel (first reference pixel or main reference pixel).

[0439] Alternatively, a reference pixel (second reference pixel or auxiliary reference pixel) from a block adjacent to the current block can be used. Figure 14 The Ref_L, Ref_T, Ref_TL, Ref_TR, and Ref_BL values ​​in the provided text are used to generate (or correct) the prediction block. Specifically, the nearest neighbor pixel of the corresponding block (assuming it's the nearest neighbor in this example) can be used. Figure 14

[0440] Alternatively, pixels of blocks neighboring the block obtained in other color spaces (second reference pixels or auxiliary reference pixels; when assuming Figure 14 that the picture is a block in other color spaces corresponding to the current block, the pixels are Ref_L, Ref_T, Ref_TL, Ref_TB, Ref_BL, and Ref_R, Ref_BR, Ref_B) are used to generate (or correct) the prediction block. Filtering can be performed on the pixels to be corrected and their surrounding pixels (e.g., first reference pixels or first reference pixels and second reference pixels in different color spaces; i.e., within the block, the first reference pixels to be corrected and the first reference pixels to which filtering is applied are required, at the block boundary, the first reference pixels to be corrected and the first reference pixels to which filtering is applied are required, etc.) and fed back to the correction process. Figure 14

[0441] In the case where a mixture of the two cases occurs, not only the pixels of the neighboring blocks of the current block but also the pixels in the prediction block obtained in other color spaces can be used for correction, and filtering is performed on the pixels to be corrected and their surrounding pixels (e.g., the pixels of the neighboring blocks of the correction target pixels and the neighboring pixels within the current block of the correction target pixels) and fed back to the correction process.

[0442] This example is a case where filtering is applied after the prediction value of the current block in other color spaces is obtained, but it can also be a value that has already been filtered in the corresponding color space before the prediction value is obtained as the prediction value of the current block. At this time, it should be noted that this case only differs from the above example in order and the object of filtering is the same.

[0443] At this time, the filtering has only one setting in one image or is adaptively determined according to various encoding / decoding elements. ​​

[0444] For example, for the case of adaptive determination, the setting for filtering can be determined according to the prediction mode. In detail, it can set adaptive filtering according to the detail color copy mode among the color copy modes. For example, in some color copy modes (in this example, when one set of correlation information is obtained in the neighboring area of the current block and the neighboring area of the block corresponding to a different color space), some filter setting <1> can be employed, and in some color copy modes (in this example, compared to the above mode, when a plurality of sets of correlation information are obtained. That is, a1 and b1, a2 and b2), some filter setting <2> can be employed.

[0445] In the filter setting, it can be determined whether to apply filtering. For example, according to the filter setting, filtering <1> can be applied or filtering <2> can not be applied. Or, an A filter <1> can be used or a B filter <2> can be used. Or, filtering can be applied to all pixels of the left and upper sides of the current block, or filtering can be applied to some pixels of the left and upper sides.

[0446] If the pixels to be corrected are limited to some pixels, the pixels to be corrected can be determined in units of horizontal lines or vertical lines adjacent to the reference pixels for the prediction mode (in this example, the auxiliary reference pixels. Different from the foregoing example). At this time, the horizontal line and the vertical line can be considered at the same time, and overlap can be allowed.

[0447] For example, the pixels corresponding to a to d and the pixels corresponding to a, e, i, m (a overlap) can be included in the correction target. Further, the pixels corresponding to e to h and the pixels corresponding to b, f, j, n (a, b, e, f overlap) can be included in the correction target.

[0448] In summary, the main reference pixels for generating the prediction block can be obtained from the other color space, and the auxiliary reference pixels for correcting the prediction block can be obtained from the block adjacent to the current block of the current color space. And, it can be obtained from the block adjacent to the corresponding block of the other color space. And, it can be obtained from some pixels of the prediction block of the current block. That is, some pixels in the prediction block can be used to correct some pixels in the prediction block.

[0449] In addition to the above description, according to the additional encoding / decoding elements, adaptive settings can be applied, in the above description, the restrictive case of the non-directional mode is mainly described, however, not only in the above example, the same or similar settings can be applied to other modes. And, according to the combination of a plurality of elements, not one encoding / decoding element, the above examples are implemented.

[0450] The example is an example of using the correlation between color spaces to obtain a prediction block of a current block, but the block for which the correlation is used is obtained from a neighboring area of the current block and a neighboring area of a corresponding block of a different color space, and thus, filtering can be applied to the block boundary.

[0451] There can be various cases of using multiple reference pixels to generate a prediction block according to an encoding / decoding setting. In detail, it can be determined whether to support the generation or correction of a prediction block using a second reference pixel according to an encoding / decoding setting.

[0452] As one example, it can be implicitly or explicitly determined whether to use additional pixels in a prediction process. If it is an explicit case, the above information can be included in units of a video, a sequence, a picture, a slice, a tile, a block.

[0453] As one example, whether to use additional pixels in a prediction process can be applied to all prediction modes or can be applied to certain prediction modes. At this time, some prediction modes can be at least one of a horizontal, a vertical, some diagonal line modes, a non-directional mode, a color copy mode, etc.

[0454] As one example, whether to use additional pixels in a prediction process can be applied to all blocks or can be applied to some blocks. At this time, some blocks can be defined according to the size, shape, etc. of the blocks, and the corresponding blocks are MxN (for example, M and N have lengths of 8, 16, 32, 64, etc.; if it is a square, it has lengths of 8x8, 16x16, 32x32, 64x64, etc.; if it is a rectangle, it can have a shape of a 2:1 rectangle, a 4:1 rectangle, etc.).

[0455] In addition, it can be determined whether to use additional pixels in a prediction process according to some encoding / decoding settings. At this time, the encoding / decoding setting can be constrained_intra_pred_flag, and according to the flag, additional reference pixels can be limitedly used in a prediction process.

[0456] For example, when the use of an area including a second reference pixel is limited by the flag (i.e., assuming an area filled by a process of filling, etc. by a reference pixel according to the above flag), the second reference pixel can be limitedly used for a prediction process. Or, the second reference pixel can be used for a prediction process regardless of the flag.

[0457] In addition to the cases described through the above examples, there can be various applications and modifications such as the combination of one or more elements. In addition, although the above examples only describe some cases related to a color copy mode, the example can be used for prediction modes of generating or correcting a prediction block using multiple reference pixels, in addition to color copying or in a transformed manner.

[0458] Through the above examples, a case where one setting of generating or correcting a prediction block by using a plurality of reference pixels is performed in each prediction mode has been described, but a plurality of settings can be employed for each prediction mode. That is, a plurality of candidate groups of filter settings can be configured to generate selection information.

[0459] In summary, information on whether to perform filtering can be processed explicitly or implicitly, and when filtering is performed, information on filter selection information can be processed explicitly or implicitly. When information is processed explicitly, the information can be included in units of video, sequence, picture, slice, tile, and block.

[0460] The generated prediction block can be corrected, and hereinafter, a process of correcting the prediction block will be described.

[0461] The correction process can be performed based on a predetermined reference pixel and a weight. At this time, the reference pixel and the weight value can be determined according to the position of a pixel (hereinafter, referred to as a current pixel) in the current block to be corrected. The reference pixel and the weight value can be determined according to the intra prediction mode of the current block.

[0462] When the intra prediction mode of the current block is a non-directional mode, the reference pixels refL, refT of the current pixel can belong to a first pixel line adjacent to the current block and can be located on the same horizontal / vertical line as the current pixel. The weight value can include at least one of a first weight value wL in an x-axis direction, a second weight value wT in a y-axis direction, or a third weight value wTL in a diagonal direction. The first weight value can refer to a weight value applied to a left reference pixel, the second weight value can refer to a weight value applied to an upper reference pixel, and the third weight value can refer to a weight value applied to an upper-left reference pixel. Here, the first weight value and the second weight value can be determined based on position information of the current pixel and a predetermined scaling factor (nScale). The scaling factor can be determined based on the width W and the height H of the current block. For example, the first weight value wL[x] of the current pixel predPixel[x][y] is determined as (32 >> ((x << 1) >> nScale)), and the second weight value (wT[x]) can be determined as (32 >> ((y << 1) >> nScale)). The third weight value wTL[x][y] can be determined as ((wL[x] >> 4) + (wT[y] >> 4)). However, when the intra prediction mode is a planar mode, the third weight value can be determined as 0. The scaling factor can be set to ((Log2(nTbW) + Log2(nTbH) - 2) >> 2).

[0463] When the intra prediction mode of the current block is the vertical / horizontal mode, the reference pixels refL and refT of the current pixel belong to the first pixel line adjacent to the current block, and can be located on the same horizontal / vertical line as the current pixel. In the vertical mode, the first weighting value wL[x] of the current pixel predPixel[x][y] is determined as (32 » ((x « 1) » nScale)), the second weighting value (wT[y]) can be determined as 0, and the third weighting value wTL[x][y] can be determined as equal to the first weighting value. On the other hand, in the horizontal mode, the first weighting value wL[x] of the current pixel predPixel[x][y] is determined as 0, the second weighting value wT[y] is determined as (32 » ((y « 1) » nScale)), and the third weighting value wTL[x][y] can be determined as equal to the second weighting value.

[0464] When the intra prediction mode of the current block is the diagonal mode, the reference pixels refL and refT of the current pixel belong to the first pixel line adjacent to the current block, and can be located on the same diagonal line as the current pixel. Here, the diagonal line has the same angle as the intra prediction mode of the current block. The diagonal line can represent a diagonal line from the lower left end to the upper right end direction, or can represent a diagonal line from the upper left end to the lower right end direction. At this time, the first weighting value wL[x] of the current pixel predPixel[x][y] is determined as (32 » ((x « 1) » nScale)), the second weighting value wT[y] is determined as (32 » ((y « 1) » nScale)), and the third weighting value wTL[x][y] can be determined as 0.

[0465] When the intra prediction mode of the current block is less than or equal to mode 10, the reference pixels refL and refT of the current pixel belong to the first pixel line adjacent to the current block, and can be located on the same diagonal line as the current pixel. Here, the diagonal line has the same angle as the intra prediction mode of the current block. At this time, the reference pixels can be limited such that only one of the left reference pixel or the upper end reference pixel of the current block is used. The first weighting value wL[x] of the current pixel predPixel[x][y] is determined as 0, the second weighting value wT[y] is determined as (32 » ((y « 1) » nScale)), and the third weighting value wTL[x][y] can be determined as 0.

[0466] When the intra prediction mode of the current block is greater than or equal to mode 58, the reference pixels refL and refT of the current pixel belong to the first pixel line adjacent to the current block, and can be located on the same diagonal line as the current pixel. At this time, the diagonal line has the same angle as the intra prediction mode of the current block. At this time, the reference pixels can be limited so that only one of the left reference pixels or the upper end reference pixels of the current block is used. The first weighting value wL[x] of the current pixel predPixel[x][y] is determined as (32 » ((x « 1) » nScale)), the second weighting value wT[y] is determined as 0, and the third weighting value wTL[x][y] can be determined as 0.

[0467] Based on the determined reference pixels refL[x][y], refT[x][y] and the weighting values wL[x], wT[y], wTL[x][y], the following formula 1 can be performed on the current pixel predPixels[x][y].

[0468] [Formula 1]

[0469] predPixels[x][y] = clip1Cmp((refL[x][y] * wL[x] + refT[x][y] * wT[y] - p[-1][-1] * wTL[x][y] + (64 - wL[x] - wT[y] + wTL[x][y]) * predPixels[x][y] + 32) » 6)

[0470] However, the above correction process can be performed only when the current block does not perform intra prediction in a sub-block unit. The correction process can be performed only when the reference pixels of the current block are the first pixel line. The correction process can be performed only when the intra prediction mode of the current block corresponds to a specific mode. Here, the specific mode can include at least one of a non-directional mode, a vertical mode, a horizontal mode, a mode less than a predetermined first threshold mode, and a mode greater than a predetermined second threshold mode. The first threshold mode can be 8, 9, 10, 11, or 12, and the second threshold mode can be 56, 57, 58, 59, or 60.

[0471] The prediction mode determination section performs a process for selecting the best mode among a plurality of prediction mode candidate groups. In general, a mode with the best encoding cost can be determined using a rate-distortion technique that takes into account the block distortion (e.g., the distortion of the current block and the reconstructed block; the sum of absolute difference (SAD), the sum of square difference (SSD), etc.) and the amount of bits generated for the corresponding mode. The prediction block generated based on the prediction mode determined through the above process can be sent to the subtraction section and the addition section.

[0472] The prediction mode encoding section can perform encoding on the prediction mode selected by the prediction mode determination section. In the prediction mode candidate group, index information corresponding to the prediction mode can be encoded, or the prediction mode can be predicted to perform encoding on information related thereto. That is, in the former case, a method in which prediction is not performed and encoding is directly performed on the prediction mode, and in the latter case, a method in which prediction is performed on the prediction mode, and thus encoding is performed on mode prediction information and information obtained based on the prediction information. In addition, the former is an example that can be applied to a color difference component, and the latter is an example that can be applied to a luminance component, but is not limited thereto, and there can be other cases.

[0473] In the case of encoding by performing prediction on the prediction mode, the predicted value (or prediction information) of the prediction mode can be referred to as the most probable mode (MPM). At this time, a preset prediction mode (e.g., a DC mode, a planar mode, a vertical mode, a horizontal mode, a diagonal mode, etc.) or a prediction mode of a spatially adjacent block (e.g., a left block, an upper block, a left upper block, a right upper block, a left lower block, etc.) is configured as the MPM. In the present example, the diagonal mode can denote a diagonal up right, a diagonal down right, a diagonal down left, and can correspond to Figure 14 Mode 9, Mode 2, and Mode 66.

[0474] In addition, a mode derived from a mode already included in the MPM candidate group can be configured as the MPM candidate group. For example, in the case of a directional mode already included in the MPM candidate group, a mode having a mode interval difference of a (e.g., a is a non-zero integer, such as 1, -1, 2, -2, etc.; in the case of Figure 14 Mode 10 already included in Mode 10, the derived modes are Mode 9, Mode 11, Mode 8, Mode 12, etc.) are newly (or additionally) included in the MPM candidate group.

[0475] The above example can correspond to a case where the MPM candidate group is configured in multiple modes, and the MPM candidate group (or the number of MPM candidate groups) can be determined according to the encoding / decoding setting (e.g., prediction mode candidate group, image type, block size, block shape, etc.), and can include at least one mode.

[0476] The prediction modes used to configure the MPM candidate group can have a priority. The order of the prediction modes included in the MPM candidate group can be determined according to the priority, and when the number of MPM candidate groups is filled according to the priority, the configuration of the MPM candidate group can be completed. At this time, the priority can be in order of the prediction mode of the spatial neighboring block, the preset prediction mode, the mode derived from the prediction mode first included in the MPM candidate group, but there can be other modifications.

[0477] When performing prediction mode encoding of the current block using the MPM, information on whether the prediction mode matches the MPM (e.g., most_probable_mode_flag) can be generated.

[0478] If it matches the MPM (e.g., most_probable_mode_flag = 1), MPM index information (e.g., mpm_idx) can be additionally generated according to the configuration of the MPM. For example, if the MPM is configured as one prediction mode, no additional MPM index information is generated, and if the MPM is configured as multiple prediction modes, index information corresponding to the prediction mode of the current block can be generated in the MPM candidate group.

[0479] If it does not match the MPM (e.g., most_probable_mode_flag = 0), non-MPM index information (e.g., non_mpm_idx) corresponding to the prediction mode of the current mode can be generated in the remaining prediction mode candidate group (or non-MPM candidate group) other than the MPM candidate group in the prediction mode candidate group, which can be an example of a case where the non-MPM is configured as one group.

[0480] When a non-MPM candidate group consists of multiple groups, information about which group the prediction mode of the current block belongs to can be generated. For example, the non-MPM can be configured by groups A and B (assuming A is configured with m prediction modes, B with n prediction modes, and the non-MPM is configured with m+n prediction modes, where n is greater than m; assuming A's mode is a directional mode with equal intervals, and B's mode is a directional mode without equal intervals). If the prediction mode of the current block matches the prediction mode of group A (e.g., non_mpm_A_flag = 1), then in the candidate group A, index information corresponding to the prediction mode of the current block can be generated. If they do not match (e.g., non_mpm_A_flag = 0), then in the remaining prediction mode candidate groups (or the candidate group B), index information corresponding to the prediction mode of the current block can be generated. As in the example above, the non-MPM can be configured as at least one prediction mode candidate group (or cluster), and the non-MPM configuration can be determined based on the prediction mode candidate group. For example, when the number of prediction pattern candidate groups is less than 35, there can be one non-MPM; in other cases, there can be two or more non-MPMs.

[0481] As in the example above, the purpose of supporting non-MPM is to reduce the number of pattern bits when the number of prediction patterns is large and the prediction patterns are not predicted by MPM, when the non-MPM consists of multiple groups.

[0482] When performing prediction mode encoding (or prediction mode decoding) of the current block using MPM, a binarization table can be generated separately for each prediction mode candidate group (e.g., MPM candidate group, non-MPM candidate group, etc.), and a binarization method applicable to each candidate group can be applied separately.

[0483] The prediction-related information generated by the prediction mode coding unit can be transmitted to the coding unit and included in the bit stream.

[0484] Figure 15 This is an example of a tree-based segmentation block according to an embodiment of the present invention.

[0485] exist Figure 14 In the diagram, 'i' represents a quadtree partition, 'ii' represents a horizontal partition in a binary tree partition, and 'iii' represents a vertical partition in a binary tree partition. In the diagram, A through C represent the initial blocks (blocks before partitioning, e.g., coded tree units), and the numbers following these text indicate the partition numbers used during the partitioning process. In the case of a quadtree, the top-left, top-right, bottom-left, and bottom-right blocks are assigned numbers 0 through 3, respectively; in the case of a binary tree, the left / top and right / bottom blocks are assigned numbers 0 and 1, respectively.

[0486] refer to Figure 15 The segmentation status or information obtained during the segmentation process can be identified by the text and number obtained during the segmentation process to determine the segmentation status or information performed to obtain the corresponding block.

[0487] For example, in Figure 16 In i, block A00 is the top left block (with 0 added to A0) of the four blocks obtained by performing a quadtree partition on the initial block A.

[0488] Or, in Figure 16 In ii, block B10 is the upper block (adding 0 to B1) of the two blocks obtained by performing a horizontal split in the binary tree partitioning on the initial block B, and then performing a horizontal split in the binary tree partitioning on the lower block (adding 1 to B) B1.

[0489] By segmenting as described above, we can know the segmentation status and information of each block (e.g., supported segmentation settings <types of tree methods, etc.>), the supported range of the block, such as minimum and maximum size <details depend on the supported range of the segmentation method>, the allowed segmentation depth <details depend on the supported range of the segmentation method>, the segmentation flags <details depend on the segmentation flags of the segmentation method>, and the image type. , coding mode <intra inter>The encoding / decoding setting required for the confirmation information, and the like), and it can be confirmed which block (parent block) the current block belongs to before the partitioning step for obtaining the current block (sub-block). For example, in the case of the block A31 in i, the neighboring blocks can include A30, A12, A13, and it can be confirmed that A30 belongs to the same block A3 as A31 in the partitioning step of the previous step. In the case of A12 and A13, A12 and A13 belong to another block Al in the partitioning step of the previous step, i.e., A3, and it can be confirmed that A12 and A13 belong to the same block A only in the step before the previous step. Figure 16 In i, in the case of the block A31, the neighboring blocks can include A30, A12, A13, and it can be confirmed that A30 belongs to the same block A3 as A31 in the partitioning step of the previous step. In the case of A12 and A13, A12 and A13 belong to another block Al in the partitioning step of the previous step, i.e., A3, and it can be confirmed that A12 and A13 belong to the same block A only in the step before the previous step.

[0490] Since the above example is for the case of one partitioning operation (four partitioning of a quadtree or horizontal / vertical partitioning of a binary tree), the case where partitioning based on multiple trees is performed is explained in the following example.

[0491] 15 is an example of a block partitioned based on multiple trees according to an embodiment of the present application.

[0492] Referring to Figure 16 The partitioning state or information performed for obtaining the corresponding block can be confirmed by the letters and numbers obtained through the partitioning process. In this example, each letter does not mean an initial block, but indicates information about partitioning in the number.

[0493] For example, in the case of the block A1A1B0, the upper right block A1 is obtained when quadtree partitioning is performed in the initial block, and the upper right block (A1 is added to A1) is obtained when quadtree partitioning is performed in the block A1, while the upper block (B0 is added to A1A1) is indicated when horizontal partitioning in binary tree partitioning is performed in the block A1A1.

[0494] Alternatively, in the case of the block A3B1C1, the lower right block A3 is obtained when quadtree partitioning is performed in the initial block, and the lower block (B1 is added to A3) is obtained when horizontal partitioning in binary tree partitioning is performed in the block A3, while the right block (C1 is added to A3B1) is indicated when vertical partitioning in the binary tree partitioning process is performed in A3B1.

[0495] In this example, through the partitioning information, it can be confirmed that the relationship information between the current block and the neighboring blocks, such as in which partitioning step the current block and the neighboring blocks are the same, according to the partitioning step of each block.

[0496] Figure 16 and Figure 16 are some examples for confirming the partitioning information of each block, and the partitioning information of each block can be confirmed using various information and combinations of information for confirming the partitioning information (for example, partitioning flags, depth information, maximum value of depth information, range of blocks, and the like), and thus the relationship between the blocks can be confirmed.

[0497] Figure 16 are schematic diagrams showing various cases of partitioning a block.

[0498] In general, since various texture information exists in an image, it is difficult to perform encoding / decoding using one encoding / decoding method. For example, some regions can have regions in which a strong edge component exists in a specific direction, and some regions can have complex regions in which no edge component exists. In order to effectively perform encoding on this, block partitioning plays an important role.

[0499] The purpose of performing block partitioning is to effectively partition a region according to the characteristics of an image. However, when only one partitioning method (for example, quad-tree partitioning) is used, it can be difficult to appropriately reflect the characteristics of an image to perform partitioning.

[0500] Referring to Figure 16 It can be confirmed that an image including various textures is partitioned according to quad-tree partitioning and binary-tree partitioning. a to e can be a case in which only quad-tree partitioning is supported, and f to j can be a case in which only binary-tree partitioning is supported.

[0501] In the present example, a partition according to quad-tree partitioning is referred to as UL, UR, DL, and DR, and binary-tree partitioning is described based on this.

[0502] Figure 16 a of FIG. 1 can be a texture form in which quad-tree partitioning exhibits the best performance, can be partitioned into 4 by one partitioning (Div_HV) of the quad-tree, and encoding / decoding is performed in units of each block. Meanwhile, when, as shown in f of FIG. 1, binary-tree partitioning is applied, three partitionings (two Div_Vs and one Div_H) can be required compared to the quad-tree. Figure 16

[0503] Figure 16 b of FIG. 1 is that a texture is partitioned into an upper region and a lower region of a block, and in Figure 16 b of FIG. 1, one partitioning (Div_HV) is required when quad-tree partitioning is applied, and in Figure 15 ​In g, binary tree segmentation can also be used to perform a single Div_H segmentation. Assuming a quadtree segmentation flag requires 1 bit, while a binary tree segmentation flag requires 2 or more bits, quadtree segmentation can be considered efficient in terms of flag bits. However, generating encoding / decoding information (e.g., information for expressing texture information (residual signals, coding coefficients, information indicating the presence or absence of coding coefficients, etc.), prediction information (e.g., intra-frame prediction related information, inter-frame prediction related information), and transform information (e.g., transform type information, transform segmentation information, etc.) per block unit is less efficient than binary tree segmentation because texture information is an example of regenerating corresponding information from segmented similar regions.

[0504] exist Figure 16 In other cases, the type of tree can also be determined based on the texture. The examples above demonstrate the crucial importance of supporting variable block sizes and various segmentation methods, enabling the division of effective regions based on image characteristics.

[0505] The following is a detailed analysis of quadtree partitioning and binary tree partitioning.

[0506] Reference Figure 17 The 'b' in the diagram represents the blocks adjacent to the bottom-right block (the current block) (in this example, the left and top blocks). It can be seen that the left block has similar characteristics to the current block, while the top block has different characteristics. Although some blocks (in this example, the left block) share similar characteristics, based on the characteristics of quadtree partitioning, they may already be partitioned.

[0507] At this point, the current block, due to its similar characteristics to the left block, may generate similar encoding / decoding information. When intra-prediction modes (e.g., the most probable mode, i.e., information predicting the current block's mode from adjacent blocks to reduce the number of bits of the current block's prediction mode) or motion information prediction modes (e.g., skip mode, merge mode, information used to reduce mode bits (e.g., contention mode)) occur, the information from the left block is valid for reference. That is, when referencing the encoding information of the current block (e.g., intra-prediction information, inter-prediction information, filter information, coefficient information, etc.) from either the left or upper block, more accurate information (in this example, the left block) can be referenced.

[0508] refer to Figure 18 In the 'e', ​​let's assume the bottom rightmost block (the block that splits the current block twice). Similarly, the current block also has similar characteristics to the block above it in the left or upper block, thus allowing for improved encoding performance by referencing encoding information from the corresponding block (the upper block in this example).

[0509] On the contrary, referring to j in Figure 13 , the left block adjacent to the rightmost block (the block that the current block is split 2 times) is referred to. In this example, since there is no upper block, it can be confirmed that the current block is a block having different characteristics from the left block when referring to only the left block. It can be confirmed that the probability that the quadtree split can be similar to a part of the adjacent blocks, while the binary tree split has different characteristics from the adjacent blocks is high.

[0510] In detail, when some blocks (x) and their adjacent blocks (y) are the same blocks before being split, respectively, for the quadtree split, some blocks (x), the adjacent blocks (y) that are the same as the blocks before being split can have similar characteristics or different characteristics, on the contrary, for the binary tree, in most cases, the adjacent blocks (y) that are the same as the blocks before being split have different characteristics from some blocks (x). In other words, if it is the case of similar characteristics, there is no need to perform the split of the blocks, but is finally determined before being split, but most cases are split due to different characteristics.

[0511] In addition to the above example, Figure 18 , the right lower block x and the left lower block y can have the following relationship. That is, since the image characteristics of the upper block are similar, it is classified without performing the split, and since the image characteristics of the lower block are different, it is classified after being split into the left lower block and the right lower block.

[0512] In summary, in the case of the quadtree split, if, among the adjacent blocks adjacent to the current block, there is an adjacent block that is the same as the parent block as the current block, since it is split into 1 / 2 in the horizontal and vertical directions unconditionally due to the quadtree characteristics, it can have similar characteristics to the current block or different characteristics. In the case of the binary tree split, if, among the adjacent blocks adjacent to the current block, there is an adjacent block that is the same as the parent block as the current block, it can be split in the horizontal or vertical direction according to the image characteristics, and thus has been split can mean that it is split due to different characteristics.

[0513] (Quadtree split)

[0514] The adjacent block that is the same as the block before being split as the current block (in this example, it is assumed to be the left block, the upper block, but is not limited thereto) can have similar or different characteristics from the current block.

[0515] In addition, the adjacent block that is different from the block before being split as the current block can have similar or different characteristics from the current block.

[0516] (Binary tree split)

[0517] The adjacent block that is the same as the block before being split as the current block (in this example, it is assumed to be the left block or the upper block, and since it is a binary tree, the maximum number of candidates is one) can have different characteristics.

[0518] In addition, the neighboring block that is different from the pre-partition block of the current block can have a similar or different characteristic from the current block.

[0519] Hereinafter, the above assumption will be described as a main assumption of the present application. According to the above, the case (1) in which the characteristic of the neighboring block is similar to or different from the current block and the case (2) in which the characteristic of the neighboring block is different from the characteristic of the current block can be distinguished.

[0520] Referring again to Figure 18 .

[0521] As an example (the current block is A1A2), since the pre-partition block A1 of the A1A2 block is different from the pre-partition block (initial block) of the A0 block, the A0 block (left block) among the neighboring blocks can be classified (i.e., without knowing whether the characteristic is similar to or different from the current block) as a normal case.

[0522] As for the neighboring A1A0 block (upper block), since the pre-partition block A1 of the A1A2 block is identical to the pre-partition block A1 of the A1A0 block, the partitioning manner can be confirmed. At this time, since it is a quadtree partitioning (A), it is classified as a normal case.

[0523] As an example (the current block is A2B0B1), as for the A2B0B0 block (upper block) among the neighboring blocks, the pre-partition block A2B0 of the A2B0B1 block is identical to the pre-partition block A2B0B1 of the A2B0B1 block, and thus the partitioning manner is confirmed. At this time, since it is a binary tree partitioning (B), it is classified as an exceptional case.

[0524] As an example (the current block is A3B1C0), among the neighboring blocks, since the pre-partition block A3B1 of the A3B1C0 block is different from the pre-partition block A3 of the A3B0 block, the A3B0 block (upper right block in this example) can be classified as a normal case.

[0525] As described in the above examples, the neighboring blocks can be classified as a normal case and an exceptional case. For the normal case, the state in which it is not known whether the encoding information of the corresponding neighboring block can be used as the encoding information of the current block, and for the exceptional case, the state in which it is strictly judged that the encoding information of the corresponding neighboring block cannot be used as the encoding information of the current block.

[0526] Based on the above classification, a method of obtaining prediction information of the current block from the neighboring block can be used.

[0527] As described above, it is confirmed whether the pre-partition blocks of the current block and the neighboring block are identical (A).

[0528] If A has the same result, confirm the partition mode (B) of the current block (if the same, not only the current block, but also the block delimited using the same partition mode for the neighboring block, thus only confirm the current block).

[0529] If the result of A is different, exit (end).

[0530] If the result of B is quad-tree partitioning, mark the neighboring block as normal state and exit (end).

[0531] If the result of B is binary-tree partitioning, mark the neighboring block as exceptional state and exit (end).

[0532] The above example can be applied to the setting of the intra prediction mode prediction candidate group (related to the most probable mode) of the present application. The normal prediction candidate group setting (e.g., candidate group configuration priority, etc.) and the exceptional prediction candidate group setting can be supported, and the priority can be pushed back or excluded from the candidate group derived from the block based on the above state of the neighboring block.

[0533] At this time, the neighboring block to which the setting is applied can be limited to the spatial case (the same space), or can be applied to the case derived from other color spaces of the same image, such as a color copy mode. That is, the above setting can be performed considering the partitioning state of the block derived through the color copy mode, etc.

[0534] In addition to the above example, the following example is an example of adaptively determining the encoding / decoding setting (e.g., prediction candidate group setting, reference pixel setting, etc.) according to the relationship between the blocks (in the above example, the relative relationship between the current block and the other blocks is identified using the partition block information, etc.).

[0535] This example (luma component) is described under the assumption that 3 candidates selected from the neighboring blocks (left, top in this example) are configured as MPM candidate groups when the intra prediction mode is predefined in the encoding / decoding apparatus, and there are 35.

[0536] A total of two candidates can be configured by adding one candidate to the left block L0 and the top block T0, respectively. If the candidate group cannot be configured in each block, it can be replaced and filled in with a DC mode, a planar mode, a vertical mode, a horizontal mode, a diagonal mode, etc. If two candidates are filled in through the above process, the remaining one candidate can be filled in with the number in various cases.

[0537] For example, if the candidates filled in each block are the same, instead of the above-mentioned modes, neighboring modes (e.g., k_mode-2, k_mode-2, k_mode+1, k_mode+2, etc. when the same mode is k_mode) that do not overlap with the modes included in the candidate group are configured. Alternatively, when the candidates filled in each block are the same or different, the candidate group can be configured by adding a planar mode, a DC mode, a vertical mode, a horizontal mode, a diagonal mode.

[0538] Through the above process, the intra prediction mode candidate group (normal case) can be configured. The candidate group thus established belongs to the normal case, and the adaptive intra prediction mode candidate group (exception case) can be configured according to the neighboring block.

[0539] For example, if the neighboring block is marked with an exception state, the candidate group derived from the block can be excluded. If the left block is marked as an exception state, the candidate group can be configured with the upper block and a preset prediction mode (e.g., a mode derived from a DC block, a planar block, a vertical block, a horizontal block, a diagonal block, etc.). The above-mentioned example can be applied identically / similarly even when the MPM candidate group is configured with three or more MPM candidates.

[0540] The description will be made based on the assumption that the example (chroma component) has five intra prediction modes (DC mode, planar mode, vertical mode, horizontal mode, color mode in this example), and encoding / decoding is performed by configuring the prediction modes ordered with priorities determined adaptively as a candidate group (i.e., encoding / decoding is performed directly without using MPM).

[0541] First, the color mode is given the highest priority (0th index in this example; '0' is assigned 1 bit), and the other modes (planar, vertical, horizontal, DC in this example) are given low priorities (1st to 4th indexes in this example, '100', '101', '110', '111' are assigned 3 bits).

[0542] If the color mode matches one of the other prediction modes (DC, planar, vertical, horizontal) of the candidate group, the priority (1st to 4th indexes in this example) given to the matching prediction mode can be assigned a preset prediction mode (e.g., a diagonal mode, etc.), and if not, the candidate group configuration is ended.

[0543] Through the above process, the candidate group for the intra prediction mode can be configured. The example thus made corresponds to the normal case, and the adaptive candidate group can be configured according to the block from which the color mode has been acquired.

[0544] In this example, if the block corresponding to the current block in the other color space of the color mode has been acquired and is configured as one block (i.e., in a non-partitioned state), it can be referred to as a normal case, and if it is configured as a plurality of blocks (i.e., in a partitioned state of two or more), it can be considered an exceptional case. As described above, it can be an example assuming that the likelihood of the characteristics of the current block being different when the corresponding blocks in the different color space are configured as a plurality is higher depending on whether the parent blocks of the current block and the neighboring blocks are the same, the manner of partitioning, etc. That is, it can be understood as an example in which the coding / decoding settings are adaptively determined depending on the relationship between the blocks.

[0545] If an example is assumed according to the above, if the corresponding block is marked as an exceptional state, the prediction mode derived from the block can be given a lower priority. In this case, one of the other prediction modes (planar, DC, vertical, horizontal) can be assigned a high priority, and a lower priority can be assigned to the other prediction modes and the color mode that are not included in the priority.

[0546] For ease of description, the above-described example is described under some assumptions, but is not limited thereto, and the same or similar applications can be applied to the above-described various embodiments of the present application.

[0547] In summary, when there is a block marked as an exceptional state among the neighboring blocks, candidate group A can be used, and when there is a block marked as an exceptional state, candidate group B can be used. It can be understood that the above-described classification is divided into two cases, but the configuration of the intra prediction candidate group in the block unit can be adaptively implemented depending on the exceptional state and the block position.

[0548] In addition, the above-described example assumes a tree-based partitioning in the partitioning manner, but is not limited thereto. In detail, in the above-described example, it can be assumed that a block obtained using at least one tree-based partitioning manner is set as a coding block, and prediction, transformation, etc. are directly performed without partitioning the block into a prediction block, a transform block, etc.

[0549] As another example of the partitioning setting, a coding block is obtained using a tree-based partitioning, and at least one prediction block is obtained based on the obtained coding block.

[0550] For example, it can be assumed that a coding block (2N×2N) is obtained using a tree-based partitioning (in this example, a quad tree), and a prediction block is obtained based on a type (in this example, the candidate types that can be supported are 2N×2N, 2N×N, N×2N, N×N). At this time, when one coding block (in this example, it is assumed that this block is a parent block) is partitioned into a plurality of prediction blocks (in this example, it is assumed that these blocks are child blocks), the above-described setting of the exceptional state, etc. can also be applied between the prediction blocks.

[0551] Figure 18 If there are two prediction blocks (separated by thin solid lines) in the coding block (thick solid line), the lower block has different characteristics from the upper block, and does not refer to the coding information of the upper block or pushes back the priority.

[0552] Figure 19 An example of a split block according to an embodiment of the present application is shown. In detail, an example in which a base coding block (largest coding block, 8N x 8N) is split using quad-tree-based splitting to obtain coding blocks (diagonal block, 2N x 2N), and the obtained coding blocks are split into at least one prediction block (2N x 2N, 2N x N, N x 2N, N x N) by type-based splitting is shown.

[0553] Hereinafter, setting of an intra prediction mode candidate group for a case in which a block of a rectangular shape (2N x N and N x 2N) is obtained will be described.

[0554] Figure 13 Various examples of setting an intra prediction mode candidate group for a block (in this example, a prediction block of 2N x N) that generates prediction information are shown.

[0555] This example assumes that, when there are 67 intra prediction modes for (luminance component), 6 candidates are selected from neighboring blocks (in this example, left, above, upper left, upper right, lower left) and are configured in an MPM candidate group.

[0556] Referring to Figure 19 Four candidates can be configured in the order of L3-T3-B0-R0-TL, and two candidates can be configured in a preset mode (for example, planar, DC). If the maximum number (in this example, 6) is not filled in the above configuration, prediction modes derived from prediction modes already included in the candidate group (for example, when k_mode, there can be k_mode-2, k_mode-2, k_mode+1, k_mode+2, etc.), preset modes (for example, vertical, horizontal, diagonal, etc.), and the like can be included.

[0557] In this example, assuming the case of spatially neighboring blocks, the candidate group priority is in the order of left block - upper block - lower left block - upper right block - upper left block of the current block (in detail, lower side sub-block of the left block, right side sub-block of the upper block), and for the preset mode, the order is assumed to be planar - DC - vertical - horizontal - diagonal mode in that order.

[0558] Referring to Figure 19 a, with the same candidate group setting as the above example, the current block (2N x N, PU0) can be configured with the candidate group in the order of l1-t3-l2-tr-tl (since the other contents are repetitive, they are omitted). In this example, the neighboring block of the current block can be a block that has completed encoding / decoding (an encoded block, i.e., a prediction block in other encoded blocks).

[0559] Unlike the above, when the position of the current block corresponds to PUI, at least one intra prediction mode candidate group can be set. In general, the more a block is adjacent to the current block, the higher the likelihood of the block being similar to the characteristics of the current block, and thus it is most advantageous to configure a candidate group from the corresponding block (1). On the other hand, in order to perform parallel processing for decoding / decoding, it can be necessary to configure a candidate group (2).

[0560] If the current block is PUI, in the candidate group configuration setting as in (1), as Figure 19 b, the candidate group can be configured in the order of l3-c7-bl-k-l1 (k can be derived from c7 or tr, etc.), and in the candidate group configuration setting as in (2), as Figure 20 c, the candidate group can be configured in the order of l3-bl-k-l1 (k can be derived from tr, etc.). The difference between the two examples is whether to include the intra prediction mode of the upper block in the candidate group. That is, in the former case, in order to improve the efficiency of intra prediction mode encoding / decoding, the intra prediction mode of the upper block is included in the candidate group, and in the latter case, since it is in a state where it has not yet been determined whether encoding / decoding is completed, in order to perform parallel processing or the like, the intra prediction mode of the upper block, which cannot be referenced, is excluded from the candidate group.

[0561] Figure 21 Various examples of setting the intra prediction mode candidate group of the block (in this example, the prediction block is N x 2N) that generates prediction information are shown.

[0562] This example assumes that, when there are 67 intra prediction modes (for the luminance component), a total of 6 candidates are selected from the neighboring blocks (in this example, left, above, upper left, upper right, and lower left) and configured in the MPM candidate group.

[0563] Referring to ​ One candidate can be configured in the order of L3-L2-L1-L0 (top block), one candidate can be configured in the order of T3-T2-T1-T0 (top block), two candidates can be configured in the order of B0-R0-TL (top-left block, top-right block, bottom-left block), and two candidates can be configured in a preset mode (e.g., Planar, DC). If the maximum number is not filled in the above configuration, a prediction mode derived from a prediction mode already included in the candidate group, a preset mode, etc. can be included. At this time, the priority of the candidate group configuration can be in the order of left block-top block-planar block-DC block-bottom-left block-top-right block-top-left block.

[0564] Referring to ​ a, in the same manner as in the candidate group setting in the above example, one candidate can be configured in the order of l3-l2-l1-l0, one candidate can be configured in the order of t1-t0, and two candidates can be configured in the order of bl-t2-tl for the current block (N×2N.PU0). In this example, the neighboring blocks of the current block can be blocks for which encoding / decoding has been completed (coded blocks; i.e., prediction blocks in other coded blocks).

[0565] Unlike the above, at least one intra prediction mode candidate group can be set when the position of the current block corresponds to PUI. In the above example, (1) and (2) can be configured.

[0566] If the current block is PUI, one candidate can be configured in the order of c13-c9-c5-c1, one candidate can be configured in the order of t3-t2, and two candidates can be configured in the order of k-tr-tl (k can be derived from bl or c13, etc.) in the candidate group configuration setting as in (1), and one candidate can be configured in the order of t3-t2, and two candidate groups can be configured in the order of k-tr-tl (k can be derived from bl, etc.) in the candidate group configuration setting as in (2), as in b. ​ ​ The difference between the two examples is whether to include a candidate group of an intra prediction mode of a top block. That is, in the former case, in order to improve the efficiency of intra prediction mode encoding / decoding, an intra prediction mode of a left block is included in the candidate group, and in the latter case, since it is in a state in which it has not been determined whether encoding / decoding is completed, an intra prediction mode of a left block that cannot be referred to is excluded from the candidate group for parallel processing, etc.

[0567] Thus, the candidate group configuration can be determined according to the setting of the candidate group configuration. In this example, the candidate group configuration setting (in this example, the candidate group configuration setting for parallel processing) can be implicitly determined, or relevant information can be explicitly included in a video, a sequence, a picture, a slice, a tile, etc. ​

[0568] The above is summarized as follows. Assume the case where the relevant information is implicitly determined or explicitly generated.

[0569] Confirm the configuration of the intra prediction mode candidate group at the initial stage of encoding / decoding (A).

[0570] If the result of the confirmation for A is the setting where the previous prediction block in the same coding block can be referred to, the intra prediction mode of the block is included in the candidate group (end).

[0571] If the result of the confirmation for A is the setting where the previous prediction block in the same coding block cannot be referred to, the intra prediction mode of the block is excluded from the candidate group (end).

[0572] For the convenience of description, the above example is described under some assumptions, but is not limited thereto, and the same or similar applications can be applied to the above various embodiments of the present application.

[0573] ​ An example of block partitioning according to an embodiment of the present application is shown. In detail, the basic coding block (the largest coding block) indicates an example of obtaining a coding block (diagonal block AxB) by partitioning based on a binary tree (or multiple tree-based partitioning), and the obtained coding block is set as an example of a prediction block.

[0574] At this time, the motion information prediction candidate group setting for the case where a rectangular block is obtained (AxB, A≠B) will be described below.

[0575] ​ Various examples of setting the intra prediction mode candidate group of a block (in this example, a coding block. 2N×N) that generates prediction information are shown.

[0576] The description is made under the following assumptions: this example (luma component) has 67 intra prediction modes, 6 candidates are selected from the neighboring blocks (in this example, left, above, upper left, upper right, lower left) and are configured in the MPM candidate group, and when the non-MPM candidate group is configured as multiple groups (in this example, A and B. The modes that are more likely to predict the prediction mode of the current block among the non-MPM candidates belong to A) when A group is configured with a total of 16 candidates and B group is configured with a total of 45 candidates.

[0577] At this time, group A includes candidates classified according to a certain rule (for example, composed of equidistant modes among directional modes) not included in the MPM candidate group, or according to the MPM candidate group priority, can include candidates not included in the final MPM candidate group, etc. B group can be composed of candidates not included in group A among the MPM candidate group and the non-MPM candidate group.

[0578] Reference FIG. 21 a, the current block (CU0 or PU0, assuming size 2NxN, horizontal / vertical 2:1) can be configured with six candidates in the order of l1-t3-planar-DC-l2-tr-tl-l1*-t3*-l2*-tr*-tl*-vertical-horizontal-diagonal in a candidate group. In the above example, * indicates a mode derived from the prediction mode of each block (e.g., a sum mode of +1, -1, etc.).

[0579] On the other hand, referring to FIG. 21 b, the current block (CU1 or PU1, size 2N x N) can be configured with six candidates in the order of l3-c7-planar-DC-bl-k-l1-l3*-c7*-bl*-k*-l1*-vertical-horizontal-diagonal-c7* in a candidate group.

[0580] In this example, in the case where the setting of (2) of FIG. 18 is applied, as FIG. 21 b, l3-planar-DC-bl-k-l1-c7-l3*-bl*-k*-l1*-vertical-horizontal-diagonal-c7* is excluded from the prediction mode candidate group of the upper block, or the priority is pushed back, and thus can be included in Group A.

[0581] However, the difference from the case of FIG. 18 is that even if the block is rectangular in shape, the block is split into coding units and is immediately set as a prediction unit without additional splitting. Therefore, as shown in FIG. 18 , the candidate group configuration setting can not be applicable to this example (as in the setting of (2)).

[0582] However, in the case of k in FIG. 21 , since it is a position that is not yet coded / decoded, it can be derived from the neighboring block that is coded / decoded.

[0583] FIG. 22 Various examples of setting the intra prediction mode candidate group for the block (in this example, coding block Nx2N) that generates prediction information are shown.

[0584] The description will be made based on the assumption that when the example (chroma component) has five intra prediction modes (in this example, DC mode, planar mode, vertical mode, horizontal mode, color copy mode), the prediction modes configured in the order of priority after the post-ordering are adaptively determined and coding / decoding is performed.

[0585] At this time, the priority will be described based on the assumption that the priority is determined from the neighboring blocks (in this example, left, upper, upper left, upper right, lower left).

[0586] Referring to FIG. 13 The first level candidate can be determined in the left block L3, the top block T3, the top-left block TL, the top-right block R0, and the bottom-left block B0. At this time, the mode having the most frequent value among the modes of the prediction mode of the block can be determined as the first level candidate. If a plurality of modes have the most frequent value, a predetermined priority is assigned (for example, ColorCopy mode - Planar - Vertical - Horizontal - DC).

[0587] This example can be considered similar to the MPM candidate setting (in this example, the first bit is determined as 0 or 1; if 1, 2 additional bits are required; according to the encoding / decoding setting, the first bit can perform bypass encoding or regular encoding, and the remaining bits can perform bypass encoding) in aspects of obtaining a mode (the mode is a mode estimated as a prediction mode of a current block) from a neighboring block and determining a priority (i.e., determining the amount of bits allocated; for example, '0' for the first level, '100', '101', '110', '111' for the 2nd to 4th levels) therefrom, and aspects of performing prediction of a prediction mode.

[0588] Referring to FIG. 22 a, the current block (CU0 or PU0, assuming a size of N x 2N and horizontal / vertical of 1:2) can determine the first level candidate in the l3, t1, t1, t2, b1 blocks.

[0589] On the other hand, referring to FIG. 22 b, the current block (CU1 or PU1, size of N x 2N) can determine the first level candidate in the c13, t3, t1, tr, k blocks.

[0590] In the present example, when the setting of (2) of FIG. 19 is applied, the current block CU1 can determine the first level candidate in the t3, t1, tr, k blocks. In addition, if a block corresponding to the current block in other color space of the ColorCopy mode is not configured as one block, the priority of the ColorCopy mode is pushed back in the predetermined priority, and the priority is changed to Planar - Vertical - Horizontal - DC - ColorCopy mode, etc. As described above, it can be an example under the assumption that the example is different from the example of performing classification according to whether the parent block of the current block and the neighboring block is the same, the division manner, etc., but when the corresponding blocks of different color spaces are configured as a plurality, the possibility of a different characteristic from the current block is higher. That is, it can be understood as an example of adaptively determining the encoding / decoding setting according to the relationship between blocks.

[0591] However, the difference from the case of FIG. 19 is that even if the block is rectangular, the block is divided into coding units, and corresponds to a case where the prediction unit is immediately set without additional division. Therefore, as FIG. 19 The illustrated candidate group configuration setting can not be applicable to this example.

[0592] However, in the case of k in FIG. 22 , since it is a position where encoding / decoding is not completed, it can be derived from an adjacent block where encoding / decoding is completed.

[0593] For convenience of description, the above-described example is described under some assumptions, but is not limited thereto, and can have the same or similar application in the above-described various embodiments of the present application.

[0594] In the embodiments of FIG. 21 and FIG. 22 , a case where MxN (M≠N) blocks that can be split by binary tree splitting occur consecutively is assumed.

[0595] In the above-described case, a case as described in FIG. 14 to FIG. 16 (the example of setting a candidate group by confirming the relationship between the current block and the adjacent block, etc.) can occur. That is, in FIG. 21 and FIG. 21 , the adjacent blocks before the splitting of CU0 and CU1 are the same as each other, and CU0 and CU1 can be obtained by horizontal splitting or vertical splitting of binary tree splitting.

[0596] In addition, in the embodiments of FIG. 18 and FIG. 19 , a case where a plurality of rectangular-shaped prediction blocks in an encoding block occur after the splitting of the encoding block is assumed.

[0597] In the above-described case, a case as described in FIG. 14 to FIG. 16 may also occur. Then, a case where there is a conflict with the example of FIG. 18 and FIG. 19 occurs. For example, in FIG. 18 , in the case of PU1, it can be determined whether to use the information of PU0, and in FIG. 14 to FIG. 16 , since the characteristics of PU1 are different from those of PU0, the case where the information of PU0 is not used.

[0598] Regarding the above, the candidate group can be configured without a conflict according to the setting of the initial stage of encoding / decoding. According to various other encoding / decoding settings, the candidate group of motion information prediction can be set.

[0599] The case where the prediction mode candidate group is set is described through the above-described example. In addition, it can be set to restrict the use of reference pixels for predicting the current block from the adjacent block marked with the exception state.

[0600] For example, when a prediction block is generated by distinguishing the first reference pixel and the second reference pixel according to the embodiment of the present application, in the case where the second reference pixel is included in a block marked as an exceptional state, it is possible to restrict the generation of the prediction block by using the second reference pixel. That is, it is possible to generate the prediction block using only the first reference pixel.

[0601] In summary, the above example can be considered as one element in the encoding / decoding setting related to the use of the second reference pixel.

[0602] Various cases regarding the intra prediction mode candidate group setting of the present application will be explained.

[0603] In this example, it is assumed that there are 67 intra prediction modes, and configured by 65 directional modes and 2 non-directional modes of planar and DC, however, not limited thereto, and other intra prediction modes can be set. In this example, it is assumed that six candidates are included in the MPM candidate group. However, not limited thereto, and the MPM candidate group can also be configured by four, five, or seven candidates. In addition, the priority refers to the order of determining whether to be included in the MPM candidate group, but can be considered as an element for determining the binarization, entropy encoding / decoding setting, etc. regarding each candidate belonging to the MPM candidate group. The following example will be described centering on the luma component, but the same or similar or changed application can also be performed for the chroma component.

[0604] The mode included in the intra prediction mode candidate group (for example, the MPM candidate group, etc.) of the present application can be configured as the prediction mode of the spatially neighboring block, the preset prediction mode, and the prediction mode derived from the prediction mode included in the candidate, etc. At this time, the rule (for example, the priority, etc.) for configuring the candidate group can be determined according to the encoding / decoding setting.

[0605] The example described later describes the case regarding the fixed candidate group configuration.

[0606] As one example (1), one fixed priority for configuring the intra prediction mode candidate group (in this example, the MPM candidate group) can be supported. For example, one preset priority can be supported, for example, when the prediction mode of the spatially neighboring block is added to the candidate group, the prediction mode of the left block (L3 in), the prediction mode of the top block (T3 in), the prediction mode of the left-bottom block ( B0 in ), the prediction mode of the right-top block ( R0 in ), the prediction mode of the left-top block ( T0 in ), etc. can be supported. FIG. 13 FIG. 13 FIG. 13 FIG. 13 FIG. 13 order of the planar-DC-vertical-horizontal-diagonal modes when adding the preset prediction modes to the candidate group. In addition, there can be a mixed configuration of the above examples, such as the order of the left block-upper block-planar block-DC block-left lower block-right upper block-left upper block. If the number of candidates cannot be filled even when the candidates are executed according to the priority, the derived modes of the included prediction modes (e.g., +1, -1 of the left block mode, +1, -1 of the upper block mode, etc.), the vertical mode, the horizontal mode, the diagonal mode, etc. can have the next priority.

[0607] In the above example, when adding the prediction modes of the spatially adjacent blocks to the candidate group, the candidate modes have the priority of the left block-upper block-left lower block-right upper block-left upper block, and the prediction mode of the left block (L3) is included in the candidate group in the order. The prediction mode of the upper block (T3) in the L3 is included in the candidate group when the corresponding module does not exist, and the prediction mode of the upper block (T3) in the T3 is included in the candidate group as the next priority. In this way, the prediction mode is included in the candidate group in the order, and when the prediction mode of the corresponding block is not available or overlaps with the included mode, the order jumps to the next block. FIG. 12 FIG. 13 In the above example, when adding the prediction modes of the spatially adjacent blocks to the candidate group, the candidate modes have the priority of the left block-upper block-left lower block-right upper block-left upper block, and the prediction mode of the left block (L3) is included in the candidate group in the order. The prediction mode of the upper block (T3) in the L3 is included in the candidate group when the corresponding module does not exist, and the prediction mode of the upper block (T3) in the T3 is included in the candidate group as the next priority. In this way, the prediction mode is included in the candidate group in the order, and when the prediction mode of the corresponding block is not available or overlaps with the included mode, the order jumps to the next block.

[0608] As another example, when adding the prediction modes of the spatially adjacent blocks to the candidate group, the candidate group can be configured in the order of the left block-upper block-left lower block-right upper block-left upper block. At this time, the prediction mode of the left block first considers the prediction mode of the block located in the L3, but if there is an unavailable or overlapping mode, the prediction mode candidate of the left block is filled in the order of the next sub-blocks L2, L1, L0 of the left block. Likewise, the same or similar settings are applied to the upper block (T3-T2-T1-T0), the left lower block (B0-B1-B2-B3), the right upper block (R0-R1-R2-R3), and the left upper block (TL). For example, if it is a case where it cannot be added to the candidate group even if it is executed in the order of L3-L2-L1-L0, the next order block can be executed.

[0609] The example described later describes a case of adaptive candidate group configuration. The adaptive candidate group configuration can be determined according to the state of the current block (e.g., the size and shape of the block), the state of the adjacent block (e.g., the size and shape of the block, the prediction mode, etc.), or the relationship between the current block and the adjacent block.

[0610] As one example (3), adaptive priority for configuring the intra prediction mode candidate group (MPM candidate group in this example) can be supported. The priority can be set according to the frequency. That is, the prediction mode that frequently occurs can have a high priority, and the prediction mode that less frequently occurs can have a low priority.

[0611] ​For example, the priority can be set according to the frequency of the prediction mode of the spatially adjacent block.

[0612] A preset priority for the case where the frequencies are the same can be supported. For example, assuming that the modes occurring twice each among the left block, the upper block, the lower-left block, the upper-right block, and the upper-left block (assuming that one prediction mode is acquired for each block) are mode 6 and mode 31, and the mode occurring once is mode 14, in this example (assuming that the mode occurring in the previous order of the block in the order of left block - upper block - lower-left block - upper-right block - upper-left block is mode 6), mode 6 and mode 31 are included as the first and second candidates.

[0613] Mode 14, which is the prediction mode having a frequency of once, is included as the fifth candidate. Mode 5 and mode 7, and mode 30 and 32, which are derived from the first and second candidates, can then be placed in the next priority. In addition, mode 13 and mode 15, which are the modes derived from the fifth candidate, are placed in the next priority, and then the vertical mode, the horizontal mode, and the diagonal mode can have the next priority.

[0614] That is, the prediction modes having a frequency of 2 or more are assigned a priority before the planar mode and the DC mode, and the prediction mode having a frequency of 1 can be assigned a priority after the planar and DC modes, and the derived modes of the above example, the preset modes, etc. are placed behind.

[0615] In summary, the preset priority (for example, the order of left block - upper block - planar block - DC block - lower-left block - upper-right block - upper-left block) can be a priority set in consideration of the statistical characteristics of a general image, and the adaptive priority (in this example, the case where the modes are included in the candidate group according to the frequency) can be an example of performing a partial modification of the preset priority (in this example, the planar and DC are fixed as and the modes having a frequency of twice or more are arranged in front, and the modes having a frequency of once are arranged behind) in consideration of the partial characteristics of the image.

[0616] In addition, not only can the priority regarding the configuration of the candidate group be determined according to the frequency, but also the binarization and entropy encoding / decoding settings for each candidate belonging to the MPM candidate group can be determined based on the frequency. As one example, the binarization of the MPM candidate having m frequencies can be determined based on the frequency. Or, the context information regarding the candidate can be adaptively determined according to the frequency. That is, in this example, the context information setting the selection probability of the mode to be high can be used. That is, when m is 1 to 4 (in this example, 2 out of a total of 6 candidates include a non-directional mode, and thus the maximum value of the frequency is 4), the context information can be differently set.

[0617] If a bin index (the order of bits when configured with more than one bit according to binarization; for example, when an MPM candidate is configured as '010', the first to third bins can be 0, 1, 0) has 0s and 1s where 0 indicates that the candidate has been selected as the MPM (the case where a single bin is used to determine whether it is the final MPM, or the case where additional bins need to be confirmed to determine the final MPM; that is, in the above '010', if the first bin is 0, the second and third bins need to be confirmed to confirm whether the pattern is the final MPM; if it is a single bin, it can be immediately confirmed whether it is the final MPM based on the 0s and 1s of that bin), and 1 indicates that the candidate has not been selected as the MPM, then context information with a high probability of 0 is applied (that is, when performing binary arithmetic, the probability of 0 can be set to 90% and the probability of 1 to 10%. Assuming the basic case is that the probabilities of 0 and 1 are 60% and 40%, respectively), then context adaptive binary arithmetic coding (CABAC) can be applied.

[0618] As an example (4), adaptive prioritization for configuring intra-prediction mode candidate groups (MPM candidate groups in this example) can be supported. For example, the priority can be set based on the orientation of the prediction modes of spatially adjacent blocks.

[0619] At this point, the directional category is the pattern group facing upwards and to the right ( FIG. 9 (2 to 17) Horizontal pattern group ( FIG. 9 18) The pattern group facing the lower right (in the middle) FIG. 9 (19 to 49) Vertical mode group ( FIG. 9 50 in the middle), the pattern group facing the lower left ( FIG. 9 (51 to 66) Non-directional mode group (planar, DC mode). Alternatively, it can be divided into horizontally oriented mode group ( FIG. 9 Modes 2 to 34), vertical orientation mode group ( FIG. 9 The options include 35 to 66, non-directional mode groups (planar, DC mode), and each can have various configuration examples.

[0620] For example, if the base candidate group priority is the order of top-left block - planar block - DC block - bottom-left block - top-right block - top-left block, the candidate groups can be configured in the above order. However, after configuring the candidate groups, the priority for binarization, entropy encoding / decoding of each candidate can be determined based on the class. As an example, binarization that allocates fewer bits can be performed for a class including a large number of candidates in the MPM candidate group. Or, context information can be adaptively determined according to the class. That is, context information can be determined according to the number of modes included in each class (for example, context information is determined according to the combination of m and n when the first class is m and the second class is n).

[0621] As one example (5), adaptive priority can be supported according to the size and shape of the current block. For example, the priority can be determined according to the size of the block, and the priority can be determined according to the shape of the block.

[0622] If the block size is 32x32 or more, it can be included in the candidate group in the order of left block - top block - planar block - DC block - bottom-left block - top-right block - top-left block, and if it is less than 32x32, it can be included in the candidate group in the order of left block - top block - bottom-left block - top-right block - top-left block - planar block - DC block.

[0623] Or, if the shape of the block is square, it can be included in the candidate group in the order of left block - top block - planar block - DC block - bottom-left block - top-right block - top-left block, if the shape of the block is rectangular (horizontal is long), it can be included in the candidate group in the order of top block - top-right block - top-left block - planar block - DC block - left block - bottom-left block, and if the shape of the block is rectangular (vertical is long), it can be included in the candidate group in the order of left block - bottom-left block - top-left block - planar block - DC block - top block - top-right block. This example can be understood as a case where a block adjacent to a longer block has a leading order.

[0624] As one example (6), adaptive priority can be supported according to the relationship between the current block and the neighboring blocks.

[0625] Referring to FIG. 23 a, an example of generating a prediction block according to a prediction mode of a neighboring block (a sub-block of a left block in this example) is shown.

[0626] When the prediction mode of the left block (in this example, the top sub-block of th...

Claims

1. An intra-frame prediction method, characterized in that, Applied to decoding devices, including: Export the intra-prediction mode for the current block; Determine the sample line from a plurality of sample lines for intra-frame prediction of the current block; Based on the intra-prediction mode and the determined sample lines, perform intra-prediction for the current block; and The prediction samples of the current block are corrected according to the intra-frame prediction mode; The method further includes: Based on a first flag indicating whether filtering is to be performed on the first reference sample used for intra-frame prediction, filtering is selectively performed on the first reference sample of the determined sample line; The first flag is derived from the decoding device based on the encoding parameters of the current block, the encoding parameters including at least: whether intra-frame prediction is applied on a sub-block basis.

2. The intra-frame prediction method according to claim 1, characterized in that, The correction also includes: Based on the position of the predicted sample of the current block, at least one of a second reference sample or a weighted value is determined for the correction.

3. The intra-frame prediction method according to claim 2, characterized in that, The correction is performed selectively by considering at least one of the following: the position of the sample line of the current block, the intra-prediction mode of the current block, or whether to perform intra-prediction on a sub-block basis for the current block.

4. The intra-frame prediction method according to claim 1, characterized in that, The sample line is a reference sample line, and the sample line is determined based on the size and shape of the current block.

5. The intra-frame prediction method according to any one of claims 1 to 4, characterized in that, The intra-frame prediction is performed on a sub-block basis within the current block. The sub-block is determined based on at least one of a second flag indicating whether a segmentation is to be performed, segmentation direction information, or segmentation quantity information.

6. An intra-frame prediction method, characterized in that, Applied to encoding devices, including: Export the intra-prediction mode for the current block; Determine the sample line from a plurality of sample lines for intra-frame prediction of the current block; Based on the intra-prediction mode and the determined sample lines, perform intra-prediction for the current block; and The prediction samples of the current block are corrected according to the intra-frame prediction mode; The method further includes: Based on a first flag indicating whether filtering is to be performed on the first reference sample used for intra-frame prediction, filtering is selectively performed on the first reference sample of the determined sample line; The first flag is encoded and included in the bitstream according to the encoding parameters of the current block, wherein the encoding parameters include at least whether to apply intra-frame prediction on a sub-block basis.

7. The intra-frame prediction method according to claim 6, characterized in that, The correction also includes: Based on the position of the predicted sample of the current block, at least one of a second reference sample or a weighted value is determined for the correction.

8. The intra-frame prediction method according to claim 7, characterized in that, The correction is performed selectively by considering at least one of the following: the position of the sample line of the current block, the intra-prediction mode of the current block, or whether to perform intra-prediction on a sub-block basis for the current block.

9. The intra-frame prediction method according to claim 6, characterized in that, The sample line is a reference sample line, and the sample line is determined based on the size and shape of the current block.

10. The intra-frame prediction method according to any one of claims 6 to 9, characterized in that, The intra-frame prediction is performed on a sub-block basis within the current block. The sub-block is determined based on at least one of a second flag indicating whether a segmentation is to be performed, segmentation direction information, or segmentation quantity information.

11. A decoding device, characterized in that, include: The prediction mode decoding unit is configured to export the intra-prediction mode of the current block; The reference sample configuration unit is configured to determine a sample line from a plurality of sample lines for intra-frame prediction of the current block; The prediction block generation unit is configured to perform intra-prediction of the current block based on the intra-prediction mode and the determined sample line; and to correct the prediction samples of the current block according to the intra-prediction mode. The prediction block generation unit is further configured to selectively perform filtering on the first reference sample of the determined sample line based on a first flag indicating whether filtering is performed on the first reference sample used for intra-frame prediction; the first flag is derived from the decoding device based on the coding parameters of the current block, the coding parameters including at least whether intra-frame prediction is applied on a sub-block basis.

12. An encoding device, characterized in that, include: The prediction mode determination unit is configured to derive the intra-prediction mode for the current block; The reference sample configuration unit is configured to determine a sample line from a plurality of sample lines for intra-frame prediction of the current block; The prediction block generation unit is configured to perform intra-prediction of the current block based on the intra-prediction mode and the determined sample line; and to correct the prediction samples of the current block according to the intra-prediction mode. The prediction block generation unit is further configured to selectively perform filtering on the first reference sample of the determined sample line based on a first flag indicating whether filtering is performed on the first reference sample used for intra-frame prediction; and to encode the first flag according to the encoding parameters of the current block and include it in the bit stream, wherein the encoding parameters include at least whether to apply intra-frame prediction on a sub-block basis.

13. A computing device, characterized in that, include: Memory is used to store programs that can be executed on a processor; A processor, configured to, when executing the program, implement the intra-prediction method as described in any one of claims 1 to 5, or the intra-prediction method as described in any one of claims 6 to 10.

14. A computer storage medium, characterized in that, The computer storage medium stores a program that, when executed, implements the intra-frame prediction method as described in any one of claims 1 to 5, or the intra-frame prediction method as described in any one of claims 6 to 10.

15. A computer storage medium storing a program and a bit stream thereon, characterized in that, When the program is executed by a processor, it implements the method as described in any one of claims 6 to 10 to generate the bit stream.

Citation Information

Patent Citations

  • System and method for managing heat duty for a heat recovery system

    KR1020180072558A

  • Display Device

    KR1020180076783A

  • Intra-picture prediction using non-adjacent reference lines of sample values

    WO2017190288A1

  • Image encoding / decoding method and device, and recording medium in which bitstream is stored

    WO2018016823A1