Video decoding method, video encoding method, and readable recording medium

Through adaptive initialization of CABAC context model, refine motion vectors and loop filtering technologies, the low encoding efficiency problem in high-resolution video encoding is solved, and the inter prediction compression efficiency and video quality are improved.

CN119996660APending Publication Date: 2025-05-13KONINKLIJKE PHILIPS NV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510207692.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2016-05-04
Filing Date
2017-03-22
Publication Date
2025-05-13

Smart Images

  • Figure CN119996660A_ABST
    Figure CN119996660A_ABST
Patent Text Reader

Abstract

Disclosed are a video decoding method, a video encoding method, and a non-transitory computer-readable recording medium. The video decoding method includes performing a first intra prediction on a first sub-block within a current block using one or more reference pixels of the current block; performing a second intra prediction on a second sub-block adjacent to the first sub-block within the current block using at least one reference pixel of the current block or one or more reconstructed pixels of the first sub-block, the reconstructed pixels being generated based on an output of the first intra prediction; and reconstructing the current block on the basis of the predicted first sub-block and the predicted second sub-block.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application of the Chinese patent application with the application date of March 22, 2017, the international application number of PCT / KR2017 / 003082, the invention name of “Method and device for encoding / decoding video signals”, and the application number of 201780029821.X that has entered the Chinese national phase. Technical Field

[0002] The present invention relates to a method and an apparatus for encoding or decoding a video signal. Background Art

[0003] Recently, the demand for high-resolution and high-quality videos, such as high-definition or ultra-high-definition videos, has increased in various fields. As video resolution and quality increase, the amount of video data has also increased compared to traditional videos. Therefore, when such high-quality videos are stored in existing storage media or transmitted through existing wired or wireless broadband communication networks, the transmission and storage costs increase accordingly. In order to solve this problem caused by the increasing demand for high-resolution and high-quality videos, efficient video compression technology can be used.

[0004] There are various video compression techniques, such as inter-picture prediction techniques for predicting pixel values ​​in a current picture from a previous picture or a future picture of the current picture, intra-picture prediction techniques for predicting pixel values ​​in an area of ​​the current picture from another area of ​​the current picture, and entropy coding techniques for assigning shorter codes to pixels with higher probabilities and assigning longer codes to pixels with lower probabilities. Using these video compression techniques, video data can be efficiently compressed, transmitted, and stored.

[0005] In addition, as the demand for high-resolution video increases, the demand for new video services such as stereoscopic video content is also increasing. For this reason, video compression technology for efficiently providing high-definition or ultra-high-definition stereoscopic video content is being discussed and developed. Summary of the invention

[0006] Technical issues

[0007] The present invention aims to improve the coding efficiency of the CABAC context model.

[0008] The present invention aims to improve the inter-frame prediction compression efficiency.

[0009] The present invention aims to improve the intra-frame prediction compression efficiency.

[0010] The present invention aims to provide a method for scanning a non-square transform block.

[0011] The present invention aims to provide a method for performing adaptive loop filtering.

[0012] The technical problems to be solved by this embodiment are not limited to the above-mentioned technical problems, and there may be other technical problems to be solved by the present invention.

[0013] Technical Solution

[0014] The present invention provides a method and apparatus for adaptively initializing a CABAC context model.

[0015] The present invention provides a method and apparatus for refining an encoded / decoded motion vector and performing motion compensation based on the refined motion vector.

[0016] The present invention provides a unidirectional / bidirectional intra-frame prediction method and device, which are used for dividing a current block into a plurality of sub-blocks and reconstructing each sub-block one by one according to a predetermined priority.

[0017] The present invention provides a method and apparatus for selectively using a scan type from a plurality of scan types based on a set of N×M coefficients.

[0018] The present invention provides a method and apparatus for applying loop filtering to a boundary between virtual blocks having different motion vectors.

[0019] The present invention provides a video decoding method, comprising: performing a first intra-frame prediction on a first sub-block within the current block using one or more reference pixels of the current block; performing a second intra-frame prediction on a second sub-block within the current block that is adjacent to the first sub-block using at least one reference pixel of the current block or one or more reconstructed pixels of the first sub-block, wherein the reconstructed pixels are generated based on an output of the first intra-frame prediction; and reconstructing the current block based on the predicted first sub-block and the predicted second sub-block.

[0020] The present invention provides a video encoding method, comprising: performing a first intra-frame prediction on a first sub-block within the current block using one or more reference pixels of the current block; performing a second intra-frame prediction on a second sub-block adjacent to the first sub-block within the current block using at least one reference pixel of the current block or one or more reconstructed pixels of the first sub-block, wherein the reconstructed pixels are generated based on the output of the first intra-frame prediction; and encoding intra-frame prediction information related to the first intra-frame prediction and the second intra-frame prediction into a bit stream.

[0021] The present invention provides a non-transitory computer-readable recording medium storing a bit stream generated by a video encoding method, the video encoding method comprising: performing a first intra-frame prediction on a first sub-block within the current block using one or more reference pixels of the current block; performing a second intra-frame prediction on a second sub-block adjacent to the first sub-block within the current block using at least one reference pixel of the current block or one or more reconstructed pixels of the first sub-block, the reconstructed pixel being generated based on an output of the first intra-frame prediction; and encoding intra-frame prediction information related to the first intra-frame prediction and the second intra-frame prediction into a bit stream.

[0022] Beneficial effects

[0023] According to the present invention, encoding performance can be improved by using the state of the CABAC context model stored in the process of encoding a previous picture according to the encoding / decoding order or encoding a reference picture using the same QP as the current picture as the initial value of the CABAC context model of the current picture.

[0024] In addition, according to the present invention, encoding performance can be improved by referring to the state of the CABAC context model stored in the parallelization unit in the reference picture corresponding to each parallelization unit in the current picture.

[0025] In addition, according to the present invention, a more accurately represented video can be reconstructed and the coding efficiency is improved by performing additional refinement on the encoded / decoded motion vectors.

[0026] According to the present invention, the compression efficiency of intra-frame prediction can be improved by using unidirectional / bidirectional prediction technology.

[0027] According to the present invention, transform coefficients can be efficiently scanned.

[0028] According to the present invention, subjective or objective video quality improvement can be obtained by applying loop filtering to the boundaries between virtual blocks with different motion vectors. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] Figure 1 is a block diagram illustrating a video encoding apparatus according to an embodiment of the present invention.

[0030] Figure 2 is a block diagram illustrating a video decoding apparatus according to an embodiment of the present invention.

[0031] Figure 3 is a schematic diagram illustrating a configuration of a CABAC context encoding / decoding apparatus for adaptively initializing a CABAC context model according to an application example of the present invention;

[0032] Figure 4A technique for adaptively initializing a CABAC context model according to an embodiment of the present invention is described;

[0033] Figure 5 A method for adaptively initializing a CABAC context model based on each parallelization unit according to an application example of the present invention is described;

[0034] Figure 6 and 7 A CABAC context model initialization method based on parallel processing according to an application example of the present invention is described;

[0035] Figure 8 A process of performing inter-frame prediction by selectively refining some motion vectors according to an application example of the present invention is described;

[0036] Fig. 9 Explained based on Figure 8 An example of changing a block size in a process of refining a motion vector when repetitively performing motion vector refinement of an embodiment;

[0037] Fig.10 The size and shape of blocks resulting from partitioning performed to support repeated motion vector refinement according to one example of application of the present invention are illustrated;

[0038] Fig.11 A process of performing inter-frame prediction by selectively signaling motion vector differences according to an application example of the present invention is described;

[0039] Fig.12 A unidirectional intra prediction method based on each sub-block according to an application example of the present invention is described;

[0040] Fig.13 A bidirectional intra prediction method based on each sub-block according to an application example of the present invention is described;

[0041] Fig.14 A method for scanning a square transform block according to an application example of the present invention is described;

[0042] Fig.15 and 16 A method for scanning a non-square transform block according to an application example of the present invention is described;

[0043] Fig.17 The application scope of the loop filtering according to an application example of the present invention is described;

[0044] Fig.18 A method for determining an application range of loop filtering according to an application example of the present invention is described; and

[0045] Fig.19 A method of applying loop filtering to a boundary of a geometric shape according to an application example of the present invention is described. DETAILED DESCRIPTION

[0046] The inter-frame prediction method according to the present invention includes: obtaining motion vector refinement information about a current block, reconstructing a motion vector of the current block, performing primary motion compensation on the current block based on the motion vector, refining the motion vector of the current block using an output of the motion compensation performed on the current block or using at least one motion vector refinement information, and performing secondary motion compensation on the current block using the refined motion vector.

[0047] The intra-frame prediction method according to the present invention includes: reconstructing the first sub-block in the current block by performing intra-frame prediction on the first sub-block in the current block based on the reference pixels of the current block, and performing intra-frame prediction on the second sub-block in the current block using at least one of the reference pixels of the current block or the pixels in the reconstructed first sub-block.

[0048] The transform coefficient scanning method according to the present invention includes: decoding a scanned bit stream to obtain transform coefficients of a transform block, and scanning the transform coefficients of the transform block according to a predetermined scan type, wherein the scanning can be performed on a per-group basis (wherein the group consists of NxM coefficients), and the scan type can be selected from a plurality of scan type candidates based on a signaled index.

