Image signal encoding / decoding method and device
Patent Information
- Application Number
- IN202218007119
- Authority / Receiving Office
- IN · IN
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2017-01-16
- Filing Date
- 2022-02-10
- Publication Date
- 2026-10-24
- Estimated Expiration
- 2038-01-16
AI Technical Summary
The current High Efficiency Video Coding (HEVC) standard has limitations in prediction accuracy due to the use of only one prediction method per coding block and restricted prediction modes, which affects the efficiency of multimedia data compression.
An image signal encoding/decoding method that allows multiple prediction methods for a single coding block, including intra, inter, and hybrid modes, where the coding block is divided into sub-blocks to utilize prediction information from neighboring blocks and apply advanced modes like DMID and DIMD for improved prediction.
This approach enhances prediction accuracy and compression efficiency by allowing multiple prediction methods and considering the positional characteristics of prediction blocks, leading to improved video coding performance.
Abstract
Description
Technical Field[1] The present invention relates to an image signalencoding / decoding method and apparatus. More particularly, thepresent invention relates to an image signal encoding / decodingmethod and apparatus using hybrid mode as coding mode.Background Art[2] In recent years, demand for multimedia data such as videohas been rapidly increasing on the Internet. However, it isdifficult for development of technology for improving channelbandwidths to keep up with the rapid changes in the demand formultimedia data. Therefore, Video Coding Expert Group (VCEG) ofITU-T and Moving Picture Expert Group (MPEG) of ISO / IEC whichare international standardization organizations have agreed toestablish High Efficiency Video Coding (HEVC) version 1.0 as anew moving picture compression standard.[3] HEVC defines techniques such as intra prediction, interprediction, transformation, quantization, entropy coding, andin-loop filtering.[4] HEVC which is the current moving image compressionstandard has a problem that accuracy of prediction isrelatively low. One of the causes is that only one prediction(intra prediction or inter prediction) can be performed forprediction of one coding block (or one coding unit).[5] Another cause is that the HEVC allows only AMVP mode,merge mode, and skip mode for inter prediction.[6] A further cause is that the HEVC allows only planar mode,DC mode, and angular mode for intra prediction.DisclosureTechnical Problem[7] The present invention has been made to solve the abovementionedproblems, and an object of the present invention isto provide a method of performing prediction using two or moreprediction methods for one coding block.[8] Another object of the present invention is to provide amethod of determining an inter picture prediction mode bytaking into account positional characteristics of a predictionblock in an inter picture prediction block.[9] A further object of the present invention is to provide amethod of determining an intra prediction mode by taking intoaccount characteristics of location of a prediction blockwithin an intra prediction block.
[10] The technical problems to be solved by the presentdisclosure are not limited to the above-mentioned ones, andother technical problems which are not mentioned above will beclearly understood from the following description by thoseskilled in the art.Technical Solution
[11] According to one aspect o f the present disclosure, animage decoding method includes: decoding coding modeinformation of a current coding block; dividing the currentcoding block into at least one prediction block; and generatinga prediction sample of the at least one prediction block usingthe decoded coding mode information, in which the coding modeinformation is information indicating any one mode among intramode, inter mode, and hybrid mode.
[12] In the image decoding method, when the coding modeinformation of the current coding block indicates hybrid mode,the current coding block may be divided into a first predictionblock and a second prediction block.
[13] In the image decoding method, when the coding modeinformation of the current coding block indicates hybrid mode,a prediction sample of the first prediction block may begenerated using prediction information of at least oneneighboring block of the first prediction block, and aprediction sample of the second prediction block may begenerated using prediction information derived by one modeamong intra prediction mode, inter prediction mode, decoder25side motion information derivation (DMID) mode, and decoder-side intra mode derivation (DIMD) mode.
[14] In the image decoding method, when the coding modeinformation of the current coding block indicates hybrid mode,prediction information of the second prediction block may bederived by decoding the pr ediction information of the secondprediction block.
[15] In the image decoding method, the DMID mode may be aprocess of deriving final motion information on the basis ofinitial motion information derived from a neighboring block ofa coding block, and the derived final motion information may beused as prediction information of a prediction block within thecoding block.
[16] In the image decoding method, the DIMD mode may be aprocess of setting a template block from a reconstructed regionaround a coding block and using an intra prediction mode bywhich an optimal prediction pixel value of the template blockis derived as prediction information of a prediction blockwithin the coding block.
[17] In the image decoding method, the at least one predictionblock may be a corner-partitioned portion within the currentcoding block.
[18] In the image decoding method, when the at least oneprediction block is a corner-partitioned portion within thecurrent coding block, diagonal filtering may be performed onpixels adjacent to a corner boundary of a prediction block.
[19] According to one aspect of the present invention, an imageencoding method includes: dividing a current coding block intoat least one prediction block; and generating a predictionsample of the at least one prediction block using coding modeinformation of the current co ding block, in which the codingmode information is information indicating any one mode amongintra mode, inter mode, and hybrid mode.
[20] In the image encoding method, when the coding modeinformation of the current coding block indicates hybrid mode,the current coding block may be divided into a first predictionblock and a second prediction block.
[21] In the image encoding method, when the coding modeinformation of the current coding block indicates hybrid mode,a prediction sample of the first prediction block may begenerated using prediction information of at least oneneighboring block of the first prediction block, and aprediction sample of the second prediction block may begenerated using prediction information derived by one modeamong intra prediction mode, inter prediction mode, decoder20side motion information derivation (DMID) mode, and decodersideintra mode derivation (DIMD) mode.
[22] In the image encoding method, when the coding modeinformation of the current coding block indicates hybrid mode,a prediction mode of the second prediction block may bedetermined and the prediction mode information of the secondprediction block may be encoded.
[23] In the image encoding method, the at least one predictionblock may be a corner block partitioned from the current codingblock.
[24] In the image encoding method, when the at least oneprediction block is a corner block partitioned from the currentcoding block, diagonal filtering may be performed on pixelsadjacent to a corner boundary of a prediction block.
[25] According to one aspect of the present invention, arecording medium contains a bitstream generated by an imageencoding method including dividing a current coding block intoat least one prediction block; and generating a predictionsample of the at least one prediction block using coding modeinformation of the current coding block, in which the codingmode information is information indicating any one mode amongintra mode, inter mode, and hybrid mode.
[26] According to one aspect of the present invention, an imagedecoding method includes decoding inter hybrid mode informationof a current coding block and generating a prediction sample ofa prediction block within the current coding block on the basisof the inter hybrid mode information, in which when the currentcoding block is encoded in inter hybrid mode, the generating ofthe prediction sample of the prediction block includes dividingthe current coding block into a first prediction block and asecond prediction block, deriving motion information of thefirst prediction block, generating a prediction sample of thefirst prediction block using the motion information of thefirst prediction block, deriving motion information of thesecond prediction block using any one mode among merge mode,AMVP mode, decoder-side m otion information derivation (DMID)mode, generating a prediction sample of the second predictionblock using the derived motion information of the secondprediction block.
[27] In the image decoding method, a prediction mode to be usedto derive motion information of the second prediction block maybe determined by decoding inter prediction mode information ofthe second prediction block.
[28] In the image decoding method, the DMID mode may be aprocess of deriving final motion information on the basis ofinitial motion information derived from a neighboring block ofa coding block and using the derived final motion informationas prediction information of a prediction block within thecoding block.
[29] In the image decoding method, the dividing of the currentcoding block into the first prediction block and the secondprediction block may be a process of corner-partitioning thecurrent coding block.
[30] In the image decoding method, when the first predictionblock and the second prediction block are corner-partitionedportions within the current coding block, diagonal filteringmay be performed on pixels adjacent to a corner boundary of thefirst prediction block.
[31] According to one aspect of the present invention, an imageencoding method includes encoding inter hybrid mode informationof a current coding block and generating a prediction sample ofa prediction block within the current coding block on the basisof the inter hybrid mode information, in which when the currentcoding block is encoded in inter hybrid mode, the generating ofthe prediction sample of the prediction block includes dividingthe current coding block into a first prediction block and asecond prediction block, deriving motion information of thefirst prediction block, generating a prediction sample of thefirst prediction block using the motion information of thefirst prediction block, deriving motion information of thesecond prediction block using any one mode among merge mode,AMVP mode, decoder-side motion information derivation (DMID)mode, generating a prediction sample of the second predictionblock using the derived motion information of the secondprediction block.
[32] In the image encoding method, a prediction mode used toderive motion information of the second prediction block may bedetermined on the basis of inter prediction mode information ofthe second prediction block.
[33] In the image encoding method, the DMID mode may be aprocess of deriving final motion information on the basis ofinitial motion information derived from a neighboring block ofa coding block and using the derived final motion informationas motion information of a prediction block within the codingblock.
[34] In the image encoding method, the dividing of the currentcoding block into the first prediction block and the secondprediction block may be a process of corner-partitioning thecurrent coding block.
[35] In the image encoding method, when the first predictionblock and the second prediction block are corner-partitionedportions within the current coding block, diagonal filteringmay be performed on pixels adjacent to an edge boundary of thefirst prediction block.
[36] According to one aspect of the present invention, arecording medium contains a bitstream generated by an imageencoding method including: encoding inter hybrid modeinformation of a current coding block and generating aprediction sample of a prediction block within the currentcoding block on the basis of the inter hybrid mode information,in which when the current coding block is encoded in interhybrid mode, the generating of the prediction sample of theprediction block includes dividing the current coding blockinto a first prediction block and a second prediction block,deriving motion information of the first prediction block usingmerge mode, generating a prediction sample of the firstprediction block using the derived motion information of thefirst prediction block, deriving motion information of thesecond prediction block using any one mode among merge mode,AMVP mode, decoder-side motion information derivation (DMID)mode, generating a prediction sampl e of the second predictionblock using the derived motion information of the secondprediction block.
[37] According to one aspect of the present invention, an imagedecoding method includes decoding inter hybrid mode informationof a current coding block and generating a prediction sample ofa prediction block within the current coding block on the basisof the inter hybrid mode information, in which when the currentcoding block is encoded in inter hybrid mode, the generating ofthe prediction sample of the prediction block includes dividingthe current coding block into a first prediction block and asecond prediction block, deriving motion information of thefirst prediction block, generating a prediction sample of thefirst prediction block using the motion information of thefirst prediction block, deriving motion information of thesecond prediction block using any one mode among merge mode,AMVP mode, decoder-side motion information derivation (DMID)mode, generating a prediction sample of the second predictionblock using the derived motion information of the secondprediction block.
[38] In the image encoding method, when the DMID mode may be aprocess of deriving final motion information on the basis ofinitial motion information derived from a neighboring block ofa coding block and using the derived final motion informationas prediction information of a prediction block within thecoding block.
[39] In the image decoding method, the generating of theprediction sample of the first prediction block may be aprocess of generating the prediction sample of the firstprediction block by using an intra prediction mode of aneighboring block determined according to a predeterminedpriority among neighboring blocks of the first prediction blockas an intra prediction mode of the first prediction block.
[40] In the image decoding method, the generating of theprediction sample of the first prediction block may be aprocess of generating the prediction sample of the firstprediction block by using an intra prediction mode of aneighboring block determined according to neighboring blockindex information as an intra prediction mode of the firstprediction block.
[41] In the image decoding method, the dividing of the currentcoding block into the first prediction block and the secondprediction block may be a process of corner-partitioning thecurrent coding block.
[42] In the image decoding method, when the first predictionblock and the second prediction block are corner-partitionedportions within the current coding block, diagonal filteringmay be performed on pixels adjacent to an edge boundary of thefirst prediction block.
[43] According to one aspect of the present invention, an imageencoding method includes encoding inter hybrid mode informationof a current coding block and generating a prediction sample ofa prediction block within the current coding block on the basisof the inter hybrid mode information, in which when the currentcoding block is encoded in inter hybrid mode, the generating ofthe prediction sample of the prediction block includes dividingthe current coding block into a first prediction block and asecond prediction block, deriving motion information of thefirst prediction block, generating a prediction sample of thefirst prediction block using the motion information of thefirst prediction block, deriving motion information of thesecond prediction block using any one mode among merge mode,AMVP mode, decoder-side motion information derivation (DMID)mode, generating a prediction sample of the second predictionblock using the derived motion information of the secondprediction block.
[44] In the image encoding method, the generating of theprediction sample of the first prediction block may be aprocess of generating the prediction sample of the firstprediction block by using an intra prediction mode of aneighboring block determined according to a predeterminedpriority among neighboring blocks of the first prediction blockas an intra prediction mode of the first prediction block.
[45] In the image encoding method, the generating of theprediction sample of the first prediction block may be aprocess of generating the prediction sample of the firstprediction block by using an intra prediction mode of aneighboring block determined according to neighboring blockindex information as an intra prediction mode of the firstprediction block.
[46] In the image encoding method, the dividing of the currentcoding block into the first prediction block and the secondprediction block may be a process of corner-partitioning thecurrent coding block.
[47] In the image encoding method, when the first predictionblock and the second prediction block are corner-partitionedwithin the current coding block, diagonal filtering may beperformed on pixels adjacent to an edge boundary of the firstprediction block.
[48] According to one aspect of the present invention, arecording medium contains a bitstream generated by an imageencoding method including encoding inter hybrid modeinformation of a current coding block and generating aprediction sample of a prediction block within the currentcoding block on the basis of the inter hybrid mode information,in which when the current coding block is encoded in interhybrid mode, the generating of the prediction sample of theprediction block includes dividing the current coding blockinto a first prediction block and a second prediction block,deriving motion information of the first prediction block,generating a prediction sample of the first prediction blockusing the motion information of the first prediction block,deriving motion information of the second prediction blockusing any one mode among merge mode, AMVP mode, decoder-sidemotion information derivation (DMID) mode, generating aprediction sample of the second prediction block using thederived motion information of the second prediction block.Advantageous Effects
[49] The present invention can improve the accuracy ofprediction by making predictions using two or more predictionmethods for a coding block.
[50] The present invention can improve the efficiency ofcompression by making predictions using two or more predictionmethods for a coding block.
[51] The present invention can improve the accuracy ofprediction by determining an inter prediction mode taking intoaccount characteristics of the location of a prediction blockwithin a coding block.
[52] The present invention can improve the efficiency ofcompression by determining an inter prediction mode taking intoaccount characteristics of the location of a prediction blockwithin a coding block.
[53] The present invention can improve the accuracy ofprediction by determining an intra prediction mode taking intoaccount characteristics of the location of a prediction blockwithin a coding block.
[54] The present invention can improve the efficiency ofcompression by determining an intra prediction mode taking intoaccount characteristics of the location of a prediction blockwithin a coding block.
[55] The effects and advantages that can be achieved by thepresent disclosure are not limited to the ones mentioned above,and other effects and advantages which are not mentioned abovebut can be achieved by the present disclosure can be clearlyunderstood by those skilled in the art from the followingdescription.Description of Drawings
[56] FIG. 1 is a block diagram illustrating an image encodingapparatus according to one embodiment of the present invention;
[57] FIG. 2 is a flowchart illustrating an Intra predictionmode according to one embodiment of the present invention;
[58] FIG. 3 is a flowchart illustrating a method of encodingthe optimal prediction mode of a current prediction block amongintra prediction modes;
[59] FIG. 4 is a diagram illustrating a method of setting a MPMcandidate for intra prediction, according to one embodiment ofthe present invention;
[60] FIG. 5 is a flowchart illustrating a method of setting anAMVP candidate for inter prediction, according to oneembodiment of the present invention;
[61] FIG. 6 is a diagram showing locations of neighboringblocks of a current prediction block;
[62] FIG. 7 is a diagram illustrating a method of derivingmotion information of a temporal candidate;
[63] FIG. 8 is a flowchart illustrating a method of selecting acandidate for merge mode from among inter prediction modes,according to one embodiment of the present invention;
[64] FIG. 9 is a flowchart illustrating a method of encodinginformation of inter prediction mode, according to oneembodiment of the present invention;
[65] FIG. 10 is a block diagram of an image decoding apparatusaccording to one embodiment of the present invention;
[66] FIG. 11 is a flowchart illustrating a method of decodingoptimal intra prediction mode for a current prediction block;
[67] FIG. 12 is a flowchart illustrating a method of decodinginformation of inter prediction mode, according to oneembodiment of the present invention;
[68] FIG. 13 is a diagram illustrating a first method ofdividing a current coding block;
[69] FIG. 14 and FIG. 15 are diagrams illustrating a secondmethod of dividing a current coding block;
[70] FIGS. 16A, 16B, and 16C and FIGS. 17A, 17B, and 17C arediagrams illustrating a method of determining predictioninformation of prediction blocks within a coding block that isencoded / decoded with hybrid mode;
[71] FIGS. 18A, 18B, and 18C are diagrams illustrating thelocations and sizes of nearby template blocks for each splittype when DMID mode is used;
[72] FIG. 19 is a diagram illustrating a method of derivingmotion information in DMID mode;
[73] FIG. 20 is a diagram illustrating a method of encodingprediction information in hybrid mode;
[74] FIG. 21 is a flowchart illustrating a method ofdetermining the optimal prediction mode among intra predictionmode, inter prediction mode, and hybrid mode, in an imageencoding apparatus;
[75] FIG. 22 is a flowchart illustrating a method of encodingprediction information of a prediction block within a codingblock that is encoded with hybrid mode, in an image encodingapparatus;
[76] FIG. 23 is a flowchart illustrating a method of encodingprediction information in DMID mode;
[77] FIG. 24 is a flowchart illustrating a method ofdetermining a prediction mode for a prediction block within acoding block that is encoded with hybrid mode, in an imageencoding apparatus;
[78] FIG. 25 is a flowchart illustrating a method of decodingprediction information in hybrid mode;
[79] FIG. 26 is a flowchart illustrating a method of decodingprediction information in DMID mode;
[80] FIG. 27 is a diagram illustrating a boundary filteringmethod;
[81] FIG. 28 is a flowchart illustrating an encoding methodaccording to a first embodiment of the present invention;
[82] FIG. 29 is a flowchart illustrating an image decodingmethod according to a first embodiment of the presentinvention;
[83] FIG. 30 is a diagram illustrating a method of deriving anintra prediction mode in DIMD mode;
[84] FIG. 31 is a diagram illustrating a method of encodingprediction information of a current coding block according to asecond embodiment of the present invention;
[85] FIG. 32 is a flowchart illustrating a method of encodinginformation of inter hybrid mode in an image encodingapparatus;
[86] FIG. 33 is a flowchart illustrating a method ofdetermining a prediction mode of a second prediction block in acoding block that is encoded with inter hybrid mode, in animage encoding apparatus;
[87] FIG. 34 is a diagram illustrating a method of decodingprediction information of a current coding block according to asecond embodiment of the present invention;
[88] FIG. 35 is a flowchart illustrating an image decodingmethod according to a second embodiment of the presentinvention;
[89] FIG. 36 is a flowchart illustrating the image decodingmethod according to the second embodiment of the presentinvention;
[90] FIG. 36 is a flowchart illustrating an image encodingmethod according to a second embodiment of the presentinvention;
[91] FIG. 38 is a diagram illustrating a method of encodingprediction information of a current coding block according to athird embodiment of the present invention;
[92] FIG. 39 is a flowchart illustrating a method of encodinginformation of intra hybrid mode in an image encodingapparatus;
[93] FIG. 40 is a flowchart illustrating a method ofdetermining prediction information of a first prediction blockin a coding block that is encoded with intra hybrid mode in animage encoding apparatus;
[94] FIG. 41 is a flowchart illustrating a method of decodingprediction information of a current coding block according to athird embodiment of the present invention;
[95] FIG. 42 is a flowchart illustrating an image decodingmethod according to a third embodiment of the presentinvention;
[96] FIG. 43 is a flowchart illustrating the image decodingmethod according to the third embodiment of the presentinvention; and
[97] FIG. 44 is a flowchart illustrating an image encodingmethod according to the third embodiment of the presentinvention.Best Mode
[98] The present invention may be changed in various ways andmay be embodied in many forms. Thus, specific embodiments willbe illustrated in the drawings and will be described herein indetail. While specific embodiments of the invention will bedescribed herein below, they are only illustrative purposes andshould not be construed as limiting to the present invention.Accordingly, the present invention should be construed to covernot only the specific embodiments but also cover allmodifications, equivalents, and substitutions that fall withinthe sprit and technical scope of the present invention.Throughout the drawings, like elements are denoted by likereference numerals.
[99] Terms used in the specification, “first”, “second”, etc.,may be used to describe various components, but the componentsare not to be construed as being limited to the terms. That is,the terms are used to distinguish one component from anothercomponent. For example, a f irst constitutive element may bereferred as a second constitutive element, and the secondconstitutive element may be also referred to as the firstconstitutive element. Moreover, the term “and / or” includes anyand all combinations of one or more of the associated listeditems.
[100] It will be understood that when any element is referred toas being "connected” or “coupled” to another element, oneelement may be directly connected or coupled to the otherelement, or an intervening element may be present therebetween.In contrast, it should be understood that when an element isreferred to as being “directly coupled” or “directly connected”to another element, there are no intervening elements present.
[101] The terminology used herein is for the purpose ofdescribing particular embodiments only and is not intended tobe limiting. As used herein, the singular forms “a”, “an”, and“the” are intended to include the plural forms as well unlessthe context clearly indicates otherwise. It will be furtherunderstood that the terms “comprises”, “includes”, or “has”when used in this specification specify the presence of statedfeatures, regions, integers, steps, operations, elements and / orcomponents, but do not preclude the presence or addition of oneor more other features, regions, integers, steps, operations,elements, components and / or combinations thereof.
[102] Hereinafter, preferred embodiments of the presentinvention will be described with reference t o the accompanyingdrawings. Hereinafter, like constituent elements are denoted bylike reference numerals throughout the drawings, and redundantexplanations for the same constituent elements will be omitted.
[103] Hereinafter, preferred embodiments of the presentinvention will be described with reference to the accompanyingdrawings. Hereinafter, like constituent elements are denoted bylike reference numerals throughout the drawings, and redundantexplanations for the same constituent elements will be omitted.
[104]
[105] FIG. 1 is a block diagram illustrating the configurationof an image encoding apparatus 100 according to one embodimentof the present invention.
[106] The image encoding apparatus 100 functions to encode animage. The image encoding apparatus 100 includes a blockpartitioning module 101, a prediction module 102, a transformmodule 103, a quantization module 104, an entropy encodingmodule 105, a dequantization module 106, an inverse transformmodule 107, an adder 108, an in-loop filter module 109, amemory module 100, and a subtractor 111.
[107] The block partitioning module may perform blockpartitioning from the largest coding block down to the smallestcoding block. The block may be partitioned by a quad-tree (QT)partition structure or a dual-tree (DT) partition structure.The QT partition structure is a method of splitting a parentblock into child blocks that are half the parent block in widthand height. The DT partition structure is a method of splittinga parent block into child blocks either width or height ofwhich is half the parent block. The DT partition structure isalso called binary tree (BT) partition structure.
[108] The block partitioning module 101 may split an input imageinto one or more blocks. The input image may vary in size andshape. I.e., the input image may be a picture, a slice, atile, a segment, or the like. A block means a coding unit (CU),a prediction unit (PU), or a transform unit (TU).
[109] Hereinafter, in embodiments of the present invention, acoding unit is used as a basic unit for performing coding, oras a basic unit for performing decoding. The term “coding unit”may mean a coding block.
[110] The prediction module 102 may include a inter predictionmodule performing inter prediction and an intra predictionmodule performing intra prediction. The prediction module 102may generate a prediction block using neighboring samplesaround a block (hereinafter, referred to as prediction block)on which prediction is to be immediately performed, within acurrent original block, or using a previously decoded referencepicture. Here, one or more prediction blocks may be generatedfrom one coding block. When one coding block has one predictionblock, the coding block and the prediction block are the same.The process in which the prediction module 102 generates aprediction block means the process in which the predictionmodule 102 generates prediction samples within a predictionblock.
[111] Prediction techniques for moving picture signals arelargely divided into inter picture prediction and intra pictureprediction. The intra picture prediction means a method ofgenerating a prediction block using neighboring samples of acurrent block and inter picture prediction means a method ofgenerating a prediction block by searching for the most similarblock to a current block from a previously encoded / decodedreference picture and then generating a prediction block usingthe samples within the most similar block. Hereinafter, theinter picture prediction will be simply referred to as interprediction and the intra picture prediction will be simplyreferred to as intra prediction.
[112] The prediction module may determine the optimal predictionmode of a prediction block using various techniques such asrate-distortion optimization which is a technique of obtaininga residual block by subtracting a prediction block from acurrent original block. The RDO cost is calculated usingExpression 1 shown below.
[113] [Equation 1]
[114]
[115] Where D is deterioration attributable to quantization, Ris rate of compression stream, J is RD cost, φ is coding mode,and λ is Lagranginan multiplier which is a scale correctioncoefficient for matching the units of error rate and bit rate.In order for a certain mode to be selected as the optimalcoding mode in the encoding process, the mode needs to asmaller J, that is, a smaller RD cost value than the othermodes. The equation for calculating a RD cost value takes botha bit rate and an error rate.
[116] Residual values (residual block) between a generatedprediction block which is the block generated throughprediction and an original block is input to the transformmodule 103. In addition, prediction mode information, motionvector information, and the like which has been used for theprediction are encoded by the entropy encoding module 105 alongwith the residual values, and then transmitted to a decoder.When a particular coding mode is used, an original coding blockmay be directly coded without undergoing a process in which theprediction module 102 generates prediction blocks from theoriginal coding block, and the resulting coded block may betransmitted to the decoder.
[117] The intra prediction module may generate prediction blocksusing information of reference pixels around a current codingblock, i.e., information of pixels within a current picture.When the coding mode of a neighboring block of a current blockto undergo intra prediction is an inter prediction mode, pixelswithin the neighboring block to which inter prediction has beenapplied may be replaced with reference pixels within aneighboring block to which intra prediction has been applied.That is, when one or more reference pixels within a specificneighboring block are not available, these unavailable pixelsmay be replaced with one or more available reference pixels.
[118] For intra prediction, there are directional predictionmodes and non-directional prediction modes. In the directionalprediction modes, reference pixels to be used are determineddepending on a prediction direction. In contrast, in the nondirectionalprediction modes, direction information is notused. The mode for predicting luminance information may bedifferent from the mode for predicting chrominance information.In order to predict chrominance information, intra predictionmode information which has been used for prediction ofluminance information, or predicted luminance signalinformation may be used.
[119] For intra prediction, a total of N+2 prediction modesincluding planar mode, DC mode, and N angular prediction modesmay be used.
[120] In FIG. 2, 201 represents a method of generating aprediction block using DC mode.
[121] Referring to 201 of FIG. 2, the average value of the pixelvalues of “a” through “s” reference pixels is applied to everyprediction sample within R1 to R4 regions. Next, a finalprediction block is generated such that a final predictionsample within the region R1 is generated by performing FIRfiltering with two nearby reference pixels “a” and “j” and afinal sample of each pixel within the regions R2 and R3 isgenerated by FIR filtering with one nearby reference pixelamong pixels “b” through “h” and “l” through “q”.
[122] In FIG. 2, 202 represents a method of generating aprediction block using planar mode.
[123] Referring to 202 of FIG. 2, in planar mode, a finalprediction block is generated by linear interpolation of atop / left reference pixel and a bottom / right copied referencepixel.
[124] In FIG 2, 203 represents N prediction directions inangular prediction mode.
[125] Referring to 203 of FIG. 2, a final prediction block isgenerated by applying a nearby reference pixel vale in aprediction direction to a prediction block.
[126] FIG. 3 is a flowchart illustrating a method of encodingthe optimal prediction mode of a current prediction block.
[127] Referring to FIG. 3, in step S301, a most probable mode(MPM) candidate is set. The method of setting an MPM candidatewill be described with reference to FIG. 4 below.
[128] In step S302, information indicating whether to encode theoptimal intra prediction mode is encoded using MPM.
[129] In step S303, it is determined whether there is MPMoperation information. When the information has a value oftrue, in step S304, index information indicating which MPMcandidate is the same as the optimal intra prediction mode ofthe current prediction block is encoded. Conversely, when theinformation has a value of false, in step S305, informationindicating which intra prediction mode among intra predictionmodes except for the intra prediction mode the same as the MPMcandidate is optimal may be encoded.
[130] FIG. 4 is a diagram illustrating a method of setting anMPM candidate according to one embodiment of the presentinvention.
[131] In FIG. 4, L represents the intra prediction modeinformation of a neighboring block located to the left part ofa current prediction block, and A represents the intraprediction mode information of a neighboring block located tothe top part of the current prediction block.
[132] Referring to FIG. 4, three MPM candidates may be finallydetermined according to each of the specified conditions.
[133] The number of MPM candidates may be set to P (P is aninteger greater than 0, P > 0)), and MPM candidates may bedetermined in various ways.
[134] Referring to FIG. 1, the inter prediction module of theprediction module 102 may generate a prediction block usinginformation on either one or both of the preceding picture andthe subsequent picture of a current picture. In some cases,the prediction block may be generated using information on apreviously encoded region within a current picture. The interprediction module 103 may include a reference pictureinterpolation unit, a motion prediction unit, and a motioncompensation unit.
[135] For inter prediction, an inter prediction mode such asAMVP mode, merge mode, or skip mode may be used.
[136] Hereinafter, the AMVP mode among the inter predictionmodes will be described with reference to FIGS. 5 to 7.
[137] In AMVP mode, AMVP candidates may be set from predictioninformation of neighboring blocks of a current predictionblock.
[138] FIG. 5 is a flowchart illustrating a method of settingAMVP candidates and FIG. 6 is a diagram showing locations ofneighboring blocks of a current prediction block.
[139] Referring to FIG. 5, in step S501, two spatial candidatesmay be derived from neighboring blocks of a current predictionblock. Specifically, one of the two spatial candidates isderived from an earlier available neighboring block among A1and A4 which are scanned in this order, and the other one isderived from an earlier available neighboring block from amongA3, A2, and A5 which are scanned in this order in FIG. 6.
[140] In step S502, to select two temporal candidates,neighboring blocks are scanned in order of B1 -> B2 in FIG. 6,and then one earlier available candidate i s selected. Next, themethod of deriving motion information of the temporalcandidates will be described later with reference to FIG. 7.
[141] In step S503, redundant candidates among the spatialcandidates derived in step S501 and the temporal candidatesderived in step S502 may be removed.
[142] In step S504, when the number of candidates that have beenderived until this time is smaller than the number of finalAMVP candidates, (0, 0) motion information may be added. Here,the number of final AMVP candidates can also be determined invarious ways.
[143] In step S505, two derived AMVP candidates are finallyselected. Among the two derived AMVP candidates, one final AMVPcandidate with the lowest RD cost is determined through a RDOprocess. Then, a motion estimation process is performedstarting from a point indicated by the motion vector of thefinal AMVP candidate, thereby identifying the optimal motionvector through motion estimation.
[144] The number of AMVP candidates may be set to Q (Q is aninteger greater than 0, Q > 0)), and AMVP candidates may bedetermined in various ways.
[145] FIG. 7 is a diagram illustrating a method of derivingmotion information of a temporal candidate.
[146] Referring to FIG. 7, motion information of a temporalcandidate block may be searched for from a block within acollocated picture, the block being located at the sameposition as a current block of a current picture. The motionvector of the motion information indicates a prediction blockin a reference picture B. A scaled motion vector may bederived by calculating the temporal distance (for conveniencein description, referred to as a first temporal distance)between the reference picture B and the collocated picture andthen scaling the first temporal distance to match the temporaldistance (for convenience in description, referred to as asecond temporal distance) to a reference picture A referred toby the current picture. Here, the scaled motion vector may beused as motion information of a temporal candidate. Thereference picture A and the reference picture B may be the samepicture.
[147] Hereinafter, merge mode among the inter prediction modeswill be described with reference to FIG. 8.
[148] In merge mode, merge candidates may be set usingprediction information of neighboring blocks of a currentprediction block.
[149] FIG. 8 is a flowchart illustrating a method of settingmerge candidates.
[150] Referring to FIG. 8, in step S801, to derive spatialcandidates, five blocks A1 through A5 in FIG. 6 are scanned inorder of A1→A2→A3→A4→A5, and earlier four available candidatesare selected.
[151] In step S802, the temporal candidate is derived in thesame manner as step S502 of FIG. 5.
[152] In step S803, redundant candidates among the candidatesthat have been derived until this time are removed and combinedbidirectional candidates are added. The combined bidirectionalcandidate is a combination of bidirectional motion informationbased on previously determined candidate motion information.
[153] In step S804, when the number of candidates that have beenderived until this time is smaller than the number of finalmerge candidates, (0, 0) motion information may be added. Here,the number of final merge candidates can also be determined invarious ways. Herein, the number is assumed to be five.
[154] In step S805, five candidates among the derived candidatesare determined as the final merge candidates. Among the fivederived merge candidates, the merge candidate having optimalmotion information for the current prediction block may bedetermined through the RDO process.
[155] The number of merge candidates may be set to R (R is aninteger greater than 0, R > 0)), and merge candidates may bedetermined in various ways.
[156] FIG. 9 is a flowchart illustrating a method of encodinginter prediction mode information, according to one embodimentof the present invention;
[157] Referring to FIG. 9, merge operation information isencoded in step S901.
[158] In step S902, whether to perform merge operation isdetermined on the basis of merge operation information.
[159] When the merge operation information has a value of true,the index information of the merge candidate is encoded in stepS903, and the flow of FIG. 9 ends. When the merge operationinformation has a value of false, the prediction direction isencoded in step S904. The prediction direction may be encodedinto one of three direction types: bidirectional, pastdirection, and future direction.
[160] In step S905, whether the prediction direction is futuredirection or not is determined. When the prediction directionis not future, direction, the reference picture indexinformation for the past direction is encoded in step S906, andthe past direction MVD information is encoded in step S907.Here, MVD is an abbreviation of motion vector difference whichis information indicating the difference between the pastdirectionoptimal motion vector of the current prediction blockand the motion vector of the optimal AMVP candidate in the pastdirection.
[161] In step S908, the past MVP information is encoded. MVP isan abbreviation of motion vector predictor which indicates theoptimal AMVP candidate among the two final AMVP candidates.
[162] In step S909, whether the prediction direction past or notis determined. When the prediction direction is not past, thereference picture index information for the future direction isencoded in step S910, and the future direction MVD informationis encoded in step S911. In step S912, the future directionMVP information is encoded.
[163] Next, the skip mode of inter prediction will be described.
[164] In the skip mode, the motion information of a neighboringblock of a current prediction block may be directly applied tothe current prediction block as it is. In the skip mode, aprediction sample of a current prediction block is generatedusing motion information of a neighboring block, and theprediction sample is used as a reconstruction sample as it is.That is, in the skip mode, generation of a residual block isomitted.
[165] The prediction module 102 determines a neighboring blockwhose motion information is to be used as motion information ofa current block when skip mode is used.
[166] In addition, the prediction module 102 may encode codingmode information indicating the prediction mode of a codingblock. As described above, a coding block may be divided intoat least one prediction block, and the same prediction methodmay be used for the prediction block(s) generated from oneencoding block. However, the prediction mode that can be usedfor the prediction blocks generated from one coding block mayvary for each prediction block.
[167] For example, when a current coding block is encodedthrough inter prediction, prediction sample of a firstprediction block in the current coding block may generate usingAMVP mode and prediction samples of a second prediction blockmay be generated using merge mode.
[168] That is, the coding mode information may be encoded on aper coding block basis, and the prediction mode information maybe encoded on a per prediction block basis.
[169] Referring back to FIG. 1, the transform module 103transforms a residual block which is the difference between anoriginal block and a prediction block to generate a transformblock. Here, the transform block may be the smallest size(basic unit) used for the transform and quantization process.
[170] The transform module 103 transforms a residual signal intoa frequency domain to generate a transform block havingtransform coefficients. Here, a variety of transform techniquessuch as discrete cosine transform (DCT), discrete sinetransform (DST), and Karhunen_Loeve transform (KLT) may be usedas a method of transforming a residual signal into a frequencydomain. Through this process, the residual signal istransformed into the frequency domain. Thus, transformcoefficients are generated. In order to use the transformtechnique, a matrix operation is performed using a basisvector. Depending on a prediction mode in which a predictionblock is encoded, a variety of transform techniques may be usedin matrix operation. For example, discrete cosine transform maybe used for a horizontal direction operation and discretecosine transform may be used for a vertical directionoperation, depending on the intra prediction mode when intraprediction is performed.
[171] In this case, a transform method to be used is determineddepending on the intra prediction mode used to generate aresidual block of a prediction block. For example, in a certainintra prediction mode, DCT may be used for the horizontaldirection and DST may be used for the vertical direction.
[172] For each coding block, the transform block may be dividedby the quad tree (QT) scheme or the binary tree (BT) todetermine an optimal transform block partition type. Then, thetransform block partition information may be transmitted to theimage decoding apparatus 1000. Such a transform block dividingmethod may be referred to as a CU-based residual tree (RU)structure. This means that the transform may be performed inunits of a size other than a prediction block and that atransform block may be determined regardless of the boundary ofa prediction block.
[173] The transform block partitioning method is determined tobe the QT partition scheme or the BT partition scheme on a perprediction block basis, and transform block partitioninformation may be transmitted to the image decoding apparatus100 on a per transform block basis. This transform blockpartitioning method may be referred to as a PU-based residualtree (RU) structure. This means that transform blocks cannot begenerated through partitioning across the boundary of aprediction block. That is, a transform block cannot extendover the boundary of a prediction block.
[174] In the case of the CU-based RT structure, the transformblock partition information may not be transmitted. That is,transform may be performed on the entire coding block bydetermining the entire coding block as a transform block. Asimilar process is also possible for the PU-based RT structure.
[175] The quantization module 104 may quantize a transform blockto generate a quantized transform block. That is, thequantization module 104 may quantize the transform coefficientsof the transform block generated by the transform module 103 togenerate a quantized transform block having the quantizedtransform coefficients. For quantization, the dead zone uniformthreshold quantization (DZUTQ) or the quantization weightedmatrix may be used. Alternatively, a quantization methodimproved from those quantization methods may be used.
[176] Although the image encoding apparatus 100 including boththe transform module 103 and the quantization module 104 isillustrated and has been described above, the transform module103 and the quantization module 104 may be selectivelyincluded. That is, the image encoding apparatus 100 mayperform only a transform process of transforming a residualblock to generate a transform block but may not perform aquantization process. Alternatively, the image encodingapparatus 100 may not perform a transform process oftransforming a residual block into frequency coefficients butmay perform only a quantization process. Furtheralternatively, the image encoding apparatus 100 may performneither the transform process nor the quantization process.
[177] Even in the case where the image encoding apparatus 100may perform neither the transform process nor the quantizationprocess, a block input to the entropy encoding module 105 iscalled a quantized transform block.
[178] The entropy encoding module 105 encodes the quantizedtransform block to generate a bitstream. The entropy encodingmodule 105 encodes the coefficients of the quantized transformblock output from the quantization module 104 using a varietyof encoding techniques, thereby generating and outputting abitstream including auxiliary information (for example,information on prediction mode, quantization coefficients,etc.) required for decoding of the encoded blocks in an imagedecoding apparatus to be described below as well as the encodedimage signal.
[179] For entropy encoding, various encoding methods such asexponential-Golomb, context-adaptive variable length coding(CAVLC) and context-adaptive binary arithmetic coding (CABAC)can be used.
[180] The dequantization module 106 performs dequantization (thereverse process of the quantization) on the quantized transformblock to obtain a dequantized tra nsform block (reconstructionprocess). Here, the quantization and the dequantization arethe same technique but are opposite in the process sequence.
[181] The inverse transform module 107 uses a method the same asthe method used in the transform process to inverse-transformthe dequantized transform block, thereby reconstructing theresidual block. The transform and the inverse transform arethe same technique but are opposite in the process sequence.
[182] The dequantization module 106 and the inverse transformmodule 107 perform the reverse sequence of the quantization andthe transform used in the quantization module 104 and thetransform module 103, respectively. When only the quantizationis performed at an earlier stage (i.e., by the transform module103 and the quantization module 104), only the dequantizationmay be performed at a later stage (i.e., by the inversetransform module and the dequantization module). That is, theinverse transform may not be performed in this case. Whenneither the transform or the quantization is performed at anearlier stage, neither the inverse transform nor thedequantization is performed by the inverse transform module 107and the dequantization module 106 in the image decodingapparatus 100. It is also possible that the image decodingapparatus 100 does not include the dequantization module 106and the inverse transform module 107 in this case.
[183] The adder 108 adds the residual signal (residual block)output from the inverse transform m odule 107 to the predictionsignal (prediction block) generated through the predictionprocess, thereby reconstructing a current block.
[184] The in-loop filter 109 optionally filters the entirepicture after all of the blocks within the current picture arereconstructed. The in-loop filter 109 includes at least onefilter among a deblocking filter, a sample adaptive offset(SAO), and an adaptive loop filter (ALF).
[185] The deblocking filter removes block artifacts caused bythe boundary between blocks within a reconstructed picture.When determining whether to perform deblocking, it is possibleto determine whether to perform deblocking on a current blockon the basis of several pixel rows and columns included in thecurrent block. When performing deblocking, a strong filter ora weak filter may be used according to a deblocking filteringstrength required. When performing horizontal filtering andvertical filtering by using a deblocking filter, the verticalfiltering and the horizontal filtering may be performed inparallel.
[186] Sample adaptive offset (SAO) means a process of minimizingthe difference between the reconstructed picture and theoriginal picture by adding or subtracting a predetermined valueto the reconstructed pixels.
[187] Adaptive loop filtering (ALF) is performed on the basis ofthe results of comparison between the filtered reconstructedpicture and the original picture. Pixels within a picture maybe grouped into a plurality of pixel groups, and filtering maybe differently performed on each pixel group. the informationindicating whether to apply the ALF may be transmitted on a percoding unit (CU) basis. The shape and the filter coefficientof the ALF filter to be used may differ block by block.Alternatively, the same type of ALF filter may be used,regardless of the characteristics of target blocks to befiltered.
[188] The memory module 110 stores the reconstructed currentblock that is generated through the addition of the residualsignal output from the inverse transform module 107 and theprediction signal and through the optional filtering by the inloopfilter module 109. The stored reconstructed current blockis used for prediction of the next block or the next picture.
[189] The adder 111 may generate the reconstructed block basedon the current original block and the predicted block.
[190] FIG. 10 is a block diagram illustrating an image encodingapparatus 1000 according to an embodiment of the presentinvention.
[191] Referring to FIG. 10, the image decoding apparatus 1000includes an entropy decoding module 1001, a dequantizationmodule 1002, an inverse transform module 1003, a predictionmodule 1004, an adder 1005, an in-loop filter module 1004, anda memory module 1007.
[192] When a bit stream generated by the image encodingapparatus 100 is input to the image decoding apparatus 1000,the input bit stream is decoded by undergoing the operationsperformed by the image encoding apparatus 100 in reverse. Theterm “coding block” used to describe the encoding processperformed by the image encoding apparatus 100 will be referredto as “decoding block” to describe the decoding processperformed by the image decoding apparatus 1000.
[193] The entropy decoding module 1001 parses a bitstreamtransmitted from the image encoding apparatus 100 and obtainsquantized transform coefficients and a variety of informationrequired for decoding of a block.
[194] The entropy decoding module 1001 performs entropy decodingwhich is reverse in procedure to the entropy encoding performedby the entropy encoding module 105 of the image encodingapparatus 100. For example, one of a method among variousmethods such as exponential-Golomb, context-adaptive variablelength coding (CAVLC) and context-adaptive binary arithmeticcoding (CABAC) may be used depending on the encoding methodused in the image encoding apparatus. In the entropy decodingmodule 1001, the coefficients in a transform block may bedecoded sub-block by sub-block in the transform block. Thedecoding may be performed using various flags representing acoefficient other than zero, a coefficient having the absolutevalue greater than 1 or 2, a sign of each coefficient, etc. Acoefficient that cannot be represented only by a flag isdecoded by summing a coefficient represented by a flag and asignaled coefficient.
[195] In addition, the entropy decoding module 100 may decodeinformation associated with intra prediction and interprediction performed in the image encoding apparatus.
[196] The dequantization module 1002 performs the same processas the quantization technique used for quantization, inreverse, on the quantized transform coefficients decoded by theentropy decoding module 1001, to obtain a dequantized transformblock having dequantized coefficients. The dequantizationmodule 1002 operates substantially in the same way as thedequantization module 106 of FIG. 1.
[197] The inverse transform module 1003 performs the sameprocess as the transform technique used for transformation ofthe current coding block, in reverse, on the dequantizedtransform block, to obtain a residual block, i.e., residualsignal. The inverse transform module 1003 operatessubstantially in the same way as the inverse transform module107 of FIG. 1.
[198] The prediction module 1004 generates a prediction blockusing coding mode information that is decoded by the entropydecoding module 1001. Alternatively, the prediction module1004 may generate a prediction block using the same predictionmethod used by the prediction module 102 of the image encodingapparatus 100.
[199] FIG. 11 is a flowchart illustrating a method of decodingthe optimal intra prediction mode for a current predictionblock.
[200] Referring to FIG. 11, in step S1101, a most probable mode(MPM) candidate is set. A method of setting the MPM candidatemay be the same as the MPM candidate setting method of FIG. 3that is performed by the prediction module 102 of the imageencoding apparatus 100.
[201] In step S1102, information indicating whether the intraprediction mode is encoded using MPM is decoded.
[202] In step S1103, whether there is MPM operation informationis determined on the basis of the information decided in stepS1102. When the information is true, in step S1104, indexinformation indicating which MPM candidate is the same as theintra prediction mode is decoded to determine the optimal intraprediction mode of the current prediction block. Conversely,when the information is false, in step S1105, informationindicating which intra prediction mode among intra predictionmodes excluding the intra prediction mode the same as the MPMcandidate is optimal is decoded to determine the intraprediction mode of the current prediction block.
[203] FIG. 12 is a flowchart illustrating a method of decodinginformation of inter prediction mode, according to oneembodiment of the present invention.
[204] Referring to FIG. 12, the merge operation information isdecoded in step S1201.
[205] In step S1202, whether to perform merge operation isdetermined on the basis of the merge operation information thatis decoded in step S1201.
[206] When the merge operation information has a value of true,index information of the merge candidate is decoded in stepS1203, and the flow of FIG. 12 ends. When the merge operationinformation indicates has a value of false, the predictiondirection is decoded in step S1204. The prediction directionmay be decoded into one of three direction types:bidirectional, past direction, and future direction.
[207] In step S1205, whether the prediction direction is futuredirection is determined. When the prediction direction is notfuture direction, the reference picture index information forthe past direction is decoded in step S1206, and the pastdirection MVD information is decoded in step S1207.
[208] In step S1208, the past direction MVP information isdecoded.
[209] In step S1209, whether or not the prediction direction ispast direction is determined. When the prediction direction isnot past direction, the reference picture index information forthe future direction is decoded in step S1210, and the futuredirection MVD information is decoded in step S1211. In stepS1212, future direction MVP information is decoded.
[210] Referring back to FIG. 10, the adder 1005 adds theprediction block generated by the prediction module 1004 andthe residual block generated by the inverse transform module1004, thereby generating a reconstructed block.
[211] The in-loop filter 1006 module optionally filters theentire picture area after all of the blocks within the currentpicture are decoded. The in-loop filter module 1006 includes adeblocking filter and a sample adaptive offset (SAO).Information on whether or not a deblocking filter has beenapplied to the corresponding block or picture is received fromthe image encoding apparatus 100. When a deblocking filter isapplied, information on whether a strong filter is applied or aweak filter is applied is received from the image encodingapparatus 100. The in-loop filter module 1006 operatessubstantially in the same way as the in-loop filter of FIG. 1.
[212] The memory module 1007 stores the reconstructed currentblock that is generated through the addition of the residualsignal output from the inverse transform module 1003 and theprediction signal and through the optional filtering by the inloopfilter module 1006. The stored reconstructed currentblock is used for prediction of the next block or the nextpicture.
[213] As described above, for convenience of description ofembodiments of the present invention, the term “coding unit”refers to both a basic unit for encoding and a basic unit fordecoding. The units or blocks are elements segmented from apicture. In the embodiments of the present invention, the unitand the block are interchangeably used, and the current codingblock means a target block to be immediately encoded ordecoded.
[214]
[215] Hereinafter, a method of dividing a coding block will bedescribed in detail with reference to FIGS. 13 to 15.
[216] FIG. 13 is a diagram illustrating a first method ofdividing a current coding block.
[217] Referring to FIG. 13, a coding block may be divided intosmaller square or rectangular coding blocks. In FIG. 13, 1301is a vertical partition line by which a coding block is dividedinto left and right halves and 1302 is a horizontal partitionline by which a coding block is divided into upper and lowerhalves. Prediction blocks A and B within a coding block mayundergo prediction in that order. A dotted line within thecoding block is a block partition line that is a boundarybetween prediction blocks. In FIG. 13, the block partitionlines 1301 and 1302 are used to divide a coding block invarious ways, including a way of dividing a coding block intohalves.
[218] There are two methods of determining an optimal blockpartition type. First, an RD cost is calculated for each blockpartition type while varying the value of P from 1 to 2N-1 in ahorizontal direction and a vertical direction, and the blockpartition type having the least RD cost is determined as theoptimal block partition type.
[219] FIG. 14 and FIG. 15 are diagrams illustrating a secondmethod of dividing a current coding block.
[220] In this method, possible block partition forms are preset,an RD-dost for each passible block partition form iscalculated, and the block partition form having the least RDcost is determined as the optimal block partition type.Information indicating the preset possible block partitiontypes may be inserted into an upper-level header fortransmission. The upper-level header means a transmissionlayer which is above a block layer, for example, a videoparameter layer, a sequence parameter layer, a pictureparameter layer, a slice layer, etc.
[221] The preset block partition types include symmetricvertical partition, symmetric horizontal partition, asymmetricvertical partition, and asymmetric horizontal partition.
[222] Referring to FIG. 14, 1 / 4 and 3 / 4 vertical partition, 1 / 2and 1 / 2 vertical partition, 3 / 4 and 1 / 4 vertical partition, 1 / 4and 3 / 4 horizontal partition, 1 / 2 and 1 / 2 horizontal partition,3 / 4 and 1 / 4 horizontal partition are possible. Referring toFIG. 14, 1 / 4 and 3 / 4 horizontal partition, 3 / 4 and 1 / 4 verticalpartition, 1 / 4 and 3 / 4 vertical partition, and 3 / 4 and 1 / 4vertical partition are asymmetric partition forms, and 1 / 2 and1 / 2 horizontal partition 1 / 2 and 1 / 2 vertical partition aresymmetric partition forms.
[223] A corner partition may be performed according to a presetpartition form.
[224] Referring to FIG. 15, top left corner partition 1501, topright corner partition 1502, bottom left corner partition 1503,and bottom right corner partition 1504 are possible. Here, acorner prediction block generated from corner partition mayhave a quarter size (1 / 4) of a cording block.
[225] In the case of a top left corner partition 1501, there aretwo prediction blocks: a first prediction block A having an NxNsize located at the top left corner of a coding block; and asecond prediction block B that is the rest area of the codingblock.
[226] In the case of a top right corner partition 1502, thereare two prediction blocks: a first prediction block A having anNxN size located at the top right corner of a coding block; anda second prediction block B that is the rest area of the codingblock.
[227] In the case of a bottom left corner partition 1503, thereare two prediction blocks: a first prediction block A having anNxN size located at the bottom left corner of a coding block;and a second prediction block B that is the rest area of thecoding block.
[228] In the case of a top right corner partition 1504, thereare two prediction blocks: a first prediction block A having anNxN size located at the top right corner of a coding block; anda second prediction block B that is the rest area of the codingblock. For every partition type, the encoding order may be theorder of prediction blocks A and B. When a coding block ispartitioned in the manner described above, a prediction blockmay have a size larger or smaller than a 1 / 4 area of the codingblock.
[229] In addition, prediction blocks generated through thepartitioning may have various shapes such as a rectangle, asquare, etc. In addition, the RD costs of the partition typesare compared, and the partition type having the least RD costmay be determined as the optimal partition type of the currentcoding block.
[230]
[231] Hereinafter, a coding mode (hereinafter referred to ashybrid mode) for generating prediction samples of a predictionblock using a plurality of prediction modes in one coding blockaccording to an embodiment of the present invention will bedescribed.
[232] The prediction modes available in the hybrid mode include:intra prediction modes including planar mode, DC mode, andangular mode; inter prediction modes including AMVP mode, mergemode, and skip mode; decoder-side motion information derivation(DMID) mode; and decoder-side intra mode derivation (DIMD)mode. In a coding mode which is encoded with hybrid mode,prediction samples of a prediction block are generated by usingmultiple prediction modes selected among the above-mentionedprediction modes.
[233] The DMID mode refers to a prediction mode in which motioncompensation information which is not encoded by the imageencoding apparatus 100 is directly derived by the imagedecoding apparatus 1000 and prediction samples are generated onthe basis of the motion compensation information. Here, motioninformation which is not encoded by the image encodingapparatus 100 and is thus required to be directly derived bythe image decoding apparatus 1000 may be motion informationincluding a motion vector.
[234] For example, in the DMID mode, the image decodingapparatus 1000 derives initial motion information of aprediction block from neighboring blocks of a coding block,derives final motion information of the prediction block on thebasis of the derived initial motion information, and generatesprediction samples of the prediction block on the basis of thefinal motion information.
[235] Alternatively, in the DMID mode, the image decodingapparatus 1000 may derive final motion information of aprediction block on the basis of initial motion informationtransmitted from the image encoding apparatus 100, and generateprediction samples of the prediction block on the basis of thefinal motion information.
[236] The DIMD mode refers to a prediction mode in which anintra prediction mode which is not encoded by the imageencoding apparatus 100 is directly derived by the imagedecoding apparatus 1000 and prediction samples of a predictionblock are generated by using the derived intra prediction mode.
[237] For example, in the DIMD mode, the image decodingapparatus 100 sets a template block using a reconstructedregion located around a coding block and uses an intraprediction mode by which an optimal prediction pixel value ofthe template block is derived as prediction information of aprediction block within the coding block.
[238]
[239] On the other hand, when a coding block is encoded withhybrid mode and is divided into prediction blocks A and B, theprediction information of the prediction block A may bedetermined to use the prediction information of a neighboringblock of the prediction block A as it is, and the predictioninformation of the prediction block B is determined on thebasis of one mode among intra prediction modes (planar mode, DCmode, and angular mode), inter prediction modes (AMVP mode,merge mode, skip mode), DMID mode, and DIMD mode.
[240] FIGS. 16A, 16B, and 16C are diagrams illustrating a methodof determining prediction information of a prediction block Aby using prediction information of a neighboring block as itis.
[241] When generating prediction samples of the prediction blockA, prediction information that is optimal for the predictionblock A is searched from prediction information of previouslyencoded neighboring blocks located around the prediction blockA, and the prediction samples of the prediction block A aregenerated by using the detected optimal prediction sample asthe prediction information of the prediction block A.
[242] The neighboring blocks of the prediction block A may belocated at the positions denoted by 1601 through 1606 in FIGS.16A, 16B, and 16C. When the neighboring blocks of theprediction block A have priorities, the optimal predictioninformation is searched from the neighboring blocks accordingto a given priority order. The present embodiment assumes thatneighboring blocks 1, 2, 3, 4, and 5 are in this priorityorder.
[243] Referring to 1601 of FIG. 16A, a prediction block A hasfive neighboring blocks 1, 2, 3, 4, 5. The RD cost iscalculated by sequentially applying the prediction informationof the neighboring blocks 1 through 5 to the prediction block,and the prediction information of the neighboring block havingthe least RD cost is determined as the prediction informationof the prediction block A.
[244] Regarding 1602 of FIG. 16A, the description thereof may bethe same as the description of 1601 except for the positions ofthe neighboring blocks.
[245] FIGS. 16B and 16C illustrate that the number and positionof neighboring blocks may vary depending on the position of theprediction block A. In each case, the prediction informationof the neighboring block is applied to the prediction block Ato calculate the RD cost, the prediction information having theleast RD cost is determined as the optimal predictioninformation of the prediction block A, and the predictionsamples of the prediction block A are generated using theprediction information.
[246] On the other hand, regarding the method of determining theprediction information of the prediction block B, theprediction information of a neighboring block of the predictionblock may be used, as it is, as the prediction information ofthe prediction block B. In addition, it is also possible todetermine the prediction information of the prediction block Bby searching for the optimal prediction information among theintra prediction modes (this method is called intra prediction)or by searching the optimal prediction information from areconstructed reference picture through motion estimation (thismethod is called inter prediction).
[247] However, in some cases, the prediction information of theprediction block B can be determined with reference to theprediction information of the prediction block A Here, thecases will be described below.
[248] FIGS. 17A, 17B, and 17C are diagrams illustrating a methodof determining the prediction information of a prediction blockB.
[249] The neighboring blocks of the prediction block B may belocated at the positions denoted by 1701 through 1706 in FIGS.17A, 17B, and 17C. When the neighboring blocks of theprediction block B have priorities, the optimal predictioninformation is searched from the neighboring blocks accordingto a given priority order. The present embodiment assumes thatthe neighboring blocks 1, 2, 3, 4, and 5 are in this priorityorder.
[250] The number of neighboring block candidates 1701 may not befive but may be three or four as illustrated in the diagrams1701 and 1702 of FIG. 12.
[251]
[252] The prediction information of the prediction block B canbe determined by referring to the prediction information of theprediction block A depending on a transform block partitionstructure.
[253] When the transform block partition structure of thecurrent coding block is the CU-based RT structure, when any oneof the following conditions is satisfied, the predictioninformation of the prediction block B may be determined byreferring to the prediction information of the prediction blockA:
[254] 1) when the prediction block A is divided into sub-blocksand the prediction information varies from sub-block to subblock;and
[255] 2)when the prediction block A is not divided into subblocks,the prediction block B is divided into sub-blocks, andprediction information varies from sub-block to sub-block.
[256] On the other hand, when the transform block partitionstructure of the current coding block is the PU-based RTstructure, when any one of the following conditions issatisfied, the prediction information of the prediction block Bmay be determined by referring to the prediction information ofthe prediction block A:
[257] 1) when the prediction block A is divided into sub-blocksand the prediction information varies from sub-block to subblock;
[258] 2) when the prediction block A is not divided into subblocks,the prediction block B is divided into sub-blocks, andprediction information varies from sub-block to sub-block;
[259] 3) when the optimal prediction information of theprediction blocks A and B are skip mode, the remaining casesexcept for the case where the prediction block B refers to theprediction information of the prediction block A.
[260] On the other hand, the prediction information of theprediction block B may be determined on the basis of the intraprediction mode or the inter prediction mode as describedabove. In this case, as described above in connection with theprediction module 102 of the image encoding apparatus 100 ofFIG. 1, prediction information may be determined for eachprediction mode, and prediction blocks may be generated usingthe determined prediction information.
[261] The prediction information of the prediction block B maybe determined by DMID mode or DIMD mode. FIGS. 18, 19, and 30are diagrams illustrating a method of searching for predictioninformation in DMID mode and DIMD mode.
[262] FIGS. 18A, 18B, and 18C shows examples of a neighboringtemplate for each partition type when searching for aprediction mode of a prediction block B generated from acurrent coding block in DMID mode or DIMD mode. The templateblock may be determined by using a previously reconstructedregion located around the current coding block.
[263] In DMID mode, the image decoding apparatus 1000 searchesfor prediction information by setting assuming the differencebetween a neighboring template located around a predictionblock within a reference picture and determined according to aninitial motion vector and a neighboring template of a currentblock within a current picture as an error for calculating theRD cost, instead of the difference between the predictionblock. In DIMD mode, the image decoding apparatus 1000searches for prediction information by setting the differencebetween the reconstructed pixel value of a template region andthe predicted pixel value of the template region, which isderived by using the reference pixels located around thetemplate region, an error for calculating the RD cost. In DMIDmode, as an initial motion vector for motion estimation, motionvectors of motion information of reconstructed neighboringblocks.
[264] In a diagram 1801 of FIG. 18A, an above template isadjacent to the prediction block B and a left template is notadjacent to the prediction block B. This is to performtransform and quantization on a per coding block basis. It isalso possible to generate a left template block located withinthe prediction block A adjacent to the left edge of theprediction block B. This is to perform transform andquantization on a per prediction block basis.
[265] In a diagram 1802 of FIG. 18A, a left template is adjacentto the prediction block B but an above template is not adjacentto the prediction block B. It is also possible to generate anabove template block located within the prediction block Aadjacent to the upper edge of the prediction block B.
[266] Even in cases where the shape of the prediction block B isneither a square nor a rectangular as illustrated in diagrams1803 to 1805 of FIGS. 18B and 18C, an above template block anda left template block may differ in size and shape.
[267] In FIG. 18C, reference numeral 1806 denotes a partitiontype in which a prediction block is adjacent to neither anabove template nor a left template. When transform andquantization are performed on a per prediction block basis, atemplate block may be generated to be located within aprediction block A so as to be adjacent to a prediction blockB.
[268] In the cases denoted by reference numerals 1801 through1806 in FIGS. 18A, 18B, and 18C, a template block in only onedirection of a prediction block B is available, only theavailable template block may be used.
[269] In addition to the examples of the template blocksillustrated in FIGS. 18A, 18B, and 18C, the position, size, andshape of the template block may diversely vary.
[270] FIG. 19 is a diagram illustrating a method of searchingfor prediction information in DMID mode.
[271] 1901 in FIG. 19 denotes a case where predictioninformation is searched for using any one template block shownin FIGS. 18A to 18C in DMID mode, and 1902 in FIG. 19 denotes acase where when prediction direction is determined to bebidirectional, prediction information is searched for withoutusing a template block in DMID mode.
[272] Referring to 1901 in FIG. 19, there are template blocks onthe upper side and the left side of a current block in acurrent picture. The template block on the upper side isdenoted by CurAboveTemplate and the template block on the leftside is denoted by CurLeftTemplate block in FIG. 19.
[273] The above template block CurAboveTemplate have a width(horizontal size) of Aw and a height (vertical size) of Ah, andthe left template block CurLeftTemplate has a width of Lw and aheight of Lh.
[274] The width and height of a reference above template blockRefAboveTemplate within a reference picture may be the same asthe width and height of a neighboring template block locatedaround the current block.
[275] In DMID mode, motion estimation refers to a process ofsearching for a template block most similar to the neighboringtemplate block of the current block from a reference pictureand a block adjacent to the detected template block within thereference picture is determined as a prediction block. Themethod may be applied regardless of the prediction directions(past direction, future direction, bidirectional).
[276] In FIG. 19, reference numeral 1902 denotes a case where aDMID coding method in which a template block is not used whenthe prediction direction is bidirectional. A point at whichthe difference between a prediction block in the past directionand a prediction block in the future direction is minimum issearched through bidirectional prediction, and motioninformation indicating the point is determined as predictioninformation of the current block.
[277] FIG. 30 shows a method of searching for predictioninformation in DIMD mode. FIG. 30 illustrates examples of aneighboring template for ea ch partition type when a predictionmode of a prediction block B generated from a current codingblock is searched for in DIMD mode. A template region may bedetermined by using a previously reconstructed region locatedaround a current coding block.
[278] A template region on the upper side is denoted byAboveTemplate and a template region on the left side is denotedby LeftTemplate.
[279] The above template region AboveTemplate has a width W anda height AT, the left template region LeftTemplate has a widthLT and a height H, and pixels on R pixel lines in each templateregion may be used. The template region may also be referredto as template block.
[280] An intra prediction mode that can generate a predictionpixel value having the least error with a reconstructed pixelvalue within the template region may be searched for. Theintra prediction mode detected in this way is determined asprediction information of the template region, and theprediction information is used as prediction information of thecurrent block.
[281] FIG. 20 is a diagram illustrating a method of encodingprediction information in hybrid mode. FIG. 20 illustrates anexample in which a current coding block is partitioned into aprediction block A and a prediction block B.
[282] Referring to FIG. 20, optimal prediction mode informationof the current coding block is encoded in step S2001. In thiscase, the RD costs for hybrid mode, the RD cost for intraprediction mode, and the RD cost for inter prediction mode arecompared, and a coding mode incurring the least RD cost isdetermined as the optimal coding mode of the current codingblock.
[283] A method of determining the coding mode of the currentcoding block through comparison of the RD costs will be furtherdetailed with reference to FIG. 21.
[284] FIG. 21 is a flowchart illustrating a method ofdetermining the optimal coding mode among intra predictionmode, inter prediction mode, and hybrid mode, in the imageencoding apparatus 100.
[285] Referring to FIG. 21, in step S2101, each coding mode ofthe three coding modes may be assigned prediction mode indexinformation. For example, 0 may be intra prediction modeindex, 1 may be inter prediction mode index, and 2 may behybrid mode index.
[286] In step S2102, the initial value of N is zero and theinitial value of Best_Cosat is infinity. In this step, the RDcost of intra prediction mode assigned an index of 0 iscalculated, and the calculated value is stored as the value ofa variable N_Cost.
[287] In step S2103, whether the N_Cost is greater than thecurrent Best_Cost is determined. When the N_Cost is determinedto be less than the current Best_Cost, the current value of Nis stored as Best_Idx and the current value of the N_Cost isstored as the Best_Cost in step S2104.
[288] In step S2105, whether the current value of N is 2 or notis determined. When the current value of N is not 2, the valueof N is increased by 1 in step S2106, the process is returnedto step S2102, and step S2106 and the subsequent steps areperformed. When the current value of N is 2, the current valueof the Best_Idx is determined as the optimal coding mode indexinformation of the current coding block in step S2107 and theflow of FIG. 21 ends.
[289] Referring back to FIG. 20, when the hybrid mode isdetermined as the optimal coding mode through the method ofFIG. 21, the hybrid mode information may be encoded as theoptimal coding mode information of the current coding block instep S2001.
[290] In addition, information on whether the hybrid modeoperation is to be performed may be inserted into in an upperlayerheader so as to be transmitted, and the hybrid modeoperation may be controlled by the upper-layer header.
[291] In step S2002, it is determined whether the optimal codingmode of the current coding block determined in step S2001 ishybrid mode. When the optimal coding mode of the currentcoding block is hybrid mode, the process proceeds to stepS2003. On the other hand, when the optimum coding mode of thecurrent coding block is not hybrid mode, the process proceedsto step S2006.
[292] In step S2006, it is determined whether or not the optimalcoding mode of the current coding block is intra predictionmode. When the optimal coding mode of the current coding blockis intra prediction mode, intra prediction mode information isencoded through the same process as described with reference toFIG. 3 in step S2007. When the optimal coding mode of thecurrent coding block is not intra prediction mode, interprediction mode information is encoded through the same processas described with reference to FIG. 9 in step S2008.
[293] Meanwhile, in step S2003, the partition information of thecurrent coding block may be encoded. In this case, when thecurrent coding block is divided into two parts as shown in FIG.13, information indicating vertical partition or horizontalpartition may be encoded, and then P information may beencoded. Alternatively, as index information indicating theoptimal partition type among preset partition types shown inFIG. 14 may be encoded.
[294] In addition, when the current coding block is partitionedat a corner as shown in FIG. 15, index information indicatingwhich corner is partitioned may be encoded. That is, when thecurrent coding block is partitioned into a first predictionblock A and a second prediction block B whose area ratios tothe entire area of the current coding block are respectively1 / 4 and 3 / 4, index information indicating in which directionthe 1 / 4-area block (first prediction block) is located may beencoded.
[295] In step S2004, prediction information of the predictionblock A is encoded. Among prediction information ofneighboring blocks, index information of a neighboring blockhaving prediction information that is the most optimal for theprediction block A may be encoded. A detailed descriptionthereof will be given below with reference to FIG. 22.
[296] FIG. 22 is a flowchart illustrating a method of encodingprediction information of a prediction block A in the imageencoding apparatus 100.
[297] Referring to FIG. 22, in step S2201, predictioninformation of available neighboring blocks is applied to theprediction block A to generate a prediction block, and the RDcost for each prediction information is calculated.
[298] In step S2202, prediction information having the least RDcost is selected from among the multiple prediction informationentries is determined. In step S2203, index information of aneighboring block having the selected prediction informationmay be stored.
[299] There is an alternative to the method of FIG. 22. Thatis, the comparison of the RD costs is not performed, andprediction information of an available neighboring block havinga higher priority and occurring earlier among the neighboringblocks may be used as it is by searching for an availableneighboring block according to the priority order.
[300] Returning to the description of FIG. 20, in step S2005,prediction information of the prediction block B may beencoded.
[301] The image encoding apparatus according to an exemplaryembodiment of the present invention may determine the optimalprediction mode of the prediction block B by taking intoaccount only one predetermined prediction mode among fiveprediction modes which are merge mode, AMVP mode, DMID mode,intra prediction mode, and DIMD mode.
[302] In this case, the prediction information may be encoded inthe same manner as in the encoding method of FIG. 9 describedabove when the preset prediction mode is merge mode or AMVPmode (inter prediction mode). When the preset prediction modeis intra prediction mode, the prediction information may beencoded in the same manner as in the encoding method shown inFIG. 3.
[303] On the other hand, when the predetermined prediction modeis DMID mode, the prediction information may be encoded in thesame manner as in the encoding method shown in FIG. 23.
[304] FIG. 23 is a flowchart illustrating a method of encodingprediction information in DMID mode.
[305] Referring to FIG. 23, DMID operation information may beencoded in step S2301. Here, the DMID operation informationmay be information indicating whether to encode the predictioninformation in DMID mode.
[306] In step S2302, whether to perform DMID operation or not isdetermined on the basis of the DMID operation information.When the DMID operation information has a value of false, theflow ends. When the DMID operation information has a value oftrue, the process proceeds to step S2303.
[307] In step S2303, the prediction direction may be encoded.This process may be the same as the description of step S904 ofFIG. 9.
[308] In step S2304, whether or not the prediction direction isfuture direction is determined. When the prediction directionis determined not to be future direction, the process proceedsto step S2305. When the prediction direction is determined tobe future direction, the process proceeds to step S2308.
[309] In step S2305, the motion vector of the past direction maybe encoded. Before the image decoding apparatus derives amotion vector through motion estimation, the image decodingapparatus may receive a motion vector having a low resolutionfrom the image encoding apparatus and may derive a motionvector having a final resolution (finer resolution) by usingthe received low resolution motion vector as an initial motionvector.
[310] Alternatively, a motion vector may not be transmitted fromthe image encoding apparatus (step S2305 is omitted). In thiscase, the image decoding apparatus may derive a motion vectorhaving a final resolution on its own by using a motion vectorin motion information of a previously reconstructed neighboringblock as an initial motion vector to be used for motionestimation. This process may differ from that of step S907 ofFIG. 9.
[311] In step S2306, past direction reference picture indexinformation may be encoded. This may be the same as thedescription of step S906 of FIG. 9 described above. However,the image decoding apparatus may determine the past directionreference picture index information on its own without aprocess in which the image encoding device encodes the pastdirection reference picture index information.
[312] In step S2307, MVP information in the past direction maybe encoded. This may be the same as the description of stepS907 of FIG. 9. However, the image decoding apparatus maydetermine the past direction MVP information its own without aprocess in which the image encoding device encodes the pastdirection MVP information. Alternatively, the image decodingapparatus may determine the past direction optimal motioninformation through motion estimation without using the MVPinformation.
[313] In step S2308, whether or not the prediction direction ispast direction is determined. When the prediction direction isdetermined to be past direction, the flow ends. When theprediction direction is determined not to be past direction,the motion vector in the future direction may be encoded instep S2309. This process may differ from the description ofstep S911 of FIG. 9. Before the image decoding apparatusderives a motion vector through motion estimation, the imagedecoding apparatus may receive a motion vector having a lowresolution from the image encoding apparatus and may derive amotion vector having a final resolution (finer resolution) byusing the received low resolution motion vector as an initialmotion vector.
[314] Alternatively, a motion vector may not be transmitted fromthe image encoding apparatus (step S2309 may be omitted). Inthis case, the image decoding apparatus may derive a motionvector having a final resolution on its own by using a motionvector in motion information of a previously reconstructedneighboring block as an initial motion vector to be used formotion estimation.
[315] In step S2310, the reference picture index information inthe future direction may be encoded. This process may be thesame as the description of step S910 of FIG. 9. However, it isalso possible to determine the future-direction referencepicture index information in a manner that the image decodingapparatus determines the future-direction reference pictureindex information on its own determination without encoding thefuture reference picture index information in the imageencoding apparatus side.
[316] In step S2311, future-direction MVP information may beencoded. This may be the same as the description of step S911of FIG. 9. However, the image decoding apparatus may determinethe future-direction MVP information on its own determinationwithout a process in which the image encoding device encodesthe future-direction MVP information. Alternatively, the imagedecoding apparatus may determine the future-direction optimalmotion information through motion estimation without using theMVP information.
[317] The image encoding apparatus according to an exemplaryembodiment of the present invention may determine the optimalprediction mode of the prediction block B by taking intoaccount only one predetermined prediction mode among fiveprediction modes which are merge mode, AMVP mode, DMID mode,intra prediction mode, and DIMD mode. A detailed descriptionthereof will be given below with reference to FIG. 24.
[318] FIG. 24 is a flowchart illustrating a method in which animage encoding apparatus determines a prediction mode of aprediction block B.
[319] Referring to FIG. 24, in step S2401, each prediction modemay be assigned mode index information. For example, AMVP modemay be assigned 0, merge mode may be assigned 1, DMID mode maybe assigned 2, intra prediction mode may be assigned 3, andDIMD mode may be assigned 4.
[320] In step S2402, a mode number range of the prediction modesconsidered by the image encoding apparatus is determinedaccording to M. For example, when M is 2, the prediction modeof the prediction block B may be determined from among onlythree prediction modes: AMVP mode, merge mode, and DMID mode.
[321] In step S2403, the initial value of N is 0 and the initialvalue of Best_Cost is infinity. First, RD cost of mode number0 is calculated and the result is stored in N_Cost.
[322] In step S2404, whether or not the current N_Cost issmaller than the stored Best_Cost is determined. When theN_Cost is smaller than the Best_Cost, it is possible to storethe current N as Best_Idx and the N_Cost as Best_Cost in stepS2405.
[323] In step S2406, whether or not the current value of N isequal to the maximum value M of the prediction mode range.When the current value of N is not equal to the maximum value Mof the prediction mode range, the value of N is increased by 1in step S2407, and the process returns to step S2403. When thecurrent value of N is equal to the maximum value M, theBest_Idx is stored as an optimal prediction mode index of thecurrent prediction block in step S2408, and the flow ends.
[324] Next, the Best_Idx information is encoded, and predictioninformation of a prediction mode corresponding to the indexinformation is encoded.
[325] In the case where the prediction mode is AMVP mode ormerge mode (inter prediction mode), prediction information maybe encoded through the same process as described with referenceto FIG. 9. In the case where the prediction mode is intraprediction mode, prediction information may be encoded throughthe same process as described with reference to FIG. 3.
[326] In the case where the prediction mode is DMID mode,prediction information may be encoded through the same processas described with reference to FIG. 23.
[327] Hereinabove, a method in which an image encoding apparatusencodes prediction information when a current coding block isencoded in hybrid mode has been described.
[328] Hereinafter, a method in which an image decoding apparatusdecodes prediction information when a current coding block isencoded in the hybrid mode will be described with reference toFIGS. 25 and 26. In FIG. 25, a decoding block means a codingblock.
[329] FIG. 25 is a flowchart illustrating a method of decodingprediction information in hybrid mode. FIG. 25 illustrates anexample in which a current coding block is partitioned into aprediction block A and a prediction block B.
[330] Referring to FIG. 25, coding mode information of a currentcoding block is decoded in step S2501. The coding modeinformation of the current coding block is informationindicating any one mode among intra prediction mode, interprediction mode, and hybrid mode.
[331] It is possible to determine whether the coding mode of thecurrent coding block is hybrid mode on the basis of theprediction mode information that is decoded in step S2501.When the coding mode of the current coding block is determinedto be hybrid mode, the process proceeds to step S2503. On theother hand, when the coding mode of the current coding block isdetermined not to be hybrid mode, the process proceeds to stepS2506.
[332] In step S2506, it is determined whether or not the codingmode of the current coding block is intra prediction mode.When the coding mode of the current coding block is determinedto be intra prediction mode, intra prediction mode informationis decoded through the same process as S2007 of FIG. 20 in stepS2507. Here, the method of decoding the intra prediction modeinformation is the same as the method illustrated in FIG. 11.
[333] When the coding mode of the current coding block isdetermined not to be intra prediction mode, inter predictionmode information is decoded through the same process as S2008of FIG. 20 in step S2508. Here, the method of decoding theinter prediction mode information is the same as the methodillustrated in FIG. 12.
[334] On the other hand, in step S2503, the partitioninformation of the current decoding block encoded in step S2003of FIG. 20 may be decoded.
[335] In step S2504, the prediction information of theprediction block A that is encoded in step S2004 of FIG. 20 maybe decoded.
[336] In step S2505, the prediction information of theprediction block B encoded in step S2005 of FIG. 20 may bedecoded. Here, when the prediction mode of the predictionblock B is DMID mode, the prediction information may be decodedas shown in FIG. 26.
[337] FIG. 26 is a flowchart illustrating a method of decodingprediction information in DMID mode.
[338] Referring to FIG. 26, in step S2601, the DMID operationinformation encoded in the step S2301 of FIG. 23 describedabove may be decoded.
[339] In step S2602, it is determined whether or not DMID modeoperation is to be performed on the basis of the decoded DMIDoperation information. When the DMID mode operation isdetermined not to be performed, the process flow of FIG. 26ends. When the DMID mode operation is determined to beperformed, the process proceeds to step S2603.
[340] In step S2603, the prediction direction encoded in stepS2303 of FIG. 23 described above may be decoded. When theprediction direction information has not been encoded, thisstep may be omitted.
[341] In step S2604, whether or not the prediction direction isfuture direction is determined on the basis of the decodedprediction direction information. When the predictiondirection is determined not to be future direction, the processproceeds to step S2605. When the prediction direction isdetermined to be future direction, the process proceeds to stepS2608.
[342] In step S2605, the past-direction motion vector encoded instep S2305 of FIG. 23 may be decoded. When the information hasnot been encoded, this step may be omitted.
[343] In step S2606, the past-direction reference picture indexinformation encoded in step S2306 of FIG. 23 may be decoded.When the information has not been encoded, this step may beomitted.
[344] In step S2607, the past-direction MVP information encodedin step S2307 of FIG. 23 may be decoded. When the informationhas not been encoded, this step may be omitted.
[345] In step S2608, whether or not the prediction direction ispast direction is determined on the basis of the decodedprediction direction information. When the predictiondirection is past direction, the process flow ends. When theprediction direction is not past direction, the futuredirectionmotion vector encoded in step S2309 of FIG. 23 may bedecoded in step S2609. When the information has not beenencoded, this step may be omitted.
[346] In step S2610, the future-direction reference pictureindex information encoded in step S2310 of FIG. 23 may bedecoded. When the information has not been encoded, this stepmay be omitted.
[347] In step S2611, the future-direction MVP informationencoded in step S2311 of FIG. 23 may be decoded. When theinformation has not been encoded, this step may be omitted.
[348] FIG. 27 is a diagram illustrating a boundary filteringmethod according to one embodiment of the present invention.
[349] Prediction blocks A and B generated from a current codingblock may experience blocking artifacts at the boundary regionsthereof. Therefore, smoothing filtering is required to smooththe boundary regions.
[350] Referring to FIG. 27, after the prediction modes of theprediction block A and the prediction block B within thecurrent coding block are determined and then two predictedblocks corresponding to the prediction blocks A and B aregenerated, filtering is performed on the boundaries of the twopredicted blocks.
[351] In FIG. 27, reference numerals 2701 and 2702 denote pixelswhich are to be filtered and located at the boundary betweenthe two prediction blocks within the current coding block. Thefilters at the boundary between the prediction blocks arefiltered. In this case, the filter tap is four and filtercoefficients are W1 through W4. W1 to W4 are arbitrary realnumbers, and the sum of the W1, W2, W3 and W4 (W1+W2+W3+W4) isalways 1. Equation 2 shows a filtering equation for 2701 and2702.
[352] [Equation 2]
[353]
[354] In FIG. 27, reference numerals 2703 through 2706 denotepixels which are to be filtered and located at the boundarybetween two prediction blocks within the current coding blockin the case where a corner region of the current predictionbock is partitioned. In this case, diagonal filtering may beapplied to boundary pixels e1, e2, e4, and e5 at the cornerboundary of a prediction block. Here, d1 and b1 within onerectangular means the same pixel denoted by both b1 and d1.
[355] Equation 3 shows a filtering equation for 2703 through2706 in FIG. 27.
[356] [Equation 3]
[357] Referring to Equation 3, diagonal filtering is applied toboundary pixels e1, e2, e4, and e5 at the corner boundary.
[358]
[359] FIG. 28 is a flowchart illustrating an image encodingmethod according to a first embodiment of the presentinvention.
[360] Referring to FIG. 28, the image encoding apparatus maydivide a current coding block into at least one predictionblock in step S2801.
[361] The image encoding apparatus may generate predictionsamples of the at least one prediction block on the basis ofcoding mode information of the current coding block in stepS2802.
[362] The coding mode information means information indicatingany one mode among intra mode, inter mode, and hybrid mode.
[363] When the coding mode information of the current codingblock indicates hybrid mode, the image encoding apparatus maydivide the current coding block into a first prediction blockand a second prediction block.
[364] In this case, the image encoding apparatus may generateprediction samples of the first prediction block usingprediction information of at least one neighboring block of thefirst prediction block. The image encoding apparatus maygenerate prediction samples of the second prediction blockusing prediction information derived on the basis of any onemode among intra prediction mode, inter prediction mode,decoder-side motion information (DMID) mode, and decoder-sideintra mode derivation (DIMD) mode.
[365] The intra prediction modes may include planar mode, DCmode, and n angular prediction modes.
[366] The inter prediction modes may include AMVP mode, mergemode, and skip mode.
[367] When the coding mode information of the current codingblock indicates hybrid mode, the image encoding apparatus maydetermine a prediction mode of the second prediction block andencode prediction mode information of the second predictionblock.
[368] At least one prediction block may be partitioned at acorner of the current coding block.
[369] In this case, diagonal filtering may be applied toboundary pixels located at the corner boundary of a predictionblock. Since a detailed description thereof has been madeabove with reference to FIG. 27, a redundant description willbe omitted.
[370]
[371] FIG. 29 is a flowchart illustrating an image decodingmethod according to a first embodiment of the presentinvention.
[372] Referring to FIG. 29, the image decoding apparatus maydecode the coding mode information of a current coding block instep S2901.
[373] The coding mode information means information indicatingany one mode among intra mode, inter mode, and hybrid mode.
[374] The image decoding apparatus may divide the current codingblock into at least one prediction block in step S2902.
[375] When the coding mode information of the current codingblock indicates hybrid mode, the image decoding apparatus maydivide the current coding block into a first prediction blockand a second prediction block.
[376] The image decoding apparatus may generate predictionsamples of the at least one prediction block on basis of thedecoded coding mode information in step S2903.
[377] When the coding mode information of the current codingblock indicates hybrid mode, prediction samples of the firstprediction block may be generated using prediction informationof at least one neighboring block of the first predictionblock, and prediction sam ples of the second prediction blockmay be generated using prediction information derived by onemode among intra prediction mode, inter prediction mode,decoder-side motion information derivation (DMID) mode, anddecoder-side intra mode derivation (DIMD) mode.
[378] In this case, the prediction information of the secondprediction block may be derived by decoding the prediction modeinformation of the second prediction block.
[379] The DMID mode may be a process of deriving final motioninformation on the basis of initial motion information derivedfrom a neighboring block of the current coding block and ofusing the derived final motion information as predictioninformation of the prediction block within the current codingblock.
[380] The DIMD mode may be a process of setting a template blockusing a reconstructed region around the current coding blockand of using intra prediction information that produces anoptimal prediction pixel value of the template block asprediction information of the prediction block within thecurrent block.
[381] The optimal prediction pixel value of the template blockmay mean a prediction pixel value having the least difference(least error) with a reconstructed pixel value of the templateblock. The optimal prediction pixel value of the templateblock may be generated using neighboring reference pixelslocated around the template block.
[382] In this case, diagonal filtering may be applied toboundary pixels located at the corner boundary of theprediction block. Since a detailed description thereof hasbeen made above with reference to FIG. 27, a redundantdescription will be omitted.
[383] A bitstream generated by the image encoding method of FIG.28 may be recorded in a recording medium.
[384]
[385] FIG. 31 is a diagram illustrating a method of encodingprediction information of a current coding block according to asecond embodiment of the present invention. In FIG. 31, it isassumed that the current coding block is divided into aprediction block A and a prediction block B, and the codingmode of the current coding block is inter prediction mode.
[386] Referring to FIG. 31, inter hybrid mode information of thecurrent coding block is encoded in step S3101. The interhybrid mode information means information indicating whetherthe current coding block is to be encoded in inter hybrid mode.
[387] The RD costs of the inter hybrid mode and the interprediction mode are compared. When the RD cost of the interhybrid mode is minimum, the inter hybrid mode information ofthe current coding block having a value of true is encoded.The inter hybrid mode information may be encoded into flags.
[388] FIG. 32 is a flowchart illustrating a method of encodingthe inter hybrid mode information in the image encodingapparatus 100.
[389] Referring to FIG. 32, in step S3201, whether or not theinter prediction mode operation is true. When the interprediction mode operation is false, the process flow ends.When the inter prediction mode operation is true, the processproceeds to step S3202.
[390] In step S3202, the inter prediction mode is assigned indexinformation of zero and the inter hybrid mode is assigned indexinformation of one.
[391] In step S3203, the initial value of N is zero and theinitial value of Best_Cosat is infinity. In this step, the RDcost of the intra prediction mode is calculated and the resultis stored in N_Cost.
[392] In step S3204, whether the N_Cost is greater than thecurrent Best_Cost is determined. When the N_Cost is determinedto be less than the current Best_Cost, the current value of Nis stored in Best_Idx and the current value of the N_Cost isstored in the Best_Cost in step S3205.
[393] In step S3206, whether the current value of N is 1 or notis determined. When the current value of N is not 1, the valueof N is increased by 1 in step S3207, the process is returnedto step S3203, and step S3203 and the subsequent steps areperformed. When the current value of N is 1, the current valueof the Best_Idx is determined as the inter hybrid modeinformation of the current coding block in step S3208 and theflow of FIG. 32 ends.
[394] The intra hybrid mode information generated through theprocess is encoded in the step S3101 as the inter hybrid modeinformation of the current coding block. In addition,information on whether the inter hybrid mode operation is to beperformed may be inserted into in an upper-layer header so asto be transmitted, and the inter hybrid mode operation may becontrolled at the upper-layer header.
[395] Referring back to FIG. 31, in step S3102, it is determinedwhether the current coding block is to be encoded in interhybrid mode, on the basis of the inter hybrid mode informationof the current coding block.
[396] When the current coding block is determined to be encodedin inter hybrid mode, the process proceeds to step S3103 sothat the partition information of the current coding block isencoded.
[397] In this case, when the current coding block is to bedivided into two halves as shown in FIG. 13, informationindicating vertical partition or horizontal partition may beencoded, and then P information also may be encoded.Alternatively, index information indicating the optimalpartition type among preset partition types shown in FIG. 14may be encoded. When the coding block is to be partitionedinto a 1 / 4 prediction block and a 3 / 4 block as illustrated inFIG. 15, index information indicating in which direction the1 / 4 prediction block is located is encoded to determine thepartition type of the current coding block.
[398] In step S3104, prediction information of the predictionblock A may be encoded. The prediction information of theprediction block A may be determined using merge mode. As tothe method of encoding the prediction information of theprediction block A, FIG. 5 will be referred to.
[399] In step S3104, merge mode may not be used, but predictioninformation of an available neighboring block having a higherpriority among the neighboring blocks may be used as it is.
[400] In step S3105, prediction information of the predictionblock B is encoded.
[401] The image encoding apparatus according to an exemplaryembodiment of the present invention may determine the optimalprediction mode of the prediction block B by taking intoaccount only one predetermined prediction mode among threeprediction modes which are merge mode, AMVP mode, and DMIDmode.
[402] When the preset prediction mode is merge mode or AMVPmode, the detailed prediction information may be encoded in thesame manner as the encoding method of FIG. 6 described above.
[403] On the other hand, when the preset prediction mode is DMIDmode, the prediction information may be encoded in the samemanner as the encoding method of FIG. 23.
[404] Referring back to step S5105 of FIG. 31, an image encodingapparatus according to another embodiment of the presentinvention may determine the optimal prediction mode of theprediction block B by taking into account two or moreprediction modes among three prediction modes which are mergemode, AMVP mode, and DMID mode. A detailed description thereofwill be given below with reference to FIG. 19.
[405] FIG. 33 is a flowchart illustrating a method in which animage encoding apparatus according to a second embodiment ofthe present invention determines a prediction mode of aprediction block B. a decoding coding block according to asecond embodiment of the present invention.
[406] Referring to FIG. 33, in step S3301, each prediction modemay be assigned index information. For example, VMVP mode maybe assigned 0, merge mode may be assigned 1, and DMID mode maybe assigned 2.
[407] In step S3302, a mode number range of the prediction modesconsidered by the image encoding apparatus is determinedaccording to M. For example, when M is 2, the prediction modeof the prediction block B may be determined from among onlythree prediction modes: AMVP mode, merge mode, and DMID mode.
[408] In step S3303, the initial value of N is 0 and the initialvalue of Best_Cost is infinity. First, RD cost of mode number0 is calculated and the result is stored in N_Cost.
[409] In step S3304, whether or not the current N_Cost issmaller than the stored Best_Cost is determined. When theN_Cost is smaller than the Best_Cost, it is possible to storethe current N as Best_Idx and the N_Cost as Best_Cost in stepS3305.
[410] In step S3306, whether or not the current value of N isequal to the maximum value M of the prediction mode range.When the current value of N is not equal to the maximum value Mof the prediction mode range, the value of N is increased by 1in step S3307, and the process returns to step S3303. When thecurrent value of N is equal to the maximum value M, theBest_Idx is stored as an optimal prediction mode index of thecurrent prediction block in step S3308, and the flow ends.
[411] Next, the Best_Idx information is encoded, and predictioninformation of a prediction mode corresponding to the indexinformation is encoded.
[412] In the case where the prediction mode is AMVP mode ormerge mode, prediction information may be encoded through thesame process as described with reference to FIG. 6. In thecase where the prediction mode is DMID mode, predictioninformation may be encoded through the same process asdescribed with reference to FIG. 23.
[413] Hereinabove, a method in which an image encoding apparatusencodes prediction information when a current coding blockinter is encoded in inter hybrid mode has been described.
[414] Hereinbelow, a method in which an image decoding apparatusaccording to a second embodiment of the present inventiondecodes prediction information of a current coding block willbe described with reference to FIG. 34. In FIG. 34, a codingmode of a current coding block is assumed to be interprediction mode. Here, a current decoding block means acurrent coding block.
[415] Referring to FIG. 34, inter hybrid mode information of thecurrent coding block is decoded in step S3401.
[416] In step S3402, whether the current decoding block has beenencoded in inter hybrid mode on the basis of the decoded interhybrid mode information.
[417] When the current coding block is determined to be encodedin inter hybrid mode, the process proceeds to step S3403 sothat the partition information of the current coding block isdecoded.
[418] On the other hand, in step S3403, the partitioninformation of the current decoding block which has beenencoded in step S3103 of FIG. 31 may be decoded. The currentcoding block may be divided using the decoded partitioninformation. Since the detailed description regarding this hasbeen given above with reference to FIGS. 13 through 15, aredundant description will be omitted.
[419] In step S3404, the prediction information of theprediction block A that is encoded in step S3104 of FIG. 31 maybe decoded. Specifically, in step S3104, the predictioninformation of the prediction block A may be derived from theprediction information of a neighboring block that is selectedfrom among neighboring blocks on the basis of index information(or merge index information) of the neighboring blocks.Alternatively, the prediction information of an availableneighboring block having a higher priority among predeterminedavailable neighboring blocks may be derived as the predictioninformation of the prediction block A.
[420] In step S3405, the prediction information of theprediction block B encoded in step S3105 of FIG. 31 may bedecoded. Here, when the prediction mode of the predictionblock B is DMID mode, the prediction information may be decodedas shown in FIG. 26.
[421]
[422] FIG. 35 is a flowchart illustrating an image decodingmethod according to a second embodiment of the presentinvention;
[423] Referring to FIG. 35, the image decoding apparatus maydecode inter hybrid mode information of a current coding blockin step S3101.
[424] The image decoding apparatus may generate predictionsamples of the at least one prediction block within the currentcoding block on the basis of the inter hybrid mode informationin step S3502. A detailed description of step S3502 will bemade below with reference to FIG. 24.
[425] FIG. 36 is a flowchart illustrating the image decodingmethod according to the second embodiment of the presentinvention.
[426] Referring to FIG. 36, when the current coding block is ininter hybrid mode (Yes in S3601), the image decoding apparatusmay divide the current coding block into a first predictionblock and a second prediction block in step S3602.
[427] The first prediction block and the second prediction blockmay be prediction blocks obtained by partitioning a corner ofthe current coding block as illustrated in FIG. 11.
[428] In this case, as having been described with reference toFIG. 27, diagonal filtering may be applied to pixels adjacentto the corner boundary of the first prediction block.
[429] The image decoding apparatus derives the motioninformation of the first prediction block using merge mode, andgenerates prediction samples of the first prediction blockusing the derived motion information of the first predictionblock in step S3603.
[430] The image decoding apparatus derives motion information ofthe second prediction block using one mode selected among mergemode, AMVP mode, decoder-side motion information derivation(DMID) mode and generates prediction samples of the secondprediction block using the derived motion information of thesecond prediction block in step S3604.
[431] Here, The DMID mode may be a process of deriving finalmotion information o n the basis of initial motion informationderived from a neighboring block of the current coding blockand of using the derived final motion information as theprediction information of the prediction block within thecurrent coding block.
[432] On the other hand, the image decoding apparatus may decodethe inter prediction mode of the second prediction block anddetermine the prediction mode used to derive the motioninformation of the second prediction block. The interprediction mode information of the second prediction block maybe information signaled from the image encoding apparatus.
[433] FIG. 36 is a flowchart illustrating an image encodingmethod according to a second embodiment of the presentinvention.
[434] Referring to FIG. 37, an image encoding apparatus mayencoded inter hybrid mode information of a current coding blockin step S3701.
[435] An image decoding apparatus may generate predictionsamples of at least one prediction block within the currentcoding block on the basis of the inter hybrid mode informationin step S3702.
[436] Next, Step S3702 will be described below in detail. Theimage encoding apparatus divides a current coding block into afirst prediction block and a second prediction block when thecurrent coding block is encoded in inter hybrid mode. Next,the image encoding apparatus may derive motion information ofthe first prediction block using merge mode and generateprediction samples of the first prediction block using thederived motion information of the first prediction block.Next, the image encoding apparatus may derive motioninformation of the second prediction block using one modeselected among merge mode, AMVP mode, decoder-side motioninformation derivation (DMID) mode and generate predictionsamples of the second prediction block using the derived motioninformation of the second prediction block.
[437] A bitstream generated by the image encoding method of FIG.37 may be recorded in a recording medium.
[438]
[439] Hereinbelow, inter hybrid mode according to one embodimentof the present invention will be described.
[440] The inter hybrid mode is one of the intra predictionmodes. When the coding mode of the current coding block isintra prediction mode and intra hybrid mode, the predictioninformation of the first prediction block (prediction block A)is determined using the intra prediction information of aneighboring block as it is, and the prediction information ofthe second prediction block (prediction block B) is determinedon a per prediction block basis using the same method asillustrated in FIG. 3 or determined on a per prediction blockbasis using the DIMD.
[441] The DIMD mode refers to a prediction mode in which anintra prediction mode which is not encoded by the imageencoding apparatus 100 is directly derived without encoding bythe image decoding apparatus 1000 and prediction samples of aprediction block are generated by using the derived intraprediction mode.
[442] For example, in the DMID mode, the image decodingapparatus 1000 derives intra prediction modes of theneighboring blocks, derives a final intra prediction mode ofthe prediction block on the basis of the derived intraprediction modes, and generates prediction samples of theprediction block.
[443] FIG. 30 shows a method of searching for predictioninformation in DIMD mode. FIG. 30 illustrates examples ofneighboring template regions for each partition type whensearching for a prediction mode of the prediction block Bwithin the current coding block using DIMD mode. A templateregion may be determined by using a previously reconstructedregion located around the current coding block.
[444] A template region on the upper side is denoted byAboveTemplate and a template region on the left side is denotedby LeftTemplate.
[445] The above template region AboveTemplate has a width W anda height AT, the left template region LeftTemplate has a widthLT and a height H, and pixels on R pixel lines in each templateregion may be used. The template region may also be referredto as a template block.
[446] An intra prediction mode that can generate a predictionpixel value having the least error with a reconstructed pixelvalue within the template region may be searched for. Theintra prediction mode detected in this way is determined asprediction information of the template region, and theprediction information is used as prediction information of thecurrent block.
[447] When the intra mode coding block is not encoded in intrahybrid mode, the prediction information may be determined on aper prediction block basis as illustrated in FIG. 3.
[448]
[449] The method of determining the prediction information ofthe prediction block A using the intra prediction informationof a neighboring block as it is will be described below. Theprediction information may be an intra prediction mode.
[450] When generating prediction samples of the prediction blockA, the optimal prediction information of the prediction block Ais searched from prediction information of previously encodedneighboring blocks located around the prediction block A, andthe prediction samples of the prediction block A are generatedby determining the detected optimal prediction sample as theprediction information of the prediction block A as they are.
[451] When determining the prediction information of theprediction block B, the optimal prediction mo de is searched forfrom among planar mode, DC mode, and N angular modes using theneighboring reference pixels of the prediction block, and theprediction samples may be generated using the predictioninformation. Alternatively, the optimal prediction mode issearched using DMID mode, and the prediction samples may begenerated using the prediction information.
[452] However, in some cases, the prediction information of theprediction block B may be determined by referring to theprediction information of the prediction block A Here, thecases will be described below.
[453] In the image decoding apparatus, in the DMID mode, theprediction information is searched for while assuming thedifference between the reconstructed pixel value of thetemplate region and the predicted pixel value of the templateregion obtained by using the reference pixels around thetemplate region as an error used for calculation of the RDcost, instead of the difference between the prediction blockand the original block.
[454] The prediction information of the prediction block B maybe determined by referring to the prediction information of theprediction block A depending on a transform block partitionstructure.
[455] When the current transform block partition structure isthe PU-based RT structure, the prediction information of theprediction block B cannot be determined by referring to theprediction information of the prediction block A.
[456] On the other hand, when the current transform blockpartition structure is the PU-based RT structure, theprediction information of the prediction block B may bedetermined by referring to the prediction information of theprediction block A.
[457]
[458] On the other hand, the prediction information of theprediction block B may be determined on a per prediction blockbasis as described above. In this case, as described above inconnection with the prediction module 102 of the image encodingapparatus 100 of FIG. 1, prediction information may bedetermined on a per prediction block basis, and predictionblocks may be generated using the determined intra predictionmode or DIMD mode.
[459]
[460] FIG. 38 is a diagram illustrating a method of encodingprediction information of a current coding block. In FIG. 38,it is assumed that a current coding block is divided into aprediction block A and a prediction block B and the coding modeof the current coding block is intra mode.
[461] Referring to FIG. 38, intra hybrid mode information of thecurrent coding block is encoded in step S3801. The intrahybrid mode information means information indicating whetherthe current coding block is to be encoded in intra hybrid mode.
[462] The RD costs of the intra hybrid mode and the intraprediction mode are compared. When the RD cost of the intrahybrid mode is minimum, the intra hybrid mode information ofthe current coding block having the minimum RD cost may beencoded. The intra hybrid mode information may be encoded intoflags.
[463] FIG. 39 is a flowchart illustrating a method of encodingintra hybrid mode information in the image encoding apparatus100.
[464] Referring to FIG. 39, in step S3901, whether or not theintra prediction mode operation is true. When the intraprediction mode operation is false, the process flow ends.When the intra prediction mode operation is true, the processproceeds to step S3902.
[465] In step S3902, the intra prediction mode is assigned indexinformation of zero and the intra hybrid mode is assigned indexinformation of one.
[466] In step S3903, the initial value of N is zero and theinitial value of Best_Cosat is infinity. In this step, the RDcost of the intra prediction mode is calculated and the resultis stored in N_Cost.
[467] In step S3904, whether the N_Cost is greater than thecurrent Best_Cost is determined. When the N_Cost is determinedto be less than the current Best_Cost, the current value of Nis stored in Best_Idx and the current value of the N_Cost isstored in the Best_Cost in step S3905.
[468] In step S3906, whether the current value of N is 1 or notis determined. When the current value of N is not 1, the valueof N is increased by 1 in step S3907, the process is returnedto step S3903, and step S3903 and the subsequent steps areperformed. When the current value of N is 1, the current valueof the Best_Idx is determined as the intra hybrid modeinformation of the current coding block in step S3908 and theflow of FIG. 39 ends.
[469] The intra hybrid mode information generated through theprocess is encoded in the step S3901 as the intra hybrid modeinformation of the current coding block. In addition,information on whether the intra hybrid mode operation is to beperformed may be inserted into in an upper-layer header so asto be transmitted, and the intra hybrid mode operation may becontrolled at the upper-layer header.
[470] Referring back to FIG. 38, in step S3802, it is determinedwhether the current coding block is to be encoded in intrahybrid mode, on the basis of the intra hybrid mode informationof the current coding block.
[471] When the current coding block is determined to be encodedin intra hybrid mode, the process proceeds to step S3803 sothat the partition information of the current coding block isencoded.
[472] In this case, when the cu rrent coding block is to bedivided into two parts as shown in FIG. 13, informationindicating vertical partition or horizontal partition may beencoded, and then P information also may be encoded.Alternatively, index information indicating the optimalpartition type among preset partition types shown in FIG. 14may be encoded. When the coding block is to be partitionedinto a 1 / 4 prediction block and a 3 / 4 prediction block asillustrated in FIG. 15, index information indicating in whichdirection the 1 / 4 prediction block is located is encoded todetermine the partition type of the current coding block.
[473] In step S3804, prediction information of the predictionblock A may be encoded. Among prediction information ofneighboring blocks, index information of a neighboring blockhaving prediction information that is the most optimal for theprediction block A may be encoded.
[474] FIG. 40 is a flowchart illustrating a method of encodingprediction information of a first prediction block within acoding block that is to be encoded in intra hybrid mode in animage encoding apparatus.
[475] Referring to FIG. 40, in step S4001, predictioninformation of available neighboring blocks is applied to theprediction block A to generate a prediction block, and the RDcost for each prediction information is calculated.
[476] In step S4002, prediction information having the least RDcost is selected from among the mu ltiple prediction informationentries. In step S4003, index information of a neighboringblock having the selected prediction information may be stored.
[477] On the other hand, the process of FIG. 40 may not beperformed. That is, prediction information of an availableneighboring block having a higher priority among theneighboring blocks may be used as it is.
[478] In step S3805, the prediction information of theprediction block B is encoded. The prediction information ofthe prediction block B may be encoded using the intraprediction coding method of FIG. 3 described above or may beencoded by transmitting DIMD mode information (or flaginformation) indicating the DIMD mode.
[479] In S3806, when the current coding block is a block that isnot encoded with intra hybrid mode, encoding may be performedon a per prediction block basis using the intra predictioncoding method of FIG. 3 described above.
[480] FIG. 41 is a diagram illustrating a method of decodingprediction information of a current decoding block. In FIG.41, it is assumed that a current decoding block is divided intoa prediction block A and a prediction block B and the codingmode of the current coding block is intra mode. Here, acurrent decoding block means a current coding block.
[481] Referring to FIG. 41, intra hybrid mode information of thecurrent decoding block may be decoded in step S4101.
[482] In step S4102, whether the current decoding block has beenencoded in intra hybrid mode may be determined on the basis ofthe decoded intra hybrid mode information.
[483] When the current decoding block is determined to beencoded in intra hybrid mode, the process proceeds to stepS4103 so that the partition information of the current codingblock may be decoded.
[484] On the other hand, in step S4103, the partitioninformation of the current decoding block which has beenencoded in step S4803 of FIG. 48 may be decoded. The currentcoding block may be divided using the decoded partitioninformation. Since the detailed description regarding thepartitioning has been given above with reference to FIGS. 13through 15, a redundant description will be omitted here.
[485] In step S4104, the prediction information of theprediction block A that is encoded in step S3804 of FIG. 38 maybe decoded. Specifically, in step S4104, the predictioninformation of the prediction block A may be derived from theprediction information of a neighboring block that is selectedfrom among neighboring blocks on the basis of index informationof the neighboring blocks. Alternatively, the predictioninformation of an available neighboring block having a higherpriority among predetermined available neighboring blocks maybe derived as the prediction information of the predictionblock A.
[486] In step S4105, the prediction information of theprediction block B encoded in step S3805 of FIG. 38 may bedecoded.
[487] In S4106, when the current decoding block is a block thatis not encoded with intra hybrid mode, the decoding may beperformed on a per prediction block basis using the intraprediction decoding method of FIG. 11 described above.
[488]
[489] FIG. 42 is a flowchart illustrating an image decodingmethod according to a third embodiment of the presentinvention.
[490] Referring to FIG. 42, the image decoding apparatus maydecode intra hybrid mode information of a current coding blockin step S4201.
[491] The image decoding apparatus may generate predictionsamples of at least one prediction block within the currentcoding block on the basis of the intra hybrid mode informationin step S4202. A detailed description of step S4202 will bemade below with reference to FIG. 43.
[492] FIG. 43 is a flowchart illustrating - image decodingmethod according to one embodiment of the present invention.
[493] Referring to FIG. 43, when the current coding block is inintra hybrid mode (Yes in S4301), the image decoding apparatusmay divide the current coding block into a first predictionblock and a second prediction block in step S4302.
[494] The first prediction block and the second prediction blockmay be prediction blocks obtained by partitioning a corner ofthe current coding block as illustrated in FIG. 15.
[495] In this case, as having been described with reference toFIG. 27, diagonal filtering may be applied to pixels adjacentto the corner boundary of the first prediction block.
[496] The image decoding apparatus may generate predictionsamples of the first prediction block using an intra predictionmode of the first prediction block, which is derived from aneighboring block of the first prediction block, in step S4303.
[497] The image decoding apparatus may derive the intraprediction mode of a neighboring block that is selected fromamong neighboring blocks of the first prediction blockaccording to a preset priority order as the intra predictionmode of the first prediction block.
[498] Alternatively, the image decoding apparatus may derive theintra prediction mode of a neighboring block that is determinedon the basis of the index information of the neighboring blocksof the first prediction block as the intra prediction mode ofthe first prediction block. Here, the index information of theneighboring block may be information signaled from the imageencoding apparatus.
[499] The image decoding apparatus determines the intraprediction mode of the second prediction block by decoding theintra prediction mode information or the DIMD mode informationand generates the prediction samples of the second predictionblock using the determined intra prediction mode in step S4304.
[500] When the mode of the current coding block is not intrahybrid mode (No in S4301), the image decoding apparatus maygenerate the prediction samples of at least one predictionblock within the current coding block through the intraprediction in step S4305. That is, as described with referenceto FIG. 6, it is possible to generate the prediction samples ona per prediction block basis by deriving the intra predictionmode.
[501] FIG. 44 is a flowchart illustrating an image encodingmethod according to one embodiment of the present invention.
[502] Referring to FIG. 44, the image encoding apparatus encodesintra hybrid mode information of the current coding block instep S4401.
[503] The image encoding apparatus may generate predictionsamples of at least one prediction block within the currentcoding block on the basis of the intra hybrid mode informationin step S4402.
[504] Next, Step S4402 will be described below in detail. Theimage encoding apparatus divides a current coding block into afirst prediction block and a second prediction block when thecurrent coding block is encoded in intra hybrid mode. Next,the image encoding apparatus may generate prediction samples ofthe first prediction block using the intra prediction mode ofthe first prediction block derived from a neighboring block ofthe first prediction block. The image encoding apparatusdetermines the intra prediction mode of the second predictionblock on the basis of the intra prediction mode information orthe DIMD mode of the second prediction block, and generates theprediction samples of the second prediction block using thedetermined intra prediction mode.
[505] A bitstream generated by the image encoding method of FIG.44 may be recorded in a recording medium.
[506]
[507] Although the exemplary methods of the present disclosureare represented by a series of steps for clarity ofdescription, they are not intended to limit the order in whichthe steps are performed. That is, if necessary, each step maybe performed in parallel or performed in series in a differentorder. In order to implement the method according to thepresent disclosure, each of the embodiments described above canbe modified such that some additional steps can be added to acorresponding embodiment or some existing steps can beeliminated from a corresponding embodiment. Alternatively,some additional steps are added and some existing steps areeliminated from a corresponding of the embodiments.
[508] Various embodiments in the present disclosure are notintended to represent all of the possible combinations based ontechnical spirit of the present invention but are provided onlyfor illustrative purposes. Elements or steps described invarious embodiments can be applied independently or incombination.
[509] Various embodiments in the present disclosure can beimplemented by hardware, firmware, software, or a combinationthereof. When implemented by hardware, each of the embodimentscan be implemented by one or more application specificintegrated circuits (ASICs), digital signal processors (DSPs),digital signal processing devices (DSPDs), programmable logicdevices (PLDs), field programmable gate arrays (FPGAs), generalprocessors, controllers, micro controllers, or microprocessors.
[510] The scope of the present disclosure covers software ormachine-executable commands (for example, operating systems(OSs), application programs, firmware, programs) that enablesteps in various embodiments to be performed in a certaindevice or computer, and a non-transitory computer-readablemedium in which such software or commands are stored so as tobe executable in a certain device or computer when read out.Industrial Applicability
[511] The present invention can be used to encode / decode animage.
Claims
1. An image decoding method performed by an image decoding apparatus (1000), the image decoding method comprising: determining whether an intra-hybrid mode is applied to a current coding block; dividing the current coding block into more than one sub-block, when the current coding block is predicted by the intra hybrid mode; generating a prediction sample of a first sub-block among the more than one sub-blocks using an intra prediction mode of the first sub-block derived based on a first neighboring block adjacent to the first sub-block and a second neighboring block adjacent to a second sub-block; and generating a prediction sample of remaining sub-blocks including the second sub-block among the more than one sub-blocks using the intra prediction mode of the first sub-block, wherein, the current coding block includes the more than one sub-block and predicted by intra prediction mode based on the intra-hybrid mode applied to the current coding block, and the current coding block is divided into the more than one sub-block based on a partition direction.
2. An image encoding method performed by an image encoding apparatus (100), the image encoding method comprising: determining whether an intra-hybrid mode is applied to a current coding block; dividing the current coding block into more than one sub-block, when the current coding block is predicted by the intra hybrid mode; generating a prediction sample of a first sub-block among the more than one sub-blocks using an intra prediction mode of the first sub-block derived based on a first neighboring block adjacent to the first sub-block and a second neighboring block adjacent to a second sub-block; and generating a prediction sample of remaining sub-blocks including the second sub-block among the more than one sub-blocks using the intra prediction mode of the first sub-block, wherein, the current coding block includes the more than one sub-block and predicted by intra prediction mode based on the intra-hybrid mode applied to the current coding block, and the current coding block is divided into the more than one sub-block based on a partition direction.
3. A bitstream transmitting method for a bitstream that is encoded by an image encoding method, the image encoding method performed by an image encoding apparatus (100) and comprising: determining whether an intra-hybrid mode is applied to a current coding block; dividing the current coding block into more than one sub-block, when the current coding block is predicted by the intra hybrid mode; generating a prediction sample of a first sub-block among the more than one sub-blocks using an intra prediction mode of the first sub-block derived based on a first neighboring block adjacent to the first sub-block and a second neighboring block adjacent to a second sub-block; and generating a prediction sample of remaining sub-blocks including the second sub-block among the more than one sub-blocks using the intra prediction mode of the first sub-block, wherein, the current coding block includes the more than one sub-block and predicted by intra prediction mode based on the intra-hybrid mode applied to the current coding block, and the current coding block is divided into the more than one sub-block based on a partition direction.
