Non-temporal image decoding methods, image encoding methods, and computer-readable storage media.
Patent Information
- Application Number
- VN1202606040
- Authority / Receiving Office
- VN · VN
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2013-01-18
- Filing Date
- 2013-01-18
- Publication Date
- 2026-09-15
AI Technical Summary
Current image encoding and decoding technologies face challenges in reducing computational complexity while improving image encoding efficiency, particularly in high-definition and ultra-high-definition video compression, where inter prediction and motion vector prediction methods are inefficient.
The proposed method involves adjusting the motion vector candidate list by adding or removing specific motion vector candidates to determine a predictive motion vector, reducing the number of candidates to the maximum required, and using motion compensation to generate a prediction block, thereby optimizing computational complexity and encoding efficiency.
This approach effectively reduces computational complexity and enhances image encoding efficiency by optimizing the motion vector prediction process, improving the performance of image encoding and decoding in high-definition and ultra-high-definition video compression.
Smart Images

Figure VN1202606040_0
Abstract
Description
The present invention relates to an image encoding / decoding method and apparatus, and more specifically, to a motion vector prediction technology capable of reducing computational complexity. Recently, as broadcasting services with HD (High Definition) resolution have expanded not only domestically but also globally, many users are becoming accustomed to high-resolution, high-quality video, and accordingly, many organizations are accelerating the development of next-generation video devices. In addition, as interest in UHD (Ultra High Definition), which has more than four times the resolution of HDTV, grows alongside HDTV, there is a demand for compression technology for higher resolution and higher-quality video. For image compression, inter prediction techniques that predict pixel values included in the current image from images prior to and / or subsequent images in time, intra prediction techniques that predict pixel values included in the current image using pixel information within the current image, and entropy coding techniques that assign short codes to symbols with high frequency and long codes to symbols with low frequency may be used. The technical problem of the present invention is to provide an image encoding method and apparatus capable of not only improving image encoding efficiency but also reducing computational complexity. Another technical objective of the present invention is to provide an image decoding method and apparatus capable of not only improving image encoding efficiency but also reducing computational complexity. Another technical objective of the present invention is to provide a prediction block generation method and apparatus capable of not only improving image encoding efficiency but also reducing computational complexity. Another technical objective of the present invention is to provide an inter prediction method and apparatus capable of not only improving image encoding efficiency but also reducing computational complexity. Another technical objective of the present invention is to provide a motion vector prediction method and apparatus capable of not only improving image encoding efficiency but also reducing computational complexity. The image decoding method of the present invention for achieving the above-mentioned purpose comprises the steps of: inversely quantizing and inversely transforming the entropy-decoded residual block to restore the residual block; performing motion compensation to generate a prediction block; and adding the restored residual block to the prediction block to restore the image, wherein the motion vector candidate list is adjusted by adding a specific motion vector candidate or removing some of the motion vector candidates based on the maximum number of motion vector candidates in the motion vector candidate list associated with the prediction block, and in the step of generating the prediction block, the predicted motion vector of the prediction block can be determined based on the adjusted motion vector candidate list. The step of generating the prediction block may include deriving motion vector candidates associated with the prediction block to construct a motion vector candidate list, removing one identical motion vector candidate among the spatial motion vector candidates included in the motion vector candidate list, adjusting the motion vector candidate list by adding the specific motion vector candidate or removing some of them, and determining a predicted motion vector among the motion vector candidates included in the adjusted motion vector candidate list. The step of adjusting the motion vector candidate list may include the step of adding the specific motion vector candidate regardless of whether a motion vector candidate exists in the motion vector candidate list or whether the specific motion vector candidate exists in the motion vector candidate list, when the number of motion vector candidates included in the motion vector candidate list is less than the maximum number of motion vector candidates. The step of adjusting the motion vector candidate list may include the step of repeatedly adding the specific motion vector candidate until the number of motion vector candidates included in the motion vector candidate list reaches the maximum number of motion vector candidates when the number of motion vector candidates included in the motion vector candidate list is less than the maximum number of motion vector candidates. The specific motion vector above is a (0,0) motion vector, and the maximum number of motion vector candidates above may be 2. In a state where no motion vector candidate exists in the above motion vector candidate list, two of the above specific motion vectors may be added. In the state where one specific motion vector exists in the above motion vector candidate list, one more specific motion vector may be added. The step of adjusting the motion vector candidate list may include, when the number of motion vector candidates included in the motion vector candidate list is greater than the maximum number of motion vector candidates value, removing motion vector candidates having an index value greater than the index value obtained by subtracting 1 from the maximum number of motion vector candidates from the motion vector candidate list. The image decoding device of the present invention for achieving the above-mentioned purpose comprises a residual block restoration unit that restores a residual block by inversely quantizing and inversely transforming an entropy-decoded residual block, a prediction block generation unit that generates a prediction block by performing motion compensation, and an image restoration unit that restores an image by adding the restored residual block to the prediction block, wherein the prediction block generation unit adjusts the motion vector candidate list by adding a specific motion vector candidate or removing some of the motion vector candidates based on the maximum number of motion vector candidates in the motion vector candidate list associated with the prediction block, and determines the predicted motion vector of the prediction block based on the adjusted motion vector candidate list. The prediction block generation unit may include a motion vector candidate list configuration unit that derives motion vector candidates related to the prediction block to form a motion vector candidate list, a duplicate motion vector candidate removal unit that removes one identical motion vector candidate among the spatial motion vector candidates included in the motion vector candidate list, a motion vector candidate list that adjusts the motion vector candidate list by adding the specific motion vector candidate or removing a part of it, and a prediction motion vector determination unit that determines a prediction motion vector from the adjusted motion vector candidate list. The motion vector candidate list adjustment unit may add the specific motion vector candidate regardless of whether a motion vector candidate exists in the motion vector candidate list or whether the specific motion vector candidate exists in the motion vector candidate list when the number of motion vector candidates included in the motion vector candidate list is less than the maximum number of motion vector candidates. The motion vector candidate list adjustment unit may repeatedly add the specific motion vector candidate until the number of motion vector candidates included in the motion vector candidate list reaches the maximum number of motion vector candidates when the number of motion vector candidates included in the motion vector candidate list is less than the maximum number of motion vector candidates. The specific motion vector above is a (0,0) motion vector, and the maximum number of motion vector candidates above may be 2. In a state where no motion vector candidate exists in the above motion vector candidate list, two of the above specific motion vectors may be added. In the state where one specific motion vector exists in the above motion vector candidate list, one more specific motion vector may be added. The image encoding method of the present invention for achieving the above-mentioned purpose comprises the steps of generating a prediction block by performing inter-frame prediction or motion compensation on an input image, and transforming and quantizing a residual block, which is the difference between a current input block and a prediction block predicted by the inter-frame prediction, to perform entropy encoding, wherein the motion vector candidate list is adjusted by adding a specific motion vector candidate or removing some of the motion vector candidates based on the maximum number of motion vector candidates in the motion vector candidate list associated with the prediction block, and in the step of generating the prediction block, the predicted motion vector of the prediction block can be determined based on the adjusted motion vector candidate list. The step of generating the prediction block may include deriving motion vector candidates associated with the prediction block to construct a motion vector candidate list, removing one identical motion vector candidate among the spatial motion vector candidates included in the motion vector candidate list, adjusting the motion vector candidate list by adding the specific motion vector candidate or removing some of them, and determining a predicted motion vector from the adjusted motion vector candidate list. The step of adjusting the motion vector candidate list may include the step of adding the specific motion vector candidate regardless of whether a motion vector candidate exists in the motion vector candidate list or whether the specific motion vector candidate exists in the motion vector candidate list, when the number of motion vector candidates included in the motion vector candidate list is less than the maximum number of motion vector candidates. The image encoding device of the present invention for achieving the above-mentioned purpose comprises a prediction block generating unit that generates a prediction block by performing inter-frame prediction or motion compensation on an input image, and an encoding unit that performs entropy encoding by transforming and quantizing a residual block, which is the difference between a current input block and a prediction block predicted by the inter-frame prediction. The prediction block generating unit can adjust the motion vector candidate list by adding a specific motion vector candidate or removing some of the motion vector candidates based on the maximum number of motion vector candidates in the motion vector candidate list associated with the prediction block, and can determine the predicted motion vector of the prediction block based on the adjusted motion vector candidate list. According to the image encoding method of the present invention, not only can computational complexity be reduced, but image encoding efficiency can also be improved. According to the image decoding method of the present invention, not only can computational complexity be reduced, but image encoding efficiency can also be improved. According to the prediction block generation method of the present invention, not only can computational complexity be reduced, but image encoding efficiency can also be improved. According to the inter prediction method of the present invention, not only can computational complexity be reduced, but image encoding efficiency can also be improved. According to the motion vector prediction method of the present invention, not only can computational complexity be reduced, but image encoding efficiency can also be improved. FIG. 1 is a block diagram showing the configuration according to one embodiment of an image encoding device to which the present invention is applied. FIG. 2 is a block diagram showing the configuration according to one embodiment of an image decoding device to which the present invention is applied. FIG. 3 is a flowchart schematically illustrating one embodiment of an inter prediction method, FIG. 4 is a flowchart illustrating the process of an image encoding / decoding device according to an embodiment of the present invention inducing motion vector candidates and determining a predicted motion vector. FIG. 5 is a schematic diagram illustrating one embodiment of the spatial motion vector candidate derivation process. FIG. 6 is a schematic diagram illustrating one embodiment of the process for deriving temporal motion vector candidates. FIG. 7 is a schematic diagram illustrating an embodiment for constructing a list of motion vector candidates based on induced motion vector candidates. FIG. 8 is a schematic diagram illustrating an embodiment of removing identical motion vector candidates from a motion vector candidate list. FIG. 9 is a flowchart schematically illustrating a motion vector candidate list adjustment process according to an embodiment of the present invention. FIG. 10 is a schematic diagram illustrating an additional embodiment of a (0,0) motion vector when one motion vector candidate exists in the motion vector candidate list. FIG. 11 is a schematic diagram illustrating an additional embodiment of a (0,0) motion vector when one (0,0) motion vector candidate exists in the motion vector candidate list. FIG. 12 is a schematic diagram illustrating an additional embodiment of a (0,0) motion vector when no motion vector exists in the motion vector candidate list. FIG. 13 is a schematic diagram illustrating an embodiment of removing some motion vector candidates from a motion vector candidate list. Figure 14 is a schematic diagram illustrating the process of determining a predicted motion vector among motion vector candidates in a motion vector candidate list. Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings. In describing the embodiments of this specification, detailed descriptions of related known configurations or functions are omitted if it is determined that such detailed descriptions may obscure the gist of this specification. When it is stated that a component is "connected" or "joined" to another component, it should be understood that while it may be directly connected or joined to that other component, there may also be other components present in between. Furthermore, the description in the present invention that a specific configuration is "included" does not exclude configurations other than that specific configuration, but rather implies that additional configurations may be included within the scope of the practice or technical concept of the present invention. Terms such as "first," "second," etc., may be used to describe various components, but said components should not be limited by said terms. These terms are used solely for the purpose of distinguishing one component from another. For example, without departing from the scope of the present invention, the first component may be named the second component, and similarly, the second component may be named the first component. Furthermore, the components shown in the embodiments of the present invention are depicted independently to represent different characteristic functions and do not imply that each component consists of separate hardware or a single software unit. That is, each component is listed and included as a separate component for convenience of explanation; however, at least two of the components may be combined to form a single component, or a single component may be divided into multiple components to perform a function, and such integrated and separated embodiments of each component are included within the scope of the present invention as long as they do not deviate from the essence of the invention. Furthermore, some components may not be essential components performing an essential function in the present invention, but merely optional components for enhancing performance. The present invention may be implemented by including only the components essential for realizing the essence of the present invention, excluding components used solely for performance enhancement, and a structure including only the essential components, excluding optional components used solely for performance enhancement, is also included within the scope of the rights of the present invention. FIG. 1 is a block diagram showing the configuration according to one embodiment of an image encoding device to which the present invention is applied. Referring to FIG. 1, the image encoding device (100) includes a motion prediction unit (111), a motion compensation unit (112), an intra prediction unit (120), a switch (115), a subtractor (125), a converter (130), a quantization unit (140), an entropy encoding unit (150), an inverse quantization unit (160), an inverse conversion unit (170), an adder (175), a filter unit (180), and a reference image buffer (190). The video encoding device (100) can perform encoding on an input video in an intra mode or an inter mode and output a bitstream. Intra prediction refers to prediction within a frame, and inter prediction refers to prediction between frames. In the case of intra mode, the switch (115) can be switched to intra, and in the case of inter mode, the switch (115) can be switched to inter. The video encoding device (100) can generate a prediction block for an input block of the input video, and then encode the difference between the input block and the prediction block. In the case of intra mode, the intra prediction unit (120) can generate a prediction block by performing spatial prediction using the pixel values of already encoded blocks around the current block. In the case of inter mode, the motion prediction unit (111) can obtain a motion vector by finding the region that best matches the input block in the reference image stored in the reference image buffer (190) during the motion prediction process. Here, the image can be used with the same meaning as the picture described later. The motion compensation unit (112) can generate a prediction block by performing motion compensation using the motion vector. Here, the motion vector is a two-dimensional vector used for inter prediction and can represent the offset between the block in the current encoding / decoding target image and the block in the reference image. The subtractor (125) can generate a residual block by the difference between the input block and the generated prediction block. The transform unit (130) can perform a transform on the residual block to output a transform coefficient. The quantization unit (140) can quantize the input transform coefficient according to a quantization parameter to output a quantized coefficient. The entropy encoding unit (150) can output a bit stream by performing entropy encoding based on values calculated in the quantization unit (140) or encoding parameters calculated during the encoding process, such as motion vector difference, reference picture index, motion vector candidate index, and prediction direction information. When entropy encoding is applied, a small number of bits are allocated to symbols with a high probability of occurrence and a large number of bits are allocated to symbols with a low probability of occurrence, thereby representing the symbols and reducing the size of the bit sequence for the symbols to be encoded. Therefore, the compression performance of video encoding can be improved through entropy encoding. The entropy encoding unit (150) may use encoding methods such as exponential golomb, CAVLC (Context-Adaptive Variable Length Coding), and CABAC (Context-Adaptive Binary Arithmetic Coding) for entropy encoding. Since the image encoding device according to the embodiment of FIG. 1 performs inter-predictive encoding, that is, inter-frame predictive encoding, the currently encoded image needs to be decoded and stored to be used as a reference image. Accordingly, the quantized coefficients are inversely quantized in the inverse quantization unit (160) and inversely transformed in the inverse transformation unit (170). The inversely quantized and inversely transformed coefficients are added to the prediction block through the adder (175) and a restoration block is generated. The restored block passes through a filter unit (180), and the filter unit (180) can apply at least one of a deblocking filter, a Sample Adaptive Offset (SAO), and an Adaptive Loop Filter (ALF) to the restored block or the restored image. The filter unit (180) may also be called an adaptive in-loop filter. The deblocking filter can remove block distortion that occurs at the boundaries between blocks. The SAO can add an appropriate offset value to the pixel value to compensate for coding errors. The ALF can perform filtering based on a value obtained by comparing the restored image with the original image. The restored block that has passed through the filter unit (180) can be stored in a reference image buffer (190). FIG. 2 is a block diagram showing the configuration according to one embodiment of an image decoding device to which the present invention is applied. Referring to FIG. 2, the image decoding device (200) includes an entropy decoding unit (210), an inverse quantization unit (220), an inverse transformation unit (230), an intra prediction unit (240), a motion compensation unit (250), an adder (255), a filter unit (260), and a reference image buffer (270). The image decoding device (200) receives a bitstream output from an encoder, performs decoding in intra mode or inter mode, and outputs a reconstructed image, i.e., a restored image. In the case of intra mode, the switch may be switched to intra, and in the case of inter mode, the switch may be switched to inter. The image decoding device (200) may obtain a reconstructed residual block from the input bitstream, generate a prediction block, and then add the reconstructed residual block and the prediction block to generate a reconstructed block, i.e., a restored block. The entropy decoding unit (210) can generate symbols including symbols in the form of quantized coefficients by entropy decoding the input bitstream according to a probability distribution. The entropy decoding method is similar to the entropy encoding method described above. When the entropy decoding method is applied, symbols are represented by allocating a small number of bits to symbols with a high probability of occurrence and a large number of bits to symbols with a low probability of occurrence, thereby reducing the size of the bit sequence for each symbol. Therefore, the compression performance of image decoding can be improved through the entropy decoding method. The quantized coefficients are inversely quantized in the inverse quantization unit (220) and inversely transformed in the inverse transformation unit (230), and as a result of the quantized coefficients being inversely quantized / inversely transformed, a restored residual block can be generated. In the case of intra mode, the intra prediction unit (240) can generate a prediction block by performing spatial prediction using pixel values of already encoded / decoded blocks around the current block. In the case of inter mode, the motion compensation unit (250) can generate a prediction block by performing motion compensation using motion vectors and reference images stored in the reference image buffer (270). The restored residual block and the prediction block are added through an adder (255), and the added block may pass through a filter unit (260). The filter unit (260) may apply at least one of a deblocking filter, SAO, and ALF to the restored block or the restored image. The filter unit (260) may output a reconstructed image, i.e., a restored image. The restored image may be stored in a reference image buffer (270) and used for inter-prediction. Hereinafter, a block refers to a unit of video encoding and decoding. During video encoding and decoding, the encoding unit or decoding unit refers to the divided unit when the video is divided for encoding or decoding; therefore, it can be called a Unit, Coding Unit (CU), Prediction Unit (PU), Transform Unit (TU), or Transform Block. A single block can be further divided into smaller sub-blocks. The prediction unit is the basic unit for performing inter-prediction or motion compensation and can be called a prediction block. The prediction unit can be divided into multiple partitions, and multiple partitions also serve as basic units for performing prediction; furthermore, a partition into which a prediction unit is divided can also be referred to as a prediction unit. Additionally, in this specification, "picture" may be replaced with "image," "frame," "field," and / or "slice" depending on the context, and such distinctions can be easily made by those skilled in the art. For example, the P picture, B picture, and forward B picture described below may be replaced with P slice, B slice, and forward B slice, respectively, depending on the picture. Furthermore, in this specification, the current block may refer to a block during inter-prediction or motion compensation, and in such cases, the current block may mean a prediction unit or a prediction block. Figure 3 is a flowchart schematically illustrating one embodiment of an inter prediction method. Referring to FIG. 3, the encoder and decoder can derive motion information for the current block (S310). In inter mode, the encoder and decoder may derive motion information of the current block and then perform inter prediction and / or motion compensation based on the derived motion information. At this time, the encoder and decoder can improve encoding efficiency by utilizing motion information of a collocated block corresponding to the current block within a restored neighboring block and / or an already restored collocated picture. Here, the restored neighboring block is a block within the current picture that has already been encoded and / or decoded and restored, and may include a block adjacent to the current block and / or a block located at the outer corner of the current block. Additionally, the encoder and decoder may determine a predetermined relative position based on a block existing at the same spatial location as the current block within the collocated picture, and may derive the collocated block based on the determined predetermined relative position (an internal and / or external position of a block existing at the same spatial location as the current block). Here, for example, a call picture may correspond to one of the reference pictures included in the reference picture list. Additionally, the motion information here refers to information required for inter-prediction or motion compensation, including at least one of a motion vector, a reference picture index, a motion vector candidate index, a motion vector difference, a reference picture list, a predicted motion vector, a merge flag, a merge index, a predicted direction, and availability information. Meanwhile, the motion information derivation method may vary depending on the prediction mode of the current block. Prediction modes applied for inter-prediction may include motion vector prediction, such as AMVP (Advanced Motion Vector Prediction), and merge mode. For example, when motion vector prediction is applied, the encoder and decoder may generate a motion vector candidate list using the motion vectors of the restored surrounding blocks and / or the motion vectors of the call blocks. That is, the motion vectors of the restored surrounding blocks and / or the motion vectors of the call blocks may be used as motion vector candidates. The encoder may transmit a predicted motion vector index to the decoder indicating the optimal predicted motion vector selected from among the motion vector candidates included in the list. At this time, the decoder may use the predicted motion vector index to select the predicted motion vector of the current block from among the predicted motion vector candidates included in the motion vector candidate list. The encoder can obtain the Motion Vector Difference (MVD) between the motion vector of the current block and the predicted motion vector, and can encode and transmit it to the decoder. At this time, the decoder can decode the received Motion Vector Difference and derive the motion vector of the current block through the sum of the decoded Motion Vector Difference and the predicted motion vector. As another example, when merge mode is applied, the encoder and decoder can generate a merge candidate list using movement information of the restored neighboring blocks and / or movement information of the call blocks. That is, if movement information of the restored neighboring blocks and / or call blocks exists, the encoder and decoder can use it as a merge candidate for the current block. The encoder can select a merge candidate from among the merge candidates included in the merge candidate list that can provide optimal encoding efficiency as the movement information for the current block. At this time, a merge index indicating the selected merge candidate may be included in the bitstream and transmitted to the decoder. The decoder may use the transmitted merge index to select one of the merge candidates included in the merge candidate list and determine the selected merge candidate as the movement information for the current block. Therefore, when the merge mode is applied, the movement information of the restored surrounding blocks and / or call blocks can be used as is as the movement information for the current block. In the AMVP and merge modes described above, motion information of restored surrounding blocks and / or motion information of call blocks may be used to derive motion information of the current block. In the embodiments described below, motion information derived from restored surrounding blocks is referred to as spatial motion information, and motion information derived based on call blocks is referred to as temporal motion information. For example, a motion vector derived from restored surrounding blocks may be referred to as a spatial motion vector, and a motion vector derived based on call blocks may be referred to as a temporal motion vector. Referring again to FIG. 3, the encoder and decoder can generate a prediction block by performing motion compensation on the current block based on the induced motion information (S320). Here, the prediction block may refer to a motion-compensated block generated as a result of performing motion compensation on the current block. Additionally, a plurality of motion-compensated blocks may constitute a single motion-compensated image. Accordingly, in the embodiments described below, the prediction block may be referred to as a 'motion-compensated block' and / or a 'motion-compensated image' depending on the context, and such distinction can be easily made by a person with ordinary knowledge in the relevant art. Meanwhile, there may be P pictures and B pictures in which inter-prediction is performed. A P picture may refer to a picture in which unidirectional prediction is performed using a single reference picture, and a B picture may refer to a picture in which forward-directional, backward-directional, or bi-predictive prediction can be performed using one or more, for example, two reference pictures. For example, in a B picture, inter-prediction can be performed using one forward reference picture (past picture) and one backward reference picture (future picture). Additionally, in a B picture, prediction may be performed using two forward reference pictures or two backward reference pictures. Here, reference pictures can be managed by a reference picture list. The reference picture used in picture P can be assigned to reference picture list 0 (L0 or List0). The two reference pictures used in picture B can be assigned to reference picture list 0 and reference picture list 1 (L1 or List1), respectively. Hereinafter, the L0 reference picture list may have the same meaning as reference picture list 0, and the L1 reference picture list may have the same meaning as reference picture list 1. Generally, forward reference pictures may be assigned to Reference Picture List 0, and reverse reference pictures may be assigned to Reference Picture List 1. However, the method of assigning reference pictures is not limited to this, and forward reference pictures may be assigned to Reference Picture List 1, and reverse reference pictures may be assigned to Reference Picture List 0. Hereinafter, the reference picture assigned to Reference Picture List 0 is referred to as the L0 reference picture, and the reference picture assigned to Reference Picture List 1 is referred to as the L1 reference picture. Reference pictures can generally be assigned to a reference picture list in descending order according to the reference picture number. Here, the reference picture number may refer to a number assigned to each reference picture in the order of the Picture Order Count (POC), and the POC order may refer to the display order and / or chronological order of the pictures. For example, two reference pictures with the same reference picture number may correspond to the same reference picture. Reference pictures assigned to a reference picture list can be rearranged by Reference Picture List Modification. As described above, unidirectional prediction using one L0 reference picture can be performed in P picture, and forward, reverse, or bidirectional prediction using one L0 reference picture and one L1 reference picture, i.e., two reference pictures, can be performed in B picture. Prediction using one reference picture can be called uni-prediction, and prediction using two reference pictures including the L0 reference picture and the L1 reference picture can be called bi-prediction. Pair prediction can be used as a concept that includes forward prediction, reverse prediction, and bidirectional prediction; however, for convenience in the embodiments described below, prediction using two reference pictures (L0 reference picture and L1 reference picture) is referred to as bidirectional prediction. That is, in the embodiments described below, bidirectional prediction may mean pair prediction and can be understood as a concept that includes forward, reverse, and bidirectional predictions using two reference pictures (L0 reference picture and L1 reference picture). Furthermore, even when pair prediction is performed, forward prediction or reverse prediction may be performed; however, for convenience in the embodiments described below, prediction using only one reference picture is referred to as unidirectional prediction. That is, in the embodiments described below, unidirectional prediction may mean single prediction and should be understood as a concept that includes prediction using only one reference picture. Additionally, information indicating whether unidirectional prediction (single prediction) or bidirectional prediction (pair prediction) is applied to the block where prediction is performed below is referred to as prediction direction information. FIG. 4 is a flowchart illustrating the process of an image encoding / decoding device according to an embodiment of the present invention inducing motion vector candidates and determining a predicted motion vector. Referring to FIG. 4, the encoder and decoder first derive spatial motion vector candidates to determine the predicted motion vector (S410). As previously described, the encoder and decoder can derive motion vector candidates from blocks already restored (reference blocks) in the spatial vicinity of the current block. At this time, spatial motion vector candidates can be derived up to a maximum number of spatial motion vector candidates (maxNumSpatialMVPCand). If the reference picture of the reference block and the reference picture of the current block are different, scaling can be performed to derive spatial motion vector candidates. Once the derivation of spatial motion vector candidates is complete, the encoder and decoder derive temporal motion vector candidates (S420). The encoder and decoder can derive motion vector candidates from call blocks restored from call pictures that are temporally surrounding the current block. Additionally, temporal motion vector candidates can be derived up to a maximum number of temporal motion vector candidates (maxNumTemporalMVPCand). Furthermore, if the distance between the current picture and the reference picture of the current block is different from the distance between the call picture and the reference picture of the call block, scaling can be performed to derive temporal motion vector candidates. When the derivation of spatial motion vector candidates or temporal motion vector candidates is finished, the derived motion vector candidates are added to the motion vector candidate list (S430). That is, the encoder and decoder can add the derived spatial motion vector candidates and temporal motion vector candidates in order to the motion vector candidate list (mvpListLX). The motion vector candidate list (mvpListLX) refers to the motion vector candidate list corresponding to either reference picture list L0 or L1; for example, the motion vector candidate list corresponding to reference picture list L0 can be represented as mvpListL0. Once the motion vector candidate list is constructed, the encoder and decoder remove identical motion vector candidates (S440). It is checked whether there are motion vector candidates with identical motion vector values within the motion vector candidate list (mvpListLX). For example, if there are multiple identical spatial motion vector candidates, only the spatial motion vector candidate with the smallest motion vector candidate index among the identical spatial motion vector candidates is kept, and the remaining spatial motion vector candidates are removed from the motion vector candidate list. That is, if there are multiple candidates with identical motion vector values, only one candidate with identical motion vector values can be kept in the motion vector candidate list. And there may be only one motion vector candidate to be removed. Then, the encoder and decoder adjust the motion vector candidate list by adding a specific motion vector or removing some of them (S450). The encoder and decoder can adjust the size of the motion vector candidate list (mvpListLX) by adding a motion vector to the motion vector candidate list or by removing some of the motion vector candidates included in the motion vector candidate list. And there may be one motion vector candidate to be removed. At this time, a specific motion vector may be added without checking whether a motion vector candidate exists within the motion vector candidate list based on the maximum number of motion vector candidates (maxNumMVPCand). In addition, the number of motion vector candidates within the motion vector candidate list may be adjusted by adding a specific motion vector without checking whether a specific motion vector exists within the motion vector candidate list. At this time, the specific motion vector to be added may be a vector having a fixed integer value, and in some cases, may be a (0,0) motion vector. Here, a (0,0) motion vector refers to a motion vector in which both the x and y components of the vector are 0, and can be referred to as a zero motion vector. Finally, the encoder and decoder can determine the predicted motion vector based on the list of adjusted motion vector candidates (S460). FIG. 5 is a schematic diagram illustrating an example of a process for deriving candidates for spatial motion vectors. Referring to FIG. 5, the encoder and decoder determine whether motion information of the restored surrounding blocks (510, 512, 514, 516, 518) exists to derive a spatial motion vector candidate of the current block (500). If motion information of the restored surrounding blocks does not exist, it can be determined that they cannot be used as motion vector candidates. According to one embodiment of the present invention, an encoder and a decoder can derive spatial motion vectors from an AO block (510) located at the bottom left corner of the current block (500), an A1 block (512) adjacent to the bottom left corner of the current block (500), a B0 block (514) located at the top right corner of the current block (500), a B1 block (516) adjacent to the top right corner of the current block (500), and a B2 block (518) located at the top left corner of the current block (500), and determine them as candidates for spatial motion vectors of the current block (500). At this time, it can be determined whether a motion vector exists in each block in the order of blocks A0, A1, BO, B1, and B2 (510, 512, 514, 516, 518). If a motion vector exists, the motion vector of the corresponding block can be determined as a motion vector candidate. Spatial motion vector candidates can be derived up to a maximum number of spatial motion vectors (maxNumSpatialMVPCand), where the maximum number of spatial motion vectors (maxNumSpatialMVPCand) is a positive integer including 0. According to an embodiment of the present invention, the maximum number of spatial motion vectors (maxNumSpatialMVPCand) may be 2. Accordingly, a total of two spatial motion vectors are derived by deriving one motion vector candidate from A0 block (510) and A1 block (512), and one motion vector candidate from BO block (514), B1 block (516), and B2 block (518). At the same time, if the motion vector derived from A0 block (510) and A1 block (512) and the motion vector derived from BO block (514), B1 block (516), and B2 block (518) are not identical, the process of deriving a temporal motion vector candidate may not be performed. Additionally, if the reference picture of the restored surrounding block and the reference picture of the current block (500) are different, the motion vector of the surrounding block can be scaled and used by utilizing the distance between the reference picture of the current block (500) and the reference picture of the restored surrounding block. According to another embodiment of the present invention, a specific method for deriving spatial motion vectors from restored surrounding blocks may follow the following method. 1) If a block exists at a predetermined location, and the block is not encoded within the screen, and the reference picture list and reference picture of the block are the same as the reference picture list and reference picture of the current block, the motion vector of the block can be derived as a candidate motion vector of the current block. 2) If a block exists at a specific location, and the block is not encoded within the screen, and the reference picture list of the block is different from the reference picture list of the current block, but the reference pictures of the block and the current block are the same, then the motion vector of the block can be derived as a candidate motion vector of the current block. 3) If a block exists at a specific location and the block is not encoded within the screen, and the reference picture list of the block is the same as the reference picture list of the current block, but the reference picture of the block is different from the reference picture of the current block, then scaling can be performed on the motion vector of the block to derive a candidate motion vector for the current block. 4) If a block exists at a predetermined location and the block is not encoded within the screen, and the reference picture list and reference picture of the block are different from the reference picture list and reference picture of the current block, scaling can be performed on the motion vector of the block to derive a candidate motion vector for the current block. Based on the above steps 1) to 4), the encoder and decoder may sequentially perform steps 1) and 2) for the AO block (510), steps 1) and 2) for the A1 block (512), steps 3) and 4) for the AO block (510), steps 3) and 4) for the A1 block (512), steps 1) and 2) for the B0 block (514), steps 1) and 2) for the B1 block (516), steps 1) and 2) for the B2 block (518), steps 3) and 4) for the B0 block (514), steps 3) and 4) for the B1 block (516), and steps 3) and 4) for the B2 block (518). FIG. 6 is a schematic diagram illustrating one example of a process for deriving candidate temporal motion vectors. Referring to FIG. 6, the encoder and decoder can derive motion vector candidates from a corresponding location block (or call block: 600) restored from a corresponding location picture (or call picture) that is temporally surrounding the current block (500). According to one embodiment of the present invention, temporal motion vector candidates can be derived in the order of a block (610) at position H, which is located outside a call block (600) that corresponds to a spatially identical position to the current block (500) in the call picture of the current picture, and a block (612) located at position C3, which is located inside the call block (600). At this time, if a motion vector can be derived from the H block (610), a temporal motion vector is derived from the H block (610), and if a motion vector cannot be derived from the H block (610), a temporal motion vector candidate can be derived from the C3 block (612). Here, the H block (610) may be the block at the bottom right corner of the call block (600), and the C3 block (612) may be the block at the bottom right of the square divided into four sections based on the center of the call block (600). The temporal motion vector may be determined based on the relative positions of the H block (610) and the C3 block (612). If the H block (610) and the C3 block (612) are encoded within the screen, a candidate temporal motion vector cannot be derived. Additionally, temporal motion vector candidates can be derived up to a maximum number of temporal motion vectors (maxNumTemporalMVPCand). In this case, the maximum number of temporal motion vectors (maxNumTemporalMVPCand) is a positive integer including 0, for example, the maximum number of temporal motion vectors (maxNumTemporalMVPCand) may be 1. If the distance between the current picture and the reference picture of the current block (500) and the distance between the call picture and the reference picture of the call block (600) are different, the temporal motion vector candidates can be derived by performing scaling on the motion vectors. Scaling can be performed through the following process. First, td and tb values are obtained, which represent the difference in POC (Picture Order Count) between the call picture and the reference picture of the H block (610) or C3 block (612), and the difference in POC between the current picture and the reference picture of the current block. At this time, i) in the case of the spatial motion vector derivation process, the td value represents the difference between the POC of the current picture and the POC of the reference picture referenced by the spatially adjacent reference block, and the tb value represents the difference between the POC of the current picture and the POC of the reference picture referenced by the current block. At this time, the prediction direction of the reference picture of the current block and the reference picture of the reference block may be different from each other, in which case the signs of the td and tb values may be assigned differently. Depending on the case, the td value or tb value may be adjusted to be included in the range between -128 and 127. At this time, if the td value or tb value is less than -128, the td value or tb value is adjusted to -128, and if the td value or tb value is greater than 127, the td value or tb value is adjusted to 127. If the td value or tb value falls within the range between -128 and 127, the td value or tb value is not adjusted. After calculating the values of td and tb, the value of tx, which is inversely proportional to td, is calculated. This can be determined using the mathematical formula (16384 + (Abs(td)>>1)) / td. Here, Abs() represents the absolute value of the input. Then, the scaling factor DistScaleFactor is determined using the mathematical formula (tb*tx + 32) >> 6, and adjusted to be included in the range between -1024 and 1023. Using the adjusted DistScaleFactor value, the scaled temporal motion vector can be calculated using the mathematical formula Sign(DistScaleFactor*mvCol)*((Abs(DistScaleFactor*mvCol) + 127 ) >> 8). Here, Sign() outputs the sign information of the input value, and mvCol represents the temporal motion vector value before scaling. FIG. 7 is a schematic diagram illustrating an embodiment of constructing a list of motion vector candidates based on induced motion vectors. Referring to FIG. 7, the encoder and decoder add the derived motion vector candidates to the motion vector candidate list (mvpListLX). The encoder and decoder add the derived spatial motion vector candidates and temporal motion vector candidates to the motion vector candidate list in order. mvpListLX represents the motion vector candidate list corresponding to either reference picture list L0 or L1. For example, the motion vector candidate list corresponding to reference picture list L0 can be represented as mvpListL0. The size of the motion vector candidate list (mvpListLX) can be determined based on a predetermined number of maximum motion vector candidates (maxNumMVPCand). In this case, the maximum motion vector candidate list (maxNumMVPCand) can be 2. If the maximum motion vector candidate list is 3 and there are 3 derived motion vector candidates, the motion vector candidate added first to the motion vector candidate list (mvpListLX) has a motion vector candidate index value of 0, and the motion vector candidate added last can have a motion vector candidate index value of 2. According to the embodiment of FIG. 7, if an unscaled spatial motion vector candidate (1, 0) is derived from block A1 (512), a scaled spatial motion vector candidate (4, -1) is derived from block B1 (516), and a temporal motion vector candidate (2, 3) is derived from block H (610), the motion vector candidates are added in order to the motion vector candidate list (700). At this time, the index value of the motion vector candidate derived from block A1 (512) may be 0, the index value of the motion vector candidate derived from block B1 (516) may be 1, and the index value of the motion vector candidate derived from block H (610) may be 2. In the above embodiment, assuming the maximum number of motion vector candidates is 2, since the motion vector candidates derived from block A1 (512) and block B1 (516) are not identical to each other, the motion vector candidates derived from block A1 (512) and block B1 (516) are added to the motion vector candidate list without deriving a temporal motion vector candidate. FIG. 8 is a schematic diagram illustrating an example of removing identical motion vectors from a list of motion vector candidates. Referring to FIG. 8, the encoder and decoder check whether there are identical motion vector candidates in the motion vector candidate list (800). If, as a result of the check, there are multiple identical motion vector candidates, only the motion vector candidate with the smallest motion vector candidate index among the identical motion vector candidates is kept in the motion vector candidate list (800), and the remaining motion vector candidates are removed from the motion vector candidate list (800). At this time, the operation to remove identical motion vector candidates can be performed only for spatial motion vector candidates. According to the embodiment of FIG. 8, when the motion vector candidate list (800) consists of three motion vector candidates (1,0), (1,0), and (2,3), the candidate corresponding to index 0 and index 1 is (1,0) and is identical to each other. When there are identical motion vectors, the encoder and decoder remove the remaining motion vector candidates, leaving only the motion vector candidate with the smallest index among the identical motion vector candidates in the motion vector candidate list (810), as in the reconstructed motion vector candidate list (810). FIG. 9 is a flowchart schematically illustrating the motion vector candidate list adjustment process according to one embodiment of the present invention. Referring to FIG. 9, the encoder and decoder determine whether the number of motion vector candidates (numMVPCandLX) included in the motion vector candidate list is less than the maximum number of motion vector candidates (maxNumMVPCand) (S910). If the number of included motion candidates is less than the maximum number of motion vector candidates, a (0,0) motion vector is added to the motion vector candidate list (S920). Adding the (0,0) motion vector to the motion vector candidate list can increase the number of motion vector candidates (numMVPCandLX) by 1. After adding the (0,0) motion vector, the determination of whether the number of motion vector candidates (numMVPCandLX) included in the motion vector candidate list is less than the maximum number of motion vector candidates (maxNumMVPCand) and the operation of adding the (0,0) motion vector are repeated until the number of motion vector candidates (numMVPCandLX) reaches the maximum number of motion vector candidates (maxNumMVPCand). That is, the above process is performed until the number of motion vector candidates (numMVPCandLX) included in the motion vector candidate list becomes equal to the maximum number of motion vector candidates (maxNumMVPCand), so that the number of motion vector candidates (numMVPCandLX) becomes equal to the maximum number of motion vector candidates (maxNumMVPCand). However, according to another embodiment of the present invention, if the number of motion vector candidates (numMVPCandLX) included in the motion vector candidate list is smaller than the maximum number of motion vector candidates (maxNumMVPCand), only one (0,0) motion vector may be added. In conclusion, the number of motion vector candidates included in the above motion vector candidate list can be determined by the maximum number of motion vector candidates. According to one embodiment of the present invention, if the number of motion vector candidates (numMVPCandLX) included in the motion vector candidate list is greater than the maximum number of motion vector candidates (maxNumMVPCand), the motion vector candidate list can be adjusted by removing some of the motion vector candidates. At this time, the motion vector candidates to be removed may be motion vector candidates having an index value greater than a number one less than the maximum number of motion vector candidates (maxNumMVPCand - 1). Additionally, if the number of included motion candidates is equal to the maximum number of motion vector candidates, a final motion vector candidate is derived. At this time, if the maximum number of motion vector candidates (maxNumMVPCand) is 2, a maximum of 2 motion vector candidates can be derived. At this time, the derived motion vector candidates may be included in the motion vector candidate list, and one of the derived motion vector candidates may be determined as the predicted motion vector of the prediction block. According to another embodiment of the present invention, if the number of motion vector candidates (numMVPCandLX) included in the motion vector candidate list is greater than or equal to the maximum number of motion vector candidates (maxNumMVPCand), the motion vector candidate list can be adjusted by removing some of the motion vector candidates. Similarly, since there is no need to remove motion vector candidates when the number of motion vector candidates (numMVPCandLX) included in the motion vector candidate list is equal to the maximum number of motion vector candidates (maxNumMVPCand), the motion vector candidate list can be adjusted by removing some of the motion vector candidates only when the number of motion vector candidates (numMVPCandLX) included in the motion vector candidate list is greater than the maximum number of motion vector candidates (maxNumMVPCand). Through the above process, since motion vector candidates are added to the motion vector candidate list by comparing only the number of motion vector candidates and the maximum number of motion vector candidates within the motion vector candidate list, a duplicate check to determine whether a specific motion vector candidate ((0,0) motion vector) to be added exists in the motion vector candidate list can be omitted, thereby reducing the computational complexity in motion vector prediction. In addition, by comparing only the number of motion vector candidates in the motion vector candidate list with the maximum number of motion vector candidates, the list empty check performed during the intermediate stage of constructing the motion vector candidate list may be omitted, thereby further reducing the computational complexity of motion vector prediction. FIG. 10 is a schematic diagram illustrating an additional example of a (0,0) motion vector when there is one motion vector candidate in the motion vector candidate list. The encoder and decoder may adjust the size of the motion vector candidate list (mvpListLX) by adding motion vectors to the motion vector candidate list or removing some of them. Here, numMVPCandLX represents the number of motion vector candidates in the motion vector candidate list corresponding to either reference picture list L0 or L1, and the size of the maximum motion vector candidate list can be determined by a predetermined number, the maximum number of motion vector candidates (maxNumMVPCand). For example, the number of motion vector candidates in the motion vector candidate list corresponding to reference picture list L0 can be expressed as numMVPCandL0. In this case, numMVPCandLX and maxNumMVPCand may be positive integers including 0, and as an example, maxNumMVPCand may be 2. Referring to FIG. 10, in one embodiment of the present invention, when the maximum number of motion vector candidates (maxNumMVPCand) is 2, the number of motion vector candidates (numMVPCandLX) included in the motion vector candidate list (1000) is 1. Since the number of motion vector candidates included in the motion vector candidate list (1000) is smaller than the maximum number of motion vector candidates (maxNumMVPCand), a specific motion vector can be added to the motion vector candidate list (1000) and the number of motion vector candidates (numMVPCandLX) can be increased by 1. Accordingly, a motion vector candidate list (1010) with a size adjusted by adding a specific motion vector can be generated. At this time, the specific motion vector added may be a vector having a predetermined fixed integer value and may be a (0,0) motion vector. FIG. 11 is a schematic diagram illustrating an additional example of a (0,0) motion vector when there is one (0,0) motion vector candidate in the motion vector candidate list. Referring to FIG. 11, in another embodiment of the present invention, the maximum number of motion vector candidates (maxNumMVPCand) is 2, and the number of motion vector candidates (numMVPCandLX) included in the motion vector candidate list (1100) is smaller than the maximum number of motion vector candidates (maxNumMVPCand), and there may be one specific motion vector ((0,0) motion vector) within the motion vector candidate list (1100). In this case, the encoder and decoder may add the specific motion vector regardless of whether the specific motion vector ((0,0) motion vector) exists within the motion vector candidate list (1100). Accordingly, one additional specific motion vector may be added to generate a size-adjusted motion vector candidate list (1110). At this time, the specific motion vector added may be a vector having a predetermined fixed integer value and may be a (0,0) motion vector. While adding the specific motion vector, the number of motion vector candidates (numMVPCandLX) may be increased. Accordingly, the motion vector candidate list (1110) may contain (0,0) motion vectors up to the maximum number of motion vector candidates (maxNumMVPCand). Since the encoder and decoder add a specific motion vector by comparing only the maximum number of motion vector candidates (maxNumMVPCand) and the number of motion vector candidates included in the motion vector candidate list (numMVPCandLX), they do not determine whether a specific motion vector exists in the list, thereby reducing computational complexity. FIG. 12 is a schematic diagram illustrating an additional example of a (0,0) motion vector when no motion vector exists in the motion vector candidate list. Referring to FIG. 12, in another embodiment of the present invention, the maximum number of motion vector candidates (maxNumMVPCand) is 2, and the number of motion vector candidates (numMVPCandLX) included in the motion vector candidate list (1200) is smaller than the maximum number of motion vector candidates (maxNumMVPCand), and there may be no motion vectors in the motion vector candidate list (1200). In this case, the encoder and decoder may repeatedly add a specific motion vector regardless of whether there are motion vector candidates in the motion vector candidate list (1200). While adding the specific motion vector, the number of motion vector candidates (numMVPCandLX) may be increased. That is, the encoder and decoder may add the specific motion vector until the number of motion vector candidates (numMVPCandLX) included in the motion vector candidate list reaches the maximum number of motion vector candidates (maxNumMVPCand). As in the above embodiment, when the maximum number of motion vector candidates (maxNumMVPCand) is 2, two specific motion vectors can be added. At this time, the specific motion vectors added may be vectors having a predetermined fixed integer value, or may be (0,0) motion vectors. Accordingly, the motion vector candidate list (1210) may contain (0,0) motion vectors equal to the maximum number of motion vector candidates (maxNumMVPCand). Since the encoder and decoder add specific motion vectors by comparing only the maximum number of motion vector candidates (maxNumMVPCand) and the number of motion vector candidates (numMVPCandLX) included in the motion vector candidate list, they do not determine whether motion vector candidates exist within the list, thereby reducing computational complexity. Although not illustrated in the drawings, according to another embodiment of the present invention, if the maximum number of motion vector candidates (maxNumMVPCand) is 2 and the number of motion vector candidates (numMVPCandLX) included in the motion vector candidate list is less than the maximum number of motion vector candidates (maxNumMVPCand), one specific motion vector can be added. While adding the specific motion vector, the number of motion vector candidates (numMVPCandLX) can be increased. That is, instead of repeatedly adding the specific motion vector, only one specific motion vector can be added. For example, if there is no motion vector in the motion vector candidate list, the encoder and decoder can add one specific motion vector regardless of whether a motion vector candidate exists in the motion vector candidate list. While adding the specific motion vector, the number of motion vector candidates (numMVPCandLX) can be increased. At this time, the specific motion vector added may be a vector having a predetermined fixed integer value and may be a (0,0) motion vector. Even in such cases, the encoder and decoder can reduce computational complexity because they add a specific motion vector by comparing only the maximum number of motion vector candidates (maxNumMVPCand) with the number of motion vector candidates included in the motion vector candidate list (numMVPCandLX), and thus do not determine whether a motion vector candidate exists within the list. FIG. 13 is a schematic diagram illustrating an example of removing some motion vector candidates from a list of motion vector candidates. Referring to FIG. 13, in one embodiment of the present invention, an encoder and a decoder can remove from the motion vector candidate list (1300) a motion vector candidate having an index value greater than a value one less than the maximum number of motion vector candidates (maxNumMVPCand - 1) when the number of motion vector candidates (numMVPCandLX) included in the motion vector candidate list (1300) is greater than the maximum number of motion vector candidates (maxNumMVPCand). For example, when the maximum number of motion vector candidates (maxNumMVPCand) is 2 and the number of motion vector candidates (numMVPCandLX) included in the motion vector candidate list (1300) is 3, a motion vector candidate (4, -3) having an index value greater than 1, which is one less than the maximum number of motion vector candidates (maxNumMVPCand - 1), can be removed from the motion vector candidate list (1300) to generate a scaled motion vector candidate list (1310). According to another embodiment of the present invention, when the number of motion vector candidates (numMVPCandLX) included in the motion vector candidate list is greater than or equal to the maximum number of motion vector candidates (maxNumMVPCand), the encoder and decoder may remove motion vector candidates having an index value greater than a value (maxNumMVPCand - 1) that is 1 less than the maximum number of motion vector candidates from the motion vector candidate list. Figure 14 is a schematic diagram illustrating the process of determining a predicted motion vector among motion vector candidates in a motion vector candidate list. Referring to FIG. 14, the encoder and decoder can determine a predicted motion vector from a motion vector candidate included in a motion vector candidate list (1400) adjusted through the above process. According to one embodiment, the encoder and decoder may determine a motion vector candidate within a motion vector candidate list (1400) corresponding to a specific motion vector candidate index as a predicted motion vector. For example, if the maximum number of motion vector candidates (maxNumMVPCand) is 2 and the motion vector candidate index is 1, motion vector candidates (2,3) may be determined as predicted motion vectors. The encoder and decoder can generate a prediction block by performing inter-prediction or motion compensation based on the prediction motion vector values determined as above. In the embodiments described above, methods are described based on flowcharts as a series of steps or blocks; however, the present invention is not limited to the order of the steps, and some steps may occur in a different order or simultaneously with other steps as described above. Furthermore, those skilled in the art will understand that the steps shown in the flowcharts are not exclusive, that other steps may be included, or that one or more steps of the flowcharts may be omitted without affecting the scope of the present invention. The embodiments described above include examples of various aspects. While it is not possible to describe all possible combinations for representing various aspects, those skilled in the art will recognize that other combinations are possible. Accordingly, the present invention shall be deemed to include all other substitutions, modifications, and changes falling within the scope of the following claims.
Claims
In a method for decoding an image, A step of recovering the residual block by inversely quantizing and inversely transforming the entropy-decoded residual block; A step of generating a prediction block by performing motion compensation; and The method includes the step of restoring an image by adding the restored residual block to the prediction block, A method for decoding an image characterized by adjusting a list of motion vector candidates by adding specific motion vector candidates or removing some of the motion vector candidates based on the maximum number of motion vector candidates in the list of motion vector candidates associated with the prediction block, and determining the predicted motion vector of the prediction block based on the adjusted list of motion vector candidates in the step of generating the prediction block. In claim 1, the step of generating the prediction block A step of deriving motion vector candidates associated with the above prediction block to construct a motion vector candidate list; A step of removing one identical motion vector candidate among the spatial motion vector candidates included in the above motion vector candidate list; A step of adjusting the motion vector candidate list by adding the specific motion vector candidate to the motion vector candidate list or removing some of them; and A method for decoding an image characterized by including the step of determining a predicted motion vector among motion vector candidates included in the above-mentioned adjusted motion vector candidate list. In claim 2, the step of adjusting the motion vector candidate list is A method for decoding an image characterized by including the step of adding a specific motion vector candidate regardless of whether a motion vector candidate exists in the motion vector candidate list or whether the specific motion vector candidate exists in the motion vector candidate list, when the number of motion vector candidates included in the motion vector candidate list is smaller than the maximum number of motion vector candidates. In claim 3, the step of adjusting the motion vector candidate list is A method for decoding an image characterized by including the step of repeatedly adding the specific motion vector candidate until the number of motion vector candidates included in the motion vector candidate list reaches the maximum number of motion vector candidates when the number of motion vector candidates included in the motion vector candidate list is smaller than the maximum number of motion vector candidates. In Paragraph 3, A method for decoding an image characterized in that the specific motion vector is a (0,0) motion vector and the maximum number of motion vector candidates is 2. In Article 5, A method for decoding an image characterized by adding two specific motion vectors when no motion vector candidates exist in the above motion vector candidate list. A method for decoding an image characterized by adding one more specific motion vector while one specific motion vector exists in the aforementioned motion vector candidate list. In claim 1, the step of adjusting the motion vector candidate list A method for decoding an image characterized by including the step of removing from the motion vector candidate list a motion vector candidate having an index value greater than the index value obtained by subtracting 1 from the maximum number of motion vector candidates when the number of motion vector candidates included in the motion vector candidate list is greater than the maximum number of motion vector candidates value. In an image decoding device, A residual block recovery unit that recovers a residual block by inversely quantizing and inversely transforming an entropy-decoded residual block; A prediction block generation unit that generates a prediction block by performing motion compensation; and The image restoration unit includes a restoration unit that restores an image by adding the restored residual block to the prediction block, An image decoding device characterized by the above-mentioned prediction block generating unit adjusting the motion vector candidate list by adding a specific motion vector candidate or removing some of the motion vector candidates based on the maximum number of motion vector candidates of the motion vector candidate list associated with the prediction block, and determining the predicted motion vector of the prediction block based on the adjusted motion vector candidate list. In claim 9, the prediction block generation unit A motion vector candidate list constructor that derives motion vector candidates related to the above prediction block and constructs a motion vector candidate list; A duplicate motion vector candidate removal unit that removes one identical motion vector candidate among the spatial motion vector candidates included in the above motion vector candidate list; A motion vector candidate list adjustment unit that adjusts the motion vector candidate list by adding the specific motion vector candidate to the motion vector candidate list or removing a part thereof; and An image decoding device characterized by including a predicted motion vector determining unit that determines a predicted motion vector from the above-mentioned adjusted motion vector candidate list. In claim 10, the motion vector candidate list adjustment unit An image decoding device characterized by adding a specific motion vector candidate regardless of whether a motion vector candidate exists in the motion vector candidate list or whether the specific motion vector candidate exists in the motion vector candidate list, when the number of motion vector candidates included in the motion vector candidate list is smaller than the maximum number of motion vector candidates. In claim 11, the motion vector candidate list adjustment unit An image decoding device characterized by repeatedly adding the specific motion vector candidate until the number of motion vector candidates included in the motion vector candidate list reaches the maximum number of motion vector candidates when the number of motion vector candidates included in the motion vector candidate list is smaller than the maximum number of motion vector candidates. In Article 12, An image decoding device characterized in that the specific motion vector is a (0,0) motion vector and the maximum number of motion vector candidates is 2. In Article 13, An image decoding device characterized by adding two specific motion vectors when no motion vector candidates exist in the above motion vector candidate list. An image decoding device characterized by adding one more specific motion vector when one specific motion vector exists in the above motion vector candidate list. In the image encoding method, A step of generating a prediction block by performing inter-frame prediction or motion compensation on an input image; and The method includes the step of converting and quantizing the residual block, which is the difference between the current input block and the prediction block predicted by the above-mentioned inter-screen prediction, to entropy-encode, A method for encoding an image characterized by adjusting a list of motion vector candidates by adding specific motion vector candidates or removing some of the motion vector candidates based on the maximum number of motion vector candidates in the list of motion vector candidates associated with the prediction block, and determining the predicted motion vector of the prediction block based on the adjusted list of motion vector candidates in the step of generating the prediction block. In claim 16, the step of generating the prediction block is A method for encoding an image characterized by including the step of determining a predicted motion vector from the above-mentioned list of adjusted motion vector candidates. In claim 17, the step of adjusting the motion vector candidate list is A method for encoding an image characterized by including the step of adding a specific motion vector candidate regardless of whether a motion vector candidate exists in the motion vector candidate list or whether the specific motion vector candidate exists in the motion vector candidate list, when the number of motion vector candidates included in the motion vector candidate list is smaller than the maximum number of motion vector candidates. In an image encoding device, A prediction block generation unit that generates a prediction block by performing inter-frame prediction or motion compensation on an input image; and It includes an encoding unit that converts and quantizes a residual block, which is the difference between the current input block and the prediction block predicted by the above-mentioned inter-screen prediction, and entropy-encodes it, An image encoding device characterized by the above-mentioned prediction block generation unit adjusting the motion vector candidate list by adding a specific motion vector candidate or removing some of the motion vector candidates based on the maximum number of motion vector candidates of the motion vector candidate list associated with the prediction block, and determining the predicted motion vector of the prediction block based on the adjusted motion vector candidate list.