[0049] The video decoding device according to the present invention includes: an entropy decoding unit for obtaining motion vector refinement information about a current block; and an inter-frame prediction unit for reconstructing a motion vector of the current block, performing primary motion compensation on the current block based on the motion vector, refining the motion vector of the current block using an output of the motion compensation performed on the current block or by using at least one piece of motion vector refinement information, and performing secondary motion compensation on the current block using the refined motion vector.

[0050] The video decoding device according to the present invention may include an intra-frame prediction unit, which is used to perform intra-frame prediction on a first sub-block within the current block based on reference pixels of the current block, reconstruct the first sub-block, and use at least one or both of the reference pixels of the current block and the pixels within the reconstructed first sub-block to perform intra-frame prediction on a second sub-block within the current block.

[0051] The video decoding device according to the present invention may include: an entropy decoding unit for decoding a scanned bit stream and obtaining transform coefficients of a transform block; and a realignment unit for scanning the transform coefficients of the transform block according to a predetermined scan type, wherein the scanning may be performed on a per-group basis (wherein the group consists of N×M coefficients), and the scan type may be selected from a plurality of scan type candidates based on a signaled index.

[0052] Invention Mode

[0053] The present invention can be implemented in many forms and has various embodiments. Therefore, specific embodiments will be shown in the accompanying drawings and will be described in detail below. Although specific embodiments of the present invention will be described below herein, they are only for illustrative purposes and should not be construed as limitations of the present invention. Therefore, the present invention should be construed as not only covering specific embodiments, but also covering other embodiments and modifications and equivalents of specific embodiments and other possible embodiments. Throughout the accompanying drawings, the same reference numerals represent the same elements.

[0054] The terms "first", "second", etc. used in the specification can be used to describe various components, but the components should not be interpreted as limited to these terms. That is, these terms are used to distinguish one component from another component. Therefore, the first component can be referred to as the second component, and the second component can be referred to as the first component. In addition, the term "and / or" includes any and all combinations of one or more of the related listed items, or includes one or more of the related listed items.

[0055] It should be understood that when any element is referred to as being "connected to" or "coupled to" another element, it can be directly connected to or directly coupled to another element or connected to or coupled to another element with other elements interposed therebetween. On the other hand, when an element is referred to as being "directly connected to" or "directly coupled to" another element, it should be understood that there are no other elements interposed therebetween.

[0056] The terms used herein are only used for the purpose of describing specific embodiments and are not intended to limit the present invention. As used herein, the singular forms "a", "an" and "the" are also intended to include plural forms, unless the context clearly indicates otherwise. It will be further understood that when used in this specification, the terms "include" and / or "include among others" or "include" and / or "include among others" specify the presence of the features, regions, integers, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, regions, integers, steps, operations, elements, components and / or groups thereof.

[0057] Hereinafter, preferred embodiments of the present embodiment will be described in detail with reference to the accompanying drawings. Throughout the accompanying drawings, the same elements are represented by the same reference numerals, and the description of the same elements may not be repeated hereinafter.

[0058] Figure 1 is a block diagram of a video encoding apparatus according to an embodiment of the present invention.

[0059] Reference Figure 1, the video encoding device 100 includes a picture partition unit 110, a prediction unit 120+125, a transform unit 130, a quantization unit 135, a realignment unit 160, an entropy encoding unit 165, an inverse quantization unit 140, an inverse-transform unit 145, a filter unit 150 and a memory 155.

[0060] Figure 1 The components of the video encoding device shown in are shown independently only to show that they perform different characteristic functions. Therefore, the components shown independently do not mean that each component may not be implemented as a hardware or software. That is, although the components are shown in a separate form for ease of explanation, multiple components can be combined with each other to thereby operate as a component, or a component can be further divided into multiple components to operate it as multiple components. All of these forms are included in the scope of the present invention as long as they do not deviate from the basic features of the present invention.

[0061] In addition, some components may not be essential components for performing the basic functions of the present invention, but are selective components that only improve its performance. The present invention may also be implemented only by a structure including essential components other than the selective components, and a structure including only necessary components is also included in the scope of the present invention.

[0062] The picture partitioning unit 110 may divide the input picture into one or more blocks. In this case, the block may represent a coding unit (CU), a prediction unit (PU), or a transform unit (TU). Partitioning may be performed based on at least one of a quadtree or a binary tree. A quadtree is a partitioning scheme that divides a block into quadrants (i.e., four sub-blocks) that are half of the width and height of the original block. A binary tree is a partitioning scheme that divides a block into two halves (i.e., two sub-blocks) that are half of the height or width of the original block. In a binary tree structure, when a block is divided into two halves in height, the sub-block may have a square shape or a non-square shape, depending on the shape of the original block.

[0063] In the embodiments of the present invention described below, a coding unit may be regarded not only as a basic unit for processing in an encoding process but also as a basic unit for processing in a decoding process.

[0064] The prediction units 120+125 may include an inter-prediction unit 120 for performing inter-prediction and an intra-prediction unit 125 for performing intra-prediction. For each prediction unit, a prediction method is first determined. That is, it is first determined whether to use inter-prediction or intra-prediction. Next, specific information for the determined prediction method (e.g., a prediction mode, motion vector, reference picture, etc. for intra-prediction) may be determined. Here, it should be noted that the basic unit for performing the prediction process, the basic unit for determining the prediction method, and the specific information for prediction may be different from each other. That is, the prediction method, prediction mode, etc. may be determined based on each PU, but the prediction may be performed based on each TU. The residual value (residual block) as the difference between the original block and the generated prediction block may be fed to the transform unit 130. In addition, the prediction mode information as information about the prediction mode for prediction and the vector information as information about the motion vector for prediction may be encoded by the entropy coding unit 165 together with the residual value and then sent to the decoder. When a specific encoding mode is used, the prediction units 120+125 may not generate a prediction block, but may encode the original block as is, and then may send a resulting signal to a decoder.

[0065] The inter-frame prediction unit 120 may generate a prediction unit based on information about at least one of a previous picture and a subsequent picture of the current picture. In some cases, the inter-frame prediction unit 120 may generate a prediction unit based on information about a portion of a coding area within the current picture. The inter-frame prediction unit 120 may include a reference picture interpolation unit, a motion prediction unit, and a motion compensation unit.

[0066] The reference picture interpolation unit may receive information about a reference picture from the memory 155 and generate pixel information of integer pixels or sub-pixels within the reference picture. For luma pixels, an eight-tap DCT-based interpolation filter with different filter coefficients may be used to generate pixel information about integer pixels and sub-pixels on a 1 / 4 pixel basis. For chroma pixels, a fourth-tap DCT-based interpolation filter with different filter coefficients may be used to generate pixel information about integer pixels or sub-pixels on a 1 / 8 pixel basis.

[0067] The motion prediction unit may perform motion prediction based on an interpolated reference picture obtained by the interpolation performed by the reference picture interpolation unit. Various motion vector calculation methods may be used, such as a full search based block matching algorithm (FBMA), a three-step search (TSS), and a new tree step search algorithm (NTS). By performing pixel interpolation, the motion vector may have a motion vector value of a half pixel or a quarter pixel. The motion prediction unit may predict the current prediction unit (PU) while changing the motion prediction method. Various motion prediction methods may be used, such as a skip method, a merge method, and an advanced motion vector prediction (AMVP) method.

[0068] The intra prediction unit 125 may generate a prediction unit (PU) based on information about reference pixels around the current block (i.e., information about pixels within the current picture). In the case where a neighboring block of the current prediction unit is an inter-prediction block and thus the reference pixel is an inter-prediction pixel, the reference pixel within the inter-prediction block may be replaced by a reference pixel within the neighboring intra-prediction block. That is, when one reference pixel is unavailable, information about at least one available reference pixel may be used to replace the unavailable reference pixel.

[0069] In the case of intra prediction, there are angular prediction modes in which reference pixels are determined according to the prediction direction and non-angular prediction modes in which the direction information is not used to perform prediction. The mode for predicting luma information and the mode for predicting chroma information may be different. To predict chroma information, intra prediction mode information for predicting luma information or predicted luma signal information may be used.

[0070] In the intra prediction method, the reference pixels may be fed into an adaptive intra smoothing filter, and then a prediction block may be generated based on the filtered information, depending on the prediction mode used. Different types of AIS filters may be used to filter the reference pixels. In order to perform the intra prediction method, the intra prediction mode of the current PU may be predicted from the intra prediction modes of neighboring PUs that exist around the current PU. In the case of predicting the prediction mode of the current PU based on the mode information predicted from the neighboring PUs, when the intra prediction mode of the current PU is the same as the intra prediction mode of the neighboring PU, information indicating the fact that the prediction mode of the current PU and the prediction mode of the neighboring PU are the same may be signaled using a predetermined flag. On the other hand, when the prediction modes of the current PU and the neighboring PU are different from each other, the prediction mode information about the current block may be encoded by entropy coding.

[0071] In addition, a residual block consisting of residual value information, which is a difference value between a prediction unit (PU) generated by the prediction unit 120+125 and an original block of the prediction unit, may be generated. The generated residual block may be fed to the transform unit 130.

[0072] The transform unit 130 may transform the residual block including the residual data using a transform method such as DCT or DST. The determination of the transform method may be performed based on an intra prediction mode of a prediction unit used to generate the residual block.

[0073] The quantization unit 135 may quantize the value in the frequency domain generated by the transform unit 130. The quantization coefficient may vary from block to block or may vary according to the importance of the video. The calculated value generated by the quantization unit 135 may be fed to the inverse quantization unit 140 and the realignment unit 160.

