Video decoding method, video encoding method and device

The method addresses inefficiencies in high-resolution video encoding and decoding by employing intra prediction and weighted filtering techniques, resulting in improved image quality and compression efficiency.

JP7762773B2Active Publication Date: 2025-10-30SAMSUNG ELECTRONICS CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
JP2024124997
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Priority Date
2017-09-28
Filing Date
2024-07-31
Publication Date
2025-10-30
Estimated Expiration
2038-09-27

AI Technical Summary

Technical Problem

Existing video encoding and decoding technologies face challenges in efficiently compressing and reconstructing high-resolution or high-quality video content, particularly in determining optimal data units and handling intra-prediction modes for improved image quality.

Method used

A method and apparatus that utilize intra prediction techniques, including generating intra-predicted values based on sample positions and modes, determining filtered reference samples with weighted values, and reconstructing blocks using transform coefficients to enhance video encoding and decoding efficiency.

Benefits of technology

Improves the encoding and decoding of high-resolution video by optimizing data unit determination and intra-prediction, leading to enhanced image quality and compression efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007762773000022
    Figure 0007762773000022
  • Figure 0007762773000023
    Figure 0007762773000023
  • Figure 0007762773000024
    Figure 0007762773000024
Patent Text Reader

Abstract

To provide a video decoding method and apparatus for encoding or decoding a video by using an encoding unit of various forms included in the video.SOLUTION: A method includes the steps of: determining a first reference sample corresponding to a current sample based on a position of the current sample and an intra prediction mode of a current block; determining, in the case where the intra prediction mode of the current block is a mode indicating an upward prediction direction, a second reference sample and a second weight value from among a plurality of neighboring samples located on a left side of the current block to obtain a modified intra-prediction sample of the current sample; determining, in the case where the intra prediction mode of the current block is a mode indicating a left side prediction direction, a third reference sample and a third weight value from among a plurality of neighboring samples located above the current block to obtain the modified intra-prediction sample; and restoring the current block by using the modified intra prediction sample of the current sample and a residual sample of the current sample.SELECTED DRAWING: Figure 1B
Need to check novelty before this filing date? Find Prior Art

Description

[Technical Field]

[0001] The method and apparatus according to the present invention can encode or decode an image using various types of coding units included in the image. The method and apparatus according to the present invention includes an intra prediction method and apparatus. [Background technology]

[0002] With the development and widespread use of hardware capable of playing and storing high-resolution or high-quality video content, there is an increasing need for codecs that can effectively encode or decode high-resolution or high-quality video content. Encoded video content can also be played back by decoding it. Recently, methods for effectively compressing such high-resolution or high-quality video content have been implemented. For example, an efficient video compression method has been implemented, which involves processing a video to be encoded in a specific manner.

[0003] Various data units may be used to compress an image, and there may be an inclusion relationship between such data units. To determine the size of the data units used for such image compression, the data units are divided in various ways, and an optimized data unit is determined according to the characteristics of the image, thereby encoding or decoding the image. Summary of the Invention [Means for solving the problem]

[0004] According to an embodiment, a video decoding method includes: acquiring information related to transform coefficients of a current block from a bitstream; generating an intra-predicted value of the current sample based on a position of the current sample within the current block and an intra-prediction mode of the current block; determining a sample value of at least one filtered reference sample to be filtered, a first weighted value related to the filtered reference sample, and a second weighted value related to the intra-predicted value of the current sample based on the position of the current sample within the current block; and generating a filtered predicted sample value of the current sample based on the filtered reference sample value, the intra predicted value of the current sample, a first weighted value associated with the filtered reference sample, and a second weighted value associated with the intra predicted value of the current sample; generating a predicted block of the current block including the filtered predicted sample value of the current sample; obtaining a residual block of the current block based on information associated with the obtained transform coefficients of the current block; and reconstructing the current block based on the predicted block of the current block and the residual block of the current block.

[0005] The step of generating an intra-predicted value of the current sample based on the position of the current sample within the current block and the intra-prediction mode of the current block may include the steps of determining an original reference sample corresponding to the current sample based on the position of the current sample and the intra-prediction mode of the current block, and generating an intra-predicted value of the current sample based on the sample value of the original reference sample.

[0006] The first weight value for the filtering reference sample is also determined based on the distance between the filtering reference sample and the current sample.

[0007] The first weight associated with the filtering reference sample decreases as the distance between the filtering reference sample and the current sample increases.

[0008] The filtered reference sample may include at least one of an original reference sample positioned horizontally of the current sample and an original reference sample positioned vertically of the current sample.

[0009] When the intra prediction mode of the current block is an angular mode, the filtering reference sample may include at least one of the neighboring samples on the left and above of the current block located on a line passing through the current sample, and the line may be oriented in the prediction direction indicated by the angular mode and in the opposite direction.

[0010] The step of determining a sample value of at least one filtered reference sample to be filtered, a first weighted value for the filtered reference sample, and a second weighted value for an intra-predicted value of the current sample based on a position of the current sample within the current block, and generating a filtered predicted sample value of the current sample based on the determined sample value of the filtered reference sample to be filtered, the intra-predicted value of the current sample, the first weighted value for the filtered reference sample, and the second weighted value for the intra-predicted value of the current sample, includes the steps of determining at least one second intra-prediction mode; and determining, based on a position of the current sample within the current block, sample values ​​of at least one filtered reference sample to be filtered, a first weighted value associated with the filtered reference sample, and a second weighted value associated with the intra predicted value of the current sample, using the at least one second intra prediction mode determined by the at least one second intra prediction mode, and generating a filtered predicted sample value of the current sample based on the determined sample values ​​of the filtered reference sample to be filtered, the intra predicted value of the current sample, the first weighted value associated with the filtered reference sample, and the second weighted value associated with the intra predicted value of the current sample.

[0011] The at least one second intra prediction mode may be determined on a picture-by-picture basis or may be determined on a block-by-block basis.

[0012] The at least one second intra prediction mode may also be determined as at least one of the intra prediction mode, an intra prediction mode indicating a prediction direction opposite to that indicated by the intra prediction mode, a horizontal mode, and a vertical mode.

[0013] The first weighted value and the second weighted value are also normalized values.

[0014] determining a sample value of at least one filtered reference sample to be filtered, a first weighted value for the filtered reference sample, and a second weighted value for an intra predicted value of the current sample based on a position of the current sample within the current block; and generating a filtered predicted sample value of the current sample based on the determined sample value of the filtered reference sample to be filtered, the intra predicted value of the current sample, the first weighted value for the filtered reference sample, and the second weighted value for the intra predicted value of the current sample, when the intra prediction mode is a predetermined intra prediction mode. In the case of the intra prediction mode, the method may include determining a sample value of at least one filtered reference sample to be filtered, a first weighted value for the filtered reference sample, and a second weighted value for an intra prediction value of the current sample, based on a position of the current sample within the current block, and generating a filtered prediction sample value of the current sample based on the determined sample value of the filtered reference sample to be filtered, the intra prediction value of the current sample, the first weighted value for the filtered reference sample, and the second weighted value for the intra prediction value of the current sample.

[0015] According to an embodiment, an image encoding method includes: generating an intra-predicted value of a current sample based on a position of the current sample within a current block and an intra-prediction mode of the current block; determining, based on the position of the current sample within the current block, sample values ​​of at least one filtered reference sample to be filtered, a first weighted value associated with the filtered reference sample, and a second weighted value associated with the intra-predicted value of the current sample; generating a filtered predicted sample value of the current sample based on the determined sample values ​​of the filtered reference sample to be filtered, the intra-predicted value of the current sample, the first weighted value associated with the filtered reference sample, and the second weighted value associated with the intra-predicted value of the current sample; generating a predicted block of the current block including the filtered predicted sample value of the current sample; and encoding information related to transform coefficients of the current block based on the predicted block of the current block.

[0016] According to an embodiment, a video decoding apparatus includes: acquiring information related to transform coefficients of a current block; acquiring the information related to transform coefficients of the current block; generating an intra-predicted value of the current sample based on a position of the current sample within the current block and an intra-prediction mode of the current block; determining a sample value of at least one filtering reference sample to be filtered, a first weighted value related to the filtering reference sample, and a second weighted value related to the intra-predicted value of the current sample based on the position of the current sample within the current block; and The present invention also includes a processor that generates a filtered predicted sample value of the current sample based on a sample value of a sample, an intra predicted value of the current sample, a first weighted value associated with the filtered reference sample, and a second weighted value associated with the intra predicted value of the current sample, generates a predicted block of the current block including the filtered predicted sample value of the current sample, obtains a residual block of the current block based on information associated with the obtained transform coefficients of the current block, and reconstructs the current block based on the predicted block of the current block and the residual block of the current block.

[0017] A computer program relating to a video decoding method according to an embodiment of the present disclosure may also be recorded on a computer-readable recording medium. [Brief explanation of the drawings]

[0018] [Figure 1A] 1 is a block diagram of a video decoding device according to various embodiments. [Figure 1B] 1 is a flowchart of a video decoding method according to various embodiments. [Figure 1C] 1 is a flowchart of a video decoding method according to various embodiments. [Figure 1D] 3A and 3B are block diagrams of a video decoder according to various embodiments. [Figure 2A] 1 is a block diagram of a video encoding device according to various embodiments. [Figure 2B]1 is a flowchart of a video encoding method according to various embodiments. [Figure 2C] 1 is a flowchart of a video decoding method according to various embodiments. [Figure 2D] 3A and 3B are block diagrams of a video decoder according to various embodiments. [Figure 3] 10 is a diagram illustrating a process in which a video decoding apparatus divides a current coding unit and determines at least one coding unit, according to an embodiment. [Figure 4] 10 is a diagram illustrating a process in which a video decoding apparatus divides a non-square coding unit and determines at least one coding unit, according to an embodiment. [Figure 5] 10 is a diagram illustrating a process in which a video decoding apparatus divides a coding unit based on at least one of block shape information and partition shape mode information, according to an embodiment. [Figure 6] 10 is a diagram illustrating a method for a video decoding apparatus to determine a predetermined coding unit from an odd number of coding units, according to an embodiment; [Figure 7] 10 is a diagram illustrating an order in which a plurality of coding units are processed when a video decoding apparatus divides a current coding unit and determines the plurality of coding units, according to an embodiment. [Figure 8] 10 is a diagram illustrating a process in which a video decoder determines to divide a current coding unit into an odd number of coding units when the current coding unit cannot be processed in a predetermined order, according to an embodiment. [Figure 9] 10 is a diagram illustrating a process in which a video decoding apparatus divides a first coding unit and determines at least one coding unit, according to an embodiment. [Figure 10] 10 is a diagram illustrating that, according to one embodiment, when a video decoding device determines that a non-square second coding unit obtained by dividing a first coding unit satisfies a predetermined condition, the form into which the second coding unit may be divided is restricted. [Figure 11]10 is a diagram illustrating a process in which a video decoding device divides a square-shaped coding unit when division mode information does not indicate division into four square-shaped coding units, according to one embodiment. [Figure 12] 10 is a diagram illustrating that a processing order among a plurality of coding units may vary depending on a division process of the coding units, according to an embodiment. [Figure 13] 10 is a diagram illustrating a process of determining the depth of a coding unit according to one embodiment when a coding unit is recursively divided to determine multiple coding units, as the shape and size of the coding unit change. [Figure 14] 10 is a diagram illustrating a depth determined depending on the type and size of a coding unit and an index (PID: part index) for a coding unit division, according to an embodiment. [Figure 15] 1 is a diagram illustrating a plurality of coding units being determined based on a plurality of predetermined data units included in a picture, according to an embodiment; [Figure 16] 10 is a diagram illustrating processing blocks that are used as a reference for determining a determination order of reference coding units included in a picture, according to an embodiment; [Figure 17] 1 is a diagram illustrating an intra prediction mode according to an embodiment. [Figure 18] 10 is a diagram illustrating a method in which a video decoding apparatus generates reconstructed samples using original reference samples according to an embodiment of the present disclosure. [Figure 19A] 10 is a diagram illustrating a method in which a video decoding apparatus generates reconstructed samples using original reference samples according to a prediction direction of an intra prediction mode of a current block, according to an embodiment of the present disclosure. [Figure 19B] 10 is a diagram illustrating a method in which a video decoding apparatus generates reconstructed samples using original reference samples according to a prediction direction of an intra prediction mode of a current block, according to an embodiment of the present disclosure. [Figure 20]10 is a diagram illustrating a method in which a video decoding apparatus generates reconstructed samples using original reference samples according to an embodiment of the present disclosure. [Figure 21] 10 is a diagram illustrating a process in which a video decoding apparatus performs intra prediction on a current block using original reference samples and reconstructed samples, according to an embodiment of the present disclosure. [Figure 22] 10 is a diagram illustrating a process in which a video decoding apparatus performs weighted prediction using original reference samples and reconstructed reference samples of a left adjacent line and an upper adjacent line. [Figure 23] 10 is a diagram illustrating a process in which a video decoding device performs weighted prediction using a predicted value generated by performing intra prediction using original reference samples and reconstructed reference samples of a left adjacent line and an upper adjacent line. [Figure 24] 10 is a diagram illustrating a process in which a video decoding apparatus performs position-based intra prediction of a current sample when an intra prediction mode of a current block is one of a DC mode, a planar mode, and a vertical mode. [Figure 25] 10 is a diagram illustrating a process in which a video decoding apparatus performs position-based intra prediction of a current sample when an intra prediction mode of a current block is a diagonal mode in a bottom-left direction. [Figure 26] 10 is a diagram illustrating a process in which a video decoding apparatus performs position-based intra prediction on a current sample when an intra prediction mode of a current block is a diagonal mode in the upper right direction. [Figure 27] 10 is a diagram illustrating a process in which a video decoding apparatus performs position-based intra prediction of a current sample when an intra prediction mode of a current block is an angular mode adjacent to a diagonal mode in a lower-left direction. [Figure 28]10 is a diagram illustrating a process in which a video decoding apparatus performs position-based intra prediction of a current sample when an intra prediction mode of a current block is an angular mode adjacent to a diagonal mode in the upper right direction. [Figure 29] This is a diagram to explain that, according to one embodiment of the present disclosure, the encoding / decoding order between coding units is determined to be forward or backward based on the encoding order flag, and the reference line on the right or upper side can be used for intra prediction depending on the determined encoding / decoding order. DETAILED DESCRIPTION OF THE INVENTION

[0019] A video decoding method according to various embodiments includes the steps of: acquiring information related to transform coefficients of a current block from a bitstream; generating an intra-predicted value of the current sample based on a position of the current sample within the current block and an intra-prediction mode of the current block; determining a sample value of at least one filtered reference sample to be filtered, a first weighted value related to the filtered reference sample, and a second weighted value related to the intra-predicted value of the current sample based on the position of the current sample within the current block; and generating a filtered predicted sample value of the current sample based on a first weighted value of the filtered reference sample, an intra predicted value of the current sample, a first weighted value related to the filtered reference sample, and a second weighted value related to the intra predicted value of the current sample; generating a predicted block of the current block including the filtered predicted sample value of the current sample; obtaining a residual block of the current block based on information related to the obtained transform coefficients of the current block; and reconstructing the current block based on the predicted block of the current block and the residual block of the current block.

[0020] A video encoding method according to various embodiments includes: generating an intra-predicted value of a current sample based on a position of the current sample within a current block and an intra-prediction mode of the current block; determining, based on the position of the current sample within the current block, sample values ​​of at least one filtered reference sample to be filtered, a first weighted value associated with the filtered reference sample, and a second weighted value associated with the intra-predicted value of the current sample; generating a filtered predicted sample value of the current sample based on the determined sample values ​​of the filtered reference sample to be filtered, the intra-predicted value of the current sample, the first weighted value associated with the filtered reference sample, and the second weighted value associated with the intra-predicted value of the current sample; generating a predicted block of the current block including the filtered predicted sample value of the current sample; and encoding information related to transform coefficients of the current block based on the predicted block of the current block.

[0021] A video decoding apparatus according to various embodiments includes a processor that acquires information related to transform coefficients of a current block from a bitstream, generates an intra-predicted value of the current sample based on a position of the current sample within the current block and an intra-prediction mode of the current block, determines sample values ​​of at least one filtered reference sample to be filtered, a first weighted value related to the filtered reference sample, and a second weighted value related to the intra-predicted value of the current sample based on the position of the current sample within the current block, generates filtered predicted sample values ​​of the current sample based on the determined sample values ​​of the filtered reference sample to be filtered, the intra-predicted value of the current sample, the first weighted value related to the filtered reference sample, and the second weighted value related to the intra-predicted value of the current sample, generates a predicted block of the current block including the filtered predicted sample values ​​of the current sample, acquires a residual block of the current block based on the acquired information related to transform coefficients of the current block, and reconstructs the current block based on the predicted block of the current block and the residual block of the current block.

[0022] The present invention may also include a computer-readable recording medium having a program recorded thereon for implementing the methods according to various embodiments.

[0023] The advantages, features, and methods for achieving the disclosed embodiments will become apparent from the following detailed description of the embodiments in conjunction with the accompanying drawings. However, the present disclosure is not limited to the embodiments disclosed below, and may be embodied in various different forms. However, the present embodiments are provided solely for the purpose of making the disclosure complete and fully conveying the scope of the invention to those skilled in the art.

[0024] The terms used in this specification will be briefly explained, and the disclosed embodiments will be specifically described.

[0025] The terms used in this specification are currently commonly used and general terms that have been selected as much as possible while taking into consideration the function of the present disclosure. However, these terms may differ depending on the intentions of engineers in the relevant field, precedents, or the emergence of new technology. In addition, in certain cases, the applicant may arbitrarily select terms, and in such cases, the meanings thereof will be described in detail in the description of the invention. Therefore, the terms used in this disclosure must be defined based on the meanings of the terms and the overall content of the present disclosure, rather than simply by the names of the terms.

[0026] In this specification, the singular expression includes the plural expression unless the context clearly dictates otherwise.

[0027] Throughout the specification, when a part "comprises" a certain element, it does not mean that it excludes other elements, but that it may further include other elements, unless otherwise specified to the contrary.

[0028] Furthermore, the term "module" as used herein refers to a software component or a hardware component, and a "module" performs a certain function. However, the term "module" is not limited to software or hardware. A "module" may reside on an addressable storage medium or may execute one or more processors. Thus, by way of example, "module" includes components such as software components, object-oriented software components, class components, and task components, as well as processes, functions, attributes, procedures, subroutines, program code segments, drivers, firmware, microcode, circuits, data, databases, data structures, tables, arrays, and variables. The functionality provided within the components and "modules" may be combined into fewer components and "modules," or may be further separated into additional components and "modules."

[0029] According to one embodiment of the present disclosure, a "unit" may also be embodied by a processor and memory. The term "processor" should be broadly interpreted to include a general-purpose processor, a central processing unit (CPU), a microprocessor, a digital signal processor (DSP), a controller, a microcontroller, a state machine, etc. In some environments, a "processor" may also refer to an application specific integrated circuit (ASIC), a programmable logic device (PLD), a field programmable gate array (FPGA), etc. The term "processor" may also refer to a combination of processing devices, such as, for example, a combination of a DSP and a microprocessor, a combination of multiple microprocessors, a combination of one or more microprocessors in conjunction with a DSP core, or any other such configuration.

