WO2020139040A1 - 영상 부/복호화 방법 및 장치 - Google Patents

영상 부/복호화 방법 및 장치 Download PDF

Info

Publication number
WO2020139040A1
WO2020139040A1 PCT/KR2019/018644 KR2019018644W WO2020139040A1 WO 2020139040 A1 WO2020139040 A1 WO 2020139040A1 KR 2019018644 W KR2019018644 W KR 2019018644W WO 2020139040 A1 WO2020139040 A1 WO 2020139040A1
Authority
WO
WIPO (PCT)
Prior art keywords
merge
current block
block
prediction
motion vector
Prior art date
Application number
PCT/KR2019/018644
Other languages
English (en)
French (fr)
Inventor
이배근
전동산
Original Assignee
인텔렉추얼디스커버리 주식회사
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 인텔렉추얼디스커버리 주식회사 filed Critical 인텔렉추얼디스커버리 주식회사
Priority to US17/418,540 priority Critical patent/US11812031B2/en
Priority to CN201980086601.XA priority patent/CN113228642A/zh
Publication of WO2020139040A1 publication Critical patent/WO2020139040A1/ko
Priority to US18/476,044 priority patent/US20240022730A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/103Selection of coding mode or of prediction mode
    • H04N19/109Selection of coding mode or of prediction mode among a plurality of temporal predictive coding modes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/136Incoming video signal characteristics or properties
    • H04N19/137Motion inside a coding unit, e.g. average field, frame or block difference
    • H04N19/139Analysis of motion vectors, e.g. their magnitude, direction, variance or reliability
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/503Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal prediction
    • H04N19/51Motion estimation or motion compensation
    • H04N19/513Processing of motion vectors
    • H04N19/517Processing of motion vectors by encoding
    • H04N19/52Processing of motion vectors by encoding by predictive encoding
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/117Filters, e.g. for pre-processing or post-processing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/119Adaptive subdivision aspects, e.g. subdivision of a picture into rectangular or non-rectangular coding blocks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/12Selection from among a plurality of transforms or standards, e.g. selection between discrete cosine transform [DCT] and sub-band transform or selection between H.263 and H.264
    • H04N19/122Selection of transform size, e.g. 8x8 or 2x4x8 DCT; Selection of sub-band transforms of varying structure or type
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • H04N19/176Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a block, e.g. a macroblock
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/46Embedding additional information in the video signal during the compression process
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/503Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal prediction
    • H04N19/51Motion estimation or motion compensation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/503Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal prediction
    • H04N19/51Motion estimation or motion compensation
    • H04N19/513Processing of motion vectors
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/70Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by syntax aspects related to video coding, e.g. related to compression standards