[0074] The realignment unit 160 may realign the coefficient values ​​with respect to the quantized residual values.

[0075] The realignment unit 160 may transform the coefficients in the two-dimensional block form into the one-dimensional vector form of the coefficients using a coefficient scanning method. For example, the realignment unit 160 scans the coefficients from the DC coefficient to the high frequency domain coefficient using a predetermined scanning type and obtains the one-dimensional vector form of the coefficients.

[0076] The entropy encoding unit 165 performs entropy encoding based on the value generated by the realignment unit 160. For the entropy encoding, various methods such as exponential Golomb, context adaptive variable length coding (CAVLC), or context adaptive binary arithmetic coding (CABAC) may be used.

[0077] The entropy coding unit 165 can receive various information from the realignment unit 160 and the prediction units 120+125, such as residual value coefficient information and block type information based on each coding unit (CU), prediction mode information, partition unit information, prediction unit information, transmission unit information, motion vector information, reference frame information, block interpolation information and filtering information, and can then encode the received information.

[0078] The entropy encoding unit 165 may entropy encode coefficient values ​​input on a per-CU basis from the realignment unit 160 .

[0079] The inverse quantization unit 140 and the inverse transform unit 145 may inversely quantize and inversely transform the values ​​quantized and transformed by the quantization unit 135 and the transform unit 140. The residual value generated by the processes performed in the inverse quantization unit 140 and the inverse transform unit 145 is added to the prediction unit generated by the processes performed in the motion estimation unit, the motion compensation unit, and the intra prediction unit included in the prediction units 120+125 to generate a reconstructed block.

[0080] The filter unit 150 may include at least one of a deblocking filter, an offset correction unit, and an adaptive loop filter (ALF).

[0081] The deblocking filter can eliminate block distortion attributable to the boundaries between blocks from the reconstructed picture. In order to determine whether it is necessary to perform deblocking, the determination of whether to apply deblocking to the current block can be performed based on the pixels included in several rows or columns included in the block. When it is determined that it is necessary to deblock the block, a strong filter or a weak filter can be selectively used according to the strength of deblocking. When performing deblocking, when both vertical filtering and horizontal filtering are used, vertical filtering and horizontal filtering can be performed in parallel.

[0082] The offset correction unit can refine the offset between the deblocked video and the original video based on each pixel. In order to perform offset correction on a specific picture, various offset correction methods can be used: a method of dividing pixels included in the video into a predetermined number of regions, determining the regions to be subjected to offset correction, and performing offset correction on the determined regions; and a method of performing offset correction while considering edge information of each pixel.

[0083] ALF may be performed based on a value obtained by comparison between the filtered video and the reconstructed video. The pixels in the video may be divided into a predetermined number of groups, the filter to be used for a particular group may be determined, and each group may be filtered using a different filter. Information indicating whether ALF is applied may be signaled for a luminance signal on a per-CU basis, and the shape and coefficients of the filter used for ALF may vary from block to block. Alternatively, the filter used for ALF for each block may be the same (fixed) in shape, regardless of the characteristics of the target block to be subjected to ALF.

[0084] The memory 155 may store the reconstructed block or picture output from the filter unit 150 , and may feed the stored reconstructed block or picture into the prediction unit 120+125 for subsequent inter-frame prediction.

[0085] Figure 2 is a block diagram showing a video decoding apparatus according to an embodiment of the present invention.

[0086] Reference Figure 2 , the video decoder 200 includes an entropy decoding unit 210 , a realignment unit 215 , an inverse quantization unit 220 , an inverse transform unit 225 , a prediction unit 230+235 , a filter unit 240 , and a memory 245 .

[0087] When a video bitstream is fed from a video encoder into the video decoder 200, the bitstream may be decoded in the reverse order of the processing sequence performed in the video encoder.

[0088] The entropy decoding unit may perform entropy decoding in a reverse order to the sequence of entropy encoding performed in the entropy encoding unit. For example, various methods such as exponential Golomb, context adaptive variable length coding (CAVLC) or context adaptive binary arithmetic coding (CABAC) may be used to correspond to the method used in the video encoder.

[0089] The entropy decoding unit 210 may decode information associated with intra prediction and inter prediction performed in the encoder.

[0090] The realignment unit 215 realigns the bitstream decoded by the entropy decoding unit 210 using the method used by the entropy encoding unit to perform entropy encoding to generate a bitstream. Coefficients represented in the form of a one-dimensional vector may be rearranged into coefficients in the form of a two-dimensional block. The realignment unit 215 may receive information about coefficient scanning performed in the coding unit and perform realignment in the reverse order of the scanning sequence performed in the coding unit.

[0091] The inverse quantization unit 220 may perform inverse quantization based on the encoding parameters provided by the encoder and the coefficient values ​​of the realigned block.

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

[0093] The prediction unit 230 / 235 may generate a prediction block based on information on generation of the prediction block provided by the entropy decoding unit 210 and information on a previously decoded block or picture received from the memory 245 .

[0094] The prediction unit 230+235 may include a PU determination unit, an inter prediction unit, and an intra prediction unit. The PU determination unit receives various information, such as prediction unit information, prediction mode information used in the intra prediction method, and motion compensation information used in the inter prediction method, which is provided by the entropy decoding unit 210, identifies the prediction unit for the current block, and determines whether the prediction unit is an inter prediction prediction unit or an intra prediction prediction unit. The inter prediction unit 230 may use the information required for inter prediction of the current prediction unit provided by the video encoder and the information included in at least one of the previous picture and the subsequent picture of the current picture containing the current prediction unit to perform inter prediction on the current prediction unit. Alternatively, inter prediction may be performed based on information about a portion of a previously reconstructed area within the current picture including the current prediction unit.

[0095] In order to perform inter-frame prediction, for each coding unit, a prediction method for a prediction unit included in the coding unit may be determined. That is, it may be determined which mode among the skip mode, the merge mode, and the AMVP mode is used to generate the prediction mode.

[0096] The intra prediction unit 235 may generate a prediction unit (PU) based on information about pixels within the current picture. When the prediction unit is a prediction unit generated by intra prediction during encoding, intra prediction may be performed based on intra prediction mode information about the prediction unit provided by the video encoder. The intra prediction unit 235 may include an adaptive intra smoothing filter, a reference picture interpolation unit, and a DC filter. The AIS filter is a unit for performing filtering on reference pixels of the current block, and filtering may or may not be performed according to the prediction mode of the current prediction unit. By using the AIS filter information provided by the video encoder and the prediction mode of the prediction unit, AIS filtering may be performed on the reference pixels in the current block. When the prediction mode of the current block is a mode that does not require AIS filtering, AIS filtering may not be applied.

[0097] When the prediction mode of the prediction unit is a prediction unit generated by interpolation prediction performed by interpolating pixel values ​​obtained by interpolating reference pixels, the reference pixel interpolation unit may generate reference pixel values ​​by interpolating reference pixels based on each sub-pixel. When the prediction mode of the current prediction unit is a prediction mode in which a prediction block may be generated without interpolating reference pixels, the reference pixels may not be interpolated. When the prediction mode is a DC mode, the DC filter may generate a prediction block by performing filtering.

[0098] The reconstructed block or picture may be fed to the filter unit 240. The filter unit 240 may include a deblocking filter, an offset correction unit, and an adaptive loop filter (ALF).

[0099] Information may be received from a video decoder: information on whether deblocking filtering is applied to a target block or picture; and information on which filter to use between a strong filter or a weak filter when deblocking filtering is applied. A deblocking filter of a video decoder may receive deblocking information from a video encoder and perform deblocking filtering on a target block.

[0100] The offset correction unit may perform offset correction on the reconstructed video based on information of an offset type and an offset value applied to the video during encoding.

[0101] ALF may apply filtering to a coding unit based on information indicating whether ALF is applied, information of ALF coefficients, etc. provided by an encoder. ALF information may be inserted into a specific parameter for signaling.

[0102] The memory 245 stores the reconstructed pictures or blocks so that the reconstructed pictures or blocks can be used as reference pictures or blocks, or feed them to the output unit.

[0103] In the following, reference will be made to Figures 3 to 7A CABAC encoding method and apparatus and a CABAC decoding method and apparatus according to an embodiment of the present invention are described. In various embodiments described herein, the term "parallelization unit" refers to a set of one or more coding units constituting a picture, which is created for parallel processing during video encoding and decoding. Here, the term "coding unit" refers collectively to coding units that can be divided into sub-coding units based on a tree structure and coding units that cannot be further divided.

[0104] Figure 3 is a schematic diagram showing a configuration of a CABAC encoding / decoding apparatus for adaptively initializing a CABAC context model according to an embodiment to which the present invention is applied.

[0105] Reference Figure 3 According to an embodiment of the present invention, a CABAC encoding / decoding device may include a context initialization determination unit 310, a reference context loading unit 320, and a context initial value loading unit 330 or a context initialization unit 340.

[0106] The context initialization determination unit 310 can determine whether to perform adaptive initialization of the CABAC context model based on information indicating whether adaptive initialization of the CABAC context model has been performed. The information indicating the determination result of whether to perform adaptive initialization of the CABAC context model can be encoded in the form of a flag in the video encoding device, etc. The information may include a specific value indicating the state of the reference CABAC context. The information can be inserted into the high-level syntax of the bitstream for signaling to the video decoding device. For example, the information can be inserted into at least one of the sequence parameter set and the picture parameter set for signaling. The information can be signaled on the basis of each parallelization unit constituting the picture. In this way, independent adaptive initialization of the CABAC context model of each parallelization unit can be allowed.