[0030] The term "memory" should be interpreted broadly to include any electronic component capable of storing electronic information. The term "memory" can refer to various types of processor-readable media, such as random access memory (RAM), read-only memory (ROM), nonvolatile random access memory (NVRAM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), flash memory, magnetic or optical data storage devices, and registers. Memory is in electronic communication with a processor if the processor can read information from and / or record information to the memory. Memory integrated with the processor is in electronic communication with the processor.

[0031] Hereinafter, "image" can refer to both a static image, such as a stopped video, and a moving image, i.e., a video itself.

[0032] Hereinafter, a "sample" refers to data assigned to a sampling position in an image and to data to be processed. For example, in a spatial domain image, a pixel value and a transform coefficient in the transform domain are also samples. A unit including at least one such sample can be defined as a block.

[0033] Hereinafter, the present disclosure will be described in detail with reference to the accompanying drawings so that those skilled in the art can easily carry out the present disclosure. In order to clearly explain the present disclosure, parts not relevant to the description will be omitted in the drawings.

[0034] Hereinafter, a video encoding apparatus, a video decoding apparatus, a video encoding method, and a video decoding method according to an embodiment will be described in detail with reference to Figures 1 to 29. A method for determining a video data unit according to an embodiment will be described with reference to Figures 3 to 16. An encoding method or a decoding method, and an apparatus therefor, for determining filtered reference samples and filter weights to be applied with a filter and performing adaptive intra prediction based on the filtered reference samples and filter weights according to an embodiment will be described with reference to Figures 1, 2, and 17 to 29.

[0035] Hereinafter, with reference to FIGS. 1 and 2, an encoding / decoding method and apparatus for adaptively performing intra prediction based on various types of coding units according to an embodiment of the present disclosure will be described in detail.

[0036] FIG. 1A illustrates a block diagram of a video decoder according to various embodiments.

[0037] A video decoding apparatus 100 according to various embodiments may include an acquisition unit 105, an intra prediction unit 110, and a video decoding unit 115.

[0038] The acquisition unit 105, the intra prediction unit 110, and the video decoding unit 115 may each include at least one processor. The acquisition unit 105, the intra prediction unit 110, and the video decoding unit 115 may also include a memory for storing instructions executed by the at least one processor. The video decoding unit 115 may be implemented as hardware separate from the acquisition unit 105 and the intra prediction unit 110, or may include the acquisition unit 105 and the intra prediction unit 110.

[0039] The acquiring unit 105 may acquire information related to transform coefficients of the current block from the bitstream. The acquiring unit 105 may acquire information related to a prediction mode of the current block and information related to an intra-prediction mode of the current block from the bitstream.

[0040] The information related to the prediction mode of the current block obtained by the obtaining unit 105 may include information indicating an intra mode or an inter prediction mode. The information related to the intra prediction mode of the current block may also be information related to an intra prediction mode applied to the current block among a plurality of intra prediction modes. For example, the intra prediction mode may be one of a DC mode, a planar mode, and at least one angular mode having a prediction direction. The angular mode may include a horizontal mode, a vertical mode, and a diagonal mode, and may include a mode having a predetermined direction excluding the horizontal direction, the vertical direction, and the diagonal direction. For example, the number of angular modes may be 65 or 33.

[0041] The intra prediction unit 110 is also activated when the prediction mode of the current block is an intra prediction mode.

[0042] The intra prediction unit 110 may determine an original reference sample-related value based on the position of the current sample within the current block and the intra prediction mode of the current block. That is, the intra prediction unit 110 may determine at least one original reference sample among the reference samples based on the position of the current sample within the current block and the intra prediction mode of the current block, and may determine an original reference sample-related value based on the determined at least one original reference sample. The original reference sample is a sample of a neighboring block of the current block, and may include a sample of a left-side neighboring block or an upper-side neighboring block of the current block. For example, the original reference sample may include a sample of a predetermined vertical line adjacent to the left of the current block or a sample of a predetermined horizontal line adjacent to the top of the current block. However, the original reference sample is not limited to a sample of a left-side neighboring block or an upper-side neighboring block of the current block, and may also include a sample of an upper-side neighboring block or a right-side neighboring block of the current block.

[0043] The intra prediction unit 110 may generate an intra prediction value for a current sample based on the position of the current sample within the current block and the intra prediction mode of the current block. That is, the intra prediction unit 110 may determine an original reference sample corresponding to the current sample based on the position of the current sample and the intra prediction mode of the current block. The intra prediction unit 110 may generate an intra prediction value for the current sample based on sample values ​​of the original reference sample. The intra prediction unit 110 may determine at least one filtering reference sample to be applied with a filter and filter weights based on at least one of the intra prediction mode of the current block, the position of the current sample within the current block, and the positions of the reference samples of the current block, and may determine filtering reference sample-related values ​​based on the filtering reference sample and the filter weights.

[0044] For example, if the intra prediction mode of the current block is one of planar, DC, horizontal, and vertical modes, the intra prediction unit 110 may determine at least one of a sample adjacent to the upper left corner of the current block, a neighboring sample of the current block located above the current block, and a neighboring sample of the current block located to the left of the current block as a filtering reference sample.

[0045] When the intra prediction mode of the current block is an angular mode including a diagonal mode, the intra prediction unit 110 may determine, as a filtering reference sample, at least one of neighboring samples on the left and upper sides of the current block located on a line passing through the current sample in the current block and a sample neighboring the upper left corner of the current block, where the line may be in the prediction direction indicated by the angular mode or in the opposite direction.

[0046] The intra prediction unit 110 may determine the number of taps of the filter to be applied to the filtered reference sample based on at least one of the intra prediction mode of the current block and the size of the current block.

[0047] In addition, the intra prediction unit 110 is not limited to determining the filter weights to be applied to the filtered reference sample based on at least one of the intra prediction mode of the current block, the position of the current sample within the current block, and the position of the reference sample, but may determine the filter weights to be applied to the filtered reference sample based on the size of the current block.

[0048] The intra prediction unit 110 may determine some of the samples in the reference line adjacent to the current block as filtering reference samples based on the horizontal and vertical components of the prediction direction specified by the intra prediction mode.

[0049] When the intra prediction mode of the current block is a predetermined intra prediction mode, the intra prediction unit 110 can determine at least one filtering reference sample to be filtered and a filtering reference sample related value based on the filter weight value based on at least one of the intra prediction mode of the current block, the position of the current sample within the current block, and the position of the reference sample of the current block.

[0050] The intra prediction unit 110 may determine at least one intra prediction mode, and may determine a filtering reference sample and a filter weight value to be applied to a filter based on at least one of a position of a current sample in a current block and a position of a reference sample of the current block using the determined at least one intra prediction mode. The intra prediction unit 110 may determine a filtering reference sample-related value based on the filtering reference sample and the filter weight value.

[0051] In this case, the at least one intra prediction mode may be determined for each picture or for each block. The at least one intra prediction mode may be an intra prediction mode determined based on the intra prediction mode of the current block or may be a predetermined intra prediction mode. The predetermined intra prediction mode may be at least one of a horizontal mode and a vertical mode.

[0052] The intra prediction unit 110 may obtain a prediction block of the current block including a prediction sample of the current block based on at least one of the original reference sample-related value and the filtered reference sample-related value. For example, the intra prediction unit 110 may determine whether to perform intra prediction for the current sample using both the original reference sample-related value and the filtered reference sample-related value, or may determine one of the original reference sample-related value and the filtered reference sample-related value and determine whether to perform intra prediction for the current sample based on the determined value. The intra prediction unit 110 may obtain a prediction block of the current block including a prediction sample of the current sample based on the determination.

[0053] The intra prediction unit 110 may determine a sample value of at least one filtered reference sample to be filtered, a first weighting value for the filtered reference sample, and a second weighting value for the intra-predicted value of the current sample based on the position of the current sample within the current block. The first weighting value for the filtered reference sample may also be determined based on the distance between the filtered reference sample and the current sample. For example, the first weighting value may also be determined based on the distance between the filtered reference sample and the current sample relative to the size of the current block. In this case, the size of the current block refers to the height or width of the current block. The first weighting value may be smaller as the distance between the filtered reference sample and the current sample increases. The second weighting value may also be determined in a manner similar to the first weighting value. The first and second weighting values ​​may also be normalized values.

[0054] In this case, the filtering reference sample may include at least one of an original reference sample located horizontally of the current sample and an original reference sample located vertically of the current sample. Meanwhile, if the intra prediction mode of the current block is an angular mode, the filtering reference sample may include at least one of neighboring samples on the left and upper sides of the current block located on a line passing through the current sample. In this case, the line may be oriented in the prediction direction indicated by the angular mode or in the opposite direction.

[0055] The intra prediction unit 110 may generate a filtered predicted sample value of the current sample based on a sample value of a filtered reference sample to be filtered, an intra predicted value of the current sample, a first weighted value related to the filtered reference sample, and a second weighted value related to the intra predicted value of the current sample. For example, only when the intra prediction mode of the current block is a predetermined intra prediction mode, the intra prediction unit 110 may generate a filtered predicted sample value of the current sample based on a sample value of a filtered reference sample to be filtered, an intra predicted value of the current sample, a first weighted value related to the filtered reference sample, and a second weighted value related to the intra predicted value of the current sample.

[0056] For example, the intra prediction unit 110 may determine at least one second intra prediction mode, determine a sample value of at least one filtered reference sample to be filtered, a first weighted value for the filtered reference sample, and a second weighted value for the intra prediction value of the current sample based on the position of the current sample within the current block using the at least one second intra prediction mode, and generate a filtered prediction sample value of the current sample based on the determined sample value of the filtered reference sample to be filtered, the intra prediction value of the current sample, the first weighted value for the filtered reference sample, and the second weighted value for the intra prediction value of the current sample. In this case, the at least one second intra prediction mode may be determined for each picture or each block. The at least one second intra prediction mode may also be determined as at least one of the intra prediction mode of the current block, an intra prediction mode indicating a prediction direction opposite to that indicated by the intra prediction mode of the current block, a horizontal mode, and a vertical mode.

[0057] The intra prediction unit 110 may generate a prediction block of the current block including filtered prediction sample values ​​of the current block.

[0058] The intra prediction unit 110 can perform filtering based on a first weighting value related to the original reference sample related value, a second weighting value related to the filtered reference sample related value, the original reference sample related value, and the filtered reference sample related value to obtain a predicted sample of the current block.

[0059] The intra prediction unit 110 may determine that the second weight value associated with the filtering reference sample-related value decreases as the distance from the filtering reference sample to the current sample increases.

[0060] The video decoding unit 115 may obtain a residual block of the current block based on information related to the transform coefficients of the current block. That is, the video decoding unit 115 may perform inverse quantization and inverse transform on the bitstream based on information related to the transform coefficients of the current block to obtain residual samples related to the residual block of the current block.

[0061] The video decoding unit 115 may reconstruct the current block based on the predicted block of the current block and the residual block of the current block. The video decoding unit 115 may generate reconstructed samples within the current block using sample values ​​of predicted samples within the predicted block of the current block and sample values ​​of residual samples within the residual block of the current block, and may generate a reconstructed block of the current block based on the reconstructed samples.

[0062] Meanwhile, the video decoding apparatus 100 may acquire flag information indicating whether to perform adaptive intra prediction based on a filtering reference sample and a filter weight from a bitstream, and may determine whether to perform adaptive intra prediction based on the filtering reference sample and the filter weight based on the flag information. In this case, the flag information may be acquired for each block, and in particular, for each maximum coding unit.

[0063] Furthermore, the video decoding apparatus 100 may acquire flag information commonly applied to the luminance component and the chrominance component, or may acquire flag information individually applied to the luminance component or the chrominance component.

[0064] Alternatively, the video decoding apparatus 100 may determine whether to perform adaptive intra prediction based on a filtered reference sample and a filter weight without acquiring flag information from a bitstream. For example, if the prediction mode of the current block is a predetermined intra prediction mode, the video decoding apparatus 100 may determine to perform adaptive intra prediction based on a filtered reference sample and a filter weight.

[0065] Alternatively, the video decoding apparatus 100 may determine whether to perform adaptive intra prediction based on a filtered reference sample and a filter weight using information on neighboring blocks without acquiring flag information from a bitstream. For example, the video decoding apparatus 100 may determine whether to perform adaptive intra prediction on a current block based on a filtered reference sample and a filter weight based on flag information on neighboring blocks indicating whether to perform adaptive intra prediction on a neighboring block of the current block based on a filtered reference sample and a filter weight.

[0066] Alternatively, the video decoding apparatus 100 may determine whether to perform adaptive intra prediction based on the size of the current block, the filtered reference sample, and the filter weights. For example, when the size of the current block is a predetermined first block size, the video decoding apparatus 100 may perform adaptive intra prediction based on the filtered reference sample and the filter weights, and when the size of the current block is a predetermined second block size, the video decoding apparatus 100 may perform conventional intra prediction without performing adaptive intra prediction based on the filtered reference sample and the filter weights.

[0067] The video decoding device 100 may perform intra prediction by combining intra prediction encoding / decoding tools similar to adaptive intra prediction encoding / decoding tools based on filtered reference samples and filter weights. Alternatively, the video decoding device 100 may prioritize multiple intra prediction encoding / decoding tools and perform intra prediction according to the priorities among the encoding / decoding tools. That is, when an encoding / decoding tool with a high priority is used, an encoding / decoding tool with a low priority is not used, and when an encoding / decoding tool with a high priority is not used, an encoding / decoding tool with a low priority is used.

[0068] FIG. 1B illustrates a flowchart of a video decoding method according to various embodiments.

[0069] In operation S105, the video decoding apparatus 100 may obtain information related to the transform coefficients of the current block.

[0070] In step S110, the video decoding device 100 determines at least one filtering reference sample to be filtered and a filter weight based on at least one of the intra prediction mode of the current block, the position of the current sample within the current block, and the position of the reference sample of the current block, and may determine a filtering reference sample related value based on the filtering reference sample to be filtered and the filter weight.

[0071] In operation S115, the video decoding apparatus 100 may determine an original reference sample-related value based on the position of the current sample within the current block and the intra-prediction mode of the current block.

[0072] In operation S120, the video decoding apparatus 100 may obtain a prediction block of the current block including a prediction sample of the current sample based on at least one of the original reference sample-related value and the filtered reference sample-related value.

[0073] In operation S125, the video decoding apparatus 100 may obtain a residual block of the current block based on information related to the transform coefficients of the current block.

[0074] In operation S130, the video decoding apparatus 100 may reconstruct the current block based on the prediction block of the current block and the residual block of the current block.

[0075] FIG. 1C illustrates a flowchart of a video decoding method according to various embodiments.

[0076] In operation S155, the video decoding apparatus 100 may obtain information related to the transform coefficients of the current block.

[0077] In operation S160, the video decoding apparatus 100 may generate an intra-predicted value for the current sample based on the position of the current sample within the current block and the intra-prediction mode of the current block.

[0078] In step S165, the video decoding device 100 determines a sample value of at least one filtered reference sample to be filtered, a first weighting value for the filtered reference sample, and a second weighting value for the intra-prediction value of the current sample based on the position of the current sample within the current block, and can generate a filtered prediction sample value of the current sample based on the sample value of the filtered reference sample to be filtered, the intra-prediction value of the current sample, the first weighting value for the filtered reference sample, and the second weighting value for the intra-prediction value of the current sample.

[0079] In operation S170, the video decoding apparatus 100 may generate a predicted block of the current block including a filtered predicted sample value of the current sample.

[0080] In operation S175, the video decoding apparatus 100 may obtain a residual block of the current block based on information related to the transform coefficients of the current block.

[0081] In operation S180, the video decoding apparatus 100 may reconstruct the current block based on the prediction block of the current block and the residual block of the current block.

[0082] FIG. 1D illustrates a block diagram of a video decoder 6000 according to various embodiments.

[0083] The video decoder 6000 according to various embodiments performs the same operations as those performed by the video decoder 115 of the video decoding device 100 to encode video data.

[0084] 1D, the entropy decoding unit 6150 parses coded video data to be decoded and coding information required for decoding from a bitstream 6050. The coded video data is quantized transform coefficients, and the inverse quantization unit 6200 and the inverse transform unit 6250 restore residual data from the quantized transform coefficients.

[0085] The intra prediction unit 6400 performs intra prediction for each block. The intra prediction unit 6400 in Figure 1D corresponds to the intra prediction unit 110 in Figure 1A.

[0086] The inter prediction unit 6350 performs inter prediction for each block using a reference image obtained from the reconstructed picture buffer 6300. Spatial domain data for a block of the current image is reconstructed by adding prediction data and residual data for each block generated by the intra prediction unit 6400 or the inter prediction unit 6350, and the deblocking unit 6450 and the SAO performing unit 6500 perform loop filtering on the reconstructed spatial domain data to output a filtered reconstructed image 6600. In addition, the reconstructed image stored in the reconstructed picture buffer 6300 is also output as a reference image.

[0087] In a decoder (not shown) of the video decoding device 100, the step-by-step operations of the video decoder 6000 according to various exemplary embodiments are also performed for each block in order to decode the video data.

[0088] FIG. 2A illustrates a block diagram of a video encoding device according to various embodiments.

[0089] The video encoding device 150 according to various embodiments may include an intra prediction unit 155 and a video encoding unit 160.

[0090] The intra predictor 155 and the video encoder 160 may include at least one processor. The intra predictor 155 and the video encoder 160 may also include a memory that stores instructions executed by the at least one processor. The intra predictor 155 and the video encoder 160 may be implemented as separate hardware or may include the intra predictor 155 and the video encoder 160.

[0091] The intra prediction unit 155 may determine a filtering reference sample to be filtered and a filter weight based on at least one of an intra prediction mode of a current block, a position of a current sample within the current block, and a position of a reference sample of the current block, and may determine a filtering reference sample-related value based on the filtering reference sample to be filtered and the filter weight. The intra prediction unit 155 may determine an original reference sample-related value based on the position of a current sample within the current block and the intra prediction mode of the current block.

[0092] The intra prediction unit 155 may generate a prediction block of the current block including a prediction sample of the current sample based on at least one of the original reference sample-related value and the filtered reference sample-related value.

[0093] Alternatively, the intra prediction unit 155 may generate an intra prediction value of the current sample based on the position of the current sample within the current block and the intra prediction mode of the current block. The intra prediction unit 155 may determine a sample value of at least one filtered reference sample to be filtered, a first weighted value for the filtered reference sample, and a second weighted value for the intra prediction value of the current sample based on the position of the current sample within the current block. The intra prediction unit 155 may generate a filtered prediction sample value of the current sample based on the sample value of the filtered reference sample to be filtered, the intra prediction value of the current sample, the first weighted value for the filtered reference sample, and the second weighted value for the intra prediction value of the current sample. The intra prediction unit 155 may generate a prediction block of the current block including the filtered prediction sample value of the current sample.