Definitions

  • the present invention relates to a video signal processing method and apparatus.
  • Video compression is largely composed of intra prediction (or intra prediction), inter prediction (or inter prediction), transformation, quantization, entropy coding, and in-loop filter.
  • intra prediction or intra prediction
  • inter prediction or inter prediction
  • transformation or quantization
  • quantization or in-loop filter
  • An object of the present invention is to provide a method and apparatus for adaptively splitting a picture.
  • An object of the present invention is to provide an intra prediction method and apparatus.
  • An object of the present invention is to provide an inter prediction method and apparatus.
  • An object of the present invention is to provide an inter prediction method and apparatus using a merge mode based on a motion vector difference value (MVD).
  • VMD motion vector difference value
  • the video encoding/decoding method and apparatus construct a merge candidate list of a current block, derive motion information of the current block based on the merge index of the current block and the merge candidate list, and the current A motion vector difference value of a block may be derived, the motion vector of the current block may be corrected using the motion vector difference value, and motion compensation of the current block may be performed using the corrected motion vector.
  • the motion information may include at least one of a motion vector or a reference picture index.
  • the merge candidate list may include at least one of a spatial merge candidate and a temporal merge candidate of the current block.
  • motion information of a previous block belonging to a motion information list of the current block is further added to the merge candidate list, and the previous block is decoded before the current block. It can be one or more blocks.
  • the step of deriving the motion vector difference value is selectively performed based on a predetermined flag, and whether the flag uses a motion vector difference value in merge mode or not. Can represent.
  • the maximum number of merge candidates available for the current block may be adaptively determined.
  • the motion vector difference value is derived based on a merge offset vector, and the merge offset vector can be determined based on the length and direction of the merge offset vector. .
  • the length of the merge offset vector may be determined in consideration of at least one of an encoded distance index or a precision of a motion vector of the current block.
  • the direction of the merge offset vector is determined based on the encoded direction index, and the direction can be determined in any one of left, right, up, or down directions. have.
  • the motion vector difference value is derived by applying a predetermined scaling factor to the merge offset vector, wherein the scaling factor is the current picture to which the current block belongs and the current It may be determined based on a difference in POC between reference pictures of a block.
  • a digital storage medium for storing a video bitstream constructs a merge candidate list of a current block, derives motion information of the current block based on the merge index of the current block and the merge candidate list, A process of deriving a motion vector difference value of the current block, correcting a motion vector of the current block using the motion vector difference value, and performing a process of performing motion compensation of the current block using the corrected motion vector Can record/store the video decoding program.
  • encoding/decoding efficiency of a video signal can be improved by dividing a picture into predetermined units and performing encoding/decoding.
  • the present invention can improve the coding efficiency of intra prediction by using a subdivided directional mode and/or selective pixel lines.
  • the present invention can improve encoding efficiency of inter prediction by using affine mode or inter-domain motion information.
  • the present invention can improve the accuracy and encoding efficiency of a motion vector by using a merge mode based on a motion vector difference value (MVD).
  • VMD motion vector difference value
  • FIG. 1 is a block diagram showing an image encoding apparatus according to the present invention.
  • FIG. 2 is a block diagram showing an image decoding apparatus according to the present invention.
  • 3 to 5 is an embodiment to which the present invention is applied, and shows a method of dividing a picture into a plurality of blocks.
  • 6 to 8 is an embodiment to which the present invention is applied, and shows an affine inter prediction method.
  • FIG. 9 illustrates an image encoding/decoding method using a merge mode based on a motion vector difference value (MVD) as an embodiment to which the present invention is applied.
  • VMD motion vector difference value
  • 10 to 14 is an embodiment to which the present invention is applied, and shows a previous block usable as a merge candidate.
  • 15 to 19 is an embodiment to which the present invention is applied, and shows a merge offset vector derivation method for a merge mode.
  • 20 to 24 is an embodiment to which the present invention is applied, and shows an intra prediction method.
  • 25 to 28 is an embodiment to which the present invention is applied, and shows an intra prediction method based on a wide angle.
  • 29 and 30 is an embodiment to which the present invention is applied, and shows a method of applying an in-loop filter to a reconstructed block.
  • the video encoding/decoding method and apparatus construct a merge candidate list of a current block, derive motion information of the current block based on the merge index of the current block and the merge candidate list, and the current A motion vector difference value of a block may be derived, the motion vector of the current block may be corrected using the motion vector difference value, and motion compensation of the current block may be performed using the corrected motion vector.
  • the motion information may include at least one of a motion vector or a reference picture index.
  • the merge candidate list may include at least one of a spatial merge candidate and a temporal merge candidate of the current block.
  • motion information of a previous block belonging to a motion information list of the current block is further added to the merge candidate list, and the previous block is decoded before the current block. It can be one or more blocks.
  • the step of deriving the motion vector difference value is selectively performed based on a predetermined flag, and whether the flag uses a motion vector difference value in merge mode or not. Can represent.
  • the maximum number of merge candidates available for the current block may be adaptively determined.
  • the motion vector difference value is derived based on a merge offset vector, and the merge offset vector can be determined based on the length and direction of the merge offset vector. .
  • the length of the merge offset vector may be determined in consideration of at least one of an encoded distance index or a precision of a motion vector of the current block.
  • the direction of the merge offset vector is determined based on the encoded direction index, and the direction can be determined in any one of left, right, up, or down directions. have.
  • the motion vector difference value is derived by applying a predetermined scaling factor to the merge offset vector, wherein the scaling factor is the current picture to which the current block belongs and the current It may be determined based on a difference in POC between reference pictures of a block.
  • a digital storage medium for storing a video bitstream constructs a merge candidate list of a current block, derives motion information of the current block based on the merge index of the current block and the merge candidate list, A process of deriving a motion vector difference value of the current block, correcting a motion vector of the current block using the motion vector difference value, and performing a process of performing motion compensation of the current block using the corrected motion vector
  • the video decoding program to be recorded/stored.
  • first and second may be used to describe various components, but the components should not be limited by the terms. The terms are used only for the purpose of distinguishing one component from other components.
  • a part of the configuration of the apparatus or a part of the method may be omitted.
  • the order of some of the components of the device or the steps of the method may be changed.
  • other configurations or other steps may be inserted in some of the configuration of the device or in some of the steps of the method.
  • each component shown in the embodiments of the present invention are shown independently to indicate different characteristic functions, and do not mean that each component is composed of separate hardware or one software component unit. That is, for convenience of description, each component is listed as each component, and at least two components of each component may be combined to form one component, or one component may be divided into a plurality of components to perform a function.
  • the integrated and separate embodiments of each of these components are also included in the scope of the present invention without departing from the essence of the present invention.
  • blocks may be variously expressed in units, regions, units, partitions, and the like, and samples may be variously expressed in pixels, pels, pixels, and the like.
  • FIG. 1 is a block diagram showing an image encoding apparatus according to the present invention.
  • the conventional image encoding apparatus 100 includes a picture division unit 110, a prediction unit 120, 125, a transformation unit 130, a quantization unit 135, a reordering unit 160, and an entropy encoding unit 165, an inverse quantization unit 140, an inverse conversion unit 145, a filter unit 150, and a memory 155.
  • the picture division unit 110 may divide the input picture into at least one processing unit.
  • the processing unit may be a prediction unit (PU), a transformation unit (TU), or a coding unit (CU).
  • a coding unit may be used as a meaning of a unit that performs coding, or may be used as a meaning of a unit that performs decoding.
  • the prediction unit may be divided into at least one square or rectangular shape having the same size within one coding unit, and one prediction unit among the prediction units split within one coding unit may be another prediction unit. It may be divided into units having different shapes and/or sizes.
  • intra prediction may be performed without dividing into a plurality of prediction units NxN.
  • the prediction units 120 and 125 may include an inter prediction unit 120 that performs inter prediction or inter-screen prediction, and an intra prediction unit 125 that performs intra prediction or intra-screen prediction. It is determined whether to use inter prediction or intra prediction for a prediction unit, and specific information (eg, intra prediction mode, motion vector, reference picture, etc.) according to each prediction method may be determined.
  • the residual value (residual block) between the generated prediction block and the original block may be input to the transform unit 130.
  • prediction mode information, motion vector information, and the like used for prediction may be encoded by the entropy encoding unit 165 together with the residual value and transmitted to the decoder.
  • the inter-prediction unit 120 may predict a prediction unit based on information of at least one of a previous picture or a subsequent picture of the current picture, and in some cases, predicts the prediction unit based on information of some regions that have been coded in the current picture. Units can also be predicted.
  • the inter prediction unit 120 may include a reference picture interpolation unit, a motion prediction unit, and a motion compensation unit.
  • the reference picture interpolator may receive reference picture information from the memory 155 and generate pixel information of an integer pixel or less in the reference picture.
  • a DCT-based 8-tap interpolation filter (DCT-based interpolation filter) having different filter coefficients may be used to generate pixel information of integer pixels or less in units of 1/4 pixels.
  • a DCT-based interpolation filter (DCT-based interpolation filter) having different filter coefficients may be used to generate pixel information of an integer pixel or less in units of 1/8 pixels.
  • the motion prediction unit may perform motion prediction based on the reference picture interpolated by the reference picture interpolation unit.
  • various methods such as Full Search-based Block Matching Algorithm (FBMA), Three Step Search (TSS), and New Three-Step Search Algorithm (NTS) can be used.
  • the motion vector may have a motion vector value in units of 1/2 or 1/4 pixels based on the interpolated pixels.
  • the motion prediction unit may predict a current prediction unit by differently using a motion prediction method.
  • various methods such as a skip mode, a merge mode, an AMVP mode, an intra block copy mode, and an affine mode can be used.
  • the intra prediction unit 125 may generate a prediction unit based on reference pixel information around a current block, which is pixel information in a current picture. If the neighboring block of the current prediction unit is a block that has undergone inter prediction, and the reference pixel is a pixel that has undergone inter prediction, the reference pixel included in the block that has undergone inter prediction is a reference pixel of the block that has performed intra prediction around it. Can be used as a substitute for information. That is, when the reference pixel is not available, the available reference pixel information may be replaced with at least one reference pixel among the available reference pixels.
  • a residual block including prediction units that perform prediction based on prediction units generated by the prediction units 120 and 125 and residual information that is a difference value from the original block of the prediction unit may be generated.
  • the generated residual block may be input to the conversion unit 130.
  • the transform unit 130 includes a residual block including residual information of a prediction unit generated through the original block and the prediction units 120 and 125, and DCT (Discrete Cosine Transform), DST (Discrete Sine Transform), and KLT. It can be converted using the same conversion method. Whether DCT, DST, or KLT is applied to transform the residual block may be determined based on intra prediction mode information of a prediction unit used to generate the residual block.
  • DCT Discrete Cosine Transform
  • DST Discrete Sine Transform
  • KLT Discrete Sine Transform
  • the quantization unit 135 may quantize values converted from the conversion unit 130 to the frequency domain.
  • the quantization coefficient may vary depending on the block or the importance of the image.
  • the value calculated by the quantization unit 135 may be provided to the inverse quantization unit 140 and the rearrangement unit 160.
  • the rearrangement unit 160 may rearrange the coefficient values with respect to the quantized residual value.
  • the reordering unit 160 may change a block shape coefficient of 2D into a vector form of 1D through a coefficient scanning method.
  • the rearrangement unit 160 may scan a DC coefficient to a coefficient in a high frequency region using a Zig-Zag Scan method and change it into a one-dimensional vector form.
  • a vertical scan in which two-dimensional block shape coefficients are scanned in the column direction and a horizontal scan in which two-dimensional block shape coefficients are scanned in the row direction may be used instead of the zig-zag scan. That is, depending on the size of the transform unit and the intra-prediction mode, it is possible to determine whether a scan method is used among zigzag scan, vertical scan, and horizontal scan.
  • the entropy encoding unit 165 may perform entropy encoding based on values calculated by the reordering unit 160.
  • various encoding methods such as exponential Golomb, CAVLC (Context-Adaptive Variable Length Coding), and CABAC (Context-Adaptive Binary Arithmetic Coding) can be used.
  • the entropy encoding unit 165 may encode residual value coefficient information of a coding unit from the reordering unit 160 and the prediction units 120 and 125.
  • the inverse quantization unit 140 and the inverse transformation unit 145 inverse quantize the values quantized by the quantization unit 135 and inversely transform the values converted by the conversion unit 130.
  • the residual values generated by the inverse quantization unit 140 and the inverse transformation unit 145 are restored by being combined with the prediction units predicted through the motion estimation unit, the motion compensation unit, and the intra prediction unit included in the prediction units 120 and 125 You can create a Reconstructed Block.
  • the filter unit 150 may include at least one of a deblocking filter, an offset correction unit, and an adaptive loop filter (ALF).
  • the deblocking filter can remove block distortion caused by boundary between blocks in the reconstructed picture.
  • the offset correction unit may correct an offset from the original image in units of pixels for the deblocking image. In order to perform offset correction for a specific picture, after dividing the pixels included in the image into a certain number of regions, determining the region to perform the offset and applying the offset to the region, or offset by considering the edge information of each pixel You can use the method of applying.
  • ALF Adaptive Loop Filtering
  • the memory 155 may store the reconstructed block or picture calculated through the filter unit 150, and the stored reconstructed block or picture may be provided to the predictors 120 and 125 when performing inter prediction.
  • FIG. 2 is a block diagram showing an image decoding apparatus according to the present invention.
  • the image decoder 200 includes an entropy decoding unit 210, a reordering unit 215, an inverse quantization unit 220, an inverse transform unit 225, a prediction unit 230, 235, and a filter unit ( 240), a memory 245 may be included.
  • the input bitstream may be decoded in a procedure opposite to that of the image encoder.
  • the entropy decoding unit 210 may perform entropy decoding in a procedure opposite to that performed by entropy encoding in the entropy encoding unit of the image encoder. For example, various methods such as Exponential Golomb (CAVLC), Context-Adaptive Variable Length Coding (CAVLC), and Context-Adaptive Binary Arithmetic Coding (CABAC) may be applied to the method performed in the image encoder.
  • CAVLC Exponential Golomb
  • CAVLC Context-Adaptive Variable Length Coding
  • CABAC Context-Adaptive Binary Arithmetic Coding
  • the entropy decoding unit 210 may decode information related to intra prediction and inter prediction performed by the encoder.
  • the reordering unit 215 may perform reordering based on a method of reordering the bitstream entropy-decoded by the entropy decoding unit 210 in the encoding unit.
  • the coefficients expressed in the form of a one-dimensional vector can be reconstructed by reconstructing the coefficients in a two-dimensional block form again.
  • the inverse quantization unit 220 may perform inverse quantization based on the quantization parameter provided by the encoder and the coefficient values of the rearranged blocks.
  • the inverse transform unit 225 may perform inverse transform, that is, inverse DCT, inverse DST, and inverse KLT, for transforms performed by the transform unit for the quantization results performed by the image encoder, that is, DCT, DST, and KLT.
  • the inverse transform may be performed based on the transmission unit determined by the image encoder.
  • a transform method for example, DCT, DST, KLT
  • a plurality of information such as a prediction method, a current block size, and a prediction direction.
  • the prediction units 230 and 235 may generate prediction blocks based on prediction block generation related information provided by the entropy decoding unit 210 and previously decoded block or picture information provided by the memory 245.
  • Intra-prediction of the prediction unit is performed based on the pixel existing at the top, but when the size of the prediction unit and the size of the transformation unit are different when performing intra prediction, intra prediction is performed using a reference pixel based on the transformation unit. You can make predictions.
  • intra prediction using NxN splitting may be used only for the smallest coding unit.
  • the prediction units 230 and 235 may include a prediction unit determination unit, an inter prediction unit, and an intra prediction unit.
  • the prediction unit discrimination unit receives various information such as prediction unit information input from the entropy decoding unit 210, prediction mode information of the intra prediction method, and motion prediction related information of the inter prediction method, classifies the prediction unit from the current coding unit, and predicts the prediction unit. It is possible to determine whether the unit performs inter prediction or intra prediction. On the other hand, if the encoder 100 does not transmit the motion prediction related information for the inter prediction, instead, it transmits information indicating that the motion information is derived and used in the decoder side and information about a technique used to derive the motion information. In the case, the prediction unit discrimination unit determines the prediction performance of the inter prediction unit 230 based on the information transmitted from the encoder 100.
  • the inter predictor 230 predicts the current prediction based on information included in at least one of a previous picture or a subsequent picture of the current picture including the current prediction unit, using information required for inter prediction of the current prediction unit provided by the image encoder. Inter prediction for a unit may be performed.
  • a motion prediction method of a prediction unit included in a coding unit based on a coding unit is a skip mode, a merge mode, an AMVP mode, and an intra block copy mode ( Intra block copy mode) or affine mode can be determined.
  • the intra prediction unit 235 may generate a prediction block based on pixel information in the current picture.
  • intra prediction may be performed based on intra prediction mode information of a prediction unit provided by an image encoder.
  • the intra prediction unit 235 may include an adaptive intra smoothing (AIS) filter, a reference pixel interpolation unit, and a DC filter.
  • the AIS filter is a part that performs filtering on the reference pixel of the current block and can be applied by determining whether to apply the filter according to the prediction mode of the current prediction unit.
  • AIS filtering may be performed on a reference pixel of a current block by using prediction mode and AIS filter information of a prediction unit provided by an image encoder. When the prediction mode of the current block is a mode that does not perform AIS filtering, the AIS filter may not be applied.
  • the reference pixel interpolation unit may interpolate the reference pixel to generate a reference pixel in a pixel unit equal to or less than an integer value. If the prediction mode of the current prediction unit is a prediction mode in which a prediction block is generated without interpolating a reference pixel, the reference pixel may not be interpolated.
  • the DC filter may generate a prediction block through filtering when the prediction mode of the current block is the DC mode.
  • the reconstructed block or picture may be provided to the filter unit 240.
  • the filter unit 240 may include a deblocking filter, an offset correction unit, and an ALF.
  • Information about whether a deblocking filter is applied to a corresponding block or picture and information about whether a strong filter is applied or a weak filter is applied may be provided from the image encoder.
  • information related to the deblocking filter provided by the video encoder may be provided, and the video decoder may perform deblocking filtering on the corresponding block.
  • the offset correction unit may perform offset correction on the reconstructed image based on the type of offset correction and offset value information applied to the image during encoding.
  • ALF may be applied to a coding unit based on ALF application information provided by an encoder, ALF coefficient information, and the like. This ALF information may be provided by being included in a specific parameter set.
  • the memory 245 may store the restored picture or block so that it can be used as a reference picture or a reference block, and also provide the restored picture to an output unit.
  • 3 to 5 is an embodiment to which the present invention is applied, and shows a method of dividing a picture into a plurality of blocks.
  • the picture 300 is divided into a plurality of basic coding units (Coding Tree Units, hereinafter, CTU).
  • CTU Coding Tree Unit
  • the size of the CTU can be defined in units of picture or video sequence, and each CTU is configured not to overlap with another CTU.
  • the CTU size may be set to 128x128 in the entire sequence, and any one of 128x128 to 256x256 may be selected and used as a picture unit.
  • the CTU may be hierarchically split to generate a coding block/coding unit (CU). Prediction and transformation can be performed in units of coding units, and are a basic unit for determining a prediction encoding mode.
  • the prediction encoding mode represents a method for generating a predictive image, and examples include intra prediction (hereinafter, intra prediction), inter prediction (hereinafter, inter prediction), or composite prediction. have.
  • a prediction block may be generated using at least one prediction coding mode of intra prediction, inter prediction, or complex prediction in units of coding units.
  • a prediction block may be generated based on an area in the current picture that has already been decoded.
  • Intra prediction is a method of generating a prediction block using information of a current picture
  • inter prediction is a method of generating a prediction block using information of another decoded picture
  • complex prediction is a mixture of inter prediction and intra prediction How to use.
  • some regions among a plurality of sub-regions constituting one coding block may be encoded/decoded by inter prediction, and the remaining regions may be encoded/decoded by intra prediction.
  • the composite prediction may first perform inter prediction on a plurality of sub-regions, and intra prediction second.
  • the predicted value of the coding block may be derived by weighted average of the predicted value according to inter prediction and the predicted value according to intra prediction.
  • the number of sub-regions constituting one coding block may be 2, 3, 4 or more, and the shape of the sub-regions may be square, triangle, or other polygon.
  • the CTU may be divided (partitioned) into a quad tree, binary tree, or triple tree form.
  • the divided blocks may be further divided into quad trees, binary trees, or triple trees.
  • the method of dividing the current block into 4 square partitions is called quad-tree partitioning, and the method of dividing the current block into 2 square or non-square partitions is called binary tree partitioning, and the method of dividing the current block into 3 partitions is binary This is called tree partitioning.
  • Binary partitioning in the vertical direction (SPLIT_BT_VER in FIG. 4) is called vertical binary tree partitioning, and binary tree partitioning in the horizontal direction (SPLIT_BT_HOR in FIG. 4) is called horizontal binary tree partitioning.
  • Triple partitioning in the vertical direction (SPLIT_TT_VER in FIG. 4) is called vertical triple tree partitioning, and triple tree partitioning in the horizontal direction (SPLIT_TT_HOR in FIG. 4) is called horizontal triple tree partitioning.
  • the number of divisions is called a partitioning depth, and the maximum value of the partitioning depth can be set differently for each sequence, picture, sub-picture, slice, or tile, and each other according to the partitioning tree type (quad tree/binary tree/triple tree). It can be set to have a different partitioning depth, and the syntax representing this can be signaled.
  • a coding unit may be set by hierarchically dividing one CTU, and a coding unit may be split using at least one of binary tree partitioning, quad tree partitioning, and triple tree partitioning. This method is called multi-tree partitioning.
  • the coding unit generated by dividing any coding unit having a partitioning depth k is referred to as a lower coding unit, and the partitioning depth is (k+1).
  • a coding unit having a partitioning depth k that includes a lower coding unit having a partitioning depth (k+1) is called a higher coding unit.
  • the partitioning type of the current coding unit may be limited according to the partitioning type of the higher coding unit and/or the partitioning type of the coding unit around the current coding unit.
  • the partitioning type indicates an indicator indicating which partitioning is used among binary tree partitioning, quad tree partitioning, or triple tree partitioning.
  • a prediction image can be generated in a plurality of ways, and a method for generating a prediction image is called a prediction encoding mode.
  • the prediction encoding mode may be configured as an intra prediction encoding mode, an inter prediction encoding mode, a current picture reference encoding mode, or a combined prediction mode.
  • the inter prediction encoding mode is called a prediction encoding mode that generates a prediction block (prediction image) of a current block using information of a previous picture
  • the intra prediction encoding mode is a prediction that generates a prediction block using samples neighboring the current block. It is called an encoding mode.
  • a prediction block may be generated using an already reconstructed image of the current picture, and this is called a current picture reference mode or an intra block copy mode.
  • a prediction block may be generated using at least two or more prediction encoding modes among an inter prediction encoding mode, an intra prediction encoding mode, or a current picture reference encoding mode, which is called a combined prediction mode.
  • a method of generating a prediction block (prediction image) of a block in a current picture using information of a previous picture is called an inter prediction encoding mode.
  • a predictive image may be generated based on a corresponding block of a previous picture, or a predictive block (predicted image) may be generated based on a specific block of a previous picture.
  • a block obtained by subtracting a corresponding block of a previous picture from a current block is called a corresponding prediction block.
  • a prediction block may be generated in consideration of object movement.
  • a prediction block (prediction image) may be generated by differentiating a block considering motion in the current block, which is called a motion prediction block.
  • a residual block may be generated by differentiating a motion prediction block or a corresponding prediction block from a current block.
  • the method using the motion prediction block is called motion compensation prediction, and motion compensation prediction is used in most inter prediction encoding.
  • a value indicating the direction and extent to which the object in the previous picture has moved in the current picture is called a motion vector.
  • motion vectors having different pixel precisions may be used in units of a sequence, a picture, a sub-picture, a slice, a tile, a CTU, or a CU.
  • the pixel precision of a motion vector in a specific block may be at least any one of 1/16, 1/8, 1/4, 1/2, 1, 2, 4 or 8.
  • the type and/or number of available pixel precision candidates may be different for each of the inter prediction encoding modes described below. For example, for the affine inter prediction method, k pixel precisions are available, and for the inter prediction method using translation motion, i pixel precisions are available.
  • j pixel precisions are available.
  • k, i and j may be 1, 2, 3, 4, 5, or more natural numbers.
  • k may be smaller than i and i may be smaller than j.
  • the affine inter prediction method uses at least one pixel precision of 1/16, 1/4, or 1, and the inter prediction method using translation motion (eg, merge mode, AMVP mode) is 1/4, 1/2, Pixel precision of at least one of 1 or 4 may be used.
  • the current picture reference mode may use pixel precision of at least one of 1, 4, or 8.
  • the inter prediction method using the translaton motion and the affine inter prediction method using the affine motion may be selectively used.
  • 6 to 8 is an embodiment to which the present invention is applied, and shows an affine inter prediction method.
  • the affine movement can be expressed as Equation 1 below.
  • affine motion can be simplified and expressed with four parameters, and this is called a four-parameter affine motion model. Equation 2 expresses the affine movement with four parameters.
  • the 4-parameter affine motion model may include motion vectors at two control points of the current block.
  • the control point may include at least one of a top left corner, a top right corner, or a bottom left corner of the current block.
  • the 4-parameter affine motion model is shown in the motion vector sv0 in the upper left sample (x0,y0) of the coding unit and the motion vector sv1 in the upper right sample (x1,y1) of the coding unit, as shown in the left figure of FIG. 7. It can be determined by, and sv 0 and sv 1 are called affine seed vectors.
  • the affine seed vector sv 0 located at the upper left is a first affine seed vector
  • the affine seed vector sv 1 located at the upper right is a second affine seed vector.
  • the 6-parameter affine motion model is an affine motion in which a motion vector sv 2 of a residual control point (eg, sample (x2,y2) at the bottom left) is added to the 4-parameter affine motion model as shown in the right figure of FIG. 7. It is a model. Located below the upper left affine seed vector sv 0 a first affine seed vector called home, located in the upper right affine seed vector sv 1 a second affine seed vector called home, and the affine located in the lower left seed vector Assume sv 2 is a third affine seed vector.
  • a motion vector sv 2 of a residual control point eg, sample (x2,y2) at the bottom left
  • Information regarding the number of parameters for expressing affine motion may be encoded in a bitstream.
  • a flag indicating whether to use 6-parameters or a flag indicating whether to use 4-parameters may be encoded/decoded in at least one unit of a picture, subpicture, slice, tile set, tile, coding unit, or CTU. Accordingly, either a 4-parameter affine motion model or a 6-parameter affine motion model may be selectively used as a predetermined unit.
  • the motion vector may be derived for each sub-block of the coding unit by using the affine seed vector, which is called an affine sub-block vector.
  • the affine sub-block vector may be derived as shown in Equation 3 below.
  • the reference sample position (x,y) of the sub-block may be a sample located at the corner of the block (eg, the upper left sample) or a sample (eg, a central sample) in which at least one of the x-axis or the y-axis is central. .
  • Motion compensation may be performed in a coding unit unit or a sub-block unit in a coding unit using an affine sub-block vector, which is called affine inter prediction mode.
  • (x 1 -x 0 ) may have a value equal to the width of the coding unit.
  • FIG. 9 illustrates an image encoding/decoding method using a merge mode based on a motion vector difference value (MVD) as an embodiment to which the present invention is applied.
  • VMD motion vector difference value
  • motion information of a current coding unit can be derived from motion information of a neighboring block.
  • Motion information of any one of the neighboring blocks may be set as motion information of the current coding unit, and this is called a merge mode. That is, the merge mode uses the motion information of the neighboring blocks as the motion information of the current block, and unlike the AMVP mode, does not require encoding a separate motion vector difference value.
  • a predetermined motion vector difference value may be used to improve the accuracy of the motion vector.
  • the motion information may be understood to include at least one of a motion vector, a reference picture index, or prediction direction information.
  • the MVD may be selectively used based on a predetermined flag (hereinafter MVD_flag).
  • MVD_flag may indicate whether to use a motion vector difference value (MVD) in merge mode. For example, if the flag is the first value, a motion vector difference value is used in merge mode, otherwise, a motion vector difference value is not used in merge mode.
  • a merge candidate list of a current block may be configured (S900).
  • the merge candidate list may include one or more merge candidates available for deriving motion information of the current block.
  • the size of the merge candidate list may be variably determined based on information (hereinafter, size information) indicating the maximum number of merge candidates constituting the merge candidate list.
  • size information may be encoded and signaled by an encoding device, or may be a fixed value (eg, an integer of 2, 3, 4, 5, 6, or more) pre-promised in the decoding device.
  • the plurality of merge candidates included in the merge candidate list may include at least one of a spatial merge candidate or a temporal merge candidate.
  • the spatial merge candidate may mean neighboring blocks spatially adjacent to the current block or motion information of the neighboring blocks.
  • the neighboring block may include at least one of the lower left block A0, the left block A1, the upper right block B0, the upper block B1, or the upper left block B2 of the current block.
  • available neighboring blocks among the neighboring blocks may be sequentially added to the merge candidate list. For example, priority is B1->A1->B0->A1->B2, A1->B1->A0->B1->B2, A1->B1->B0->A0->B2, etc. It may be defined as, but is not limited to.
  • the temporal merge candidate may mean one or more co-located blocks belonging to a co-located picture or motion information of the call block.
  • the call picture is any one of a plurality of reference pictures belonging to the reference picture list, which may be a picture different from the picture to which the current block belongs.
  • the call picture may be the first picture or the last picture in the reference picture list. Or, the call picture may be specified based on an index that is coded to indicate the call picture.
  • the call block may include at least one of a block C1 including a central position of the current block or a neighboring block C0 adjacent to a lower right corner of the current block. According to a predetermined priority order, available blocks among the C0 and C1 may be sequentially added to the merge candidate list. For example, C0 may have a higher priority than C1. However, it is not limited thereto, and C1 may have a higher priority than C0.
  • the encoding/decoding apparatus may include a buffer that stores motion information of one or more blocks (hereinafter, previous blocks) in which encoding/decoding has been completed before the current block.
  • the buffer may store a list (hereinafter, a motion information list) composed of motion information of a previous block.
  • the motion information list may be initialized in a unit of one of a picture, slice, tile, CTU row, or CTU. Initialization may mean that the motion information list is empty. Motion information of the previous block is sequentially added to the motion information list according to the coding/decoding order of the previous block, but the motion information list is updated in a first-in first-out (FIFO) method considering the size of the motion information list. Can be. For example, if the most recently encoded/decoded motion information (hereinafter, the latest motion information) is the same as the motion information previously added to the motion information list, the latest motion information may not be added to the motion information list.
  • FIFO first-in first-out
  • the same motion information as the latest motion information may be removed from the motion information list, and the latest motion information may be added to the motion information list.
  • the latest motion information may be added to the last position of the motion information list or may be added to the removed motion information position.
  • the previous block may include at least one of one or more neighboring blocks spatially adjacent to the current block or one or more neighboring blocks not spatially adjacent to the current block.
  • the range of the previous block of the present invention will be described in detail with reference to FIGS. 10 to 14.
  • motion information of a previous block or a previous block belonging to a buffer or motion information list may be further added as a merge candidate.
  • a redundancy check between a motion information list and a merge candidate list may be performed.
  • the redundancy check may be performed on all or part of the merge candidates belonging to the merge candidate list and all or part of the previous blocks on the motion information list.
  • the redundancy check of the present invention is performed on a part of a merge candidate belonging to a merge candidate list and a part of a previous block on a motion information list.
  • some merge candidates of the merge candidate list may include at least one of a left block or an upper block among spatial merge candidates.
  • the present invention is not limited thereto, and may be limited to any one of the spatial merge candidates, and may further include at least one of a lower left block, an upper right block, an upper left block, or a temporal merge candidate.
  • Some previous blocks of the motion information list may refer to K previous blocks recently added to the motion information list.
  • K is 1, 2, 3 or more, and may be a fixed value pre-promised in the encoding/decoding device.
  • redundancy of motion information between a previous block having indexes 5, 4, and 3 and some merge candidates in the merge candidate list may be checked.
  • the redundancy between the previous block having indexes 5 and 4 and some merge candidates in the merge candidate list may be checked.
  • the redundancy between the previous block having the indexes 4 and 3 and some merge candidates of the merge candidate list may be checked, except for the previous block of the index 5 most recently added.
  • the previous block of the motion information list may not be added to the merge candidate list.
  • all or part of the previous block of the motion information list may be added to the last position of the merge candidate list.
  • the motion information list may be added to the merge candidate list in the order of the previous block that was recently added (that is, the order from the largest index to the smallest index).
  • the previous block added to the motion information list ie, the previous block having the largest index
  • the merge candidate list has a maximum of T merge candidates according to the size information of the aforementioned merge candidate list.
  • the addition of the previous block may be limited to be performed only until the number (T-n) of merge candidates belonging to the merge candidate list is reached.
  • n may be an integer of 1, 2 or more.
  • the addition of the previous block may be repeatedly performed until the number T of merge candidates belonging to the merge candidate list is T.
  • Whether a neighbor block can be used as a merge candidate may be adaptively determined according to the value of MVD_flag. For example, when MVD_flag is 1, a block adjacent to the upper right corner, lower left corner, or upper left corner of the current block may be set as unavailable. Alternatively, when MVD_flag is 1, the temporal merge candidate may be set as unavailable. Alternatively, when MVD_flag is 1, a combination merge candidate or a zero motion vector candidate may not be added to the merge candidate list. The combination merge candidate can be derived through an average between merge candidates pre-added to the merge candidate list.
  • motion information of a current block may be derived based on a merge candidate list and a merge index (merge_idx) (S910).
  • the merge index can specify any one of a plurality of merge candidates belonging to the merge candidate list.
  • the motion information of the current block may be set as motion information of a merge candidate specified by the merge index.
  • the maximum number of merge candidates available for the current block may be adaptively determined. If MVD_flag is 0, up to M merge candidates are used, whereas if MVD_flag is 1, N merge candidates smaller than M can be used.
  • the merge index may be encoded/decoded based on MVD_flag.
  • the merge index can be encoded/decoded only when MVD_flag is the first value.
  • the maximum number of merge candidates belonging to the merge candidate list is M
  • the maximum number of merge candidates that the current block can use may be two.
  • the M value is determined based on the size information of the merge candidate list described above, and may be a value greater than 2.
  • the use of the first merge candidate may be forced by not encoding/decoding the merge index, and instead setting the merge index to 0.
  • the merge index may have a value between 0 and i, and i may be an integer of 2, 3 or more, or less than M.
  • a motion vector difference value (MVD) for a merge mode of a current block may be derived (S920 ).
  • the MVD of the current block can be derived based on the merge offset vector (offsetMV).
  • the MVD includes at least one of MVD in the L0 direction (MVD0) or MVD in the L1 direction (MVD1), and each of the MVD0 and MVD1 can be derived using a merge offset vector.
  • the merge offset vector may be determined based on the length (mvdDistance) and the direction (mvdDirection) of the merge offset vector.
  • the merge offset vector (offsetMV) may be determined by Equation 4 below.
  • offsetMV[ x0 ][ y0 ][ 0] (mvdDistance[ x0 ][ y0] ⁇ 2) * mvdDirection[ x0 ][ y0 ][0]
  • offsetMV[ x0 ][ y0 ][ 1] (mvdDistance[ x0 ][ y0] ⁇ 2) * mvdDirection[ x0 ][ y0 ][1]
  • mvdDistance may be determined by considering at least one of a distance index (distance_idx) or a predetermined flag (pic_fpel_mmvd_enabled_flag).
  • the distance index (distance_idx) may mean an index coded to specify the length or distance of the motion vector difference value MVD.
  • pic_fpel_mmvd_enabled_flag may indicate whether the motion vector uses integer pixel precision in the merge mode of the current block. For example, when pic_fpel_mmvd_enabled_flag is the first value, the merge mode of the current block uses integer pixel precision. That is, this may mean that the motion vector resolution of the current block is an integer pel.
  • the merge mode of the current block may use decimal pixel precision.
  • the merge mode of the current block may use integer pixel precision or decimal pixel precision.
  • the merge mode of the current block may be restricted to use only a few pixel precision. Examples of decimal pixel precision may include 1/2 pel, 1/4 pel, 1/8 pel, and the like.
  • mvdDistance may be determined as shown in Table 1 below.
  • mvdDirection indicates the direction of the merge offset vector, and may be determined based on the direction index (direction_idx).
  • the direction may include at least one of left, right, top, bottom, top left, bottom left, top right or bottom right.
  • mvdDirection may be determined as shown in Table 2 below.
  • mvdDirection[ x0 ][ y0 ][0] means the sign of the x component of the motion vector difference value
  • mvdDirection[ x0 ][ y0 ][1] means the sign of the y component of the motion vector difference value. can do. If direction_idx is 0, the direction of the motion vector difference value is the right direction, if direction_idx is 1, the direction of the motion vector difference value is the left direction, and if direction_idx is 2, the direction of the motion vector difference value is downward direction. , When direction_idx is 3, directions of motion vector difference values may be respectively determined in an upward direction.
  • the above-described distance index and direction index may be encoded/decoded only when MVD_flag is the first value.
  • the merge offset vector derivation method described above will be described in detail with reference to FIGS. 15 to 19.
  • the motion vector difference value MVD may be set to be the same as the previously determined merge offset vector.
  • the merge offset vector may be corrected in consideration of the POC difference (PocDiff) between the reference picture of the current block and the current picture to which the current block belongs, and the corrected merge offset vector may be set as a motion vector difference value (MVD).
  • the current block is encoded/decoded for bidirectional prediction
  • the reference picture of the current block may include a first reference picture (reference picture in the L0 direction) and a second reference picture (reference picture in the L1 direction).
  • the POC difference between the first reference picture and the current picture is referred to as PocDiff0
  • the POC difference between the second reference picture and the current picture is referred to as PocDiff1.
  • MVD0 and MVD1 of the current block may be set identically as merge offset vectors, respectively.
  • MVD0 may be set equal to the merge offset vector.
  • MVD1 can be derived based on a pre-set MVD0. For example, when the first and second reference pictures are long-term reference pictures, MVD1 may be derived by applying a first scaling factor to MVD0. The first scaling factor may be determined based on PocDiff0 and PocDiff1. On the other hand, if at least one of the first or second reference pictures is a short-term reference picture, MVD1 may be derived by applying a second scaling factor to MVD0.
  • the second scaling factor may be a fixed value (eg, -1/2, -1, etc.) pre-promised in the encoding/decoding device. However, the second scaling factor can be applied only when the code of PocDiff0 and the code of PocDiff1 are different. If the sign of PocDiff0 and the sign of PocDiff1 are the same, MVD1 is set to be the same as MVD0, and separate scaling may not be performed.
  • MVD1 may be set equally as a merge offset vector.
  • MVD0 may be derived based on a pre-set MVD1.
  • MVD0 may be derived by applying a first scaling factor to MVD1.
  • the first scaling factor may be determined based on PocDiff0 and PocDiff1.
  • MVD0 may be derived by applying a second scaling factor to MVD1.
  • the second scaling factor may be a fixed value (eg, -1/2, -1, etc.) pre-promised in the encoding/decoding device. However, the second scaling factor can be applied only when the code of PocDiff0 and the code of PocDiff1 are different. If the sign of PocDiff0 and the sign of PocDiff1 are the same, MVD0 is set to be the same as MVD1, and separate scaling may not be performed.
  • a motion vector of a current block may be corrected using a motion vector difference value MVD (S930 ), and motion compensation of a current block may be performed based on the corrected motion vector (S940 ).
  • MVD motion vector difference value
  • 10 to 14 is an embodiment to which the present invention is applied, and shows a previous block usable as a merge candidate.
  • Peripheral blocks used in the merge mode may be blocks adjacent to the current coding unit, such as merge indexes 0 to 4 in FIG. 10 (blocks that abut the boundary of the current coding unit), and not adjacent as shown in FIG. 10, merge indexes 5 to 26. It may be an unblocked block.
  • the merge candidate may be set as not available if the distance from the current block exceeds a predefined threshold.
  • the pre-defined threshold may be set to the height (ctu_height) or ctu_height+N of the CTU, which is called a merge candidate availability threshold.
  • a merge candidate availability threshold I.e., y-axis coordinates of the remaining candidate (y i) and the difference (i.e., y i - y 0) of the y-coordinate (y 0) of the current top-left sample of the coding unit (hereinafter referred to as the current coded unit based on the sample) the remaining candidates available
  • the merge candidate may be set as not available.
  • N is a pre-defined offset value. Specifically, for example, N may be set to 16 or ctu_height.
  • the number of merge candidates present at the top of the coding unit (hereinafter referred to as the upper merge candidate) may be set as small as possible, and the number of merge candidates existing at the left and bottom (hereinafter, the lower left merge candidate) of the coding unit may be set as much as possible.
  • the difference between the y-axis coordinate of the current coding unit reference sample and the y-axis coordinate of the upper merge candidate may be set so as not to exceed twice the height of the coding unit.
  • the difference between the x-axis coordinates of FIG. 11 and the current coding unit reference sample and the x-axis coordinates of the bottom left merge candidate may be set so as not to exceed twice the width of the coding unit.
  • the merge candidate adjacent to the current coding unit is called an adjacent merge candidate, and the merge candidate not adjacent to the current coding unit is called a non-adjacent merge candidate.
  • a flag isAdjacentMergeflag indicating whether a merge candidate of the current coding unit is an adjacent merge candidate may be signaled.
  • isAdjacentMergeflag value 1
  • isAdjacentMergeflag value 0
  • a non-contiguous merge index (NA_merge_idx[x0][y0]), which is a value obtained by subtracting the number of adjacent merge candidates (NumAdjMerge) from the merge index as shown in Equation 5 below, may be signaled. .
  • NA_merge_idx[x0][y0] merge_idx[x0][y0]-NumAdjMerge
  • the position of a non-contiguous merge candidate having a y-coordinate larger than the upper boundary of the current block may be determined based on a distance between the x-coordinate of the adjacent merge candidate and a coding unit reference sample.
  • a non-contiguous merge candidate having the same x-coordinate as the adjacent merge candidate A or a non-contiguous merge candidate whose x-coordinate and distance from the adjacent merge candidate A is within a threshold value is referred to as A's collinear merge candidate.
  • the x-coordinate of the merge candidate for the collinear axis of A may be derived by subtracting an offset (hereinafter, a non-adjacent merge candidate offset) to the x-coordinate of the adjacent merge candidate.
  • the non-contiguous merge candidate offset may have a fixed value or may be set to have a larger value as the distance between the adjacent merge candidate and the non-contiguous merge candidate increases.
  • the offset may be limited to a value less than the width of the current block.
  • the coordinates of the vertically collinear merge candidate (hereinafter referred to as the first non-contiguous merge candidate) closest to the adjacent merge candidate are ( Can be set to x0- (cu_height/2 -1), y1) or (x0- (cu_width/2 -1), y1).
  • Coordinates of the vertical non-contiguous merge candidate (hereinafter, the second non-contiguous merge candidate) closest to the first non-contiguous merge candidate are (x0-(cu_height -1), y2) or (x0-(cu_width -1), y2) Can be set to
  • the non-contiguous merge candidate When the non-contiguous merge candidate is outside the LCU boundary, it may be set to derive the merge candidate from the sample closest to the non-contiguous merge candidate and adjacent to the LCU boundary as shown in FIG. 13.
  • the non-contiguous merge candidate B and the x coordinate of the non-contiguous merge candidate sample may be replaced with the same sample.
  • the non-contiguous merge candidate B (coordinate (x1,y1)) (the merge candidate with a merge index of 6 in the left figure of FIG. 13) is a sample B'(coordinate (x1,y0)) adjacent to the current coding unit (FIG. 13 In the picture on the left, the merge index can be replaced by a merge candidate with 6').
  • the merge candidate C (coordinate (x2,y2)) (the merge candidate with a merge index of 15 in the right figure in FIG. 13) has the same x coordinate and is adjacent to the current coding unit, sample B'(coordinate (x2,y0 )) (merge candidate with merge index 15' in the left figure of FIG. 13).
  • the non-contiguous merge candidate outside the LCU boundary is replaced by a sample subtracting the offset to the x-axis coordinate of the non-contiguous merge candidate among samples adjacent to the LCU boundary.
  • a non-contiguous merge candidate outside the LCU boundary may be replaced with a sample adjacent to the current coding unit, and the x-axis coordinate of the replacement sample may be derived by subtracting a specific offset from the non-contiguous merge candidate.
  • a non-contiguous merge candidate offset may be used as a specific offset.
  • the non-contiguous merge offset may be set differently for each non-contiguous merge candidate outside the LCU boundary. In this case, the non-contiguous merge offset may be determined in the order of non-contiguous merge candidates outside the LCU boundary.
  • the non-contiguous merge candidate may be replaced with a sample in which a non-contiguous merge offset is applied to the x-coordinate of the non-contiguous merge candidate among samples adjacent to the current block.
  • the size of the non-contiguous merge offset may increase as the number of non-contiguous merge candidates among the vertical axis collinear merge candidates increases.
  • a non-contiguous merge offset may be applied to the y-axis coordinates of the non-contiguous merge candidate.
  • 15 to 19 is an embodiment to which the present invention is applied, and shows a merge offset vector derivation method for a merge mode.
  • merge_flag merge_flag
  • skip_skip_flag merge offset vector flag
  • the merge offset vector offsetMV can be derived from the distance index and the direction index.
  • an optimal merge offset vector value can be derived by searching for the up, down, left, and right motions derived from the merge candidate.
  • the x-axis vector and the y-axis vector of the merge offset vector can be set to be smaller than a maximum of 32 integer samples from the reference merge motion vector, respectively.
  • the merge offset vector flag may be signaled only when the value of the merge index is smaller than the reference value.
  • the merge offset vector flag may be signaled only when the merge candidate indicated by the merge index is bidirectional or unidirectional.
  • the value obtained by subtracting the POC of the current picture from the POC of the reference picture L0 (abbreviation for picture order count) is referred to as the reference picture L0 difference (PocDiff0), and the POC of the current picture from the POC of the reference picture L1
  • the subtracted value is called a reference picture L1 difference (PocDiff1).
  • the offsetMV may be generated by multiplying the value derived from the direction index by the variable DistFromMergeMV derived from the distance index, as shown in Equation 6 below, when the sign sign of the reference picture L0 difference is different from the reference picture L1 difference.
  • offsetMVL0[0] (DistFromMergeMV ⁇ 2) * sign[x0][y0][0]
  • offsetMVL0[1] (DistFromMergeMV ⁇ 2) * sign[x0][y0][1]
  • offsetMVL1[0] (DistFromMergeMV ⁇ 2) * sign[x0][y0][0]
  • offsetMVL1[1] (DistFromMergeMV ⁇ 2) * sign[x0][y0][1]
  • OffsetMV can be generated by multiplying the value derived from the direction index by the variable DistFromMergeMV derived from the distance index, as shown in Equation (7), when the sign sign of the reference picture L0 difference and the reference picture L1 difference are the same.
  • offsetMVL0[0] (DistFromMergeMV ⁇ 2) * sign[x0][y0][0]
  • offsetMVL0[1] (DistFromMergeMV ⁇ 2) * sign[x0][y0][1]
  • offsetMVL1[0] -1 * (DistFromMergeMV ⁇ 2) * sign[x0][y0][0]
  • offsetMVL1[1] -1 * (DistFromMergeMV ⁇ 2) * sign[x0][y0][1]
  • DistFromMergeMV can be derived as shown in Table 5 below.
  • the range of DistFromMergeMV can be determined differently. For example, if the motion vector precision of the current block or merge candidate is quarter-pel, DistFromMergeMV is selected within the range of ⁇ 1, 2, 4, 8, 16 ⁇ , while the motion vector precision of the current block or merge candidate is integer In case of -pel, DistFromMergeMV can be selected within the range of ⁇ 4, 8, 16, 32, 64 ⁇ .
  • Table 6 shows the variable sign[x][y][0] indicating the x-axis offset defined according to the direction index value and the variable sign[x][y][1] indicating the y-axis offset.
  • the x-axis vector and the y-axis vector of the merge offset vector can be set to be smaller than a maximum of 2 integer samples from the reference merge motion vector, and distance_idx can be set to have a total of 4 indices.
  • a syntax merge offset vector range flag merge_offset_range_flag indicating a search range of a merge offset vector may be signaled in a picture header or a slice header.
  • the merge_offset_extend_range_flag value is 1
  • the x-axis vector and the y-axis vector of the a merge offset vector can be set to be smaller than a maximum of 32 integer samples from the reference merge motion vector
  • the merge_offset_extend_range_flag value is 0, the merge offset vector
  • the x-axis vector and the y-axis vector of can be set to be smaller than a maximum of 2 integer samples from the reference merge motion vector, respectively.
  • the optimal merge offset vector value may be derived by searching for the motion up, down, left, and diagonal directions derived from the merge candidate, and direction_idx may be set to have a total of 8 indexes as shown in Table 8.
  • the merge offset vector search range is the same as the figure on the left in Fig. 16, use Table 8 to use the variable sign[x][y][0] representing the x-axis offset and the variable sign[x][y] representing the y-axis offset. If [1] can be represented, and the merge offset vector search range is as shown in the right figure of FIG. 16, Table 8 is used to represent the variables sign[x][y][0] and y-axis offsets using x-axis offset. The variable sign[x][y][1] can be represented.
  • the selected merge candidate may have different search ranges and search patterns depending on whether or not the bidirectional motion vector is selected.
  • the selected merge candidate when it has a unidirectional motion vector (either an L0 motion vector or an L1 motion vector), it can be set to have a diamond-shaped search pattern as shown in the left figure of FIG. 17, and the selected merge candidate and a bidirectional motion
  • the selected merge candidate and a bidirectional motion In the case of having a vector (L0 motion vector and L1 motion vector), it can be set to have a square shape search pattern as shown in the right figure of FIG.
  • the distance index value may have different search ranges and search patterns. For example, when the distance index value is less than the threshold value, it may be set to have a diamond-shaped search pattern, and when the distance index value is greater than or equal to the threshold value, it may be set to have a square shape pattern.
  • the motion vector precision of the current block or merge candidate may have different search ranges and search patterns. For example, if the motion vector precision is less than or equal to the Integer-pel (1/4 pel, 1/2 pel, etc.), it can be set to have a diamond-shaped search pattern, and if the motion vector precision is greater than the Integer pel, the square It can also be set to have a shape pattern.
  • a range of the search direction can be configured differently. For example, if the value of DistFromMergeMV is less than or equal to the threshold, 8 directions are searched as in the example of Table 8 or Table 9, while when the value of DistFromMergeMV is greater than the threshold, 4 directions can be searched as in the example of Table 6. have.
  • the range of the search direction may be configured differently. For example, when the difference value between MVx and MVy is less than or equal to the threshold value, the 8 directions are searched as in the example of Table 8 or Table 9, while when the difference value between MVx and MVy is greater than the threshold value, as in the example of Table 6 4 directions can be searched.
  • the final motion vector can be derived by adding offsetMV to the motion vector mergeMV derived from the merge index.
  • mvL0[0] mergeMVL0[0]+ offsetMVL0[0]
  • mvL0[1] mergeMVL0[0] + offsetMVL0[0]
  • mvL1[1] mergeMVL1[0] + offsetMVL1[0]
  • the merge offset vector offsetMV may be derived from the first distance flag (hereinafter, distance_1st_flag), the second distance index (hereinafter, distance_2nd_idx) and the direction index.
  • DistFromMergeMV may be derived using Equation (9) using the first distance index and the second distance index.
  • DistFromMergeMV 16*distance_1st_flag + (1 ⁇ distance_2nd_idx)
  • distance_1st_flag may have a value of 0 or 1
  • distance_2nd_idx may have a value of 0 to 3
  • DistFromMergeMV may have a value of 1 to 128.
  • DistFromMergeMV may be a value of at least one of ⁇ 1, 2, 4, 8, 16, 32, 64, 128 ⁇ .
  • the first distance flag hereinafter, distance_1st_flag
  • the second distance index hereinafter, distance_2nd_idx
  • the direction index may be signaled.
  • the same merge offset vector may be used for all sub-blocks.
  • the merge candidate for each sub-block can be derived as in the following process.
  • An initial shift vector may be derived from a motion vector of a merge candidate block around the current block.
  • an initial shift vector may be added to the upper left sample (xSb,ySb) of the sub block in the coding unit to derive a shift sub block having the position of the upper left sample (xColSb, yColSb).
  • the motion vector of the collocated block corresponding to the center position of the sub-block containing (xColSb, yColSb) can be derived as the motion vector of the sub-block containing the upper left sample (xSb,ySb).
  • Different merge offset vectors may be derived in units of sub-blocks of a coding unit, which is called a sub-block unit merge offset vector encoding method.
  • a coding unit may be divided into sub-blocks of MxM units, and different merge offset vectors may be used as sub-block units.
  • the previous sub-block and the distance index and the direction index may not be the same.
  • DistFromMergeMV is applied to all sub-blocks, but the Direction can be individually determined. Conversely, the same direction is applied to all sub-blocks, but DistFromMergeMV can be determined individually.
  • a merge offset vector may be applied to only some of the sub-blocks.
  • the motion information of the first sub-block is set equal to the motion information of the merge candidate indicated by the merge index
  • the motion information of the second sub-block is the first sub-block It can be derived by applying a merge offset vector to the motion information.
  • the first sub-block may be a left triangle prediction unit and the second sub-block may be a right triangle prediction unit.
  • the left triangle prediction unit may be performed as follows.
  • the left picture in FIG. 19 is called left triangle partitioning, and the right picture is called right triangle partitioning.
  • the prediction unit to which the upper left or lower left sample of the coding unit belongs is called a left triangle prediction unit (, and the prediction unit to which the upper or lower right sample of the coding unit belongs is called a right triangle prediction unit, and a right triangle prediction unit or a left triangle prediction unit. Is collectively called a triangular prediction unit.
  • 20 to 24 is an embodiment to which the present invention is applied, and shows an intra prediction method.
  • an already coded boundary sample around the current block is used to generate an intra prediction, which is called an intra reference sample.
  • Predict the average value of the intra reference samples set the value of the entire sample of the prediction block (DC mode), or perform the horizontal direction weighted prediction to generate the horizontal direction prediction sample and the vertical direction reference sample weighted prediction to generate the vertical direction prediction sample.
  • a prediction sample may be generated by weighted prediction of a horizontal prediction sample and a vertical prediction sample (Planar mode), or intra prediction may be performed using a directional intra prediction mode.
  • intra prediction may be performed using 33 directions (total of 35 intra prediction modes), and 65 directions may be used as shown in the right figure (total of 67 intra prediction modes).
  • an intra reference sample reference sample
  • intra prediction may be performed therefrom.
  • the intra reference sample on the left side of the coding unit is called the left intra reference sample, and the intra reference sample on the upper side of the coding unit is called the upper intra reference sample.
  • an intra direction parameter (intraPredAng), which is a parameter indicating a prediction direction (or prediction angle)
  • intraPredAng an intra direction parameter
  • Table 11 is only an example based on the directional intra prediction mode having a value of 2 to 34 when using 35 intra prediction modes.
  • the prediction direction (or prediction angle) of the directional intra prediction mode is further subdivided so that more than 33 directional intra prediction modes may be used.
  • PredModeIntra One 2 3 4 5 6 7 IntraPredAng - 32 26 21 17 13 9 PredModeIntra 8 9 10 11 12 13 14 IntraPredAng 5 2 0 -2 -5 -9 -13 PredModeIntra 15 16 17 18 19 20 21 IntraPredAng -17 -21 -26 -32 -26 -21 -17 PredModeIntra 22 23 24 25 26 27 28 IntraPredAng -13 -9 -5 -2 0 2 5 PredModeIntra 29 30 31 32 33 34 IntraPredAng 9 13 17 21 26 32
  • the left intra reference sample and the upper intra reference sample are configured in 1D according to the angle of the intra prediction mode in the current block as shown in FIG. 22. It can be reconstructed as a one-dimensional reference sample (Ref_1D).
  • a one-dimensional reference sample may be generated counterclockwise from the intra reference sample located on the upper right side of the current block to the intra reference sample located on the lower left side as shown in FIG. 23.
  • a one-dimensional reference sample may be generated using only the upper side intra reference sample or the left side intra reference sample.
  • a one-dimensional reference sample may be generated in a clockwise direction from the intra reference sample located at the lower left side of the current block to the intra reference sample located at the upper right side as shown in FIG. 24.
  • the weight-related parameter i fact applied to at least one reference sample determined based on the reference sample determination index i Idx and i Idx may be derived as shown in Equation 11 below.
  • i Idx and i fact are variably determined according to the slope of the directional intra prediction mode, and the reference sample specified by i Idx may correspond to an integer pel.
  • Prediction images may be derived by specifying at least one one-dimensional reference sample for each prediction sample.
  • the position of a one-dimensional reference sample that can be used for generating a prediction sample may be specified by considering the slope value of the directional intra prediction mode. It is also possible to have different directional intra prediction modes for each prediction sample. Multiple intra prediction modes may be used for one prediction block.
  • the plurality of intra prediction modes may be represented by a combination of a plurality of non-directional intra prediction modes, or may be represented by a combination of one non-directional intra prediction mode and at least one directional intra prediction mode, or multiple directional intra prediction It can also be expressed as a combination of modes.
  • Different intra prediction modes may be applied to each sample group in one prediction block.
  • a given sample group may consist of at least one sample.
  • the number of sample groups may be variably determined according to the size/number of samples of the current prediction block, or may be a fixed number preset in the encoder/decoder independently of the size/number of samples of the prediction block.
  • the location of the one-dimensional reference sample may be specified using the reference sample determination index i Idx .
  • the first prediction image when it is not possible to express the slope of the intra prediction mode using only one one-dimensional reference sample, the first prediction image may be generated by interpolating adjacent one-dimensional reference samples as shown in Equation (12).
  • the first prediction image When the angular line according to the slope/angle of the intra prediction mode does not pass the reference sample located in the integer pel, the first prediction image may be generated by interpolating the reference samples adjacent to the left/right or top/bottom of the angular line.
  • the filter coefficient of the interpolation filter used may be determined based on i fact .
  • the filter coefficient of an interpolation filter can be derived based on the distance between a minority pel located on an angular line and a reference sample located on the integer pel.
  • the first prediction image may be generated as shown in Equation 13 below.
  • 25 to 28 is an embodiment to which the present invention is applied, and shows an intra prediction method based on a wide angle.
  • the prediction angle of the directional intra prediction mode may be set between 45 and -135 degrees as shown in FIG. 25.
  • a disadvantage of predicting the current sample from the intra reference sample far from the current sample may occur instead of the intra reference sample close to the current sample due to a predefined prediction angle.
  • intra prediction is performed at a distance L instead of the sample T having a short distance.
  • the coding unit having a height of the coding unit larger than the width of the coding unit hereinafter, a vertical coding unit
  • the intra distance from the sample T is short. You can make predictions.
  • intra prediction may be performed at a prediction angle wider than a pre-defined prediction angle, and this is called a wide angle intra prediction mode.
  • the wide angle intra prediction mode may have a prediction angle of 45- ⁇ to -135- ⁇ , and a prediction angle deviating from an angle used in the existing intra prediction mode is called a wide angle angle.
  • sample A in the horizontal coding unit can be predicted from the intra reference sample T using the wide angle intra prediction mode.
  • sample A in the vertical coding unit can be predicted from the intra reference sample L using the wide angle intra prediction mode.
  • N+20 intra prediction modes may be used by adding 20 wide angle angles to N existing intra prediction modes. Specifically, for example, when 67 intra modes are used, a total of 87 intra prediction modes may be used by adding a wide angle angle as shown in Table 12.
  • the length of the upper intra reference sample may be set to 2W+1 and the length of the left intra reference sample may be set to 2H+1 as shown in FIG. 27.
  • the wide-angle intra-prediction mode can be encoded by replacing it with an existing intra-prediction mode that is not used in the wide-angle intra, and the replaced prediction mode is called a wide-angle intra-mode.
  • wide angle intra prediction mode 35 may be encoded in intra prediction mode 2, which is a wide angle replacement mode, and wide angle intra prediction mode 36 may be replaced by a wide angle.
  • the mode can be encoded in intra prediction mode 3.
  • the number of modes and number of replacements can be set differently. Specifically, for example, as shown in Table 13, different modes and number of replacements may be set according to the type of the coding block. Table 13 shows an intra prediction replacement mode used according to the ratio of the width and height of the coding block.
  • a predicted image may be generated through the inter prediction or intra prediction described above, and an image obtained by subtracting the predicted image from the original image, that is, a residual image may be obtained.
  • the residual image may be decomposed into binary frequency components through a two-dimensional transform such as a DCT (Discrete cosine transform).
  • a two-dimensional transform such as a DCT (Discrete cosine transform).
  • Discrete sine transform may be used according to the size of a prediction block or a prediction mode. Specifically, for example, in the intra prediction mode, when the size of the prediction block/coding block is smaller than NxN, DST transformation may be set to be used, and DCT may be set to be used in other prediction blocks/coding blocks.
  • DCT is a process of decomposing (converting) an image into two-dimensional frequency components using cos transform, and the frequency components at that time are expressed as a base image. For example, if DCT transformation is performed on an NxN block, N 2 basic pattern components can be obtained. Performing DCT conversion is to obtain the size of each of the basic pattern components included in the original pixel block. The size of each basic pattern component is called the DCT coefficient.
  • a discrete cosine transform is mainly used in an image in which a lot of non-zero components are distributed in a low frequency
  • a discrete Sine Transform may be used in an image in which a large amount of high-frequency components are distributed.
  • DST denotes a process of decomposing (converting) an image into two-dimensional frequency components using a sin transform.
  • a 2D image may be decomposed (converted) into 2D frequency components using a conversion method other than DCT or DST conversion, and this is called 2D image conversion.
  • a 2D image transformation may not be performed in a specific block among residual images, and this is called transform skip. Quantization can be applied after the transform skip.
  • DCT or DST or a 2D image transformation may be applied to any block in the 2D image, and the transformation used at this time is called a first transformation.
  • the transform may be performed again in a part of the transform block, and this is called a second transform.
  • the first transformation may use one of a plurality of transformation cores. Specifically, for example, any one of DCT2, DCT8, or DST7 can be selected and used in the conversion block. Alternatively, different transform cores may be used in the horizontal and vertical transforms of the transform block.
  • Block units performing the first transformation and the second transformation may be set differently. Specifically, for example, after performing the first transformation on the 8x8 block of the residual image, the second transformation may be performed for each 4x4 sub-block. As another example, after performing the first transform in each 4x4 block, the second transform may be performed in the 8x8 block.
  • the residual image to which the first transform is applied is called a first transform residual image.
  • a DCT or DST or 2D image transformation may be applied to the first transform residual image, and the transform used at this time is referred to as a second transform.
  • the 2D image to which the second transform is applied is called a second transform residual image.
  • Quantization refers to the process of dividing the transform coefficients into predefined values to reduce the energy of the block.
  • the value defined to apply quantization to the transform coefficient is called a quantization parameter.
  • Pre-defined quantization parameters may be applied in sequence units or block units.
  • a quantization parameter can be defined with a value between 1 and 51.
  • a residual reconstruction image may be generated by performing inverse quantization and inverse transformation.
  • a first reconstructed image may be generated by adding a predictive image to the residual reconstructed image.
  • a transform block may be generated based on at least one of n transform types pre-defined in the encoding/decoding apparatus.
  • n can be an integer of 1, 2, 3, 4, or more.
  • DCT2, DCT8, DST7, conversion skip mode, and the like can be used. Only one same transformation type may be applied to the vertical/horizontal direction of one block, or different transformation types may be applied to each vertical/horizontal direction. To this end, a flag indicating whether one and the same conversion type is applied may be used. The flag can be signaled in the encoding device.
  • the transform type may be determined based on information signaled by the encoding device, or may be determined based on predetermined encoding parameters.
  • the encoding parameter may mean at least one of a block size, shape, intra prediction mode, or component type (e.g., luminance, color difference).
  • the size of the block can be expressed as width, height, ratio of width and height, product of width and height, sum/difference of width and height, and the like. For example, if the size of the current block is greater than a predetermined threshold, the horizontal transformation type is determined as a first transformation type (eg, DCT2), and the vertical transformation type is a second transformation type (eg, DST7). ).
  • the threshold value may be an integer of 0, 4, 8, 16, 32 or more.
  • the residual coefficient according to the present invention may be obtained by performing a second transformation after the first transformation.
  • the second transform may be performed on residual coefficients of some regions in the current block.
  • the decoding apparatus may obtain a transform block of the current block by performing a second inverse transform on the partial region and performing a first inverse transform on the current block including the inverse transformed partial region.
  • 29 and 30 is an embodiment to which the present invention is applied, and shows a method of applying an in-loop filter to a reconstructed block.
  • a predetermined in-loop filter may be applied to the reconstructed current block.
  • the in-loop filter may include at least one of a deblocking filter, a sample adaptive offset (SAO) filter, or an adaptive loop filter (ALF).
  • SAO sample adaptive offset
  • ALF adaptive loop filter
  • In-loop filtering is a technique that adaptively filters the decoded image to reduce loss of information generated during quantization and encoding.
  • a deblocking filter, a sample adaptive offset filter (SAO), and an adaptive loop filter (ALF) are examples of in-loop filtering.
  • a second reconstructed image may be generated by performing at least one of a deblocking filter, a sample adaptive offset (SAO), or an adaptive loop filter (ALF) on the first reconstructed image.
  • a deblocking filter e.g., a sample adaptive offset (SAO), or an adaptive loop filter (ALF)
  • SAO and ALF After applying a deblocking filter to the reconstructed image, SAO and ALF can be applied.
  • the deblocking filter is a method for alleviating blocking artifacts occurring at a block boundary of the first image and improving encoding performance.
  • Filtering may be performed at the block boundary to alleviate the deterioration of the block quality, and whether the block is encoded in the intra prediction mode as shown in FIG. 29, or the difference between the absolute values of the motion vectors of neighboring blocks is greater than a predetermined threshold.
  • a block filter strength (BS) value may be determined based on at least one of whether the reference pictures of neighboring blocks are equal to each other or not. When the BS value is 0, filtering is not performed, and when the BS value is 1 or 2, filtering may be performed at a block boundary.
  • SAO can effectively reduce the ringing phenomenon by adding or subtracting a specific offset in block units in consideration of the pattern of the first reconstructed image.
  • SAO is composed of an edge offset (hereinafter referred to as EO) and a band offset (BO) according to the characteristics of the reconstructed image.
  • Edge offset is a method of adding an offset to a current sample differently according to a sample pattern of surrounding pixels.
  • the band offset is to reduce coding errors by adding a constant value to a set of pixels having similar pixel brightness values in the region. By dividing the pixel brightness into 32 uniform bands, pixels having similar brightness values can be set as one set. For example, four adjacent bands can be grouped into one category. One category can be set to use the same offset value.
  • ALF Adaptive Loop Filter
  • the filter may be selected on a picture-by-picture or CTU basis.
  • any one of 5x5, 7x7 or 9x9 diamond shapes can be selected as shown in FIG. 30 below. It is also possible to limit the use of 5x5 diamonds in the Chroma component.
  • various embodiments of the present disclosure may be implemented by hardware, firmware, software, or a combination thereof.
  • ASICs Application Specific Integrated Circuits
  • DSPs Digital Signal Processors
  • DSPDs Digital Signal Processing Devices
  • PLDs Programmable Logic Devices
  • FPGAs Field Programmable Gate Arrays
  • ASICs Application Specific Integrated Circuits
  • DSPs Digital Signal Processors
  • DSPDs Digital Signal Processing Devices
  • PLDs Programmable Logic Devices
  • FPGAs Field Programmable Gate Arrays
  • Universal It can be implemented by a processor (general processor), a controller, a microcontroller, a microprocessor.
  • the scope of the present disclosure includes software or machine-executable instructions (eg, operating systems, applications, firmware, programs, etc.) that cause an operation according to the method of various embodiments to be executed on a device or computer, and such software or Instructions include a non-transitory computer-readable medium that is stored and executable on a device or computer.
  • software or Instructions include a non-transitory computer-readable medium that is stored and executable on a device or computer.
  • the present invention can be used for video encoding/decoding.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • Discrete Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

