METHODS AND EQUIPMENT FOR VIDEO SIGNAL PROCESSING
Patent Information
- Authority / Receiving Office
- ID · ID
- Patent Type
- Patents
- Current Assignee / Owner
- KT CORP
- Filing Date
- 2019-05-23
- Publication Date
- 2026-07-16
AI Technical Summary
The increasing demand for high-resolution and high-quality images leads to higher data volumes, resulting in increased transmission and storage costs, and existing video compression techniques are inadequate for efficiently encoding and decoding stereographic image content.
The method involves deriving joint candidates from adjacent blocks to create combined candidate lists for motion compensation during video encoding and decoding, using index prefixes and suffixes to optimize inter-prediction efficiency, and incorporating non-adjacent blocks for improved encoding/decoding processes.
This approach enhances inter-prediction efficiency and enables effective encoding/decoding of high-resolution video signals, reducing data transmission and storage costs while maintaining image quality.
Smart Images

Figure 0_ABST
Abstract
Description
Description METHODS AND EQUIPMENT FOR VIDEO SIGNAL PROCESSING Invention Engineering Field The present invention relates to methods and apparatus for video signal processing. Background of the Invention Recently, the demand for high-resolution and high-quality images such as high-definition (HD) and ultra-high-definition (UHD) images has increased in various application fields. However, higher resolution and quality image data require an increased amount of data compared to conventional image data. Therefore, when transmitting image data using media such as conventional broadband wired and wireless networks, or when storing image data using conventional storage media, transmission and storage costs increase. To solve the problems that arise with the increase in resolution and quality of image data, high-efficiency image encoding / decoding techniques can be utilized. Image compression technology includes various techniques, including: inter-prediction techniques that predict the pixel values included in the current image from the previous or subsequent images of the current image; intra-prediction techniques that predict the pixel values included in the current image by using the pixel information in the current image; entropy encoding techniques that assign short codes to values with high appearance frequency and assign long codes to values with low appearance frequency; etc. Image data can be effectively compressed by using such image compression technologies, and can be transmitted or stored. Meanwhile, with the demand for high-resolution imagery, the demand for stereographic image content, a new image service, has also increased. Video compression techniques to effectively provide high-resolution and ultra-high-resolution stereographic image content are being discussed. The present invention provides a method and apparatus for effectively performing inter-prediction on encoder / decoder target blocks when encoding / decoding a video signal. The present invention provides a method and apparatus for performing motion compensation by using a plurality of combined candidate lists when encoding / decoding a video signal. The present invention provides a method and apparatus for effectively encoding / decoding a combined index when encoding / decoding a video signal. The technical problems that can be obtained from this invention are not limited to the technical tasks mentioned above, and other technical tasks not mentioned can be clearly understood from the following description by those having general expertise in the technical field related to this invention. Brief Description of the Invention A video signal decoding method and apparatus according to the present invention can derive joint candidates from adjacent blocks close to the current block, generate a first joint candidate list including joint candidates, decode information for the specification of one of the joint candidates included in the first joint candidate list and derive the current block motion information from the joint candidate for which an index determined by the information is given. In this case, when a number of joint candidates included in the first joint candidate list is smaller than a predetermined value, the joint candidates included in the second joint candidate list can be added to the first joint candidate list. A video signal encoding method and apparatus according to the present invention can derive joint candidates from adjacent blocks close to the current block, generate a first joint candidate list including joint candidates, encode information for the specification of one of the joint candidates included in the first joint candidate list and derive motion information of the current block from the joint candidate for which an index determined by the information is provided. In this case, when a number of joint candidates included in the first joint candidate list is smaller than a predetermined value, joint candidates included in the second joint candidate list can be added to the first joint candidate list. For video signals encoding / decoding methods and apparatus according to the present invention, the information may include an index prefix and an index suffix. For the video signal encoding / decoding method and apparatus according to the present invention, when the value of the index prefix is smaller than the threshold value, the index can be set to be the same as the index prefix. For a video signal of the encoding / decoding method and apparatus according to the present invention, when the value of the index prefix is greater than the threshold value, the index can be derived by adding the index suffix value to the derived value based on the index prefix. For a video signal encoding / decoding method and apparatus according to the present invention, a threshold value may be determined based on the number of combined candidates included in the first combined candidate list. For video signals of the encoding / decoding method and apparatus according to the present invention, the second combined candidate list may include combined candidates derived from blocks that are not adjacent to the current block. For video signals of the encoding / decoding method and apparatus according to the present invention, non-adjacent blocks may be on the same line as blocks adjacent to the current block. It will be understood that the features summarized hereinafter are exemplary aspects of the following complete description of the present invention without limiting the scope of the present invention. In accordance with the present invention, the inter-prediction efficiency can be improved by performing motion compensation using a plurality of combined candidate lists. In accordance with the present invention, the inter-prediction efficiency can be improved by obtaining motion information based on a plurality of combined candidates. In accordance with the present invention, an effective combined index encoding / decoding method can be provided. The effects that can be obtained from the present invention may not be limited to the effects mentioned above, and other effects not mentioned can be clearly understood from the following description by those of general skill in the technical field to which the present invention relates. Short Description of Image FIGURE 1 is a block diagram illustrating a means for encoding video in accordance with an embodiment of the present invention. FIGURE 2 is a block diagram illustrating a video decoding apparatus in accordance with an embodiment of the present invention. FIGURE 3 is a diagram illustrating the candidate partition modes that can be applied to the encoding block when the encoding block is encoded by inter-prediction. FIGURE 4 shows an example of hierarchically partitioning coding blocks based on a tree structure as an embodiment to which the present invention applies. FIGURE 5 is a diagram showing a partitioning form where binary tree-based partitioning is left as an embodiment to which the present invention applies. FIGURE 6 shows the form of a triple tree partition. FIGURE 7 is a diagram showing an example where only a specific form of binary tree-based partitioning is possible. FIGURE 8 is a diagram to illustrate an example where information relating to a number of times that allows for partitioning a binary tree is encoded / decoded in accordance with an embodiment to which the present invention applies. FIGURE 9 is a flowchart illustrating the inter-prediction method as an embodiment to which the present invention applies. FIGURE 10 is a diagram illustrating the procedure for deriving the current block motion information when the merge mode is applied to the current block. FIGURE 11 is a diagram showing an example of spatially contiguous blocks. FIGURE 12 is a diagram showing an example of deriving the motion vector from a temporally coupled candidate. FIGURE 13 is a diagram showing the positions of candidate blocks that are likely to be used as co-located blocks. FIGURE 14 is a diagram showing the process of deriving the current block movement information when AMVP mode is applied to the current block. FIGURE 15 is a diagram illustrating an example of deriving a merge candidate from a second merge candidate block when the first merge candidate block is not available. FIGURE 16 is a diagram illustrating an example of deriving a merge candidate from a second merge candidate block positioned on the same row as the first merge candidate block. FIGURES 17 through 20 are diagrams illustrating the search sequence for a combined candidate block. FIGURE 21 is a diagram illustrating an example where the candidate union of non-square blocks is derived based on the square blocks. FIGURE 22 is a diagram illustrating an example of deriving merge candidates based on high-level node blocks. FIGURE 23 is a diagram illustrating an example of determining the availability of spatially contiguous blocks based on the combined estimated area. FIGURE 24 is a diagram illustrating an example where a combined candidate is derived based on the combined estimation region. Complete Description of the Invention Various modifications can be made to the present invention and there are various embodiments of the present invention, examples of which will now be provided with reference to the drawings and described in detail. However, the present invention is not limited thereto, and example embodiments may be stated as including all modifications, equivalents, or substitutes within the technical concept and technical scope of the present invention. Similar reference numbers refer to similar elements in the drawings described. The terms used in the specification, 'first', 'second', etc., may be used to describe various components, but components are not considered to be limited to those terms. They are used only to distinguish one component from another. For example, a 'first' component may be called a 'second' component without departing from the scope of the present invention, and a 'second' component may also similarly be called a 'first' component. The term 'and / or' includes any combination of any number of items or any one of any number of terms. In this discussion, when elements are referred to as connected or coupled to other elements, it is understood to include not only elements that are directly connected or coupled to other elements but also those where there may be other elements between them. When elements are referred to as directly connected or coupled to other elements, it is understood that there are no other elements between them. The terms used in this specification are used only to describe particular embodiments, and are not intended to limit the invention. An expression used in the singular includes an expression of the plural, unless the context clearly indicates a different meaning. In this specification, it will be understood that terms such as “including,” “having,” etc. are intended to indicate the presence of features, quantities, steps, actions, elements, parts, or combinations thereof disclosed in the specification, and are not intended to exclude the possibility that one or more other features, quantities, steps, actions, elements, parts, or combinations thereof may be present or may be added. Next, preferred embodiments of the present invention will be described in detail with reference to the accompanying drawings. Hereinafter, the same constituent elements in the drawings are designated by the same reference number, and repeated descriptions of the same elements will be omitted. FIGURE 1 is a block diagram illustrating a means for encoding video in accordance with an embodiment of the present invention. Referring to FIGURE 1, the apparatus (100) for encoding video may include: an image partition module (110), prediction modules (120 and 125), a transformation module (130), a quantization module (135), a reordering module (160), an entropy encoding module (165), an inverse quantization module (140), an inverse transformation module (145), a filter module (150), and a memory (155). The constitutional parts shown in FIG. 1 are shown freely to represent different characteristic functions from each other in a video encoding device. Thus, it does not mean that each constitutional part is arranged in a constitutional unit of separate hardware or software. In other words, each constitutional part includes each of the constitutional parts enumerated for convenience. Thus, at least two constitutional parts of each constitutional part can be combined to form one constitutional part or one constitutional part can be divided into a plurality of constitutional parts to perform their respective functions. Embodiments in which the respective constitutional parts are combined and embodiments in which one constitutional part is divided are also included within the scope of the present invention, if not separated from the essence of the present invention. Also, some constituents may not be indispensable constituents that perform the essential function of the invention but are selective constituents that only improve its performance. The present invention can be implemented with those that include only the constitutional parts that are indispensable for implementing the essence of the present invention except for the constituents used in improving performance. Structures that include only indispensable constituents except for selective constituents used in improving performance are also included in the scope of the present invention. The image partition module (110) may divide an input image into one or more processing units. Here, the processing units may be prediction units (PUs), transformation units (TUs), or coding units (CUs). The image partition module (110) may divide an image into a combination of multiple coding units, prediction units, and transformation units, and may encode the image by selecting one combination of coding units, prediction units, and transformation units with predetermined criteria (e.g., a cost function). For example, a single image can be partitioned into multiple coding units. A recursive tree structure, such as a quad tree, can be used to partition an image into coding units. A coding unit that is partitioned into other coding units by a single image or the largest coding unit such as the root can be partitioned with child nodes corresponding to the number of coding units it partitions into. A coding unit that is no longer partitioned by a predefined constraint acts as a leaf node. Thus, assuming that only a square partition is possible for a single coding unit, a single coding unit can be partitioned into at most four other coding units. Further, in embodiments of the present invention, a coding unit may mean a unit that performs encoding, or a unit that performs decoding. The prediction unit may be one of the partitions partitioned to have square or rectangular shapes having the same size within a single coding unit, or the prediction unit may be one of the partitions partitioned to have different shapes / sizes within a single coding unit. When the prediction unit subjected to intra-prediction is generated based on a coding unit and the coding unit is not the smallest coding unit, intra-prediction can be performed without partitioning the coding unit into multiple NxN prediction units. The prediction modules (120 and 125) may include an inter-prediction module (120) performing inter-prediction and an intra-prediction module (125) performing intra-prediction. Whether to perform inter-prediction or intra-prediction for a prediction unit may be specified, and detailed information (e.g., intra-prediction mode, motion vector, reference image, etc.) corresponding to each prediction method may be specified. Here, the processing unit imposed on the prediction may be different from the processing unit for which the prediction method and detailed content are specified. For example, the prediction method, prediction mode, etc. may be specified by the prediction unit, and the prediction may be performed by the transformation unit. The residual value (residual block) between the generated prediction block and the original block may be input to the transformation module (130).Also, the prediction mode information, motion vector information, etc. used for prediction can be encoded with residual values by the entropy encoding module (165) and can be transmitted to the device for decoding the video. When the special encoding mode is used, it is possible to transmit to the device for decoding the video by encoding the original block as is without generating the prediction block through the prediction module (120 and 125). The inter-prediction module (120) may predict prediction units based on information from at least one of a previous image or a subsequent image of the current image, or may predict prediction units based on information from multiple encoded regions of the current image, in some cases. The inter-prediction module (120) may include a reference image interpolation module, a motion prediction module, and a motion compensation module. The reference image interpolation module can receive reference image information from memory (155) and can generate pixel information from integer pixels or less than integer pixels of the reference image. In the case of luma pixels, 8-tap DCT-based interpolation filters having different filter coefficients can be used to generate pixel information from integer pixels or less than integer pixels in units of 1 / 4 pixel. In the case of chroma signals, 4-tap DCT-based interpolation filters having different filter coefficients can be used to generate pixel information from integer pixels or less than integer pixels in units of 1 / 8 pixel. The motion prediction module can perform motion prediction based on the reference image interpolated by the reference image interpolation module. As for the method for calculating the motion vector, various methods, such as the full search-based block matching algorithm (FBMA), three-stage search (TSS), new three-stage search algorithm (NTS), etc., can be used. The motion vector may have a motion vector value in units of 1 / 2 pixel or 1 / 4 pixel based on the interpolated pixels. The motion prediction module can predict the current prediction unit by changing the motion prediction method. As for the motion prediction method, various methods, such as the long method, the combined method, the AMVP method (Advanced Motion Vector Prediction), the intra-block copy method, etc., can be used. The intra-prediction module (125) may generate a prediction unit based on the information of a reference pixel adjacent to the current block which is the information of a pixel in the current image. When the adjacent block of the current prediction unit is a block subjected to inter-prediction and thus the reference pixel is a pixel subjected to inter-prediction, the reference pixel included in the block subjected to inter-prediction may be replaced with the reference pixel information of the adjacent block subjected to intra-prediction. Thus, when a reference pixel is not available, at least one reference pixel of the available reference pixels may be used instead of the unavailable reference pixel information. The prediction modes in intra-prediction may include a directional prediction mode that uses reference pixel information that relies on directional prediction and a nondirectional prediction mode that does not use directional information in making predictions. The mode for predicting luma information may be different from the mode for predicting chroma information, and to predict chroma information, the intra-prediction mode information is used to predict luma information or the predicted luma signal information may be utilized. In performing intra-prediction, when the size of the prediction unit is the same as the size of the transformation unit, intra-prediction can be performed on the prediction unit based on the pixels positioned on the left, top left, and top of the prediction unit. However, in performing intra-prediction, when the size of the prediction unit is different from the size of the transformation unit, intra-prediction can be performed using reference pixels based on the transformation unit. Also, intra-prediction using NxN partitioning can be used for only the smallest coding unit. In the intra-prediction method, a prediction block can be generated after applying an AIS (Adaptive Intra-Smoothing) filter to the reference pixel depending on the prediction mode. The type of AIS filter applied to the reference pixel can vary. To perform the intra-prediction method, the intra-prediction mode of the current prediction unit can be predicted from the intra-prediction mode of the prediction unit adjacent to the current prediction unit. In prediction with the prediction mode of the current prediction unit using the predicted mode information of the adjacent prediction unit, when the intra-prediction mode of the current prediction unit is the same as the intra-prediction mode of the adjacent prediction unit, information indicating that the prediction modes of the current prediction unit and the adjacent prediction unit are the same as each other can be transmitted using pre-determined flag information.When the prediction mode of the current prediction unit is different from the prediction mode of the adjacent prediction unit, entropy encoding can be performed to encode the prediction mode information of the current block. Also, a residual block including information on the different residual values between the prediction units subjected to prediction and the original block of prediction units may be generated based on the prediction units generated by the prediction modules (120 and 125). The resulting residual block may be fed to the transformation module (130). The transformation module (130) can transform a residual block including information on residual values between the original block and the prediction unit generated by the prediction module (120 and 125) by using a transformation method, such as a clear cosine transform (DCT), a clear sine transform (DST), and a KLT. Whether to apply a DCT, a DST, or a KLT to transform the residual block can be determined based on the intra-prediction mode information of the prediction unit used to generate the residual block. The quantization module (135) can calculate values that are transformed into the frequency domain by the transformation module (130). The quantization coefficients can vary depending on the block or the importance of the image. The values calculated by the quantization module (135) can be provided to the inverse quantization module (140) and the rearrangement module (160). The rearrangement module (160) may rearrange the quantized residual value coefficients. The rearrangement module (160) can convert coefficients in two-dimensional block form to coefficients in one-dimensional vector form through a coefficient scanning method. For example, the rearrangement module (160) can scan from DC coefficients to coefficients in the high frequency domain using a zigzag scanning method to convert the coefficients into one-dimensional vector form. Depending on the size of the transformation unit and the intra-prediction mode, a vertical direction scan in which the coefficients in two-dimensional block form are scanned in the column direction or a horizontal direction scan in which the coefficients in two-dimensional block form are scanned in the row direction can be used instead of the zigzag scan. Therefore, which scanning method among the zigzag scan, vertical direction scan, and horizontal direction scan is used can be determined depending on the size of the transformation unit and the intra-prediction mode. The entropy encoding module (165) may perform entropy encoding based on the values calculated by the reordering module (160). The entropy encoding may use various encoding methods, for example, an exponential Golomb encoder, a context-adaptive variable length encoder (CAVLC), and a context-adaptive binary arithmetic encoder (CABAC). The entropy coding module (165) can encode various information, such as the residual value of the information coefficient and the block type information of the coding unit, the prediction mode information, the partition unit information, the prediction unit information, the transformation unit information, the motion vector information, the reference frame information, the block interpolation information, the filtering information, etc. from the reordering module (160) and the prediction modules (120 and 125). The entropy encoding module (165) may encode the entropy of the input coefficients of the coding unit of the rearrangement module (160). The inverse quantization module (140) can inversely quantize the values quantized by the quantization module (135) and the inverse transformation module (145) can inversely transform the values transformed by the transformation module (130). The residual values generated by the inverse quantization module (140) and the inverse transformation module (145) can be combined with the prediction units predicted by the motion estimation module, the motion compensation module, and the intra-prediction modules of the prediction modules (120 and 125) such that a reconstructed block can be generated. The filter module (150) may include at least one of a deblocking filter, an offset correction unit, and an adaptive loop filter (ALF). A deblocking filter can eliminate block distortion caused by boundaries between blocks in the reconstructed image. To determine whether to perform deblocking, pixels belonging to multiple rows or columns within a block can be the basis for determining whether to apply a deblocking filter to the current block. When a deblocking filter is applied to a block, either a strong filter or a weak filter can be applied depending on the required deblocking filter strength. Also, when applying a deblocking filter, the horizontal and vertical filter directions can be processed in parallel. The offset correction module can correct the offset with the original image in pixel units in the image subjected to deblocking. To perform offset correction on a specific image, it is possible to use the method of applying offset by considering the edge information of each pixel or the method of partitioning the pixels of the image into a specified number of regions, which determines the regions to be subjected to offset, and applies the offset to the specified regions. Adaptive rotation filtering (ALF) can be performed based on the values obtained by comparing the filtered reconstructed image and the original image. The pixels included in the image can be divided into defined groups, the filter to be applied to each group can be determined, and the filtering can be performed individually for each group. Information regarding whether to apply the ALF and the luma signal can be transmitted by the coding unit (CU). The shape and filter coefficients of the ALF filter can vary depending on the individual blocks. Also, ALF filters of the same shape (fixed shape) can be applied regardless of the characteristics of the target block of the application. Memory (155) may store reconstructed blocks or images computed through the filter module (150). The stored reconstructed blocks or images may be provided to the prediction modules (120 and 125) for performing inter-prediction. FIGURE 2 is a block diagram illustrating a video decoding apparatus in accordance with an embodiment of the present invention. Referring to FIGURE 2, the apparatus (200) for decoding the video may include: an entropy decoding module (210), a reordering module (215), an inverse quantization module (220), an inverse transform module (225), prediction modules (230 and 235), a filter module (240), and a memory (245). When a video bit stream is input from a device for encoding video, the input bit stream can be decoded according to the reverse process of the device for encoding video. The entropy decoding module (210) may perform entropy decoding in accordance with the reverse process of entropy encoding by the entropy encoding module of the device for encoding video. For example, in accordance with the method performed by the device for encoding video, various methods, such as exponential Golomb coding, context-adaptive variable length coding (CAVLC), and context-adaptive binary arithmetic coding (CABAC) may be applied. The entropy decoding module (210) may decode information regarding intra-prediction and inter-prediction performed by the device for encoding video. The reordering module (215) can perform reordering on the entropy of the bit stream decoded by the entropy decoder module (210) based on a reordering method used in the device for encoding video. The reordering module can reconstruct and reorder coefficients in one-dimensional vector form into coefficients in two-dimensional block form. The reordering module (215) can receive information related to the scanning coefficients performed in the device for encoding video and can perform reordering via a reverse scanning method the coefficients based on the scanning sequence performed in the device for encoding video. The inverse quantization module (220) can perform inverse quantization based on the quantization parameters received from the video encoding device and the rearranged block coefficients. The inverse transformation module (225) can perform inverse transformations, e.g., inverse DCT, inverse DST, and inverse KLT, which are the inverse transformation processes, e.g., DCT, DST, and KLT, performed by the transformation module on the quantization result by the device for encoding video. The inverse transformation can be performed based on the transfer unit determined by the device for encoding video. The inverse transformation module (225) of the device for decoding video can selectively perform transformation schemes (e.g., DCT, DST, and KLT) depending on a plurality of pieces of information, such as a prediction method, a current block size, a prediction direction, etc. The prediction modules (230 and 235) may generate prediction blocks based on information regarding the formation of prediction blocks received from the entropy decoding module (210) and previously decoded block or image information received from the memory (245). As explained above, like the operation of the tool for encoding video, in performing intra-prediction, when the size of the prediction unit is the same as the size of the transformation unit, intra-prediction can be performed on the prediction unit based on the pixels positioned on the left, top left, and top of the prediction unit. In performing intra-prediction, when the size of the prediction unit is different from the size of the transformation unit, intra-prediction can be performed that uses reference pixels based on the transformation unit. Also, intra-prediction that uses NxN partitioning can be used for only the smallest coding unit. The prediction modules (230 and 235) may include a prediction unit determination module, an inter-prediction module, and an intra-prediction module. The prediction unit determination module may receive various information, such as prediction unit information, prediction mode information from the intra-prediction method, information regarding prediction motion from the inter-prediction method, etc. from the entropy decoding module (210), may divide the current coding unit into prediction units, and may determine whether inter-prediction or intra-prediction is performed on the prediction units. By using the information required in the inter-prediction of the current prediction unit received from the means for encoding the video, the inter-prediction module (230) may perform inter-prediction on the current prediction unit based on information from at least one of the previous images or subsequent images of the current image that include the current prediction unit. Alternatively, inter-prediction may be performed based on information from multiple pre-reconstructed regions of the current image that include the current prediction unit. To perform inter-prediction, it can be determined for the coding unit that is, the long mode, combined mode, AMVP mode, and inter-block copy mode are used as the prediction method for the motion of the prediction unit included in the coding unit. An intra-prediction module (235) may generate a prediction block based on pixel information in the current image. When the prediction unit is a prediction unit subject to intra-prediction, intra-prediction may be performed based on the intra-prediction mode information of the prediction unit received from a device for encoding video. The intra-prediction module (235) may include an Intra Adaptive Smoothing (AIS) filter, a reference pixel interpolation module, and a DC filter. The AIS filter performs filtering on the reference pixels of the current block, and whether to apply the filter may be determined depending on the prediction mode of the current prediction unit. AIS filtering may be performed on the reference pixels of the current block by using the prediction mode of the prediction unit and the AIS filter information received from the device for encoding video. When the prediction mode of the current block is a mode in which AIS filtering is not performed, the AIS filter may not be applied. When the prediction mode of the prediction unit is a prediction mode in which intra-prediction is performed based on the pixel values obtained by interpolating the reference pixels, the reference pixel interpolation module can interpolate the reference pixels to generate reference pixels of integer pixels or less than integer pixels. When the prediction mode of the current prediction unit is a prediction mode in which prediction blocks are generated without interpolating the reference pixels, the reference pixels may not be interpolated. The DC filter can generate prediction blocks through filtering when the prediction mode of the current block is DC mode. The reconstructed block or image may be provided to the filter module (240). The filter module (240) may include a deblocking filter, an offset correction module, and an ALF. Information regarding whether or not a deblocking filter is applied to the corresponding block or image and information regarding which strong filter and which weak filter are applied when the deblocking filter is applied may be received from the video encoding device. The deblocking filter of the video decoding device may receive information regarding the deblocking filter from the video encoding device, and may perform the deblocking filter on the corresponding block. The offset correction module can perform offset correction on the reconstructed image based on the offset correction type and offset value information applied to the image in encoding. ALF can be applied to the encoding unit based on information about whether to apply ALF, ALF coefficient information, etc. received from the video encoding device. ALF information can be provided as included in a specific parameter set. Memory (245) may store a reconstructed image or block for use as a reference image or block, and may provide the reconstructed image to an output module. As explained above, in the embodiments of the present invention, for ease of explanation, coding unit is used as a term representing the unit for encoding, but the coding unit can act as a unit that performs decoding as well as encoding. Additionally, the current block may represent the target block to be encoded / decoded. Furthermore, the current block may represent a coding tree block (or coding tree unit), a coding block (or coding unit), a transformation block (or transformation unit), a prediction block (or prediction unit), or the like depending on the encoding / decoding stage. In this description, a 'unit' may represent a basic unit for performing a specific encoding / decoding process and a 'block' may represent a sample array of a specified size. Unless otherwise specified, 'block' and 'unit' may be used interchangeably. For example, in the following examples, it is understood that coding blocks and coding units are both synonymous. An image can be encoded / decoded by being divided into elementary blocks having a square shape or a non-square shape. At this time, the elementary blocks can be referred to as coding tree units. The coding tree unit can be specified as the coding unit of the largest size left in the sequence or slice. Information representing whether the coding tree unit has a square shape or a non-square shape or information regarding the size of the coding tree unit can be signaled through sequence set parameters, image set parameters, or slice headers. The coding tree unit can be divided into smaller partition sizes. At this time, if it is assumed that the partition depth resulting from dividing the coding tree unit is 1, the partition depth resulting from dividing a partition having a depth of 1 can be specified as 2.Thus, the partition produced by dividing the partition of depth k in the coding tree unit can be designated as having depth k+1. A partition of arbitrary size generated by dividing a coding tree unit can be designated as a coding unit. The coding unit can be recursively divided or divided into elementary units for performing prediction, quantization, transformation, or in-loop filtering, and the like. For example, a partition of arbitrary size generated by dividing a coding unit can be designated as a coding unit, or can be designated as a transformation unit or a prediction unit, which is an elementary unit for performing prediction, quantization, transformation, or in-loop filtering and the like. Alternatively, a prediction block that has the same size as the encoding block or is smaller than the encoding block may be determined by the encoding block partition prediction. For the encoding block partition prediction, one of the partition mode candidates (Part_mode) representing the partition shape of the encoding block may be determined. Information for determining a partition index indicating one of the partition mode candidates may be signaled via a bit stream. Alternatively, the encoding block partition index may be determined based on at least one of the size, shape, or encoding mode of the encoding block. The size or shape of the prediction block may be determined based on the partition mode specified by the partition index. The partition mode candidates may include asymmetric partition shapes (e.g., nLx2N, nRx2N, 2NxnU, 2NxnD).The number or type of asymmetric partition mode candidates available for a coding block may be determined based on at least one of the size, shape, or encoding mode of the coding block. FIGURE 3 is a diagram illustrating the candidate partition modes that can be applied to the encoding block when the encoding block is encoded by inter-prediction. When the coding block is encoded by inter-prediction, any of the 8 candidate partition modes shown in FIGURE3 can be applied to the coding block. On the other hand, when the coding block is encoded by intra-prediction, only the square partitioning mode can be applied to the coding block. In other words, when the coding block is encoded by intra-prediction, the partitioning mode, PART_2Nx2N or PART_NxN, can be applied to the coding block. PART_NxN can be applied when the encoding block has a minimum size. Here, the minimum size of the encoding block can be predefined in the encoder and decoder. Alternatively, information about the minimum size of the encoding block can be signaled via the bit stream. In the example, the minimum size of the encoding block can be signaled via the slice header. Therefore, the minimum size of the encoding block can be specified differently per slice. In another example, the available partition mode candidates for the encoding block may be determined differently according to at least one of the sizes or shapes of the encoding block. In an example, the number or type of available partition mode candidates for the encoding block may be determined differently according to at least one of the sizes or shapes of the encoding block. Alternatively, the type or number of asymmetric partition mode candidates available for a coding block may be determined based on the size or shape of the coding block. The number or type of asymmetric partition mode candidates available for a coding block may be determined differently according to at least one of the sizes or shapes of the coding block. In an example, when the coding block has a non-rectangular shape whose width is greater than its height, at least one of PART_2NxN, PART_2NxnU or PART_2NxnD may not be used as a coding block partition mode candidate. When the coding block has a non-rectangular shape whose height is greater than its width, at least one of PART_Nx2N, PART_nLx2N, PART_nRx2N may not be used as a coding block partition mode candidate. In general, prediction blocks may have a size of 4x4 to 64x64. However, when the encoding block is encoded by interprediction, the prediction block can be restricted to not have a size of 4x4 to reduce memory bandwidth in performing motion compensation. Based on the partition mode, the encoding block can be partitioned recursively. In other words, based on the partition mode specified by the partition index, the encoding block can be partitioned and each partition generated by partitioning the encoding block can be designated as an encoding block. Next, the method of partitioning a coding unit will be explained in more detail. In the following examples, a coding unit can mean a coding tree unit or a coding unit included in a coding tree unit. In addition, a 'partition' produced by partitioning a coding block can mean a 'coding block.' The following partitioning method can be applied when a coding block is partitioned into a plurality of prediction blocks or transformation blocks. A coding unit can be partitioned by at least one row. In this case, the row angle partitioning the coding unit can be a value in the range of 0 to 360 degrees. For example, the horizontal row angle can be 0 degrees, the vertical row angle can be 90 degrees, the diagonal row angle in the top-right direction can be 45 degrees, and the diagonal row angle in the top-left direction can be 135 degrees. When a coding unit is partitioned by a plurality of rows, all of the plurality of rows may have the same angle. Alternatively, at least one of the plurality of rows may have an angle that differs from the other rows. Alternatively, the plurality of rows partitioning a coding tree unit or coding unit may have a predefined angle of difference (e.g., 90 degrees). Information about the rows that partition the coding unit can be specified by the partitioning mode. Alternatively, information about at least one of the number, direction, angle, or position within the block of rows can be encoded. For ease of description, in the following examples, it is assumed that the coding unit is partitioned into a number of coding units using at least one of the vertical or horizontal rows. The number of vertical rows or horizontal rows partitioning a coding unit can be at least one or more. In the example, the coding unit can be partitioned into 2 partitions using one vertical row or one horizontal row. Alternatively, the coding unit can be partitioned into 3 partitions using two vertical rows or two horizontal rows. Alternatively, the coding unit can be partitioned into 4 partitions that are half the width and height of the coding unit, using one vertical row or one horizontal row. When a coding unit is partitioned into a plurality of partitions using at least one vertical row or at least one horizontal row, the partitions may have uniform sizes. Alternatively, one partition may have a different size from the other partitions or each partition may have a different size. In the example, when a coding unit is partitioned by two horizontal rows or two vertical rows, the coding unit may be partitioned into 3 partitions. In this case, the ratio of the width or height of the 3 partitions may be n:2n:n, 2n:n:n, or n:n:2n. In the following examples, partitioning the coding block into 4 partitions is called quad-tree partitioning. And, partitioning the coding block into 2 partitions is called binary-tree partitioning. Also, partitioning the coding block into 3 partitions is called triple-tree partitioning. In the hereinafter mentioned drawings, it will be seen that one vertical row and / or one horizontal row is used to partition the coding unit, however it will be explained that partitioning the coding unit into more partitions than shown by using more vertical rows and / or more horizontal rows than shown or partitioning the coding unit into fewer partitions than shown is also included in the range of the present invention. FIGURE 4 shows an example of hierarchically partitioning coding blocks based on a tree structure as an embodiment to which the present invention applies. An input video signal is decoded in pre-defined block units and the basic unit for decoding the input video signal is called a coding block. The coding block can be a unit that performs intra / inter prediction, transformation and quantization. In addition, prediction modes (e.g., intra-prediction mode or inter-prediction mode) can be defined in the coding block unit and the prediction blocks included in the coding block can share the defined prediction modes. The coding block can be a square or non-square block with arbitrary size in the range of 8x8 to 64x64 or a square or non-square block with size of 128x128, 256x256 or more. Specifically, the coding blocks may be hierarchically partitioned based on at least one of a quad tree partitioning method, a binary tree partitioning method, or a triple tree partitioning method. A quad tree partitioning method may mean a method where a 2Nx2N coding block is partitioned into four NxN coding blocks. A binary tree partitioning method may mean a method where a coding block is partitioned into two coding blocks. A triple tree partitioning method may mean a method where a coding block is partitioned into three coding blocks. Even when triple tree or binary tree partitioning is performed, the coding square blocks may be present at a lower depth. Partitions generated by binary tree-based partitioning can be symmetric or asymmetric. In addition, coding blocks partitioned based on a binary tree can be square or non-square (e.g., rectangular) blocks. FIGURE 5 is a diagram showing forming a partition for a coding block based on a binary tree partition. The form of the coding block partition based on a binary tree partition may include symmetric types such as 2NxN (non-square coding units in the horizontal direction) or Nx2N (non-square coding units in the vertical direction), etc. or asymmetric types such as nLx2N, nRx2N, 2NxnU or 2NxnD, etc. only one of the symmetric type or the asymmetric type may be left as forming the coding block partition. The triple tree partitioning form may include at least one of the form of partitioning the coding block into 2 vertical rows or the form of partitioning the coding block into 2 horizontal rows. 3 non-square partitions can be generated by triple tree partitioning. FIGURE 6 shows the form of a triple tree partition. A triple tree partitioning form can include partitioning the coding block into 2 horizontal rows or partitioning the coding block into 2 vertical rows. The ratio of the width or height of the partitions produced by partitioning the coding block can be n:2n:n, 2n:n:n or n:n:2n. The position of the partition with the largest width or height among the three partitions can be pre-defined in the encoder and decoder. Alternatively, information indicating the partition with the largest width or height among the three partitions can be signaled in the bit stream. Only partitions with square or symmetric non-square shapes can be possible for coding units. In this case, partitioning coding units into square partitions can correspond to partitioning a CU quad tree, and partitioning coding units into non-square partitions in a symmetric shape can correspond to partitioning a binary tree. Partitioning coding units into square partitions and non-square partitions in a symmetric shape can correspond to partitioning a CU quad tree and binary tree (QTBT). Binary tree or triple tree-based partitioning may be performed for coding blocks where quad tree-based partitioning is no longer performed. A coding block generated with binary tree or triple tree-based partitioning may be partitioned into smaller coding blocks. In this case, at least one of the quad tree partitioning, triple tree partitioning, or binary tree partitioning may be specified not to be applied to the coding block. Alternatively, binary tree partitioning in a predetermined direction or triple tree partitioning in a predetermined direction may not be allowed for coding blocks. In the example, quad tree partitioning and triple tree partitioning may be specified to be not possible for coding blocks generated with binary tree or triple tree-based partitioning. Only binary tree partitioning may be left for coding blocks. Alternatively, only the largest coding block among the 3 coding blocks generated by triple-tree-based partitioning can be partitioned into smaller coding blocks. Alternatively, binary-tree-based partitioning or triple-tree-based partitioning can be left for only the largest coding block among the 3 coding blocks generated by triple-tree-based partitioning. The partition shape of the lower partition depth can be determined depending on the partition shape of the upper partition depth. In the example, when the upper partition and the lower partition are partitioned based on a binary tree, only binary tree-based partitions in the same shape as the binary tree partition shape of the upper partition depth can be allowed for the lower partition depth. For example, when the binary tree partition shape of the upper partition depth is 2NxN, the binary tree partition shape of the lower partition depth can also be set to 2NxN. Alternatively, when the binary tree partition shape of the upper partition depth is Nx2N, the partition shape of the lower partition depth can also be set to Nx2N. Alternatively, binary tree partitioning in the same partition direction as the top partition depth or triple tree partitioning in the same partition direction as the top partition depth can be specified to be impossible for the largest partition among the partitions produced by triple tree-based partitioning. Alternatively, the partition shape of a lower partition depth can be determined by considering the partition shape of the upper partition depth and the partition shape of the adjacent lower partition depth. Concretely, if the upper partition depth is partitioned based on a binary tree, the partition shape of the lower partition depth can be determined such that the same result as that of partitioning the upper partition depth based on a quad tree does not occur. In the example, when the partition shape of the upper partition depth is 2NxN and the partition shape of the adjacent lower partition depth is Nx2N, the partition shape of the current lower partition depth may not be set to Nx2N.This is because when the partition shape of the current lower partition depth is Nx2N, it produces the same result as that of partitioning the upper partition depth based on the NxN-shaped quad tree. When the partition shape of the upper partition depth is Nx2N and the partition shape of the adjacent lower partition depth is 2NxN, the partition shape of the current lower partition depth may not be set to 2NxN. In other words, when the partition shape of the upper partition depth binary tree is different from the partition shape of the adjacent lower partition depth binary tree, the partition shape of the current lower partition depth binary tree can be set to be the same as the partition shape of the upper partition depth binary tree. Alternatively, the partition shape of the lower partition depth binary tree can be set to be different from the partition shape of the upper partition depth binary tree. Possible binary tree partition shapes can be specified in sequence units, slices, or encoding units. In the example, possible binary tree partition shapes for an encoding tree unit can be limited to 2NxN or Nx2N. Possible partition shapes can be predefined in the encoder or decoder. Alternatively, information on possible partition shapes or impossible partition shapes can be encoded and signaled via a bit stream. FIGURE 7 is a diagram showing an example where only a specific form of binary tree-based partitioning is possible. FIGURE7(a) represents an example where only partitions based on Nx2N-shaped binary trees are possible and FIGURE7(b) represents an example where only partitions based on 28NxN-shaped binary trees are possible. To represent various forms of partitioning, information about quad tree partitioning, information about binary tree partitioning, or information about triple tree partitioning may be used. Information about quad tree partitioning may include at least one of information indicating whether quad tree-based partitioning is performed or information regarding the size / depth of the coding block where quad tree-based partitioning is possible. Information about binary tree partitioning may include at least one of information indicating whether binary tree-based partitioning is performed, information regarding whether binary tree-based partitioning is vertical or horizontal, information regarding the size / depth of the coding block where binary tree-based partitioning is allowed, or information regarding the size / depth of the coding block where binary tree-based partitioning is not possible.Information regarding triple tree partitioning may include at least one of information indicating whether triple tree-based partitioning is performed, information regarding whether triple tree-based partitioning is vertical or horizontal, information regarding a coding block size / depth where triple tree-based partitioning is allowed or information regarding a coding block size / depth where triple tree-based partitioning is not possible. The coding block size information may represent at least one of a minimum or maximum value among a width, a height, a product of the width and height or a ratio of the width and height of the coding block. In the example, when the width or height of the encoding block is smaller than the minimum size at which binary tree partitioning is allowed, or when the depth of the encoding block partition is greater than the maximum depth at which binary tree partitioning is allowed, binary tree-based partitioning may not be allowed for the encoding block. In the example, when the width or height of the coding block is smaller than the minimum size at which triple tree partitioning is allowed, or when the depth of the coding block partition is greater than the maximum depth at which triple tree partitioning is allowed, triple tree-based partitioning may not be allowed for the coding block. Information about the conditions under which a binary tree or triple tree-based partition is left can be signaled via a bit stream. The information can be encoded in sequence units, images, or partial images. A partial image can be at least one of slices, tile groups, tiles, bricks, coding blocks, prediction blocks, or transformation blocks. In the example, the syntax, 'max_mtt_depth_idx_minus1', represents the maximum depth to which a possible binary tree / triple tree partition can be encoded / decoded over a bit stream. In this case, max_mtt_depth_idx_minus1+1 can represent the maximum depth to which a binary tree / triple tree partition is possible. In an example, at least one of the number of times that a binary tree / triple tree partition is allowed, the maximum depth that a binary tree / triple tree partition is allowed or the number of depths to which a binary tree / triple tree partition is possible may be signaled in a sequence or slice level. Therefore, at least one of the number of times that a binary tree / triple tree partition is allowed, the maximum depth that a binary tree / triple tree partition is allowed or the number of depths to which a binary tree / triple tree partition is possible may be different for a first slice and a second slice. In the example, while for the first slice, a binary tree / triple tree partition may be allowed in only one depth, for the second slice, a binary tree / triple tree partition may be possible in two depths. In the example shown in FIGURE8, FIGURE8 shows where binary tree partitioning is performed for a coding unit having a depth of 2 and a coding unit having a depth of 3. Therefore, at least one of the information representing the number of times (2 times) that binary tree partitioning is performed in the coding tree unit, the information representing the maximum depth (depth 3) of partitioning produced by binary tree partitioning in the coding tree unit or the information representing the number of partition depths (depth 2, depth 2 and depth 3) that binary tree partitioning is applied in the coding tree unit can be encoded / decoded over the bit stream. Alternatively, the number of times that binary tree / triple tree partitions are possible, the depth to which binary tree / triple tree partitions are possible or the number of depths to which binary tree / triple tree partitions are possible may be predefined in the encoder and decoder. Alternatively, the number of times that binary tree / triple tree partitions are possible, the depth to which binary tree / triple tree partitions are possible or the number of depths to which binary tree / triple tree partitions are possible may be determined based on at least one of the sequence or slice index or the size / shape of the encoding unit. In an example, for the first slice, binary tree / triple tree partitions may be possible in one depth and for the second slice, binary tree / triple tree partitions may be possible in two depths. In another example, at least one of the number of times that a binary tree partition is possible, the depth to which a binary tree partition is allowed or the number of depths to which a binary tree partition is possible may be set differently according to a temporal level identifier (TemporalID) of the slice or image. Here, the temporal level identifier (TemporalID) is to identify each of a plurality of layers in the image that has at least one or more of view, spatial, temporal or quality scalability. As shown in FIGURE 4, the first coding block (300) with partition depth (splitting depth) k can be partitioned into multiple second coding blocks based on the quad tree. For example, the second coding block (310 to 340) can be a square block having half the width and height of the first coding block and the partition depth of the second coding block can be increased to k+1. The second coding block (310) with partition depth k+1 can be partitioned into multiple third coding blocks with partition depth k+2. The partitioning of the second coding block (310) can be done by selectively using either a quad tree or a binary tree depending on the partitioning method. In this case, the partitioning method can be determined based on at least one of information indicating partitioning based on a quad tree or information indicating partitioning based on a binary tree. When the second coding block (310) is partitioned based on a quad tree, the second coding block (310) can be partitioned into four third coding blocks (310a) having a width and a height of half of the second coding block and the partition depth of the third coding block (310a) can be increased up to k+2. On the other hand, when the second coding block (310) is partitioned based on a binary tree, the second coding block (310) can be partitioned into two third coding blocks. In this case, each of the two third coding blocks can be a non-square block having either a width and a height of half of the second coding block and the partition depth can be increased up to k+2. The second coding block can be determined as a non-square block in the horizontal direction or the vertical direction corresponding to the partition direction and the partition direction can be determined based on information regarding whether the binary tree-based partitioning is performed in the vertical direction or the horizontal direction. Meanwhile, the second coding block (310) may be defined as a leaf coding block that is no longer partitioned based on a quad tree or a binary tree and in this case, the corresponding coding block may be used as a prediction block or a transformation block. Like the second coding block partition (310), the third coding block (310a) can be defined as a leaf coding block or can be further partitioned based on a quad tree or a binary tree. On the other hand, the third coding block (310b) partitioned based on the binary tree may be further partitioned into coding blocks (310b-2) in the vertical direction or coding blocks (310b-3) in the horizontal direction based on the binary tree and the partition depth of the corresponding coding blocks may be increased up to k+3. Alternatively, the third coding block (310b) may be defined as a leaf coding block (310b-1) which is no longer partitioned based on the binary tree and in this case, the corresponding coding block (310b-1) may be used as a prediction block or a transformation block.However, the above-mentioned partitioning process may be performed in a limited manner based on at least one of information regarding the size / depth of the coding block where quad-tree-based partitioning is possible, information regarding the size / depth of the coding block where binary-tree-based partitioning is allowed or information regarding the size / depth of the coding block where binary-tree-based partitioning is not possible. The number of candidates representing the coding block size may be limited to a predetermined number or the coding block size in the predetermined unit may have a fixed value. In an example, the coding block size in a sequence or in an image may be limited to having one of 256x256, 128x128 or 32x32. Information representing the coding block size in a sequence or in an image may be signaled in the sequence header or image header. As a result of partitioning based on quad trees and binary trees, coding units can be represented as square or rectangular shapes of arbitrary size. As shown in FIGURE 4, the first coding block (300) with partition depth (splitting depth) k can be partitioned into multiple second coding blocks based on the quad tree. For example, the second coding block (310 to 340) can be a square block having half the width and height of the first coding block and the partition depth of the second coding block can be increased to k+1. The second coding block (310) with partition depth k+1 can be partitioned into multiple third coding blocks with partition depth k+2. The partitioning of the second coding block (310) can be done by selectively using either a quad tree or a binary tree depending on the partitioning method. In this case, the partitioning method can be determined based on at least one of information indicating partitioning based on a quad tree or information indicating partitioning based on a binary tree. When the second coding block (310) is partitioned based on a quad tree, the second coding block (310) can be partitioned into four third coding blocks (310a) having a width and a height of half of the second coding block and the partition depth of the third coding block (310a) can be increased up to k+2. On the other hand, when the second coding block (310) is partitioned based on a binary tree, the second coding block (310) can be partitioned into two third coding blocks. In this case, each of the two third coding blocks can be a non-square block having either a width and a height of half of the second coding block and the partition depth can be increased up to k+2. The second coding block can be determined as a non-square block in the horizontal direction or the vertical direction corresponding to the partition direction and the partition direction can be determined based on information regarding whether the binary tree-based partitioning is performed in the vertical direction or the horizontal direction. Meanwhile, the second coding block (310) may be defined as a leaf coding block that is no longer partitioned based on a quad tree or a binary tree and in this case, the corresponding coding block may be used as a prediction block or a transformation block. Like the second coding block partition (310), the third coding block (310a) may be defined as a leaf coding block or may be further partitioned based on a quad tree or a binary tree. On the other hand, the third coding block (310b) partitioned based on the binary tree may be further partitioned into coding blocks (310b-2) in the vertical direction or coding blocks (310b-3) in the horizontal direction based on the binary tree and the partition depth of the corresponding coding blocks may be increased up to k+3. Alternatively, the third coding block (310b) may be defined as a leaf coding block (310b-1) which is no longer partitioned based on the binary tree and in this case, the corresponding coding block (310b-1) may be used as a prediction block or a transformation block.However, the above-mentioned partitioning process may be performed in a limited manner based on at least one of information regarding the size / depth of the coding block where quad-tree-based partitioning is possible, information regarding the size / depth of the coding block where binary-tree-based partitioning is allowed or information regarding the size / depth of the coding block where binary-tree-based partitioning is not possible. The number of candidates representing the coding block size may be limited to a predetermined number or the coding block size in the predetermined unit may have a fixed value. In an example, the coding block size in a sequence or in an image may be limited to having one of 256x256, 128x128 or 32x32. Information representing the coding block size in a sequence or in an image may be signaled in the sequence header or image header. As a result of partitioning based on quad trees and binary trees, coding units can be represented as square or rectangular shapes of arbitrary size. A leap transformation may be set not to be used for coding units generated by binary tree-based partitioning or ternary tree-based partitioning. Alternatively, the leap transformation may be set to be applied to at least one of the vertical direction or the horizontal direction in a non-square coding unit. In the example, when the leap transformation is applied to the horizontal direction, it represents only scaling performed in the horizontal direction without inverse transformation / transformation and the transformation / transformation using DCT or DST is performed in the vertical direction. When the leap transformation is applied to the vertical direction, it represents only scaling performed in the vertical direction without inverse transformation / transformation and the transformation / transformation using DCT or DST is performed in the horizontal direction. Information about whether the inverse transformation for the horizontal direction is skipped or information about whether the inverse transformation for the vertical direction is skipped can be signaled through the bit stream. In the example, information about whether the inverse transformation for the horizontal direction is skipped can be a 1-bit flag, 'hor_transform_skip_flag', and information about whether the inverse transformation for the vertical direction is skipped can be a 1-bit flag, 'ver_transform_skip_flag'. The encoder can specify whether 'hor_transform_skip_flag' or 'ver_transform_skip_flag' is encoded according to the size and / or shape of the current block. In the example, when the current block has a shape of Nx2N, hor_transform_skip_flag can be encoded and ver_transform_skip_flag encoding can be omitted. When the current block has a shape of 2NxN, ver_transform_skip_flag can be encoded and hor_transform_skip_flag can be omitted. Alternatively, based on the size and / or shape of the current block, whether a horizontal transformation or a vertical transformation is performed can be determined. In the example, when the current block has a shape of Nx2N, a horizontal transformation can be applied to the horizontal direction and a reverse transformation / transformation can be performed for the vertical direction. When the current block has a shape of 2NxN, a vertical transformation can be applied to the vertical direction and a reverse transformation / transformation can be performed for the horizontal direction. The reverse transformation / transformation can be performed based on at least one of DCT or DST. As a result of partitioning based on a quad tree, binary tree, or triple tree, the departitioned coding block can be used as a prediction block or a transformation block. In other words, the coding block generated by quad tree partitioning or binary tree partitioning can be used as a prediction block or a transformation block. In an example, an image prediction can be generated in a coding block unit and the signal residual, the difference between the original image and the prediction image, can be transformed in the coding block unit. To generate a prediction image in a coding block unit, motion information can be determined based on the coding block or an intra-prediction mode can be determined based on the coding block. Therefore, the coding block can be encoded using at least one of the long-range, intra-prediction, or inter-prediction modes. Alternatively, a plurality of coding blocks generated by partitioning the coding blocks may be arranged to share at least one of motion information, joint candidates, reference samples, row reference samples, or intra-prediction modes. In an example, when the coding blocks are partitioned by a triple tree, partitions generated by partitioning the coding blocks may share at least one of motion information, joint candidates, reference samples, row reference samples, or intra-prediction modes appropriate to the size or shape of the coding blocks. Alternatively, only a portion of the plurality of coding blocks may be arranged to share information and the remaining coding blocks may be arranged not to share information. In other examples, it is possible to use smaller prediction blocks or transformation blocks than encoding blocks by partitioning the encoding blocks. Next, the method of performing inter-prediction for the encoder block or the prediction block generated by partitioning the encoder block will be explained in detail. FIGURE 9 is a flowchart illustrating the inter-prediction method as an embodiment to which the present invention applies. Referring to FIGURE 9, the current block motion information can be determined S910. The current block motion information can include at least one of the motion vector of the current block, the index reference image of the current block, the inter-prediction direction or the lame prediction weight of the current block. The lame prediction weight can represent the weight applied to the reference block L0 and the weight applied to the reference block L1. The motion vector of the current block can be determined based on the information signaled through the bit stream. The motion vector precision represents the basic unit for expressing the motion vector of the current block. For example, the motion vector precision of the current block can be specified as one of an integer pel, 1 / 2 pel, 1 / 4 pel, or 1 / 8 pel. The motion vector precision can be determined on a per-image basis, on a per-slice basis, on a per-tile group basis, on a per-tile basis, or on a per-block basis. Blocks can represent coding tree units, coding units, prediction units, or transformation units. The current block movement information can be obtained based on at least one of the information signaled through the bit stream or the block movement information of the current adjacent block. FIGURE 10 is a diagram illustrating the procedure for deriving the current block motion information when the merge mode is applied to the current block. A merge mode represents a method of deriving the current block movement information from adjacent blocks. When merge mode is applied to the current block, spatial merge candidates can be derived from the spatially adjacent blocks of the current block S1010. The spatially adjacent blocks can include at least one of the blocks close to the top boundary, left boundary, or corner (for example, at least one of the top left corner, top right corner, or bottom left corner) of the current block. FIGURE 11 is a diagram showing an example of spatially contiguous blocks. As the example shown in FIGURE11, a spatially contiguous block may include at least one of a contiguous block (A1) close to the left side of the current block, a contiguous block (B1) close to the top side of the current block, a contiguous block (Ao) close to the bottom-left corner of the current block, a contiguous block (B0) close to the top-right corner of the current block, and a contiguous block (B2) close to the top-left corner of the current block. For example, suppose that the position of the top-left corner of the sample of the current block is (0, 0), the width of the current block is W, and the height of the current block is H. Block Ai may include the sample at position (-1, H-1). Block B1 may include the sample at position (W-1, -1). Block A0 may include the sample at position (-1, H). Block B0 may include the sample at position (W, -1). Block B2 may include the sample at position (-1, -1). Further expanding the example of FIGURE 11, spatially combined candidates can be derived from blocks adjacent to the top-left sample of the current block, or blocks adjacent to the top-center sample of the current block. For example, blocks adjacent to the top-left sample of the current block can include at least the block that includes the sample at position (0, -1) or the block that includes the sample at position (-1, 0). Alternatively, spatial-only candidates can be derived from at least one of the blocks adjacent to the top-center sample of the current block or the blocks adjacent to the middle-left sample of the current block. For example, blocks adjacent to the top-center sample of the current block can include the sample at position (W / 2, -1). Blocks adjacent to the middle-left sample of the current block can include the sample at position (-1, H / 2). Based on the size and / or shape of the current block, the position of the adjacent top block and / or the adjacent left block used to derive the spatial join candidate can be determined. In an example, when the size of the current block is larger than a threshold value, the spatial join candidate can be derived from the block adjacent to the top of the center sample of the current block and the block adjacent to the left center sample of the current block. On the other hand, when the size of the current block is smaller than a threshold value, the spatial join candidate can be derived from the block adjacent to the top-right sample of the current block and the block adjacent to the bottom-left sample of the current block. Here, the size of the current block can be indicated based on at least one of width, height, sum of width and height, product of width and height or ratio of width and height.The threshold value can be an integer such as 2, 4, 8, 16, 32 or 128. According to the shape of the current block, the availability of spatially adjacent extended blocks can be determined. For example, when the current block is a non-rectangular block where the width is greater than the height, it can be determined that the block close to the top-left sample of the current block, the block close to the middle-left sample, or the block close to the bottom-left sample of the current block are unavailable. Meanwhile, when the current block is a block where the height is greater than the width, it can be determined that the block close to the top-left sample of the current block, the block close to the top-center sample, or the block close to the top-right sample of the current block are unavailable. The motion information of a spatially merged candidate can be set to be identical to the motion information of its spatially adjacent blocks. Spatial join candidates can be determined by searching contiguous blocks in a predetermined order. In the example, shown in FIGURE 11, the search for determining spatial join candidates can be performed in the blocks of the order A1, B1, B0, A0, and B2. Here, block B2 can be used when at least one of the remaining blocks (hence, A1, B1, B0, and A0) is missing or at least one is encoded via the intra-prediction mode. The search order for spatial join candidates can be predefined in the encoder / decoder. Alternatively, the search order for spatial join candidates can be adaptively determined based on the size or shape of the current block. Alternatively, the search order for spatial join candidates can be determined based on information signaled through the bit stream. A temporal merge candidate can be derived from the contiguous temporal blocks of the current block S1020. Contiguous temporal blocks can mean co-located blocks that belong to a co-located image. The co-located images have a different POC than the current image that belongs to the current block. Co-located images can be defined as images that have a predefined index in the reference image list or as images that have a minimum POC difference with the current image. Alternatively, co-located images can be defined by information signaled through a bit stream.The information signaled through the bit stream may include at least one of information indicating a reference list of images (e.g., an L0 reference list of images or an L1 reference list of images) that includes co-located images and an index indicating the co-located images in the reference list of images. The information for specifying the co-located images may be signaled in at least one of the image set, slice header, and block level parameters. The motion information of a temporal merge candidate can be determined based on the motion information of the co-located blocks. In an example, the motion vector of a temporal merge candidate can be determined based on the motion vector of the co-located blocks. For example, the motion vector of the temporal merge candidate can be set to be identical to the motion vector of the co-located blocks. Alternatively, the motion vector of the temporal merge candidate can be derived by scaling the motion vector of the co-located blocks on the basis of at least one of the POC difference between the current image and the reference image of the current block, and the POC difference between the co-located image and the reference image of the co-located. FIGURE 12 is a diagram showing an example of deriving motion vectors from temporal composite candidates. In the example shown in FIGURE 12, tb represents the POC difference between the current image curr_pic and the reference image curr_ref of the current image, and td represents the POC difference between the co-located image col_pic and the reference image col_ref of the co-located block. The motion vector of the temporal merge candidate can be derived by scaling the motion vector of the co-located block col_PU on the basis of tb and / or td. Alternatively, considering whether or not the co-located blocks can be used, the motion vector of the co-located blocks and the motion vector obtained by scaling the motion vector of the co-located blocks can be used as the motion vector of the temporal combination candidate. In the example, the motion vector of the co-located block is set as the motion vector of the first temporal combination candidate, and the value obtained by scaling the motion vector of the co-located blocks can be set as the motion vector of the second temporal combination candidate. An inter-prediction direction of a temporal merge candidate may be set to be identical to the inter-prediction direction of a temporally adjacent block. However, the index reference image of the temporal merge candidate may have a fixed value. In an example, the index reference image of the temporal merge candidate may be set to 0. Alternatively, the index reference image of the temporal merge candidate may be adaptively determined on the basis of at least one of the index reference images of the spatial merge candidate, the index reference image of the current image. A specific block that has the same position and size as the current block in the co-located image, or a block that is close to a block that is close to a block that has the same position and size as the current block can be specified as a co-located block. FIGURE 13 is a diagram showing the positions of candidate blocks that are likely to be used as co-located blocks. A candidate block may include at least one of a block close to the top-left corner position of the current block in the co-located image, a block close to the middle sample position of the current block in the co-located image, and a block close to the bottom-left corner position of the current block in the co-located image. In an example, a candidate block may include at least one of a TL block that includes the top-left sample position of the current block in the co-located image, a BR block that includes the bottom-right sample position of the current block in the co-located image, an H block that is close to the bottom-right corner of the current block in the co-located image, a C3 block that includes the middle sample position of the current block in the co-located image, and a C0 block that is close to the middle sample of the current block (e.g., a block that includes sample positions that are spaced apart from the middle sample of the current block by (-1, -1)) in the co-located image. In addition to the example shown in FIGURE 13, blocks that include adjacent block positions that are close to the previously defined boundaries of the current block in the co-located drawing can be selected as co-located blocks. The number of temporal join candidates can be 1 or more. In the example, at least one temporal join candidate can be derived based on at least one co-located block. Information regarding the maximum number of temporal join candidates may be encoded and signaled through an encoder. Alternatively, the maximum number of temporal join candidates may be derived based on the maximum number of join candidates and / or the maximum number of spatial join candidates that may be included in the join candidate list. Alternatively, the maximum number of temporal join candidates may be determined on the basis of the number of co-located blocks that may be used. Whether or not a candidate block can be used can be determined according to a predetermined priority, and at least one co-located block can be determined based on the above determination and the maximum number of temporally combined candidates. In the example, when block C3 which includes the middle sample position of the current block and block H which is close to the bottom-right corner of the current block are candidate blocks, one of block C3 and block H can be determined as the co-located block. When block H is available, block H can be determined as the co-located block. However, when block H is not available (for example, when block H is encoded via intraprediction, when block H is unusable or when block H is positioned outside the largest coding unit (LCU), etc.), block C3 can be determined as the co-located block. In another example, when at least one of a plurality of blocks close to the lower-right corner of the current block position in the co-located image is unavailable (e.g., block H and / or block BR), the unavailable block may be replaced with another available block. The other available blocks replaced with the unavailable block may include at least one block (e.g., C0 and / or C3) close to the center sample of the current block position in the co-located image, and a block (e.g., TL) close to the lower-left corner of the current block in the co-located image. When at least one of a plurality of blocks close to the center sample of the current block position in the co-located image is unavailable or when at least one of a plurality of blocks close to the upper-left corner of the current block position in the co-located image is unavailable, the unavailable block may be replaced by another available block. Next, a merge candidate list including spatial merge candidates and temporal merge candidates can be generated S1030. When configuring the merge candidate list, merge candidates that have identical motion information to existing merge candidates can be removed from the merge candidate list. Information regarding the maximum number of merge candidates can be signaled through the bit stream. In the example, information indicating the maximum number of merge candidates can be signaled through a sequence parameter or an image parameter. In the example, when the maximum number of merge candidates is six, a total of six can be selected from the spatial merge candidates and the temporal merge candidates. For example, five spatial merge candidates can be selected from five merge candidates, and one temporal merge candidate can be selected from two temporal merge candidates. Alternatively, the maximum number of merge candidates can be predefined in the encoder and decoder. For example, the maximum number of merge candidates can be two, three, four, five, or six. Alternatively, the maximum number of merge candidates can be determined based on at least one of whether merge with MVD (MMVD) is performed, whether combined prediction is performed, or whether triangle partitioning is performed. If the number of combined candidates included in the combined candidate list is less than the maximum number of combined candidates, the combined candidates included in the second combined candidate list may be added to the combined candidate list. The second combined candidate list may include combined candidates derived based on block motion information encoded / decoded by inter-prediction before the current block. In an example, if motion compensation for a block whose encoding mode is inter-prediction is performed, the combined candidates derived based on the block motion information may be added to the second combined candidate list. If encoding / decoding of the current block is completed, the current block motion information may be added to the second combined candidate list for inter-prediction of the next block. The second combined candidate list can start in CTU units, tiles, or slices. The maximum number of combined candidates that can be included in the second combined candidate list can be predefined in the encoder and decoder. Alternatively, information representing the maximum number of combined candidates that can be included in the second combined candidate list can be signaled via a bit stream. The index of the merge candidates included in the second merge candidate list may be determined based on the order in which they are added to the second merge candidate list. In the example, the index given for the Nth merge candidate added to the second merge candidate list may have a smaller value than the index given for the N+1th merge candidate added to the second merge candidate list. For example, the index of the N+1th merge candidate may be set to a value increased by 1 for the index of the Nth merge candidate. Alternatively, the index of the Nth merge candidate may be set to the index of the N+1th merge candidate and the value of the index of the Nth merge candidate may be decreased by 1. Alternatively, the index given for the Nth merge candidate added to the second merge candidate list may have a value greater than the index given for the N+1th merge candidate added to the second merge candidate list. For example, the index of the Nth merge candidate may be set to the index of the N+1st merge candidate and the value of the index of the Nth merge candidate may be increased by 1. Based on whether the motion information of the block that compensates for the movement is the same as the motion information of the joint candidate included in the second joint candidate list, whether the joint candidate derived from the block is added to the second joint candidate list can be determined. In an example, when a joint candidate with the same motion information as the block is included in the second joint candidate list, the joint candidate derived based on the motion information of the block may not be added to the second joint candidate list. Alternatively, when a joint candidate with the same motion information as the block is included in the second joint candidate list, the joint candidate may be removed from the second joint candidate list and the joint candidate derived based on the motion information of the block may be added to the second joint candidate list. When the number of combined candidates included in the second combined candidate list is equal to the maximum number of combined candidates, the combined candidate with the lowest index or the combined candidate with the highest index can be removed from the second combined candidate list and the combined candidate derived based on the block movement information can be added to the second combined candidate list. In other words, after removing the oldest combined candidate among the combined candidates included in the second combined candidate list, the combined candidate derived based on the block movement information can be added to the second combined candidate list. When the number of combined candidates included in the combined candidate list is not the maximum number of combined candidates, the combined combined candidates obtained by combining two or more combined candidates or the combined candidates having (0,0) motion vector (zero motion vector) can be included in the combined candidate list. Alternatively, a joint candidate average regarding the average of the motion vectors of two or more joint candidates may be added to the joint candidate list. The joint candidate average may be derived by regarding the average of the motion vectors of two or more joint candidates included in the joint candidate list. In the example, when a first joint candidate and a second joint candidate are added to the joint candidate list, the average of the motion vectors of the first joint candidate and the motion vector of the second joint candidate may be calculated to obtain the joint candidate average.In detail, the L0 motion vector of the average of the joint candidates can be derived by calculating the average of the L0 motion vector of the first joint candidate and the L0 motion vector of the second joint candidate, and the L1 motion vector of the average of the joint candidates can be derived by calculating the average of the L1 motion vector of the first joint candidate and the L1 motion vector of the second joint candidate. When bidirectional prediction is applied to one of the first joint candidate and the second joint candidate, and one-way prediction is performed on the other, the motion vector of the bidirectional joint candidate can be set as is to the L0 motion vector or L1 motion vector of the average of the joint candidates.In the example, when directional LO and directional L1 predictions are performed on the first joint candidate, but directional LO prediction is performed on the second joint candidate, the L0 motion vector of the average joint candidate can be derived by calculating the average of the L0 motion vector of the first joint candidate and the L0 motion vector of the second joint candidate. Meanwhile, the L1 motion vector of the average joint candidate can be derived as the L1 motion vector of the first joint candidate. When the reference image of the first merge candidate is different from the second merge candidate, the motion vector of the first merge candidate or the second merge candidate can be scaled according to the distance (hence, the POC difference) between the reference image of each merge candidate and the current image. For example, after scaling the motion vector of the second merge candidate, the average of the merge candidate can be derived by calculating the average of the motion vector of the first merge candidate and the scaled motion vector of the second merge candidate. Here, the priority can be set on the basis of the index value of the reference image of each merge candidate, the distance between the reference image of each merge candidate and the current block, or whether or not bidirectional prediction is applied, and the scaling can be applied to the motion vector of the merge candidate that has a high (or low) priority. A reference image index of a combined candidate average may be specified to indicate the reference image at a specific position in a list of reference images. In an example, the reference image index of a combined candidate average may represent the first or the last reference image in the list of reference images. Alternatively, the reference image index of a combined candidate average may be set to be identical to the reference image index of the first combined candidate or the second combined candidate. In the example, when the reference image index of the first combined candidate is identical to the second combined candidate, the reference image index of the combined candidate average may be set to be identical to the reference image index of the first combined candidate and the second combined candidate.When the reference image index of the first merge candidate is different from that of the second merge candidate, the priority can be set on the basis of the reference image index value of each merge candidate, the distance between the reference image of each merge candidate and the current block, or whether or not two-way prediction is applied, and the reference image index of the merge candidate with high (or low) priority can be set as the reference image index of the average merge candidate. In an example, when two-way prediction is applied to the first merge candidate, and one-way prediction is applied to the second merge candidate, the reference image index of the first merge candidate to which the two-way prediction is applied can be specified as the reference image index of the average merge candidate. Based on the priorities among the combinations of the candidate combinations, the order of combinations to produce the average candidate combinations can be determined. The priorities can be predefined in the encoder and decoder. Alternatively, the order of combinations can be determined based on whether bidirectional prediction of the candidate combinations is performed. For example, a combination of encoded joint candidates using bidirectional prediction may be assigned a higher priority than a combination of encoded joint candidates using unidirectional prediction. Alternatively, the order of the combinations may be determined based on the reference images of the joint candidates. For example, a combination of joint candidates that have the same reference image may have a higher priority than a combination of joint candidates that have different reference images. A merge candidate may be included in the merge candidate list according to a pre-defined priority. A high-priority merge candidate may be assigned a small index value. In the example, a spatial merge candidate may be added to the merge candidate list before a temporal merge candidate. In addition, spatial merge candidates may be added to the merge candidate list in the order of the adjacent left-block spatial merge candidate, the adjacent top-block spatial merge candidate, the block spatial merge candidate near the top-right corner, the block spatial merge candidate near the bottom-left corner, and the block spatial merge candidate near the top-left corner.Alternatively, it can be arranged so that spatial join candidates derived from adjacent blocks close to the top-left corner of the current block (B2 of FIGURE 11) are added to the join candidate list later than temporal join candidates. In another example, priority among merge candidates may be determined according to the size or shape of the current block. In the example, when the current block has a rectangular shape where the width is greater than the height, the adjacent left block spatial merge candidate may be added to the merge candidate list before the adjacent top block spatial merge candidate. On the other hand, when the current block has a rectangular shape where the height is greater than the width, the adjacent top block spatial merge candidate may be added to the merge candidate list before the adjacent left block spatial merge candidate. In another example, priorities among the joint candidates may be determined according to the motion information of each joint candidate. In the example, a joint candidate that has bidirectional motion information may have a higher priority than a joint candidate that has unidirectional motion information. Therefore, a joint candidate that has bidirectional motion information may be added to the joint candidate list before a joint candidate that has unidirectional motion information. In another example, a list of merge candidates may be generated that correspond to pre-defined priorities, and then the merge candidates may be reordered. The reordering may be performed based on the motion information of the merge candidates. In the example, the reordering may be performed based on whether or not the merge candidate has bidirectional motion information, the motion vector size, the motion vector precision, or the POC difference between the current image and the reference image of the merge candidate. Specifically, merge candidates that have bidirectional motion information may be reordered to have a higher priority than merge candidates that have unidirectional motion information. Alternatively, merge candidates that have motion vectors with fractional-pel precision values may be reordered to have a higher priority than merge candidates that have motion vectors with integer-pel precision. When a combined candidate list is generated, at least one of the combined candidates included in the combined candidate list can be determined based on the combined candidate index S1040. The current block motion information may be set to be identical to the motion information of a merge candidate specified by the merge candidate index S1050. In an example, when a spatial merge candidate is selected by the merge candidate index, the current block motion information may be set to be identical to the motion information of a spatially adjacent block. Alternatively, when a temporal merge candidate is selected by the merge candidate index, the current block motion information may be set to be identical to the motion information of a temporally adjacent block. FIGURE 14 is a diagram showing the process of deriving the current block movement information when AMVP mode is applied to the current block. When AMVP mode is applied to the current block, at least one of the inter-prediction directions of the current block, and the reference image index can be decoded from the S1410 bit stream. In other words, when AMVP mode is applied, at least one of the inter-prediction directions of the current block, and the reference image index can be determined based on the information encoded through the bit stream. A candidate spatial motion vector may be determined based on the motion vectors of the spatially adjacent blocks of the current block S1420. The candidate spatial motion vector may include at least one of the first candidate spatial motion vector derived from the adjacent top block of the current block, and the second candidate spatial motion vector derived from the adjacent left block of the current block. Here, the adjacent top block may include at least one of the blocks near the top and top-right corners of the current block, and the adjacent left block of the current block includes at least one of the blocks near the left and bottom-left corners of the current block. The block near the top-left corner of the current block may be used as the adjacent top block or may be used as the adjacent left block. Alternatively, candidate spatial motion vectors may be derived from non-adjacent spatial blocks that are not close to the current block. In the example, candidate spatial motion vectors of the current block may be derived using at least one of: blocks positioned on the same vertical row as blocks close to the top, top-right corner, or top-left corner of the current block; blocks positioned on the same horizontal row as blocks close to the left, bottom-left corner, or top-left corner of the current block; and blocks positioned on the same diagonal row as blocks close to the corners of the current block. When spatially contiguous blocks are not available, candidate spatial motion vectors may be derived using non-adjacent spatial blocks. In another example, at least two candidate spatial motion vectors can be derived using spatially adjacent blocks and spatially adjacent non-blocks. In the example, the first candidate spatial motion vector and the second candidate spatial motion vector can be derived using adjacent blocks that are close to the current block. Meanwhile, the third candidate spatial motion vector and / or the fourth candidate spatial motion vector can be derived based on blocks that are not close to the current block but close to the above adjacent blocks. When the current block differs in the reference image from its spatially adjacent blocks, the spatial motion vector can be obtained by scaling the motion vectors of the spatially adjacent blocks. The candidate temporal motion vectors can be determined based on the motion vectors of the temporally adjacent blocks of the current block S1430. When the current block differs in the reference image from its temporally adjacent blocks, the temporal motion vector can be obtained by scaling the motion vectors of the temporally adjacent blocks. Here, when the number of candidate spatial motion vectors is equal to or less than a predetermined number, the candidate temporal motion vectors can be derived. A list of candidate motion vectors including candidate spatial motion vectors and candidate temporal motion vectors can be generated S1440. When a list of candidate motion vectors is generated, at least one of the candidate motion vectors included in the candidate motion vector list may be determined based on information specifying at least one of the candidate motion vectors S1450. The candidate motion vector determined by the information can be set as the predicted value of the motion vector of the current block, and the motion vector of the current block can be obtained by adding the residual value of the motion vector to the predicted value of the S1460 motion vector. Here, the residual value of the motion vector can be decomposed through the bit stream. When the motion information of the current block is obtained, motion compensation for the current block can be performed based on the motion information obtained by the S920. In detail, motion compensation for the current block can be performed based on the inter-prediction direction, the reference image index, and the motion vector of the current block. The inter-prediction direction represents whether L0-prediction, L1-prediction, or bi-prediction is performed. When the current block is encoded by bi-prediction, the prediction block of the current block can be obtained based on the imbalance sum operation or the average operation of the L0 reference block and the L1 reference block. When prediction samples are obtained by performing motion compensation, the current block can be reconstructed based on the resulting prediction samples. In detail, the reconstructed sample can be obtained by adding the prediction samples from the current block and the residual samples. As in the example described above, based on the motion information of the encode / decode blocks using inter-prediction before the current block, a candidate joint of the current block can be derived. For example, based on the motion information of adjacent blocks at pre-determined positions close to the current block, a candidate joint of the current block can be derived. Examples of adjacent blocks can include at least one of a block close to the left side of the current block, a block close to the top of the current block, a block close to the upper left corner of the current block, a block close to the upper right corner of the current block, and a block close to the lower left corner of the current block. A merge candidate of the current block can be derived based on the motion information of blocks other than the neighboring blocks. For ease of description, the neighboring block at a pre-defined position close to the current block is referred to as the first merge candidate block, and the block at a position different from the first merge candidate block is referred to as the second merge candidate block. The second merge candidate block may include at least one of a block encoded / decoded using inter-prediction before the current block, a block adjacent to the first merge candidate block, or a block positioned on the same row as the first merge candidate block. FIGURE 15 shows a second merge candidate block adjacent to the first merge candidate block, and FIGURE 16 shows a second merge candidate block positioned on the same row as the first merge candidate block. When the first merge candidate block is not available, a merge candidate derived based on motion information from the second merge candidate block is added to the merge candidate list. Alternatively, even if at least one of the spatial merge candidates and the temporal merge candidate is added to the merge candidate list, when the number of merge candidates included in the merge candidate list is smaller than the maximum number of merge candidates, a merge candidate derived based on motion information from the second merge candidate block is added to the merge candidate list. FIGURE 15 is a diagram illustrating an example of deriving a merge candidate from a second merge candidate block when the first merge candidate block is not available. When the first merge candidate block AN (here, N ranges from 0 to 4) is unavailable, the merge candidate of the current block is derived based on the motion information of the second merge candidate block BM (here, M ranges from 0 to 6). Then, the merge candidate of the current block can be derived by replacing the unavailable first merge candidate block with the second merge candidate block. Among the blocks adjacent to the first merge candidate block, blocks placed in a predetermined direction of the first merge candidate block may be arranged like the second merge candidate block. The predetermined direction may be a left direction, a right direction, an upward direction, a downward direction, or a diagonal direction. The predetermined direction may be set for each of the first merge candidate blocks. For example, the predetermined direction of the first merge candidate block adjacent to the left side of the current block may be a left direction. The predetermined direction of the first merge candidate block adjacent to the top of the current block may be an upward direction. The predetermined direction of the first merge candidate block adjacent to the corner of the current block may include at least one of a left direction, an upward direction, or a diagonal direction. For example, when A0 which is close to the left side of the current block is not available, the merge candidate of the current block is derived based on B0 which is close to A1. When A1 which is close to the top of the current block is not available, the merge candidate of the current block is derived based on B1 which is close to A1. When A2 which is close to the upper right corner of the current block is not available, the merge candidate of the current block is derived based on B2 which is close to A2. When A3 which is close to the lower left corner of the current block is not available, the merge candidate of the current block is derived based on B3 which is close to A3. When A4 which is close to the upper left corner of the current block is not available, the merge candidate of the current block is derived based on at least one of B4 to B6 which are close to A4. The example shown in FIGURE 15 is for illustrating embodiments of the present invention only, and is not limiting. The position of the second combined candidate block may be arranged differently from the sample shown in FIGURE 15. For example, the second combined candidate block adjacent to the first combined candidate block adjacent to the left side of the current block may be positioned in an upward direction or a downward direction from the first combined candidate block. Alternatively, the second combined candidate block adjacent to the first combined candidate block adjacent to the top of the current block may be positioned in a left direction or a right direction from the first combined candidate block. FIGURE 16 is a diagram showing an example of deriving a merge candidate from a second merge candidate block positioned on the same row as the first merge candidate block. A block positioned on the same row as the first merge candidate block may include at least one of a block positioned on the same horizontal row as the first merge candidate block, a block positioned on the same vertical row as the first merge candidate block or a block positioned on the same diagonal row as the first merge candidate block. The y-coordinate positions of the blocks positioned on the same horizontal row are the same. The x-coordinate positions of the blocks positioned on the same vertical row are the same. The difference in values between the x-coordinate positions of the blocks positioned on the same diagonal row is the same as the difference in values between the y-coordinate positions. It is assumed that the top-left sample of the current block is positioned at (0,0) and the width and height of the current block are W and H, respectively. In figure 18, it is shown that the position of the second merge candidate block (e.g., B4, C6) positioned on the same vertical row as the first merge candidate block is determined based on the rightmost block in the upper block of the encoder (e.g., block A1 which includes coordinates (W-1, -1)). In addition, in figure 18, it is shown that the position of the second merge candidate block (e.g., B1, C1) positioned on the same horizontal row as the first merge candidate block is determined based on the lowest block in the left block of the encoder (e.g., block A0 which includes coordinates (-1, H-1)). In another example, the position of the second merge candidate block may be determined based on the leftmost block in the top block of the encoder (e.g., the block including coordinates (0, -1)) or the block positioned at the top center of the encoder block (e.g., the block including coordinates (W / 2, -1)). Alternatively, the position of the second merge candidate block may be determined based on the topmost block in the left block of the encoder (e.g., the block including coordinates (-1, 0)) or the block positioned at the left center of the encoder block (e.g., the block including coordinates (-1, H / 2)). In another example, when there are a plurality of adjacent top-block blocks that are close to the top of the current block, a second merge candidate block may be determined by using all or some of the plurality of adjacent top-block blocks. In the example, the second merge candidate block may be determined by using blocks at specific positions (e.g., at least one of the adjacent top-blocks positioned on the leftmost side, the adjacent top-blocks positioned on the rightmost side or the adjacent top-blocks positioned in the center) among the plurality of adjacent top-block blocks. The number of adjacent top-blocks used to determine the second merge candidate block among the plurality of adjacent top-block blocks may be 1, 2, 3 or more.Additionally, when there are a plurality of adjacent left blocks close to the left side of the current block, a second merge candidate block may be determined by using all or some of the plurality of adjacent left blocks. In an example, a second merge candidate block may be determined by using blocks at specific positions (e.g., at least one of the adjacent left blocks positioned at the bottommost side, the adjacent left blocks positioned at the topmost side, or the adjacent left blocks positioned at the center) among the plurality of adjacent left blocks. The number of adjacent left blocks used to determine the second merge candidate block among the plurality of adjacent left blocks may be 1, 2, 3, or more. According to the size and / or shape of the current block, the position and / or number of adjacent top blocks and / or adjacent left blocks used to determine the second merge candidate block may be determined differently. In the example, when the size of the current block is larger than the threshold value, the second merge candidate block may be determined based on the top middle block and / or the middle left block. On the other hand, when the size of the current block is smaller than the threshold value, the second merge candidate block may be determined based on the top rightmost block and / or the bottom leftmost block. The threshold value may be an integer such as 8, 16, 32, 64 or 128. A first combined candidate list and a second combined candidate list may be constructed and movement compensation of the current block may be performed based on at least one of the first combined candidate list or the second combined candidate list. The first merge candidate list may include at least one of spatial merge candidates derived based on motion information of adjacent blocks at pre-determined positions close to the current block, or temporal merge candidates derived based on motion information of co-located blocks. The second combined candidate list may include combined candidates derived based on the movement information of the second combined candidate block. As an embodiment of the present invention, a first combined candidate list may be constructed that includes combined candidates derived from the first combined candidate block, and a second combined candidate list may be constructed that includes combined candidates derived from the second combined candidate block. In an example, in the example shown in FIGURE 15, combined candidates derived from blocks A0 to A4 may be added to the first combined candidate list, and combined candidates derived from blocks B0 to B6 may be added to the second combined candidate list. In an example, shown in FIGURE 16, combined candidates derived from blocks A0 to A4 may be added to the first combined candidate list and combined candidates derived from blocks B0 to B5, C0 to C7 may be added to the second combined candidate list. Alternatively, the second combined candidate list may include combined candidates derived based on block motion information encoded / decoded using inter-prediction before the current block. For example, when motion compensation for a block for which inter-prediction encoding mode is performed, combined candidates derived based on block motion information are added to the second combined candidate list. When encoding / decoding of the current block is completed, the current block motion information is added to the second combined candidate list for inter-prediction of the next block. The index of the merged candidates included in the second merged candidate list may be determined based on the order in which the merged candidates are added to the second merged candidate list. For example, the index assigned to the Nth merged candidate added to the second merged candidate list may have a lower value than the index assigned to the N+1st merged candidate added to the second merged candidate list. For example, the index of the N+1st merged candidate may be set to have a higher value by one than the index of the Nth merged candidate. Alternatively, the index of the Nth merged candidate may be set to be the index of the N+1st merged candidate, and the value of the index of the Nth merged candidate reduced by one. Alternatively, the index assigned to the Nth merge candidate added to the second merge candidate list may have a higher value than the index assigned to the N+1st merge candidate added to the second merge candidate list. For example, the index of the Nth merge candidate may be set to the index of the N+1st merge candidate, and the value of the index of the reduced Nth merge candidate increased by one. Based on whether the motion information of the block subject to motion compensation is the same as the motion information of a joint candidate included in the second joint candidate list, it can be determined whether to add the joint candidate derived from the block to the second joint candidate list. For example, when a joint candidate having the same motion information as the block is included in the second joint candidate list, the joint candidate derived based on the motion information of the block is not added to the second joint candidate list. Alternatively, when a joint candidate having the same motion information as the block is included in the second joint candidate list, the joint candidate is removed from the second joint candidate list and the joint candidate derived based on the motion information of the block is added to the second joint candidate list. When the number of joint candidates included in the second joint candidate list is equal to the maximum number of joint candidates, the joint candidate having the lowest index or the joint candidate having the highest index is detected from the second joint candidate list and the joint candidate derived based on the block movement information is added to the second joint candidate list. Then, after deleting the oldest joint candidate among the joint candidates included in the second joint candidate list, the joint candidate derived based on the block movement information can be added to the second joint candidate list. The second merge candidate list can begin in a CTU, tile, or slice unit. In other words, blocks belonging to a different CTU, tile, or slice than the current block can be set to be unavailable as second merge candidate blocks. The maximum number of merge candidates that can be included in the second merge candidate list can be predefined in the encoder and decoder. Alternatively, information representing the maximum number of merge candidates that can be included in the second merge candidate list can be signaled via a bit stream. Either the first combined candidate list or the second combined candidate list can be selected and the inter-prediction of the current block can be performed using the selected combined candidate list. Specifically, on the basis of the information index, one of the combined candidates included in the combined candidate list can be selected and the current block's movement information can be obtained from the combined candidate. Information specifying either the first combined candidate list or the second combined candidate list can be signaled through the bit stream. The decoder can select either the first combined candidate list or the second combined candidate list based on the information. Alternatively, between the first combined candidate list and the second combined candidate list, a combined candidate list that includes the larger number of selectable combined candidates is available. Alternatively, either the first combined candidate list or the second combined candidate list may be selected on the basis of at least one of the size, shape, and partition depth of the current block. Alternatively, a combined candidate list is configured by adding (or attaching) another to either the first combined candidate list and the second combined candidate list. For example, inter-prediction can be performed based on a combined candidate list that includes at least one combined candidate included in the first combined candidate list, and at least one combined candidate included in the second combined candidate list. For example, a combined candidate included in the second combined candidate list can be added to the first combined candidate list. Alternatively, a combined candidate included in the first combined candidate list can be added to the second combined candidate list. When the number of merged candidates included in the first merged candidate list is smaller than the maximum number, or when the first merged candidate block is not available, the merged candidates included in the second merged candidate list are added to the first merged candidate list. Alternatively, when the first merge candidate block is unavailable, a merge candidate derived from a block close to the first merge candidate block among the merge candidates included in the second merge candidate list is added to the first merge candidate list. Referring to FIGURE 15, when A0 is unavailable, a merge candidate derived based on the motion information of B0 among the merge candidates included in the second merge candidate list is added to the first merge candidate list. When A1 is unavailable, a merge candidate derived based on the motion information of B1 among the merge candidates included in the second merge candidate list is added to the first merge candidate list. When A2 is unavailable, a merge candidate derived based on the motion information of B2 among the merge candidates included in the second merge candidate list is added to the first merge candidate list.When A3 is not available, a combined candidate derived based on the motion information of B3 among the combined candidates included in the second combined candidate list is added to the first combined candidate list. When A4 is not available, a combined candidate derived based on the motion information of B4, B5, or B6 among the combined candidates included in the second combined candidate list is added to the first combined candidate list. Alternatively, the merged candidates to be added to the first merged candidate list may be determined according to the priority of the merged candidates included in the second merged candidate list. The priority may be determined based on the value index assigned to each merged candidate. For example, when the number of merged candidates included in the first merged candidate list is less than the maximum number, or when the first merged candidate block is not available, the merged candidate having the smallest value index or the merged candidate having the largest value index among the merged candidates included in the second merged candidate list is added to the first merged candidate list. When a joint candidate having the same movement information as the joint candidate with the highest priority among the joint candidates included in the second joint candidate list is included in the first joint candidate list, the joint candidate with the highest priority may not be added to the first joint candidate list. In addition, whether a joint candidate with a later priority (for example, a joint candidate for which a value index greater than the value index given for the joint candidate with the highest priority 1 is given or a joint candidate for which a value index smaller than the value index given for the joint candidate with the highest priority 1 is given) may be added to the first joint candidate list can be determined. Alternatively, a combined candidate list that includes combined candidates derived based on motion information from the first combined candidate block, and combined candidates derived based on motion information from the second combined candidate block can be generated. The combined candidate list can be a combination of the first combined candidate list and the second combined candidate list. For example, according to a predetermined search order, a list of merged candidates can be generated by searching for the first merged candidate block and the second merged candidate block. FIGURES 17 through 20 are diagrams illustrating the search sequence for a combined candidate block. FIGURES 17 to 20 show the search sequence for the combined candidates as follows. A0 ^> A1 ^> A2 ^> A3 ^- A4 ^> B0 ^> B1 ^- B2 ^> B3 ^> B4 ^- (B5) ^> (B6) Only when block B4 is not available or when the number of combined candidates included in the combined candidate list is equal to or less than the pre-set number, the search for blocks B5 and B6 takes place. A different search order from the examples shown in FIGURES 17 to 20 can be set. A combined candidate list including at least one combined candidate included in a first combined candidate list, and at least one combined candidate included in a second combined candidate list may be generated. For example, the combined candidate list may include N of combined candidates included in the first combined candidate list, and M of combined candidates included in the second combined candidate list. The letters N and M may indicate the same number or different numbers. Alternatively, at least one of N and M may be determined on the basis of at least one of the number of combined candidates included in the first combined candidate list and the number of combined candidates included in the second combined candidate list. Alternatively, information for determining at least one of N and M may be signaled via a bit stream.Either of N and M can be derived by subtracting the other from the maximum number of combined candidates in the combined candidate list. The merged candidates to be added to the combined merged candidate list can be determined according to a pre-defined priority. The pre-defined priority can be determined on the basis of the indexes assigned to the merged candidates. Alternatively, the combined candidates to be added to the combined candidate list can be determined based on the relationships between the combined candidates. For example, when A0, which is included in the first combined candidate list, is added to the combined candidate list, the combined candidates (e.g., B0) at positions close to A0 are not added to the combined candidate list. When the number of combined candidates included in the first combined candidate list is smaller than N, more than M combined candidates among the combined candidates included in the second combined candidate list are added to the combined combined candidate list. For example, when N is four and M is two, four of the combined candidates included in the first combined candidate list are added to the combined combined candidate list, and two of the combined candidates included in the second combined candidate list are added to the combined combined candidate list. When the number of combined candidates included in the first combined candidate list is smaller than four, two or more combined candidates among the combined candidates included in the second combined candidate list are added to the combined combined candidate list.When the number of combined candidates included in the second combined candidate list is less than two, four or more of the combined candidates included in the first combined candidate list are added to the combined combined candidate list. Therefore, the value of N or M can be adjusted according to the number of combined candidates included in each combined candidate list. By adjusting the value of N or M, the total number of combined candidates included in the combined combined candidate list can be determined. When the total number of combined candidates included in the combined combined candidate list is less than the maximum number of combined candidates, a combined combined candidate, an average of the combined candidates, or a zero candidate motion vector is added. Motion compensation of the current block may be performed using at least one of the merge candidates included in the first merge candidate list and the second merge candidate list. An encoder may encode an information index for the specification of one of a plurality of merge candidates. In the example, 'merge_idx' may specify one of a plurality of merge candidates. In the example, Table 1 represents the merge index of each merge candidate derived from the first merge candidate block and the second merge candidate block shown in FIGURE 16. Table 1 Merge candidate Merge index (merge_idx) A1 0 A2 1 A3 2 A4 3 B1 4 B2 5 B3 6 B4 7 B5 8 C1 9 C2 10 C3 11 C4 12 C5 13 C6 14 C7 15 However, as the number of combined candidates included in the combined candidate list increases, the codeword for encoding the combined index becomes longer. Therefore, the problem of reduced encoding / decoding efficiency arises. To reduce the codeword length, a combined index of 10 can be defined using prefixes and suffixes. In the example, the merge index can be defined by using merge_idx_prefix which represents the prefix of the merge index and merge_idx_suffix which represents the suffix of the merge index. Table 2 represents the combined index prefix values and combined index suffix values for each combined index and Table 3 represents the process that determines the combined index based on the combined index prefix values and combined index suffix values. Table 2 Merge candidate Merge index (merge_idx) Merge prefix index Merge index Suffix A1 0 0 - A2 1 1 - A3 2 2 - A4 3 3 - B1 4 4 0 B2 5 4 1 B3 6 4 2 B4 7 4 3 B5 8 4 4 C1 9 5 0 C2 10 5 1 C3 11 5 2 C4 12 5 3 C5 13 5 4 Table 3 if merge_idx_prefix < 4 ____merge idx = merge idx prefix_____________________________ or merge idx = (merge idx prefix-3) << 2 + merge idx suffix As shown in Tables 2 and 3, when the prefix value of the combined index is less than the threshold value, the combined index can be set to be the same as the prefix value of the combined index. On the other hand, when the prefix value of the combined index is greater than the threshold value, the combined index can be determined by subtracting the base value from the combined prefix index and adding the combined suffix index to the value that shifts the result. The base value can be the threshold value or the value obtained by subtracting 1 from the threshold value. Tables 2 and 3 show that the threshold value is 4. The threshold value can be determined based on at least one of the number of merge candidates included in the merge candidate list, the number of blocks of the second merge candidate or the number of rows in which the second merge candidate block is included. Alternatively, the threshold value can be predefined in the encoder and decoder. Whether the prefix and suffix used to determine the combined index can be determined according to the number of combined candidates included in the combined candidate list or the maximum number of combined candidates that can be included in the combined candidate list. In the example, when the maximum number of combined candidates that can be included in the combined candidate list is greater than a threshold value, the combined prefix index and the combined suffix index used to determine the combined index can be signaled. On the other hand, when the maximum number of combined candidates is less than a threshold value, the combined index can be signaled. A rectangular block can be partitioned into a number of triangular blocks. The merge candidates of a triangular block can be derived based on the rectangular blocks that include the triangular block. The triangular blocks can share the same merge candidates. A merge index can be signaled for each triangle block. In this case, the triangle blocks can be configured not to use the same merge candidate. In the example, the merge candidate used for the first triangle block may not be the one used as the merge candidate for the second triangle block. Therefore, the merge index of the second triangle block can determine any of the remaining merge candidates unless a merge candidate is selected for the first triangle block. A merge candidate can be derived based on blocks that have a predetermined shape or a predetermined size or larger. When the current block is not in a predetermined shape, or when the size of the current block is smaller than the predetermined size, the merge candidate of the current block is derived based on blocks that include the current block and are in the predetermined shape or in the predetermined size or larger. The predetermined shape can be a square or a non-square shape. When the predefined shape is a square, the combined candidate for coding units in non-square shapes is derived based on coding units in square shapes that include coding units in non-square shapes. FIGURE 21 is a diagram illustrating an example where the candidate union of non-square blocks is derived based on the square blocks. A candidate union of non-square blocks can be derived based on the square blocks that include the non-square blocks. For example, a candidate union of coding block 0 in non-square shape and coding block 1 in non-square shape can be derived based on the blocks in square shape that include coding block 0 and coding block 1. Therefore, the position of adjacent spatial blocks can be determined based on the position, width / height, or size of the blocks in square shape. A candidate union of coding block 0 and coding block 1 can be derived based on at least one of the adjacent spatial blocks (Ao), A1, A2, A3, and A4 that are close to the block in square shape. A temporal merge candidate can be defined at the base of the block in a square. Then, adjacent temporal blocks can be defined based on the position, width / height, or size of the block in a square. For example, a merge candidate of encoding block 0 and encoding block 1 can be derived based on adjacent temporal blocks defined at the base of the block in a square. Alternatively, one of the spatial join candidates and the temporal join candidate can be derived based on square blocks, and the other join candidate can be derived based on non-square blocks. For example, the spatial join candidate of coding block 0 can be derived based on square blocks, while the temporal join candidate of coding block 0 can be derived based on coding block 0. Multiple blocks belonging to a block of a predetermined shape or a predetermined size or larger can share a merge candidate. For example, in the example shown in FIGURE 21, at least one of the spatial merge candidates and the temporal merge candidates of coding block 0 and coding block 1 can be the same. The predefined shape can be a non-square shape, such as 2NxN, Nx2N, or the like. When the predefined shape is a non-square shape, the merge candidate of the current block can be derived based on the non-square blocks that belong to the current block. For example, when the current block is in the shape of 2NxN (here, n is 1 / 2N), the merge candidate of the current block is derived based on the non-square blocks in the shape of 2NxN. Alternatively, when the current block is in the shape of Nx2N, the merge candidate of the current block is derived based on the non-square blocks in the shape of Nx2N. Information indicating a predetermined shape or a predetermined size can be signaled through a bit stream. For example, information indicating either a non-square or a square shape can be signaled through a bit stream. Alternatively, pre-defined shapes or pre-defined sizes can be specified that conform to pre-defined rules in the encoder and decoder. When a child node does not satisfy a pre-defined condition, a candidate merge of the child node is derived based on the parent node satisfying the pre-defined condition. Here, the pre-defined condition may include at least one of whether the block is a block generated as a result of quad tree partitioning, whether exceeding the block size, block shape, and constraint drawing takes place, and whether the depth difference between the child node and the parent node is equal to or greater than a pre-defined value. For example, pre-defined conditions may include whether the block is a block generated as a result of quad tree partitioning, and whether the block is a square-shaped encoding block of a pre-defined size or larger. When the current block is generated by binary tree partitioning or triple tree partitioning, the merge candidate of the current block is derived based on the high-level node blocks that belong to the current block and satisfy the pre-defined conditions. When no high-level node blocks satisfy the pre-defined conditions, the merge candidate of the current block is derived based on the current block, blocks that belong to the current block and are of a pre-defined size or larger, or high-level node blocks that belong to the current block and have a depth difference from the current block. FIGURE 22 is a diagram illustrating an example of deriving merge candidates based on high-level node blocks. A block 0 and a block 1 are generated by partitioning the square blocks based on a binary tree. The merge candidates of block 0 and block 1 can be derived based on their adjacent blocks (hence, at least one among A0, A1, A2, A3, and A4) which are determined based on the high-level node blocks that belong to block 0 and block 1. As this result, block 0 and block 1 can share the same spatial merge candidates. A high-level node block including block 2 and block 3, and block 4 can be generated by partitioning the square blocks based on a binary tree. In addition, block 2 and block 3 can be generated by partitioning the blocks in a non-square form based on a binary tree. The merge candidates of block 2, block 3, and block 4 in a non-square form can be derived based on the high-level node blocks that include them. Then, the merge candidates can be derived based on the adjacent blocks (e.g., at least one among B0, B1, B2, B3, and B4) determined by the position, width / height, or size of the square blocks that include block 2, block 3, and block 4. As a result, block 2, block 3, and block 4 can use the same merge candidate spatially. A temporal join candidate for a block in a non-square shape can be derived based on the high-level node blocks. For example, the temporal join candidates for block 0 and block 1 can be derived based on the square blocks that include block 0 and block 1. The temporal join candidates for block 2, block 3, and block 4 can be derived based on the square blocks that include block 2, block 3, and block 4. In addition, the same temporal join candidates derived from adjacent temporal blocks determined based on per-block quad trees can be used. A low-level node block that belongs to a high-level node block can share at least one of its spatial join candidates and one of its temporal join candidates. For example, a low-level node block that belongs to a high-level node block can share the same list of join candidates. Alternatively, at least one of the spatial join candidates and the temporal join candidates may be derived based on the low-level node block, and the other may be derived based on the high-level node block. For example, the spatial join candidates for block 0 and block 1 may be derived based on the high-level node block. However, the temporal join candidate for block 0 may be derived based on block 0, and the temporal join candidate for block 1 may be derived based on block 1. Alternatively, when the number of samples that a low-level node block includes is smaller than a predefined number, merge candidates are derived based on high-level node blocks that include the predefined number or more samples.For example, when at least one of the following conditions is met: the case where at least one of the low-level node blocks generated on the basis of at least one among the quad tree partition, binary tree partition, and triple tree partition is smaller than a pre-defined size; the case where at least one of the low-level node blocks is not a square block; the case where the high-level node block does not exceed the bounding image; and the case where the width or height of the high-level node block is equal to or greater than a pre-defined value, a merge candidate is derived based on the high-level node blocks in square or non-square shape that include a pre-defined number of more samples (for example, 64, 128, or 256 samples). The low-level node blocks included in the high-level node block can share the merge candidate derived based on the high-level node block. A merge candidate may be derived based on one of the low-level node blocks, and another low-level node block may be specified to use the merge candidate. The low-level node block may include blocks of a predetermined shape or a predetermined size or larger. For example, the low-level node block may divide the list of merge candidates derived based on one of the low-level node blocks. Information for the low-level node block that is the underlying derivation of the merge candidate may be signaled via a bit stream. The information may be an index of information indicating one of the low-level node blocks. Alternatively, the low-level node block that is the underlying derivation of the merge candidate may be determined on the basis of at least one of the position, size, shape, and scan order of the low-level node block. Information indicating whether a low-level node block shares a merge candidate list derived based on a high-level node block can be signaled via a bit stream. Based on the information, it can be determined whether a merge candidate block is not in a predetermined form or a block in a size smaller than a predetermined size is derived based on a high-level node block that includes the block. Alternatively, according to predetermined rules in the encoder and decoder, it can be determined whether a merge candidate is derived based on a high-level node block. When adjacent blocks close to the current block are within a predefined region, it is determined that the adjacent blocks are unavailable as spatial join candidates. The predefined region can be a parallel-processing region designated for parallel processing between blocks. The parallel-processing region can be referred to as a merge estimation region (MER). For example, when adjacent blocks close to the current block are within the same merge estimation region as the current block, it is determined that the adjacent blocks are unavailable. A shear operation can be performed to determine whether the current block and the adjacent blocks are within the same merge estimation region.Specifically, on the basis of whether the value obtained by shifting the upper left position of the reference sample of the current block is the same as the value obtained by shifting the upper left position of the reference sample of the adjacent block, it can be determined whether the current block and the adjacent block belong to the same joint estimation region. FIGURE 23 is a diagram illustrating an example of determining the availability of contiguous spatial blocks based on the combined estimated area. In FIGURE 23, it is shown that the combined estimation region is in the form Nx2N. A candidate for a block 1 merge can be derived based on adjacent spatial blocks close to block 1. The adjacent spatial blocks can include B0, B1, B2, B3, and B4. Here, it can be determined that the adjacent spatial blocks (B0) and B3 that belong to the same merge estimation area as block 1 are not available as merge candidates. Therefore, the candidate for a block 1 merge can be derived from at least one of the adjacent spatial blocks B1, B2, and B4 except the adjacent spatial blocks (B0) and B3. A candidate merge block 3 can be derived based on adjacent spatial blocks close to block 3. The adjacent spatial blocks can include C0, C1, C2, C3, and C4. Here, it can be determined that the adjacent spatial block C0 which belongs to the same merge estimation area as block 3 is not available as a merge candidate. Therefore, the candidate merge block 3 can be derived from at least one of the adjacent spatial blocks C1, C2, C3, and C4 except the adjacent spatial block C0. Based on at least one of the position, size, width, and height of the joint estimation region, a joint candidate of blocks included in the joint estimation region may be derived. For example, a joint candidate of multiple blocks included in the joint estimation region may be derived from at least one of adjacent spatial blocks and adjacent temporal blocks determined on the basis of at least one of the position, size, width, and height of the joint estimation region. Blocks included in the joint estimation region may share the same joint candidate. FIGURE 24 is a diagram illustrating an example where a combined candidate is derived based on the combined estimation region. When the compound coding units are included in the joint estimation region, the compound coding unit compound candidates can be derived based on the joint estimation region. Thus, by using the joint estimation region as coding units, the compound candidates can be derived based on the position, size, or width / height of the joint estimation region. For example, the joint candidates of coding unit 0 (CU0) and coding unit 1(CU1) both in (n / 2)xN (here, n is N / 2) size and which fall within the joint estimation region in size (N / 2)xN can be derived based on the joint estimation region. Thus, the joint candidates of coding unit 0 and coding unit 1 can be derived from at least one of the adjacent blocks C0, C1, C2, C3, and C4 which are close to the joint estimation region. For example, the candidate combinations of coding unit 2 (CU2), coding unit 3 (CU3), coding unit 4 (CU4), and coding unit 5 (CU5) in size nxn that fall within the joint estimation region in size NxN can be derived based on the joint estimation region. Thus, the candidate combinations of coding unit 2, coding unit 3, coding unit 4, and coding unit 5 can be derived from at least one of the adjacent blocks C0, C1, C2, C3, and C4 that are close to the joint estimation region. The shape of the joint estimation region can be rectangular or non-square. For example, it can be specified that a coding unit (or prediction unit) in rectangular shape or a coding unit (or prediction unit) in non-square shape is the joint estimation region. The ratio between the width and height of the joint estimation region can be limited to not exceed a predetermined range. For example, the joint estimation region cannot have a non-square shape where the ratio between the width and height exceeds two, or a non-square shape where the ratio between the width and height is less than 1 / 2. Thus, the non-square joint estimation region can be of the shape 2NxN or Nx2N. Information regarding the limit on the ratio between the width and height can be signaled via the bit stream. Alternatively, the limit on the ratio between the width and height can be predetermined in the encoder and decoder. At least one of the information indicating the shape of the combined estimation region, and the information indicating the size of the combined estimation region may be signaled via a bit stream. For example, at least one of the information indicating the shape of the combined estimation region, and the information indicating the size of the combined estimation region may be signaled via a slice head, a group of tile heads, an image parameter, or a sequence parameter. The shape of the joint estimation region or the size of the joint estimation region can be updated on a per-sequence basis, on a per-image basis, on a per-slice basis, on a per-tile group basis, on a per-tile basis, or on a per-block (CTU) basis. When the shape of the joint estimation region or the size of the joint estimation region differs from the previous unit, information indicating the new shape of the joint estimation region or the new size of the joint estimation region is signaled through the bit stream. At least one block may be included in the combined estimation region. The blocks included in the combined estimation region may be rectangular or non-rectangular. A maximum or minimum number of blocks that the combined estimation region may include may be specified. For example, three, four, or more CUs may be included in the combined estimation region. The determination may be based on information signaled through the bit stream. Alternatively, the maximum or minimum number of blocks that the combined estimation region may include may be predefined in the encoder and decoder. In at least one of the cases where the number of blocks included in the combined estimation region is less than the maximum number, and the case where the number is greater than the minimum number, block parallel processing may be possible. For example, when the number of blocks included in the combined estimation region is equal to or less than the maximum number, or when the number of blocks included in the combined estimation region is equal to or greater than the minimum number, block combined candidates are derived based on the combined estimation region. When the number of blocks included in the combined estimation region is greater than the maximum number, or when the number of blocks included in the combined estimation region is less than the minimum value, block combined candidates are derived based on the size, position, width, or height of each block. Information indicating the shape of the joint estimation region can include a one-bit flag. For example, the syntax isrectagular_mer_flag can indicate that the candidate joint region is rectangular or non-rectangular. An isrectagular_mer_flag value of one can indicate that the joint estimation region is non-rectangular, and an isrectagular_mer_flag value of zero can indicate that the joint estimation region is rectangular. When information indicates that the combined estimation region is non-rectangular, information indicating at least one of the width, height, and ratio between the width and height of the combined estimation region is signaled via the bit stream. Based on this, the size and / or shape of the combined estimation region can be determined. Applications of the embodiments described focus on a decoding process or an encoding process for an encoding process or a decoding process included within the scope of the present invention. Changing the embodiments described in a predetermined sequence to a different sequence is also included within the scope of the present invention. Although the embodiments described above have been described in terms of a series of steps or flowcharts, this is not intended to limit the sequence of inventive time-series, and they may be performed simultaneously or in a different order. In addition, the individual components (e.g., units, modules, etc.) that constitute the block diagram in the embodiments described above may be implemented as hardware or software devices, and a plurality of components may be combined into a single hardware or software device. The embodiments described above may be implemented in the form of program instructions that may be executed by various computer components and recorded in a computer-readable medium. The computer-readable storage medium may include program instructions, data files, data structures, and the like either singly or in combination thereof.Examples of computer-readable storage media include magnetic recording media such as hard disks, floppy disks, and magnetic tape; optical data storage media such as CD-ROMs or DVD-ROMs; magneto-optical media such as floptical disks; and hardware devices, such as read-only memory (ROM), random access memory (RAM), and flash memory, which are particularly structured for storing and implementing program instructions. The hardware devices may be configured to be operated by one or more software modules or otherwise to perform processes in accordance with the present invention. Application capabilities in industry This invention can be applied to electronic devices capable of encoding / decoding images.
Claims
1. A video decoding method, the method comprising: deriving joint candidates from adjacent blocks close to the current block; generating a first joint candidate list including joint candidates, wherein when a number of joint candidates included in the first joint candidate list is smaller than a predetermined value, joint candidates included in the second joint candidate list are added to the first joint candidate list; decoding information for the specification of one of the joint candidates included in the first joint candidate list; and deriving motion information of the current block from the joint candidates for which an index determined by the information is given.
2. The method of claim 1, wherein the information includes an index prefix and an index suffix.
3. The method of claim 2, wherein when the value of the index prefix is less than the threshold value, the index is set to be the same as the index prefix.
4. The method of claim 3, wherein when the value of the index prefix is greater than a threshold value, the index is derived by adding the value of the index suffix to the value derived based on the index prefix.
5. The method of claim 3, wherein the threshold value is determined based on the number of combined candidates included in the first combined candidate list.
6. The method of claim 1, wherein the second combined candidate list includes combined candidates derived from blocks that are not adjacent to the current block.
7. The method of claim 6, wherein the non-adjacent blocks are on the same row as the blocks adjacent to the current block.
8. A method of encoding video, the method comprising: deriving a merge candidate from adjacent blocks that are close to the current block; generating a first merge candidate list that includes the merge candidates, wherein when a number of merge candidates included in the first merge candidate list is smaller than a predetermined value, the merge candidates included in the second merge candidate list are added to the first merge candidate list; encoding information for the specification of one of the merge candidates included in the first merge candidate list; and deriving motion information of the current block from the merge candidate for which an index determined by the information is given.
9. The method of claim 8, wherein the information includes an index prefix and an index suffix.
10. The method of claim 9, wherein when the value of the index prefix is less than the threshold value, the index is set to be the same as the index prefix.
11. The method of claim 10, wherein when the value of the index prefix is greater than a threshold value, the index is derived by adding the index suffix value to the value derived based on the index prefix.
12. The method of claim 10, wherein the threshold value is determined based on the number of combined candidates included in the first combined candidate list.
13. The method of claim 8, wherein the second combined candidate list includes combined candidates derived from blocks that are not adjacent to the current block.
14. The method of claim 13, wherein the non-adjacent blocks are on the same row as the blocks adjacent to the current block.
15. An image decoding device, the device comprising: a decoding device that decodes information specifying one of the joint candidates included in a first joint candidate list; and an inter-prediction unit deriving joint candidates from adjacent blocks adjacent to the current block, generating a first joint candidate list including the joint candidate and deriving motion information of the current block from the joint candidate for which an index determined by the information is provided, wherein when a number of joint candidates included in the first joint candidate list is smaller than a predetermined value, the joint candidate included in the second joint candidate list is added to the first joint candidate list.