[0094] The video encoder 160 may encode information related to transform coefficients of the current block based on the predicted block of the current block. That is, the video encoder 160 may generate a residual block of the current block based on the original block of the current block and the predicted block of the current block, transform and quantize the residual block of the current block, and encode information related to the transform coefficients of the current block. The video encoder 160 may encode information related to a prediction mode of the current block and information related to an intra-prediction mode of the current block.

[0095] The video encoder 160 generates a bitstream including information related to the transform coefficients of the current block and outputs the bitstream.

[0096] FIG. 2B illustrates a flowchart of a video encoding method according to various embodiments.

[0097] In step S205, the video encoding device 150 determines at least one filtering reference sample to be filtered and a filter weight based on at least one of the intra prediction mode of the current block, the position of the current sample within the current block, and the position of the reference sample of the current block, and may determine a filtering reference sample related value based on the filtering reference sample to be filtered and the filter weight.

[0098] In operation S210, the video encoding apparatus 150 may determine an original reference sample-related value based on the position of the current sample within the current block and the intra-prediction mode of the current block.

[0099] In operation S215, the video encoding apparatus 150 may generate a prediction block of the current block including a prediction sample of the current sample based on at least one of the original reference sample-related value and the filtered reference sample-related value.

[0100] In operation S220, the image encoding device 150 may encode information related to transform coefficients of the current block based on the predicted block of the current block.

[0101] FIG. 2C illustrates a flowchart of a video encoding method according to various embodiments.

[0102] In operation S250, the video encoding device 150 may generate an intra-predicted value of the current sample based on the position of the current sample within the current block and the intra-prediction mode of the current block.

[0103] In step S255, the video encoding device 150 determines a sample value of at least one filtered reference sample to be filtered, a first weighted value for the filtered reference sample, and a second weighted value for the intra-predicted value of the current sample based on the position of the current sample within the current block, and may generate a filtered predicted sample value of the current sample based on the determined sample value of the filtered reference sample to be filtered, the intra-predicted value of the current sample, the first weighted value for the filtered reference sample, and the second weighted value for the intra-predicted value of the current sample.

[0104] In operation S260, the video encoding device 150 may generate a predicted block of the current block including a filtered predicted sample value of the current sample.

[0105] In operation S265, the video encoding device 150 may encode information related to transform coefficients of the current block based on the predicted block of the current block.

[0106] FIG. 2D illustrates a block diagram of a video encoder according to various embodiments.

[0107] The video encoder 7000 according to various embodiments performs the same operations as those performed by the video encoder 160 of the video encoder 150 to encode video data.

[0108] That is, the intra prediction unit 7200 performs intra prediction for each block in the current image 7050, and the inter prediction unit 7150 performs inter prediction for each block using the current image 7050 and a reference image obtained from the reconstructed picture buffer 7100.

[0109] Residual data is generated by subtracting prediction data for each block output from the intra predictor 7200 or inter predictor 7150 from data for the block to be encoded in the current image 7050. The transformer 7250 and quantizer 7300 transform and quantize the residual data and output quantized transform coefficients for each block. The intra predictor 7200 of FIG. 2D corresponds to the intra predictor 155 of FIG. 2A.

[0110] The inverse quantization unit 7450 and the inverse transform unit 7500 perform inverse quantization and inverse transform on the quantized transform coefficients to restore spatial domain residual data. The restored spatial domain residual data is added to prediction data for each block output from the intra prediction unit 7200 or the inter prediction unit 7150 to restore spatial domain data for a block of the current image 7050. The deblocking unit 7550 and the SAO performer perform in-loop filtering on the restored spatial domain data to generate a filtered restored image. The generated restored image is stored in the restored picture buffer 7100. The restored image stored in the restored picture buffer 7100 is also used as a reference image for inter prediction of other images. The entropy coding unit 7350 performs entropy coding on the quantized transform coefficients, and the entropy-coded coefficients are also output as a bitstream 7400.

[0111] Since the image encoder 7000 according to various embodiments is applied to the image encoder 150, the step-by-step operations of the image encoder 7000 according to various embodiments are also performed for each block.

[0112] The division of coding units according to one embodiment of the present disclosure will be described in detail below.

[0113] First, a picture is divided into one or more slices. A slice is also a sequence of one or more coding tree units (CTUs). A coding tree block (CTB) is a concept that contrasts with a coding unit (CTU).

[0114] A maximal coding block (CTB) means an NxN block containing NxN samples, where N is an integer. Each color component is also divided into one or more maximal coding blocks.

[0115] When a picture has three sample arrays (sample arrays for Y, Cr, and Cb components), the largest coding unit (CTU) is a unit that includes the largest coded block of luma samples, the two largest coded blocks of corresponding chroma samples, and the syntax structure used to code the luma samples and chroma samples.When a picture is a monochrome picture, the largest coding unit is a unit that includes the largest coded block of monochrome samples and the syntax structure used to code the monochrome samples.When a picture is coded into color planes separated by color components, the largest coding unit is a unit that includes the picture and the syntax structure used to code the samples of the picture.

[0116] One maximal coding block (CTB) is also divided into MxN coding blocks containing MxN samples (M and N are integers).

[0117] When a picture has sample arrays for Y, Cr, and Cb components, a coding unit (CU) includes a coding block of luma samples, two corresponding coding blocks of chroma samples, and a syntax structure used to code the luma samples and chroma samples. When a picture is a monochrome picture, a coding unit includes a coding block of monochrome samples and a syntax structure used to code the monochrome samples. When a picture is coded into color planes separated by color components, a coding unit includes the picture and a syntax structure used to code the samples of the picture.

[0118] As mentioned above, the largest coding block and the largest coding unit are distinct concepts, and the coding block and the coding unit are distinct concepts. That is, a (largest) coding unit refers to a (largest) coding block including a corresponding sample and a data structure including a corresponding syntax structure. However, since those skilled in the art can understand that a (largest) coding unit or a (largest) coding block refers to a block of a predetermined size including a predetermined number of samples, hereinafter in this specification, the largest coding block and the largest coding unit, or the coding block and the coding unit, will be referred to without distinction unless otherwise specified.

[0119] The video is also divided into maximum coding units (CTUs), the size of which is determined based on information obtained from the bitstream. The maximum coding units may have a square shape of the same size, but are not limited thereto.

[0120] For example, information regarding the maximum size of a luma coding block may be obtained from a bitstream, and the maximum size of the luma coding block indicated by the information regarding the maximum size of the luma coding block may be one of 16x16, 32x32, 64x64, 128x128, and 256x256.

[0121] For example, information regarding the maximum size of a luma coding block that can be divided into two and the luma block size difference may be obtained from the bitstream. The information regarding the luma block size difference may indicate the size difference between the largest luma coding unit and the largest luma coding block that can be divided into two. Therefore, the size of the largest luma coding unit may be determined by combining the information regarding the maximum size of a luma coding block that can be divided into two obtained from the bitstream and the information regarding the luma block size difference. The size of the largest chroma coding unit is also determined using the size of the largest luma coding unit. For example, if the Y:Cb:Cr ratio is 4:2:0 according to the color format, the size of the chroma block is half the size of the luma block, and similarly, the size of the largest chroma coding unit is half the size of the largest luma coding unit.

[0122] According to an embodiment, information regarding the maximum size of a luma coding block that can be binary split is acquired from a bitstream, so that the maximum size of the luma coding block that can be binary split may be variably determined. In contrast, the maximum size of a luma coding block that can be ternary split may be fixed. For example, the maximum size of a luma coding block that can be ternary split in an I slice is 32x32, and the maximum size of a luma coding block that can be ternary split in a P slice or a B slice is 64x64.

[0123] The maximum coding unit is also hierarchically divided into coding units based on division mode information acquired from the bitstream, which includes at least one of information indicating whether or not a quad split is performed, information indicating whether or not a multi-division is performed, division direction information, and division type information acquired from the bitstream.

[0124] For example, the information indicating whether or not the current coding unit is quad split may indicate whether or not the current coding unit is quad split (QUAD_SPLIT).

[0125] If the current coding unit is not split into quads, the information indicating whether the current coding unit is split further may indicate whether the current coding unit is not split further (NO_SPLIT) or whether the current coding unit is split into binary / ternary.

[0126] If the current coding unit is binary-divided or ternary-divided, the division direction information indicates that the current coding unit is divided either horizontally or vertically.

[0127] If the current coding unit is divided horizontally or vertically, the division type information indicates that the current coding unit is divided into binary division or ternary division.

[0128] The split mode of the current coding unit is also determined by the split direction information and split type information. If the current coding unit is split horizontally in binary, the split mode is determined as binary horizontal split (SPLIT_BT_HOR), if it is split horizontally in ternary, the split mode is determined as ternary horizontal split (SPLIT_TT_HOR), if it is split vertically in binary, the split mode is determined as binary vertical split (SPLIT_BT_VER), and if it is split vertically in ternary, the split mode is determined as ternary vertical split (SPLIT_BT_VER).

[0129] The video decoding device 100 can acquire partition mode information from a bin string from a bitstream. The format of the bitstream received by the video decoding device 100 may include a fixed-length binary code, a unary code, a truncated unary code, a predetermined binary code, etc. A bin string represents information as a sequence of binary digits. The bin string also includes at least one bit. The video decoding device 100 can acquire partition mode information corresponding to the bin string based on a partitioning rule. The video decoding device 100 can determine whether to partition a coding unit into quads or not, or the partition direction and type, based on a bin string.

[0130] A coding unit may be smaller than or equal to the maximum coding unit. For example, the maximum coding unit is also a coding unit because it has the largest size. If the partition mode information for the maximum coding unit indicates no partitioning, the coding unit determined as the maximum coding unit has the same size as the maximum coding unit. If the partition mode information for the maximum coding unit indicates partitioning, the maximum coding unit is also partitioned into coding units. Furthermore, if the partition mode information for the coding unit indicates partitioning, the coding unit is further partitioned into smaller coding units. However, the partitioning of an image is not limited to this, and the maximum coding unit and the coding unit are not distinguished from each other. The partitioning of coding units will be described in more detail with reference to FIGS. 3 to 16.

[0131] One or more prediction blocks for prediction may also be determined from the coding unit, where the prediction blocks may be the same as or smaller than the coding unit. One or more transform blocks for transformation may also be determined from the coding unit, where the transform blocks may be the same as or smaller than the coding unit.

[0132] The shapes and sizes of the transform block and the prediction block are independent of each other.

[0133] In other embodiments, prediction may be performed using the coding unit as a prediction block, or transformation may be performed using the coding unit as a transform block.

[0134] The division of coding units will be described in more detail with reference to Figures 3 to 16. In the present disclosure, the current block and neighboring blocks may refer to one of a largest coding unit, a coding unit, a prediction block, and a transform block. The current block or current coding unit is a block currently being decoded or coded, or a block currently being divided. The neighboring blocks may also be blocks reconstructed before the current block. The neighboring blocks are spatially or temporally adjacent to the current block. The neighboring blocks may be located at one of the lower left, left, upper left, upper, upper right, right, or lower right sides of the current block.

[0135] FIG. 3 illustrates a process in which the video decoding apparatus 100 divides a current coding unit and determines at least one coding unit according to an embodiment.

[0136] The block shape information may include 4Nx4N, 4Nx2N, 2Nx4N, 4NxN, Nx4N, 32NxN, Nx32N, 16NxN, Nx16N, 8NxN, or Nx8N, where N is a positive integer. The block shape information indicates at least one of the shape, direction, width and height ratio, or size of a coding unit.

[0137] The shape of the coding unit may include square and non-square. If the width and height of the coding unit are the same (i.e., if the block shape of the coding unit is 4Nx4N), the video decoding apparatus 100 may determine the block shape information of the coding unit as square. The video decoding apparatus 100 may also determine the shape of the coding unit as non-square.

[0138] If the width and height of a coding unit are different (i.e., if the block shape of the coding unit is 4Nx2N, 2Nx4N, 4NxN, Nx4N, 32NxN, Nx32N, 16NxN, Nx16N, 8NxN, or Nx8N), the video decoding apparatus 100 may determine that the block shape information of the coding unit is non-square. If the block shape of the coding unit is non-square, the video decoding apparatus 100 may determine that the width-to-height ratio in the block shape information of the coding unit is at least one of 1:2, 2:1, 1:4, 4:1, 1:8, 8:1, 1:16, 16:1, 1:32, and 32:1. Based on the width and height of the coding unit, the video decoding apparatus 100 may determine whether the coding unit is horizontally oriented or vertically oriented. Based on at least one of the width, height, and width of the coding unit, the video decoding apparatus 100 may determine the size of the coding unit.

[0139] The video decoding device 100 according to an embodiment may determine the type of coding unit using block type information and may determine the type of division of the coding unit using partition type mode information. That is, the division method of the coding unit indicated by the partition type mode information may be determined depending on the block type indicated by the block type information used by the video decoding device 100.

[0140] The video decoding device 100 may acquire partition mode information from a bitstream. However, without being limited thereto, the video decoding device 100 and the video encoding device 150 may determine predetermined partition mode information based on block format information. The video decoding device 100 may determine predetermined partition mode information for the largest coding unit or the smallest coding unit. For example, the video decoding device 100 may determine the partition mode information for the largest coding unit as quad partitioning. Also, the video decoding device 100 may determine the partition mode information for the smallest coding unit as "no partitioning." Specifically, the video decoding device 100 may determine the size of the largest coding unit to be 256x256. The video decoding device 100 may determine the predetermined partition mode information as quad partitioning. The quad partitioning is a partition mode in which both the width and height of the coding unit are divided into two equal parts. Based on the partition mode information, the video decoding device 100 can obtain a coding unit of 128x128 size from the maximum coding unit of 256x256 size. Also, the video decoding device 100 can determine the size of the minimum coding unit to be 4x4. The video decoding device 100 can obtain partition mode information indicating "no partition" for the minimum coding unit.

[0141] According to an embodiment, the video decoding device 100 may use block shape information indicating that the current coding unit is square. For example, the video decoding device 100 may determine whether to not split the square coding unit, split it vertically, split it horizontally, or split it into four coding units, based on the partition shape mode information. Referring to FIG. 3, when the block shape information of the current coding unit 300 indicates a square shape, the decoder 120 may not split a coding unit 310a having the same size as the current coding unit 300 based on the partition shape mode information indicating no split, or may determine split coding units 310b, 310c, 310d, 310e, and 310f based on the partition shape mode information indicating a predetermined split method.

[0142] Referring to FIG. 3, the video decoding device 100 may determine two coding units 310b obtained by vertically dividing the current coding unit 300 based on partition mode information indicating vertical division. The video decoding device 100 may determine two coding units 310c obtained by horizontally dividing the current coding unit 300 based on partition mode information indicating horizontal division. The video decoding device 100 may determine four coding units 310d obtained by vertically and horizontally dividing the current coding unit 300 based on partition mode information indicating vertical and horizontal division. The video decoding device 100 may determine three coding units 310e obtained by vertically dividing the current coding unit 300 based on partition mode information indicating vertical ternary division. The video decoding device 100 may determine three coding units 310f obtained by horizontally dividing the current coding unit 300 based on partition mode information indicating horizontal ternary division. However, the division patterns into which the square coding unit may be divided are not limited to the above-described patterns, and may include various patterns that can be indicated by the division pattern mode information. The predetermined division patterns into which the square coding unit may be divided will be described in detail below through various embodiments.

[0143] FIG. 4 illustrates a process in which a video decoding apparatus 100 according to an embodiment divides a non-square coding unit and determines at least one coding unit.

[0144] According to an embodiment, the video decoding apparatus 100 may use block shape information indicating that the current coding unit is non-square. The video decoding apparatus 100 may determine whether to not split the non-square current coding unit or to split it in a predetermined manner based on the partition shape mode information. Referring to FIG. 4, if the block shape information of the current coding unit 400 or 450 indicates a non-square shape, the video decoding apparatus 100 may determine a coding unit 410 or 460 having the same size as the current coding unit 400 or 450 based on the partition shape mode information indicating no splitting, or may determine split coding units 420a, 420b, 430a, 430b, 430c, 470a, 470b, 480a, 480b, and 480c based on the partition shape mode information indicating a predetermined splitting method. Predetermined splitting methods for splitting non-square coding units will be described in detail below through various embodiments.

[0145] According to an embodiment, the video decoding device 100 may determine a manner in which a coding unit is divided using the partition mode information, and in this case, the partition mode information may indicate the number of coding units to be generated by dividing the coding unit. Referring to FIG. 4, when the partition mode information indicates that the current coding unit 400 or 450 is to be divided into two coding units, the video decoding device 100 may divide the current coding unit 400 or 450 based on the partition mode information and determine two coding units 420a, 420b or 470a, 470b included in the current coding unit.

[0146] When the video decoding device 100 according to an embodiment divides a non-square current coding unit 400 or 450 based on the division mode information, the video decoding device 100 may divide the current coding unit by considering the position of a long side of the non-square current coding unit 400 or 450. For example, the video decoding device 100 may divide the current coding unit 400 or 450 in a direction that divides the long side of the current coding unit 400 or 450 by considering the shape of the current coding unit 400 or 450, thereby determining a plurality of coding units.

[0147] According to one embodiment, if the partition mode information indicates that a coding unit is to be partitioned into an odd number of blocks (ternary partitioning), the video decoding device 100 may determine the odd number of coding units included in the current coding unit 400 or 450. For example, if the partition mode information indicates that the current coding unit 400 or 450 is to be partitioned into three coding units, the video decoding device 100 may partition the current coding unit 400 or 450 into three coding units 430a, 430b, 430c, 480a, 480b, and 480c.

[0148] According to an embodiment, the width-to-height ratio of the current coding unit 400 or 450 may be 4:1 or 1:4. When the width-to-height ratio is 4:1, the width is greater than the height, and therefore the block shape information is horizontal. When the width-to-height ratio is 1:4, the width is smaller than the height, and therefore the block shape information is vertical. The video decoding device 100 may determine to divide the current coding unit into an odd number of blocks based on the partition shape mode information. The video decoding device 100 may also determine the partition direction of the current coding unit 400 or 450 based on the block shape information of the current coding unit 400 or 450. For example, if the current coding unit 400 is vertical, the video decoding device 100 may divide the current coding unit 400 horizontally to determine coding units 430a, 430b, and 430c. Also, if the current coding unit 450 is horizontal, the video decoding apparatus 100 may divide the current coding unit 450 vertically to determine coding units 480a, 480b, and 480c.

[0149] The video decoding apparatus 100 according to an embodiment may determine an odd number of coding units included in the current coding unit 400 or 450, and the determined coding units may not all have the same size. For example, among the determined odd number of coding units 430a, 430b, 430c, 480a, 480b, and 480c, the size of a given coding unit 430b or 480b may be different from the sizes of the other coding units 430a, 430c, 480a, and 480c. That is, the coding units that may be determined by dividing the current coding unit 400 or 450 may have a variety of sizes, and in some cases, the odd number of coding units 430a, 430b, 430c, 480a, 480b, and 480c may have different sizes.