[0107] In response to the information indicating that the CABAC context is adaptively initialized, the reference context loading unit 320 may acquire a reference CABAC context state. The context initialization unit 340 may initialize a CABAC context model based on the acquired reference CABAC context state.

[0108] The reference CABAC context state may represent a CABAC context state stored in a previous decoding process. The reference CABAC context state may represent a CABAC context state stored at a specific position within a previously decoded picture. For example, the reference CABAC context state may be a CABAC context state stored at a specific position within the same picture as the picture to which the current CABAC context model belongs or within a reference picture at a different time point. Here, the specific position may represent a position within a parallelization unit, which corresponds to the current CABAC context model or within a parallelization unit that is adjacent in time or space. The specific position may be a fixed position pre-agreed between a CABAC encoding device and a CABAC decoding device. The specific position may be identified based on information signaled using a bitstream. The signaling information may represent information indicating a specific position encoded by CABAC information, information about a reference to the current picture, information about the attributes of the blocks constituting the picture (e.g., partitioning technology, size, shape, depth, etc.), etc.

[0109] When a picture is divided into parallelization units (e.g., tiles), the reference CABAC context state may represent a CABAC context stage stored at a specific location in a corresponding parallelization unit within a previously decoded picture. The corresponding parallelization unit may be a co-located parallelization unit within a reference picture or a parallelization unit using the same quantization parameter (QP) within a reference picture.

[0110] In the case where a picture is divided into parallelization units, when the size and / or number of parallelization units in each picture are the same, the reference CABAC context state may represent a specific position in the parallelization unit of the same position in the previously decoded picture.

[0111] On the other hand, when the size and / or number of parallelization units are different, any one of the CABAC context states stored in the previously decoded picture can be selected. The selection can be performed taking into account the difference between the position of the stored CABAC context state and the position of the parallelization unit. For example, the CABAC context state with the smallest difference in position with the parallelization unit can be selected as the reference CABAC context state. In the case where the size and / or number of parallelization units are different, when the position information about the CABAC context state within the previously decoded picture is mapped on the parallelization unit, the CABAC context state stored in the parallelization unit occupying the largest area within the previously decoded picture can be used as the reference CABAC context state.

[0112] In the case where multiple sub-pictures exist within a picture such as a 360-degree video, the CABAC context state stored at a specific location within each sub-picture present within the picture may be used as a reference CABAC context state.

[0113] Figure 4 A technique for adaptively initializing a CABAC context model according to an embodiment of the present invention is shown.

[0114] exist Figure 4 In the CABAC encoding apparatus and the CABAC decoding apparatus, the reference picture 410 may be a picture encoded / decoded before the current picture 420 (i.e., a previously encoded / decoded picture) and may mean a picture referred to as the initialization of the CABAC context model of the current picture 420. The reference picture 410 may be any one of a plurality of reference pictures referenced by the current picture 420 when performing inter-frame prediction of the current picture 420. For example, the reference picture 410 may be a reference picture with a predetermined index, which is included in a reference picture list of the current picture. The predetermined index may be a fixed value preset in the CABAC encoding apparatus and the CABAC decoding apparatus. The predetermined index may be a variable value notified using bitstream signaling, or a variable value derived from a reference picture index of a block included in the current picture 420. A picture having the same quantization parameter (QP) as the current picture 420 may be selected and used as the reference picture 410.

[0115] like Figure 4 As shown in , the current picture 420 may refer to a CABAC context state stored at a specific location within the reference picture 410 for adaptive initialization of a CABAC context model.

[0116] The specific position within the reference picture 410 may represent the position of the coding unit, which is pre-agreed between the CABAC encoding device and the CABAC decoding device, and information indicating the specific position may not be signaled. The CABAC encoding device may determine the optimal specific position within the reference picture 410 while considering encoding efficiency, encode the determined optimal specific position, and signal the encoding information to the CABAC decoding device.

[0117] The process of referring to the CABAC context state stored at a specific location within the reference picture 410 may include a process of loading the CABAC context state stored when encoding / decoding a block corresponding to the specific location within the reference picture 410 .

[0118] The process of initializing the CABAC context model of the current picture 420 means initializing the CABAC context state of the start block of the current picture 420 based on the loaded CABAC context state.

[0119] Figure 5A method for adaptively initializing a CABAC context model based on each parallelization unit according to an embodiment of the present invention is shown.

[0120] In this embodiment, for the convenience of description, the case where the parallelization unit is a tile will be described as an example. Figure 4 Describes in detail Figure 5 Therefore, its description will not be repeated here. Figure 5 , the reference picture 510 consists of four parallelization units 511, 512, 513 and 514, and the current picture 520 consists of parallelization units 521, 522, 523 and 524 of the same number and size.

[0121] like Figure 5 As shown, the parallelization unit of the current picture 520 can refer to the CABAC context state stored at a specific position in the parallelization unit of the reference picture 510 for adaptive initialization of the CABAC context model. In this case, the parallelization unit of the current picture 520 can refer to the parallelization unit located at the same position in the reference picture 510, or can refer to the parallelization unit located at a different position in the reference picture. The parallelization unit at the different position can be a parallelization unit in the reference picture 510, which uses the same quantization parameter (QP) as the parallelization unit in the current picture 520.

[0122] The specific position in the parallelization unit may represent the position of the coding unit preset in the CABAC encoding device and the CABAC decoding device, and in this case, the information indicating the specific position may not be signaled. The CABAC encoding device may determine the optimal specific position within each parallelization unit while considering the encoding efficiency, encode the determined optimal specific position, and signal the encoding information to the CABAC decoding device.

[0123] The process of referring to the CABAC context state stored at a specific location within the reference picture 510 may include a process of loading the CABAC context state stored when encoding / decoding a block corresponding to the specific location in the parallelization unit within the reference picture 510 .

[0124] The process of initializing the CABAC context model of each parallelization unit of the current picture 520 means initializing the CABAC context state of the start block of each parallelization unit belonging to the current picture 520 based on the loaded CABAC context.

[0125] Figure 6 and 7 A CABAC context model initialization method based on parallel processing according to an embodiment of the present invention is shown.

[0126] Reference Figure 6 According to the CABAC context model initialization method based on parallel processing of the present embodiment, a CABAC context model is initialized for each block row 610, 620, 630, 640, and 650, and a CABAC context model of a first block of a block row of block rows may be initialized by referring to a CABAC context state of a second block of a previous block row. Here, a block may represent a coding unit, and may specifically represent a coding tree block (CTB), a coding block generated by tree structure partitioning, or a minimum coding block (SCU).

[0127] Reference Figure 7 , the current picture 720 refers to the CABAC context state stored at a specific position in the reference picture 710, and initializes the CABAC context model of the first block row 721 of the current picture 720. By referring to the reference Figure 6 Initialization of the CABAC context model of the other block rows compared to the first block row of the current picture 720 is performed by referring to the previous block row described. In some cases, initialization of the CABAC context model of at least one of the other block rows 722, 723, 724, and 725 may be performed by referring to the CABAC context state stored at a specific position in the reference picture 710. Here, the specific position in the reference picture 710 referred to by the block row 821 (hereinafter, referred to as the first specific position) may be the same as or may be different from the specific position in the reference picture 710 referred to by at least one other block row (hereinafter, referred to as the second specific position).

[0128] The specific position may be a variable position determined according to the position of each block row included in the current picture 720 or a fixed position allocated to each block row.

[0129] The specific position may be a fixed position preset in a CABAC encoding device and a CABAC decoding device. The specific position may be identified based on information signaled using a bitstream. The signaled information may include information indicating a specific position encoded by CABAC information, information about a reference of a current picture, information about attributes of blocks constituting a picture (e.g., partitioning technique, size, shape, depth, etc.), and the like.

[0130] In the following, reference will be made to Fig.11 A method of performing inter prediction based on motion vector refinement performed by an inter prediction unit is described.

[0131] The inter prediction unit may determine a motion vector of the current block based on a predetermined inter mode (e.g., skip mode, merge mode, and AMVP mode), and perform inter prediction using the determined motion vector. The determined motion vector may be used as is, or may be used after being refined based on the motion vector refinement information.

[0132] Here, the motion vector refinement information may include refinement ON / OFF information, refinement repetition / non-repetition information, the number of refinement repetitions, information about the resolution of the motion vector, information about the allowable refinement range, motion vector refinement signaling information, and at least one of the information about blocks, slices, and pictures which is referred to as refinement for the motion vector.

[0133] The motion vector may be selectively refined based on the refinement ON / OFF information. The refinement ON / OFF information may be information indicating whether the motion vector is to be refined, and may be represented in the form of a flag. The motion vector may be refined at a resolution indicated by the information about the resolution of the motion vector. Possible resolution candidates may include integer pixels and sub-pixels, such as 1 / 2 pixels, 1 / 4 pixels, 1 / 8 pixels, and 1 / 16 pixels, and the motion vector resolution information may specify at least one possible resolution candidate. The information about the allowable refinement range may indicate a resolution range that allows refinement, a block range for performing motion vector refinement, and the like.