본 발명에 따른 영상 부호화/복호화 방법 및 장치는, 현재 블록의 머지 후보 리스트를 구성하고, 현재 블록의 머지 인덱스와 머지 후보 리스트를 기반으로 현재 블록의 움직임 정보를 유도하며, 현재 블록의 움직임 벡터 차이값을 유도하고, 움직임 벡터 차이값을 이용하여 현재 블록의 움직임 벡터를 보정하며, 보정된 움직임 벡터를 이용하여 현재 블록의 움직임 보상을 수행할 수 있다.

Description

영상 부/복호화 방법 및 장치
본 발명은 비디오 신호 처리 방법 및 장치에 관한 것이다.
고해상도 비디오에 대한 시장의 수요가 증가하고 있으며, 이에 따라 고해상도 영상을 효율적으로 압축할 수 있는 기술이 필요하다. 이러한 시장의 요구에 따라 ISO/IEC의 MPEG (Moving Picture Expert Group)과 ITU-T의 VCEG (Video Coding Expert Group)이 공동으로 JCT-VC (Joint Collaborative Team on Video Coding)를 결성하여, HEVC (High Efficiency Video Coding) 비디오 압축 표준을 2013년 1월에 개발을 완료했으며, 차세대 압축 표준에 대한 연구 및 개발을 활발히 진행해오고 있다.
동영상 압축은 크게 화면 내 예측 (또는 인트라 예측), 화면 간 예측(또는 인터 예측), 변환, 양자화, 엔트로피(Entropy coding) 부호화, 인루프 필터(In-loop filter)로 구성된다. 한편, 고해상도 영상에 대한 수요가 증가함과 함께, 새로운 영상 서비스로서 입체 영상 컨텐츠에 대한 수요도 함께 증가하고 있다. 고해상도 및 초고해상도의 입체 영상 콘텐츠를 효과적으로 제공하기 위한 비디오 압축 기술에 대하여 논의가 진행되고 있다.
본 발명은 픽쳐를 적응적으로 분할하는 방법 및 장치를 제공하는데 목적이 있다.
본 발명은 인트라 예측 방법 및 장치를 제공하는데 목적이 있다.
본 발명은 인터 예측 방법 및 장치를 제공하는데 목적이 있다.
본 발명은 움직임 벡터 차이값(MVD) 기반의 머지 모드를 이용한 인터 예측 방법 및 장치를 제공하는데 목적이 있다.
본 발명에 따른 영상 부호화/복호화 방법 및 장치는, 현재 블록의 머지 후보 리스트를 구성하고, 상기 현재 블록의 머지 인덱스와 상기 머지 후보 리스트를 기반으로, 상기 현재 블록의 움직임 정보를 유도하며, 상기 현재 블록의 움직임 벡터 차이값을 유도하고, 상기 움직임 벡터 차이값을 이용하여, 상기 현재 블록의 움직임 벡터를 보정하며, 상기 보정된 움직임 벡터를 이용하여, 상기 현재 블록의 움직임 보상을 수행할 수 있다.
본 발명에 따른 영상 부호화/복호화 방법 및 장치에 있어서, 상기 움직임 정보는 움직임 벡터 또는 참조 픽쳐 인덱스 중 적어도 하나를 포함할 수 있다.
본 발명에 따른 영상 부호화/복호화 방법 및 장치에 있어서, 상기 머지 후보 리스트는, 상기 현재 블록의 공간적 머지 후보 또는 시간적 머지 후보 중 적어도 하나를 포함할 수 있다.
본 발명에 따른 영상 부호화/복호화 방법 및 장치에 있어서, 상기 현재 블록의 움직임 정보 리스트에 속한 이전 블록의 움직임 정보가 상기 머지 후보 리스트에 더 추가되고, 상기 이전 블록은 상기 현재 블록 이전에 복호화가 완료된 하나 이상의 블록일 수 있다.
본 발명에 따른 영상 부호화/복호화 방법 및 장치에 있어서, 상기 움직임 벡터 차이값을 유도하는 단계는, 소정의 플래그에 기초하여 선택적으로 수행되고, 상기 플래그는 머지 모드에서 움직임 벡터 차이값을 이용하는지 여부를 나타낼 수 있다.
본 발명에 따른 영상 부호화/복호화 방법 및 장치에 있어서, 상기 플래그에 따라, 상기 현재 블록이 이용 가능한 머지 후보의 최대 개수는 적응적으로 결정될 수 있다.
본 발명에 따른 영상 부호화/복호화 방법 및 장치에 있어서, 상기 움직임 벡터 차이값은, 머지 오프셋 벡터에 기초하여 유도되고, 상기 머지 오프셋 벡터는, 상기 머지 오프셋 벡터의 길이와 방향에 기초하여 결정될 수 있다.
본 발명에 따른 영상 부호화/복호화 방법 및 장치에 있어서, 상기 머지 오프셋 벡터의 길이는, 부호화된 디스턴스 인덱스 또는 상기 현재 블록의 움직임 벡터의 정밀도 중 적어도 하나를 고려하여 결정될 수 있다.
본 발명에 따른 영상 부호화/복호화 방법 및 장치에 있어서, 상기 머지 오프셋 벡터의 방향은, 부호화된 방향 인덱스에 기초하여 결정되고, 상기 방향은 좌, 우, 상 또는 하 중 어느 하나의 방향으로 결정될 수 있다.
본 발명에 따른 영상 부호화/복호화 방법 및 장치에 있어서, 상기 움직임 벡터 차이값은, 소정의 스케일링 팩터를 상기 머지 오프셋 벡터에 적용하여 유도되고, 상기 스케일링 팩터는 상기 현재 블록이 속한 현재 픽쳐와 상기 현재 블록의 참조 픽쳐 간의 POC 차이에 기초하여 결정될 수 있다.
본 발명에 따른 비디오 비트스트림을 저장하기 위한 디지털 저장 매체는, 현재 블록의 머지 후보 리스트를 구성하고, 상기 현재 블록의 머지 인덱스와 상기 머지 후보 리스트를 기반으로 상기 현재 블록의 움직임 정보를 유도하며, 상기 현재 블록의 움직임 벡터 차이값을 유도하고, 상기 움직임 벡터 차이값을 이용하여 상기 현재 블록의 움직임 벡터를 보정하며, 상기 보정된 움직임 벡터를 이용하여 상기 현재 블록의 움직임 보상을 수행하는 처리를 실행하는 비디오 복호화 프로그램을 기록/저장할 수 있다.
본 발명은 소정의 단위로 픽쳐를 분할하여 부호화/복호화를 수행함으로써, 비디오 신호의 부호화/복호화 효율을 향상시킬 수 있다.
본 발명은 세분화된 방향성 모드 및/또는 선택적인 화소 라인을 이용함으로써 인트라 예측의 부호화 효율을 향상시킬 수 있다.
본 발명은 어파인 모드 또는 인터 영역 움직임 정보를 이용함으로써, 인터 예측의 부호화 효율을 향상시킬 수 있다.
본 발명은 움직임 벡터 차이값(MVD) 기반의 머지 모드를 이용함으로써, 움직임 벡터의 정확도 및 부호화 효율을 향상시킬 수 있다.
도 1은 본 발명에 따른 영상 부호화 장치를 나타낸 블록도이다.
도 2는 본 발명에 따른 영상 복호화 장치를 나타낸 블록도이다.
도 3 내지 도 5는 본 발명이 적용되는 일실시예로서, 픽쳐를 복수의 블록으로 분할하는 방법을 도시한 것이다.
도 6 내지 도 8은 본 발명이 적용되는 일실시예로서, 어파인 인터 예측 방법을 도시한 것이다.
도 9는 본 발명이 적용되는 일실시예로서, 움직임 벡터 차이값(MVD) 기반의 머지 모드를 이용한 영상 부호화/복호화 방법을 도시한 것이다.
도 10 내지 도 14는 본 발명이 적용되는 일실시예로서, 머지 후보로 이용 가능한 이전 블록을 도시한 것이다.
도 15 내지 도 19는 본 발명이 적용되는 일실시예로서, 머지 모드를 위한 머지 오프셋 벡터 유도 방법을 도시한 것이다.
도 20 내지 도 24는 본 발명이 적용되는 일실시예로서, 인트라 예측 방법을 도시한 것이다.
도 25 내지 도 28은 본 발명이 적용되는 일실시예로서, 와이드 앵글 기반의 인트라 예측 방법을 도시한 것이다.
도 29 및 도 30은 본 발명이 적용되는 일실시예로서, 복원 블록에 인루프 필터를 적용하는 방법을 도시한 것이다.
본 발명에 따른 영상 부호화/복호화 방법 및 장치는, 현재 블록의 머지 후보 리스트를 구성하고, 상기 현재 블록의 머지 인덱스와 상기 머지 후보 리스트를 기반으로, 상기 현재 블록의 움직임 정보를 유도하며, 상기 현재 블록의 움직임 벡터 차이값을 유도하고, 상기 움직임 벡터 차이값을 이용하여, 상기 현재 블록의 움직임 벡터를 보정하며, 상기 보정된 움직임 벡터를 이용하여, 상기 현재 블록의 움직임 보상을 수행할 수 있다.
본 발명에 따른 영상 부호화/복호화 방법 및 장치에 있어서, 상기 움직임 정보는 움직임 벡터 또는 참조 픽쳐 인덱스 중 적어도 하나를 포함할 수 있다.
본 발명에 따른 영상 부호화/복호화 방법 및 장치에 있어서, 상기 머지 후보 리스트는, 상기 현재 블록의 공간적 머지 후보 또는 시간적 머지 후보 중 적어도 하나를 포함할 수 있다.
본 발명에 따른 영상 부호화/복호화 방법 및 장치에 있어서, 상기 현재 블록의 움직임 정보 리스트에 속한 이전 블록의 움직임 정보가 상기 머지 후보 리스트에 더 추가되고, 상기 이전 블록은 상기 현재 블록 이전에 복호화가 완료된 하나 이상의 블록일 수 있다.
본 발명에 따른 영상 부호화/복호화 방법 및 장치에 있어서, 상기 움직임 벡터 차이값을 유도하는 단계는, 소정의 플래그에 기초하여 선택적으로 수행되고, 상기 플래그는 머지 모드에서 움직임 벡터 차이값을 이용하는지 여부를 나타낼 수 있다.
본 발명에 따른 영상 부호화/복호화 방법 및 장치에 있어서, 상기 플래그에 따라, 상기 현재 블록이 이용 가능한 머지 후보의 최대 개수는 적응적으로 결정될 수 있다.
본 발명에 따른 영상 부호화/복호화 방법 및 장치에 있어서, 상기 움직임 벡터 차이값은, 머지 오프셋 벡터에 기초하여 유도되고, 상기 머지 오프셋 벡터는, 상기 머지 오프셋 벡터의 길이와 방향에 기초하여 결정될 수 있다.
본 발명에 따른 영상 부호화/복호화 방법 및 장치에 있어서, 상기 머지 오프셋 벡터의 길이는, 부호화된 디스턴스 인덱스 또는 상기 현재 블록의 움직임 벡터의 정밀도 중 적어도 하나를 고려하여 결정될 수 있다.
본 발명에 따른 영상 부호화/복호화 방법 및 장치에 있어서, 상기 머지 오프셋 벡터의 방향은, 부호화된 방향 인덱스에 기초하여 결정되고, 상기 방향은 좌, 우, 상 또는 하 중 어느 하나의 방향으로 결정될 수 있다.
본 발명에 따른 영상 부호화/복호화 방법 및 장치에 있어서, 상기 움직임 벡터 차이값은, 소정의 스케일링 팩터를 상기 머지 오프셋 벡터에 적용하여 유도되고, 상기 스케일링 팩터는 상기 현재 블록이 속한 현재 픽쳐와 상기 현재 블록의 참조 픽쳐 간의 POC 차이에 기초하여 결정될 수 있다.
본 발명에 따른 비디오 비트스트림을 저장하기 위한 디지털 저장 매체는, 현재 블록의 머지 후보 리스트를 구성하고, 상기 현재 블록의 머지 인덱스와 상기 머지 후보 리스트를 기반으로 상기 현재 블록의 움직임 정보를 유도하며, 상기 현재 블록의 움직임 벡터 차이값을 유도하고, 상기 움직임 벡터 차이값을 이용하여 상기 현재 블록의 움직임 벡터를 보정하며, 상기 보정된 움직임 벡터를 이용하여 상기 현재 블록의 움직임 보상을 수행하는 처리를 실행하는 비디오 복호화 프로그램을 기록/저장할 수 있다.
본 명세서에 첨부된 도면을 참조하여 본 발명이 속하는 기술 분야에서 통상의 지식을 가진 자가 용이하게 실시할 수 있도록 본 발명의 실시예를 상세히 설명한다. 그러나 본 발명은 여러 가지 상이한 형태로 구현될 수 있으며 여기에서 설명하는 실시예에 한정되지 않는다. 그리고 도면에서 본 발명을 명확하게 설명하기 위해서 설명과 관계없는 부분은 생략하였으며, 명세서 전체를 통하여 유사한 부분에 대해서는 유사한 도면 부호를 붙였다.
본 명세서 전체에서, 어떤 부분이 다른 부분과 '연결'되어 있다고 할 때, 이는 직접적으로 연결되어 있는 경우뿐 아니라, 그 중간에 다른 소자를 사이에 두고 전기적으로 연결되어 있는 경우도 포함한다.
또한, 본 명세서 전체에서 어떤 부분이 어떤 구성요소를 '포함'한다고 할 때, 이는 특별히 반대되는 기재가 없는 한 다른 구성요소를 제외하는 것이 아니라 다른 구성 요소를 더 포함할 수 있는 것을 의미한다.
또한, 제1, 제2 등의 용어는 다양한 구성요소들을 설명하는데 사용될 수 있지만, 상기 구성요소들은 상기 용어들에 의해 한정되어서는 안 된다. 상기 용어들은 하나의 구성요소를 다른 구성요소로부터 구별하는 목적으로만 사용된다.
또한, 본 명세서에서 설명되는 장치 및 방법에 관한 실시예에 있어서, 장치의 구성 일부 또는 방법의 단계 일부는 생략될 수 있다. 또한 장치의 구성 일부 또는 방법의 단계 일부의 순서가 변경될 수 있다. 또한 장치의 구성 일부 또는 방법의 단계 일부에 다른 구성 또는 다른 단계가 삽입될 수 있다.
또한, 본 발명의 제1 실시예의 일부 구성 또는 일부 단계는 본 발명의 제2 실시예에 부가되거나, 제2 실시예의 일부 구성 또는 일부 단계를 대체할 수 있다.
덧붙여, 본 발명의 실시예에 나타나는 구성부들은 서로 다른 특징적인 기능들을 나타내기 위해 독립적으로 도시되는 것으로, 각 구성부들이 분리된 하드웨어나 하나의 소프트웨어 구성단위로 이루어짐을 의미하지 않는다. 즉, 각 구성부는 설명의 편의상 각각의 구성부로 나열하여 기술되고, 각 구성부 중 적어도 두 개의 구성부가 합쳐져 하나의 구성부로 이루어지거나, 하나의 구성부가 복수 개의 구성부로 나뉘어져 기능을 수행할 수 있다. 이러한 각 구성부의 통합된 실시예 및 분리된 실시예도 본 발명의 본질에서 벗어나지 않는 한 본 발명의 권리 범위에 포함된다.
본 명세서에서, 블록은 단위, 영역, 유닛, 파티션 등으로 다양하게 표현될 수 있고, 샘플은 화소, 펠(pel), 픽셀 등으로 다양하게 표현될 수 있다.
이하, 첨부한 도면들을 참조하여, 본 발명의 실시예를 보다 상세하게 설명하고자 한다. 본 발명을 설명함에 있어 동일한 구성요소에 대해서 중복된 설명은 생략한다.
도 1은 본 발명에 따른 영상 부호화 장치를 나타낸 블록도이다.
도 1을 참조하면, 종래 영상 부호화 장치(100)는 픽쳐 분할부(110), 예측부(120, 125), 변환부(130), 양자화부(135), 재정렬부(160), 엔트로피 부호화부(165), 역양자화부(140), 역변환부(145), 필터부(150) 및 메모리(155)를 포함할 수 있다.
픽쳐 분할부(110)는 입력된 픽쳐를 적어도 하나의 처리 단위로 분할할 수 있다. 이때, 처리 단위는 예측 단위(Prediction Unit: PU)일 수도 있고, 변환 단위(Transform Unit: TU)일 수도 있으며, 부호화 단위(Coding Unit: CU)일 수도 있다. 이하, 본 발명의 실시예에서는 부호화 단위는 부호화를 수행하는 단위의 의미로 사용할 수도 있고, 복호화를 수행하는 단위의 의미로 사용할 수도 있다.
예측 단위는 하나의 부호화 단위 내에서 동일한 크기의 적어도 하나의 정사각형 또는 직사각형 등의 형태를 가지고 분할된 것일 수도 있고, 하나의 부호화 단위 내에서 분할된 예측 단위 중 어느 하나의 예측 단위가 다른 하나의 예측 단위와 상이한 형태 및/또는 크기를 가지도록 분할된 것일 수도 있다. 부호화 단위를 기초로 인트라 예측을 수행하는 예측 단위를 생성시 최소 부호화 단위가 아닌 경우, 복수의 예측 단위 NxN 으로 분할하지 않고 인트라 예측을 수행할 수 있다.
예측부(120, 125)는 인터 예측 또는 화면 간 예측을 수행하는 인터 예측부(120)와 인트라 예측 또는 화면 내 예측을 수행하는 인트라 예측부(125)를 포함할 수 있다. 예측 단위에 대해 인터 예측을 사용할 것인지 또는 인트라 예측을 수행할 것인지를 결정하고, 각 예측 방법에 따른 구체적인 정보(예컨대, 인트라 예측 모드, 움직임 벡터, 참조 픽쳐 등)를 결정할 수 있다. 생성된 예측 블록과 원본 블록 사이의 잔차값(잔차 블록)은 변환부(130)로 입력될 수 있다. 또한, 예측을 위해 사용한 예측 모드 정보, 움직임 벡터 정보 등은 잔차값과 함께 엔트로피 부호화부(165)에서 부호화되어 복호화기에 전달될 수 있다.
인터 예측부(120)는 현재 픽쳐의 이전 픽쳐 또는 이후 픽쳐 중 적어도 하나의 픽쳐의 정보를 기초로 예측 단위를 예측할 수도 있고, 경우에 따라서는 현재 픽쳐 내의 부호화가 완료된 일부 영역의 정보를 기초로 예측 단위를 예측할 수도 있다. 인터 예측부(120)는 참조 픽쳐 보간부, 움직임 예측부, 움직임 보상부를 포함할 수 있다.
참조 픽쳐 보간부에서는 메모리(155)로부터 참조 픽쳐 정보를 제공받고 참조 픽쳐에서 정수 화소 이하의 화소 정보를 생성할 수 있다. 휘도 화소의 경우, 1/4 화소 단위로 정수 화소 이하의 화소 정보를 생성하기 위해 필터 계수를 달리하는 DCT 기반의 8탭 보간 필터(DCT-based Interpolation Filter)가 사용될 수 있다. 색차 신호의 경우 1/8 화소 단위로 정수 화소 이하의 화소 정보를 생성하기 위해 필터 계수를 달리하는 DCT 기반의 4탭 보간 필터(DCT-based Interpolation Filter)가 사용될 수 있다.
움직임 예측부는 참조 픽쳐 보간부에 의해 보간된 참조 픽쳐를 기초로 움직임 예측을 수행할 수 있다. 움직임 벡터를 산출하기 위한 방법으로 FBMA(Full search-based Block Matching Algorithm), TSS(Three Step Search), NTS(New Three-Step Search Algorithm) 등 다양한 방법이 사용될 수 있다. 움직임 벡터는 보간된 화소를 기초로 1/2 또는 1/4 화소 단위의 움직임 벡터값을 가질 수 있다. 움직임 예측부에서는 움직임 예측 방법을 다르게 하여 현재 예측 단위를 예측할 수 있다. 움직임 예측 방법으로 스킵 모드(Skip Mode), 병합 모드(Merge 모드), AMVP 모드(AMVP Mode), 인트라 블록 카피(Intra Block Copy) 모드, 어파인 모드(Affine mode) 등 다양한 방법이 사용될 수 있다.
인트라 예측부(125)는 현재 픽쳐 내의 화소 정보인 현재 블록 주변의 참조 픽셀 정보를 기초로 예측 단위를 생성할 수 있다. 현재 예측 단위의 주변 블록이 인터 예측을 수행한 블록이어서, 참조 픽셀이 인터 예측을 수행한 픽셀일 경우, 인터 예측을 수행한 블록에 포함되는 참조 픽셀을 주변의 인트라 예측을 수행한 블록의 참조 픽셀 정보로 대체하여 사용할 수 있다. 즉, 참조 픽셀이 가용하지 않는 경우, 가용하지 않은 참조 픽셀 정보를 가용한 참조 픽셀 중 적어도 하나의 참조 픽셀로 대체하여 사용할 수 있다.
또한, 예측부(120, 125)에서 생성된 예측 단위를 기초로 예측을 수행한 예측 단위와 예측 단위의 원본 블록과 차이값인 잔차값(Residual) 정보를 포함하는 잔차 블록이 생성될 수 있다. 생성된 잔차 블록은 변환부(130)로 입력될 수 있다.
변환부(130)에서는 원본 블록과 예측부(120, 125)를 통해 생성된 예측 단위의 잔차값(residual)정보를 포함한 잔차 블록을 DCT(Discrete Cosine Transform), DST(Discrete Sine Transform), KLT와 같은 변환 방법을 사용하여 변환시킬 수 있다. 잔차 블록을 변환하기 위해 DCT를 적용할지, DST를 적용할지 또는 KLT를 적용할지는 잔차 블록을 생성하기 위해 사용된 예측 단위의 인트라 예측 모드 정보를 기초로 결정할 수 있다.
양자화부(135)는 변환부(130)에서 주파수 영역으로 변환된 값들을 양자화할 수 있다. 블록에 따라 또는 영상의 중요도에 따라 양자화 계수는 변할 수 있다. 양자화부(135)에서 산출된 값은 역양자화부(140)와 재정렬부(160)에 제공될 수 있다.
재정렬부(160)는 양자화된 잔차값에 대해 계수값의 재정렬을 수행할 수 있다.
재정렬부(160)는 계수 스캐닝(Coefficient Scanning) 방법을 통해 2차원의 블록 형태 계수를 1차원의 벡터 형태로 변경할 수 있다. 예를 들어, 재정렬부(160)에서는 지그-재그 스캔(Zig-Zag Scan)방법을 이용하여 DC 계수부터 고주파수 영역의 계수까지 스캔하여 1차원 벡터 형태로 변경시킬 수 있다. 변환 단위의 크기 및 인트라 예측 모드에 따라 지그-재그 스캔 대신 2차원의 블록 형태 계수를 열 방향으로 스캔하는 수직 스캔, 2차원의 블록 형태 계수를 행 방향으로 스캔하는 수평 스캔이 사용될 수도 있다. 즉, 변환 단위의 크기 및 인트라 예측 모드에 따라 지그-재그 스캔, 수직 방향 스캔 및 수평 방향 스캔 중 어떠한 스캔 방법이 사용될지 여부를 결정할 수 있다.
엔트로피 부호화부(165)는 재정렬부(160)에 의해 산출된 값들을 기초로 엔트로피 부호화를 수행할 수 있다. 엔트로피 부호화는 예를 들어, 지수 골롬(Exponential Golomb), CAVLC(Context-Adaptive Variable Length Coding), CABAC(Context-Adaptive Binary Arithmetic Coding)과 같은 다양한 부호화 방법을 사용할 수 있다. 관련하여, 엔트로피 부호화부(165)는 재정렬부(160) 및 예측부(120, 125)로부터 부호화 단위의 잔차값 계수 정보를 부호화 할 수 있다. 또한, 본 발명에 따라 움직임 정보를 디코더 측면에서 유도하여 사용함을 지시하는 정보 및 움직임 정보 유도에 사용된 기법에 대한 정보를 시그널링(signaling)하여 전송하는 것이 가능하다.
역양자화부(140) 및 역변환부(145)에서는 양자화부(135)에서 양자화된 값들을 역양자화하고 변환부(130)에서 변환된 값들을 역변환한다. 역양자화부(140) 및 역변환부(145)에서 생성된 잔차값(Residual)은 예측부(120, 125)에 포함된 움직임 추정부, 움직임 보상부 및 인트라 예측부를 통해서 예측된 예측 단위와 합쳐져 복원 블록(Reconstructed Block)을 생성할 수 있다.
필터부(150)는 디블록킹 필터, 오프셋 보정부, ALF(Adaptive Loop Filter)중 적어도 하나를 포함할 수 있다. 디블록킹 필터는 복원된 픽쳐에서 블록간의 경계로 인해 생긴 블록 왜곡을 제거할 수 있다. 오프셋 보정부는 디블록킹을 수행한 영상에 대해 픽셀 단위로 원본 영상과의 오프셋을 보정할 수 있다. 특정 픽쳐에 대한 오프셋 보정을 수행하기 위해 영상에 포함된 픽셀을 일정한 수의 영역으로 구분한 후 오프셋을 수행할 영역을 결정하고 해당 영역에 오프셋을 적용하는 방법 또는 각 픽셀의 에지 정보를 고려하여 오프셋을 적용하는 방법을 사용할 수 있다. ALF(Adaptive Loop Filtering)는 필터링한 복원 영상과 원래의 영상을 비교한 값을 기초로 수행될 수 있다. 영상에 포함된 픽셀을 소정의 그룹으로 나눈 후 해당 그룹에 적용될 하나의 필터를 결정하여 그룹마다 차별적으로 필터링을 수행할 수 있다.
메모리(155)는 필터부(150)를 통해 산출된 복원 블록 또는 픽쳐를 저장할 수 있고, 저장된 복원 블록 또는 픽쳐는 인터 예측을 수행 시 예측부(120, 125)에 제공될 수 있다.
도 2는 본 발명에 따른 영상 복호화 장치를 나타낸 블록도이다.
도 2를 참조하면, 영상 복호화기(200)는 엔트로피 복호화부(210), 재정렬부(215), 역양자화부(220), 역변환부(225), 예측부(230, 235), 필터부(240), 메모리(245)가 포함될 수 있다.
영상 부호화기에서 영상 비트스트림이 입력된 경우, 입력된 비트스트림은 영상 부호화기와 반대의 절차로 복호화될 수 있다.
엔트로피 복호화부(210)는 영상 부호화기의 엔트로피 부호화부에서 엔트로피 부호화를 수행한 것과 반대의 절차로 엔트로피 복호화를 수행할 수 있다. 예를 들어, 영상 부호화기에서 수행된 방법에 대응하여 지수 골롬(Exponential Golomb), CAVLC(Context-Adaptive Variable Length Coding), CABAC(Context-Adaptive Binary Arithmetic Coding)과 같은 다양한 방법이 적용될 수 있다.
엔트로피 복호화부(210)에서는 부호화기에서 수행된 인트라 예측 및 인터 예측에 관련된 정보를 복호화할 수 있다.
재정렬부(215)는 엔트로피 복호화부(210)에서 엔트로피 복호화된 비트스트림을 부호화부에서 재정렬한 방법을 기초로 재정렬을 수행할 수 있다. 1차원 벡터 형태로 표현된 계수들을 다시 2차원의 블록 형태의 계수로 복원하여 재정렬할 수 있다.
역양자화부(220)는 부호화기에서 제공된 양자화 파라미터와 재정렬된 블록의 계수값을 기초로 역양자화를 수행할 수 있다.
역변환부(225)는 영상 부호화기에서 수행한 양자화 결과에 대해 변환부에서 수행한 변환 즉, DCT, DST, 및 KLT에 대해 역변환 즉, 역 DCT, 역 DST 및 역 KLT를 수행할 수 있다. 역변환은 영상 부호화기에서 결정된 전송 단위를 기초로 수행될 수 있다. 영상 복호화기의 역변환부(225)에서는 예측 방법, 현재 블록의 크기 및 예측 방향 등 복수의 정보에 따라 변환 기법(예를 들어, DCT, DST, KLT)이 선택적으로 수행될 수 있다.
예측부(230, 235)는 엔트로피 복호화부(210)에서 제공된 예측 블록 생성 관련 정보와 메모리(245)에서 제공된 이전에 복호화된 블록 또는 픽쳐 정보를 기초로 예측 블록을 생성할 수 있다.
전술한 바와 같이 영상 부호화기에서의 동작과 동일하게 인트라 예측 또는 화면 내 예측을 수행시 예측 단위의 크기와 변환 단위의 크기가 동일할 경우, 예측 단위의 좌측에 존재하는 픽셀, 좌측 상단에 존재하는 픽셀, 상단에 존재하는 픽셀을 기초로 예측 단위에 대한 인트라 예측을 수행하지만, 인트라 예측을 수행시 예측 단위의 크기와 변환 단위의 크기가 상이할 경우, 변환 단위를 기초로 한 참조 픽셀을 이용하여 인트라 예측을 수행할 수 있다. 또한, 최소 부호화 단위에 대해서만 NxN 분할을 사용하는 인트라 예측을 사용할 수도 있다.
예측부(230, 235)는 예측 단위 판별부, 인터 예측부 및 인트라 예측부를 포함할 수 있다. 예측 단위 판별부는 엔트로피 복호화부(210)에서 입력되는 예측 단위 정보, 인트라 예측 방법의 예측 모드 정보, 인터 예측 방법의 움직임 예측 관련 정보 등 다양한 정보를 입력 받고 현재 부호화 단위에서 예측 단위를 구분하고, 예측 단위가 인터 예측을 수행하는지 아니면 인트라 예측을 수행하는지 여부를 판별할 수 있다. 반면, 만약 부호화기(100)에서 상기 인터 예측을 위한 움직임 예측 관련 정보를 전송하지 않고, 대신 움직임 정보를 디코더 측면에서 유도하여 사용함을 지시하는 정보 및 움직임 정보 유도에 사용된 기법에 대한 정보를 전송하는 경우에는, 상기 예측 단위 판별부는 부호화기(100)로부터 전송된 정보를 기초로 하여, 인터 예측부(230)의 예측 수행을 판별하게 된다.
인터 예측부(230)는 영상 부호화기에서 제공된 현재 예측 단위의 인터 예측에 필요한 정보를 이용해 현재 예측 단위가 포함된 현재 픽쳐의 이전 픽쳐 또는 이후 픽쳐 중 적어도 하나의 픽쳐에 포함된 정보를 기초로 현재 예측 단위에 대한 인터 예측을 수행할 수 있다. 인터 예측을 수행하기 위해 부호화 단위를 기준으로 해당 부호화 단위에 포함된 예측 단위의 움직임 예측 방법이 스킵 모드(Skip Mode), 병합 모드(Merge 모드), AMVP 모드(AMVP Mode), 인트라 블록 카피 모드(Intra block copy mode), 어파인 모드(Affine mode) 중 어떠한 방법인지 여부를 판단할 수 있다.
인트라 예측부(235)는 현재 픽쳐 내의 화소 정보를 기초로 예측 블록을 생성할 수 있다. 예측 단위가 인트라 예측을 수행한 예측 단위인 경우, 영상 부호화기에서 제공된 예측 단위의 인트라 예측 모드 정보를 기초로 인트라 예측을 수행할 수 있다.
인트라 예측부(235)에는 AIS(Adaptive Intra Smoothing) 필터, 참조 화소 보간부, DC 필터를 포함할 수 있다. AIS 필터는 현재 블록의 참조 화소에 필터링을 수행하는 부분으로써 현재 예측 단위의 예측 모드에 따라 필터의 적용 여부를 결정하여 적용할 수 있다. 영상 부호화기에서 제공된 예측 단위의 예측 모드 및 AIS 필터 정보를 이용하여 현재 블록의 참조 화소에 AIS 필터링을 수행할 수 있다. 현재 블록의 예측 모드가 AIS 필터링을 수행하지 않는 모드일 경우, AIS 필터는 적용되지 않을 수 있다.
참조 화소 보간부는 예측 단위의 예측 모드가 참조 화소를 보간한 화소값을 기초로 인트라 예측을 수행하는 예측 단위일 경우, 참조 화소를 보간하여 정수값 이하의 화소 단위의 참조 화소를 생성할 수 있다. 현재 예측 단위의 예측 모드가 참조 화소를 보간하지 않고 예측 블록을 생성하는 예측 모드일 경우 참조 화소는 보간되지 않을 수 있다. DC 필터는 현재 블록의 예측 모드가 DC 모드일 경우 필터링을 통해서 예측 블록을 생성할 수 있다.
복원된 블록 또는 픽쳐는 필터부(240)로 제공될 수 있다. 필터부(240)는 디블록킹 필터, 오프셋 보정부, ALF를 포함할 수 있다.
영상 부호화기로부터 해당 블록 또는 픽쳐에 디블록킹 필터를 적용하였는지 여부에 대한 정보 및 디블록킹 필터를 적용하였을 경우, 강한 필터를 적용하였는지 또는 약한 필터를 적용하였는지에 대한 정보를 제공받을 수 있다. 영상 복호화기의 디블록킹 필터에서는 영상 부호화기에서 제공된 디블록킹 필터 관련 정보를 제공받고 영상 복호화기에서 해당 블록에 대한 디블록킹 필터링을 수행할 수 있다.
오프셋 보정부는 부호화시 영상에 적용된 오프셋 보정의 종류 및 오프셋 값 정보 등을 기초로 복원된 영상에 오프셋 보정을 수행할 수 있다. ALF는 부호화기로부터 제공된 ALF 적용 여부 정보, ALF 계수 정보 등을 기초로 부호화 단위에 적용될 수 있다. 이러한 ALF 정보는 특정한 파라메터 셋에 포함되어 제공될 수 있다.
메모리(245)는 복원된 픽쳐 또는 블록을 저장하여 참조 픽쳐 또는 참조 블록으로 사용할 수 있도록 할 수 있고 또한 복원된 픽쳐를 출력부로 제공할 수 있다.
도 3 내지 도 5는 본 발명이 적용되는 일실시예로서, 픽쳐를 복수의 블록으로 분할하는 방법을 도시한 것이다.
도 3을 참조하면, 픽쳐(300)는복수개의 기본 코딩 유닛(Coding Tree Unit, 이하, CTU)으로 나누어진다.
픽쳐 또는 비디오 시퀀스 단위로 CTU의 크기를 규정할 수 있으며, 각 CTU는 다른 CTU와 겹치지 않도록 구성되어 있다. 예를 들어, 전체 시퀀스에서 CTU 사이즈를 128x128로 설정할 수 있고, 픽쳐 단위로 128x128 내지 256x256 중 어느 하나를 선택해서 사용할 수도 있다.
CTU를 계층적으로 분할하여 코딩 블록/코딩 유닛(Coding Unit, 이하 CU)을 생성할 수 있다. 코딩 유닛 단위로 예측 및 변환을 수행할 수 있으며, 예측 부호화 모드를 결정하는 기본 단위가 된다. 예측 부호화 모드는 예측 영상을 생성하는 방법을 나타내며, 화면 내 예측 (intra prediction, 이하, 인트라 예측), 화면 간 예측(inter prediction, 이하, 인터 예측) 또는 복합 예측(combined prediction) 등을 예로 들 수 있다. 구체적으로 예를 들어, 코딩 유닛 단위로 인트라 예측, 인터 예측 또는 복합 예측 중 적어도 어느 하나의 예측 부호화 모드를 이용하여 예측 블록(prediction block)을 생성할 수 있다. 화면 간 예측 모드에서 참조 픽쳐가 현재 픽쳐를 가리키는 경우에는 이미 복호화된 현재 픽쳐 내 영역을 기반으로 예측 블록을 생성할 수 있다. 이는, 참조 픽쳐 인덱스와 움직임 벡터를 이용하여 예측 블록을 생성하기 때문에 화면 간 예측에 포함될 수 있다. 인트라 예측은 현재 픽쳐의 정보를 이용하여 예측 블록을 생성하는 방법이고, 인터 예측은 이미 복호화된 다른 픽쳐의 정보를 이용하여 예측 블록을 생성하는 방법이며, 복합 예측은 인터 예측과 인트라 예측을 혼합하여 사용하는 방법이다. 복합 예측은, 하나의 코딩 블록을 구성하는 복수의 서브 영역 중 일부 영역은 인터 예측으로 부호화/복호화하고, 나머지 영역은 인트라 예측으로 부호화/복호화할 수 있다. 또는, 복합 예측은, 복수의 서브 영역에 대해서 1차적으로 인터 예측을 수행하고, 2차적으로 인트라 예측을 수행할 수 있다. 이 경우, 코딩 블록의 예측값은, 인터 예측에 따른 예측값과 인트라 예측에 따른 예측값을 가중 평균하여 유도될 수 있다. 하나의 코딩 블록을 구성하는 서브 영역의 개수는, 2개, 3개, 4개 또는 그 이상일 수 있고, 서브 영역의 형태는, 사각형, 삼각형, 기타 다각형일 수 있다.
도 4를 참조하면, CTU는 쿼드 트리, 바이너리 트리 또는 트리플 트리 형태로 분할 (파티셔닝)될 수 있다. 분할된 블록은 다시 쿼드 트리, 바이너리 트리 또는 트리플 트리 형태로 추가 분할될 수 있다. 현재 블록을 4개의 정방 형태 파티션으로 나누는 방법을 쿼드 트리 파티셔닝이라고 부르고, 현재 블록을 2개의 정방 또는 비정방 형태 파티션으로 나누는 방법을 바이너리 트리 파티셔닝이라고 부르며, 현재 블록을 3개의 파티션으로 나누는 방법을 바이너리 트리 파티셔닝이라고 부른다.
수직 방향으로 바이너리 파티셔닝(도 4의 SPLIT_BT_VER)을 수직 바이너리 트리 파티셔닝이라고 부르며, 수평 방향으로 바이너리 트리 파티셔닝 (도 4의 SPLIT_BT_HOR)을 수평 바이너리 트리 파티셔닝이라고 부른다.
수직 방향으로 트리플 파티셔닝 (도 4의 SPLIT_TT_VER)을 수직 트리플 트리 파티셔닝이라고 부르며, 수평 방향으로 트리플 트리 파티셔닝 (도 4의 SPLIT_TT_HOR)을 수평 트리플 트리 파티셔닝이라고 부른다.
분할 횟수를 파티셔닝 뎁스(partitioning depth)라고 부르며, 시퀀스, 픽쳐, 서브 픽쳐, 슬라이스 또는 타일 별로 파티셔닝 뎁스의 최대치를 서로 다르게 설정할 수도 있으며, 파티셔닝 트리 형태(쿼드 트리/바이너리 트리/트리플 트리)에 따라 서로 다른 파티셔닝 뎁스를 가지도록 설정할 수 있으며, 이를 나타내는 신택스를 시그날링할 수도 있다.
쿼드 트리 파티션닝, 바이너리 트리 파니셔닝 또는 기타 멀티 트리 파티셔닝(예를 들어, 터너리 트리 파티셔닝)과 같은 방법으로, 분할된 코딩 유닛을 추가로 분할하여 리프 노드(leaf node)의 코딩 유닛을 구성하거나, 추가 분할 없이 리프 노드(leaf node)의 코딩 유닛을 구성할 수도 있다.
도 5를 참조하면, 하나의 CTU를 계층적으로 분할하여 코딩 유닛을 설정할 수 있으며, 바이너리 트리 파티셔닝, 쿼드 트리 파티셔닝/트리플 트리 파티셔닝 중 적어도 어느 하나를 이용하여 코딩 유닛을 분할할 수 있다. 이와 같은 방법을 멀티 트리 파티셔닝(Multi tree partitioning)이라고 부른다.
파티셔닝 뎁스가 k인 임의의 코딩 유닛을 분할하여 생성된 코딩 유닛을 하위 코딩 유닛이라 하며, 파티셔닝 뎁스는 (k+1)이 된다. 파티셔닝 뎁스 (k+1)인 하위 코딩 유닛을 포함하고 있는 파티셔닝 뎁스 k인 코딩 유닛을 상위 코딩 유닛이라 한다.
상위 코딩 유닛의 파티셔닝 타입 및/또는 현재 코딩 유닛의 주변에 있는 코딩 유닛의 파티셔닝 타입에 따라 현재 코딩 유닛의 파티셔닝 타입이 제한될 수도 있다.
여기서, 파티셔닝 타입은 바이너리 트리 파티셔닝, 쿼드 트리 파티셔닝/트리플 트리 파티셔닝 중 어느 파티셔닝을 사용했는지를 알려주는 지시자를 나타낸다.
비디오 부호화/복호화에서 예측 영상은 복수 개의 방법으로 생성할 수 있으며, 예측 영상을 생성하는 방법을 예측 부호화 모드라고 한다.
예측 부호화 모드는 인트라 예측 부호화 모드, 인터 예측 부호화 모드, 현재 픽쳐 레퍼런스 부호화 모드 또는 결합 부호화 모드 (combined prediction)등으로 구성될 수 있다.
인터 예측 부호화 모드는 이전 픽쳐의 정보를 이용하여 현재 블록의 예측 블록(예측 영상)을 생성하는 예측 부호화 모드라고 하고, 인트라 예측 부호화 모드는 현재 블록과 이웃한 샘플을 이용하여 예측 블록을 생성하는 예측 부호화 모드라 한다. 현재 픽쳐의 이미 복원된 영상을 이용하여 예측 블록을 생성할 수도 있으며, 이를 현재 픽쳐 레퍼런스 모드 또는 인트라 블록 카피 모드라고 부른다.
인터 예측 부호화 모드, 인트라 예측 부호화 모드 또는 현재 픽쳐 레퍼런스 부호화 모드 중 적어도 2개 이상의 예측 부호화 모드를 사용하여 예측 블록을 생성할 수도 있으며, 이를 결합 부호화 모드(Combined prediction)이라고 부른다.
이전 픽쳐의 정보를 이용하여 현재 픽쳐에 있는 블록의 예측 블록(예측 영상)을 생성하는 방법을 인터 예측 부호화 모드라고 부른다.
예를 들어, 이전 픽쳐의 해당 블록(colocated block)을 기반으로 예측 영상을 생성하거나, 이전 픽쳐의 특정 블록을 기반으로 예측 블록(예측 영상)을 생성할 수 있다.
현재 블록에서 이전 픽쳐의 해당 블록을 차분한 블록을 해당 예측 블록(colocated prediction block)이라고 부른다.
인터 예측 부호화 모드에서는 오브젝트의 움직임을 고려하여 예측 블록을 생성할 수 있다.
예를 들어, 이전 픽쳐에 있는 오브젝트가 현재 픽쳐에서 어느 방향으로 어느 정도 움직였는지 알면 현재 블록에서 움직임을 고려한 블록을 차분하여 예측 블록(예측 영상)을 생성할 수 있으며, 이를 움직임 예측 블록이라고 부른다.
현재 블록에서 움직임 예측 블록 또는 해당 예측 블록을 차분하여 잔차 블록을 생성할 수 있다.
오브젝트에 움직임이 발생하면, 해당 예측 블록보다 움직임 예측 블록을 사용하면 잔차 블록의 에너지가 작아져서 압축 성능이 좋아질 수 있다.
이와 같이 움직임 예측 블록을 이용하는 방법을 움직임 보상 예측이라고 부르며, 대부분의 인터 예측 부호화에서는 움직임 보상 예측을 사용한다.
이전 픽쳐에 있는 오브젝트가 현재 픽쳐에서 어느 방향으로, 어느 정도 움직였는지를 나타내는 값을 움직임 벡터라고 한다. 움직임 벡터는 시퀀스, 픽쳐, 서브 픽쳐, 슬라이스, 타일, CTU 또는 CU의 단위로 서로 다른 화소 정밀도를 갖는 움직임 벡터를 사용할 수 있다. 예를 들어, 특정 블록에서 움직임 벡터의 화소 정밀도는 1/16, 1/8, 1/4, 1/2, 1, 2, 4 또는 8 중 적어도 어느 하나일 수 있다. 후술하는 인터 예측 부호화 모드 별로, 이용 가능한 화소 정밀도 후보의 종류 및/또는 개수가 상이할 수 있다. 예를 들어, 어파인 인터 예측 방법의 경우, k개의 화소 정밀도가 이용 가능하고, translation 움직임을 이용한 인터 예측 방법의 경우, i개의 화소 정밀도가 이용 가능하다. 현재 픽쳐 레퍼런스 모드의 경우, j개의 화소 정밀도가 이용 가능하다. 여기서, k, i와 j는 1, 2, 3, 4, 5, 또는 그 이상의 자연수일 수 있다. 다만, k는 i보다 작고, i는 j보다 작을 수 있다. 어파인 인터 예측 방법은 1/16, 1/4 또는 1 중 적어도 하나의 화소 정밀도를 이용하고, translation 움직임을 이용한 인터 예측 방법(e.g., 머지 모드, AMVP 모드)은 1/4, 1/2, 1 또는 4 중 적어도 하나의 화소 정밀도를 이용할 수 있다. 현재 픽쳐 레퍼런스 모드는, 1, 4 또는 8 중 적어도 하나의 화소 정밀도를 이용할 수 있다.
인터 예측 모드는 translaton 움직임을 이용한 인터 예측 방법과 affine 움직임을 이용한 affine 인터 예측 방법이 선택적으로 사용될 수도 있다.
도 6 내지 도 8은 본 발명이 적용되는 일실시예로서, 어파인 인터 예측 방법을 도시한 것이다.
비디오에서 특정 물체(object)의 움직임이 선형적으로 나타나지 않는 경우가 많이 발생한다. 예를 들어, 도 6과 같이 카메라 줌인 (Zoom-in), 줌 아웃(Zoom-out), 회전(roation), 임의 형태로 변환을 가능하게 하는 affine 변환 등의 affine motion이 사용된 영상에서는 오브젝트의 움직임을 translation 움직임 벡터만 사용하는 경우 물체의 움직임을 효과적으로 표현할 수 없으며, 부호화 성능이 낮아질 수 있다.
어파인 움직임은 다음 수학식 1과 같이 표현할 수 있다.
[수학식 1]
vx=ax-by+e
vy=cx+dy+f
어파인 움직임을 총 6개의 파라미터를 사용하여 표현하는 것은 복잡한 움직임이 있는 영상에 효과적이지만, 어파인 움직임 파라미터를 부호화하는데 사용하는 비트가 많아서 부호화 효율이 떨어질 수도 있다.
이에, 4개의 파라미터로 어파인 움직임을 간략화하여 표현할 수 있으며,, 이를 4 파라미터 어파인 움직임 모델이라고 부른다. 수학식 2는 4개의 파라미터로 어파인 움직임을 표현한 것이다.
[수학식 2]
vx=ax-by+e
vy=bx+ay+f
4-파라미터 어파인 움직임 모델은 현재 블록의 2개 컨트롤 포인트에서의 움직임 벡터를 포함할 수 있다. 컨트롤 포인트는 현재 블록의 좌상단 코너, 우상단 코너 또는 좌하단 코너 중 적어도 하나를 포함할 수 있다. 일 예로, 4-파라미터 어파인 움직임 모델은 도 7의 좌측 그림과 같이 코딩 유닛의 좌상단 샘플 (x0,y0)에서의 움직임 벡터 sv0 와 코딩 유닛의 우상단 샘플 (x1,y1)에서의 움직임 벡터 sv1에 의해서 결정 될 수 있으며, sv0와 sv1을 어파인 시드 벡터라고 부른다. 이하, 좌상단에 위치한 어파인 시드 벡터 sv0를 제1 어파인 시드 벡터라 가정하고, 우상단에 위치한 어파인 시드 벡터 sv1를 제2 어파인 시드 벡터라 가정하기로 한다. 4-파라미터 어파인 움직임 모델에서 제1 또는 제2 어파인 시드 벡터 중 하나를 좌하단에 위치한 어파인 시드 벡터로 교체하여 사용하는 것도 가능하다.
6-파라미터 어파인 움직임 모델은 도 7의 우측 그림과 같이 4-파라미터 어파인 움직임 모델에 잔여 컨트롤 포인트(예컨대, 좌하단에 샘플 (x2,y2))의 움직임 벡터 sv2가 추가된 어파인 움직임 모델이다. 이하, 좌상단에 위치한 어파인 시드 벡터 sv0를 제1 어파인 시드 벡터라 가정하고, 우상단에 위치한 어파인 시드 벡터 sv1를 제2 어파인 시드 벡터라 가정하고, 좌하단에 위치한 어파인 시드 벡터 sv2를 제3 어파인 시드 벡터라 가정한다.
어파인 움직임을 표현하기 위한 파라미터의 개수에 관한 정보가 비트스트림에 부호화될 수 있다. 예컨대, 6-파라미터의 사용 여부를 나타내는 플래그, 4-파라미터의 사용 여부를 나타내는 플래그가 픽쳐, 서브 픽쳐, 슬라이스, 타일 세트, 타일, 코딩 유닛 또는 CTU 중 적어도 하나의 단위로 부호화/복호화될 수 있다. 이에 따라, 소정의 단위로 4-파라미터 어파인 움직임 모델 또는 6-파라미터 어파인 움직임 모델 중 어느 하나를 선택적으로 사용할 수도 있다.
어파인 시드 벡터를 이용하여 도 8과 같이 코딩 유닛의 서브 블록 별로 움직임 벡터를 유도할 수 있으며, 이를 어파인 서브 블록 벡터라고 부른다.
어파인 서브 블록 벡터는 다음 수학식 3과 같이 유도할 수도 있다. 여기서 서브 블록의 기준 샘플 위치(x,y)는 블록의 코너에 위치한 샘플(예컨대, 좌상단 샘플)일 수도 있고, x축 또는 y축 중 적어도 하나가 중앙인 샘플(예컨대, 중앙 샘플)일 수도 있다.
[수학식 3]
Figure PCTKR2019018644-appb-I000001
어파인 서브 블록 벡터를 이용하여 코딩 유닛 단위 또는 코딩 유닛 내 서브 블록 단위로 움직임 보상을 수행할 수 있으며, 이를 어파인 인터 예측 모드라고 부른다. 수학식 3에서 (x1-x0)는 코딩 유닛의 너비와 같은 값을 가질 수 있다.
도 9는 본 발명이 적용되는 일실시예로서, 움직임 벡터 차이값(MVD) 기반의 머지 모드를 이용한 영상 부호화/복호화 방법을 도시한 것이다.
현재 코딩 유닛(또는 현재 블록)의 움직임 정보를 부호화 하지 않고, 주변 블록의 움직임 정보로부터 현재 코딩 유닛의 움직임 정보를 유도할 수 있다. 주변 블록 중 어느 하나의 움직임 정보를 현재 코딩 유닛의 움직임 정보로 설정할 수 있으며, 이를 머지 모드(merge mode)라고 부른다. 즉, 머지 모드는 주변 블록의 움직임 정보를 현재 블록의 움직임 정보로 동일하게 이용하며, AMVP 모드와 달리 별도의 움직임 벡터 차이값을 부호화할 것을 요구하지 않는다. 다만, 머지 모드의 경우에도 움직임 벡터의 정확도를 향상시키기 위하여 소정의 움직임 벡터 차이값(MVD)을 이용할 수 있다. 본 발명에서, 움직임 정보는, 움직임 벡터, 참조 픽쳐 인덱스 또는 예측 방향 정보 중 적어도 하나를 포함하는 것으로 이해될 수 있다.
상기 MVD는 소정의 플래그(이하, MVD_flag)에 기초하여 선택적으로 이용될 수 있다. MVD_flag는, 머지 모드에서 움직임 벡터 차이값(MVD)을 이용하는지 여부를 나타낼 수 있다. 예를 들어, 상기 플래그가 제1 값인 경우, 머지 모드에서 움직임 벡터 차이값이 이용되고, 그렇지 않은 경우, 머지 모드에서 움직임 벡터 차이값이 이용되지 아니한다.
도 9를 참조하면, 현재 블록의 머지 후보 리스트를 구성할 수 있다(S900).
머지 후보 리스트는, 현재 블록의 움직임 정보를 유도하기 위해 이용 가능한 하나 또는 복수의 머지 후보를 포함할 수 있다. 머지 후보 리스트의 크기는, 머지 후보 리스트를 구성하는 머지 후보의 최대 개수를 지시하는 정보(이하, 크기 정보)에 기초하여 가변적으로 결정될 수 있다. 상기 크기 정보는, 부호화 장치에서 부호화되어 시그날링되거나, 복호화 장치에 기-약속된 고정된 값(예를 들어, 2, 3, 4, 5, 6 또는 그 이상의 정수)일 수도 있다.
머지 후보 리스트에 속한 복수의 머지 후보는, 공간적 머지 후보 또는 시간적 머지 후보 중 적어도 하나를 포함할 수 있다.
공간적 머지 후보는, 현재 블록에 공간적으로 인접한 주변 블록 또는 상기 주변 블록의 움직임 정보를 의미할 수 있다. 여기서, 주변 블록은, 현재 블록의 좌하단 블록(A0), 좌측 블록(A1), 우상단 블록(B0), 상단 블록(B1) 또는 좌상단 블록(B2) 중 적어도 하나를 포함할 수 있다. 소정의 우선순서에 따라, 상기 주변 블록 중 가용한 주변 블록이 순차적으로 머지 후보 리스트에 추가될 수 있다. 예를 들어, 우선순위는, B1->A1->B0->A1->B2, A1->B1->A0->B1->B2, A1->B1->B0->A0->B2 등으로 정의될 수 있으며, 다만 이에 한정되지 아니한다.
시간적 머지 후보는, 콜 픽쳐(co-located picture)에 속한 하나 또는 그 이상의 콜 블록(co-located block) 또는 상기 콜 블록의 움직임 정보를 의미할 수 있다. 여기서, 콜 픽쳐는, 참조 픽쳐 리스트에 속한 복수의 참조 픽쳐 중 어느 하나이며, 이는 현재 블록이 속한 픽쳐와 다른 픽쳐일 수 있다. 콜 픽쳐는 참조 픽쳐 리스트에서 가장 처음에 위치한 픽쳐이거나 가장 마지막에 위치한 픽쳐일 수 있다. 또는, 콜 픽쳐는 콜 픽쳐를 지시하기 위해 부호화된 인덱스에 기초하여 특정될 수도 있다. 콜 블록은, 현재 블록의 중앙 위치를 포함하는 블록(C1) 또는 현재 블록의 우하단 코너에 인접한 주변 블록(C0) 중 적어도 하나를 포함할 수 있다. 소정의 우선순서에 따라, 상기 C0와 C1 중 가용한 블록이 순차적으로 머지 후보 리스트에 추가될 수 있다. 예를 들어, C0는 C1보다 높은 우선순위를 가질 수 있다. 다만, 이에 한정되지 아니하며, C1은 C0보다 높은 우선순위를 가질 수도 있다.
부호화/복호화 장치는, 현재 블록 이전에 부호화/복호화가 완료된 하나 이상의 블록(이하, 이전 블록)의 움직임 정보를 저장하는 버퍼를 포함할 수 있다. 다시 말해, 버퍼는, 이전 블록의 움직임 정보로 구성된 리스트(이하, 움직임 정보 리스트)를 저장할 수 있다.
상기 움직임 정보 리스트는, 픽쳐, 슬라이스, 타일, CTU 행 또는 CTU 중 어느 하나의 단위로 초기화될 수 있다. 초기화는 움직임 정보 리스트가 비어있는 상태를 의미할 수 있다. 이전 블록의 부호화/복호화 순서에 따라 순차적으로 해당 이전 블록의 움직임 정보가 움직임 정보 리스트에 추가되되, 움직임 정보 리스트는, 움직임 정보 리스트의 크기를 고려하여 FIFO(first-in first-out) 방식으로 업데이트될 수 있다. 예를 들어, 가장 최근에 부호화/복호화된 움직임 정보(이하, 최근 움직임 정보)가 움직임 정보 리스트에 기-추가된 움직임 정보와 동일한 경우, 최근 움직임 정보는 움직임 정보 리스트에 추가되지 않을 수 있다. 또는, 최근 움직임 정보와 동일한 움직임 정보를 움직임 정보 리스트에서 제거하고, 최근 움직임 정보를 움직임 정보 리스트에 추가할 수도 있다. 이때, 최근 움직임 정보는, 움직임 정보 리스트의 가장 마지막 위치에 추가되거나, 제거된 움직임 정보의 위치에 추가될 수 있다.
이전 블록은, 현재 블록에 공간적으로 인접한 하나 또는 그 이상의 주변 블록 또는 현재 블록에 공간적으로 인접하지 않은 하나 또는 그 이상의 주변 블록 중 적어도 하나를 포함할 수 있다. 본 발명의 이전 블록의 범위에 대해서는 도 10 내지 도 14를 참조하여 자세히 살펴보도록 한다.
머지 후보 리스트는, 버퍼 또는 움직임 정보 리스트에 속한 이전 블록 또는 이전 블록의 움직임 정보가 머지 후보로 더 추가될 수도 있다.
구체적으로, 움직임 정보 리스트와 머지 후보 리스트 간의 중복성 체크가 수행될 수 있다. 중복성 체크는, 머지 후보 리스트에 속한 머지 후보 전부 또는 일부와 움직임 정보 리스트에 이전 블록 전부 또는 일부에 대해서 수행될 수 있다. 다만, 설명의 편의를 위해, 본 발명의 중복성 체크는, 머지 후보 리스트에 속한 머지 후보 일부와 움직임 정보 리스트에 이전 블록 일부에 대해서 수행됨을 가정한다. 여기서, 머지 후보 리스트의 일부 머지 후보는, 공간적 머지 후보 중 좌측 블록 또는 상단 블록 중 적어도 하나를 포함할 수 있다. 다만, 이에 한정되지 아니하며, 공간적 머지 후보 중 어느 하나의 블록으로 제한될 수도 있고, 좌하단 블록, 우상단 블록, 좌상단 블록 또는 시간적 머지 후보 중 적어도 하나를 더 포함할 수도 있다. 움직임 정보 리스트의 일부 이전 블록은, 움직임 정보 리스트에 최근에 추가된 K개의 이전 블록을 의미할 수 있다. 여기서, K는 1, 2, 3 또는 그 이상이고, 부호화/복호화 장치에 기-약속된 고정된 값일 수 있다.
예를 들어, 움직임 정보 리스트에 5개의 이전 블록(또는 이전 블록의 움직임 정보)가 저장되어 있고, 각 이전 블록에 1 내지 5의 인덱스가 할당되어 있다고 가정한다. 인덱스가 클수록 최근에 저장된 이전 블록을 의미한다. 이때, 인덱스 5, 4 및 3을 가진 이전 블록과 머지 후보 리스트의 일부 머지 후보 간의 움직임 정보의 중복성을 체크할 수 있다. 또는, 인덱스 5 및 4를 가진 이전 블록과 머지 후보 리스트의 일부 머지 후보 간의 중복성을 체크할 수도 있다. 또는, 가장 최근에 추가된 인덱스 5의 이전 블록을 제외하고, 인덱스 4 및 3을 가진 이전 블록과 머지 후보 리스트의 일부 머지 후보 간의 중복성을 체크할 수도 있다.
중복성 체크 결과, 동일한 움직임 정보를 가진 이전 블록이 하나라도 존재하는 경우, 움직임 정보 리스트의 이전 블록은 머지 후보 리스트에 추가되지 않을 수 있다. 반면 동일한 움직임 정보를 가진 이전 블록이 존재하지 않는 경우, 움직임 정보 리스트의 이전 블록 전부 또는 일부는 머지 후보 리스트의 마지막 위치에 추가될 수 있다. 이때, 움직임 정보 리스트에서 최근에 추가된 이전 블록의 순서(즉, 인덱스가 큰 순서부터 작은 순서로)로 머지 후보 리스트에 추가될 수 있다. 다만, 움직임 정보 리스트에 가장 최근에 추가된 이전 블록(즉, 가장 큰 인덱스를 가진 이전 블록)는 머지 후보 리스트에 추가되지 않도록 제한될 수도 있다. 상기 이전 블록의 추가는, 머지 후보 리스트의 크기를 고려하여 수행될 수 있다. 예를 들어, 전술한 머지 후보 리스트의 크기 정보에 따라, 머지 후보 리스트가 최대 T개의 머지 후보를 가지는 경우를 가정한다. 이 경우, 이전 블록의 추가는, 머지 후보 리스트에 속한 머지 후보의 개수 (T-n)개가 될 때까지만 수행되도록 제한될 수 있다. 여기서, n은 1, 2 또는 그 이상의 정수일 수 있다. 또는, 이전 블록의 추가는, 머지 후보 리스트에 속한 머지 후보의 개수 T개가 될 때까지 반복적으로 수행될 수도 있다.
MVD_flag의 값에 따라 이웃 블록을 머지 후보로 이용할 수 있는지 여부가 적응적으로 결정될 수 있다. 일 예로, MVD_flag가 1인 경우, 현재 블록의 우측 상단 코너, 좌측 하단 코너 또는 좌측 상단 코너에 인접한 블록은 이용 불가능한 것으로 설정될 수 있다. 또는, MVD_flag가 1인 경우, 시간적 머지 후보는 이용 불가능한 것으로 설정될 수 있다. 또는, MVD_flag가 1인 경우, 조합 머지 후보 또는 제로 움직임 벡터 후보는 머지 후보 리스트에 추가되지 않을 수 있다. 조합 머지 후보는, 머지 후보 리스트에 기-추가된 머지 후보들 간의 평균을 통해 유도될 수 있다.
도 9를 참조하면, 머지 후보 리스트와 머지 인덱스(merge_idx)를 기반으로, 현재 블록의 움직임 정보를 유도할 수 있다(S910).
머지 인덱스는, 머지 후보 리스트에 속한 복수의 머지 후보 중 어느 하나를 특정할 수 있다. 현재 블록의 움직임 정보는, 머지 인덱스에 의해 특정된 머지 후보의 움직임 정보로 설정될 수 있다.MVD_flag의 값에 따라, 현재 블록이 이용 가능한 머지 후보의 최대 개수가 적응적으로 결정될 수 있다. MVD_flag가 0이면, 최대 M개의 머지 후보를 사용하는 한편, MVD_flag가 1이면, M개보다 작은 N개의 머지 후보를 사용할 수 있다.
구체적으로, 머지 인덱스는, MVD_flag에 기초하여 부호화/복호화될 수 있다. 머지 인덱스는 MVD_flag가 제 1값인 경우에 한하여 부호화/복호화될 수 있다. 이때, 머지 인덱스는, 0 또는 1의 값을 가질 수 있다. 즉, 머지 모드에서 움직임 벡터 차이값이 이용되는 경우, 현재 블록의 움직임 정보는 머지 후보 리스트의 첫번째 머지 후보(merge_idx=0) 또는 두번째 머지 후보(merge_idx=1) 중 어느 하나만을 사용하여 유도될 수 있다.
따라서, 머지 후보 리스트에 속한 머지 후보의 최대 개수가 M개인 경우라도, 머지 모드에서 움직임 벡터 차이값이 사용되는 경우에는 현재 블록이 이용 가능한 머지 후보의 최대 개수는 2개일 수 있다. 여기서, M 값은 전술한 머지 후보 리스트의 크기 정보에 기초하여 결정되며, 2보다 큰 값일 수 있다.
다만, 이에 한정되지 아니한다. 예를 들어, 머지 인덱스를 부호화/복호화하지 않고, 대신에 머지 인덱스를 0으로 설정함으로써, 첫번째 머지 후보의 사용이 강제될 수도 있다. 또는, 머지 인덱스는 0 내지 i 사이의 값을 가질 수 있고, i는 2, 3 또는 그 이상의 정수이나 M보다 작을 수 있다.
도 9를 참조하면, 현재 블록의 머지 모드를 위한 움직임 벡터 차이값(MVD)을 유도할 수 있다(S920).
현재 블록의 MVD는 머지 오프셋 벡터(offsetMV)에 기초하여 유도될 수 있다. MVD는 L0 방향의 MVD(MVD0) 또는 L1 방향의 MVD(MVD1) 중 적어도 하나를 포함하며, MVD0와 MVD1 각각은 머지 오프셋 벡터를 이용하여 유도될 수 있다.
머지 오프셋 벡터는, 머지 오프셋 벡터의 길이(mvdDistance)와 방향(mvdDirection)에 기초하여 결정될 수 있다. 예를 들어, 머지 오프셋 벡터(offsetMV)는, 다음 수학식 4와 같이 결정될 수 있다.
[수학식 4]
offsetMV[ x0 ][ y0 ][ 0 ] = ( mvdDistance[ x0 ][ y0 ] << 2 ) * mvdDirection[ x0 ][ y0 ][0]
offsetMV[ x0 ][ y0 ][ 1 ] = ( mvdDistance[ x0 ][ y0 ] << 2 ) * mvdDirection[ x0 ][ y0 ][1]
여기서, mvdDistance는 디스턴스 인덱스(distance_idx) 또는 소정의 플래그(pic_fpel_mmvd_enabled_flag) 중 적어도 하나를 고려하여 결정될 수 있다. 디스턴스 인덱스(distance_idx)는, 움직임 벡터 차이값(MVD)의 길이 또는 거리를 특정하기 위해 부호화된 인덱스를 의미할 수 있다. pic_fpel_mmvd_enabled_flag는, 현재 블록의 머지 모드에서 움직임 벡터가 정수 화소 정밀도를 사용하는지 여부를 지시할 수 있다. 예를 들어, pic_fpel_mmvd_enabled_flag가 제1 값인 경우, 현재 블록의 머지 모드는 정수 화소 정밀도를 사용한다. 즉, 이는 현재 블록의 움직임 벡터 해상도가 정수 펠(integer pel)임을 의미할 수 있다. 반면, pic_fpel_mmvd_enabled_flag가 제2 값인 경우, 현재 블록의 머지 모드는 소수 화소 정밀도를 사용할 수 있다. 다시 말해, pic_fpel_mmvd_enabled_flag가 제2 값인 경우, 현재 블록의 머지 모드는 정수 화소 정밀도를 사용할 수도 있고, 소수 화소 정밀도를 사용할 수도 있다. 또는, pic_fpel_mmvd_enabled_flag가 제2 값인 경우, 현재 블록의 머지 모드는 소수 화소 정밀도만을 사용하도록 제한될 수도 있다. 소수 화소 정밀도의 예로, 1/2 pel, 1/4 pel, 1/8 pel 등이 있을 수 있다.
예를 들어, mvdDistance는 다음 표 1과 같이 결정될 수 있다.
distance_idx[ x0 ][ y0 ] MmvdDistance[ x0 ][ y0 ]
pic_fpel_mmvd_enabled_flag = = 0 pic_fpel_mmvd_enabled_flag = = 1
0 1 4
1 2 8
2 4 16
3 8 32
4 16 64
5 32 128
6 64 256
7 128 512
또한, mvdDirection는, 머지 오프셋 벡터의 방향을 나타내며, 방향 인덱스(direction_idx)에 기초하여 결정될 수 있다. 여기서, 방향은, 좌, 우, 상, 하, 좌상, 좌하, 우상 또는 우하 중 적어도 하나의 방향을 포함할 수 있다. 예를 들어, mvdDirection는 다음 표 2와 같이 결정될 수 있다.
direction_idx[ x0 ][ y0 ] mvdDirection[ x0 ][ y0 ][0] mvdDirection[ x0 ][ y0 ][1]
0 +1 0
1 -1 0
2 0 +1
3 0 -1
표 2에서, mvdDirection[ x0 ][ y0 ][0]는 움직임 벡터 차이값의 x 성분의 부호를 의미하고, mvdDirection[ x0 ][ y0 ][1]는 움직임 벡터 차이값의 y 성분의 부호를 의미할 수 있다. direction_idx가 0인 경우, 움직임 벡터 차이값의 방향은 우 방향으로, direction_idx가 1인 경우, 움직임 벡터 차이값의 방향은 좌 방향으로, direction_idx가 2인 경우, 움직임 벡터 차이값의 방향은 하 방향으로, direction_idx가 3인 경우, 움직임 벡터 차이값의 방향은 상 방향으로 각각 결정될 수 있다.
전술한 디스턴스 인덱스와 방향 인덱스는 MVD_flag가 제1 값인 경우에 한하여 부호화/복호화될 수 있다. 앞서 살펴본 머지 오프셋 벡터 유도 방법은 도 15 내지 도 19를 참조하여 자세히 살펴보도록 한다.
한편, 움직임 벡터 차이값(MVD)는 앞서 결정된 머지 오프셋 벡터와 동일하게 설정될 수 있다. 또는, 머지 오프셋 벡터는, 현재 블록의 참조 픽쳐와 현재 블록이 속한 현재 픽쳐 간의 POC 차이(PocDiff)를 고려하여 보정될 수 있고, 보정된 머지 오프셋 벡터가 움직임 벡터 차이값(MVD)으로 설정될 수도 있다. 이 경우, 현재 블록은 양방향 예측을 부호화/복호화되며, 상기 현재 블록의 참조 픽쳐는 제1 참조 픽쳐(L0 방향의 참조 픽쳐)와 제2 참조 픽쳐(L1 방향의 참조 픽쳐)를 포함할 수 있다. 설명의 편의를 위해, 이하 제1 참조 픽쳐와 현재 픽쳐 간의 POC 차이를 PocDiff0라 하고, 제2 참조 픽쳐와 현재 픽쳐 간의 POC 차이를 PocDiff1라 한다.
PocDiff0와 PocDiff1이 동일한 경우, 현재 블록의 MVD0과 MVD1은 각각 머지 오프셋 벡터로 동일하게 설정될 수 있다.
PocDiff0와 PocDiff1이 동일하지 않은 경우에 있어서, PocDiff0의 절대값이 PocDiff1의 절대값보다 크거나 같은 경우, MVD0는 머지 오프셋 벡터로 동일하게 설정될 수 있다. 한편, MVD1은 기-설정된 MVD0에 기초하여 유도될 수 있다. 예를 들어, 제1 및 제2 참조 픽쳐가 롱텀 참조 픽쳐인 경우, MVD1은 MVD0에 제1 스케일링 팩터를 적용하여 유도될 수 있다. 제1 스케일링 팩터는 PocDiff0와 PocDiff1에 기초하여 결정될 수 있다. 반면, 제1 또는 제2 참조 픽쳐 중 적어도 하나가 숏텀 참조 픽쳐인 경우, MVD1은 MVD0에 제2 스케일링 팩터를 적용하여 유도될 수 있다. 제2 스케일링 팩터는 부호화/복호화 장치에 기-약속된 고정된 값(예를 들어, -1/2, -1 등)일 수 있다. 다만, 제2 스케일링 팩터는, PocDiff0의 부호와 PocDiff1의 부호가 서로 다른 경우에 한하여 적용될 수 있다. 만일, PocDiff0의 부호와 PocDiff1의 부호가 서로 동일한 경우, MVD1은 MVD0와 동일하게 설정되고, 별도의 스케일링이 수행되지 않을 수 있다.
한편, PocDiff0와 PocDiff1이 동일하지 않은 경우에 있어서, PocDiff0의 절대값이 PocDiff1의 절대값보다 작은 경우, MVD1은 머지 오프셋 벡터로 동일하게 설정될 수 있다. 한편, MVD0은 기-설정된 MVD1에 기초하여 유도될 수 있다. 예를 들어, 제1 및 제2 참조 픽쳐가 롱텀 참조 픽쳐인 경우, MVD0은 MVD1에 제1 스케일링 팩터를 적용하여 유도될 수 있다. 제1 스케일링 팩터는 PocDiff0와 PocDiff1에 기초하여 결정될 수 있다. 반면, 제1 또는 제2 참조 픽쳐 중 적어도 하나가 숏텀 참조 픽쳐인 경우, MVD0은 MVD1에 제2 스케일링 팩터를 적용하여 유도될 수 있다. 제2 스케일링 팩터는 부호화/복호화 장치에 기-약속된 고정된 값(예를 들어, -1/2, -1 등)일 수 있다. 다만, 제2 스케일링 팩터는, PocDiff0의 부호와 PocDiff1의 부호가 서로 다른 경우에 한하여 적용될 수 있다. 만일, PocDiff0의 부호와 PocDiff1의 부호가 서로 동일한 경우, MVD0은 MVD1과 동일하게 설정되고, 별도의 스케일링이 수행되지 않을 수 있다.
도 9를 참조하면, 움직임 벡터 차이값(MVD)를 이용하여, 현재 블록의 움직임 벡터를 보정하고(S930), 보정된 움직임 벡터를 기반으로 현재 블록의 움직임 보상을 수행할 수 있다(S940).
도 10 내지 도 14는 본 발명이 적용되는 일실시예로서, 머지 후보로 이용 가능한 이전 블록을 도시한 것이다.
머지 모드에 사용되는 주변 블록은 도 10의 머지 인덱스 0 내지 4 와 같이 현재 코딩 유닛과 인접한 블록 (현재 코딩 유닛의 경계와 맞닿은 블록)일 수도 있고, 도 10의 머지 인덱스 5 내지 26과 같이 인접하지 않은 블록일 수도 있다.
머지 후보가 현재 블록과의 거리가 기-정의된 임계값을 넘어가면 가용(available)하지 않은 것으로 설정할 수 있다.
예를 들어, 기-정의된 임계값을 CTU의 높이(ctu_height) 또는 ctu_height+N으로 설정할 수도 있으며, 이를 머지 후보 가용 임계값이라고 부른다. 즉 머지 후보의 y축 좌표(yi)와 현재 코딩 유닛의 좌상단 샘플(이하, 현재 코딩 유닛 기준 샘플)의 y축 좌표(y0)의 차분(즉, yi - y0)이 머지 후보 가용 임계값 보다 큰 경우에는 머지 후보를 가용(Available)하지 않은 것으로 설정할 수 있다. 여기서 N은 기-정의된 오프셋 값이다. 구체적으로 예를 들어, N을 16으로 설정할 수도 있고, ctu_height으로 설정할 수도 있다.
CTU 경계 (CTU boundary)를 넘어가는 머지 후보가 많은 경우에는 비가용 머지 후보가 많이 발생하여, 부호화 효율이 낮아질 수도 있다. 코딩 유닛의 위쪽에 존재하는 머지 후보(이하, 상측 머지 후보)는 가능한 적게 설정하고, 코딩 유닛의 좌측 및 하단(이하, 좌하단 머지 후보)에 존재하는 머지 후보는 가능한 많게 설정할 수도 있다.
도 11과 같이 현재 코딩 유닛 기준 샘플의 y축 좌표와 상측 머지 후보의 y축 좌표의 차가 코딩 유닛 높이의 2배가 넘지 않도록 설정할 수도 있다.
도 11과 현재 코딩 유닛 기준 샘플의 x축 좌표와 좌하단 머지 후보의 x축 좌표의 차가 코딩 유닛 너비의 2배가 넘지 않도록 설정할 수도 있다.
현재 코딩 유닛과 인접한 머지 후보를 인접 머지 후보라고 부르고, 현재 코딩 유닛과 인접하지 않은 머지 후보를 비인접 머지 후보라고 부른다.
현재 코딩 유닛의 머지 후보가 인접 머지 후보인지 여부를 나타내는 플래그 isAdjacentMergeflag을 시그날링할 수 있다.
isAdjacentMergeflag값이 1이면 현재 코딩 유닛의 움직임 정보는 인접 머지 후보에서 유도될 수 있음을 나타내고, isAdjacentMergeflag값이 0이면 현재 코딩 유닛의 움직임 정보는 비인접 머지 후보에서 유도될 수 있음을 나타내며, 표 3과 같이 시그날링할 수도 있다.
비인접 머지 후보가 머지 후보로 사용된 경우에는 아래 수학식 5와 같이 머지 인덱스에서 인접 머지 후보 개수(NumAdjMerge)를 차분한 값인 비인접 머지 인덱스(NA_merge_idx[x0][y0] 값을 시그날링할 수도 있다.
[수학식 5]
NA_merge_idx[x0][y0] = merge_idx[x0][y0] - NumAdjMerge
coding_unit( x0, y0, cbWidth, cbHeight, treeType ) { Descriptor
if( slice_type != I ) {
pred_mode_flag ae(v)
}
if( CuPredMode[ x0 ][ y0 ] = = MODE_INTRA ) {
if( treeType = = SINGLE_TREE | | treeType = = DUAL_TREE_LUMA ) {
intra_luma_mpm_flag[ x0 ][ y0 ]
if( intra_luma_mpm_flag[ x0 ][ y0 ] )
intra_luma_mpm_idx[ x0 ][ y0 ] ae(v)
else
intra_luma_mpm_remainder[ x0 ][ y0 ] ae(v)
}
if( treeType = = SINGLE_TREE | | treeType = = DUAL_TREE_CHROMA )
intra_chroma_pred_mode[ x0 ][ y0 ] ae(v)
} else {
if (cu_skip_falg[x0][y0]) {
if (MaxNumMergeCand > 1){
isAdjacentMergeflag ae(v)
if (isAdjcanetMergeflag){
merge_idx[x0][y0] ae(v)
} else{
NA_merge_idx[x0][y0] ae(v)
}
}
} else { /* MODE_INTER*/
merge_flag[x0][y0] ae(v)
if (merge_flag[x0][y0]){
if (MaxNumMergeCand > 1){
isAdjacentMergeflag ae(v)
if (isAdjcanetMergeflag){
merge_idx[x0][y0] ae(v)
} else{
NA_merge_idx[x0][y0] ae(v)
}
}
}
if( CuPredMode[ x0 ][ y0 ] != MODE_INTRA )
cu_cbf ae(v)
if( cu_cbf ) {
transform_tree( x0, y0, cbWidth, cbHeight, treeType )
}
현재 블록의 상단 경계보다 큰 y 좌표를 갖는 비인접 머지 후보의 위치는 인접 머지 후보의 x 좌표와 코딩 유닛 기준 샘플과의 거리에 기초하여 결정될 수도 있다.
인접 머지 후보 A와 같은 x 좌표를 갖는 비인접 머지 후보 또는 인접 머지 후보 A의 x 좌표와 거리가 임계값 이내에 있는 비인접 머지 후보를 A의 세로축 동일 선상 머지 후보라고 부른다.
예를 들어, 도 12와과 같이 A의 세로축 동일 선상 머지 후보의 x 좌표는 인접 머지 후보의 x좌표에 오프셋(이하, 비인접 머지 후보 오프셋)을 감산하여 유도할 수 있다. 비인접 머지 후보 오프셋은 고정된 값을 가질 수도 있고, 인접 머지 후보와 비인접 머지 후보 사이의 거리가 멀수록 큰 값을 갖도록 설정할 수도 있다. 오프셋은 현재 블록의 너비보다 작은 값으로 제한될 수 있다.
구체적으로 예를 들어, 도 12와 같이 인접 머지 후보 A의 좌표가 (x0,y0)인 경우에 인접 머지 후보와 가장 가까운 세로축 동일 선상 머지 후보( 이하, 제1 비인접 머지 후보)의 좌표는 (x0- (cu_height/2 -1), y1) 또는 (x0- (cu_width/2 -1), y1)으로 설정할 수 있다.
제1 비인접 머지 후보와 가장 가까운 세로축 동일 선상 머지 후보(이하, 제2 비인접 머지 후보)의 좌표는 (x0-(cu_height -1) , y2) 또는 (x0-(cu_width -1) , y2)로 설정할 수 있다.
비인접 머지 후보가 LCU 경계 밖에 있는 경우에는 도 13과 같이 비인접 머지 후보와 가장 가까우면서 LCU 경계에 인접한 샘플에서 머지 후보를 유도하도록 설정할 수도 있다.
예를 들어, 현재 블록의 상단 경계가 LCU 경계에 접하는 경우, 비인접 머지 후보는 LCU 경계에 접하는 샘플 중 비인접 머지 후보 B와 x 좌표는 동일한 샘플로 대체될 수 있다. 구체적을, 비인접 머지 후보 B (좌표 (x1,y1)) (도 13 좌측 그림에서 머지 인덱스가 6인 머지 후보)는 현재 코딩 유닛과 인접한 샘플 B' (좌표 (x1,y0)) (도 13 좌측 그림에서 머지 인덱스가 6' 인 머지 후보)로 대체 될수 있다.
또 다른 예를 들어, 머지 후보 C (좌표 (x2,y2)) (도 13 우측 그림에서 머지 인덱스가 15인 머지 후보)는 x 좌표는 같고 현재 코딩 유닛과 인접한 샘플 B' (좌표 (x2,y0)) (도 13 좌측 그림에서 머지 인덱스가 15' 인 머지 후보)로 대체 될수 있다.
또 다른 예를 들어, 세로축 동일 선상 머지 후보들이 동일한 x 좌표를 갖는 경우, LCU 경계 밖에 있는 비인접 머지 후보는 LCU 경계에 인접한 샘플 중 비인접 머지 후보의 x축 좌표에 오프셋을 감산한 샘플로 대체될 수 있다. 구체적으로, 도 14와과 같이 LCU 경계 밖에 있는 비인접 머지 후보는 현재 코딩 유닛과 인접한 샘플로 대체 될수 있으며, 대체 샘플의 x축 좌표는 비인접 머지 후보에서 특정 오프셋을 감산하여 유도할 수 있다. 일례로, 비인접 머지 후보 오프셋이 특정 오프셋으로 사용될 수도 있다. LCU 경계 밖에 있는 비인접 머지 후보 별로 비인접 머지 오프셋이 상이하게 설정될 수 있다. 이때, 비인접 머지 오프셋은 LCU 경계 밖에서 비인접 머지 후보의 순서에 따라 결정될 수 있다.
비인접 머지 후보가 이용 불가능한 경우, 비인접 머지 후보를 현재 블록에 인접한 샘플 중 비인접 머지 후보의 x 좌표에 비인접 머지 오프셋을 적용한 샘플로 대체할 수도 있다. 세로축 동일 선상 머지 후보들 중 비가용한 비인접 머지 후보이 개수가 증가할수록 비인접 머지 오프셋의 크기도 증가할 수 있다.
세로축 동일 선상 머지 후보 뿐만 아니라, 가로축 동일 선상 머지 후보에 대해서도 상술한 설명이 적용될 수 있다. 가로축 동일 선상 머지 후보의 경우, 비인접 머지 후보의 y축 좌표에 비인접 머지 오프셋을 적용할 수 있다.
도 15 내지 도 19는 본 발명이 적용되는 일실시예로서, 머지 모드를 위한 머지 오프셋 벡터 유도 방법을 도시한 것이다.
다음 표 4와 같이, 머지 플래그(merge_flag) 또는 스킵 플래그 (cu_skip_flag)값이 1인 경우에 머지 오프셋 벡터 플래그(MVD_flag), 머지 인덱스, 디스턴스 인덱스, 방향 인덱스 중 적어도 하나를 부호화/복호화할 수 있다.
coding_unit( x0, y0, cbWidth, cbHeight, treeType ) { Descriptor
if( slice_type != I ) {
cu_skip_flag[ x0 ][ y0 ] ae(v)
if( cu_skip_flag[ x0 ][ y0 ] = = 0 )
pred_mode_flag ae(v)
}
if( CuPredMode[ x0 ][ y0 ] = = MODE_INTRA ) {
if( treeType = = SINGLE_TREE | | treeType = = DUAL_TREE_LUMA ) {
intra_luma_mpm_flag[ x0 ][ y0 ]
if( intra_luma_mpm_flag[ x0 ][ y0 ] )
intra_luma_mpm_idx[ x0 ][ y0 ] ae(v)
else
intra_luma_mpm_remainder[ x0 ][ y0 ] ae(v)
}
if( treeType = = SINGLE_TREE | | treeType = = DUAL_TREE_CHROMA )
intra_chroma_pred_mode[ x0 ][ y0 ] ae(v)
} else { /* MODE_INTER */
if( cu_skip_flag[ x0 ][ y0 ] ) {
if( merge_affine_flag[ x0 ][ y0 ] = = 0 && MaxNumMergeCand > 1 ) {
merge_idx[ x0 ][ y0 ] ae(v)
merge_offset_vector_flag ae(v)
if (merge_idx < 2 && merge_offset_vector_flag) {
distance_idx[ x0 ][ y0 ] ae(v)
direction_idx[ x0 ][ y0 ] ae(v)
}
}
} else {
merge_flag[ x0 ][ y0 ] ae(v)
if( merge_flag[ x0 ][ y0 ] ) {
if( merge_affine_flag[ x0 ][ y0 ] = = 0 && MaxNumMergeCand > 1 ) {
merge_idx[ x0 ][ y0 ] ae(v)
merge_offset_vector_flag ae(v)
if (merge_idx < 2 && merge_offset_vector_flag) {
distance_idx[ x0 ][ y0 ] ae(v)
direction_idx[ x0 ][ y0 ] ae(v)
}
}
} else {
if( slice_type = = B )
inter_pred_idc[ x0 ][ y0 ] ae(v)
if( sps_affine_enabled_flag && cbWidth >= 16 && cbHeight >= 16 ) {
inter_affine_flag[ x0 ][ y0 ] ae(v)
if( sps_affine_type_flag && inter_affine_flag[ x0 ][ y0 ] )
cu_affine_type_flag[ x0 ][ y0 ] ae(v)
}
}
디스턴스 인덱스 및 방향 인덱스로부터 머지 오프셋 벡터 offsetMV을 유도할 수 있다.
도 15와 같이 머지 후보에서 유도한 움직임 상하 및 좌우 주변을 탐색하여 최적의 머지 오프셋 벡터 값을 유도할 수 있다. 머지 오프셋 벡터의 x축 벡터 및 y축 벡터는 각각 기준이 되는 머지 움직임 벡터로부터 최대 32 integer sample보다 작도록 설정할 수 있다.
머지 인덱스의 값이 기준값보다 작은 경우에 한하여, 머지 오프셋 벡터 플래그가 시그날링될 수도 있다. 또는, 머지 인덱스가 가리키는 머지 후보가 양방향 또는 단방향인 경우에 한하여, 머지 오프셋 벡터 플래그가 시그날링될 수도 있다.
참조 픽쳐 L0의 POC (Picture order count의 약자로 픽쳐의 아웃풋 순서를 나타내는 지시자)에서 현재 픽쳐의 POC를 뺀 값을 참조 픽쳐 L0 차분(PocDiff0)이라고 부르고, 참조 픽쳐 L1의 POC 에서 현재 픽쳐의 POC를 뺀 값을 참조 픽쳐 L1 차분(PocDiff1)이라고 부른다.
offsetMV는 참조 픽쳐 L0 차분과 참조 픽쳐 L1 차분의 sign 부호가 다르면, 다음 수학식 6과 같이 디스턴스 인덱스로부터 유도한 변수 DistFromMergeMV에 방향 인덱스에서 유도한 값을 곱하여 생성할 수 있다.
[수학식 6]
offsetMVL0[0] = (DistFromMergeMV << 2 ) * sign[x0][y0][0]
offsetMVL0[1] = (DistFromMergeMV << 2 ) * sign[x0][y0][1]
offsetMVL1[0] = (DistFromMergeMV << 2 ) * sign[x0][y0][0]
offsetMVL1[1] = (DistFromMergeMV << 2 ) * sign[x0][y0][1]
offsetMV는 참조 픽쳐 L0 차분과 참조 픽쳐 L1 차분의 sign 부호가 같으면, 다음 수학식 7과 같이 디스턴스 인덱스로부터 유도한 변수 DistFromMergeMV에 방향 인덱스에서 유도한 값을 곱하여 생성할 수 있다.
[수학식 7]
offsetMVL0[0] = (DistFromMergeMV << 2 ) * sign[x0][y0][0]
offsetMVL0[1] = (DistFromMergeMV << 2 ) * sign[x0][y0][1]
offsetMVL1[0] = -1 * (DistFromMergeMV << 2 ) * sign[x0][y0][0]
offsetMVL1[1] = -1 * (DistFromMergeMV << 2 ) * sign[x0][y0][1]
DistFromMergeMV는 다음 표 5와 같이 유도될 수 있다.
distance_idx[ x ][ y ] binarization DistFromMergeMV[ x0 ][ y0 ]
0 0 1
1 10 2
2 110 4
3 1110 8
4 11110 16
5 111110 32
6 1111110 64
7 1111111 128
표 5에 도시된 것보다 더 적은/더 많은 DistFromMergeMV 값을 사용할 수도 있다.
현재 블록 또는 머지 후보의 움직임 벡터 정밀도에 따라, DistFromMergeMV의 범위를 상이하게 결정할 수 있다. 예컨대, 현재 블록 또는 머지 후보의 움직임 벡터 정밀도가 quarter-pel인 경우, {1, 2, 4, 8, 16}의 범위 내에서 DistFromMergeMV를 선택하는 한편, 현재 블록 또는 머지 후보의 움직임 벡터 정밀도가 integer-pel인 경우, {4, 8, 16, 32, 64}의 범위 내에서 DistFromMergeMV를 선택할 수 있다.
다음 표 6은 방향 인덱스 값에 따라 정의된 x축 오프셋을 나타내는 변수 sign[x][y][0] 및 y축 오프셋을 나타내는 변수 sign[x][y][1]를 나타낸다.
direction_idx[ x ][ y ] binarization sign[x][y][0] sign[x][y][1]
0 00 +1 0
1 01 -1 0
2 10 0 +1
3 11 0 -1
머지 오프셋 벡터의 x축 벡터 및 y축 벡터는 각각 기준이 되는 머지 움직임 벡터로 부터 최대 2 integer sample 보다 작도록 설정할 수 있으며, distance_idx는 총 4개의 인덱스를 갖도록 설정할 수 있다.
또는 픽쳐 헤더 또는 슬라이스 헤더 등에 머지 오프셋 벡터의 탐색 범위를 나타내는 신택스 머지 오프셋 벡터 범위 플래그 merge_offset_range_flag를 시그날링 할수도 있다. 일 예로, merge_offset_extend_range_flag 값이 1이면, a머지 오프셋 벡터의 x축 벡터 및 y축 벡터는 각각 기준이 되는 머지 움직임 벡터로부터 최대 32 integer sample보다 작도록 설정할 수 있으며, merge_offset_extend_range_flag 값이 0이면, 머지 오프셋 벡터의 x축 벡터 및 y축 벡터는 각각 기준이 되는 머지 움직임 벡터로 부터 최대 2 integer sample보다 작도록 설정할 수 있다.
distance_idx[ x ][ y ] binarization DistFromMergeMV[ x0 ][ y0 ]
0 0 1
1 10 2
2 110 4
3 111 8
도 16과 같이 머지 후보에서 유도한 움직임 상하 및 좌우 및 대각 방향 주변을 탐색하여 최적의 머지 오프셋 벡터 값을 유도할 수 있으며, direction_idx는 표 8과 같이 총 8개의 인덱스를 갖도록 설정할 수도 있다.
머지 오프셋 벡터 탐색 범위가 도 16의 왼쪽 그림과 같은 경우에는 표 8을 사용하여 x축 오프셋을 나타내는 변수 sign[x][y][0] 및 y축 오프셋을 나타내는 변수 sign[x][y][1]를 나타낼 수 있고, 머지 오프셋 벡터 탐색 범위가 도 16의 오른쪽 그림과 같은 경우에는 표 8을 사용하여 x축 오프셋을 나타내는 변수 sign[x][y][0] 및 y축 오프셋을 나타내는 변수 sign[x][y][1]를 나타낼 수 있다.
direction_idx[ x ][ y ] binarization sign[x][y][0] sign[x][y][1]
0 000 +1 0
1 001 -1 0
2 010 0 +1
3 011 0 -1
4 100 +1 +1
5 101 +1 -1
6 110 -1 +1
7 111 -1 -1
direction_idx[ x ][ y ] binarization sign[x][y][0] sign[x][y][1]
0 000 +1 0
1 001 -1 0
2 010 0 +1
3 011 0 -1
4 100 +1/2 +1/2
5 101 +1/2 -1/2
6 110 -1/2 +1/2
7 111 -1/2 -1/2
또는 선택된 머지 후보가 양방향 움직임 벡터를 갖는지 여부에 따라 서로 다른 탐색 범위와 탐색 패턴을 가질 수도 있다. 예를 들어, 선택된 머지 후보가 단방향 움직임 벡터(L0 움직임 벡터 또는 L1 움직임 벡터 중 어느 하나)를 가지고 있는 경우에는 도 17의 좌측 그림과 같이 다이아몬드 형태 탐색 패턴을 갖도록 설정할 수 있고, 선택된 머지 후보과 양방향 움직임 벡터(L0 움직임 벡터 및 L1 움직임 벡터)를 가지고 있는 경우에는 도 17의 우측 그림과 같이 사각 형태 탐색 패턴을 갖도록 설정할 수 있다.
디스턴스 인덱스 값에 따라 서로 다른 탐색 범위와 탐색 패턴을 가질 수도 있다. 예를 들어, 디스턴스 인덱스 값이 문턱값 보다 작은 경우에는 다이아몬드 형태 탐색 패턴을 갖도록 설정할 수 있고, 디스턴스 인덱스 값이 문턱값 보다 크거나 같은 경우에는 사각 형태 패턴을 갖도록 설정할 수 있다.
현재 블록 또는 머지 후보의 움직임 벡터 정밀도에 따라 서로 다른 탐색 범위와 탐색 패턴을 가질 수도 있다. 예를 들어, 움직임 벡터 정밀도가 Integer-pel 보다 작거나 같은 경우(1/4 pel, 1/2 pel 등)에는 다이아몬드 형태 탐색 패턴을 갖도록 설정할 수 있고, 움직임 벡터 정밀도가 Integer pel 보다 큰 경우에는 사각 형태 패턴을 갖도록 설정할 수도 있다.
DistFromMergeMV의 값에 따라, 탐색 방향의 범위를 상이하게 구성할 수 있다. 일 예로, DistFromMergeMV의 값이 문턱값 이하인 경우, 표 8 또는 표 9의 예와 같이 8 방향을 탐색하는 한편, DistFromMergeMV의 값이 문턱값보다 큰 경우, 표 6의 예와 같이 4 방향을 탐색할 수 있다.
MVx와 MVy의 차분값에 따라, 탐색 방향의 범위를 상이하게 구성할 수도 있다. 일 예로, MVx와 MVy의 차분값이 문턱값 이하인 경우, 표 8 또는 표 9의 예와 같이 8 방향을 탐색하는 한편, MVx와 MVy의 차분값이 문턱값보다 큰 경우, 표 6의 예와 같이 4 방향을 탐색할 수 있다.
다음 수학식 8과 같이 머지 인덱스로 부터 유도한 움직임 벡터 mergeMV에 offsetMV를 더하여 최종 움직임 벡터를 유도할 수 있다.
[수학식 8]
mvL0[0] = mergeMVL0[0]+ offsetMVL0[0]
mvL0[1] = mergeMVL0[0] + offsetMVL0[0]
mvL10[0] = mergeMVL1[0] + offsetMVL1[0]
mvL1[1] = mergeMVL1[0] + offsetMVL1[0]
제1 디스턴스 플래그(이하, distance_1st_flag), 제2 디스턴스 인덱스 (이하, distance_2nd_idx) 및 방향 인덱스로부터 머지 오프셋 벡터 offsetMV 을 유도할 수 있다. 제1 디스턴스 인덱스와 제2 디스턴스 인덱스를 이용하여 수학식 9와 같이 DistFromMergeMV를 유도할 수 있다.
[수학식 9]
DistFromMergeMV = 16*distance_1st_flag + (1 << distance_2nd_idx)
수학식 9에서 distance_1st_flag은 0 또는 1 값을 가질 수 있고, distance_2nd_idx는 0 내지 3의 값을 가질 수 있으며, DistFromMergeMV는 1 내지 128 사이의 값일 수 있다. 구체적으로 예를 들어, DistFromMergeMV는 {1, 2, 4, 8, 16, 32, 64, 128} 중 적어도 어느 하나의 값일 수도 있다.
다음 표 10과 같은 신택스 테이블을 사용하여, 제1 디스턴스 플래그(이하, distance_1st_flag), 제2 디스턴스 인덱스 (이하, distance_2nd_idx) 및 방향 인덱스를 시그날링할 수 있다.
coding_unit( x0, y0, cbWidth, cbHeight, treeType ) { Descriptor
if( slice_type != I ) {
cu_skip_flag[ x0 ][ y0 ] ae(v)
if( cu_skip_flag[ x0 ][ y0 ] = = 0 )
pred_mode_flag ae(v)
}
if( CuPredMode[ x0 ][ y0 ] = = MODE_INTRA ) {
if( treeType = = SINGLE_TREE | | treeType = = DUAL_TREE_LUMA ) {
intra_luma_mpm_flag[ x0 ][ y0 ]
if( intra_luma_mpm_flag[ x0 ][ y0 ] )
intra_luma_mpm_idx[ x0 ][ y0 ] ae(v)
else
intra_luma_mpm_remainder[ x0 ][ y0 ] ae(v)
}
if( treeType = = SINGLE_TREE | | treeType = = DUAL_TREE_CHROMA )
intra_chroma_pred_mode[ x0 ][ y0 ] ae(v)
} else { /* MODE_INTER */
if( cu_skip_flag[ x0 ][ y0 ] ) {
if( merge_affine_flag[ x0 ][ y0 ] = = 0 && MaxNumMergeCand > 1 ) {
merge_idx[ x0 ][ y0 ] ae(v)
merge_offset_vector_flag ae(v)
if (merge_idx < 2 && merge_offset_vector_flag) {
distance_1st_idx[ x0 ][ y0 ] ae(v)
distance_2nd_idx[ x0 ][ y0 ]
direction_idx[ x0 ][ y0 ] ae(v)
}
}
} else {
merge_flag[ x0 ][ y0 ] ae(v)
if( merge_flag[ x0 ][ y0 ] ) {
if( merge_affine_flag[ x0 ][ y0 ] = = 0 && MaxNumMergeCand > 1 ) {
merge_idx[ x0 ][ y0 ] ae(v)
merge_offset_vector_flag ae(v)
if (merge_idx < 2 && merge_offset_vector_flag) {
distance_1st_idx[ x0 ][ y0 ] ae(v)
distance_2nd_idx[ x0 ][ y0 ] ae(v)
direction_idx[ x0 ][ y0 ] ae(v)
}
}
} else {
if( slice_type = = B )
inter_pred_idc[ x0 ][ y0 ] ae(v)
if( sps_affine_enabled_flag && cbWidth >= 16 && cbHeight >= 16 ) {
inter_affine_flag[ x0 ][ y0 ] ae(v)
if( sps_affine_type_flag && inter_affine_flag[ x0 ][ y0 ] )
cu_affine_type_flag[ x0 ][ y0 ] ae(v)
}
}
서브 블록 머지 후보 (sub-block merge candidates)가 사용된 경우에는 모든 서브 블록에 같은 머지 오프셋 벡터를 사용할 수도 있다.
서브 블록 단위 머지 후보는 다음 프로세스와 같이 유도할 수 있다.
1. 현재 블록의 주변 머지 후보 블록의 움직임 벡터로 부터 초기 쉬프트 벡터 (shVector)를 유도할 수 있다.
2. 수학식 10과 같이 코딩 유닛 내 서브 블록의 좌상단 샘플 (xSb,ySb)에 초기 쉬프트 벡터를 가산하여 좌상단 샘플의 위치가 (xColSb, yColSb)인 쉬프트 서브 블록을 유도할 수 있다.
[수학식 10]
(xColSb, yColSb) = (xSb + shVector[0]>> 4,ySb+shVector[1]>> 4)
3. (xColSb, yColSb)를 포함하고 있는 서브 블록의 센터 포지션과 대응되는 collocated block의 움직임 벡터를 좌상단 샘플 (xSb,ySb)를 포함하고 있는 서브 블록의 움직임 벡터로 유도할 수 있다.
코딩 유닛의 서브 블록 단위로 서로 다른 머지 오프셋 벡터를 유도할 수도 있으며, 이를 서브 블록 단위 머지 오프셋 벡터 부호화 방법이라고 부른다.
일 예로, 도 18과 같이 코딩 유닛을 MxM 단위의 서브 블록으로 분할하고, 서브 블록 단위로 서로 다른 머지 오프셋 벡터를 사용할 수도 있다. 이전 서브 블록과 디스턴스 인덱스와 방향 인덱스가 모두 같지 않도록 설정할 수 있다.
또는, 모든 서브 블록에 동일한 DistFromMergeMV을 적용하되, Direction은 개별적으로 결정할 수 있다. 반대로, 모든 서브 블록에 동일한 Direction을 적용하되, DistFromMergeMV는 개별적으로 결정할 수 있다.
또는, 서브 블록 중 일부 서브 블록에만 머지 오프셋 벡터를 적용할 수 있다. 일 예로, 현재 블록이 2개의 서브 블록으로 분할된 경우, 제1 서브 블록의 움직임 정보는 머지 인덱스가 가리키는 머지 후보의 움직임 정보와 동일하게 설정하고, 제2 서브 블록의 움직임 정보는 제1 서브 블록의 움직임 정보에 머지 오프셋 벡터를 적용하여 유도할 수 있다. 구체적으로 예를 들어, 제1 서브 블록은 좌삼각 예측 유닛, 제2 서브 블록은 우삼각 예측 유닛일 수도 있다. 좌삼각 예측 유닛은 다음과 같이 할 수 있다.
도 19의 좌측 그림을 좌삼각 파티셔닝이라고 부르고, 오른쪽 그림을 우삼각 파티셔닝이라고 부른다. 코딩 유닛의 좌상단 또는 좌하단 샘플이 속한 예측 유닛을 좌삼각 예측 유닛(이라고 부르고, 코딩 유닛의 우상단 또는 우하단 샘플이 속한 예측 유닛을 우삼각 예측 유닛이라고 부르며, 우삼각 예측 유닛 또는 좌삼각 예측 유닛을 통칭하여 삼각 예측 유닛이라고 부른다.
도 20 내지 도 24는 본 발명이 적용되는 일실시예로서, 인트라 예측 방법을 도시한 것이다.
인트라 예측은 도 20과 같이 현재 블록 주변에 있는 이미 부호화된 경계 샘플을 인트라 예측을 생성하는데 사용하며, 이를 인트라 레퍼런스 샘플이라고 부른다.
인트라 레퍼런스 샘플의 평균값을 예측 블록 전체 샘플의 값을 설정하거나 (DC 모드), 수평 방향 레퍼런스 가중 예측을 수행하여 생성한 수평 방향 예측 샘플과 수직 방향 레퍼런스 샘플을 가중 예측하여 생성한 수직 방향 예측 샘플을 생성한 후, 수평 방향 예측 샘플과 수직 방향 예측 샘플을 가중 예측하여 예측 샘플을 생성하거나(Planar 모드), 방향성 인트라 예측 모드등을 이용하여 인트라 예측을 수행할 수있다.
도 21의 왼쪽 그림과 같이 33개의 방향을 사용(총 35개 인트라 예측 모드)하여 인트라 예측을 수행할 수 있고, 오른쪽 그림과 같이 65개의 방향을 사용(총 67개 인트라 예측 모드)할 수도 있다. 방향성 인트라 예측을 사용하는 경우에는 인트라 예측 모드의 방향성을 고려하여 인트라 레퍼런스 샘플(레퍼런스 참조 샘플)을 생성하고, 이로 부터 인트라 예측을 수행할 수 있다.
코딩 유닛의 좌측에 있는 인트라 레퍼런스 샘플을 좌측 인트라 레퍼런스 샘플이라하고, 코딩 유닛의 상측에 있는 인트라 레퍼런스 샘플을 상측 인트라 레퍼런스 샘플이라 한다.
방향성 인트라 예측을 수행하는 경우에는 표 11과 같이 인트라 예측 모드에 따라 예측 방향(또는 예측 각도)을 나타내는 파라미터인 인트라 방향 파라미터 (intraPredAng)를 설정할 수 있다. 아래 표 11은 35개 인트라 예측 모드를 사용할 때 2 내지 34의 값을 가지는 방향성 인트라 예측 모드를 기반으로 하는 일예에 불과하다. 방향성 인트라 예측 모드의 예측 방향(또는 예측 각도)은 더 세분화되어 33개보다 많은 개수의 방향성 인트라 예측 모드가 이용될 수 있음은 물론이다.
PredModeIntra 1 2 3 4 5 6 7
IntraPredAng - 32 26 21 17 13 9
PredModeIntra 8 9 10 11 12 13 14
IntraPredAng 5 2 0 -2 -5 -9 -13
PredModeIntra 15 16 17 18 19 20 21
IntraPredAng -17 -21 -26 -32 -26 -21 -17
PredModeIntra 22 23 24 25 26 27 28
IntraPredAng -13 -9 -5 -2 0 2 5
PredModeIntra 29 30 31 32 33 34
IntraPredAng 9 13 17 21 26 32
intraPredAng이 음수인 경우 (예를 들어, 인트라 예측 모드 인덱스가 11과 25 사이인 경우)에는 도 22와 같이 현재 블록에 좌측 인트라 레퍼런스 샘플과 상측 인트라 레퍼런스 샘플을 인트라 예측 모드의 각도에 따라 1D로 구성된 일차원 레퍼런스 샘플 (Ref_1D)로 재구성할 수 있다.
인트라 예측 모드 인덱스가 11과 18 사이인 경우에는 도 23과 같이 현재 블록의 상변 우측에 위치한 인트라 레퍼런스 샘플부터 좌변 하단에 위치한 인트라 레퍼런스 샘플까지 반 시계 방향으로 일차원 레퍼런스 샘플을 생성할 수 있다.
그 외의 모드에서는 상변 인트라 레퍼런스 샘플 또는 좌변 인트라 레퍼런스 샘플만 이용하여 일차원 레퍼런스 샘플을 생성할 수 있다.
인트라 예측 모드 인덱스가 19 와 25 사이인 경우에는 도 24와 같이 현재 블록의 좌변 하단에 위치한 인트라 레퍼런스 샘플부터 상변 우측에 위치한 인트라 레퍼런스 샘플까지 시계 방향으로 일차원 레퍼런스 샘플을 생성할 수 있다.
참조 샘플 결정 인덱스 iIdx와 iIdx에 기초하여 결정되는 적어도 하나의 참조 샘플에 적용되는 가중치 관련 파라미터 ifact를 다음 수학식 11과 같이 유도할 수 있다. iIdx와 ifact는 방향성 인트라 예측 모드의 기울기에 따라 가변적으로 결정되며, iIdx에 의해 특정되는 참조 샘플은 정수 펠(integer pel)에 해당할 수 있다.
[수학식 11]
iIdx = (y+1) * Pang /32
ifact = [ (y+1) * Pang] & 31
예측 샘플 별로 적어도 하나 이상의 일차원 레퍼런스 샘플을 특정하여 예측 영상을 유도 할 수도 있다. 예를 들어, 방향성 인트라 예측 모드의 기울기 값을 고려하여 예측 샘플 생성에 사용할 수 있는 일차원 레퍼런스 샘플의 위치를 특정할 수 있다. 예측 샘플 별로 상이한 방향성 인트라 예측 모드를 가질 수도 있다. 하나의 예측 블록에 대해 복수의 인트라 예측 모드가 이용될 수도 있다. 복수의 인트라 예측 모드는 복수의 비방향성 인트라 예측 모드의 조합으로 표현될 수도 있고, 하나의 비방향성 인트라 예측 모드와 적어도 하나의 방향성 인트라 예측 모드의 조합으로 표현될 수도 있고, 또는 복수의 방향성 인트라 예측 모드의 조합으로 표현될 수도 있다. 하나의 예측 블록 내의 소정의 샘플 그룹 별로 상이한 인트라 예측 모드가 적용될 수 있다. 소정의 샘플 그룹은 적어도 하나의 샘플로 구성될 수 있다. 샘플 그룹의 개수는 현재 예측 블록의 크기/샘플 개수에 따라 가변적으로 결정될 수도 있고, 예측 블록의 크기/샘플 개수와는 독립적으로 부호화기/복호화기에 기-설정된 고정된 개수일 수도 있다.
구체적으로 예를 들어, 참조 샘플 결정 인덱스 iIdx를 이용하여 일차원 레퍼런스 샘플의 위치를 특정할 수 있다.
인트라 예측 모드의 기울기에 따라 하나의 일차원 레퍼런스 샘플만으로는 인트라 예측 모드의 기울기를 표현할 수 없을 때는 수학식 12와 같이 인접한 일차원 레퍼런스 샘플을 보간하여 제1 예측 영상을 생성할 수 있다. 인트라 예측 모드의 기울기/각도에 따른 angular line이 정수 펠에 위치한 레퍼런스 샘플을 지나가지 않는 경우, 해당 angular line에 좌/우 또는 상/하에 인접한 레퍼런스 샘플을 보간하여 제1 예측 영상을 생성할 수 있다. 이때 이용되는 보간 필터의 필터 계수는 ifact에 기초하여 결정될 수 있다. 예를 들어, 보간 필터의 필터 계수는 angular line 상에 위치한 소수 펠과 상기 정수 펠에 위치한 레퍼런스 샘플 간의 거리에 기초하여 유도될 수 있다.
[수학식 12]
P(x,y)=((32-ifact)/32)* Ref_1D(x+iIdx+1) + (ifact/32)* Ref_1D(x+iIdx+2)
하나의 일차원 레퍼런스 샘플만으로 인트라 예측 모드의 기울기를 표현할 수 있을 때 (ifact 값이 0 일때) 는 다음 수학식 13과 같이 제1 예측 영상을 생성할 수 있다.
[수학식 13]
P(x,y) = Ref_1D(x+iIdx+1)
도 25 내지 도 28은 본 발명이 적용되는 일실시예로서, 와이드 앵글 기반의 인트라 예측 방법을 도시한 것이다.
방향성 인트라 예측 모드의 예측 각도는 도 25와 같이 45 내지 -135도 사이로 설정될 수 있다.
비정방 형태 코딩 유닛에서 인트라 예측 모드를 수행하는 경우 기 정의된 예측 각도 때문에 현재 샘플과 가까운 인트라 레퍼런스 샘플 대신 현재 샘플과 거리가 먼 인트라 레퍼런스 샘플에서 현재 샘플을 예측하는 단점이 발생할 수 있다.
예를 들어, 도 26의 왼쪽 그림과 같이 코딩 유닛의 너비가 코딩 유닛의 높이보다 큰 코딩 유닛(이하, 수평 방향 코딩 유닛)에서는 거리가 가까운 샘플 T 대신에 거리가 먼 L에서 인트라 예측을 수행할 수 있다. 또 다른 예를 들어, 도 26의 오른쪽 그림과 같이 코딩 유닛의 높이가 코딩 유닛의 너비보다 큰 코딩 유닛(이하, 수직 방향 코딩 유닛)에서는 거리가 가까운 샘플 L 대신에 거리가 먼 샘플 T로 부터 인트라 예측을 수행할 수 있다.
비정방 형태 코딩 유닛에서는 기-정의된 예측 각도보다 더 넓은 예측 각도에서 인트라 예측을 수행할 수도 있으며, 이를 와이드 앵글 인트라 예측 모드라고 부른다.
와이드 앵글 인트라 예측 모드는 45-α 내지 -135-β 의 예측 각도를 가질 수 있으며, 기존 인트라 예측 모드에서 사용된 각도를 벗어나는 예측 각도를 와이드 앵글 각도라고 부른다.
도 26의 좌측 그림에서 수평 방향 코딩 유닛에 있는 샘플 A는 와이드 앵글 인트라 예측 모드를 사용하여 인트라 레퍼런스 샘플 T로 부터 예측할 수 있다.
도 26의 우측 그림에서 수직 방향 코딩 유닛에 있는 샘플 A는 와이드 앵글 인트라 예측 모드를 사용하여 인트라 레퍼런스 샘플 L로 부터 예측할 수 있다.
와이드 앵글 인트라 예측 모드는 기존 인트라 예측 모드 N개에 20개의 와이드 앵글 각도를 더해 N+20 개의 인트라 예측 모드를 사용할 수도 있다. 구체적으로 예를 들어, 67개 인트라 모드를 사용하는 경우에는 표 12와 같이 와이드 앵글 각도를 더해 총 87개 인트라 예측 모드를 사용할 수 있다.
predModeIntra -10 -9 -8 -7 -6 -5 -4 -3 -2 -1 2 3 4 5 6 7 8
intraPredAngle 114 93 79 68 60 54 49 45 39 35 32 29 26 23 21 19 17
predModeIntra 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
intraPredAngle 15 13 11 9 7 5 3 2 1 0 -1 -2 -3 -5 -7 -9 -11
predModeIntra 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
intraPredAngle -13 -25 -17 -19 -21 -23 -26 -29 -32 -29 -26 -23 -21 -19 -17 -15 -13
predModeIntra 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
intraPredAngle -11 -9 -7 -5 -3 -2 -1 0 1 2 3 5 7 9 11 13 15
predModeIntra 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
intraPredAngle 17 19 21 23 26 29 32 35 39 45 49 54 60 68 79 93 114
와이드 앵글 인트라 예측 모드를 사용하는 경우 도 27과 같이 상측 인트라 레퍼런스 샘플의 길이를 2W+1로 설정하고, 좌측 인트라 레퍼런스 샘플의 길이를 2H+1로 설정할 수 있다.
와이드 앵글 인트라 예측을 사용하는 경우에 와이드 앵글 인트라 예측 모드의 인트라 예측 모드를 부호화 하는 경우에는 인트라 예측 모드의 개수가 많아져서 부호화 효율이 낮아 질수 있다. 와이드 앵글 인트라 예측 모드는 와이드 앵글 인트라에서 사용되지 않는 기존 인트라 예측 모드로 대체하여 부호화 할 수 있으며, 대체되는 예측 모드를 와이드 앵글 대체 모드라고 한다.
구체적으로 예를 들어, 도 28과 같이 35개 인트라 예측을 사용하는 경우 와이드 앵글 인트라 예측 모드 35는 와이드 앵글 대체 모드인 인트라 예측 모드 2로 부호화할 수 있고, 와이드 앵글 인트라 예측 모드 36은 와이드 앵글 대체 모드인 인트라 예측 모드 3으로 부호화 할 수 있다.
코딩 블록의 형태 또는 코딩 블록 높이대 너비의 비에 따라 대체하는 모드와 개수를 다르게 설정할 수 있다. 구체적으로 예를 들어, 표 13과 같이 코딩 블록의 형태에 따라 대체하는 모드와 개수를 다르게 설정할 수 있다. 표 13은 코딩 블록의 너비와 높이의 비에 따라 사용되는 인트라 예측 대체 모드를 나타낸다.
Aspect ratio Replaced intra prediction modes
W / H == 16 Modes 12, 13,14,15
W / H == 8 Modes 12, 13
W / H == 4 Modes 2,3,4,5,6,7,8,9,10,11
W / H == 2 Modes 2,3,4,5,6,7,
W / H == 1 None
W / H == 1/2 Modes 61,62,63,64,65,66
W / H == 1/4 Mode 57,58,59,60,61,62,63,64,65,66
W / H == 1/8 Modes 55, 56
W / H == 1/16 Modes 53, 54, 55, 56
전술한 인터 예측 또는 인트라 예측을 통해 예측 영상이 생성되고, 원본 영상에서 예측 영상을 차분한 영상 즉, 잔차 영상(residual)을 획득할 수 있다.
잔차 영상에 DCT(Discrete cosine transform)와 같은 2차원 변환(Transform)을 통하여 2원 주파수 성분으로 분해할 수 있다. 영상에서 고주파 성분을 제거해도 시각적으로 왜곡이 크게 발생하지 않는 특성이 있다. 고주파에 해당하는 값을 작게 하거나 0으로 설정하면 시각적 왜곡이 크지 않으면서도 압축 효율을 크게 할 수 있다.
예측 블록의 크기나 예측 모드에 따라 DST (Discrete sine transform)을 사용할 수도 있다. 구체적으로 예를 들어, 인트라 예측 모드이고, 예측 블록/코딩 블록의 크기가 NxN 보다 작은 크기인 경우에는 DST 변환을 사용하도록 설정하고, 그 외의 예측 블록/코딩 블록에서는 DCT를 사용하도록 설정할 수도 있다.
DCT는 영상을 cos 변환을 이용하여 2차원 주파수 성분으로 분해(변환)하는 처리이고, 그 때의 주파수 성분들은 기저 영상으로 표현된다. 예를 들어, NxN 블록에서 DCT 변환을 수행하면 N2 개의 기본 패턴 성분을 얻을 수 있다. DCT 변환을 수행한다는 것은 원화소 블록에 포함된 기본 패턴 성분들 각각의 크기를 구하는 것이다. 각 기본 패턴 성분들의 크기는 DCT 계수라고 부른다.
대체적으로 저주파에 0이 아닌 성분들이 많이 분포하는 영상에서는 이산 여현 변환(Discrete Cosine Transform, DCT)을 주로 사용하고, 고주파 성분이 많이 분포하는 영상에서는 DST (Discrete Sine Transform)을 사용할 수도 있다.
DST는 영상을 sin 변환을 이용하여 2차원 주파수 성분으로 분해(변환)하는 처리를 나타낸다. DCT 또는 DST 변환 이외의 변환 방법을 사용하여 2차원 영상을 2차원 주파수 성분으로 분해(변환)할 수 있으며, 이를 2차원 영상 변환이라고 부른다.
잔차 영상 중 특정 블록에서는 2차원 영상 변환을 수행하지 않을 수 있으며, 이를 변환 스킵(transform skip)이라고 부른다. 변환 스킵 이후에 양자화를 적용할 수 있다.
2차원 영상 내에 있는 임의의 블록을 DCT 또는 DST 또는 2차원 영상 변환을 적용할 수 있으며, 이 때 사용된 변환을 제1 변환이라고 부른다. 제1 변환을 수행 후 변환 블록의 일부 영역에서 변환을 다시 수행할 수 있으며, 이를 제2 변환이라고 부른다.
제1 변환은 복수개의 변환 코어 중 하나를 사용할 수 있다. 구체적으로 예를 들어, 변환 블록에서 DCT2 , DCT8 또는 DST7 중 어느 하나를 선택하여 사용할 수 있다. 또는 변환 블록의 수평 방향 변환과 수직 방향 변환에서 서로 다른 변환 코어를 사용할 수도 있다.
제1 변환과 제2 변환을 수행하는 블록 단위가 서로 다르게 설정할 수도 있다. 구체적으로 예를 들어, 잔차 영상의 8x8 블록에서 제1 변환을 수행한 후, 4x4 서브 블록 별로 제2 변환을 각각 수행할 수도 있다. 또 다른 예를 들어, 각 4x4 블록에서 제1 변환을 수행한 후, 8x8 크기의 블록에서 제2 변환을 각각 수행할 수도 있다.
제1 변환이 적용된 잔차 영상을 제1 변환 잔차 영상이라고 부른다.
제1 변환 잔차 영상에 DCT 또는 DST 또는 2차원 영상 변환을 적용할 수 있으며, 이 때 사용된 변환을 제2 변환이라고 부른다. 제2 변환이 적용된 2차원 영상을 제2 변환 잔차 영상이라고 부른다.
제1 변환 및/또는 제2 변환을 수행한 후의 블록 내 샘플 값을 변환 계수라고 부른다. 양자화는 블록의 에너지를 줄이기 위해 변환 계수를 기 정의된 값으로 나누는 과정을 말한다. 변환 계수에 양자화를 적용하기 위해 정의된 값을 양자화 파라미터라고 부른다.
시퀀스 단위 또는 블록 단위로 기 정의된 양자화 파라미터를 적용할 수 있다. 통상적으로 1에서 51 사이의 값으로 양자화 파라미터를 정의할 수 있다.
변환 및 양자화를 수행한 후에, 역양자화 및 역변환을 수행하여 잔차 복원 영상을 생성 할 수 있다. 잔차 복원 영상에 예측 영상을 더해서 제1 복원 영상을 생성할 수 있다.
부호화/복호화 장치에 기-정의된 n개의 변환 타입 중 적어도 하나에 기초하여, 변환 블록이 생성될 수 있다. n은 1, 2, 3, 4, 또는 그 이상의 정수일 수 있다. 상기 변환 타입으로, DCT2, DCT8, DST7, 변환 스킵 모드 등이 이용될 수 있다. 하나의 블록의 수직/수평 방향에 대해서 하나의 동일한 변환 타입만이 적용될 수도 있고, 수직/수평 방향 각각에 대해서 상이한 변환 타입이 적용될 수도 있다. 이를 위해, 하나의 동일한 변환 타입이 적용되는지 여부를 나타내는 플래그가 이용될 수 있다. 상기 플래그는 부호화 장치에서 시그날링될 수 있다.
또한, 상기 변환 타입은, 부호화 장치에서 시그날링되는 정보에 기초하여 결정되거나, 소정의 부호화 파라미터에 기초하여 결정될 수 있다. 여기서, 부호화 파라미터는, 블록의 크기, 형태, 인트라 예측 모드 또는 성분 타입(e.g., 휘도, 색차) 중 적어도 하나를 의미할 수 있다. 블록의 크기는, 너비, 높이, 너비와 높이의 비, 너비와 높이의 곱, 너비와 높이의 합/차 등으로 표현될 수 있다. 예를 들어, 현재 블록의 크기가 소정의 문턱값보다 큰 경우, 수평 방향의 변환 타입은 제1 변환 타입(e.g., DCT2)으로 결정되고, 수직 방향의 변환 타입은 제2 변환 타입(e.g., DST7)으로 결정될 수 있다. 상기 문턱값은, 0, 4, 8, 16, 32 또는 그 이상의 정수일 수 있다.
한편, 본 발명에 따른 잔차 계수는, 제1 변환 이후 제2 변환을 수행하여 획득된 것일 수 있다. 제2 변환은 현재 블록 내 일부 영역의 잔차 계수에 대해서 수행될 수 있다. 이 경우, 복호화 장치는, 상기 일부 영역에 대해 제2 역변환을 수행하고, 상기 역변환된 일부 영역을 포함한 현재 블록에 대해서 제1 역변환을 수행함으로써, 현재 블록의 변환 블록을 획득할 수 있다.
도 29 및 도 30은 본 발명이 적용되는 일실시예로서, 복원 블록에 인루프 필터를 적용하는 방법을 도시한 것이다.
복원된 현재 블록에 대해서 소정의 인-루프 필터가 적용될 수 있다. 인-루프 필터는, 디블록킹 필터, SAO(sample adaptive offset) 필터 또는 ALF(adaptive loop filter) 중 적어도 하나를 포함할 수 있다.
인루프 필터링(In-loop filtering)은 양자화 및 부호화 과정에서 발생하는 정보의 손실을 줄이기 위해 복호화 된 영상에 적응적으로 필터링을 수행하는 기술이다. 디블록킹 필터(Deblocking filter), 샘플 적응적 오프셋 필터(sample adaptive offset filter, SAO), 적응적 루프 필터(adaptive loop filter, ALF)는 인루프 필터링의 한 예이다.
제1 복원 영상에 디블록킹 필터, 샘플 적응적 오프셋(Sample Adaptive Offset, SAO) 또는 적응적 루프 필터(adaptive loop filter, ALF) 중 적어도 어느 하나를 수행하여 제 2 복원 영상을 생성할 수 있다.
복원 영상에 디블록킹 필터를 적용한 후, SAO 및 ALF를 적용할 수 있다.
비디오 부호화 과정에서 블록 단위로 변환과 양자화를 수행한다. 양자화 과정에서 발생한 손실이 발생하고, 이를 복원한 영상의 경계에서는 불연속이 발생한다. 블록 경계에 나타난 불연속 영상을 블록 화질 열화(blocking artifact)라고 부른다.
Deblocking filter는 제1 영상의 블록 경계에서 발생하는 블록 화질 열화(blocking artifact)를 완화시키고, 부호화 성능을 높여주는 방법이다.
블록 경계에서 필터링을 수행하여 블록 화질 열화를 완화 시킬수 있으며, 도 29와 같이 블록이 인트라 예측 모드로 부호화 되었는지 여부, 또는 이웃한 블록의 움직임 벡터 절대값의 차이가 기-정의된 소정의 문턱값 보다 큰지 여부, 이웃한 블록의 참조 픽쳐가 서로 동일한 지 여부 중 적어도 어느 하나에 기초하여 블록 필터 강도 (blocking strength, 이하 BS) 값을 결정할 수 있다. BS 값이 0이면 필터링을 수행하지 않으며, BS 값이 1 또는 2인 경우에 블록 경계에서 필터링을 수행할 수 있다.
주파수 영역에서 양자화를 수행하기 때문에, 물체 가장 자리에 링잉 현상(ringing artifact)를 발생시키거나, 화소 값이 원본에 비해 일정한 값만큼 커지거나 작아기게 된다. SAO는 제1 복원 영상의 패턴을 고려하여 블록 단위로 특정 오프셋을 더하거나 빼는 방법으로 링잉 현상을 효과적으로 줄일 수 있다. SAO는 복원 영상의 특징에 따라 에지 오프셋(Edge offset, 이하 EO)과 밴드 오프셋(Band offset, BO)으로 구성된다. 에지 오프셋은 주변 화소 샘플 패턴에 따라 현재 샘플에 오프셋을 다르게 더해주는 방법이다. 밴드 오프셋은 영역 안의 비슷한 화소 밝기 값을 가진 화소 집합에 대해 일정 값을 더해 부호화 오류를 줄이는 것이다. 화소 밝기를 32개의 균일한 밴드로 나눠 비슷한 밝기 값을 가지는 화소를 하나의 집합이 되도록 할 수 있다. 예를 들어, 인접한 4개의 밴드를 하나의 범주로 묶을 수 있다. 하나의 범주에서는 동일한 오프셋 값을 사용하도록 설정할 수 있다.
ALF (Adaptive Loop Filter)는 수학식 14와 같이 제1 복원 영상 또는 제1 복원 영상에 deblocking filtering을 수행한 복원 영상에 기-정의된 필터 중 어느 하나를 사용하여 제2 복원 영상을 생성하는 방법이다.
[수학식 14]
Figure PCTKR2019018644-appb-I000002
이 때 필터는 픽쳐 단위 또는 CTU 단위로 선택할 수 있다.
Luma 성분에서는 다음 도 30과 같이 5x5, 7x7 또는 9x9 다이아몬드 형태 중 어느 하나를 선택할 수 있다. Chroma 성분에서는 5x5 다이아몬드 형태만 사용할 수 있도록 제한할 수도 있다.
본 개시의 다양한 실시 예는 모든 가능한 조합을 나열한 것이 아니고 본 개시의 대표적인 양상을 설명하기 위한 것이며, 다양한 실시 예에서 설명하는 사항들은 독립적으로 적용되거나 또는 둘 이상의 조합으로 적용될 수도 있다.
또한, 본 개시의 다양한 실시 예는 하드웨어, 펌웨어(firmware), 소프트웨어, 또는 그들의 결합 등에 의해 구현될 수 있다. 하드웨어에 의한 구현의 경우, 하나 또는 그 이상의 ASICs(Application Specific Integrated Circuits), DSPs(Digital Signal Processors), DSPDs(Digital Signal Processing Devices), PLDs(Programmable Logic Devices), FPGAs(Field Programmable Gate Arrays), 범용 프로세서(general processor), 컨트롤러, 마이크로 컨트롤러, 마이크로 프로세서 등에 의해 구현될 수 있다.
본 개시의 범위는 다양한 실시 예의 방법에 따른 동작이 장치 또는 컴퓨터 상에서 실행되도록 하는 소프트웨어 또는 머신-실행가능한 명령들(예를 들어, 운영체제, 애플리케이션, 펌웨어(firmware), 프로그램 등), 및 이러한 소프트웨어 또는 명령 등이 저장되어 장치 또는 컴퓨터 상에서 실행 가능한 비-일시적 컴퓨터-판독가능 매체(non-transitory computer-readable medium)를 포함한다.
본 발명은 비디오 부호화/복호화하기 위해 이용될 수 있다.

Claims (10)

  1. 현재 블록의 머지 후보 리스트를 구성하는 단계;
    상기 현재 블록의 머지 인덱스와 상기 머지 후보 리스트를 기반으로, 상기 현재 블록의 움직임 정보를 유도하는 단계; 여기서, 움직임 정보는 움직임 벡터 또는 참조 픽쳐 인덱스 중 적어도 하나를 포함함,
    상기 현재 블록의 움직임 벡터 차이값을 유도하는 단계;
    상기 움직임 벡터 차이값을 이용하여, 상기 현재 블록의 움직임 벡터를 보정하는 단계; 및
    상기 보정된 움직임 벡터를 이용하여, 상기 현재 블록의 움직임 보상을 수행하는 단계를 포함하는, 영상 복호화 방법.
  2. 제1항에 있어서,
    상기 머지 후보 리스트는, 상기 현재 블록의 공간적 머지 후보 또는 시간적 머지 후보 중 적어도 하나를 포함하되,
    상기 현재 블록의 움직임 정보 리스트에 속한 이전 블록의 움직임 정보가 상기 머지 후보 리스트에 더 추가되고,
    상기 이전 블록은 상기 현재 블록 이전에 복호화가 완료된 하나 이상의 블록인, 영상 복호화 방법.
  3. 제1항에 있어서,
    상기 움직임 벡터 차이값을 유도하는 단계는, 소정의 플래그에 기초하여 선택적으로 수행되고,
    상기 플래그는 머지 모드에서 움직임 벡터 차이값을 이용하는지 여부를 나타내는, 영상 복호화 방법.
  4. 제3항에 있어서,
    상기 플래그에 따라, 상기 현재 블록이 이용 가능한 머지 후보의 최대 개수는 적응적으로 결정되는, 영상 복호화 방법.
  5. 제1항에 있어서,
    상기 움직임 벡터 차이값은, 머지 오프셋 벡터에 기초하여 유도되고,
    상기 머지 오프셋 벡터는, 상기 머지 오프셋 벡터의 길이와 방향에 기초하여 결정되는, 영상 복호화 방법.
  6. 제5항에 있어서,
    상기 머지 오프셋 벡터의 길이는, 부호화된 디스턴스 인덱스 또는 상기 현재 블록의 움직임 벡터의 정밀도 중 적어도 하나를 고려하여 결정되는, 영상 복호화 방법.
  7. 제5항에 있어서,
    상기 머지 오프셋 벡터의 방향은, 부호화된 방향 인덱스에 기초하여 결정되고,
    상기 방향은 좌, 우, 상 또는 하 중 어느 하나의 방향으로 결정되는, 영상 복호화 방법.
  8. 제5항에 있어서,
    상기 움직임 벡터 차이값은, 소정의 스케일링 팩터를 상기 머지 오프셋 벡터에 적용하여 유도되고,
    상기 스케일링 팩터는 상기 현재 블록이 속한 현재 픽쳐와 상기 현재 블록의 참조 픽쳐 간의 POC 차이에 기초하여 결정되는, 영상 복호화 방법.
  9. 현재 블록의 머지 후보 리스트를 구성하는 단계;
    상기 현재 블록의 머지 인덱스와 상기 머지 후보 리스트를 기반으로, 상기 현재 블록의 움직임 정보를 유도하는 단계; 여기서, 움직임 정보는 움직임 벡터 또는 참조 픽쳐 인덱스 중 적어도 하나를 포함함,
    상기 현재 블록의 움직임 벡터 차이값을 유도하는 단계;
    상기 움직임 벡터 차이값을 이용하여, 상기 현재 블록의 움직임 벡터를 보정하는 단계; 및
    상기 보정된 움직임 벡터를 이용하여, 상기 현재 블록의 움직임 보상을 수행하는 단계를 포함하는, 영상 부호화 방법.
  10. 비디오 비트스트림을 저장하기 위한 디지털 저장 매체에 있어서,
    현재 블록의 머지 후보 리스트를 구성하고, 상기 현재 블록의 머지 인덱스와 상기 머지 후보 리스트를 기반으로 상기 현재 블록의 움직임 정보를 유도하며, 여기서, 움직임 정보는 움직임 벡터 또는 참조 픽쳐 인덱스 중 적어도 하나를 포함함, 상기 현재 블록의 움직임 벡터 차이값을 유도하고, 상기 움직임 벡터 차이값을 이용하여 상기 현재 블록의 움직임 벡터를 보정하며, 상기 보정된 움직임 벡터를 이용하여 상기 현재 블록의 움직임 보상을 수행하는 처리를 실행하는 비디오 복호화 프로그램을 기록한, 디지털 저장 매체.
PCT/KR2019/018644 2018-12-27 2019-12-27 영상 부/복호화 방법 및 장치 WO2020139040A1 (ko)

Priority Applications (3)

Application Number Priority Date Filing Date Title
US17/418,540 US11812031B2 (en) 2018-12-27 2019-12-27 Image encoding/decoding method and device
CN201980086601.XA CN113228642A (zh) 2018-12-27 2019-12-27 图像编码/解码方法和装置
US18/476,044 US20240022730A1 (en) 2018-12-27 2023-09-27 Image encoding/decoding method and device

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
KR10-2018-0171321 2018-12-27
KR20180171321 2018-12-27

Related Child Applications (2)

Application Number Title Priority Date Filing Date
US17/418,540 A-371-Of-International US11812031B2 (en) 2018-12-27 2019-12-27 Image encoding/decoding method and device
US18/476,044 Continuation US20240022730A1 (en) 2018-12-27 2023-09-27 Image encoding/decoding method and device

Publications (1)

Publication Number Publication Date
WO2020139040A1 true WO2020139040A1 (ko) 2020-07-02

Family

ID=71127329

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/KR2019/018644 WO2020139040A1 (ko) 2018-12-27 2019-12-27 영상 부/복호화 방법 및 장치

Country Status (4)

Country Link
US (2) US11812031B2 (ko)
KR (1) KR20200081328A (ko)
CN (1) CN113228642A (ko)
WO (1) WO2020139040A1 (ko)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
BR112021010706A2 (pt) * 2018-12-07 2021-11-30 Samsung Electronics Co Ltd Método de decodificação de vídeo, método de codificação de vídeo, e dispositivo de decodificação de vídeo

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2015142057A1 (ko) * 2014-03-21 2015-09-24 주식회사 케이티 다시점 비디오 신호 처리 방법 및 장치
KR20180134764A (ko) * 2017-06-09 2018-12-19 한국전자통신연구원 영상 부호화/복호화 방법, 장치 및 비트스트림을 저장한 기록 매체

Family Cites Families (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101934277B1 (ko) * 2011-11-28 2019-01-04 에스케이텔레콤 주식회사 개선된 머지를 이용한 영상 부호화/복호화 방법 및 장치
ES2832573T3 (es) * 2012-01-19 2021-06-10 Electronics & Telecommunications Res Inst Método para codificación/decodificación de imágenes
KR20140105038A (ko) * 2012-01-20 2014-09-01 주식회사 아이벡스피티홀딩스 머지 모드 움직임 정보 복호화 장치
EP2669707B1 (de) * 2012-05-29 2019-07-24 Leica Geosystems AG Verfahren und handhaltbares Entfernungsmessgerät zur indirekten Entfernungsmessung mittels bildgestützter Winkelbestimmungsfunktion
US10021388B2 (en) * 2012-12-26 2018-07-10 Electronics And Telecommunications Research Institute Video encoding and decoding method and apparatus using the same
US10187657B2 (en) * 2014-03-14 2019-01-22 Samsung Electronics Co., Ltd. Method and device for configuring merge candidate list for decoding and encoding of interlayer video
US10681372B2 (en) * 2014-06-23 2020-06-09 Microsoft Technology Licensing, Llc Encoder decisions based on results of hash-based block matching
WO2016078511A1 (en) * 2014-11-18 2016-05-26 Mediatek Inc. Method of bi-prediction video coding based on motion vectors from uni-prediction and merge candidate
KR102472399B1 (ko) * 2016-10-04 2022-12-05 인텔렉추얼디스커버리 주식회사 영상 부호화/복호화 방법, 장치 및 비트스트림을 저장한 기록 매체
CN116668678A (zh) * 2018-05-10 2023-08-29 Lg电子株式会社 图像编解码方法、计算机可读存储介质和数据发送方法
KR20210052566A (ko) * 2018-09-25 2021-05-10 디지털인사이트 주식회사 인터 모드 기반의 영상 부호화/복호화 방법 및 장치
US10999589B2 (en) * 2018-10-04 2021-05-04 Tencent America LLC Method and apparatus for video coding

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2015142057A1 (ko) * 2014-03-21 2015-09-24 주식회사 케이티 다시점 비디오 신호 처리 방법 및 장치
KR20180134764A (ko) * 2017-06-09 2018-12-19 한국전자통신연구원 영상 부호화/복호화 방법, 장치 및 비트스트림을 저장한 기록 매체

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
CHEN, XU ET AL.: "CE 4: Merge Offset Extension (Test 4.4.8", JOINT VIDEO EXPERTS TEAM (JVET) OF ITU-T SG 16 WP 3 AND ISO/IEC JTC 1/SC 29/WG 11. JVET-L0176. 12TH MEETING, 12 October 2018 (2018-10-12), Macao, CN, pages 1 - 6, Retrieved from the Internet <URL:http://phenix.int-evry.fr/jvet> [retrieved on 20200331] *
SAMUELSSON , JONATAN: "Example restriction flags for VVC", JOINT VIDEO EXPERTS TEAM (JVET) OF ITU-T SG 16 WP 3 AND ISO/IEC JTC 1/SC 29/WG 11. JVET-L0042. 12TH MEETING, 12 October 2018 (2018-10-12), Macao, CN, pages 1 - 4, Retrieved from the Internet <URL:http://:phenix.int-eviy.fr/jvet> [retrieved on 20200331] *
YANG, HAITAO ET AL.: "Description of Core Experiment 4 (CE4): Inter prediction and motion vector coding", JOINT VIDEO EXPERTS TEAM (JVET) OF ITU-T SG 16 WP 3 AND ISO/IEC JTC 1/SC 29/WG 11. JVET-L1024_V3. 12TH MEETING, 12 October 2018 (2018-10-12), Macao, CN, pages 1 - 15, Retrieved from the Internet <URL:http://phenix.int-evry.fr/jvet> [retrieved on 20200331] *

Also Published As

Publication number Publication date
CN113228642A (zh) 2021-08-06
US11812031B2 (en) 2023-11-07
KR20200081328A (ko) 2020-07-07
US20240022730A1 (en) 2024-01-18
US20220070468A1 (en) 2022-03-03

Similar Documents

Publication Publication Date Title
WO2017222326A1 (ko) 비디오 신호 처리 방법 및 장치
WO2020076116A1 (ko) 영상 부호화/복호화 방법 및 장치
WO2017176030A1 (ko) 비디오 신호 처리 방법 및 장치
WO2018026219A1 (ko) 비디오 신호 처리 방법 및 장치
WO2020096389A1 (ko) 영상 신호 부호화/복호화 방법 및 이를 위한 장치
WO2017171370A1 (ko) 비디오 신호 처리 방법 및 장치
WO2016200242A1 (ko) 적응적인 디블록킹 필터링을 이용하는 영상 부호화 방법과 영상 복호화 방법 및 장치
WO2016195453A1 (ko) 영상 부호화 및 복호화 방법과 영상 복호화 장치
WO2020111785A1 (ko) 영상 신호 부호화/복호화 방법 및 이를 위한 장치
WO2019066524A1 (ko) 영상 부호화/복호화 방법, 장치 및 비트스트림을 저장한 기록 매체
WO2019050292A1 (ko) 비디오 신호 처리 방법 및 장치
WO2018212579A1 (ko) 비디오 신호 처리 방법 및 장치
WO2020050685A1 (ko) 인트라 예측을 이용한 영상 부호화/복호화 방법 및 장치
WO2020197290A1 (ko) 영상 부호화/복호화 방법 및 장치
WO2020096425A1 (ko) 영상 신호 부호화/복호화 방법 및 이를 위한 장치
WO2018066958A1 (ko) 비디오 신호 처리 방법 및 장치
WO2020096428A1 (ko) 영상 신호 부호화/복호화 방법 및 이를 위한 장치
WO2018056701A1 (ko) 비디오 신호 처리 방법 및 장치
WO2017069505A1 (ko) 영상의 부호화/복호화 방법 및 이를 위한 장치
WO2019050291A1 (ko) 비디오 신호 처리 방법 및 장치
WO2019190201A1 (ko) 비디오 신호 처리 방법 및 장치
WO2019182295A1 (ko) 비디오 신호 처리 방법 및 장치
WO2020180166A1 (ko) 영상 부호화/복호화 방법 및 장치
WO2020184979A1 (ko) 영상 신호 부호화/복호화 방법 및 이를 위한 장치
WO2020096426A1 (ko) 영상 신호 부호화/복호화 방법 및 이를 위한 장치

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19901694

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19901694

Country of ref document: EP

Kind code of ref document: A1