[0150] According to an embodiment, when the partition mode information indicates that a coding unit is partitioned into an odd number of blocks, the video decoding device 100 may determine an odd number of coding units included in the current coding unit 400 or 450. Further, the video decoding device 100 may impose a predetermined restriction on at least one of the odd number of coding units generated by the partition. Referring to FIG. 4, the video decoding device 100 may perform a different decoding process for the central coding units 430b and 480b among three coding units 430a, 430b, 430c, 480a, 480b, and 480c generated by partitioning the current coding unit 400 or 450 from the other coding units 430a, 430c, 480a, and 480c. For example, the video decoding device 100 may limit the coding units 430b and 480b located in the center from being further divided, or may limit them to being divided only a predetermined number of times, unlike the other coding units 430a, 430c, 480a, and 480c.

[0151] FIG. 5 illustrates a process in which the video decoding apparatus 100 according to an embodiment divides a coding unit based on at least one of block configuration information and partition configuration mode information.

[0152] According to an embodiment, the video decoding apparatus 100 may determine whether to divide the square-shaped first coding unit 500 into coding units or not, based on at least one of block shape information and partition shape mode information. According to an embodiment, if the partition shape mode information indicates that the first coding unit 500 is to be divided horizontally, the video decoding apparatus 100 may divide the first coding unit 500 horizontally to determine the second coding unit 510. According to an embodiment, the terms "first coding unit," "second coding unit," and "third coding unit" used are terms used to understand the division relationship between coding units. For example, if the first coding unit is divided, the second coding unit may be determined, and if the second coding unit is divided, the third coding unit may be determined. Hereinafter, the relationship between the first coding unit, the second coding unit, and the third coding unit used may be understood to be in accordance with the above-described characteristics.

[0153] According to an embodiment, the video decoding apparatus 100 may determine whether or not to divide the determined second coding unit 510 into coding units based on partition mode information. Referring to FIG. 5, the video decoding apparatus 100 may divide the first coding unit 500 based on the partition mode information, and divide the determined non-square second coding unit 510 into at least one third coding unit 520a, 520b, 520c, or 520d, or may not divide the second coding unit 510. The video decoding apparatus 100 may acquire the partition mode information, and may divide the first coding unit 500 based on the acquired partition mode information, for example, into a plurality of second coding units 510 of various types. The second coding units 510 may also be divided in the same manner as the first coding unit 500 was divided, based on the partition mode information. According to one embodiment, if the first coding unit 500 is divided into the second coding unit 510 based on the division mode information associated with the first coding unit 500, the second coding unit 510 is also divided into, for example, third coding units 520a, 520b, 520c, and 520d based on the division mode information associated with the second coding unit 510. That is, the coding units are also divided recursively based on the division mode information associated with each coding unit. Thus, for a non-square coding unit, square coding units are determined, and such square coding units are recursively divided to determine non-square coding units.

[0154] Referring to FIG. 5 , among the odd number of third coding units 520b, 520c, and 520d determined by dividing the non-square second coding unit 510, a predetermined coding unit (e.g., a central coding unit or a square-shaped coding unit) is also recursively divided. According to one embodiment, the square-shaped third coding unit 520b, which is one of the odd number of third coding units 520b, 520c, and 520d, is divided horizontally into a plurality of fourth coding units. The non-square-shaped fourth coding unit 530b or 530d, which is one of the plurality of fourth coding units 530a, 530b, 530c, and 530d, is also divided into a plurality of coding units. For example, the non-square-shaped fourth coding unit 530b or 530d is further divided into an odd number of coding units. Methods used for recursive division of coding units will be described below through various embodiments.

[0155] According to an embodiment, the video decoding device 100 may divide each of the third coding units 520a, 520b, 520c, and 520d into coding units based on the partition mode information. Furthermore, the video decoding device 100 may determine not to partition the second coding unit 510 based on the partition mode information. According to an embodiment, the video decoding device 100 may divide the non-square second coding unit 510 into an odd number of third coding units 520b, 520c, and 520d. The video decoding device 100 may impose a certain restriction on certain third coding units among the odd number of third coding units 520b, 520c, and 520d. For example, the video decoding device 100 may restrict the middle coding unit 520c of the odd number of third coding units 520b, 520c, and 520d from being further divided or may restrict it to being divided a configurable number of times.

[0156] 5, the video decoding device 100 may restrict the middle coding unit 520c of the odd number of third coding units 520b, 520c, and 520d included in the non-square second coding unit 510 to not be further divided, to be divided into a predetermined division pattern (e.g., into only four coding units, or into a pattern corresponding to the division pattern of the second coding unit 510), or to be divided into a predetermined number of times (e.g., divided n times, n>0). However, the above restriction on the middle coding unit 520c is merely a simple embodiment, and should not be construed as being limited to the above embodiment, but should be construed as including various restrictions in which the middle coding unit 520c is decoded differently from the other coding units 520b and 520d.

[0157] The video decoding apparatus 100 according to an embodiment may acquire partition mode information used to partition the current coding unit at a predetermined position within the current coding unit.

[0158] FIG. 6 illustrates a method for determining a predetermined coding unit from among an odd number of coding units by the video decoding apparatus 100 according to an embodiment.

[0159] 6, the partition mode information of the current coding unit 600, 650 is also obtained from a sample at a predetermined position (e.g., sample 640, 690 located in the middle) among the samples included in the current coding unit 600, 650. However, the predetermined position within the current coding unit 600 from which at least one piece of partition mode information is obtained is not limited to the center position shown in FIG. 6, but may include various positions within the current coding unit 600 (e.g., top, bottom, left, right, top left, bottom left, top right, bottom right, etc.). The video decoding device 100 obtains the partition mode information obtained from the predetermined position and may determine whether to partition the current coding unit into coding units of various types and sizes, or not to partition the current coding unit.

[0160] According to an embodiment, when a current coding unit is divided into a predetermined number of coding units, the video decoding apparatus 100 may select one of the coding units. There are various methods for selecting one of the plurality of coding units, and such methods will be described later in the following various embodiments.

[0161] The video decoding apparatus 100 according to an embodiment may divide a current coding unit into a plurality of coding units and determine a coding unit at a predetermined position.

[0162] According to an embodiment, the video decoding apparatus 100 may use information indicating the positions of the odd-numbered coding units to determine a middle coding unit among the odd-numbered coding units. Referring to Figure 6, the video decoding apparatus 100 may divide a current coding unit 600 or a current coding unit 650 to determine odd-numbered coding units 620a, 620b, and 620c or odd-numbered coding units 660a, 660b, and 660c. The video decoding apparatus 100 may determine the middle coding unit 620b or the middle coding unit 660b using information regarding the positions of the odd-numbered coding units 620a, 620b, and 620c or odd-numbered coding units 660a, 660b, and 660c. For example, the video decoding device 100 can determine the positions of the coding units 620a, 620b, and 620c based on information indicating the positions of certain samples included in the coding units 620a, 620b, and 620c, thereby determining the center coding unit 620b. Specifically, the video decoding device 100 can determine the positions of the coding units 620a, 620b, and 620c based on information indicating the positions of the upper left samples 630a, 630b, and 630c of the coding units 620a, 620b, and 620c, thereby determining the center coding unit 620b.

[0163] According to an embodiment, the information indicating the positions of the top left samples 630a, 630b, and 630c included in the coding units 620a, 620b, and 620c, respectively, may include information related to the positions or coordinates of the coding units 620a, 620b, and 620c within a picture. According to an embodiment, the information indicating the positions of the top left samples 630a, 630b, and 630c included in the coding units 620a, 620b, and 620c, respectively, may include information indicating the width or height of the coding units 620a, 620b, and 620c included in the current coding unit 600, where the width or height corresponds to information indicating the difference between the coordinates of the coding units 620a, 620b, and 620c within a picture. That is, the video decoding device 100 can determine the coding unit 620b located in the middle by directly using information related to the positions or coordinates of the coding units 620a, 620b, and 620c within the picture, or by using information related to the width or height of the coding unit corresponding to the coordinate difference value.

[0164] According to an embodiment, information indicating the position of the top left sample 630a of the top coding unit 620a may indicate (xa, ya) coordinates, information indicating the position of the top left sample 630b of the middle coding unit 620b may indicate (xb, yb) coordinates, and information indicating the position of the top left sample 630c of the bottom coding unit 620c may indicate (xc, yc) coordinates. The video decoding device 100 may determine the middle coding unit 620b using the coordinates of the top left samples 630a, 630b, and 630c included in the coding units 620a, 620b, and 620c, respectively. For example, when the coordinates of the top left samples 630a, 630b, and 630c are sorted in ascending or descending order, the coding unit 620b including the coordinates (xb, yb) of the middle sample 630b may be determined as the middle coding unit among the coding units 620a, 620b, and 620c determined by dividing the current coding unit 600. However, the coordinates indicating the positions of the top left samples 630a, 630b, and 630c may indicate absolute positions within a picture. Furthermore, (dxb, dyb) coordinates indicating the relative position of the top left sample 630b of the middle coding unit 620b and (dxc, dyc) coordinates indicating the relative position of the top left sample 630c of the bottom coding unit 620c may be used. Furthermore, this should not be interpreted as being limited to the method described above of determining a coding unit at a predetermined position by using the coordinates of the sample as information indicating the position of the sample included in the coding unit, but should be interpreted as various arithmetic methods that can use the coordinates of the sample.

[0165] According to an embodiment, the video decoding device 100 may divide a current coding unit 600 into a plurality of coding units 620a, 620b, and 620c and select a coding unit from the coding units 620a, 620b, and 620c according to a predetermined criterion. For example, the video decoding device 100 may select a coding unit 620b having a different size from the coding units 620a, 620b, and 620c.

[0166] According to an embodiment, the video decoding device 100 may determine the width or height of each of the coding units 620a, 620b, and 620c using (xa, ya) coordinates indicating the position of the top left sample 630a of the top coding unit 620a, (xb, yb) coordinates indicating the position of the top left sample 630b of the middle coding unit 620b, and (xc, yc) coordinates indicating the position of the top left sample 630c of the bottom coding unit 620c. The video decoding device 100 may determine the size of each of the coding units 620a, 620b, and 620c using the coordinates (xa, ya), (xb, yb), and (xc, yc) indicating the positions of the coding units 620a, 620b, and 620c. According to an embodiment, the video decoding device 100 may determine the width of the top coding unit 620a as the width of the current coding unit 600. The video decoding device 100 may determine the height of the top coding unit 620a as yb-ya. According to an embodiment, the video decoding device 100 may determine the width of the middle coding unit 620b as the width of the current coding unit 600. According to an embodiment, the video decoding device 100 may determine the height of the middle coding unit 620b as yc-yb. According to an embodiment, the video decoding device 100 may determine the width or height of the bottom coding unit using the width or height of the current coding unit and the widths and heights of the top coding unit 620a and the middle coding unit 620b. Based on the determined widths and heights of the coding units 620a, 620b, and 620c, the video decoding device 100 may determine a coding unit having a different size from the other coding units. Referring to FIG. 6, the video decoding device 100 may determine the middle coding unit 620b, having a different size from the top coding unit 620a and the bottom coding unit 620c, as a coding unit of a predetermined position. However, the process in which the video decoding device 100 determines coding units having different coding units and different sizes is merely one embodiment of determining a coding unit at a predetermined position using the size of the coding unit determined based on sample coordinates, and various other processes may also be used to determine a coding unit at a predetermined position by comparing the size of the coding unit determined based on predetermined sample coordinates.

[0167] The video decoding device 100 may determine the width or height of each of the coding units 660a, 660b, and 660c using the (xd, yd) coordinates indicating the position of the top left sample 670a of the left coding unit 660a, the (xe, ye) coordinates indicating the position of the top left sample 670b of the middle coding unit 660b, and the (xf, yf) coordinates indicating the position of the top left sample 670c of the right coding unit 660c. The video decoding device 100 may determine the size of each of the coding units 660a, 660b, and 660c using the coordinates (xd, yd), (xe, ye), and (xf, yf) indicating the positions of the coding units 660a, 660b, and 660c.

[0168] According to an embodiment, the video decoding device 100 may determine the width of the left coding unit 660a as xe-xd. The video decoding device 100 may determine the height of the left coding unit 660a as the height of the current coding unit 650. According to an embodiment, the video decoding device 100 may determine the width of the middle coding unit 660b as xf-xe. The video decoding device 100 may determine the height of the middle coding unit 660b as the height of the current coding unit 600. According to an embodiment, the video decoding device 100 may determine the width or height of the right coding unit 660c using the width or height of the current coding unit 650 and the widths and heights of the left coding unit 660a and the middle coding unit 660b. Based on the determined widths and heights of the coding units 660a, 660b, and 660c, the video decoding device 100 may determine a coding unit having a size different from the other coding units. 6, the video decoding device 100 may determine a middle coding unit 660b, which has a size different from the sizes of the left coding unit 660a and the right coding unit 660c, as a coding unit at a predetermined position. However, the above-described process by the video decoding device 100 of determining coding units having different coding units and different sizes is merely one embodiment of determining a coding unit at a predetermined position using the size of the coding unit determined based on sample coordinates, and various other processes of determining a coding unit at a predetermined position by comparing the size of the coding unit determined based on predetermined sample coordinates may also be used.

[0169] However, the position of the sample considered to determine the position of the coding unit is not interpreted as being limited to the upper left end as mentioned above, but may also be interpreted as using information related to the position of any sample included in the coding unit.

[0170] According to an embodiment, the video decoding apparatus 100 may select a coding unit at a predetermined position from among an odd number of coding units determined by dividing the current coding unit, taking into account the shape of the current coding unit. For example, if the current coding unit is non-square in shape, with its width greater than its height, the video decoding apparatus 100 may select a coding unit at a predetermined position along the horizontal direction. That is, the video decoding apparatus 100 may select one of the coding units at a different position in the horizontal direction and set a constraint on the coding unit. If the current coding unit is non-square in shape, with its height greater than its width, the video decoding apparatus 100 may select a coding unit at a predetermined position along the vertical direction. That is, the video decoding apparatus 100 may select one of the coding units at a different position in the vertical direction and set a constraint on the coding unit.

[0171] According to an embodiment, the video decoding apparatus 100 may use information indicating the positions of each of the even-numbered coding units to determine a coding unit at a predetermined position among the even-numbered coding units. The video decoding apparatus 100 may determine the even-numbered coding units by dividing (binary dividing) the current coding unit, and may determine the coding unit at a predetermined position using information regarding the positions of the even-numbered coding units. A detailed process related to this process corresponds to the process of determining a coding unit at a predetermined position (e.g., the middle position) among the odd-numbered coding units described with reference to FIG. 6, and therefore will not be described here.

[0172] According to an embodiment, when a non-square current coding unit is divided into a plurality of coding units, in order to determine a coding unit at a predetermined position among the plurality of coding units, predetermined information related to the coding unit at a predetermined position may be used in the division process. For example, in order to determine a coding unit at a center among the plurality of coding units into which the current coding unit is divided, the video decoding apparatus 100 may use at least one of block shape information and partition shape mode information stored in a sample included in the center coding unit in the division process.

[0173] 6, the video decoding device 100 may divide a current coding unit 600 into a plurality of coding units 620a, 620b, and 620c based on the partition mode information, and may determine a middle coding unit 620b among the plurality of coding units 620a, 620b, and 620c. Furthermore, the video decoding device 100 may determine the middle coding unit 620b by considering a position at which the partition mode information is acquired. That is, the partition mode information of the current coding unit 600 is also acquired from a sample 640 located in the middle of the current coding unit 600. When the current coding unit 600 is divided into a plurality of coding units 620a, 620b, and 620c based on the partition mode information, the coding unit 620b including the sample 640 may be determined as the middle coding unit. However, the information used to determine the middle coding unit is not limited to the partition mode information, and various information may also be used in the process of determining the middle coding unit.

[0174] According to an embodiment, predetermined information for identifying a coding unit at a predetermined position may also be obtained from a predetermined sample included in the coding unit to be determined. Referring to FIG. 6, the video decoding device 100 may use partition mode information obtained from a sample at a predetermined position within the current coding unit 600 (e.g., a sample located at the center of the current coding unit 600) to determine a coding unit at a predetermined position (e.g., a coding unit located at the center of the current coding unit 600) among multiple coding units 620a, 620b, and 620c determined by dividing the current coding unit 600. That is, the video decoding device 100 may determine the sample at the predetermined position by considering the block type of the current coding unit 600. The video decoding device 100 may determine a coding unit 620b including a sample from which predetermined information (e.g., partition mode information) is obtained among the multiple coding units 620a, 620b, and 620c determined by dividing the current coding unit 600, and may impose a predetermined restriction. 6, the video decoding device 100 according to an embodiment may determine a sample 640 located in the middle of a current coding unit 600 as a sample from which certain information can be acquired, and may place a certain restriction on the decoding process for a coding unit 620b including such sample 640. However, the position of the sample from which certain information can be acquired is not limited to the above position, but may also be a sample at any position included in the coding unit 620b determined to place the restriction.

[0175] According to an embodiment, the location of a sample from which the predetermined information can be acquired is also determined based on the shape of the current coding unit 600. According to an embodiment, the block shape information may determine whether the shape of the current coding unit is square or non-square, and the location of a sample from which the predetermined information can be acquired may be determined based on the shape. For example, the video decoding apparatus 100 may determine, using at least one of information related to the width and information related to the height of the current coding unit, a sample located on a boundary that divides at least one of the width and height of the current coding unit in half as a sample from which the predetermined information can be acquired. For another example, if the block shape information related to the current coding unit indicates a non-square shape, the video decoding apparatus 100 may determine, as a sample from which the predetermined information can be acquired, one of the samples adjacent to a boundary that divides the long side of the current coding unit in half.

[0176] When a current coding unit is divided into a plurality of coding units, the video decoding apparatus 100 according to an embodiment may use partition mode information to determine a coding unit at a predetermined position among the plurality of coding units. The video decoding apparatus 100 according to an embodiment may acquire the partition mode information from samples at predetermined positions included in the coding unit, and may divide the plurality of coding units generated by dividing the current coding unit using the partition mode information acquired from samples at predetermined positions included in each of the plurality of coding units. That is, the coding units may also be recursively divided using the partition mode information acquired from samples at predetermined positions included in each of the plurality of coding units. The recursive division process of the coding units has been described with reference to FIG. 5, and therefore, a detailed description thereof will be omitted.

[0177] A video decoding device 100 according to one embodiment can divide a current coding unit and determine at least one coding unit, and can determine the order in which such at least one coding unit is decoded by a predetermined block (e.g., the current coding unit).

[0178] FIG. 7 illustrates an order in which a plurality of coding units are processed when the video decoding apparatus 100 divides a current coding unit and determines the plurality of coding units, according to an embodiment.

[0179] According to one embodiment, the video decoding device 100 may divide the first coding unit 700 vertically and determine the second coding units 710a and 710b, or may divide the first coding unit 700 horizontally and determine the second coding units 730a and 730b, or may divide the first coding unit 700 vertically and horizontally and determine the second coding units 750a, 750b, 750c, and 750d, depending on the division mode information.