[0134] The motion vector refinement information may be signaled using a bitstream, and at least one piece of motion vector refinement information may be derived from a spatially adjacent block (e.g., a left adjacent block, an upper adjacent block, a left upper adjacent block, a left lower adjacent block, a right upper adjacent block, etc.) and / or a temporally adjacent block. In addition, the at least one piece of motion vector refinement information may be fixed information preset in the video encoding device and the video decoding device, or variable information determined according to the attributes of the current block (e.g., inter-frame prediction type, whether bidirectional prediction is performed, whether a close reference picture is used, the size / shape / depth of the block, the partitioning technique, whether there is a residual coefficient, a quantization parameter, etc.). According to the settings preset in the video encoding device and the video decoding device or according to the characteristics of the information, the motion vector refinement information may be signaled or derived at any level among various levels, including a sequence level, a picture level, a slice level, a tile level, a block level (e.g., a coding block level, a prediction block level, etc.). In some cases, the at least one piece of motion vector refinement information may not be signaled according to the settings preset in the video encoding device and the video decoding device.

[0135] In the case of generating a prediction block of a current block using inter-frame prediction, a motion vector may be stored in a video encoding / decoding apparatus, and in this case, the video encoding / decoding apparatus may be equipped with a dedicated buffer for storing the motion vector.

[0136] The motion vector refinement according to the present invention is described for the case where refinement is applied to the reconstructed motion vector. However, the present invention is not limited thereto, and of course the same or similar refinement process may be applied to the predicted motion vector.

[0137] Figure 8 A process of performing inter-frame prediction by selectively refining some motion vectors according to an embodiment to which the present invention is applied is shown.

[0138] refer to Figure 8 , motion vector refinement information about the current block can be obtained (S800). Here, the motion vector refinement information is the same as described above. That is, the motion vector refinement information may include refinement ON / OFF information, information about the number of refinement repetitions, information about the resolution of the motion vector, information about the allowable refinement range, motion vector refinement signaling information, and at least one of information about blocks, slices, and pictures referred to as being used to refine the motion vector. That is, at least one piece of motion vector refinement information can be obtained.

[0139] When the refinement ON / OFF information indicates that the motion vector is to be refined, the motion vector may be refined (S810).

[0140] Motion vector refinement may be performed at the same resolution as motion vector refinement performed in the video encoding device, or at a different resolution than motion vector refinement performed in the video encoding device. That is, a higher resolution or a lower resolution than that used in the video encoding device may be used. For example, the video encoding device may encode and signal motion vectors on a per integer pixel basis, and the video decoding device may refine motion vectors on a per sub-pixel basis (e.g., on a per 1 / 2 pixel, 1 / 4 pixel, or 1 / 8 pixel basis). Information about the refinement of finer sub-pixels may be included in the motion vector refinement information.

[0141] The motion vector may be refined using a previously decoded prediction / reconstruction value. The previously decoded prediction / reconstruction value may be a prediction / reconstruction value of the current block, which is obtained by performing inter-frame prediction based on the motion vector of the current block as a refinement target or a prediction / reconstruction value of a reference picture referenced by the current block. The previously decoded prediction / reconstruction value may be a prediction / reconstruction value of a neighboring block that is temporally and / or spatially adjacent to the current block.

[0142] Motion vector refinement according to the present invention may include a process of calculating an offset vector for compensating the error of a motion vector by using a previously decoded prediction / reconstruction value. In this case, a refined motion vector may be derived based on a pre-refined motion vector (original motion vector) and a calculated offset vector.

[0143] Next, inter prediction is performed again based on the refined motion vector to obtain a prediction / reconstruction value of the current block (S820).

[0144] As described above, the refined motion vector may be stored in a buffer provided in the video encoding / decoding apparatus, and may then be used to determine a motion vector of a neighboring block and / or a picture to be subsequently encoded / decoded.

[0145] On the other hand, when the refinement ON / OFF information indicates that the motion vector is not to be refined, the motion vector is used as it is for inter prediction of the current block without being refined (S830).

[0146] The motion vector refinement may be repeated a predetermined number of times. The number of times the motion vector refinement is repeated may be determined based on information about the number of times the refinement is performed. The information about the number of times the refinement is performed may be signaled using a bitstream. However, in the case where the video encoding device and the video decoding device have agreed in advance on the number of refinements and thus know when to stop the motion vector refinement, the information about the number of refinements may not be signaled. When the motion vector refinement is repeatedly performed, only the last motion vector may be stored, and at least one of the motion vectors obtained by the repeated refinement operation may be repeatedly stored in a buffer of the video encoding / decoding device.

[0147] Fig. 9 Shows that when Figure 8 An example of changing blocks in the process of refining motion vectors when motion vector refinement is repeatedly performed in the embodiment of the present invention.

[0148] Motion vector refinement is repeatedly performed on a current block having a size of N×M (here, N and M may be equal numbers or different numbers), and the size of the block on which the motion vector refinement is performed may be changed according to the number of refinements, similar to Figure 4 400 shown in FIG.

[0149] like Fig. 9 As shown, refinement may be performed on a block size of N / 2×M / 2 in a first refinement step, and on a block size of N / 4×M / 4 within the upper left block 402 in a second refinement step, and refinement may be performed for other blocks 403 having the same size.

[0150] Information on whether to perform motion vector refinement on a block of the same size (a non-partitioned block) using a previously processed block may also be included in the motion vector refinement information.

[0151] Fig.10 The sizes and shapes of blocks resulting from partitioning performed to support repeated motion vector refinement according to one embodiment applying the present invention are shown.

[0152] like Fig.10As shown in (a), a block can be divided into sub-blocks of the same size according to the partition depth. Figure 1 As shown in Fig.10 As shown in (b), the block can be divided into non-square sub-blocks. Fig.10 As shown in (c), some blocks can be divided into different depths than other blocks. Fig.10 As shown in (d), partitioning may result in asymmetric sub-blocks. Fig.10 As shown in (e), 10(f) and 10(g), partitioning can produce non-rectangular sub-blocks, where triangular or rectangular sub-blocks can be mixed. Fig.10 As shown in (h), the block can be horizontally divided by three horizontal lines to produce four non-square blocks of the same size. Fig.10 (a) to 10(h) show some possible embodiments of the present invention. That is, a block may be divided into sub-blocks having various sizes and shapes, and information on the sizes and shapes of the sub-blocks may be included in the motion vector refinement information.

[0153] The minimum unit that allows partitioning may be a single pixel. Blocks that are partially or completely identical in terms of motion vector refinement information may be merged. Even in the case where the original coding unit does not have a rectangular shape, the coding unit may be divided into sub-blocks having various shapes, such as Fig.10 As shown in the embodiments. Fig. 9 As shown, one reference picture, two reference pictures, three reference pictures or more reference pictures may be used for motion vector refinement. In the case where motion vector refinement is repeatedly performed, the reference picture may be changed, and thus the method of acquiring motion vector refinement information from the reference picture may be changed.

[0154] When a block is divided into sub-blocks with various shapes, such as Fig.10 As shown, blocks can have different motion vectors. In this case, artifacts may occur between blocks with different motion vectors. To remove artifacts, loop filtering can be applied, which will refer to Figures 17 to 19 Give a description.

[0155] Fig.11 A process of performing inter-frame prediction by selectively signaling a motion vector difference according to an embodiment to which the present invention is applied is shown.

[0156] The motion vector may be modified by motion vector refinement. When the offset vector becomes the same as the motion vector difference (MVD) calculated by the process, decoding of the current block may be performed without signaling the MVD. That is, when it is determined that the motion vector is not modified by motion vector refinement, signaling of the motion vector difference may be skipped, thereby improving coding efficiency.

[0157] For selective signaling of motion vector differences, information indicating whether to skip signaling of motion vector differences may be used. The information may be signaled using a bitstream, or may be derived from a specific value determined in consideration of the properties of a block. For example, when the value of the information is a first value, the motion vector difference of the current block may not be signaled. In this case, the motion vector difference may be replaced by an offset vector calculated by motion vector refinement. On the other hand, when the value of the information is a second value, the motion vector difference may be signaled using a bitstream.

[0158] The information may be signaled at any level including a sequence level, a picture level, a slice level, and a block level, or may be skipped according to a condition preset in a video encoding device and a video decoding device. For example, in the case where there is a protocol for signaling a motion vector difference when motion vector refinement of a current block is not performed, the information may not be signaled.

[0159] Reference Fig.11 , the motion vector refinement information may be obtained (S1100). Since the motion vector refinement information is the same as that described above, its description will not be repeated here.

[0160] Based on the motion vector refinement information acquired in S1100 , it may be determined whether to refine the motion vector of the current block ( S1110 ).

[0161] When the refinement ON / OFF information indicates that the motion vector of the current block is not to be refined, motion compensation may be performed based on a motion vector derived from the predicted motion vector and the sum of the motion vector differences ( S1120 ).

[0162] On the other hand, when the refinement ON / OFF information indicates that the motion vector of the current block is to be refined, it is determined whether to skip signaling the motion vector difference of the current block (S1130). Whether to skip signaling the motion vector difference can be determined using a predetermined flag (eg, mvd_skip_flag).

[0163] When it is determined that signaling of the motion vector difference is to be performed, motion compensation may be performed based on the motion vector derived from the sum of the predicted motion vector and the motion vector difference (S1140). The motion vector derived in S1140 may be refined using the prediction / reconstruction value obtained through motion compensation (S1150). That is, an offset vector for compensating for the error of the motion vector may be derived using the prediction / reconstruction value obtained through motion compensation. The refined motion vector may be obtained by adding the derived offset vector to the motion vector. Motion compensation may be performed using the refined motion vector (S1160).

