unit l \—
Transkript
unit l \—
US 20140198848A1 (19) United States (12) Patent Application Publication (10) Pub. N0.: US 2014/0198848 A1 Yie et a]. (54) (43) Pub. Date: IMAGE ENCODING/DECODING METHOD FOR RATE-DISTORTION OPTIMIZATION AND DEVICE FOR PERFORMING SAME H04N 19/122 H04N 19/61 H04N19/186 Sung Kim, Anyang (KR); J00n Seong Park, Yongin (KR) _ CPC H04N19/0003 (2013.01); H04N19/00696 19/00533 (2013.01); H04N 19/00812 14/239,119 (2013.01);H04N19/00781(2013.01);H04N _ 19/00315 (2013.01); H04N19/00303 (22) PCT Flled' seP' 3’ 2012 (86) PCT/KR2012/007051 PCT NO; (2013.01); H04N19/00084 (2013.01) USPC ............................... .. 375/240.13; 375/240.16 § 371 (c)(1), (57) 2 4 Dt: ( )’ ( ) a e Fb.14 2014 e ’ distortion optimization and a device for performing the same. (KR) ...................... .. 10-2011-0089163 provided macroblock, and the residual prediction block is transformed by applying one of a plurality of predetermined transform matrices to the generated residual prediction block. Accordingly, rate-distortion can be optimized, and image quality can be enhanced. (2006.01) (2006.01) (2006.01) encoding controller coding Unit A macroblock to be encoded is provided, a prediction mac roblock is generated by executing either inter Prediction 0r intra prediction, a residual prediction block is generated on the basis of the generated prediction macroblock and the Publication Classi?cation Int. Cl. H04N 19/107 H04N 19/593 H04N 19/44 ABSTRACT Disclosed are an image encoding/decoding method for rate Foreign Application Priority Data Sep. 2, 2011 (51) (2006,01) (201301); H04N19/00763 (201301); H04N _ (21) Appl~ NO" (30) (2006,01) H04N19/625 (52) us. Cl. (73) Ass1gnee: HumaX C0., Ltd., Seongnam-sl (KR) . (2006.01) (2006.01) (2006.01) (2006.01) H04N 19/182 H04N19/51 (75) Inventors: Chung Ku Yie, lncheon (KR); Min _ Jul. 17, 2014 N101 . 109 A transforming \J. unit 1??» i 010000 quantizing unit i 111 i 113 125 predicting unit 105 100M“ motion compensating —\ unit l \— intra predicting unit \107 119 117 \3 buffer (J \l21 inverse~ transforming unit entropy encoding unit 115 inverse— quantizing <— unit bit stream Patent Application Publication Jul. 17, 2014 Sheet 1 0f4 i US 2014/0198848 A1 58% GE H AH5 08 AA mMH %@{235 \v6mEc?LzoIvgmcs: H:EcH:NH/ 8H/m:N .1@9mEc3?so0tmc8zb 9:c2:8miw:5 00H Y)as;ac:E:mg ?axm/cinogw 6:02:0 . |)v Q: 9t.s5:lqu 5 05 (mc$03nIgou PE: ~5 Patent Application Publication Jul. 17, 2014 Sheet 2 0f 4 US 2014/0198848 A1 FIG. 2 ( START ) input coding unit N201 inter prediction? ll perform motion prediction ~205 perform intra prediction to generate ~209 prediction block l perform motion compensation to ~207 generate prediction block generate residual prediction block l transform residual prediction block by using transform matrix having the best encoding efficiency among predetermined x213 plural transform matrices for each residual prediction block quantization N215 i entropy encoding l END \217 Patent Application Publication 1 7, 3 0f US 2014/0198848 A1 m 5m \m C2821 S 9mH%E2(3:\5o8m m momam .QE m 5-3860225$:65m2 m:5@E;EBm3E5bS3o:uEqm2cu6b f I 49SE3%w\a Sm! 2::mom) Patent Application Publication Jul. 17, 2014 Sheet 4 0f4 US 2014/0198848 A1 FIG. 4 ( START i input bit stream "\1401 perform entropy decoding (residual prediction block, motion vector, transform matrix, intra prediction mode) N403 inverse—quantize entropy—decod ed x405 residual value perform inverse-transform using extracted transform matrix to restore N407 residual prediction block motion Yes No compensation? l perform motion compensation to generate prediction block perform intra prediction to generate prediction block add residual prediction block and prediction block to restore original block N415 END Jul. 17, 2014 US 2014/0198848 A1 [0010] Further, another object of the present invention is to IMAGE ENCODING/DECODING METHOD FOR RATE-DISTORTION OPTIMIZATION AND DEVICE FOR PERFORMING SAME provide an image encoding apparatus and decoding apparatus TECHNICAL FIELD Technical Solution [0001] The present invention relates to encoding and decoding images, and more speci?cally, to an image encod ing/decoding method for rate-distortion optimization and an apparatus of performing the same. [0011] To achieve the above-described objects of the present invention, according to an aspect of the present inven BACKGROUND ART unit, generating a residual prediction block based on the [0002] In general, an image compression method performs encoding by separating one picture into a plurality of blocks each having a predetermined size. Further, the inter predic forming the generated residual prediction block by applying of performing the above-described transform method. tion, an image encoding method comprises receiving a coding unit to be encoded, generating a prediction block by perform ing one of inter prediction and intra prediction on the coding generated prediction block and the coding unit, and trans tion and intra prediction technology is used to remove redun dancy of a plurality of pictures so as to raise compression e?iciency. [0003] A method of encoding images using inter prediction compresses images by eliminating temporal redundancy a plurality of predetermined transform matrices to the residual prediction block. [0012] To achieve the above-described objects of the present invention, according to an aspect of the present inven tion, an image decoding method of decoding an encoded bit stream by applying a transform matrix having the best encod ing ef?ciency of a plurality of predetermined transform matri between pictures, and its representative example is the motion ces to a residual prediction block comprises extracting at least compensation prediction encoding method. one information of a motion vector, a quantized residual [0004] The motion compensation prediction encoding gen prediction block, a motion vector, an intra prediction mode, and a transform matrix by entropy-decoding the bit stream, erates a motion vector (MV) by searching a region similar to a block that is currently encoded in at least one reference inverse-quantizing the quantized residual prediction block, picture positioned before and/or behind a picture that is cur rently encoded, performs DCT on a residual value between the current block and a prediction block obtained by conduct restoring the residual prediction block by inverse-transform ing motion compensation using the generated motion vector, prediction block, generating a prediction block by perform quantizes and entropy encodes the DCTed value and trans mits the resultant value. [0005] In general, blocks having various sizes such as 16x16, 8x16, and 8x8 pixels are used for motion compensa tion prediction, and a block having a size of 8x8 or 4x4 pixels is used for transform and quantization. [0006] The intra prediction is a method of compressing images by eliminating spatial redundancy using a pixel cor relation between blocks in a picture. In the intra prediction method, a prediction value of a current block to be encoded is generated from encoded pixels adjacent to the current block, and the generated prediction value and the residual value of the pixels in the current block are subjected to compression. In the H.264/AVC standards, the size of a block used for intra prediction is 4x4, 8x8 or 16x16 pixels. A block having a size of 4x4 or 8x8 pixels is subject to intra prediction using nine intra prediction modes, and a block having a size of 16x16 ing the inverse-quantized residual prediction block by apply ing the transform matrix to the inverse-quantized residual ing one of motion compensation and intra prediction, and restoring an original coding unit by adding the restored residual prediction block and the generated prediction block. The transform matrix may use at least one transform matrix of DST (Discrete Sine Transform) and DCT (Discrete Cosine Transform) on a 4x4 block whose prediction mode is an intra prediction mode with respect to a luma signal. The transform matrix may use a DST (Discrete Sine Transform) transform matrix on a 4x4 block whose prediction mode is an intra prediction mode with respect to a luma signal. The transform matrix may use at least transform matrix of DST (Discrete Sine Transform) and DCT (Discrete Cosine Transform) on a 4x4 block whose prediction mode is an intra prediction mode with respect to a chroma signal. The transform matrix may use a DST (Discrete Sine Transform) transform matrix on a 4x4 block whose prediction mode is an intra prediction mode with respect to a chroma signal. pixels is subject to intra prediction using four intra prediction Advantageous Effects modes. [0007] As described above, the residual value generated [0013] According to the image encoding/ decoding method through intra prediction undergoes transform and quantiza and apparatus of performing the same, all of a plurality of tion. [0008] However, conventional transform methods do not take the characteristics of each block into consideration, thus predetermined transform matrices, which is determined failing to maximize transform performance in light of rate distortion. DISCLOSURE according to the size of the block to be transformed upon transform, are applied to a residual prediction block gener ated through inter prediction or intra prediction, and a trans form matrix having the best encoding ef?ciency is adopted to transform the residual prediction block, thus resulting in the ratio-distortion being optimized and the image quality being enhanced. image encoding and decoding method for rate-distortion opti [0014] Further, one of DST (Discrete Sine Transform) and DCT (Discrete Cosine Transform) is performed only on a 4x4 block whose prediction mode is an intra prediction mode with respect to a luma signal, and thus, complexity may be reduced mization that may maximize transform performance. as compared with when the transform is performed on both a Technical Problem [0009] An object of the present invention is to provide an Jul. 17, 2014 US 2014/0198848 A1 4><4 block and an 8x8 block because a memory for storing only one additional DST matrix (or DCT matrix) for the 4x4 block size is required. [0015] Further, one of DST (Discrete Sine Transform) and DCT (Discrete Cosine Transform) is performed only on a 4x4 block who se prediction mode is an intra prediction mode with respect to a chroma signal, and thus, complexity may be reduced as compared with when the transform is performed meanings as those generally understood by one of ordinary skill in the art. Such terms as generally de?ned in the dictio nary should be interpreted as having meanings consistent with those understood in the context of the related technolo gies, and should not be construed as having excessively for mal or ideal meanings unless clearly de?ned in the instant application. [0026] Hereinafter, preferred embodiments of the present on both a 4x4 block and an 8x8 block because a memory for invention will be described in detail with reference to the storing only one additional DST matrix (or DCT matrix) for the 4x4 block size is required. entire invention, the same references are used to denote the DESCRIPTION OF DRAWINGS same elements throughout the drawings, and description thereof is not repeated. accompanying drawings. For better understanding of the FIG. 1 is a block diagram illustrating the con?gura [0027] A residual value generated through intra prediction tion of an image encoding apparatus using weighted predic goes through transform and quantization processes. In the tion according to an example embodiment of the present invention. [0017] FIG. 2 is a ?owchart illustrating an image encoding transform process, one transform matrix may be identically applied to all the blocks, or a transform matrix predetermined method using weighted prediction according to an example to the blocks. embodiment of the present invention. [0018] FIG. 3 is a block diagram illustrating the con?gura tional Transform) compresses energy of a prediction error [0016] tion of an image decoding apparatus using weighted predic tion according to an example embodiment of the present invention. [0019] FIG. 4 is a ?owchart illustrating an image decoding method using weighted prediction according to an example embodiment of the present invention. BEST MODE [0020] Various modi?cations may be made to the present invention and the present invention may have a number of embodiments. Speci?c embodiments are described in detail with reference to the drawings. [0021] However, the present invention is not limited to speci?c embodiments, and it should be understood that the present invention includes all modi?cations, equivalents, or replacements that are included in the spirit and technical scope of the present invention. [0022] The terms “?rst” and “second” may be used to describe various components, but the components are not limited thereto. These terms are used only to distinguish one component from another. For example, the ?rst component according to a selected intra prediction mode may be applied [0028] For example, the MDDT (Mode-Dependent Direc block in the frequency domain using a basis vector designed based on the KLT (Karhunen-Loeve Transform) according to the directivity of the intra prediction method with respect to a residual value generated after intra prediction is performed (that is, prediction error block) in order to reduce the residual value generated through intra prediction. The MDDT tech nology applies transform depending on the intra prediction mode, and thus, the characteristics of quantized transform coef?cients generated after quantization may also have dif ferent forms depending on the directivity, and adaptive scan ning is adopted so as to more ef?ciently encode such coef? cients. [0029] In a mode-dependent transform method according to an example embodiment of the present invention, along the horizontal direction or vertical direction depending on the intra prediction mode, DST (Discrete Sine Transform) and/or DCT (Discrete Cosine Transform) can be performed on a residual value (i.e., prediction error block) generated by per forming intra prediction on a block having a predetermined size (for example, a 4x4 block and/or an 8x8 block) with respect to a luma signal. may be also named the second component, and the second [0030] component may be similarly named the ?rst component. The method according to an example embodiment of the present term “and/or” includes a combination of a plurality of related items as described herein or any one of the plurality of related or DCT (Discrete Cosine Transform) on a block having a items. [0023] When a component is “connected” or “coupled” to another component, the component may be directly con nected or coupled to the other component. In contrast, when a component is directly connected or coupled to another component, no component intervenes. [0024] The terms used herein are given to describe the embodiments but not intended to limit the present invention. A singular term includes a plural term unless otherwise In other words, the mode-dependent transform invention may perform DST (Discrete Sine Transform) and/ predetermined size (for example, a 4x4 block and/or an 8x8 block), whose prediction mode is an intra prediction mode, with respect to a luma signal. [0031] In case the size of a prediction unit is 4><4 pixels, one of a total of 18 directions is determined as the prediction direction, and in case the size of the prediction unit is 8x8 pixels, one of a total of 35 directions may be used as the prediction direction. The number of prediction directions stated. As used herein, the terms “include” or “have” are used depending on the size of the prediction unit is not limited thereto, and the number of prediction direction may vary to indicate that there are features, numerals, steps, operations, considering the spatial redundancy characteristic of images components, parts or combinations thereof as described so that the size of the prediction unit may be increased. herein, but do not exclude the presence or possibility of addi tion of one or more features, numerals, steps, operations, components, parts or components thereof. method according to an example embodiment of the present [0025] Unless de?ned otherwise, all the terms including or DCT (Discrete Cosine Transform) on a residual value (i.e., technical or scienti?c terms as used herein have the same prediction error block) generated after intra prediction is per [0032] Accordingly, the mode-dependent transform invention may perform DST (Discrete Sine Transform) and/ Jul. 17, 2014 US 2014/0198848 A1 formed on the 4x4 block along the horizontal or vertical [0038] Alternatively, the mode-dependent transform direction depending on 18 intra prediction modes With respect to the luma signal. method according to an embodiment of the present invention [0033] For example, the mode-dependent transform method according to an example embodiment of the present invention may perform DCT (Discrete Cosine Transform) on a residual value (i.e., prediction error block) generated after intra prediction is performed on the 4x4 block in case the intra prediction mode is a vertical mode (or 0) With respect to the luma signal along the vertical direction. Alternatively, the mode-dependent transform method according to another example embodiment of the present invention may perform may perform one of DST (Discrete Sine Transform) and DCT (Discrete Cosine Transform) only on a 4x4 block Whose prediction mode is an intra prediction mode With respect to a luma signal. [0039] In the above-described mode-dependent transform method according to example embodiments of the present invention, transform is performed only on a 4x4 block With respect to a luma signal. Accordingly, as compared With When intra prediction is performed on both a 4x4 block and an 8x8 block, complexity may be reduced because a memory for DCT along the horizontal direction on a residual value (i.e., storing only one additional DST matrix (or DCT matrix) With prediction error block) generated after intra prediction is per respect to the size of the 4x4 block is required. formed in case the intra prediction mode is the vertical mode (or 0) on the 4x4 block With respect to the luma signal. [0034] Alternatively, the mode-dependent transform method according to another example embodiment of the present invention may perform DCT along the vertical direc tion on a residual value (i.e., prediction error block) generated after intra prediction is performed in case the intra prediction mode is a horizontal mode (or 1) on the 4x4 block With [0040] The mode-dependent transform method according to the example embodiments of the present invention has been described With respect to the luma signal. However, the mode-dependent transform method may be applied to a chroma signal in the same way. This is hereinafter described in greater detail. [0041] The mode-dependent transform method according to an embodiment of the present invention may perform DST (Discrete Sine Transform) and/or DCT (Discrete Cosine respect to the luma signal. Or, the mode-dependent transform method according to another embodiment of the present invention may perform DST along the horizontal direction on a residual value (i.e., prediction error block) generated after intra prediction is performed in case the intra prediction mode is the horizontal mode (or 1) on the 4x4 block With respect to performed on a block having a predetermined sizeifor example, a 4x4 block and/or 8x8 blOCkiWiIh respect to a the luma signal. [0035] Alternatively, the mode-dependent transform according to an embodiment of the present invention may method according to another embodiment of the present invention may perform DST (Discrete Sine Transform) and/ or DCT (Discrete Cosine Transform) along the horizontal direction or vertical direction depending on 35 intra predic tion modes on a residual value (i.e., prediction error block) generated after intra prediction is performed on an 8x8 block With respect to a luma signal. Transform) along the horizontal direction or vertical direction depending on an intra prediction mode on a residual value (i.e., prediction error block) generated after intra prediction is chroma signal. [0042] That is, the mode-dependent transform method perform DST (Discrete Sine Transform) and/or DCT (Dis crete Cosine Transform) on a block having a predetermined size (for example, a 4x4 block and/or 8x8 block) Whose prediction mode is an intra prediction mode With respect to the chroma signal. [0043] The mode-dependent transform method according to an embodiment of the present invention may perform DST [0036] For example, the mode-dependent transform (Discrete Sine Transform) and/or DCT (Discrete Cosine method according to an embodiment of the present invention Transform) along the horizontal direction or vertical direction may perform DST (Discrete Sine Transform) along the ver depending on 18 intra prediction modes on a residual value tical direction on a residual value (i.e., prediction error block) (i.e., prediction error block) generated after intra prediction is generated after intra prediction is performed in case the intra prediction mode is the vertical mode (or 0) on the 8x8 block With respect to the luma signal. Alternatively, the mode-de pendent transform method according to another embodiment of the present invention may perform DCT along the horizon performed on a 4x4 block With respect to the chroma signal. tal direction on a residual value (i.e., prediction error block) [0044] For example, the mode-dependent transform method according to an embodiment of the present invention may perform DST (Discrete Sine Transform) along the ver tical direction on a residual value (i.e., prediction error block) generated after intra prediction is performed in case the intra prediction mode is the vertical mode (or 0) on a 4x4 With generated after intra prediction is performed in case the intra prediction mode is the vertical mode (or 0) on the 8x8 block With respect to the luma signal. respect to the chroma signal. Alternatively, the mode-depen [0037] Alternatively, the mode-dependent transform the present invention may perform DCT along the horizontal dent transform method according to another embodiment of method according to another embodiment of the present direction on a residual value (i.e., prediction error block) invention may perform DCT along the vertical direction on a generated after intra prediction is performed in case the intra prediction mode is the vertical mode (or 0) on the 4x4 block With respect to the chroma signal. residual value (i.e., prediction error block) generated after intra prediction is performed in case the intra prediction mode is the horizontal mode (or 1) on the 8x8 block With respect to [0045] Alternatively, the mode-dependent transform the luma signal. Alternatively, the mode-dependent transform method according to another embodiment of the present method according to another embodiment of the present invention may perform DST along the horizontal direction on a residual value (i.e., prediction error block) generated after intra prediction is performed in case the intra prediction mode is the horizontal mode (or 1) on the 8x8 block With respect to the luma signal. invention may perform DCT along the vertical direction on a residual value (i.e., prediction error block) after intra predic tion is performed in case the intra prediction mode is the horizontal mode (or 1) on the 4x4 block With respect to the chroma signal. Or the mode-dependent transform method according to another embodiment of the present invention Jul. 17, 2014 US 2014/0198848 A1 may perform DST along the horizontal direction on a residual value (i.e., prediction error block) generated after intra pre diction is perforrned in case the intra prediction mode is the horizontal mode (or 1) on the 4x4 block With respect to the chroma signal. [0046] Alternatively, the mode-dependent transform method according to another embodiment of the present invention may perform DST (Discrete Sine Transform) and/ or DCT (Discrete Cosine Transform) along the horizontal direction or vertical direction depending on 35 intra predic tion modes on a residual value (i.e., prediction error block) generated after intra prediction is performed on the 8x8 block With respect to the chroma signal. ?rst adder 109, a transforming unit 1 1 1, an inverse-quantizing unit 115, an inverse-transforming unit 117, a second adder 119, a buffer 121, and an entropy encoding unit 125. [0054] The encoding controller 101 determines the encod ing mode of a coding unit entered as one of an inter prediction mode and an intra prediction mode, and based on the deter mined encoding mode, connects one of the motion compen sating unit 105 and the intra predicting unit 107 to the ?rst adder 109 and the second adder 119. Further, the encoding controller 101 provides encoding-related overhead informa tion including a transform matrix used for transform to the may perform DST (Discrete Sine Transform) along the ver entropy encoding unit 125 and controls the operation of the constituent elements included in the encoding apparatus. Although in FIG. 1 the encoding controller 101 is included in the encoding apparatus 100, the encoding controller 101 may also be implemented not to be included in the encoding appa tical direction on a residual value (i.e., prediction error block) ratus 100. generated after intra prediction is performed in case the intra prediction mode is the vertical mode (or 0) on the 8x8 block With respect to the chroma signal. Alternatively, the mode dependent transform method according to another embodi ment of the present invention may perform DCT along the [0055] Here, the entered coding unit has a square shape, and each coding unit (CU) may have a variable size of 2N><2N [0047] For example, the mode-dependent transform method according to an embodiment of the present invention horizontal direction on a residual value (i.e., prediction error (unit: pixels). Inter prediction (or inter-frame prediction), intra prediction (or intra-frame prediction), transform, quan tization, and entropy encoding may be performed on a per the intra prediction mode is the vertical mode (or 0) on the 8x8 block With respect to the chroma signal. coding unit (CU) basis. The coding units (CUs) may include a largest coding unit (LCU) and a smallest coding unit (SCU). The size of the largest coding unit (LCU) or the smallest coding unit (SCU) may be represented as the power of 2 [0048] Alternatively, the mode-dependent transform Which is 8 or more. For example, the entered coding unit may method according to another embodiment of the present invention may perform DCT along the vertical direction on a have a size of 16x16 pixels or less or may be an extended macro block having a size of 32x32 or 64x64 pixels or more. The extended macro block may have a size of 32x32 pixels or more, i.e., 64x64 pixels, 128x128 pixels or more, so as to ?t block) generated after intra prediction is performed in case residual value (i.e., prediction error block) after intra predic tion is performed in case the intra prediction mode is the horizontal mode (or 1) on the 8x8 block With respect to the into a high resolution such as an HD (Ultra High De?nition) chroma signal. Alternatively, the mode-dependent transform or higher resolution. The extended macro block, in case it has method according to another embodiment of the present invention may perform DST along the horizontal direction on a residual value (i.e., prediction error block) generated after intra prediction is performed in case the intra prediction mode is the horizontal mode (or 1) on the 8x8 block With respect to a high resolution such as ultra HD (High De?nition) or higher resolution, may be limited in size to up to 64x64 pixels the chroma signal. [0049] Alternatively, the mode-dependent transform method according to an embodiment of the present invention may perform one of the DST (Discrete Sine Transform) and the DCT (Discrete Cosine Transform) only on a 4x4 block Whose prediction mode is an intra prediction mode With respect to a chroma signal. [0050] In the mode-dependent transform method according to the embodiments of the present invention, intra prediction considering the complexity of the encoder and decoder. [0056] The coding unit (CU) may have a recursive tree structure. The recursive tree structure may be represented through a series of ?ags. For example, in case a coding unit (CUk) having a level or depth of k has a ?ag value of 0, the coding on the coding unit (CUk) is ful?lled With respect to a current level or depth, and in case the ?ag value is l, the coding unit (CUk) having a current level or depth of k is split into four independent coding units (CUk+l), and the split coding unit (CUk+l) has a level or depth of k+l, With a size of Nk+l><Nk+l. In such case, the coding unit (CUk+l) may be represented as a sub coding unit of the coding unit (CUk). is performed only on a 4x4 block With respect to a chroma The coding unit (CUk+l) may be recursively processed until signal. Accordingly, as compared With When intra prediction the level or depth of the coding unit (CUk+l) reaches a is performed on both a 4x4 block and an 8x8 block, complex ity may be reduced because a memory for storing only one maximum permissible level or depth. In case the level or additional DST matrix (or DCT matrix) is required With respect to the 4x4 block size. [0051] Hereinafter, according to an embodiment of the present invention, the extended macro block means a block having a size of32><32 pixels or more or a size of64><64 pixels depth of the coding unit (CUk+ l) is the same as the maximum permissible level or depth, no further split is allowed. [0057] The size of the largest coding unit (LCU) and the size of the smallest coding unit (SCU) may be included in a sequence parameter set (SPS). The sequence parameter set (SPS) may include the maximum permissible level or depth or more. of the largest coding unit (LCU). For example, in case the [0052] FIG. 1 is a block diagram illustrating the con?gura tion of an image encoding apparatus according to an embodi maximum permissible level or depth is 5, and the size of an ment of the present invention. types of coding unit sizes, such as 128x128 (LCU), 64x64, 32x32, 16x16, and 8x8 (SCU), may be possible. That is, ifthe size of the largest coding unit (LCU) and the maximum per missible level or depth are given, the permissible coding unit [0053] Referring to FIG. 1, the encoding apparatus 100 according to an embodiment of the present invention includes an encoding controller 101, a motion predicting unit 103, a motion compensating unit 105, an intra predicting unit 107, a edge of the largest coding unit (LCU) is 128 (unit: pixels), ?ve size may be determined. Jul. 17, 2014 US 2014/0198848 A1 [0058] The size of the coding unit, When it comes to the high resolution such as ultra HD (High De?nition) or higher generating a motion vector. Here, the generated motion vector is provided to the motion compensating unit 105 and the resolution, may be limited to a maximum of 64x64 pixels or entropy encoding unit 125. [0067] The motion compensating unit 105 applies the less considering the complexity of the encoder and decoder. [0059] The use of the above-described recursive coding unit structure provides the following advantages. motion vector provided to the motion predicting unit 103 to a is homogeneous, the largest coding unit (LCU) may display corresponding reference picture stored in the buffer 121, thereby generating a prediction block that has undergone motion compensation. [0068] The intra predicting unit 107 generates a prediction the image region of interest With a smaller number of symbols value of a current block from encoded pixels adjacent to the as compared With When several small blocks are used. entered coding unit. Here, the intra predicting unit 107 may separate the entered coding unit into blocks each having a size of 4x4, 8x8, or 16x16 pixels, and may generate a prediction block from pixels adjacent to each separated block. When performing intra prediction on blocks each having a size of 4x4 or 8x8 pixels, the intra predicting unit 107 may perform [0060] First, a larger size than that of the existing 16x16 macro block may be provided. If an image region of interest [0061] Second, various sizes may be applied to the largest coding unit (LCU) as compared With When a ?xed size of macro block is used. Accordingly, a codec may be readily optimized for various types of content, applications and devices. That is, the largest coding unit (LCU) size and maxi mum level or maximum depth may be properly chosen, so that the hierarchical block structure may be optimized better for a targeted application. [0062] Third, Without being separated into the macro block, sub-macro block, and extended macro block, a single unit, i.e., a coding unit (LCU), is used, so that the multi-level hierarchical structure may be represented in a very simple manner using the largest coding unit (LCU) size, maximum level (or maximum depth) and a series of ?ags. When used together With a size-independent syntax representation, it may be suf?cient to specify a syntax item having a normalized size for the remaining coding tools, and such consistency may simplify, e.g., the actual parsing process. The level (or maxi mum depth) may have any maximum value, and may have a value larger than the value permitted in the existing H.264/ AVC encoding scheme. The size-independent syntax repre sentation may be used to specify all syntax elements in a consistent manner independent from the size of the coding unit (CU). The splitting process for the coding unit (CU) may be recursively speci?ed, and other syntax elements for the leaf coding unitilast coding unit of the levelimay be de?ned to have the same size irrespective of the size of the coding unit. To make a representation as described above may be very ef?cient in reducing the parsing complexity, and in case a large level or depth is allowed, the clarity of represen tation may be enhanced. [0063] If the above-described hierarchical splitting process is complete, inter prediction or intra prediction may be per formed on the leaf unit of the leaf coding unit layer tree With no further split, and largest, and such leaf coding unit is used as a prediction unit (PU) that is a basis of inter prediction or intra prediction. [0064] In order to perform inter prediction or intra predic tion, partitioning is carried out on the leaf coding unit. That is, the partitioning is ful?lled on the prediction unit (PU). Here, the prediction unit (PU) means a basis for inter prediction or intra prediction, and may be an existing macro block or a sub-macro block, or may be a coding unit or an extended macro block having a size of 32x32 pixels. [0065] The partitioning for inter prediction or intra predic tion may be performed by an asymmetric partitioning scheme the intra prediction on the 4x4 or 8x8 pixel blocks using one nine H.264/AVC intra prediction modes. The intra predicting unit 107 may perform intra prediction on blocks each having a size of 16x16 pixels using one of four intra prediction modes. [0069] Alternatively, the intra predicting unit 107 may determine one of 18 prediction directions, When performing intra prediction using a prediction unit having a size of 4x4 pixels, may determine one of 35 prediction directions When performing intra prediction using a prediction unit having a size of 8x8 pixels, may determine one of 35 prediction direc tions When performing intra prediction on a prediction unit having a size of 16x16 pixels, may determine one of 35 prediction directions When performing intra prediction on a prediction unit (PU) having a size of 32x32 pixels, and may determine one of four prediction directions When performing intra prediction on a prediction unit (PU) having a size of 64x64 pixels. The number of prediction directions depending on the size of the prediction unit is not limited thereto, and as the size of the prediction unit, the number of prediction direc tions may vary considering the spatial redundancy of the image. [0070] In the encoding apparatus 100 according to an embodiment of the present invention, only one of the inter prediction mode through the motion predicting unit 103 and the motion compensating unit 105 and the intra prediction mode through the intra predicting unit 107 may be carried out under control of the encoding controller 101, and in case one of the inter prediction mode and intra prediction mode is selected, the encoding controller 101 sWitches a connection path so that one of an output from the motion compensating unit 105 and an output from the intra predicting unit 107, Which corresponds to the selected prediction mode, may be provided to the ?rst adder 109 and the second adder 119. [0071] The ?rst adder 109, in case inter prediction encoding is performed, computes the entered coding unit and the pre diction block provided from the motion compensating unit 105 to generate a residual value (or residual predictionblock), and in case intra prediction encoding is performed, computes the entered coding unit and the prediction block provided from the intra predicting unit 107 to generate a residual value. [0072] The transforming unit 111 performs transform or in a geometrical partitioning scheme that provides a shape other than a square shape, or may be done by an along-edge using one of a plurality of predetermined transform matrices direction partitioning scheme. [0066] Referring back to FIG. 1, the motion predicting unit residual prediction blocks (i.e., residual values) provided considering the encoding ef?ciency and size of each of 103 performs inter prediction based on a plurality of refer ence pictures that have been completely restored and are from the ?rst adder 109, Which are to be transformed. stored in the buffer 121 and the entered coding unit, thereby formed and the size of a block to be transformed is 4><4 pixels [0073] Speci?cally, When intra prediction encoding is per Jul. 17, 2014 US 2014/0198848 A1 or 8x8 pixels, the transforming unit 111 applies a predeter mined number (e.g., 9) of transform matrices all to each transform block, and then may perform encoding using a [0081] Accordingly, the transforming unit 111 may per form DST (Discrete Sine Transform) and/or DCT (Discrete Cosine Transform) along the horizontal direction or vertical transform matrix having the best encoding e?iciency. When direction depending on 18 intra prediction modes on a intra prediction encoding is performed, and the size of a block to be transformed is 16x16 pixels, the transforming unit 111 applies a predetermined number (e. g., 4) of transform matri ces all to each transform block, and then may perform encod residual value (i.e., prediction error block) generated after ing by using a transform matrix having the best encoding e?iciency. Here, the predetermined number of transform matrices may be transform matrices de?ned in the MDDT (Mode Dependent Directional Transform). intra prediction is performed on a 4x4 block With respect to a luma signal. [0082] For example, the transforming unit 111 may per form DST (Discrete Sine Transform) along the vertical direc tion on a residual value (i .e., prediction error block) generated after intra prediction is performed in case the intra prediction mode is the vertical mode (or 0) on the 4x4 block With respect [0074] The MDDT performs transform along an intra cod ing-speci?c directionifor example, an intra mode used for to the luma signal. Alternatively, the transforming unit 111 encoding (or intra coding direction). For example, in case value (i.e., prediction error block) generated after intra pre among nine intra modes, a horizontal direction mode is used to perform intra coding on a 4x4 block, transform may be diction is performed in case the intra prediction mode is the vertical mode (or 0) on the 4x4 block With respect to the luma performed along the horizontal direction. [0075] The size of the block to be transformed may be a 4x4 block, an 8x8 block, a 16x16 block or a 32x32 block. [0076] The block used for transform may be implemented as a transform unit (TU), and the transform unit may have a recursive tree structure (hierarchical structure transform). For example, the transform unit may have a two-level tree struc ture. For example, in case a transform unit having a level or depth of k comes With a ?ag value of 0, transform on the transform unit is done for the current level or depth, and in case the ?ag value is l, a coding unit (CUk) having a current level or depth of k is split into four independent coding units (CUk+l), and the split coding units (CUk) each may have a may perform DCT along the horizontal direction on a residual signal. [0083] Alternatively, the transforming unit 111 may per form DCT along the vertical direction on a residual value (i.e., prediction error block) generated after intra prediction is per formed in case the intra prediction mode is the horizontal mode (or 1) on the 4x4 block With respect to the luma signal. Alternatively, the transforming unit 111 may perform DST along the horizontal direction on a residual value (i.e., pre diction error block) generated after intra prediction is per formed in case the intra prediction mode is the horizontal mode (or 1) on the 4x4 block With respect to the luma signal. [0084] Alternatively, the transforming unit 111 may per form DST (Discrete Sine Transform) and/or DCT (Discrete level or depth of k+l and may have a size of Nk+l><Nk+l. Cosine Transform) along the horizontal direction or vertical [0077] residual value (i.e., prediction error block) generated after Alternatively, even in case inter prediction encoding is performed and the size of a block to be transformed is 32x32 pixels or more, the transforming unit 111 may apply all of a predetermined number of transform matrices corre sponding to the inter prediction encoding, and then may per form encoding using a transform matrix having the best encoding ef?ciency. [0078] In accordance With the mode-dependent transform method according to an embodiment of the present invention, the transforming unit 111 may perform DST (Discrete Sine direction depending on 35 intra prediction modes on a intra prediction is performed on an 8x8 block With respect to the luma signal. [0085] For example, the transforming unit 111 may per form DST (Discrete Sine Transform) along the vertical direc tion on a residual value (i .e., prediction error block) generated after intra prediction is performed in case the intra prediction mode is the vertical mode (or 0) on the 8x8 block With respect to the luma signal. Alternatively, the transforming unit 111 may perform DCT along the horizontal direction on a residual Transform) and/or DCT (Discrete Cosine Transform) along value (i.e., prediction error block) generated after intra pre the horizontal direction or vertical direction depending on an diction is performed in case the intra prediction mode is the vertical mode (or 0) on the 8x8 block With respect to the luma intra prediction mode on a residual value (i.e., prediction error block) generated after intra prediction is performed on a block having a predetermined sizeifor example, a 4x4 block and/or 8x8 blOCkiWIIh respect to a luma signal. [0079] signal. [0086] Alternatively, the transforming unit 111 may per form DCT along the vertical direction on a residual value (i.e., That is, in the mode-dependent transform method prediction error block) generated after intra prediction is per according to an embodiment of the present invention, the formed in case the intra prediction mode is the horizontal mode (or 1) on the 8x8 block With respect to the luma signal. transforming unit 111 may perform DST (Discrete Sine Transform) and/or DCT (Discrete Cosine Transform) on a block Whose prediction mode is an intra prediction mode and Which has a predetermined sizeifor example, a 4x4 block and/ or 8x8 blOCkiWIIh respect to the luma signal. [0080] In case the size of the prediction unit (PU) is 4><4 pixels, one of a total of l 8 prediction directions is determined, and in case the size of the prediction unit (PU) is 8x8 pixels, Alternatively, the transforming unit 111 may perform DST along the horizontal direction on a residual value (i.e., pre diction error block) generated after intra prediction is per formed in case the intra prediction mode is the horizontal mode (or 1) on the 8x8 block With respect to the luma signal. [0087] Alternatively, in the mode-dependent transform one of a total of 35 prediction directions may be used. The method according to an embodiment of the present invention, the transforming unit 111 may perform one of DST (Discrete number of prediction directions depending on the size of the prediction unit is not limited thereto, and as the size of the on a 4x4 block Whose prediction mode is an intra prediction prediction unit (PU) increases, the number of prediction directions may vary considering the spatial redundancy of the image. Sine Transform) and DCT (Discrete Cosine Transform) only mode With respect to the luma signal. [0088] In case the transforming unit 111 performs the trans form on only the 4x4 block With respect to the luma signal, Jul. 17, 2014 US 2014/0198848 A1 complexity may be reduced as compared With When the trans form is performed on both the 4x4 block and the 8x8 block because of requiring a memory for storing only one additional to the chroma signal. Alternatively, the transforming unit 111 DST matrix (or DCT matrix) for the 4x4 block size. diction is performed in case the intra prediction mode is the vertical mode (or 0) on the 8x8 block With respect to the [0089] The mode-dependent transform method according may perform DCT along the horizontal direction on a residual value (i.e., prediction error block) generated after intra pre chroma signal. to the embodiments of the present invention has been described in relation to the luma signal, but the same method may be likeWise performed on a chroma signal. This is here inafter described in greater detail. The transforming unit 111 prediction error block) generated after intra prediction is per may perform DST (Discrete Sine Transform) and/or DCT (Discrete Cosine Transform) along the horizontal direction or formed in case the intra prediction mode is the horizontal mode (or 1) on the 8x8 block With respect to the chroma [0096] Alternatively, the transforming unit 111 may per form DCT along the vertical direction on a residual value (i.e., vertical direction depending on an intra prediction mode on a signal. Alternatively, the transforming unit 111 may perform residual value (i.e., prediction error block) generated after DST along the horizontal direction on a residual value (i.e., intra prediction is performed on a block having a predeter mined sizeifor example, a 4x4 block and/or 8x8 blocki With respect to a chroma signal. prediction error block) generated after intra prediction is per [0090] That is, in the mode-dependent transform method method according to an embodiment of the present invention according to an embodiment of the present invention, the may perform one of the DST (Discrete Sine Transform) and DCT (Discrete Cosine Transform) only on a 4x4 block Whose transforming unit 111 may perform DST (Discrete Sine Transform) and/or DCT (Discrete Cosine Transform) on a block Whose prediction mode is an intra prediction mode and Which has a predetermined sizeifor example, a 4x4 block and/or 8x8 blockiWith respect to a chroma signal. [0091] The transforming unit 111 may perform DST (Dis crete Sine Transform) and/or DCT (Discrete Cosine Trans form) along the horizontal direction or vertical direction formed on the 8x8 block With respect to the chroma signal. [0097] Alternatively, the mode-dependent transform prediction mode is an intra prediction mode With respect to a chroma signal. [0098] In the mode-dependent transform method according to embodiments of the present invention, the transform is performed only on a 4x4 block With respect to the chroma signal. Accordingly, as compared With When the transform is performed on both the 4x4 block and 8x8 block, a memory is depending ion 18 intra prediction modes on a residual value required for storing only one additional DST matrix (or DCT (i.e., prediction error block) generated after intra prediction is matrix), thus reducing complexity. performed on a 4x4 block With respect to the chroma signal. [0099] As described above, information of a transform matrix used for transform among a plurality of transform [0092] For example, the transforming unit 111 may per form DST (Discrete Sine Transform) along the vertical direc may perform DCT along the horizontal direction on a residual matrices is provided to the entropy encoding unit 125 and is then entropy encoded, and is then provided to the decoding apparatus and is used for decoding. [0100] The quantizing unit 113 quantizes the transformed data provided from the transforming unit 111, and provides it to the inverse-quantizing unit 115 and the entropy encoding value (i.e., prediction error block) generated after intra pre unit 125. diction is performed in case the intra prediction mode is the vertical mode (or 0) on the 4x4 block With respect to the [0101] The inverse-quantizing unit 115 inverse-quantizes the quantized data provided from the quantizing unit 113 and then provides it to the inverse-transforming unit 117. The inverse-transforming unit 117 inverse-transforms the inverse quantized data using the transform matrix information used tion on a residual value (i.e., prediction error block) generated after intra prediction is performed in case the intra prediction mode is the vertical mode (or 0) on the 4x4 block With respect to the chroma signal. Alternatively, the transforming unit 111 chroma signal. [0093] Alternatively, the transforming unit 111 may per form DCT along the vertical direction on a residual value (i .e., prediction error block) generated after intra prediction is per formed in case the intra prediction mode is the horizontal mode (or 1) on the 4x4 block With respect to the chroma signal. Alternatively, the mode-dependent transform method according to another embodiment of the present invention may perform DST along the horizontal direction on a residual for transform in the transforming unit 111 to thereby restore the residual prediction block and then provides it to the sec ond adder 119. [0102] The second adder 119 restores the coding unit by adding the prediction block provided from the inverse-trans forming unit 117 to the prediction block provided from the diction is performed in case the intra prediction mode is the horizontal mode (or 1) on the 4x4 block With respect to the motion compensating unit 105 or the intra predicting unit 107 and stores it in the buffer 121. [0103] The buffer 121 may store pictures, a set of restored chroma signal. coding units, and the plurality of pictures stored in the buffer [0094] Alternatively, the transforming unit 111 may per form DST (Discrete Sine Transform) and/or DCT (Discrete compensation. value (i.e., prediction error block) generated after intra pre Cosine Transform) along the horizontal direction or vertical direction depending on 35 intra prediction modes on a residual value (i.e., prediction error block) generated after intra prediction is performed on an 8x8 block With respect to the chroma signal. [0095] For example, the transforming unit 111 may per form DST (Discrete Sine Transform) along the vertical direc tion on a residual value (i.e., prediction error block) generated after intra prediction is performed in case the intra prediction mode is the vertical mode (or 0) on the 8x8 block With respect 121 are used as reference pictures for motion prediction and [0104] The entropy encoding unit 125 entropy encodes the quantized residual prediction block, the motion vector infor mation used for inter prediction, prediction mode information used for intra prediction, and transform matrix information used for transform, thereby generating a bit stream. [0105] FIG. 2 is a ?owchart illustrating an image encoding method according to an embodiment of the present invention. [0106] Referring to FIG. 2, if a coding unit is input to the encoding apparatus (step 201), the encoding apparatus selects an intra prediction mode or an inter prediction mode (step Jul. 17, 2014 US 2014/0198848 A1 203). The input coding unit may have a size of 16x16 pixels inter prediction encoding and then applies a transform matrix or less or may be an extended macro block having a size of having the best encoding ef?ciency to perform encoding. [0111] The encoding apparatus may perform DST (Dis 32x32 or 64x64 pixels or more. The input coding unit may have the above-described recursive coding unit structure. [0107] In case inter prediction is performed, motion predic tion is performed based on the input coding unit and the plurality of reference pictures that have been completely restored and are stored in the buffer, thereby generating a motion vector (step 205). The generated motion vector is used to perform motion compensation to generate a prediction block corresponding to a current block (step 207). crete Sine Transform) and/or DCT (Discrete Cosine Trans form) along the horizontal direction or vertical direction depending on an intra prediction mode on a residual value (i .e., prediction error block) generated after intra prediction is performed on a block having a predetermined sizeifor example, 4><4 block and/or 8x8 blOCkiWIIh respect to a luma signal. [0112] That is, the encoding apparatus may perform DST (Discrete Sine Transform) and/or DCT (Discrete Cosine [0108] Alternatively, in case intra prediction is performed, the prediction value of the current block is generated from Transform) on a block having a predetermined sizeifor encoded pixels adjacent to the input coding unit (step 209). Here, the intra prediction may separate the input coding unit mode is an intra prediction mode With respect to the luma into blocks having a size of4><4, 8x8, 16x16, 32x32, or 64x64 signal. pixels and may generate the prediction block by applying the intra prediction mode to pixels adjacent to each separated [0113] In case the size of the prediction unit has a size of 4x4 pixels, one of a total of 18 prediction directions may be determined, and in case the prediction unit has a size of 8x8 pixels, one of a total of 35 prediction directions may be used. The number of prediction directions depending on the size of the prediction unit is not limited thereto, and as the size of the block. In case intra prediction is performed on a block having a size of 4x4 or 8x8 pixels, one ofthe nine H.264/AVC intra prediction modes may be applied to perform intra prediction, and in case intra prediction is performed on a block having a size of 16x16 pixels, one of four intra prediction modes may be applied to perform intra prediction. Alternatively, in case intra prediction is performed using a prediction unit having a size of 4x4 pixels, one of 18 prediction directions may be determined, in case intra prediction is performed using a prediction unit having a size of 8x8 pixels, one of a total of 35 prediction directions may be determined, in case intra predic tion is performed using a prediction unit having a size of 16x16 pixels, one of 35 prediction directions may be deter mined, in case intra prediction is performed using a prediction unit having a size of 32x32 pixels, one of 35 prediction directions may be determined, and in case intra prediction is performed using a prediction unit having a size of 64x64 pixels, one of four prediction directions may be determined. The number of prediction directions depending on the size of the prediction unit is not limited thereto, and as the size of the prediction unit increases, the number of prediction directions may vary considering the spatial redundancy of an image. [0109] Thereafter, the encoding apparatus generates a residual prediction block by computing the prediction block generated through intra prediction or inter prediction and the input coding unit (step 211), and then, the encoding apparatus example, 4><4 block and/or 8x8 blockiWhose prediction prediction unit increases, the number of prediction directions may vary considering the spatial redundancy of an image. [0114] Accordingly, the encoding apparatus may perform DST (Discrete Sine Transform) and/or DCT (Discrete Cosine Transform) along the horizontal direction or vertical direction depending on 18 intra prediction modes on a residual value (i .e., prediction error block) generated after intra prediction is performed on a 4x4 block With respect to a luma signal. [0115] For example, the encoding apparatus may perform DST (Discrete Sine Transform) along the vertical direction on a residual value (i.e., prediction error block) generated after intra prediction is performed in case the intra prediction mode is the vertical mode (or 0) on the 4x4 block With respect to the luma signal. Alternatively, the encoding apparatus may perform DCT along the horizontal direction on a residual value (i.e., prediction error block) generated after intra pre diction is performed in case the intra prediction mode is the vertical mode (or 0) on the 4x4 block With respect to the luma signal. [0116] Alternatively, the encoding apparatus may perform DCT along the vertical direction on a residual value (i.e., performs transform on the generated residual prediction prediction error block) generated after intra prediction is per block using one of a predetermined number of transform formed in case the intra prediction mode is the horizontal mode (or 1) on the 4x4 block With respect to the luma signal. matrices considering the size of the residual prediction block and encoding ef?ciency (step 213). That is, in case intra prediction is performed and the size of the transformed block is 4><4 pixels or 8x8 pixels, a predetermined number (e.g., 9) Alternatively, the encoding apparatus may perform DST along the horizontal direction on a residual value (i.e., pre diction error block) generated after intra prediction is per of transform matrices are all applied to each transform block, and then, a transform matrix having the best encoding ef? formed in case the intra prediction mode is the horizontal mode (or 1) on the 4x4 block With respect to the luma signal. ciency is applied to perform encoding. In case intra prediction encoding is performed and the size of the transformed matrix is 16x16 pixels, a predetermined number (e.g., 4) of trans DST (Discrete Sine Transform) and/or DCT (Discrete Cosine Transform) along the horizontal direction or vertical direction form matrices all are applied to each transform block, and depending on 35 intra prediction modes on a residual value then, a transform matrix having the best encoding ef?ciency is applied to conduct encoding. Here, the predetermined num performed on an 8x8 block With respect to a luma signal. ber of transform matrices may use transform matrices de?ned in the MDDT. [0118] For example, the encoding apparatus may perform DST (Discrete Sine Transform) along the vertical direction [0110] on a residual value (i.e., prediction error block) generated after intra prediction is performed in case the intra prediction Alternatively, in case inter prediction encoding is performed and the size of a block to be transformed is 32x32 pixels or more, the encoding apparatus applies all of a prede termined number of transform matrices corresponding to the [0117] Alternatively, the encoding apparatus may perform (i .e., prediction error block) generated after intra prediction is mode is the vertical mode (or 0) on an 8x8 block With respect to a luma signal. Jul. 17, 2014 US 2014/0198848 A1 [0119] Alternatively, the encoding apparatus may perform DCT along the horizontal direction on a residual value (i.e., prediction error block) generated after intra prediction is per diction is performed in case the intra prediction mode is the vertical mode (or 0) on the 4x4 block With respect to the chroma signal. [0127] Alternatively, the encoding apparatus may perform formed in case the intra prediction mode is the vertical mode (or 0) on the 8x8 block With respect to the luma signal. DCT along the vertical direction ion a residual value (i.e., Alternatively, the encoding apparatus may perform DCT prediction error block) generated after intra prediction is per along the horizontal direction on a residual value (i.e., pre diction error block) generated after intra prediction is per formed in case the intra prediction mode is the horizontal mode (or 1) on the 4x4 block With respect to the chroma formed in case the intra prediction mode is the vertical mode (or 0) on the 8x8 block With respect to the luma signal. DST along the horizontal direction on a residual value (i.e., [0120] Alternatively, the encoding apparatus may perform prediction error block) generated after intra prediction is per DCT along the vertical direction on a residual value (i.e., formed in case the intra prediction mode is the horizontal mode (or 1) on the 4x4 block With respect to the chroma prediction error block) generated after intra prediction is per signal. Alternatively, the encoding apparatus may perform formed in case the intra prediction mode is the horizontal mode (or 1) on the 8x8 block With respect to the luma signal. signal. Alternatively, the encoding apparatus may perform DST DST (Discrete Sine Transform) and/or DCT (Discrete Cosine [0128] Alternatively, the encoding apparatus may perform along the horizontal direction on a residual value (i.e., pre Transform) along the horizontal direction or vertical direction diction error block) generated after intra prediction is per depending on 35 intra prediction modes on a residual value formed in case the intra prediction mode is the horizontal mode (or 1) on the 8x8 block With respect to the luma signal. performed on an 8x8 block With respect to the chroma signal. [0121] Alternatively, the encoding apparatus may perform [0129] By way of example, the encoding apparatus may perform DST (Discrete Sine Transform) along the vertical one of the DST (Discrete Sine Transform) and DCT (Discrete Cosine Transform) only on a 4x4 block Whose prediction mode is an intra prediction mode With respect to a luma signal. [0122] In case the mode-dependent transform method according to embodiments of the present invention is per formed only on a 4x4 block With respect to a luma signal, a memory for storing one additional DST matrix (or DCT matrix) is required With respect to the 4x4 block size is required as compared With When the mode-dependent trans form method is performed on both a 4x4 block and an 8x8 block, thus reducing complexity. (i.e., prediction error block) generated after intra prediction is direction on a residual value (i.e., prediction error block) generated after intra prediction is performed in case the intra prediction mode is the vertical mode (or 0) on the 8x8 block With respect to the chroma signal. Alternatively, the encoding apparatus may perform DCT along the horizontal direction on a residual value (i.e., prediction error block) generated after intra prediction is performed in case the intra prediction mode is the vertical mode (or 0) on the 8x8 block With respect to the chroma signal. [0130] Alternatively, the encoding apparatus may perform DCT along the vertical direction on a residual value (i.e., prediction error block) generated after intra prediction is per [0123] The description has focused on the luma signal, for example. However, the same may also apply to the chroma signal. This is hereinafter described in greater detail. The formed in case the intra prediction mode is the horizontal mode (or 1) on the 8x8 block With respect to the chroma encoding apparatus may perform DST (Discrete Sine Trans form) and/or DCT (Discrete Cosine Transform) along the DST along the horizontal direction on a residual value (i.e., horizontal direction or vertical direction depending on a residual value (i.e., prediction error block) generated after intra prediction is performed on a block having a predeter mined sizeifor example, 4><4 block and/or 8x8 blockiWith respect to a chroma signal. signal. Alternatively, the encoding apparatus may perform prediction error block) generated after intra prediction is per formed in case the intra prediction mode is the horizontal mode (or 1) on the 8x8 block With respect to the chroma signal. [0131] Alternatively, the encoding apparatus may perform one of DST (Discrete Sine Transform) and DCT (Discrete Cosine Transform) only on a 4x4 block Whose prediction [0124] That is, the encoding apparatus may perform DST (Discrete Sine Transform) and/or DCT (Discrete Cosine mode is an intra prediction mode With respect to a chroma Transform) on a block having a predetermined sizeifor signal. example, 4><4 block and/or 8x8 blockiWhose prediction mode is an intra prediction mode With respect to the chroma [0132] The mode-dependent transform method according [0125] The encoding apparatus may perform DST (Dis to embodiments of the present invention is performed only on a 4x4 block With respect to the chroma signal. Accordingly, complexity may be reduced as compared With When trans crete Sine Transform) and/or DCT (Discrete Cosine Trans form) along the horizontal direction or vertical direction because a memory for storing only one additional DST matrix signal. form is performed on both a 4x4 block and an 8x8 block (i.e., prediction error block) generated after intra prediction is (or DCT matrix) is required. [0133] Thereafter, the encoding apparatus performs quan performed on a 4x4 block With respect to a chroma signal. tization on the transformed data (step 215), and generates a bit depending on 18 intra prediction modes on a residual value [0126] For example, the encoding apparatus may perform DST (Discrete Sine Transform) along the vertical direction on a residual value (i.e., prediction error block) generated after intra prediction is performed in case the intra prediction mode is the vertical mode (or 0) on the 4x4 block With respect to the chroma signal. Alternatively, the encoding apparatus may perform DCT along the horizontal direction on a residual value (i.e., prediction error block) generated after intra pre stream by entropy encoding the quantized data (step 217). Here, the entropy encoded information may include quan tized residual prediction block, motion vector information used for inter prediction, prediction mode information used for intra prediction, and transform matrix information used for transform. [0134] As described in FIGS. 1 and 2, in the encoding method according to an embodiment of the present invention, Jul. 17, 2014 US 2014/0198848 A1 all of a plurality of predetermined transform matrices are direction on a residual value (i.e., prediction error block) applied to a residual prediction block generated through inter prediction or intra prediction, according to the size of the generated after intra prediction is performed in case the intra prediction mode is the vertical mode (or 0) on the 4x4 block With respect to the luma signal. Alternatively, the inverse transforrning unit 305 may perform DCT along the horizontal block to be transformed upon transform, and then, a trans form matrix having the best encoding ef?ciency is applied to transform the residual prediction block, thus enhancing encoding ef?ciency. [0135] FIG. 3 is a block diagram illustrating the con?gura tion of a decoding apparatus according to an embodiment of the present invention. FIG. 3 illustrates a decoding apparatus direction on a residual value (i.e., prediction error block) generated after intra prediction is performed in case the intra prediction mode is the vertical mode (or 0) on the 4x4 block With respect to the luma signal. [0144] Alternatively, the inverse-transforming unit 305 that decodes an image encoded by the encoding apparatus may perform DCT along the vertical direction on a residual shown in FIG. 1. value (i.e., prediction error block) generated after intra pre [0136] according to an embodiment of the present invention includes diction is performed in case the intra prediction mode is the horizontal mode (or 1) on the 4x4 block With respect to the an entropy decoding unit 301, an inverse-quantizing unit 303, an inverse-transforming unit 305, a motion compensating may perform DST along the horizontal direction on a residual Referring to FIG. 3, the decoding apparatus 300 unit 307, an intra predicting unit 309, a buffer 311, and a third adder 313. [0137] The entropy decoding unit 301 entropy-decodes the luma signal. Alternatively, the inverse-transforming unit 305 value (i.e., prediction error block) generated after intra pre diction is performed in case the intra prediction mode is the horizontal mode (or 1) on the 4x4 block With respect to the bit stream provided from the encoding apparatus and extracts the quantized residual prediction block, motion vector used for inter prediction, the prediction mode information used for intra prediction, and transform matrix used for transform. luma signal. [0145] Alternatively, the inverse-transforming unit 305 may perform DST (Discrete Sine Transform) and/or DCT [0138] The inverse-quantizing unit 303 inverse-quantizes the quantized residual prediction block provided from the entropy decoding unit 301, and the inverse-transforming unit vertical direction depending on 35 intra prediction modes on (Discrete Cosine Transform) along the horizontal direction or a residual value (i.e., prediction error block) generated after 305 inverse-transforms the data provided from the inverse intra prediction is performed on an 8x8 block With respect to a luma signal. quantizing unit 303. Here, the inverse-transforming unit 305 restores the residual prediction block by performing inverse [0146] For example, the inverse-transforming unit 305 may perform a DST (Discrete Sine Transform) along the vertical transforrn based on the transform matrix information pro direction on a residual value (i.e., prediction error block) vided from the entropy decoding unit 301. generated after intra prediction is performed in case the intra prediction mode is the vertical mode (or 0) on the 8x8 block With respect to the luma signal. Alternatively, the inverse transforrning unit 305 may perform DCT along the horizontal [0139] In the mode-dependent transform method according to an embodiment of the present invention, the inverse-trans forming unit 305 may perform DST (Discrete Sine Trans form) and/ or DCT (Discrete Cosine Transform) along the horizontal direction or vertical direction depending on an intra prediction mode on a residual value (i.e., prediction error block) generated after intra prediction is performed on a block having a predetermined sizeifor example, 4><4 block direction on a residual value (i.e., prediction error block) generated after intra prediction is performed in case the intra prediction mode is the vertical mode (or 0) on the 8x8 block With respect to the luma signal. [0147] Alternatively, the inverse-transforming unit 305 or 8x8 blockiWith respect to a luma signal. may perform DCT along the vertical direction on a residual [0140] value (i.e., prediction error block) in case the intra prediction mode is the horizontal mode (or 1) on the 8x8 block With respect to the luma signal. Alternatively, the inverse-trans forming unit 305 may perform DST along the horizontal That is, in the mode-dependent transform method according to an embodiment of the present invention, the inverse-transforming unit 305 may perform DST (Discrete Sine Transform) and/ or DCT (Discrete Cosine Transform) on a block having a predetermined sizeifor example, 4><4 block or 8x8 blockiWhose prediction mode is an intra prediction mode With respect to a luma signal. [0141] In case the prediction unit has a size of 4x4 pixels, one of a total of 18 prediction directions may be determined, and in case the prediction unit has a size of 8x8 pixels, one of a total of 35 prediction directions may be used. The number of prediction directions depending on the size of the prediction unit is not limited thereto, and as the size of the prediction unit increases, the number of prediction directions may vary con sidering the spatial redundancy of an image. [0142] Accordingly, the inverse-transforming unit 305 may perform DST (Discrete Sine Transform) and/or DCT (Dis crete Cosine Transform) along the horizontal direction or vertical direction depending on 18 intra prediction modes on a residual value (i.e., prediction error block) generated after direction on a residual value (i.e., prediction error block) generated after intra prediction is performed in case the intra prediction mode is the horizontal mode (or 1) on the 8x8 block With respect to the luma signal. [0148] Alternatively, the inverse-transforming unit 305 may perform one of the DST (Discrete Sine Transform) and the DCT (Discrete Cosine Transform) only on a 4x4 block Whose prediction mode is an intra prediction mode With respect to the luma signal. [0149] As described above, in case the inverse-transform ing unit 305 performs transform only on a 4x4 block With respect to the luma signal, a memory for storing only one additional DST matrix (or DCT matrix) With respect to the 4x4 block is required as compared With When inverse-trans form is performed on both a 4x4 block and an 8x8 block, thus reducing complexity. intra prediction is performed on a 4x4 block With respect to a [0150] luma signal. signal, the same may also apply to the chroma signal, and an example thereof Will be described below. The inverse-trans [0143] For example, the inverse-transforming unit 305 may perform DST (Discrete Sine Transform) along the vertical Although the description has focused on the luma forming unit 305 may perform DST (Discrete Sine Trans Jul. 17, 2014 US 2014/0198848 A1 form) and/ or DCT (Discrete Cosine Transform) along the 305 may perform DST along the horizontal direction on a horizontal direction or vertical direction depending on an residual value (i.e., prediction error block) generated after intra prediction is performed in case the intra prediction mode intra prediction mode on a residual value (i.e., prediction error block) generated after intra prediction is performed on a block having a predetermined sizeifor example, 4><4 block or 8x8 blockiWith respect to a chroma signal. [0151] That is, the inverse-transforming unit 305 may per form DST (Discrete Sine Transform) and/or DCT (Discrete Cosine Transform) on a block having a predetermined sizei for example, 4><4 block or 8x8 blockiWhose prediction mode is an intra prediction mode With respect to a chroma signal. is the horizontal mode (or 1) on the 8x8 block With respect to the chroma signal. [0158] Alternatively, the inverse-transforming unit 305 may perform one of the DST (Discrete Sine Transform) and the DCT (Discrete Cosine Transform) only on a 4x4 block Whose prediction mode is an intra prediction mode With respect to the chroma signal. [0159] In case the inverse-transforming unit 305 performs transform only on a 4x4 block With respect to the chroma [0152] Accordingly, the inverse-transforming unit 305 may perform DST (Discrete Sine Transform) and/or DCT (Dis signal, a memory for storing only one additional DST matrix crete Cosine Transform) along the horizontal direction or vertical direction depending on 18 intra prediction modes on a residual value (i.e., prediction error block) generated after as compared With When transform is performed on both a 4x4 intra prediction is performed on a 4x4 block With respect to a chroma signal. [0153] For example, the inverse-transforming unit 305 may perform DST (Discrete Sine Transform) along the vertical direction on a residual value (i.e., prediction error block) in case the intra prediction mode is the vertical mode (or 0) on the 4x4 block With respect to the chroma signal. Alternatively, the inverse-transforming unit 305 may perform DCT along the horizontal direction on a residual value (i.e., prediction error block) generated after intra prediction is performed in case the intra prediction mode is the vertical mode (or 0) on the 4x4 block With respect to the chroma signal. [0154] Alternatively, the inverse-transforming unit 305 may perform DCT along the vertical direction on a residual value (i.e., prediction error block) generated after intra pre diction is performed in case the intra prediction mode is the horizontal mode (or 1) on the 4x4 block With respect to the chroma signal. Alternatively, the inverse-transforming unit 305 may perform DST along the horizontal direction on a residual value (i.e., prediction error block) generated after intra prediction is performed in case the intra prediction mode is the horizontal mode (or 1) on the 4x4 block With respect to the chroma signal. [0155] Alternatively, the inverse-transforming unit 305 may perform DST (Discrete Sine Transform) and/or DCT (Discrete Cosine Transform) along the horizontal direction or vertical direction depending on 35 intra prediction modes on a residual value (i.e., prediction error block) generated after intra prediction is performed on an 8x8 block With respect to a chroma signal. [0156] For example, the inverse-transforming unit 305 may perform DST (Discrete Sine Transform) along the vertical direction on a residual value (i.e., prediction error block) generated after intra prediction is performed in case the intra prediction mode is the vertical mode (or 0) on the 8x8 block With respect to the chroma signal. Alternatively, the inverse transforrning unit 305 may perform DCT along the horizontal direction on a residual value (i.e., prediction error block) generated after intra prediction is performed in case the intra prediction mode is the vertical mode (or 0) on the 8x8 block With respect to the chroma signal. (or DCT matrix) With respect to the 4x4 block size is required block and an 8x8 block, thus reducing complexity. [0160] The motion compensating unit 307 generates a pre diction block by applying the motion vector provided from the entropy decoding unit 301 to the reference block of the reference picture stored in the buffer 311. [0161] The intra predicting unit 309 generates a prediction value of a current block from pixels adjacent to the block to be currently subject to decoding based on the intra prediction mode provided from the entropy decoding unit 301. Here, the intra predicting unit 309 may separate the block that is cur rently subject to decoding into blocks having a size of 4x4, 8x8, 16x16, 32x32, or 64x64 pixels and may generate a prediction block from pixels adjacent to each separated block using the intra prediction mode information. [0162] In the decoding apparatus 300 according to an embodiment of the present invention, only one of a prediction block generated through the motion compensating unit 307 and a prediction block generated through the intra predicting unit 309 may be generated based on the selection information extracted by the entropy decoding unit 301, and only one of the motion compensating unit 307 and the intra predicting unit 309 may be connected With the third adder 313 through path sWitching. That is, the decoding apparatus 300 may perform only one of the inter prediction and intra prediction corresponding to the encoding mode that has been ful?lled in the encoding apparatus. [0163] The buffer 311 stores the restored image so that the restored image may be used as a reference picture. [0164] The third adder 313 adds the prediction block pro vided from the motion compensating unit 307 or the intra predicting unit 309 and the residual prediction block provided from the inverse-transforming unit 305, thus restoring the original block. [0165] FIG. 4 is a ?owchart illustrating an image decoding method according to an embodiment of the present invention. [0166] Referring to FIG. 4, When receiving an encoded bit stream from the encoding apparatus (step 401), the decoding apparatus extracts the quantized residual prediction block, motion vector, transform matrix, and intra prediction mode information by performing entropy-decoding on the bit stream (step 403). Here, the intra prediction mode may be extracted only When the encoding apparatus has performed may perform DCT along the vertical direction on a residual intra prediction, and the entropy-decoded data may include encoding mode information (inter prediction or intra predic value (i.e., prediction error block) generated after intra pre tion). [0157] Alternatively, the inverse-transforming unit 305 diction is performed in case the intra prediction mode is the horizontal mode (or 1) on the 8x8 block With respect to the chroma signal. Alternatively, the inverse-transforming unit [0167] Thereafter, the decoding apparatus inverse-quan tizes the entropy-decoded residual value (step 405) and inverse-transforms the inverse-quantized data using the Jul. 17, 2014 US 2014/0198848 A1 extracted transform matrix information, thereby restoring the residual prediction block (step 407). diction is performed in case the intra prediction mode is the vertical mode (or 0) on the 8x8 block With respect to the luma [0168] The inverse-transform may perform DST (Discrete Sine Transform) and/or DCT (Discrete Cosine Transform) signal. along the horizontal direction or vertical direction depending DCT along the vertical direction on a residual value (i.e., on an intra prediction mode on a residual value (i.e., predic prediction error block) generated after intra prediction is per tion error block) generated after intra prediction is performed formed in case the intra prediction mode is the horizontal mode (or 1) on the 8x8 block With respect to the luma signal. on a block having a predetermined sizeifor example, 4><4 block and/or 8x8 blockiWith respect to a luma signal. [0176] Alternatively, the inverse-transform may perform Alternatively, the inverse-transform may perform DST along [0169] That is, the inverse-transform may perform DST (Discrete Sine Transform) and/or DCT (Discrete Cosine the horizontal direction on a residual value (i.e., prediction Transform) on a block having a predetermined sizeifor case the intra prediction mode is the horizontal mode (or 1) on the 8x8 block With respect to the luma signal. [0177] The inverse-transform may use a DST (Discrete Sine Transform) transform matrix only on a 4x4 block Whose prediction mode is an intra prediction mode With respect to the luma signal. As such, in case the inverse-transform is performed only on a 4x4 block Whose prediction mode is the intra prediction mode With respect to the luma signal, a memory for storing only one additional DST matrix (or DCT matrix) With respect to the 4x4 block size is required as compared With When inverse-transform is performed on both a 4x4 block and an 8x8 block, thus reducing complexity. [0178] Although the description has focused on the luma signal, the same may also apply to the chroma signal, as the example, 4><4 block and/or 8x8 blockiWhose prediction mode is an intra prediction mode With respect to the luma signal. [0170] In case the prediction unit has a size of 4x4 pixels, one of a total of 18 prediction directions may be determined, and in case the prediction unit has a size of 8x8 pixels, one of a total of 35 prediction directions may be used. The number of prediction directions depending on the size of the prediction unit is not limited thereto, and as the size of the prediction unit increases, the number of prediction directions may vary con sidering the spatial redundancy of an image. [0171] Accordingly, the inverse-transform may perform DST (Discrete Sine Transform) and/or DCT (Discrete Cosine error block) generated after intra prediction is performed in depending on 18 intra prediction modes on a residual value (i.e., prediction error block) on a 4x4 block With respect to a speci?c description follows below. The inverse-transform may perform DST (Discrete Sine Transform) and/or DCT (Discrete Cosine Transform) along the horizontal direction or luma signal. vertical direction depending on an intra prediction mode on a [0172] For example, the inverse-transform may perform DST (Discrete Sine Transform) along the vertical direction residual value (i.e., prediction error block) generated after Transform) along the horizontal direction or vertical direction on a residual value (i.e., prediction error block) generated after intra prediction is performed in case the intra prediction mode is the vertical mode (or 0) on the 4x4 block With respect to the luma signal. Alternatively, the inverse-transform may perform DCT along the horizontal direction on a residual intra prediction is performed on a block having a predeter mined sizeifor example, 4><4 block and/or 8x8 blockiWith respect to a chroma signal. [0179] That is, the inverse-transform may perform DST (Discrete Sine Transform) and/or DCT (Discrete Cosine Transform) on a block having a predetermined sizeifor value (i.e., prediction error block) generated after intra pre example, 4><4 block and/or 8x8 blockiWhose prediction diction is performed in case the intra prediction mode is the vertical mode (or 0) on the 4x4 block With respect to the luma mode is an intra prediction mode With respect to the chroma signal. [0180] The inverse-transform may perform DST (Discrete Sine Transform) and/or DCT (Discrete Cosine Transform) [0173] Alternatively, the inverse-transform may perform DCT along the vertical direction on a residual value (i.e., prediction error block) generated after intra prediction is per signal. along the horizontal direction or vertical direction depending on 18 intra prediction modes on a residual value (i.e., predic formed in case the intra prediction mode is the horizontal mode (or 1) on the 4x4 block With respect to the luma signal. tion error block) generated after intra prediction is performed Alternatively, the inverse-transform may perform DST along [0181] For example, the inverse-transform may perform DST (Discrete Sine Transform) along the vertical direction the horizontal direction on a residual value (i.e., prediction error block) generated after intra prediction is performed in case the intra prediction mode is the horizontal mode (or 1) on the 4x4 block With respect to the luma signal. [0174] Further, the inverse-transform may perform DST (Discrete Sine Transform) and/or DCT (Discrete Cosine on a 4x4 block With respect to a chroma signal. on a residual value (i.e., prediction error block) generated after intra prediction is performed in case the intra prediction mode is the vertical mode (or 0) on the 4x4 block With respect to the chroma signal. Alternatively, the inverse-transform may perform DCT along the horizontal direction on a residual Transform) along the horizontal direction or vertical direction value (i.e., prediction error block) generated after intra pre depending on 35 intra prediction modes on a residual value diction is performed in case the intra prediction mode is the vertical mode (or 0) on the 4x4 block With respect to the (i.e., prediction error block) generated after intra prediction is performed on the 8x8 block With respect to the luma signal. [0175] For example, the inverse-transform may perform DST (Discrete Sine Transform) along the vertical direction chroma signal. [0182] Alternatively, the inverse-transform may perform DCT along the vertical direction on a residual value (i.e., prediction error block) generated after intra prediction is per on a residual value (i.e., prediction error block) generated after intra prediction is performed in case the intra prediction mode is the vertical mode (or 0) on the 8x8 block With respect to the luma signal. Alternatively, the inverse-transform may perform DCT along the horizontal direction on a residual horizontal direction on a residual value (i.e., prediction error value (i.e., prediction error block) generated after intra pre block) generated after intra prediction is performed in case formed in case the intra prediction mode is the horizontal mode (or 1) on the 4x4 block With respect to the chroma signal. Or the inverse-transform may perform DST along the Jul. 17, 2014 US 2014/0198848 Al the intra prediction mode is the horizontal mode (or 1) on the 4x4 block With respect to the chroma signal. [0183] Alternatively, the inverse-transform may perform DST (Discrete Sine Transform) and/or DCT (Discrete Cosine Transform) along the horizontal direction or vertical direction Description of elements 100: encoding apparatus 103: motion predicting unit 107: intra predicting unit 101: 105: 109: 113: 117: encoding controller motion compensating unit ?rst adder quantizing unit inverse—transforming unit depending on 35 intra prediction modes on a residual value 111: transforming unit 1 15: inverse—quantizing unit (i.e., prediction error block) generated after intra prediction is 119: second adder 121: buffer performed on an 8x8 block With respect to a chroma signal. 125: entropy encoding unit 301: entropy decoding unit 305: inverse—transforming unit 300: decoding apparatus 303: inverse—quantizing unit 307: motion compensating unit 309: intra predicting unit 311: buffer [0184] For example, the inverse-transform may perform DST (Discrete Sine Transform) along the vertical direction on a residual value (i.e., prediction error block) generated after intra prediction is performed in case the intra prediction mode is the vertical mode (or 0) on the 8x8 block With respect to the chroma signal. Alternatively, the inverse-transform may perform DCT along the horizontal direction on a residual value (i.e., prediction error block) generated after intra pre diction is performed in case the intra prediction mode is the vertical mode (or 0) on the 8x8 block With respect to the chroma signal. [0185] Alternatively, the inverse-transform may perform DCT along the vertical direction on a residual value (i.e., prediction error block) generated after intra prediction is per formed in case the intra prediction mode is the horizontal mode (or 1) on the 8x8 block With respect to the chroma signal. Alternatively, the inverse-transform may perform DST along the horizontal direction on a residual value (i.e., prediction error block) generated after intra prediction is per 313: third adder 1. An image encoding method comprising: receiving a coding unit to be encoded; generating a prediction block by performing one of inter prediction and intra prediction on the coding unit; generating a residual prediction block based on the gener ated prediction block and the coding unit; and transforming the generated residual prediction block by applying a plurality of predetermined transform matri ces to the residual prediction block. 2. The image encoding method of claim 1, Wherein trans forming the generated residual prediction block by applying a plurality of predetermined transform matrices to the residual prediction block comprises transforming the residual prediction block by applying all of nine transform matrices to formed in case the intra prediction mode is the horizontal mode (or 1) on the 8x8 block With respect to the chroma each residual prediction block and then using a transform matrix having the best encoding ef?ciency in a case Where the residual prediction block that is subjected to intra prediction signal. and transform has a size of 4x4 or 8x8 pixels. [0186] The inverse-transform may use a DST (Discrete Sine Transform) and/or DCT transform matrix only on a 4x4 block Who se prediction mode is an intra prediction mode With forming the generated residual prediction block by applying respect to the chroma signal. [0187] As such, in case the inverse-transform is performed only on a 4x4 block Whose prediction mode is an intra pre diction mode With respect to the chroma signal, a memory for storing only one additional DST matrix (or DCT matrix) With respect to the 4x4 block size is required as compared With When the inverse-transform is performed on both a 4x4 block and an 8x8 block, thus reducing complexity. [0188] Further, the decoding apparatus determines a decod ing mode based on the encoding mode included in the entropy-decoded information (step 409), and in case the decoding mode is determined as motion compensation, per forms motion compensation using the extracted motion vec 3. The image encoding method of claim 1, Wherein trans a plurality of predetermined transform matrices to the residual prediction block comprises transforming the residual prediction block by applying all of four transform matrices to each residual prediction block and then using a transform matrix having the best encoding ef?ciency in a case Where the residual prediction block that is subjected to intra prediction and transform has a size of 16x16 pixels. 4. The image encoding method of claim 1, Wherein trans forming the generated residual prediction block by applying a plurality of predetermined transform matrices to the residual prediction block comprises performing transform using the plurality of predetermined transform matrices along a speci?c direction of intra prediction. 5. The image encoding method of claim 1, Wherein trans forming the generated residual prediction block by applying tor, thereby generating a prediction block (step 411). a plurality of predetermined transform matrices to the [0189] Alternatively, in case the decoding mode is deter mined as intra prediction, the decoding apparatus generates a residual prediction block comprises performing transform using the plurality of predetermined transform matrices along prediction block by applying an extracted intra prediction mode to pixels adjacent to the current block to be decoded (step 413). [0190] Thereafter, the decoding apparatus restores an origi nal blockithat is, the coding unitiby adding the restored residual prediction block With the prediction block generated a horizontal direction upon transform When intra prediction is performed based on a horizontal direction mode among nine intra prediction modes in a case Where the residual prediction block has a size of 4x4 pixels. 6. The image encoding method of claim 1, Wherein the residual prediction block used for transform is implemented as a transform unit (TU), and Wherein the transform unit has in step 411 or 413 (step 415). [0191] Although embodiments of the present invention have been described, it may be understood by those skilled in prediction unit is an extended macro block having a size of the art that various modi?cations and variations may be made 32x32 pixels or more. thereto Without departing from the spirit and scope of the 8. An image decoding method of decoding an encoded bit stream by applying one of a plurality of predetermined trans invention de?ned in the claims. a recursive tree structure. 7. The image encoding method of claim 1, Wherein the Jul. 17, 2014 US 2014/0198848 A1 14 form matrices to a residual value generated after intra predic tion is performed, the method comprising: extracting at least one information of a motion vector, a quantized residual prediction block, a motion vector, an intra prediction mode, and a transform matrix by entropy-decoding the bit stream; inverse-quantizing the quantized residual prediction block; restoring the residual prediction block by inverse-trans forming the inverse-quantized residual prediction block by applying the transform matrix to the inverse-quan tized residual prediction block; transform matrix to the inverse-quantized residual prediction block comprises performing inverse-transform using the transform matrix along a horizontal direction upon transform When intra prediction is performed based on a horizontal direction mode among nine intra prediction modes in a case Where the residual prediction block has a size of 4x4 pixels. 13. The image decoding method of claim 8, Wherein the residual prediction block used for transform is implemented as a transform unit (TU), and the transform unit has a recur sive tree structure. 14. The image decoding method of claim 8, Wherein the generating a prediction block by performing one of motion coding unit is an extended macro block having a size of 32x32 compensation and intra prediction; and restoring an original coding unit by adding the restored residual prediction block and the generated prediction pixels or more. block. 15. The image decoding method of claim 8, Wherein the transform matrix uses at least one transform matrix of DST (Discrete Sine Transform) and DCT (Discrete Cosine Trans 9. The image decoding method of claim 8, Wherein the form) on a 4x4 block Whose prediction mode is an intra transform matrix applies all of nine transform matrices to prediction mode With respect to a luma signal. 16. The image decoding method of claim 8, Wherein the each residual prediction block and uses a transform matrix having the best encoding ef?ciency in a case Where the residual prediction block that is subjected to the intra predic tion and transform has a size of 4x4 or 8x8 pixels. 10. The image decoding method of claim 8, Wherein the transform matrix applies all of four transform matrices to each residual prediction block and uses a transform matrix having the best encoding ef?ciency in a case Where the residual prediction block that is subjected to the intra predic tion and transform has a size of 16x16 pixels. 11. The image decoding method of claim 8, Wherein restor ing the residual prediction block by inverse-transforming the inverse-quantized residual prediction block by applying the transform matrix to the inverse-quantized residual prediction block comprises performing inverse-transform using the transform matrix based on the intra prediction mode. 12. The image decoding method of claim 8, Wherein restor ing the residual prediction block by inverse-transforming the inverse-quantized residual prediction block by applying the transform matrix uses a DST (Discrete Sine Transform) trans form matrix on a 4x4 block Whose prediction mode is an intra prediction mode With respect to a luma signal. 17. The image decoding method of claim 8, Wherein the transform matrix uses at least transform matrix of DST (Dis crete Sine Transform) and DCT (Discrete Cosine Transform) on a 4x4 block Whose prediction mode is an intra prediction mode With respect to a chroma signal. 18. The image decoding method of claim 8, Wherein the transform matrix uses a DST (Discrete Sine Transform) trans form matrix on a 4x4 block Whose prediction mode is an intra prediction mode With respect to a chroma signal. 19. The image decoding method of claim 8, Wherein the transform matrix uses a DST (Discrete Sine Transform) trans form matrix only on a 4x4 block Whose prediction mode is an intra prediction mode With respect to a luma signal. * * * * *