[0180] 7, the video decoding device 100 may determine the order of processing second coding units 710a and 710b, which are determined by dividing the first coding unit 700 vertically, in the horizontal direction (710c). The video decoding device 100 may determine the processing order of second coding units 730a and 730b, which are determined by dividing the first coding unit 700 horizontally, in the vertical direction (730c). The video decoding device 100 may determine the processing order of second coding units 750a, 750b, 750c, and 750d, which are determined by dividing the first coding unit 700 vertically and horizontally, in a predetermined order (e.g., raster scan order or z scan order 750e) in which coding units located in one row are processed before coding units located in the next row are processed.

[0181] According to an embodiment, the video decoding apparatus 100 may recursively divide a coding unit (CU). Referring to FIG. 7, the video decoding apparatus 100 may divide a first coding unit (CU) 700 to determine a plurality of CUs 710a, 710b, 730a, 730b, 750a, 750b, 750c, and 750d, and may recursively divide each of the determined CUs 710a, 710b, 730a, 730b, 750a, 750b, 750c, and 750d. The method of dividing the plurality of CUs 710a, 710b, 730a, 730b, 750a, 750b, 750c, and 750d corresponds to the method of dividing the first coding unit 700. 7, the video decoding device 100 may divide the first coding unit 700 vertically to determine the second coding units 710a and 710b, and may further determine whether to divide each of the second coding units 710a and 710b independently.

[0182] In one embodiment, the video decoding device 100 can divide the second coding unit 710a on the left side horizontally into third coding units 720a and 720b, and the second coding unit 710b on the right side is not divided.

[0183] According to an embodiment, the processing order of the coding units is also determined based on the division process of the coding units. In other words, the processing order of the divided coding units is also determined based on the processing order of the coding units immediately before the division. The video decoding device 100 may determine the processing order of the third coding units 720a and 720b, which are determined by dividing the second coding unit 710a on the left side, independently of the second coding unit 710b on the right side. Since the second coding unit 710a on the left side is divided horizontally and the third coding units 720a and 720b are determined, the third coding units 720a and 720b are also processed vertically (720c). In addition, since the processing order of the second coding unit 710a on the left side and the second coding unit 710b on the right side corresponds to the horizontal direction (710c), the third coding units 720a and 720b included in the second coding unit 710a on the left side are processed in the vertical direction (720c), and then the right coding unit 710b is processed. The above content is intended to explain the process in which the processing order of coding units is determined based on the coding units before division, and should not be construed as being limited to the above embodiment, but should be construed as being used in various methods in which coding units determined by division in various forms are processed independently in a predetermined order.

[0184] FIG. 8 illustrates a process in which the video decoding apparatus 100, according to an embodiment, determines to divide a current coding unit into an odd number of coding units when the coding units cannot be processed in a predetermined order.

[0185] The video decoding apparatus 100 according to an embodiment may determine that a current coding unit is divided into an odd number of coding units based on the acquired division mode information. Referring to Figure 8, a square-shaped first coding unit 800 is divided into non-square-shaped second coding units 810a and 810b, and the second coding units 810a and 810b are each independently divided into third coding units 820a, 820b, 820c, 820d, and 820e. The video decoding apparatus 100 according to an embodiment may divide the left coding unit 810a of the second coding unit horizontally to determine a plurality of third coding units 820a and 820b, and may divide the right coding unit 810b into an odd number of third coding units 820c, 820d, and 820e.

[0186] According to an embodiment, the video decoding apparatus 100 may determine whether there is an odd number of coding units by determining whether the third coding units 820a, 820b, 820c, 820d, and 820e can be processed in a predetermined order. Referring to FIG. 8, the video decoding apparatus 100 may recursively divide the first coding unit 800 to determine the third coding units 820a, 820b, 820c, 820d, and 820e. The video decoding apparatus 100 may determine whether the first coding unit 800, the second coding unit 810a, 810b, or the third coding unit 820a, 820b, 820c, 820d, and 820e are divided into an odd number of coding units based on at least one of block type information and partition type mode information. For example, in the second coding units 810a and 810b, the coding units located on the right side are also divided into an odd number of third coding units 820c, 820d, and 820e. The order in which the multiple coding units included in the first coding unit 800 are processed may be a predetermined order (e.g., z scan order (830)), and the video decoding device 100 may determine whether the third coding units 820c, 820d, and 820e determined by dividing the right second coding unit 810b into an odd number of coding units satisfy the condition for being processed in the predetermined order.

[0187] According to an embodiment, the video decoding apparatus 100 may determine whether the third coding units 820a, 820b, 820c, 820d, and 820e included in the first coding unit 800 satisfy a condition for being processed in a predetermined order, where the condition relates to whether at least one of the width and height of the second coding units 810a and 810b is divided in half along the boundary between the third coding units 820a, 820b, 820c, 820d, and 820e. For example, the third coding units 820a and 820b, which are determined by dividing the height of the non-square left second coding unit 810a in half, may satisfy the condition. The video decoding apparatus 100 may determine that the third coding units 820c, 820d, and 820e, which are determined by dividing the right-side second coding unit 810b into three coding units, do not satisfy the condition because the boundary of the third coding units 820c, 820d, and 820e does not divide the width or height of the right-side second coding unit 810b in half. If such a condition is not satisfied, the video decoding apparatus 100 may determine that there is a disconnection in the scanning order and, based on the determination result, may determine that the right-side second coding unit 810b is divided into an odd number of coding units. When dividing the right-side second coding unit 810b into an odd number of coding units, the video decoding apparatus 100 according to an embodiment may impose a predetermined restriction on coding units at predetermined positions among the divided coding units. The content of such a restriction and the predetermined positions have been described in various embodiments, and therefore, detailed description thereof will be omitted.

[0188] FIG. 9 illustrates a process in which the video decoding apparatus 100 divides a first coding unit 900 to determine at least one coding unit, according to an embodiment.

[0189] According to an embodiment, the video decoding apparatus 100 may divide the first coding unit 900 based on division mode information acquired via a receiving unit (not shown). The square-shaped first coding unit 900 may be divided into four square-shaped coding units or into a plurality of non-square coding units. For example, referring to FIG. 9, if the first coding unit 900 is square and the division mode information indicates that the first coding unit 900 is to be divided into non-square coding units, the video decoding apparatus 100 may divide the first coding unit 900 into a plurality of non-square coding units. Specifically, when the division mode information indicates that the first coding unit 900 is to be divided horizontally or vertically to determine an odd number of coding units, the video decoding device 100 can divide the square-shaped first coding unit 900 into second coding units 910a, 910b, and 910c determined by dividing it vertically, or second coding units 920a, 920b, and 920c determined by dividing it horizontally, as an odd number of coding units.

[0190] According to an embodiment, the video decoding apparatus 100 may determine whether the second coding units 910a, 910b, 910c, 920a, 920b, and 920c included in the first coding unit 900 satisfy a condition for being processed in a predetermined order, where the condition relates to whether at least one of the width and height of the first coding unit 900 is divided in half along the boundaries of the second coding units 910a, 910b, 910c, 920a, 920b, and 920c. Referring to Figure 9, the boundaries of the second coding units 910a, 910b, and 910c determined by dividing the square-shaped first coding unit 900 vertically do not divide the width of the first coding unit 900 in half, so it is determined that the first coding unit 900 does not satisfy the condition for being processed in a predetermined order. In addition, since the boundaries of the second coding units 920a, 920b, and 920c determined by dividing the square-shaped first coding unit 900 horizontally do not divide the width of the first coding unit 900 in half, it is determined that the first coding unit 900 does not satisfy the condition for being processed in a predetermined order. If such a condition is not satisfied, the video decoding apparatus 100 determines that the scanning order is broken and may determine to divide the first coding unit 900 into an odd number of coding units based on the determination result. When dividing the first coding unit 900 into an odd number of coding units, the video decoding apparatus 100 according to an embodiment may impose a predetermined restriction on coding units at predetermined positions among the divided coding units. The content of such restriction or the predetermined position has been described in various embodiments, and therefore a detailed description thereof will be omitted.

[0191] According to an embodiment, the video decoding apparatus 100 may divide the first coding unit and determine various types of coding units.

[0192] Referring to FIG. 9, the video decoding apparatus 100 may divide a square-shaped first coding unit 900, a non-square-shaped first coding unit 930, or a non-square-shaped first coding unit 950 into various types of coding units.

[0193] Figure 10 illustrates that, in one embodiment, a video decoding device 100 restricts the manner in which a second coding unit may be divided when a non-square second coding unit determined by dividing a first coding unit 1000 satisfies a predetermined condition.

[0194] The video decoding device 100 according to an embodiment may determine to divide a square-shaped first coding unit 1000 into non-square-shaped second coding units 1010a, 1010b, 1020a, and 1020b based on division mode information acquired via a receiving unit (not shown). The second coding units 1010a, 1010b, 1020a, and 1020b may be divided independently. Thus, the video decoding device 100 may determine whether to divide the second coding units 1010a, 1010b, 1020a, and 1020b into multiple coding units or not to divide the first coding unit 1000 based on the division mode information associated with each of the second coding units. The video decoding device 100 according to an embodiment may horizontally divide the non-square-shaped left second coding unit 1010a, which is determined by dividing the first coding unit 1000 vertically, to determine third coding units 1012a and 1012b. However, when the video decoding device 100 divides the left second coding unit 1010a horizontally, the right second coding unit 1010b may be restricted so that it is not divided horizontally in the same direction as the division of the left second coding unit 1010a. If the right second coding unit 1010b is divided in the same direction to determine the third coding units 1014a and 1014b, the left second coding unit 1010a and the right second coding unit 1010b may be divided horizontally independently to determine the third coding units 1012a, 1012b, 1014a, and 1014b. However, this is the same result as if the video decoding device 100 divided the first coding unit 1000 into four square second coding units 1030a, 1030b, 1030c, and 1030d based on the division mode information, which is inefficient in terms of video decoding.

[0195] According to an embodiment, the video decoding device 100 may vertically divide a non-square second coding unit 1020a or 1020b, which is determined by horizontally dividing the first coding unit 1000, to determine third coding units 1022a, 1022b, 1024a, and 1024b. However, if the video decoding device 100 vertically divides one of the second coding units (e.g., the top second coding unit 1020a), for the above-mentioned reasons, the video decoding device 100 may restrict another second coding unit (e.g., the bottom coding unit 1020b) from being vertically divided in the same direction as the top second coding unit 1020a.

[0196] FIG. 11 illustrates a process in which the video decoding device 100 divides a square-shaped coding unit when the division mode information does not indicate division into four square-shaped coding units, according to one embodiment.

[0197] According to an embodiment, the video decoding device 100 may divide the first coding unit 1100 into second coding units 1110a, 1110b, 1120a, and 1120b based on the partition mode information. The partition mode information may include information regarding various types of division into which the coding unit may be divided, and the information regarding the various types may include information for dividing the coding unit into four square coding units. According to such partition mode information, the video decoding device 100 may not divide the square-shaped first coding unit 1100 into four square-shaped second coding units 1130a, 1130b, 1130c, and 1130d. Based on the partition mode information, the video decoding device 100 may determine non-square second coding units 1110a, 1110b, 1120a, and 1120b.

[0198] According to an embodiment, the video decoding apparatus 100 may independently divide the non-square second coding units 1110a, 1110b, 1120a, and 1120b. The second coding units 1110a, 1110b, 1120a, and 1120b may be divided in a recursive manner in a predetermined order, which corresponds to the division of the first coding unit 1100 based on the division mode information.

[0199] For example, the video decoding device 100 may horizontally divide the left-side second coding unit 1110a into square-shaped third coding units 1112a and 1112b, and may horizontally divide the right-side second coding unit 1110b into square-shaped third coding units 1114a and 1114b. Furthermore, the video decoding device 100 may horizontally divide both the left-side second coding unit 1110a and the right-side second coding unit 1110b into square-shaped third coding units 1116a, 1116b, 1116c, and 1116d. In this case, the coding units may be determined in the same manner as when the first coding unit 1100 is divided into four square-shaped second coding units 1130a, 1130b, 1130c, and 1130d.

[0200] For another example, the video decoding device 100 may vertically divide the top second coding unit 1120a to determine square third coding units 1122a and 1122b, and may vertically divide the bottom second coding unit 1120b to determine square third coding units 1124a and 1124b. Furthermore, the video decoding device 100 may vertically divide both the top second coding unit 1120a and the bottom second coding unit 1120b to determine square third coding units 1126a, 1126b, 1126a, and 1126b. In this case, the coding units may be determined in the same manner as when the first coding unit 1100 is divided into four square second coding units 1130a, 1130b, 1130c, and 1130d.

[0201] FIG. 12 illustrates that the processing order of multiple coding units may vary depending on the division process of the coding units, according to an embodiment.

[0202] According to an embodiment, the video decoding apparatus 100 may divide the first coding unit 1200 based on the partition mode information. If the block shape is square and the partition mode information indicates that the first coding unit 1200 is to be divided in at least one of the horizontal and vertical directions, the video decoding apparatus 100 may divide the first coding unit 1200 to determine, for example, second coding units 1210a, 1210b, 1220a, and 1220b. Referring to FIG. 12, the non-square second coding units 1210a, 1210b, 1220a, and 1220b determined by dividing the first coding unit 1200 only in the horizontal or vertical direction are also divided independently based on the corresponding partition mode information. For example, the video decoding device 100 may determine third coding units 1216a, 1216b, 1216c, and 1216d by horizontally dividing second coding units 1210a and 1210b, which are generated by vertically dividing the first coding unit 1200, and may determine third coding units 1226a, 1226b, 1226c, and 1226d by horizontally dividing second coding units 1220a and 1220b, which are generated by horizontally dividing the first coding unit 1200. The process of dividing the second coding units 1210a, 1210b, 1220a, and 1220b has been described with reference to FIG. 11, so a detailed description thereof will be omitted.

[0203] The video decoding device 100 according to an embodiment may process coding units in a predetermined order. The characteristics of processing coding units in a predetermined order have been described with reference to FIG. 7, and therefore detailed description thereof will be omitted. Referring to FIG. 12, the video decoding device 100 may divide a square-shaped first coding unit 1200 to determine four square-shaped third coding units 1216a, 1216b, 1216c, 1216d, 1226a, 1226b, 1226c, and 1226d. The video decoding device 100 according to an embodiment may determine the processing order of the third coding units 1216a, 1216b, 1216c, 1216d, 1226a, 1226b, 1226c, and 1226d depending on the division form of the first coding unit 1200.

[0204] According to one embodiment, the video decoding device 100 can horizontally divide the second coding units 1210a and 1210b, which have been generated by vertical division, to determine the third coding units 1216a, 1216b, 1216c, and 1216d. The video decoding device 100 can process the third coding units 1216a, 1216b, 1216c, and 1216d in the order (1217) of first vertically processing the third coding units 1216a and 1216c included in the left second coding unit 1210a, and then vertically processing the third coding units 1216b and 1216d included in the right second coding unit 1210b.

[0205] According to one embodiment, the video decoding device 100 can vertically divide the second coding units 1220a and 1220b, which have been generated by dividing them horizontally, to determine the third coding units 1226a, 1226b, 1226c, and 1226d. The video decoding device 100 can process the third coding units 1226a, 1226b, 1226c, and 1226d in the order (1227) of first horizontally processing the third coding units 1226a and 1226b included in the top second coding unit 1220a, and then horizontally processing the third coding units 1226c and 1226d included in the bottom second coding unit 1220b.

[0206] 12, the second coding units 1210a, 1210b, 1220a, and 1220b may be divided into square-shaped third coding units 1216a, 1216b, 1216c, 1216d, 1226a, 1226b, 1226c, and 1226d. The second coding units 1210a and 1210b determined by vertical division and the second coding units 1220a and 1220b determined by horizontal division are divided into different types, but the third coding units 1216a, 1216b, 1216c, 1216d, 1226a, 1226b, 1226c, and 1226d determined thereafter ultimately result in the first coding unit 1200 being divided into coding units of the same type. As a result, the video decoding device 100 recursively divides the coding units through different processes based on the division format mode information, and as a result, even if coding units of the same format are determined, multiple coding units determined to be of the same format can be processed in different orders from each other.

[0207] FIG. 13 illustrates a process of determining the depth of a coding unit according to changes in the shape and size of the coding unit when the coding unit is recursively divided to determine multiple coding units, according to one embodiment.

[0208] According to an embodiment, the video decoding apparatus 100 may determine the depth of a coding unit based on a predetermined criterion. For example, the predetermined criterion may be the long side length of the coding unit. When the long side length of the current coding unit is divided to be 2n (n>0) times the long side length of the coding unit before division, the video decoding apparatus 100 may determine that the depth of the current coding unit is increased by n from the depth of the coding unit before division. Hereinafter, a coding unit whose depth has been increased will be referred to as a coding unit of a lower depth.

[0209] 13, according to an embodiment, the video decoding apparatus 100 may divide a square-shaped first coding unit 1300 based on block shape information indicating a square shape (e.g., the block shape information may indicate "0:SQUARE"), and determine a second coding unit 1302, a third coding unit 1304, etc., of a lower depth. If the size of the square-shaped first coding unit 1300 is 2Nx2N, the second coding unit 1302, which is determined by dividing the width and height of the first coding unit 1300 by 1 / 2, may have a size of NxN. Furthermore, the third coding unit 1304, which is determined by dividing the width and height of the second coding unit 1302 by 1 / 2, may have a size of N / 2xN / 2. In this case, the width and height of the third coding unit 1304 correspond to 1 / 4 of the first coding unit 1300. If the depth of the first coding unit 1300 is D, the depth of the second coding unit 1302, which is 1 / 2 the width and height of the first coding unit 1300, is also D+1, and the depth of the third coding unit 1304, which is 1 / 4 the width and height of the first coding unit 1300, is also D+2.

[0210] According to one embodiment, based on block shape information indicating a non-square shape (for example, the block shape information may indicate "1:NS_VER", indicating a non-square shape in which the height is greater than the width, or "2:NS_HOR", indicating a non-square shape in which the width is greater than the height), the video decoding device 100 may divide the non-square first coding unit 1310 or 1320 and determine a second coding unit 1312 or 1322, a third coding unit 1314 or 1324, etc. at a lower depth.

[0211] The video decoding device 100 may divide at least one of the width and height of the first coding unit 1310 having a size of Nx2N to determine, for example, second coding units 1302, 1312, and 1322. That is, the video decoding device 100 may divide the first coding unit 1310 horizontally to determine the second coding unit 1302 having a size of NxN or the second coding unit 1322 having a size of NxN / 2, or may divide the first coding unit 1310 horizontally and vertically to determine the second coding unit 1312 having a size of N / 2xN.

[0212] According to an embodiment, the video decoding device 100 may divide at least one of the width and height of the first coding unit 1320 having a size of 2NxN to determine, for example, second coding units 1302, 1312, and 1322. That is, the video decoding device 100 may divide the first coding unit 1320 vertically to determine the second coding unit 1302 having a size of NxN or the second coding unit 1312 having a size of N / 2xN, or may divide the first coding unit 1320 horizontally and vertically to determine the second coding unit 1322 having a size of NxN / 2.

[0213] According to an embodiment, the video decoding device 100 may divide at least one of the width and height of the NxN second coding unit 1302 to determine, for example, third coding units 1304, 1314, and 1324. That is, the video decoding device 100 may divide the second coding unit 1302 vertically and horizontally to determine the N / 2xN / 2 third coding unit 1304, the N / 4xN / 2 third coding unit 1314, or the N / 2xN / 4 third coding unit 1324.