[0164] On the other hand, when it is determined that the signaling of the motion vector difference is to be skipped, motion compensation may be performed based on the predicted motion vector PMV (S1170). Similarly, the predicted motion vector obtained in S1170 may be refined using the predicted / reconstructed value obtained by motion compensation (S1180). That is, an offset vector for compensating for the error of the predicted motion vector PMV may be derived using the predicted / reconstructed value obtained by motion compensation. The refined motion vector may be obtained by adding the derived offset vector to the predicted motion vector PMV. Motion compensation may be performed based on the refined motion vector (S1190).

[0165] The motion vector refinement may be repeated a predetermined number of times, such as Fig.11 As shown in the embodiments of the present invention, and as follows Figures 8 to 10 Described.

[0166] Reference Figures 12 to 13 , an intra prediction method based on each sub-block will be described.

[0167] Fig.12 A unidirectional intra prediction method based on each sub-block according to an embodiment of the present invention is shown.

[0168] refer to Fig.12 , the current block may include n sub-blocks. Here, the current block may refer to a coding block or a prediction block. The current block may represent a block unit to which an intra-frame prediction mode is applied. Here, n is a natural number, wherein n may be a fixed value preset in a video encoding device and a video decoding device, or a variable value determined according to the attributes of the block. Alternatively, the video encoding device may determine an optimal value of n, encode the value, and signal the encoded value. The video decoding device may determine the value of n based on the signaled information.

[0169] The subblock has a size of N×M, where N and M are natural numbers of 1, 2 or greater, and N and M may be the same number or different numbers. The subblock may consist of one pixel, may represent a pixel group having a square or non-square shape, or a pixel row (row and column). The size of the subblock may be a fixed size preset in the video encoding device and the video decoding device, or a variable size determined according to the properties of the block. The size / shape of the subblock may be determined taking into account the directionality of the intra-frame prediction mode of the current block. For example, when the intra-frame prediction mode has a horizontal directionality, the subblock may have a rectangular shape, where M is greater than N. On the other hand, when the intra-frame prediction mode has a vertical directionality, the subblock has a rectangular shape where N is greater than M. The video encoding device may encode and signal the optimal size of the subblock, and the video decoding device may determine the size of the subblock based on the signaled information. The information may be signaled at at least one of the sequence level, the picture level, the slice level, the tile level, and the block level.

[0170] In the unidirectional intra prediction method according to the present invention, the intra prediction and reconstruction of the first sub-block 1210 located in the top row of the current block can be performed based on the neighboring pixels and the intra prediction mode adjacent to the current block. The second sub-block 1220 can be intra-predicted and reconstructed using the neighboring pixels and / or pixels in the reconstructed first sub-block. In this way, the other sub-blocks 1230 and 1240 can also be intra-predicted and reconstructed. In this case, the accuracy of intra prediction can be improved, and the energy of the residual error can be reduced. However, Fig.12 The embodiment of the invention is not intended to limit the prediction and reconstruction order of the sub-blocks. That is, the prediction and reconstruction of the sub-blocks can be performed in the order of the fourth sub-block, the third sub-block, the second sub-block and the first sub-block. According to the size / shape of the sub-block, the sub-blocks are predicted and reconstructed in the order from the left sub-block to the right sub-block or from the right sub-block to the left sub-block. The prediction and reconstruction order can be determined according to the intra-frame prediction mode of the current block and / or the intra-frame prediction mode of the adjacent block. For example, the direction of the intra-frame prediction mode is from top to bottom, and the prediction and reconstruction can be performed in the order of the first sub-block, the second sub-block, the third sub-block and the fourth sub-block. On the other hand, the direction of the intra-frame prediction mode is from bottom to top, and the prediction and reconstruction can be performed in the order of the fourth sub-block, the third sub-block, the second sub-block and the first sub-block. The prediction and reconstruction order can be a fixed order preset in the video encoding device and the video decoding device.

[0171] Fig.13 A bidirectional intra prediction method based on each sub-block according to an embodiment of the present invention is shown.

[0172] Reference Fig.13 , a prediction value can be obtained by performing intra-frame prediction on the first sub-block 1300 based on the reference pixel of the current block, and the current block can be reconstructed by adding the residual value to the prediction value. Here, the first sub-block 1300 can be a sub-block located at the bottom of the current block, a sub-block located at the right end of the current block, or a sub-block located at the center of the current block. However, the present invention is not limited to this. The first sub-block 1300 can be a plurality of sub-blocks constituting the current block. The first sub-block 1300 can be defined as the first prediction and reconstruction block among the plurality of sub-blocks constituting the current block.

[0173] Next, the second sub-block 1310 may be predicted for a second time using at least one of the reference pixels of the current block and the pixels in the reconstructed first sub-block. That is, similar to the first sub-block 1300, the second sub-block 1310 may be predicted using only the reference picture of the current block or using only the pixels in the reconstructed first sub-block. The second sub-block 1310 may be predicted and reconstructed using bidirectional prediction, i.e., first-direction prediction and second-direction prediction. Here, the first-direction prediction may represent a prediction based on the reference pixels of the current block, and the second-direction prediction may represent a prediction based on the pixels within the reconstructed first sub-block. Depending on the shape of the sub-block, the first direction may represent an upward vertical direction, and the second direction may represent a downward vertical direction. Alternatively, the first direction may represent a left horizontal direction, and the second direction may represent a right horizontal direction. As Fig.13 As shown, the first direction and the second direction may be different directions or may be the same direction.

[0174] The same intra-frame prediction mode may be used to perform the first direction prediction and the second direction prediction. Alternatively, different intra-frame prediction modes may be used to perform the first direction prediction and the second direction prediction. An intra-frame prediction mode for second direction prediction (hereinafter referred to as the second intra-frame prediction mode) may be derived based on an intra-frame prediction mode for first direction prediction (hereinafter referred to as the first intra-frame prediction mode). For example, the second intra-frame prediction mode may be derived by adding a predetermined constant to the value of the first intra-frame prediction mode or by subtracting a predetermined constant from the value of the first intra-frame prediction mode. The second intra-frame prediction mode may be derived as a mode corresponding to the opposite direction of the first intra-frame prediction mode.

[0175] The first direction prediction may be performed based on the encoded intra prediction mode, and the second direction prediction may be performed based on the default mode. The default mode is an intra prediction mode preset in the video encoding device and the video decoding device, and may be any one of a plane mode, a DC mode, and a vertical / horizontal mode. The default mode may be determined according to the size / shape of the sub-block. Alternatively, a specific mode may be fixed regardless of the size / shape of the sub-block.

[0176] Multiple sub-blocks of the current block are sequentially predicted and / or reconstructed according to a predetermined patterned prediction order. To this end, the video encoding device can determine the patterned prediction order and can signal information about the patterned prediction order. The video decoding device can sequentially predict and / or reconstruct the sub-blocks according to the predetermined order by referring to the signaled information.

[0177] Alternatively, the video decoding device may determine the prediction order of the sub-blocks based on the values ​​of adjacent reference pixels, the amount of change in the values ​​of adjacent reference pixels, the encoding information of adjacent blocks, etc. A plurality of reference pixels may be used to calculate the amount of change, and in this case, the number of reference pixels may be two, three, four or more. A plurality of reference pixels may be arranged continuously or intermittently at predetermined intervals (e.g., an interval of one pixel, two pixels or more pixels).

[0178] For example, prediction and / or reconstruction of the sub-blocks may be performed in descending order of the pixel value difference D of the reference pixels. The pixel value difference D with respect to the R2 reference pixel may be calculated according to Equation 1.

[0179] [Equation 1]

[0180] D=|R2-R1|+|R2-R3|

[0181] In this manner, the pixel value difference D may be calculated for each reference pixel, and the sub-blocks may be predicted and / or reconstructed in order from the maximum difference to the minimum difference. The sub-blocks may be predicted and / or reconstructed in order from the sub-block corresponding to the reference pixel having the maximum difference value Dmax to the sub-block corresponding to the reference pixel having the minimum difference value Dmin.

[0182] Depending on the size / shape of the sub-block, it can be determined whether the prediction order is from left to right, from right to left, from top to bottom, or from bottom to top. The prediction order can be determined according to the intra-frame prediction mode of the current block and / or the intra-frame prediction mode of the adjacent block. For example, when the direction of the intra-frame prediction mode is from top to bottom, prediction and reconstruction can be performed in the order of the first sub-block, the second sub-block, the third sub-block, and the fourth sub-block. On the other hand, since the direction of the intra-frame prediction mode is from bottom to top, prediction and reconstruction can be performed in the order of the fourth sub-block, the third sub-block, the second sub-block, and the first sub-block. The prediction and reconstruction order can be a fixed order preset in the video encoding device and the video decoding device.

[0183] In the following, reference will be made to Figures 14 to 16 Describes a method for scanning the transform coefficients of a transform block.

[0184] In a video encoding apparatus, transform coefficients of a transform block may be scanned based on a predetermined scan type. The transform block may include one or more coefficient groups. Based on a scan order determined according to the scan type, the transform coefficients in the coefficient groups may be sequentially scanned, and the coefficient groups in the transform block may be sequentially scanned.