[0214] According to an embodiment, the video decoding device 100 may divide at least one of the width and height of the second coding unit 1312 having a size of N / 2xN to determine, for example, the third coding units 1304, 1314, and 1324. That is, the video decoding device 100 may divide the second coding unit 1312 horizontally to determine the third coding unit 1304 having a size of N / 2xN / 2 or the third coding unit 1324 having a size of N / 2xN / 4, or may divide the second coding unit 1312 vertically and horizontally to determine the third coding unit 1314 having a size of N / 4xN / 2.

[0215] According to an embodiment, the video decoding device 100 may divide at least one of the width and height of the second coding unit 1322 having a size of NxN / 2 to determine, for example, the third coding units 1304, 1314, and 1324. That is, the video decoding device 100 may divide the second coding unit 1322 vertically to determine the third coding unit 1304 having a size of N / 2xN / 2 or the third coding unit 1314 having a size of N / 4xN / 2, or may divide the second coding unit 1322 vertically and horizontally to determine the third coding unit 1324 having a size of N / 2xN / 4.

[0216] According to an embodiment, the video decoding apparatus 100 may divide, for example, square coding units 1300, 1302, and 1304 horizontally or vertically. For example, the first coding unit 1300 having a size of 2Nx2N may be divided vertically to determine a first coding unit 1310 having a size of Nx2N, or may be divided horizontally to determine a first coding unit 1320 having a size of 2NxN. According to an embodiment, if the depth is determined based on the length of the longest side of the coding unit, the depth of the coding unit determined by dividing the first coding unit 1300 having a size of 2Nx2N horizontally or vertically may be the same as the depth of the first coding unit 1300.

[0217] According to one embodiment, the width and height of the third coding unit 1314 or 1324 corresponds to 1 / 4 times that of the first coding unit 1310 or 1320. If the depth of the first coding unit 1310 or 1320 is D, the depth of the second coding unit 1312 or 1322, which is 1 / 2 times the width and height of the first coding unit 1310 or 1320, is also D+1, and the depth of the third coding unit 1314 or 1324, which is 1 / 4 times the width and height of the first coding unit 1310 or 1320, is also D+2.

[0218] FIG. 14 illustrates a depth determined by the type and size of a coding unit and an index (PID: part index) for a coding unit partition, according to one embodiment.

[0219] According to an embodiment, the video decoding device 100 may determine various types of second coding units by dividing a square-shaped first coding unit 1400. Referring to Figure 14, the video decoding device 100 may determine various types of second coding units by dividing the first coding unit 1400 in at least one of a vertical direction and a horizontal direction according to the partition mode information. That is, the video decoding device 100 may determine various types of second coding units 1402a, 1402b, 1404a, 1404b, 1406a, 1406b, 1406c, and 1406d based on the partition mode information associated with the first coding unit 1400.

[0220] According to one embodiment, the depths of the second coding units 1402a, 1402b, 1404a, 1404b, 1406a, 1406b, 1406c, and 1406d determined by the partition mode information for the square-shaped first coding unit 1400 are also determined based on the long side lengths. For example, since the length of one side of the square-shaped first coding unit 1400 is the same as the long side lengths of the non-square-shaped second coding units 1402a, 1402b, 1404a, and 1404b, the depths of the first coding unit 1400 and the non-square-shaped second coding units 1402a, 1402b, 1404a, and 1404b can be considered to be the same as D. In contrast, when the video decoding device 100 divides the first coding unit 1400 into four square-shaped second coding units 1406a, 1406b, 1406c, and 1406d based on the division mode information, the length of one side of the square-shaped second coding units 1406a, 1406b, 1406c, and 1406d is half the length of one side of the first coding unit 1400, so the depth of the second coding units 1406a, 1406b, 1406c, and 1406d is also a depth of D+1, which is one depth lower than the depth D of the first coding unit 1400.

[0221] The video decoding apparatus 100 according to an embodiment may divide a first coding unit 1410 having a height greater than its width in the horizontal direction according to the division mode information, and divide the first coding unit 1410 into a plurality of second coding units 1412a, 1412b, 1414a, 1414b, and 1414c. The video decoding apparatus 100 according to an embodiment may divide a first coding unit 1420 having a width greater than its height in the vertical direction according to the division mode information, and divide the first coding unit 1420 into a plurality of second coding units 1422a, 1422b, 1424a, 1424b, and 1424c.

[0222] According to one embodiment, the depths of the second coding units 1412a, 1412b, 1414a, 1414b, 1414c, 1422a, 1422b, 1424a, 1424b, and 1424c determined by the partition mode information related to the non-square first coding unit 1410 or 1420 are also determined based on the long side length. For example, since the length of one side of the square second coding units 1412a and 1412b is half the length of one side of the non-square first coding unit 1410, whose height is greater than its width, the depths of the square second coding units 1412a and 1412b are D+1, which is one depth lower than the depth D of the non-square first coding unit 1410.

[0223] Furthermore, the video decoding device 100 may divide the non-square first coding unit 1410 into an odd number of second coding units 1414a, 1414b, and 1414c based on the division mode information. The odd number of second coding units 1414a, 1414b, and 1414c may include the non-square second coding units 1414a and 1414c and the square second coding unit 1414b. In this case, the length of the long sides of the non-square second coding units 1414a and 1414c and the length of one side of the square second coding unit 1414b are half the length of one side of the first coding unit 1410. Therefore, the depths of the second coding units 1414a, 1414b, and 1414c are also D+1, which is one depth lower than D, the depth of the first coding unit 1410. The video decoding device 100 can determine the depth of the coding unit for the non-square first coding unit 1420, whose width is greater than its height, in a manner corresponding to the above-mentioned manner for determining the depth of the coding unit for the first coding unit 1410.

[0224] In determining indexes (PIDs) for partitioning divided coding units, the video decoding apparatus 100 according to an embodiment may determine indexes based on the size ratio of the coding units when the odd number of divided coding units are not the same size. Referring to FIG. 14, among the odd number of divided coding units 1414a, 1414b, and 1414c, the middle coding unit 1414b has the same width as the other coding units 1414a and 1414c but is twice as high as the other coding units 1414a and 1414c. That is, in this case, the middle coding unit 1414b may include two of the other coding units 1414a and 1414c. Therefore, if the index (PID) of the middle coding unit 1414b in the scanning order is 1, the index of the next coding unit 1414c is 3, which is an increase of 2. That is, a discontinuity in the index values ​​occurs. According to one embodiment, the video decoding device 100 can determine whether coding units divided into an odd number of parts are not the same size based on whether there is an index discontinuity for the partition between such divided coding units.

[0225] According to an embodiment, the video decoding apparatus 100 may determine whether a current coding unit is divided into a specific division type based on the value of an index for distinguishing the plurality of coding units determined by dividing the current coding unit. Referring to FIG. 14, the video decoding apparatus 100 may divide a rectangular first coding unit 1410, whose height is greater than its width, to determine an even number of coding units 1412a and 1412b or an odd number of coding units 1414a, 1414b, and 1414c. The video decoding apparatus 100 may use an index (PID) indicating each coding unit to distinguish each of the plurality of coding units. According to an embodiment, the PID may also be obtained from a sample at a predetermined position (e.g., the top left sample) of each coding unit.

[0226] According to an embodiment, the video decoding apparatus 100 may determine a coding unit at a predetermined position among the coding units determined by division using an index for coding unit division. According to an embodiment, if partition mode information for a rectangular first coding unit 1410 whose height is greater than its width indicates that the first coding unit 1410 is to be divided into three coding units, the video decoding apparatus 100 may divide the first coding unit 1410 into three coding units 1414a, 1414b, and 1414c. The video decoding apparatus 100 may assign an index to each of the three coding units 1414a, 1414b, and 1414c. The video decoding apparatus 100 may compare the indexes associated with each coding unit to determine a middle coding unit among the odd number of coding units. Based on the indexes of the coding units, the video decoding apparatus 100 may determine the coding unit 1414b having an index corresponding to the middle value among the indexes as the middle coding unit among the coding units determined by dividing the first coding unit 1410. According to an embodiment, the video decoder 100 may determine indexes for partitioning the divided coding units based on the ratio of the sizes of the divided coding units when the coding units are not the same size. Referring to FIG. 14, a coding unit 1414b generated by dividing a first coding unit 1410 has the same width as other coding units 1414a and 1414c but is twice as high as the other coding units 1414a and 1414c, which have different heights. In this case, if the index (PID) of the middle coding unit 1414b is 1, the next coding unit 1414c has an index of 3, which is an increase of 2. In such a case, when the indexes increase uniformly but the increase widths are different, the video decoder 100 may determine that the coding unit has been divided into multiple coding units, including coding units having different sizes from the other coding units.According to one embodiment, when the partition mode information indicates that the current coding unit is to be partitioned into an odd number of coding units, the video decoding apparatus 100 may partition the current coding unit such that a coding unit at a predetermined position among the odd number of coding units (e.g., a middle coding unit) has a different size from the other coding units. In this case, the video decoding apparatus 100 may determine the middle coding unit having a different size using an index (PID) associated with the coding unit. However, the index and the size or position of the determined coding unit are specific for purposes of describing one embodiment and should not be construed as being limited thereto, and various indexes, positions, and sizes of coding units may be used.

[0227] The video decoding apparatus 100 according to an embodiment may use a predetermined data unit from which recursive division of a coding unit begins.

[0228] FIG. 15 illustrates a plurality of coding units determined from a plurality of predetermined data units included in a picture according to one embodiment.

[0229] According to one embodiment, the predetermined data unit is also defined as a data unit from which a coding unit begins to be recursively divided using division mode information. That is, it corresponds to a coding unit of the highest depth used in the process of determining a plurality of coding units into which a current picture is divided. Hereinafter, for convenience of explanation, such a predetermined data unit will be referred to as a reference data unit.

[0230] According to one embodiment, the reference data unit may have a predetermined size and shape. According to one embodiment, the reference coding unit may include MxN samples, where M and N may be the same or may be integers expressed as a power of 2. That is, the reference data unit may have a square or non-square shape and may then be divided into an integer number of coding units.

[0231] The video decoding apparatus 100 according to an embodiment may divide a current picture into a plurality of reference data units. The video decoding apparatus 100 according to an embodiment may divide the current picture into a plurality of reference data units using partition mode information associated with each reference data unit. The division process of the reference data units corresponds to a division process using a quad-tree structure.

[0232] According to an embodiment, the video decoding apparatus 100 may determine in advance a minimum size that a reference data unit included in a current picture may have, and may determine reference data units of various sizes that are equal to or larger than the minimum size, and may determine at least one coding unit based on the determined reference data unit using partition mode information.

[0233] 15, the video decoding apparatus 100 may use a square-shaped reference coding unit 1500 or a non-square-shaped reference coding unit 1502. According to an embodiment, the shape and size of the reference coding unit may also be determined based on various data units (e.g., a sequence, a picture, a slice, a slice segment, a maximum coding unit, etc.) that include at least one reference coding unit.

[0234] A receiving unit (not shown) of the video decoding apparatus 100 according to an embodiment may acquire at least one of information regarding the type of the reference coding unit and information regarding the size of the reference coding unit from the bitstream for each of the various data units. The process of determining at least one coding unit included in the square-shaped reference coding unit 1500 has been described through the process of dividing the current coding unit 300 in FIG. 3, and the process of determining at least one coding unit included in the non-square-shaped reference coding unit 1502 has been described through the process of dividing the current coding unit 400 or 450 in FIG. 4, so detailed descriptions thereof will be omitted.

[0235] The video decoding apparatus 100 according to an embodiment may use an index for identifying the size and type of a reference coding unit to determine the size and type of the reference coding unit according to a predetermined data unit determined in advance based on a predetermined condition. That is, a receiving unit (not shown) may acquire only an index for identifying the size and type of the reference coding unit for each data unit, such as a slice, a slice segment, or a maximum coding unit, that satisfies a predetermined condition (e.g., a data unit having a size equal to or smaller than a slice) among various data units (e.g., a sequence, a picture, a slice, a slice segment, a maximum coding unit, etc.) from a bitstream. The video decoding apparatus 100 may determine the size and type of the reference data unit for each data unit that satisfies the predetermined condition by using the index. If information regarding the type of the reference coding unit and information regarding the size of the reference coding unit were acquired from the bitstream for each data unit of a relatively small size, the bitstream utilization efficiency would be poor. Therefore, instead of directly acquiring information regarding the type of the reference coding unit and information regarding the size of the reference coding unit, only the index may be acquired and used. In this case, at least one of the size and type of the reference coding unit corresponding to the index indicating the size and type of the reference coding unit is predetermined. That is, the video decoding apparatus 100 may determine at least one of the size and type of the reference coding unit included in the data unit serving as a reference for index acquisition by selecting at least one of the size and type of the predetermined reference coding unit according to the index.

[0236] According to an embodiment, the video decoding apparatus 100 may use at least one reference coding unit included in one maximum coding unit. That is, the maximum coding unit for dividing a video includes at least one reference coding unit, and coding units may be determined through a recursive division process of each reference coding unit. According to an embodiment, at least one of the width and height of the maximum coding unit is an integer multiple of at least one of the width and height of the reference coding unit. According to an embodiment, the size of the reference coding unit is also the size obtained by dividing the maximum coding unit n times using a quadtree structure. That is, the video decoding apparatus 100 may determine the reference coding unit by dividing the maximum coding unit n times using a quadtree structure, and according to various embodiments, may divide the reference coding unit based on at least one of block shape information and partition shape mode information.

[0237] FIG. 16 illustrates processing blocks that are responsible for determining the order in which reference coding units included in a picture 1600 are determined, according to one embodiment.

[0238] The video decoding apparatus 100 according to an embodiment may determine at least one processing block for dividing a picture. The processing block is a data unit including at least one reference coding unit for dividing a picture, and the at least one reference coding unit included in the processing block may be determined in a specific order. That is, the determination order of the at least one reference coding unit determined in each processing block may correspond to one of various orders in which the reference coding units may be determined, and the determination order of the reference coding units determined in each processing block may differ for each processing block. The determination order of the reference coding units determined for each processing block may be one of various orders such as raster scan, z-scan, N-scan, up-right diagonal scan, horizontal scan, and vertical scan, but the possible orders should not be construed as being limited to the above scan orders.

[0239] According to an embodiment, the video decoding device 100 may acquire information related to processing block sizes and determine the size of at least one processing block included in a video. The video decoding device 100 may acquire information related to processing block sizes from a bitstream and determine the size of at least one processing block included in a video. Such a processing block size is also a predetermined size of a data unit indicated by the information related to the processing block size.

[0240] A receiving unit (not shown) of the video decoding device 100 according to an embodiment may acquire information related to a processing block size for each specific data unit from a bitstream. For example, the information related to the processing block size may be acquired from the bitstream for each data unit, such as an image, a sequence, a picture, a slice, or a slice segment. That is, the receiving unit (not shown) may acquire information related to the processing block size from the bitstream for each of the multiple data units, and the video decoding device 100 may determine at least one processing block size for dividing a picture using the acquired information related to the processing block size, where the processing block size may be an integer multiple of the base coding unit.

[0241] According to an embodiment, the video decoding device 100 may determine the size of processing blocks 1602 and 1612 included in a picture 1600. For example, the video decoding device 100 may determine the processing block size based on information related to the processing block size acquired from a bitstream. Referring to FIG. 16, according to an embodiment, the video decoding device 100 may determine the width of the processing blocks 1602 and 1612 to be four times the width of a reference coding unit and the height of the processing blocks 1602 and 1612 to be four times the height of the reference coding unit. The video decoding device 100 may determine an order in which at least one reference coding unit is determined within at least one processing block.

[0242] According to one embodiment, the video decoding device 100 may determine each of the processing blocks 1602 and 1612 included in the picture 1600 based on the processing block size, and may determine a determination order of at least one reference coding unit included in the processing blocks 1602 and 1612. According to one embodiment, determining the reference coding unit may include determining the reference coding unit size.

[0243] According to an embodiment, the video decoding apparatus 100 may acquire information regarding a determination order of at least one reference coding unit included in at least one processing block from a bitstream and determine an order in which at least one reference coding unit is determined based on the acquired information regarding the determination order. The information regarding the determination order may also be defined as an order or direction in which the reference coding units are determined within a processing block. That is, the order in which the reference coding units are determined may be determined independently for each processing block.

[0244] The video decoding apparatus 100 according to an embodiment may acquire information regarding a determination order of reference coding units for each specific data unit from a bitstream. For example, a receiving unit (not shown) may acquire information regarding a determination order of reference coding units from a bitstream for each data unit path, such as an image, a sequence, a picture, a slice, a slice segment, a processing block, etc. Since the information regarding the determination order of reference coding units indicates a determination order of reference coding units within a processing block, the information regarding the determination order may also be acquired for each specific data unit including an integer number of processing blocks.

[0245] The video decoding apparatus 100 may determine at least one reference coding unit based on the order determined according to an embodiment.

[0246] According to an embodiment, a receiving unit (not shown) may acquire information related to a base coding unit determination order as information related to processing blocks 1602 and 1612 from a bitstream, and the video decoding apparatus 100 may determine an order for determining at least one base coding unit included in the processing blocks 1602 and 1612 and determine at least one base coding unit included in the picture 1600 according to the determined coding unit order. Referring to Figure 16, the video decoding apparatus 100 may determine a determination order (1604, 1614) of at least one base coding unit associated with each of the processing blocks 1602 and 1612. For example, if information related to the determination order of base coding units is acquired for each processing block, the determination order of base coding units for each of the processing blocks 1602 and 1612 may differ for each processing block. If the reference coding unit determination order 1604 for a processing block 1602 is the raster scan order, the reference coding units included in the processing block 1602 are also determined by the raster scan order. On the other hand, if the reference coding unit determination order (1614) for another processing block 1612 is the reverse of the raster scan order, the reference coding units included in the processing block 1612 are also determined by the reverse of the raster scan order.

[0247] The video decoding apparatus 100 may decode at least one reference coding unit determined according to an embodiment. The video decoding apparatus 100 may decode video based on the reference coding unit determined according to the above embodiment. The method of decoding the reference coding unit may include various methods of decoding video.

[0248] According to an embodiment, the video decoding apparatus 100 may acquire and use block type information indicating the type of a current coding unit or partition type mode information indicating a method of partitioning the current coding unit from a bitstream. Partition type mode information may also be included in bitstreams related to various data units. For example, the video decoding apparatus 100 may use partition type mode information included in a sequence parameter set, a picture parameter set, a video parameter set, a slice header, or a slice segment header. Furthermore, the video decoding apparatus 100 may acquire and use syntax elements corresponding to block type information or partition type mode information from the bitstream for each largest coding unit, base coding unit, or processing block.

[0249] A method for determining a division rule according to an embodiment of the present disclosure will now be described in detail.

[0250] The video decoding device 100 may determine a video partitioning rule. The partitioning rule may be predetermined between the video decoding device 100 and the video encoding device 150. The video decoding device 100 may determine the video partitioning rule based on information acquired from a bitstream. The video decoding device 100 may determine the partitioning rule based on information acquired from at least one of a sequence parameter set, a picture parameter set, a video parameter set, a slice header, and a slice segment header. The video decoding device 100 may determine the partitioning rule differently depending on the frame, slice, temporal layer, maximum coding unit, or coding unit.

[0251] The video decoding device 100 may determine a partitioning rule based on the block type of the coding unit. The block type may include the size, shape, width and height ratio, and direction of the coding unit. The video encoding device 150 and the video decoding device 100 may predetermine to determine the partitioning rule based on the block type of the coding unit. However, the present invention is not limited to this. The video decoding device 100 may determine the partitioning rule based on information obtained from a bitstream received from the video encoding device 150.

[0252] The shape of the coding unit may include square and non-square. If the width and height of the coding unit are the same, the video decoding apparatus 100 may determine the shape of the coding unit as square. If the width and height of the coding unit are not the same, the video decoding apparatus 100 may determine the shape of the coding unit as non-square.

[0253] The size of the coding unit may include various sizes such as 4x4, 8x4, 4x8, 8x8, 16x4, 16x8, ..., 256x256. The size of the coding unit may also be classified according to the long side length, short side length, or width of the coding unit. The video decoding device 100 may apply the same partitioning rule to coding units classified into the same group. For example, the video decoding device 100 may classify coding units having the same long side length as the same size. The video decoding device 100 may also apply the same partitioning rule to coding units having the same long side length.

[0254] The width-to-height ratio of a coding unit may include 1:2, 2:1, 1:4, 4:1, 1:8, 8:1, 1:16, or 16:1. The direction of a coding unit may include horizontal and vertical directions. The horizontal direction indicates that the length of the coding unit is greater than the height of the coding unit. The vertical direction indicates that the length of the coding unit is smaller than the height of the coding unit.

[0255] The video decoding device 100 may adaptively determine a partitioning rule based on the size of the coding unit. The video decoding device 100 may differently determine an allowable partitioning mode based on the size of the coding unit. For example, the video decoding device 100 may determine whether partitioning is allowed based on the size of the coding unit. The video decoding device 100 may determine a partitioning direction based on the size of the coding unit. The video decoding device 100 may determine an allowable partitioning type based on the size of the coding unit.

[0256] Determining the partitioning rule based on the size of the coding unit is also a default partitioning rule between the video encoding device 150 and the video decoding device 100. In addition, the video decoding device 100 can determine the partitioning rule based on information obtained from the bitstream.

[0257] The video decoding device 100 can adaptively determine the division rule based on the position of the coding unit. The video decoding device 100 can adaptively determine the division rule based on the position of the coding unit in the video.

[0258] In addition, the video decoding apparatus 100 may determine a division rule so that coding units generated in different division paths do not have the same block type. However, the division rule is not limited thereto, and coding units generated in different division paths may have the same block type. The coding units generated in different division paths may have different decoding processing orders. The decoding processing order has been described with reference to FIG. 12, so a detailed description thereof will be omitted.

[0259] Hereinafter, with reference to Figures 17 to 29, a video encoding / decoding method and apparatus therefor will be described in detail, which determine filtering reference samples to be applied to a filter and filter weights, and perform adaptive intra prediction based on the filtering reference samples and filter weights.

[0260] FIG. 17 is a diagram illustrating an intra prediction mode according to an embodiment.

[0261] 17, according to an embodiment, intra prediction modes may include a planar mode (0-times mode) and a DC mode (1-times mode). The intra prediction modes may also include an angular mode (2-times mode to 66-times mode) having a prediction direction. The angular modes may also include a diagonal mode (2-times mode or 66-times mode), a horizontal mode (18-times mode), and a vertical mode (50-times mode).

[0262] Although the intra prediction modes according to one embodiment have been described above with reference to Figure 17, the present invention is not limited thereto, and various types of intra prediction modes can be provided by adding new intra prediction modes or removing existing intra prediction modes, and it will be readily understood by those skilled in the art that the mode number of each intra prediction mode may differ depending on the case.

[0263] FIG. 18 is a diagram illustrating a method in which a video decoding apparatus generates reconstructed samples using original reference samples according to an embodiment of the present disclosure.

[0264] Referring to FIG. 18, the video decoding apparatus 100 may generate reconstructed samples 1820 using original reference samples 1810 to perform intra prediction on a current block 1800 .

[0265] For example, the video decoding apparatus 100 may use an original reference sample 1830 to generate a reconstructed reference sample 1835 corresponding to the position of the original reference sample. The video decoding apparatus 100 may use an original reference sample 1830 and an original reference sample 1840 to generate a reconstructed reference sample 1845 corresponding to the position of the original reference sample 1840. The video decoding apparatus 100 may similarly generate a reconstructed reference sample 1855 at a position corresponding to the original reference sample 1850. In this case, the video decoding apparatus 100 may generate a reconstructed reference sample 1855 at a position corresponding to the original reference sample 1850 using the original reference sample 1850 and an original reference sample located to the left of the reference sample 1850 in the original reference sample 1810. That is, the video decoding apparatus 100 calculates a reconstructed reference sample a' based on the following Equation (1). n can be generated.

[0266]

number

[0267] The reconstructed reference sample may also be generated by filtering at least one original reference sample, as described above.

[0268] Although an example of generating a reconstructed reference sample has been described with reference to Figure 18, the present invention is not limited thereto, and the reconstructed reference sample may also be generated by filtering using a filter with the same weights and number of filter taps. For example, the reconstructed reference sample may also be generated by filtering using a [1,4] filter.

[0269] Alternatively, the video decoding apparatus 100 may adaptively determine filter weights and the number of filter taps according to the position of the original reference sample or the intra prediction mode of the current block, and generate a reconstructed reference sample by performing filtering based on the filter weights and the number of filter taps. Alternatively, the reconstructed reference sample may be generated by adaptively determining filter weights and the number of filter taps according to the size of the current block, and performing filtering based on the filter weights and the number of filter taps.

[0270] 19A and 19B are diagrams illustrating a method in which a video decoding device 100 generates a reconstructed sample using an original reference sample according to the prediction direction of the intra prediction mode of a current block, according to one embodiment of the present disclosure.

[0271] 19A and 19B, when the direction of the intra prediction mode of the current block is the prediction direction (1905), the video decoding device 100 may determine, based on the x-axis direction (1930) of the prediction direction (1905), an original reference sample 1925 of an upper adjacent line, on which filtering is performed to generate a reconstructed reference sample 1920 of the upper adjacent line. For example, when the direction of the intra prediction mode of the current block is the prediction direction (1905), the video decoding device 100 may generate a reconstructed sample a'j according to Equation (2) below.

[0272]

number

[0273] When the direction of the intra prediction mode of the current block is the prediction direction (1910), the video decoding device 100 may determine, based on the x-axis direction (1935) of the prediction direction (1910), an original reference sample 1925 of the upper adjacent line, which is filtered to generate a reconstructed reference sample 1920 of the upper adjacent line. When the direction of the intra prediction mode of the current block is the prediction direction (1910), the video decoding device 100 may determine, based on the x-axis direction (1935) of the prediction direction (1910), a reconstructed sample a' according to Equation (3) below. j can be generated.

[0274]

number

[0275] When the direction of the intra prediction mode of the current block is the prediction direction (1915), the video decoding device 100 may determine the original reference sample 1925 of the upper adjacent line, on which filtering is performed to generate the reconstructed reference sample 1920 of the upper adjacent line, based on the x-axis direction (1935) of the prediction direction (1915). When the direction of the intra prediction mode of the current block is the prediction direction (1915), the video decoding device 100 may determine the reconstructed sample a' according to Equation (4) below. j can be generated.

[0276]

number

[0277] The video decoding apparatus 100 may generate reconstructed reference samples for the left adjacent line in a manner similar to that for generating reconstructed reference samples for the upper adjacent line.

[0278] When the direction of the intra prediction mode of the current block is the prediction direction (1905), the video decoding device 100 can determine the original reference sample 1945 of the left adjacent line that is filtered to generate the reconstructed reference sample 1940 of the left adjacent line based on the y-axis direction (1950) of the prediction direction (1905).

[0279] When the direction of the intra prediction mode of the current block is the prediction direction (1910), the video decoding device 100 can determine the original reference sample 1945 of the left adjacent line that is filtered to generate the reconstructed reference sample 1940 of the left adjacent line based on the y-axis direction (1950) of the prediction direction (1910).

[0280] When the direction of the intra prediction mode of the current block is the prediction direction (1915), the video decoding device 100 can determine the original reference sample 1945 of the left adjacent line that is filtered to generate the reconstructed reference sample 1940 of the left adjacent line based on the y-axis direction (1955) of the prediction direction (1915).

[0281] FIG. 20 is a diagram illustrating a method in which a video decoding apparatus generates reconstructed samples using original reference samples according to an embodiment of the present disclosure.

[0282] Referring to FIG. 20, the video decoding apparatus 100 uses original reference samples a0, . . . , a1 to perform intra prediction on a current block 2000. N The reconstructed samples a'0, ..., a' are N can be generated.

[0283] When the prediction direction of the intra prediction mode of the current block 2000 is from left to right (i.e., the prediction direction is a direction corresponding to the first quadrant in FIG. 19A ), the video decoding apparatus 100 may generate a reconstructed reference sample 2015 corresponding to the position of the original reference sample 2010 using the original reference sample 2010. The video decoding apparatus 100 may generate a reconstructed reference sample 2025 corresponding to the position of the original reference sample 2020 using the original reference sample 2010 and the original reference sample 2020. The video decoding apparatus 100 may generate a reconstructed reference sample 2035 at a position corresponding to the original reference sample 2030 in a similar manner. In this case, the reconstructed reference sample 2035 may be generated using the original reference sample 2030 and the original reference sample 2031 immediately adjacent to the left of the original reference samples. That is, the video decoding apparatus 100 may generate a reconstructed reference sample a′j based on the following Equation 5.

[0284]

number

[0285] When the prediction direction of the intra prediction mode of the current block 2000 is from right to left (i.e., the prediction direction is in the second or third quadrant in FIG. 19A ), the video decoding device 100 may use the original reference sample 2040 to generate a reconstructed reference sample 2045 corresponding to the position of the original reference sample. The video decoding device 100 may use the original reference sample 2040 and the original reference sample 2050 to generate a reconstructed reference sample 2055 corresponding to the position of the original reference sample 2050. The video decoding device 100 may similarly generate a reconstructed reference sample 2035 at a position corresponding to the original reference sample 2030. In this case, the video decoding device 100 may generate a reconstructed reference sample 2035 using the original reference sample 2030 and the original reference sample 2032 immediately adjacent to the right of the original reference sample. That is, the video decoding device 100 calculates a reconstructed reference sample a′ using the following Equation 6: j can be generated.

[0286]

number

[0287] The video decoding apparatus 100 may generate a reconstructed reference sample for a left adjacent line in a manner similar to that of generating a reconstructed reference sample for an upper adjacent line. When the y-axis direction of the prediction direction of the intra prediction mode of the current block is from bottom to top (i.e., the prediction direction is a direction corresponding to the first or second quadrant in FIG. 19A ), the video decoding apparatus 100 may generate a reconstructed reference sample for a left adjacent line in a manner similar to that of generating a reconstructed reference sample for an upper adjacent line when the x-axis direction is from right to left.

[0288] The video decoding apparatus 100 may generate a reconstructed reference sample for a left adjacent line in a manner similar to that of generating a reconstructed reference sample for an upper adjacent line. When the y-axis direction of the prediction direction of the intra prediction mode of the current block is from top to bottom (i.e., the prediction direction is a direction corresponding to the third quadrant in FIG. 19A ), the video decoding apparatus 100 may generate a reconstructed reference sample for a left adjacent line in a manner similar to that of generating a reconstructed reference sample for an upper adjacent line when the x-axis direction is from left to right.

[0289] When the video decoding device 100 is in a DC mode with no directionality, a planar mode, a vertical mode having only vertical components, or a horizontal mode having horizontal components, the video decoding device 100 calculates a reconstructed reference sample a′ of the left or upper adjacent line based on Equation 7 as follows: j can be generated.

[0290]

number

[0291] The video decoding device 100 performs filtering on the original reference samples to generate reconstructed samples, and then performs intra prediction on the current block using the reconstructed samples, thereby achieving the effect of performing intra prediction by referring to a wider variety of reference samples than when performing intra prediction using the original reference samples.

[0292] FIG. 21 is a diagram illustrating a process in which a video decoding apparatus according to an embodiment of the present disclosure performs intra prediction on a current block using original reference samples and reconstructed samples.

[0293] The video decoding apparatus 100 may generate a predicted value of a current sample in a current block using an original reference sample and a reconstructed reference sample. For example, when the intra prediction mode of the current block 2100 is a vertical mode, the video decoding apparatus 100 may generate a predicted value of the current sample 2110 using an original reference sample 2121 and a reconstructed reference sample 2131 located above the current sample 2110. For example, the video decoding apparatus 100 may generate a predicted value p of the current sample based on Equation (8). n can be generated.

[0294]

number

[0295] As described above, the video decoding device 100 calculates the predicted value p of the current sample based on Equation (8). n However, the present invention is not limited to this. The video decoding device 100 may generate a final predicted value p' of the current sample by performing intra prediction using the original reference samples to generate an initial predicted value, and performing filtering using the initial predicted value and the reconstructed reference samples, as in the prior art. n can generate a value of

[0296] Although the video decoding apparatus 100 has been described as performing intra prediction for the current block using both original reference samples and reconstructed reference samples with reference to Figure 21, the present invention is not limited thereto and may perform intra prediction for the current block using only original reference samples, or may perform intra prediction for the current block using only reconstructed samples.

[0297] 21, it has been described that the first intra prediction mode of the current block for determining an original reference sample to be used for intra prediction among original reference samples and the second intra prediction mode for determining a reconstructed reference sample to be used for intra prediction among reconstructed reference samples are the same, but this is not limited thereto, and the second intra prediction mode may be determined separately from the first intra prediction mode. For example, the intra prediction mode for the reconstructed reference sample may be determined for each block or for the intra prediction mode of the current block for determining an original reference sample to be used for intra prediction among original reference samples. Alternatively, the second intra prediction mode may be determined on a picture-by-picture basis.

[0298] FIG. 22 is a diagram illustrating a process in which a video decoding apparatus performs weighted prediction using original reference samples and reconstructed reference samples of left and upper adjacent lines.

[0299] The video decoding device 100 determines an original reference sample to be used for intra prediction among the original reference prediction samples based on the intra prediction mode of the current block 2200, determines a reconstructed sample of the left adjacent line and a reconstructed sample of the upper adjacent line of the current block 2200 to be used for intra prediction regardless of the intra prediction mode of the current block 2200, and performs weighted prediction on the current sample 2210 using the original reference sample and the reconstructed reference sample to generate a predicted value related to the current sample 2210.

[0300] For example, referring to FIG. 22, when the intra prediction mode of the current block is the vertical mode, the video decoding apparatus 100 selects an original reference sample a2220 of the upper adjacent line, which is located vertically from the current sample 2210. j The video decoding device 100 determines the reconstructed reference sample a′ located vertically relative to the current sample 2210. jIn addition, the video decoding apparatus 100 determines a reconstructed reference sample b′ located horizontally of the current sample 2210. i The video decoding device 100 can determine the original reference sample a j , and the reconstructed reference sample a' j , b' i That is, the video decoding apparatus 100 can generate a predicted value p of the current sample 2210 based on the following Equation 9. ij can be generated.

[0301]

number

[0302] 22, the video decoding apparatus 100 has been described as performing weighted prediction using an original reference sample, a reconstructed reference sample of a line horizontally adjacent to the current sample to the left, and a reconstructed reference sample of a line vertically adjacent to the current sample above, but the present invention is not limited thereto and may determine a prediction direction for selecting a reference sample reconstructed for the current sample in consideration of a gradient change of the reference sample. That is, the video decoding apparatus 100 may determine a gradient direction of a reference sample having the same change tendency as the gradient value of the reference sample as a prediction direction for selecting a reference sample reconstructed for the current sample.

[0303] Figure 23 is a diagram illustrating a process in which a video decoding device performs weighted prediction using a predicted value generated by performing intra prediction using original reference samples and reconstructed reference samples of the left adjacent line and the upper adjacent line.

[0304] The video decoding apparatus 100 may generate an intermediate predicted value for a current sample in the current block by performing intra prediction based on original reference prediction samples, based on the intra prediction mode of the current block 2300. The video decoding apparatus 100 may determine at least one reference sample from among the reconstructed reference samples of the left adjacent line and at least one reference sample from among the reconstructed reference samples of the upper adjacent line, regardless of the intra prediction mode of the current block 2300. The video decoding apparatus 100 may generate a final predicted value for the current sample in the current block 2300 using the intermediate predicted value for the current sample in the current block 2300, the reconstructed reference sample of the left adjacent line, and the reconstructed reference sample of the upper adjacent line.

[0305] The video decoding device 100 calculates the final predicted value p' of the current sample in the current block based on Equation (10). ij can be generated.

[0306]

number

[0307] For example, referring to FIG. 23, the video decoding device i '[i,j]2310, Ca' j [i,j]2320 and Cp ij [i,j] 2330 to generate a final predicted value of the current sample in the current block 2300. However, those skilled in the art will readily understand that the filter coefficients disclosed in Figure 23 may be unnormalized coefficients, or, in fact, when the video decoding device 100 uses the filter coefficients disclosed in Figure 23, coefficients generated by performing normalization (i.e., performing an operation corresponding to dividing the filter coefficients by 16) may be ultimately used.

[0308] That is, the video decoding device 100 calculates the final predicted value p' of the current sample based on the following Equation (11): ij can be determined.

[0309]

number

[0310] Meanwhile, with reference to FIG. 23, the process of video decoding device 100 performing weighted prediction using a predicted value generated by performing intra prediction using an original reference sample, a reconstructed sample of a line horizontally adjacent to the current sample to the left, and a reconstructed reference sample of a line vertically adjacent to the current sample above has been described. However, the present invention is not limited to this, and those skilled in the art will easily understand that weighted prediction can be performed using an original reference sample of a line horizontally adjacent to the current sample to the left, and an original reference sample of a line vertically adjacent to the current sample above, instead of the reconstructed reference sample.

[0311] FIG. 24 is a diagram illustrating a process in which a video decoding apparatus performs position-based intra prediction on a current sample when the intra prediction mode of a current block is one of a DC mode, a planar mode, and a vertical mode.

[0312] 24, the video decoding apparatus 100 calculates an intermediate predicted value P(x,y) of a current sample 2405 in a current block 2400, a sample value R of a left-side adjacent reference sample 2415 of the current sample 2405, and -1,y , the sample value R of the upper left adjacent reference sample 2420 of the current block -1,-1 , and the sample value R of the upper adjacent reference sample 2410 of the current sample 2405 x,-1 can be used to determine the final predicted value P'(x,y) for the current sample 2405.

[0313] In this case, the video decoding apparatus 100 may determine the intermediate predicted sample value P(x, y) of the current sample 2405 based on the intra prediction according to the intra prediction mode of the current block.