[0185] The coefficient group may have an NxM size. Here, N and M are natural numbers, wherein N and M may be the same number or different numbers. In the case where N and M are different numbers, N may be greater than M or less than M. That is, the coefficient group may be a square group or a non-square group. The size / shape of the coefficient group may be a fixed size / shape existing in the video encoding device, or a variable size / shape determined according to the size / shape of the transform block. The video encoding device may determine the optimal size / shape of the coefficient group in consideration of the encoding efficiency, and may encode the determined size / shape. The scanning type may be any of diagonal scanning, vertical scanning, or horizontal scanning. However, the scanning type may not be limited thereto. One or more scanning types with a predetermined angle may be added to the scanning type candidate list. Diagonal scanning is a scanning method of scanning coefficients from the upper right corner to the lower left corner. Vertical scanning is a scanning method of scanning coefficients from bottom to top. Horizontal scanning is a scanning method of scanning coefficients from right to left. The scanning type may be any of these.

[0186] The scan type may be determined based on at least one of the coding block information (e.g., maximum / minimum size, partitioning technique, etc.), the size / shape of the transform block, the size / shape of the coefficient group, the prediction mode, the intra-frame prediction information (e.g., the intra-frame prediction mode value, directionality, angle, etc.), and the inter-frame prediction information. Alternatively, the video encoding device may determine the best scan type among the scan type candidates that can be used to scan the transform block, and may encode an index indicating the determined scan type. The scan type candidates include at least one of diagonal scanning, vertical scanning, horizontal scanning, zigzag scanning, and Z scanning. The number and type of scan types may vary from transform block to transform block, and may be determined based on at least one of the information about the coding block, the size / shape / depth of the transform block, the size / shape of the coefficient group, the prediction mode, the information about the intra-frame prediction, and the information in the inter-frame prediction.

[0187] When the size of the transform block is greater than the critical value, the coefficients within a portion of the transform block may be set to zero. The size of the transform block may be represented by width, height, the sum of width and height, the number of transform coefficients, or any combination thereof. The predetermined critical value may represent the size present in the video encoding device. The portion to which the transform coefficient is set to zero may be one or more coefficient rows at the lower end of the transform block, or one or more coefficient columns at the right end of the transform block. The portion may be determined according to the critical value. For example, an area outside the critical value size within the specified transform block, and the coefficients belonging to the corresponding area may be set to zero. For example, for an NxM transform block, when N is greater than a critical value of 64, the transform coefficients on the 64 rows and / or columns at the upper and / or left ends of the transform block remain intact, and other transform coefficients may be set to zero. When M is greater than a critical value of 64, the transform coefficients of the 64 low points and / or columns at the upper and / or left ends remain intact, and other transform coefficients may be set to zero.

[0188] Fig.14 A method of scanning a square transform block according to an embodiment to which the present invention is applied is shown.

[0189] exist Fig.14 In the embodiment, an 8×8 transform block consists of four coefficient groups, and transform coefficients in the 8×8 transform block can be scanned on a per-group basis. Fig.14 (a) shows a diagonal scan of a transform block, where the transform coefficients are scanned in the order of a lower right coefficient group, an upper right coefficient group, a lower left coefficient group, and an upper left coefficient group according to a scanning order of a diagonal scan type, where the transform coefficients in each group are scanned from the upper right end to the lower left end. Fig.14 (b) shows horizontal scanning of a transform block, where the transform coefficients are scanned in the order of a lower right coefficient group, a lower left coefficient group, an upper right coefficient group and an upper left coefficient group according to a scanning order of a horizontal scanning type, where the transform coefficients in each group are scanned from right to left. Fig.14 (c) shows the vertical scanning of the transform block, where the transform coefficients are scanned in the order of the lower right coefficient group, the upper right coefficient group, the lower left coefficient group and the upper left coefficient group according to the scanning order of the vertical scanning type, where the transform coefficients in each group are scanned from bottom to top.

[0190] Fig.15 and 16 A method of scanning a non-square transform block according to an embodiment to which the present invention is applied is shown.

[0191] Fig.15 A method of scanning an 8×4 transform block is shown.

[0192] Fig.15(a) shows the case where the scan type is diagonal scanning and the scanning is performed on a per-group basis, where a group includes 4×4 coefficients. In this case, the transform coefficients in the transform block can be scanned from the bottom coefficient group to the top coefficient group, where the coefficients in each group are scanned from the upper right end to the lower left end according to the diagonal scanning direction. Fig.15 (b) shows the case where the scan type is vertical scanning and scanning is performed on a per-group basis, where a group includes 4×4 coefficients. In this case, the transform coefficients in the transform block can be scanned from the bottom coefficient group to the top coefficient group, where the coefficients in each group are scanned from bottom to top according to the vertical scanning direction. Fig.15 (c) shows the case where the scan type is horizontal scan and scanning is performed on a per-group basis, where a group includes 4×4 coefficients. In this case, the transform coefficients in the transform block can be scanned from the bottom coefficient group to the top coefficient group, where the coefficients in each group are scanned from right to left according to the horizontal scan direction. Alternatively, Fig.15 As shown in (d), the transform coefficients in the 8×4 transform block can be scanned in each group, where a group includes 8×4 transform coefficients, and the scanning is performed from bottom to top according to the vertical scanning direction. For the 8×4 block, the scan type candidate may include at least one of diagonal scanning, vertical scanning, and horizontal scanning, and the coefficient group may be a 4×4 group or an 8×4 group. The method of determining the scan type and the scan group may be the same as described above.

[0193] Fig.16 The scanning method for a 4x8 transform block is shown.

[0194] Fig.16 (a) shows the case where the scan type is diagonal scanning and scanning is performed on a per-group basis, where the scan group is a group of 4×4 coefficients. In this case, the transform coefficients in the transform block can be scanned from the left coefficient group to the right coefficient group, where the coefficients in each group are scanned from the upper right end to the lower left end according to the diagonal scan direction. Fig.16 (b) shows the case where the scan type is vertical scanning and scanning is performed on a per-group basis, where the scan group is a group of 4×4 coefficients. In this case, the transform coefficients in the transform block can be scanned from the right coefficient group to the left coefficient group, where the coefficients in each group are scanned from bottom to top according to the vertical scan direction. Fig.16 (c) shows the case where the scan type is horizontal scan and scanning is performed on a per-group basis, where the scan group is a group of 4×4 coefficients. In this case, the transform coefficients in the transform block can be scanned from the right coefficient group to the left coefficient group, where the coefficients in each group are scanned from right to left according to the horizontal scan direction. Or, Fig.16As shown in (d), the transform coefficients in the 4×8 transform block can be scanned on each group, where the scan group is a group of 4×8 coefficients, and the scanning is performed from right to left according to the horizontal scanning direction. For a 4×8 block, the scan type candidate may include at least one of diagonal scanning, vertical scanning, and horizontal scanning, and the coefficient group may be a 4×4 group or a 4×8 group. The method of determining the scan type and the scan group may be the same as described above.

[0195] The video decoding device may obtain the transform coefficients in the transform block by entropy decoding the received bit stream. The video decoding device may determine the scan type based on at least one of the coding block information (e.g., maximum / minimum size, partitioning technique, etc.), the size / shape of the transform block, the size / shape of the coefficient group, the prediction mode, the intra-frame prediction information (e.g., the intra-frame prediction mode value, directivity, angle, etc.), and the inter-frame prediction information. When the intra-frame prediction mode has horizontal directivity, vertical scanning may be used. When the intra-frame prediction mode has vertical directivity, horizontal scanning may be used. The video decoding device may specify any one of a plurality of scan type candidates based on the energy of the transform coefficient or an index signaled from the video encoding device.

[0196] Reference Figures 17 to 19 , a method of applying loop filtering to block boundaries will be described.

[0197] Fig.17 The scope of applying loop filtering according to an embodiment of applying the present invention is shown.

[0198] refer to Fig.17 , the dotted line represents the visual block boundary, the thick solid line represents the coding block boundary, and the thin solid line represents the pixel boundary. Here, the virtual block may represent a sub-block of arbitrary size and / or shape within the coding block. Loop filtering can be applied symmetrically or asymmetrically to virtual block boundaries or coding block boundaries. Loop filtering can be applied to equal areas (ranges) of each block or to different ranges of each block according to the properties of the block. The shape of the range to which the loop filtering is applied (hereinafter referred to as the application range) may be in the form of a one-dimensional band or in the form of a two-dimensional block. In the present invention, information about loop filtering may be fixed information preset in the video encoding device and the video decoding device, or may be variable information notified using bitstream signaling.

[0199] In the present embodiment, for ease of description, it is assumed that the shape of the filter is one-dimensional and the application range covers two pixels on each side of the block boundary (ie, two pixels on the left and two pixels on the right of the block boundary).

[0200] refer to Fig.17 (a), the gray pixels around the boundary 401 are the pixels to which the loop filter is applied. When the virtual block has a small size, such as Fig.17As shown in (b), the application range around the virtual block boundary 411 overlaps with the application range around the virtual block boundary 412. On the other hand, when the virtual block has Fig.17 (c) When the size is large, there may be an area that is not covered by the application range around the virtual block boundary 421 or the application range around the virtual block boundary 422. That is, various embodiments may exist according to at least one of the size of the application range for filtering and the size of the virtual block.

[0201] For example, when the application range for filtering covers Fig.17 (a) and 17 (b) when the three pixels on each side of the boundary (i.e., three pixels on the left and three pixels on the right), there is an area where the filter is applied multiple times. On the other hand, when the application range of the filter covers Fig.17 In (a) to 17 (c), when there is one pixel on each side of the boundary (i.e., one pixel on the left and one pixel on the right), there are multiple areas where filtering is not applied. In one embodiment, the application range for filtering can be zero pixels on each side of the boundary. That is, the application of loop filtering can be skipped.

[0202] Fig.17 (e), 17(f) and 17(g) show the coding block boundary and the virtual block boundary. Here, the dark gray area indicates the application range around the coding block boundary where the loop filter is applied, and the light gray area indicates the application range around the virtual block boundary where the loop filter is applied. Fig.17 As shown in (e), the shapes / sizes of the loop filters for the coded block and the virtual block may be the same as each other. Fig.17 As shown in (f), loop filtering can be applied only to coding block boundaries, and the application of loop filtering to virtual block boundaries can be skipped. Fig.17 As shown in (g), the loop filter for the coding block boundary and the loop filter for the virtual block boundary can have different application ranges. When the virtual block is a non-square block, the filters for the horizontal boundary and the vertical boundary, respectively, can be different in at least one of the size, shape or application range of the filter. For blocks to which loop filtering is applied multiple times, the application of loop filtering to the entire area or overlapping area can be skipped.

[0203] Fig.18 A method for determining an application range for loop filtering according to an embodiment of the present invention is shown.

[0204] Reference Fig.18 , loop filtering information can be obtained (S1800).

[0205] The loop filter information may include at least one of filter information for a boundary of a virtual block and filter information for a boundary of a coding block. One piece of loop filter information may be used together to filter a coding block boundary and to filter a virtual block boundary. Filter information for a virtual block boundary may be used to filter a coding block boundary, and conversely, filter information for a coding block boundary may be used to filter a virtual block boundary. Different filter information may be used for coding block boundaries and virtual block boundaries, respectively.

[0206] The information may be signaled using a bitstream, derived, or may be information preset in the video encoding device and the video decoding device. Part of the information may be signaled using a bitstream, and the remaining information may be information preset in the video encoding device and the video decoding device.

[0207] It can be determined whether the current boundary is a boundary to which loop filtering is applied (S1810). A method for deriving / determining a coding block boundary and / or a virtual block boundary to which loop filtering is applied based on information notified using bitstream signaling can be preset in a video decoding device, or can be determined based on derived information.

[0208] When it is determined that the current boundary is a boundary to which loop filtering is applied, loop filtering may be applied to the current boundary (S1820). The application of loop filtering may include a process of determining an optimal loop filter suitable for the current boundary. The size / shape of the loop filter of the current boundary may be determined based on at least one of a quantization parameter, a pixel value on the boundary, a value of one or more adjacent pixels, a reference picture index, information about whether the boundary corresponds to a luminance component, a type of a chrominance component, a length of the boundary, and an attribute of a block to which the boundary belongs.

[0209] On the other hand, when it is determined that the current boundary is not a boundary to which the loop filtering is applied, the loop filtering may not be applied to the current boundary (S1830).

[0210] On / off information about the application of loop filtering can be signaled using a bitstream at any level of various levels, such as sequence level, picture level, slice level, tile level, block level, coding unit group level, coding unit level, and sub-coding unit level. Although ON is set for a higher level, selective application can be performed at a lower level according to the ON / OFF information. ON information indicating that loop filtering is applied to both coding block boundaries and virtual block boundaries can be signaled at the video sequence level. OFF information indicating that loop filtering is neither applied to coding block boundaries nor to virtual block boundaries within a specific picture can be signaled.

[0211] When the size of the virtual block is equal to the size of one pixel, the pixels constituting each virtual block may have different motion vectors. In this case, the application of loop filtering to the virtual block boundary may be skipped. Fig.17 As shown in (b), when the application range for loop filtering extends over two boundaries, the application of loop filtering to one of the two boundaries can be skipped. In some cases, loop filtering can be applied only to coding block boundaries, and the application of loop filtering to virtual block boundaries can be selectively skipped.

[0212] Fig.19 A method of applying loop filtering to the boundaries of geometric shapes according to an embodiment of the present invention is shown.

[0213] according to Fig.10 (f) and 10(g), the boundaries can have any shape other than a rectangle. In this case, Fig.19 As shown, loop filtering can be applied. Fig.19 (a) and 19(b) show the block boundaries, Fig.19 (c) and 19(d) are enlarged views thereof. Fig.19 In (c) and 19(d), the squares represent pixels. Loop filtering is applied to every two pixels at the boundary. The shape of the boundary and the filter application range may vary depending on the embodiment.

[0214] The present disclosure may also have the following configurations:

[0215] 1. An inter-frame prediction method, comprising:

[0216] Obtaining information about refinement of a motion vector of a current block;

[0217] Reconstruct the motion vector of the current block;

[0218] performing motion compensation on the current block using the motion vector;

[0219] refining the motion vector of the current block using at least one or both of an output of the motion compensation and information on refinement of the motion vector; and

[0220] Motion compensation is performed on the current block using the refined motion vector.

[0221] 2. An intra-frame prediction method, comprising:

[0222] reconstructing the first subblock by performing intra prediction on the first subblock within the current block based on reference pixels of the current block; and

[0223] Intra prediction is performed on a second subblock within the current block using a reference pixel of the current block or at least one pixel within the reconstructed first subblock.

[0224] 3. A method for scanning transformation coefficients, the method comprising:

[0225] Obtaining transform coefficients of the transform block by decoding the bitstream; and

[0226] scanning transform coefficients of the transform block based on a predetermined scan type,

[0227] where the scanning is performed on a per-group basis, where the group is a set of M×M coefficients, and

[0228] A scan type is selected from a plurality of scan type candidates based on a signaled index.

[0229] 4. A video decoding device, comprising:

[0230] an entropy decoding unit configured to obtain motion vector refinement information about a current block;

[0231] The inter-frame prediction unit is configured to reconstruct a motion vector of a current block, perform motion compensation on the current block using the motion vector, refine the motion vector of the current block using at least one or both of an output of the motion compensation and motion vector refinement information about the current block, and perform motion compensation on the current block using the refined motion vector.

[0232] 5. A video decoding device, comprising:

[0233] The intra prediction unit is configured to perform intra prediction on a first subblock within the current block based on reference pixels of the current block, reconstruct the first subblock, and perform intra prediction on a second subblock within the current block using at least one or both of the reference pixels of the current block and pixels within the reconstructed first subblock.

[0234] 6. A video decoding device, comprising:

[0235] an entropy decoding unit configured to obtain a transform coefficient of a transform block by decoding a bit stream; and

[0236] a realignment unit configured to scan transform coefficients of the transform block based on a predetermined scan type,

[0237] where the scanning is performed on a per-group basis, where the group is a set of M×M coefficients, and

[0238] A scan type is selected from a plurality of scan type candidates based on a signaled index.

[0239] Although the exemplary methods of the present disclosure are presented as a series of steps for clarity of description, the exemplary methods are not intended to limit the order of the steps. Some steps may be performed simultaneously, or may be performed in a different order as desired. In order to implement the methods presented in the present disclosure, additional steps may be added to the exemplary methods, some steps in the exemplary methods may be omitted, or some steps in the exemplary methods may be omitted, and additional steps may be added to the exemplary methods.

[0240] The various embodiments in the present disclosure are not intended to show all possible combinations, but are intended to show only some representative aspects of the present disclosure. The elements described in the various embodiments may be applied independently, or two or more of them may be combined for use.

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

[0242] The scope of the present disclosure includes software or machine executable commands (e.g., operating systems, applications, firmware, programs, etc.) that enable the methods of various embodiments to be executed on a device or computer, as well as non-transitory computer-readable media in which such software or machine executable commands are stored so that they can be executed on a device or computer.

[0243] Industrial Applicability

[0244] The present invention can be used for encoding / decoding video signals.

Claims

1. A video decoding method, comprising: performing a first intra prediction on a first subblock within the current block using one or more reference pixels of the current block; performing a second intra prediction on a second subblock adjacent to the first subblock in the current block using at least one reference pixel of the current block or one or more reconstructed pixels of the first subblock, the reconstructed pixels being generated based on an output of the first intra prediction; as well as The current block is reconstructed based on the predicted first sub-block and the predicted second sub-block.

2. The video decoding method according to claim 1, in, The current block includes a plurality of sub-blocks, and the number of the sub-blocks is determined based on the size of the current block.

3. The video decoding method according to claim 1, in, The current block includes a plurality of sub-blocks, and a shape of each sub-block is determined based on an intra-prediction mode of the current block.

4. A video encoding method, comprising: performing a first intra prediction on a first subblock within the current block using one or more reference pixels of the current block; performing a second intra prediction on a second subblock adjacent to the first subblock in the current block using at least one reference pixel of the current block or one or more reconstructed pixels of the first subblock, the reconstructed pixels being generated based on an output of the first intra prediction; as well as Intra prediction information related to the first intra prediction and the second intra prediction is encoded into a bitstream.

5. The video encoding method according to claim 4, in, The current block includes a plurality of sub-blocks, and the number of the sub-blocks is determined based on the size of the current block.

6. The video encoding method according to claim 4, in, The current block includes a plurality of sub-blocks, and a shape of each sub-block is determined based on an intra-prediction mode of the current block.

7. A non-transitory computer-readable recording medium storing a bit stream generated by a video encoding method, the video encoding method comprising: performing a first intra prediction on a first subblock within the current block using one or more reference pixels of the current block; performing a second intra prediction on a second subblock adjacent to the first subblock in the current block using at least one reference pixel of the current block or one or more reconstructed pixels of the first subblock, the reconstructed pixels being generated based on an output of the first intra prediction; as well as Intra prediction information related to the first intra prediction and the second intra prediction is encoded into a bitstream.