[0314] For example, the video decoding apparatus 100 may determine the final predicted sample value P′(x, y) of the current sample based on Equation 12 below.

[0315]

number

[0316]

number

[0317] FIG. 25 is a diagram illustrating a process in which a video decoding apparatus performs position-based intra prediction on a current sample when the intra prediction mode of a current block is a diagonal mode in the bottom-left direction.

[0318] Referring to FIG. 25, the video decoding device 100 can generate a predicted value P(x',y') of the current sample 2505 using the intermediate predicted value P(x',y') of the current sample 2505, the sample value R(-1,y) of the sample 2510 located on the line extending diagonally from the current sample 2505 to the lower left, and the sample value R(x,-1) of the sample 2515 located on the line opposite the line extending diagonally from the current sample 2505 to the lower left.

[0319] In this case, the video decoding apparatus 100 may determine the intermediate predicted sample value P(x', y') of the current sample 2505 based on the intra prediction according to the conventional intra prediction mode (bottom-left diagonal mode) of the current block. The bottom-left diagonal mode is also a two-time mode.

[0320] For example, the video decoding apparatus 100 may determine the final predicted sample value P'(x', y') of the current sample based on Equations (14) and (15) below.

[0321]

number

[0322]

number

[0323] Referring to FIG. 26, the video decoding device 100 can generate a predicted value P'(x',y') of the current sample 2605 using the intermediate predicted value P(x',y') of the current sample 2605, the sample value R(x,-1) of the sample 2610 located on the line extending diagonally from the current sample 2605 to the upper right, and the sample value R(-1,y) of the sample 2615 located in the opposite direction of the line extending diagonally from the current sample 2605 to the upper right.

[0324] In this case, the video decoding device 100 may determine the intermediate predicted sample value P(x', y') of the current sample 2605 based on the intra prediction according to the intra prediction mode (diagonal mode from the upper right corner) of the current block. The diagonal mode from the upper right corner is also a 66-fold mode.

[0325] For example, the video decoding apparatus 100 may determine the final predicted sample value P'(x', y') of the current sample based on the following Equations (16) and (17).

[0326]

number

[0327]

number

[0328] 27, the video decoding apparatus 100 may generate a prediction value of a current sample 2705 in a current block 2700 using an intermediate prediction value P(x',y') of the current sample 2705 and a sample value R(x,-1) of a sample 2710 located in the opposite direction of a line extending from the current sample 2705 in a lower left direction according to the angular mode. The angular mode adjacent to the diagonal mode in the lower left direction may be one of 3-fold to 10-fold modes.

[0329] In this case, the video decoding apparatus 100 may determine the intermediate predicted sample value P(x', y') of the current sample 2705 based on the intra prediction according to the conventional intra prediction mode (angular mode in the lower left direction) of the current block.

[0330] For example, the video decoding apparatus 100 may determine the final predicted sample value P'(x', y') of the current sample based on the following Equations (18) and (19).

[0331]

number

[0332]

number

[0333] FIG. 28 is a diagram illustrating a process in which a video decoding apparatus performs position-based intra prediction of a current sample when the intra prediction mode of a current block is an angular mode adjacent to a diagonal mode in the upper right direction.

[0334] 28, the video decoding apparatus 100 may generate a prediction value of the current sample 2805 by using an intermediate prediction value P(x',y') of the current sample 2805 and a sample value R(-1,y) of a sample 2810 located in the opposite direction of the line extending from the current sample 2805 toward the upper right corner according to the angular mode. The angular mode adjacent to the diagonal mode toward the upper right corner is also one of the 58th to 65th modes.

[0335] In this case, the video decoding apparatus 100 may determine the intermediate predicted sample value P(x', y') of the current sample 2805 based on the intra prediction according to the intra prediction mode (angular mode in the upper right direction) of the current block.

[0336] For example, the video decoding apparatus 100 may determine the final predicted sample value P'(x', y') of the current sample based on the following Equations (20) and (21).

[0337]

number

[0338]

number

[0339] 17 to 28, a method and apparatus for determining filtered reference samples and filter weights to be applied with a filter, and performing adaptive intra prediction based on the filtered reference samples and filter weights, assuming that the current block is square, have been described. However, those skilled in the art will easily understand that the video decoding apparatus 100 can similarly determine filtered reference samples and filter weights to be applied with a filter, and perform adaptive intra prediction based on the filtered reference samples and filter weights, even when the current block is rectangular. In this case, if the current block is a rectangle with a size of WxH (W is width and H is height), the number of samples in the upper adjacent reference line of the current block may be 2W, and the number of samples in the left adjacent reference line may be 2H. However, the present invention is not limited thereto, and if the current block is a rectangle with a size of WxH (W is width and H is height), the number of reference samples in the upper adjacent reference line of the current block may be W+H, and the number of reference samples in the left adjacent reference line may be W+H.

[0340] Figure 29 is a diagram to explain that, according to one embodiment of the present disclosure, the encoding / decoding order between coding units is determined to be forward or backward based on the encoding order flag, and the reference line on the right or upper side can be used for intra prediction depending on the determined encoding / decoding order.

[0341] 29, a maximum coding unit 2950 is divided into a plurality of coding units 2956, 2958, 2960, 2962, 2968, 2970, 2972, 2974, 2980, 2982, 2984, and 2986. The maximum coding unit 2950 corresponds to a top node 2900 of the tree structure. The plurality of coding units 2956, 2958, 2960, 2962, 2968, 2970, 2972, 2974, 2980, 2982, 2984, and 2986 correspond to a plurality of nodes 2906, 2908, 2910, 2912, 2918, 2920, 2922, 2924, 2930, 2932, 2934, and 2936, respectively. In the tree structure, top coding order flags 2902, 2914, and 2926 indicating the coding order correspond to the arrows (2952, 2964, and 2976), and top coding order flags 2904, 2916, and 2928 correspond to the arrows (2954, 2966, and 2978).

[0342] The top coding order flag indicates the coding order of the top two coding units among four coding units of the same depth. If the top coding order flag is 0, coding is performed in the forward direction. Conversely, if the top coding order flag is 1, coding is performed in the reverse direction.

[0343] Similarly, the bottom coding order flag indicates the coding order of the two coding units located at the bottom among four coding units of the same depth. If the bottom coding order flag is 0, coding is performed in the forward direction. Conversely, if the coding order flag is 1, coding is performed in the reverse direction.

[0344] For example, because the top edge coding order flag 2914 is 0, the coding order between coding units 2968 and 2970 is determined in the forward direction, from left to right. And because the bottom edge coding order flag 2916 is 1, the coding order between coding units 2972 ​​and 2974 is determined in the reverse direction, from right to left.

[0345] According to one embodiment, the top edge encoding order flag and the bottom edge encoding order flag are also set to have the same value. For example, if the top edge encoding order flag 2902 is set to 1, the bottom edge encoding order flag 2904 corresponding to the top edge encoding order flag 2902 may also be set to 1. Since the values ​​of the top edge encoding order flag and the bottom edge encoding order flag are determined in one bit, the amount of information in the encoding order information is reduced.

[0346] According to one embodiment, the top and bottom coding order flags of a current coding unit are determined by referring to at least one of the top and bottom coding order flags applied to coding units that are lower in depth than the current coding unit. For example, the top and bottom coding order flags 2926 and 2928 applied to coding units 2980, 2982, 2984, and 2986 are determined based on the bottom coding order flag 2916 applied to coding units 2972 ​​and 2974. Therefore, the top and bottom coding order flags 2926 and 2928 may be determined to have the same value as the coding order flag 2916. Because the values ​​of the top and bottom coding order flags are determined from coding units higher than the current coding unit, coding order information is not acquired from the bitstream. This reduces the amount of coding order information.

[0347] At this time, since the video decoding device 100 has access to the data of samples included in the right adjacent coding unit 2958 that was decoded before the current coding unit 2986 and the data of samples included in the upper adjacent coding units 2980 and 2982, it can perform prediction according to an embodiment of the present disclosure using the data of samples included in the right adjacent coding unit 2958 (right reference line) and the data of samples included in the upper adjacent coding units 2980 and 2982 (upper reference line).

[0348] That is, with reference to Figures 17 to 28, a method and apparatus for determining a filtering reference sample and a filter weight to be applied to a filter, and adaptively performing intra prediction based on the filtering reference sample and the filter weight have been described. The description has been made assuming that encoding / decoding is performed according to the encoding / decoding order related to conventional coding units, and performing intra prediction based on an original reference sample adjacent to the upper or left corner of a current block. However, the present invention is not limited to this. It will be easily understood by those skilled in the art that, when the encoding / decoding order between some adjacent coding units is reversed, as in Figure 29, intra prediction can be performed based on an original reference sample adjacent to the upper or right corner of a current block.

[0349] According to various embodiments of the present disclosure, information on reference samples that has not been used in conventional intra prediction is used, thereby improving prediction accuracy. In the process of reconstructing original reference samples, a reference smoothing effect is applied to the reconstructed reference samples, thereby improving prediction accuracy. Furthermore, since various prediction blocks can be generated by selectively using reconstructed reference samples and original reference samples, more efficient prediction blocks can be selected, thereby improving prediction accuracy. Furthermore, according to various embodiments of the present disclosure, prediction blocks with natural patterns are generated, thereby correcting sudden prediction errors, thereby improving conversion efficiency.

[0350] The above description focuses on various embodiments. Those skilled in the art will understand that the present disclosure may be embodied in various modified forms without departing from the essential characteristics of the present disclosure. Therefore, the disclosed embodiments should be considered from an illustrative rather than a restrictive perspective. The scope of the present disclosure is defined by the claims, not the foregoing description, and all differences within the scope of the claims should be construed as being within the scope of the present disclosure.

[0351] Meanwhile, the above-described embodiments of the present disclosure can be created as a computer-executable program and can be implemented on a general-purpose digital computer that runs the program using a computer-readable recording medium, including magnetic recording media (e.g., ROM (read-only memory), floppy disks, hard disks, etc.) and optically readable media (e.g., CD-ROM (compact disc read-only memory), DVD (digital versatile disc), etc.).

[0352] The present disclosure includes the following inventions. (Supplementary Note 1) Obtaining information related to transform coefficients of a current block from a bitstream; generating an intra-predicted value of the current sample based on a position of the current sample within the current block and an intra-prediction mode of the current block; determining a sample value of at least one filtered reference sample to be filtered, a first weighted value for the filtered reference sample, and a second weighted value for an intra-predicted value of the current sample based on a position of the current sample within the current block, and generating a filtered predicted sample value of the current sample based on the determined sample value of the filtered reference sample to be filtered, the intra-predicted value of the current sample, the first weighted value for the filtered reference sample, and the second weighted value for the intra-predicted value of the current sample; generating a predicted block of the current block including filtered predicted sample values ​​of the current sample; obtaining a residual block of the current block based on information related to the obtained transform coefficients of the current block; reconstructing the current block based on a predicted block of the current block and a residual block of the current block. (Supplementary Note 2) The step of generating an intra predicted value of the current sample based on the position of the current sample within the current block and the intra prediction mode of the current block includes: determining an original reference sample corresponding to the current sample based on a position of the current sample and an intra prediction mode of the current block; generating an intra-predicted value of the current sample based on a sample value of the original reference sample. (Supplementary Note 3) The video decoding method according to Supplementary Note 1, wherein the first weight value for the filtering reference sample is determined based on a distance between the filtering reference sample and the current sample. (Supplementary Note 4) The video decoding method according to Supplementary Note 3, wherein the first weight value for the filtering reference sample is determined based on a distance between the filtering reference sample and the current sample relative to a size of the current block. (Supplementary Note 5) The video decoding method according to Supplementary Note 3, wherein the first weight associated with the filtering reference sample decreases as the distance between the filtering reference sample and the current sample increases. (Supplementary Note 6) The video decoding method of Supplementary Note 1, characterized in that the filtered reference sample includes at least one of an original reference sample located horizontally of the current sample and an original reference sample located vertically of the current sample. (Supplementary Note 7) If the intra prediction mode of the current block is an angular mode, The video decoding method of claim 1, wherein the filtering reference sample includes at least one of neighboring samples to the left and above of the current block located on a line passing through the current sample, the line extending in a prediction direction indicated by the angular mode and in an opposite direction. (Supplementary Note 8) The step of determining a sample value of at least one filtered reference sample to be filtered, a first weighted value associated with the filtered reference sample, and a second weighted value associated with an intra-predicted value of the current sample based on a position of the current sample within the current block, and generating a filtered predicted sample value of the current sample based on the determined sample value of the filtered reference sample to be filtered, the intra-predicted value of the current sample, the first weighted value associated with the filtered reference sample, and the second weighted value associated with the intra-predicted value of the current sample, may include: determining at least one second intra-prediction mode; determining, using the determined at least one second intra prediction mode, a sample value of at least one filtered reference sample to be filtered, a first weighted value for the filtered reference sample, and a second weighted value for the intra predicted value of the current sample based on a position of the current sample within the current block; and generating a filtered predicted sample value of the current sample based on the determined sample value of the filtered reference sample to be filtered, the intra predicted value of the current sample, the first weighted value for the filtered reference sample, and the second weighted value for the intra predicted value of the current sample. (Supplementary Note 9) The video decoding method according to Supplementary Note 8, wherein the at least one second intra prediction mode is determined on a picture-by-picture basis or on a block-by-block basis. (Supplementary Note 10) The video decoding method described in Supplementary Note 1, characterized in that the at least one second intra prediction mode is determined to be at least one of the intra prediction mode, an intra prediction mode indicating the opposite direction to the prediction direction indicated by the intra prediction mode, a horizontal mode, and a vertical mode. (Supplementary Note 11) The video decoding method according to Supplementary Note 1, wherein the first weight and the second weight are normalized values. (Supplementary Note 12) The step of determining a sample value of at least one filtered reference sample to be filtered, a first weighted value for the filtered reference sample, and a second weighted value for an intra-predicted value of the current sample based on a position of the current sample within the current block, and generating a filtered predicted sample value of the current sample based on the determined sample value of the filtered reference sample to be filtered, the intra-predicted value of the current sample, the first weighted value for the filtered reference sample, and the second weighted value for the intra-predicted value of the current sample, may include: If the intra prediction mode is a predetermined intra prediction mode, the video decoding method of claim 1 further comprises determining a sample value of at least one filtered reference sample to be filtered, a first weighted value for the filtered reference sample, and a second weighted value for the intra prediction value of the current sample based on a position of the current sample within the current block, and generating a filtered prediction sample value of the current sample based on the determined sample value of the filtered reference sample to be filtered, the intra prediction value of the current sample, the first weighted value for the filtered reference sample, and the second weighted value for the intra prediction value of the current sample. (Supplementary Note 13) Generating an intra-predicted value of a current sample based on a position of the current sample within a current block and an intra-prediction mode of the current block; determining a sample value of at least one filtered reference sample to be filtered, a first weighted value for the filtered reference sample, and a second weighted value for an intra-predicted value of the current sample based on a position of the current sample within the current block, and generating a filtered predicted sample value of the current sample based on the determined sample value of the filtered reference sample to be filtered, the intra-predicted value of the current sample, the first weighted value for the filtered reference sample, and the second weighted value for the intra-predicted value of the current sample; generating a predicted block of the current block including filtered predicted sample values ​​of the current sample; encoding information related to transform coefficients of the current block based on the predicted block of the current block. (Appendix 14) Obtaining information related to the transform coefficients of the current block from the bitstream; generating an intra-predicted value of the current sample based on a position of the current sample within the current block and an intra-prediction mode of the current block; determining a sample value of at least one filtered reference sample to be filtered, a first weighted value for the filtered reference sample, and a second weighted value for an intra-predicted value of the current sample based on a position of the current sample within the current block; and generating a filtered predicted sample value of the current sample based on the determined sample value of the filtered reference sample to be filtered, the intra-predicted value of the current sample, the first weighted value for the filtered reference sample, and the second weighted value for the intra-predicted value of the current sample; generating a predicted block of the current block including filtered predicted sample values ​​of the current sample; obtaining a residual block of the current block based on information related to the obtained transform coefficients of the current block; 10. A video decoding apparatus comprising: a processor for reconstructing the current block based on a predicted block of the current block and a residual block of the current block.

Claims

1. obtaining an intra-prediction sample of a current sample of a current block using a first reference sample corresponding to the current sample, the first reference sample being determined based on a position of the current sample and an intra-prediction mode of the current block; determining a second reference sample from among a plurality of neighboring samples located to the left of the current block based on the position of the current sample and the mode indicating the prediction direction of the top direction, if the intra prediction mode of the current block is a mode indicating a prediction direction of the top direction; determining a second weighted value for the second reference sample based on an x-coordinate of the position of the current sample; and obtaining a modified intra prediction sample of the current sample based on the second reference sample, the intra prediction sample of the current sample, the second weighted value for the second reference sample, and the first weighted value for the intra prediction sample of the current sample; determining a third reference sample from among a plurality of neighboring samples located above the current block based on a position of the current sample and the mode indicating the leftward prediction direction, if the intra prediction mode of the current block is a mode indicating a leftward prediction direction; determining a third weighted value for the third reference sample based on a y coordinate of the position of the current sample; and obtaining a modified intra prediction sample of the current sample based on the third reference sample, the intra prediction sample of the current sample, the third weighted value for the third reference sample, and the first weighted value for the intra prediction sample of the current sample; reconstructing the current block using the modified intra-predicted samples of the current sample and residual samples of the current sample; The video decoding method, wherein the current block is one of a plurality of blocks divided from an upper block.

2. obtaining an intra-prediction sample of a current sample of a current block using a first reference sample corresponding to the current sample, the first reference sample being determined based on a position of the current sample and an intra-prediction mode of the current block; determining a second reference sample from among a plurality of neighboring samples located to the left of the current block based on a position of the current sample and a mode indicating an upward prediction direction, if the intra prediction mode of the current block is a mode indicating an upward prediction direction; determining a second weighted value for the second reference sample based on an x-coordinate of the position of the current sample; and obtaining a modified intra prediction sample of the current sample based on the second reference sample, the intra prediction sample of the current sample, the second weighted value for the second reference sample, and the first weighted value for the intra prediction sample of the current sample; determining a third reference sample from among a plurality of neighboring samples located above the current block based on a position of the current sample and the mode indicating the leftward prediction direction, if the intra prediction mode of the current block is a mode indicating a leftward prediction direction; determining a third weighted value for the third reference sample based on a y coordinate of the position of the current sample; and obtaining a modified intra prediction sample of the current sample based on the third reference sample, the intra prediction sample of the current sample, the third weighted value for the third reference sample, and the first weighted value for the intra prediction sample of the current sample; encoding the current block using the modified intra-predicted sample of the current sample; The video encoding method, wherein the current block is one of a plurality of blocks divided from an upper block.

3. An apparatus for generating and transmitting a bitstream, comprising: Memory and at least one processor; generating the bitstream by executing the video encoding method of claim 2; transmitting the bitstream to a video decoder; at least one processor configured to A device having:

Citation Information

Patent Citations

  • JPP7532450B

  • Improved video intra-prediction using position-dependent prediction combination for video coding

    WO2017058635A1