WO2019135419A1 - 영상 코딩 시스템에서 현재 블록의 보간 필터에 기반한 인터 예측 방법 및 장치 - Google Patents

영상 코딩 시스템에서 현재 블록의 보간 필터에 기반한 인터 예측 방법 및 장치 Download PDF

Info

Publication number
WO2019135419A1
WO2019135419A1 PCT/KR2018/000091 KR2018000091W WO2019135419A1 WO 2019135419 A1 WO2019135419 A1 WO 2019135419A1 KR 2018000091 W KR2018000091 W KR 2018000091W WO 2019135419 A1 WO2019135419 A1 WO 2019135419A1
Authority
WO
WIPO (PCT)
Prior art keywords
current block
template
interpolation filter
block
filter
Prior art date
Application number
PCT/KR2018/000091
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 PCT/KR2018/000091 priority Critical patent/WO2019135419A1/ko
Publication of WO2019135419A1 publication Critical patent/WO2019135419A1/ko

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/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/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/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

Definitions

  • the present invention relates to image coding techniques and, more particularly, to an inter prediction method and apparatus based on a selected interpolation filter of a current block in an image coding system.
  • HD high definition
  • UHD ultra high definition
  • the present invention provides a method and apparatus for enhancing video coding efficiency.
  • a method and apparatus for deriving an interpolation filter of a current block among a plurality of interpolation filters and performing inter prediction of a current block based on the derived interpolation filter is provided.
  • an image decoding method performed by a decoding apparatus includes obtaining inter prediction information of a current block through a bitstream, deriving motion information of the current block based on the inter prediction information, deriving an interpolation filter of the current block from the plurality of interpolation filters, And performing inter-prediction of the current block based on the interpolation filter and the motion information, wherein the plurality of interpolation filters include a 4-tap filter, an 8-tap filter, and a 12-tap And a filter.
  • a decoding apparatus for performing image decoding.
  • the decoding apparatus includes an entropy decoding unit that obtains inter prediction information of a current block through a bit stream, and an interpolation unit that derives motion information of the current block based on the inter prediction information, And a prediction unit for performing inter-prediction of the current block based on the interpolation filter and the motion information, wherein the plurality of interpolation filters are a 4-tap filter, an 8-tap filter, And a 12-tap filter.
  • a video encoding method performed by an encoding apparatus.
  • the method includes generating motion information of a current block, determining an interpolation filter of the current block among a plurality of interpolation filters, performing interpolation of the current block based on the interpolation filter and the motion information, And encoding and transmitting inter prediction information of the current block, wherein the plurality of interpolation filters include a 4-tap filter, an 8-tap filter, and a 12-tap filter.
  • a video encoding apparatus wherein the encoding device generates motion information of a current block, determines an interpolation filter of the current block among a plurality of interpolation filters, and performs interpolation of the current block based on the interpolation filter and the motion information, And an entropy encoding unit for encoding and transmitting inter prediction information of the current block, wherein the plurality of interpolation filters include a 4-tap filter, an 8-tap filter, and a 12-tap filter .
  • an interpolation filter can be determined according to characteristics of an input image or a current block, and inter prediction of the current block can be performed based on a determined interpolation filter, thereby improving prediction accuracy of a current block, The overall coding efficiency can be improved.
  • the interpolation filter of the current block can be derived in the decoding apparatus without transmitting the information on the interpolation filter, thereby reducing the amount of bits used for the interpolation filter of the current block and improving the overall coding efficiency .
  • FIG. 1 is a view for schematically explaining a configuration of a video encoding apparatus to which the present invention can be applied.
  • FIG. 2 is a schematic view illustrating a configuration of a video decoding apparatus to which the present invention can be applied.
  • FIG. 3 illustrates an example in which the motion estimation is performed on the current block.
  • FIG. 4 illustrates an example in which fractional sample unit motion compensation is performed on the current block.
  • FIG. 5 illustrates an example of a process of performing motion compensation based on the 4-tap filter, the 8-tap filter, and the 12-tap filter.
  • FIG. 6 illustrates an example of deriving an interpolation filter index of the current block based on motion information of a neighboring block when a merge mode is applied to the current block.
  • Fig. 9 exemplarily shows the positions of the high-frequency component and the low-frequency component in the transform domain, i.e., the frequency domain.
  • FIG. 10 shows an example of deriving the interpolation filter of the current block based on the template of the current block and the template of the reference block.
  • FIG. 11 shows an example of deriving an interpolation filter of the current block based on the reference block of the current block.
  • FIG. 12 schematically shows a video encoding method by the encoding apparatus according to the present invention.
  • FIG. 13 schematically shows a video decoding method by a decoding apparatus according to the present invention.
  • a picture generally refers to a unit that represents one image in a specific time zone
  • a slice is a unit that constitutes a part of a picture in coding.
  • One picture may be composed of a plurality of slices, and pictures and slices may be used in combination if necessary.
  • a pixel or a pel may mean a minimum unit of a picture (or image). Also, a 'sample' may be used as a term corresponding to a pixel.
  • a sample may generally represent a pixel or pixel value and may only represent a pixel / pixel value of a luma component or only a pixel / pixel value of a chroma component.
  • a unit represents a basic unit of image processing.
  • a unit may include at least one of a specific area of a picture and information related to the area.
  • the unit may be used in combination with terms such as a block or an area in some cases.
  • an MxN block may represent a set of samples or transform coefficients consisting of M columns and N rows.
  • FIG. 1 is a view for schematically explaining a configuration of a video encoding apparatus to which the present invention can be applied.
  • the video encoding apparatus 100 includes a picture dividing unit 105, a predicting unit 110, a residual processing unit 120, an entropy encoding unit 130, an adding unit 140, a filter unit 150 And a memory 160.
  • the residual processing unit 120 may include a subtracting unit 121, a transforming unit 122, a quantizing unit 123, a reordering unit 124, an inverse quantizing unit 125 and an inverse transforming unit 126.
  • the picture dividing unit 105 may divide the inputted picture into at least one processing unit.
  • the processing unit may be referred to as a coding unit (CU).
  • the coding unit may be recursively partitioned according to a quad-tree binary-tree (QTBT) structure from the largest coding unit (LCU).
  • QTBT quad-tree binary-tree
  • LCU largest coding unit
  • one coding unit may be divided into a plurality of coding units of deeper depth based on a quadtree structure and / or a binary tree structure.
  • the quadtree structure is applied first and the binary tree structure can be applied later.
  • a binary tree structure may be applied first.
  • the coding procedure according to the present invention can be performed based on the final coding unit which is not further divided.
  • the maximum coding unit may be directly used as the final coding unit based on the coding efficiency or the like depending on the image characteristics, or the coding unit may be recursively divided into lower-depth coding units Lt; / RTI > may be used as the final coding unit.
  • the coding procedure may include a procedure such as prediction, conversion, and restoration, which will be described later.
  • the processing unit may include a coding unit (CU) prediction unit (PU) or a transform unit (TU).
  • the coding unit may be split from the largest coding unit (LCU) into coding units of deeper depth along the quad tree structure.
  • LCU largest coding unit
  • the maximum coding unit may be directly used as the final coding unit based on the coding efficiency or the like depending on the image characteristics, or the coding unit may be recursively divided into lower-depth coding units Lt; / RTI > may be used as the final coding unit.
  • SCU smallest coding unit
  • the coding unit can not be divided into smaller coding units than the minimum coding unit.
  • the term " final coding unit " means a coding unit on which the prediction unit or the conversion unit is partitioned or divided.
  • a prediction unit is a unit that is partitioned from a coding unit, and may be a unit of sample prediction. At this time, the prediction unit may be divided into sub-blocks.
  • the conversion unit may be divided along the quad-tree structure from the coding unit, and may be a unit for deriving a conversion coefficient and / or a unit for deriving a residual signal from the conversion factor.
  • the coding unit may be referred to as a coding block (CB)
  • the prediction unit may be referred to as a prediction block (PB)
  • the conversion unit may be referred to as a transform block (TB).
  • the prediction block or prediction unit may refer to a specific area in the form of a block in a picture and may include an array of prediction samples.
  • a transform block or transform unit may refer to a specific region in the form of a block within a picture, and may include an array of transform coefficients or residual samples.
  • the prediction unit 110 may perform a prediction on a current block to be processed (hereinafter, referred to as a current block), and may generate a predicted block including prediction samples for the current block.
  • the unit of prediction performed in the prediction unit 110 may be a coding block, a transform block, or a prediction block.
  • the prediction unit 110 may determine whether intra prediction or inter prediction is applied to the current block. For example, the prediction unit 110 may determine whether intra prediction or inter prediction is applied in units of CU.
  • the prediction unit 110 may derive a prediction sample for a current block based on a reference sample outside the current block in a picture to which the current block belongs (hereinafter referred to as a current picture). At this time, the prediction unit 110 may derive a prediction sample based on (i) an average or interpolation of neighboring reference samples of the current block, (ii) The prediction sample may be derived based on a reference sample existing in a specific (prediction) direction with respect to the prediction sample among the samples. (i) may be referred to as a non-directional mode or a non-angle mode, and (ii) may be referred to as a directional mode or an angular mode.
  • the prediction mode may have, for example, 33 directional prediction modes and at least two non-directional modes.
  • the non-directional mode may include a DC prediction mode and a planar mode (Planar mode).
  • the prediction unit 110 may determine a prediction mode applied to a current block using a prediction mode applied to a neighboring block.
  • the prediction unit 110 may derive a prediction sample for a current block based on a sample specified by a motion vector on a reference picture.
  • the prediction unit 110 may derive a prediction sample for a current block by applying one of a skip mode, a merge mode, and a motion vector prediction (MVP) mode.
  • the prediction unit 110 can use motion information of a neighboring block as motion information of a current block.
  • difference residual between the predicted sample and the original sample is not transmitted unlike the merge mode.
  • MVP mode a motion vector of a current block can be derived by using a motion vector of a neighboring block as a motion vector predictor to use as a motion vector predictor of a current block.
  • a neighboring block may include a spatial neighboring block existing in a current picture and a temporal neighboring block existing in a reference picture.
  • the reference picture including the temporal neighboring block may be referred to as a collocated picture (colPic).
  • the motion information may include a motion vector and a reference picture index.
  • Information such as prediction mode information and motion information may be (entropy) encoded and output in the form of a bit stream.
  • the highest picture on the reference picture list may be used as a reference picture.
  • the reference pictures included in the picture order count can be sorted on the basis of the picture order count (POC) difference between the current picture and the corresponding reference picture.
  • POC picture order count
  • the POC corresponds to the display order of the pictures and can be distinguished from the coding order.
  • the subtraction unit 121 generates residual samples that are the difference between the original sample and the predicted sample. When the skip mode is applied, a residual sample may not be generated as described above.
  • the transforming unit 122 transforms the residual samples on a transform block basis to generate a transform coefficient.
  • the transforming unit 122 can perform the transform according to the size of the transform block and a prediction mode applied to the coding block or the prediction block spatially overlapping the transform block. For example, if intraprediction is applied to the coding block or the prediction block that overlaps the transform block and the transform block is a 4 ⁇ 4 residue array, the residual sample is transformed into a discrete sine transform (DST) In other cases, the residual samples can be converted using a DCT (Discrete Cosine Transform) conversion kernel.
  • DST discrete sine transform
  • the quantization unit 123 may quantize the transform coefficients to generate quantized transform coefficients.
  • the reordering unit 124 rearranges the quantized transform coefficients.
  • the reordering unit 124 may rearrange the block-shaped quantized transform coefficients into a one-dimensional vector form through a scanning method of coefficients.
  • the reordering unit 124 may be a part of the quantization unit 123, although the reordering unit 124 is described as an alternative configuration.
  • the entropy encoding unit 130 may perform entropy encoding on the quantized transform coefficients.
  • Entropy encoding may include, for example, an encoding method such as exponential Golomb, context-adaptive variable length coding (CAVLC), context-adaptive binary arithmetic coding (CABAC)
  • CAVLC context-adaptive variable length coding
  • CABAC context-adaptive binary arithmetic coding
  • the entropy encoding unit 130 may encode the information necessary for video restoration (such as the value of a syntax element) together with the quantized transform coefficient or separately.
  • the entropy encoded information may be transmitted or stored in units of NAL (network abstraction layer) units in the form of a bit stream.
  • NAL network abstraction layer
  • the inverse quantization unit 125 inversely quantizes the quantized values (quantized transform coefficients) in the quantization unit 123 and the inverse transformation unit 126 inversely quantizes the inversely quantized values in the inverse quantization unit 125, .
  • the adder 140 combines the residual sample and the predicted sample to reconstruct the picture.
  • the residual samples and the prediction samples are added in units of blocks so that a reconstruction block can be generated.
  • the adding unit 140 may be a part of the predicting unit 110, Meanwhile, the addition unit 140 may be referred to as a restoration unit or a restoration block generation unit.
  • the filter unit 150 may apply a deblocking filter and / or a sample adaptive offset. Through deblocking filtering and / or sample adaptive offsets, artifacts in the block boundary in the reconstructed picture or distortion in the quantization process can be corrected.
  • the sample adaptive offset can be applied on a sample-by-sample basis and can be applied after the process of deblocking filtering is complete.
  • the filter unit 150 may apply an ALF (Adaptive Loop Filter) to the restored picture.
  • the ALF may be applied to the reconstructed picture after the deblocking filter and / or sample adaptive offset is applied.
  • the memory 160 may store restored pictures (decoded pictures) or information necessary for encoding / decoding.
  • the reconstructed picture may be a reconstructed picture whose filtering procedure has been completed by the filter unit 150.
  • the stored restored picture may be used as a reference picture for (inter) prediction of another picture.
  • the memory 160 may store (reference) pictures used for inter prediction. At this time, the pictures used for inter prediction can be designated by a reference picture set or a reference picture list.
  • FIG. 2 is a schematic view illustrating a configuration of a video decoding apparatus to which the present invention can be applied.
  • the video decoding apparatus 200 includes an entropy decoding unit 210, a residual processing unit 220, a predicting unit 230, an adding unit 240, a filter unit 250, and a memory 260 .
  • the residual processing unit 220 may include a rearrangement unit 221, an inverse quantization unit 222, and an inverse transformation unit 223.
  • the video decoding apparatus 200 can restore video in response to a process in which video information is processed in the video encoding apparatus.
  • the video decoding apparatus 200 can perform video decoding using a processing unit applied in the video encoding apparatus.
  • the processing unit block of video decoding may be, for example, a coding unit and, in another example, a coding unit, a prediction unit or a conversion unit.
  • the coding unit may be partitioned along the quad tree structure and / or the binary tree structure from the maximum coding unit.
  • a prediction unit and a conversion unit may be further used as the case may be, in which case the prediction block is a block derived or partitioned from the coding unit and may be a unit of sample prediction. At this time, the prediction unit may be divided into sub-blocks.
  • the conversion unit may be divided along the quad tree structure from the coding unit and may be a unit that derives the conversion factor or a unit that derives the residual signal from the conversion factor.
  • the entropy decoding unit 210 may parse the bitstream and output information necessary for video restoration or picture restoration. For example, the entropy decoding unit 210 decodes information in a bitstream based on a coding method such as exponential Golomb coding, CAVLC, or CABAC, and calculates a value of a syntax element necessary for video restoration, a quantized value Lt; / RTI >
  • a coding method such as exponential Golomb coding, CAVLC, or CABAC
  • the CABAC entropy decoding method includes receiving a bean corresponding to each syntax element in a bitstream, decoding decoding target information of the decoding target syntax element, decoding information of a surrounding and decoding target block, or information of a symbol / A context model is determined and an occurrence probability of a bin is predicted according to the determined context model to perform arithmetic decoding of the bean to generate a symbol corresponding to the value of each syntax element have.
  • the CABAC entropy decoding method can update the context model using the information of the decoded symbol / bin for the context model of the next symbol / bean after determining the context model.
  • the residual value i.e., the quantized transform coefficient, which is entropy-decoded in the entropy decoding unit 210, 221).
  • the reordering unit 221 may rearrange the quantized transform coefficients into a two-dimensional block form.
  • the reordering unit 221 may perform reordering in response to the coefficient scanning performed in the encoding apparatus.
  • the rearrangement unit 221 may be a part of the inverse quantization unit 222, although the rearrangement unit 221 has been described as an alternative configuration.
  • the inverse quantization unit 222 may dequantize the quantized transform coefficients based on the (inverse) quantization parameters, and output the transform coefficients. At this time, the information for deriving the quantization parameter may be signaled from the encoding device.
  • the inverse transform unit 223 may invert the transform coefficients to derive the residual samples.
  • the prediction unit 230 may predict a current block and may generate a predicted block including prediction samples of the current block.
  • the unit of prediction performed in the prediction unit 230 may be a coding block, a transform block, or a prediction block.
  • the prediction unit 230 may determine whether intra prediction or inter prediction is to be applied based on the prediction information.
  • a unit for determining whether to apply intra prediction or inter prediction may differ from a unit for generating a prediction sample.
  • units for generating prediction samples in inter prediction and intra prediction may also be different.
  • whether inter prediction or intra prediction is to be applied can be determined in units of CU.
  • the prediction mode may be determined in units of PU to generate prediction samples.
  • a prediction mode may be determined in units of PU, and prediction samples may be generated in units of TU.
  • the prediction unit 230 may derive a prediction sample for the current block based on the surrounding reference samples in the current picture.
  • the prediction unit 230 may apply a directional mode or a non-directional mode based on the neighbor reference samples of the current block to derive a prediction sample for the current block.
  • a prediction mode to be applied to the current block may be determined using the intra prediction mode of the neighboring block.
  • the prediction unit 230 may derive a prediction sample for a current block based on a sample specified on a reference picture by a motion vector on a reference picture.
  • the prediction unit 230 may derive a prediction sample for a current block by applying a skip mode, a merge mode, or an MVP mode.
  • motion information necessary for inter-prediction of a current block provided in the video encoding apparatus for example, information on a motion vector, a reference picture index, and the like may be acquired or derived based on the prediction information
  • motion information of a neighboring block can be used as motion information of the current block.
  • the neighboring block may include a spatial neighboring block and a temporal neighboring block.
  • the prediction unit 230 may construct a merge candidate list using the motion information of the available neighboring blocks and use the information indicated by the merge index on the merge candidate list as the motion vector of the current block.
  • the merge index may be signaled from the encoding device.
  • the motion information may include a motion vector and a reference picture. When the motion information of temporal neighboring blocks is used in the skip mode and the merge mode, the highest picture on the reference picture list can be used as a reference picture.
  • the difference between the predicted sample and the original sample is not transmitted.
  • a motion vector of a current block can be derived using a motion vector of a neighboring block as a motion vector predictor.
  • the neighboring block may include a spatial neighboring block and a temporal neighboring block.
  • a merge candidate list may be generated using a motion vector of the reconstructed spatial neighboring block and / or a motion vector corresponding to a Col block that is a temporally neighboring block.
  • the motion vector of the candidate block selected in the merge candidate list is used as the motion vector of the current block.
  • the prediction information may include a merge index indicating a candidate block having an optimal motion vector selected from the candidate blocks included in the merge candidate list.
  • the predicting unit 230 can derive the motion vector of the current block using the merge index.
  • a motion vector predictor candidate list is generated by using a motion vector of the reconstructed spatial neighboring block and / or a motion vector corresponding to a Col block which is a temporally neighboring block . That is, the motion vector of the reconstructed spatial neighboring block and / or the motion vector corresponding to the neighboring block Col may be used as a motion vector candidate.
  • the information on the prediction may include a predicted motion vector index indicating an optimal motion vector selected from the motion vector candidates included in the list.
  • the predicting unit 230 can use the motion vector index to select a predictive motion vector of the current block from the motion vector candidates included in the motion vector candidate list.
  • the predicting unit of the encoding apparatus can obtain the motion vector difference (MVD) between the motion vector of the current block and the motion vector predictor, and can output it as a bit stream. That is, MVD can be obtained by subtracting the motion vector predictor from the motion vector of the current block.
  • the predicting unit 230 may obtain the motion vector difference included in the information on the prediction, and derive the motion vector of the current block through addition of the motion vector difference and the motion vector predictor.
  • the prediction unit may also acquire or derive a reference picture index or the like indicating the reference picture from the information on the prediction.
  • the adder 240 may add a residual sample and a prediction sample to reconstruct a current block or a current picture.
  • the adder 240 may add the residual samples and the prediction samples on a block-by-block basis to reconstruct the current picture.
  • the adder 240 has been described as an alternative configuration, but the adder 240 may be a part of the predictor 230.
  • the addition unit 240 may be referred to as a restoration unit or a restoration block generation unit.
  • the filter unit 250 may apply deblocking filtered sample adaptive offsets, and / or ALFs, to the reconstructed pictures.
  • the sample adaptive offset may be applied on a sample-by-sample basis and may be applied after deblocking filtering.
  • the ALF may be applied after deblocking filtering and / or sample adaptive offsets.
  • the memory 260 may store restored pictures (decoded pictures) or information necessary for decoding.
  • the reconstructed picture may be a reconstructed picture whose filtering procedure has been completed by the filter unit 250.
  • the memory 260 may store pictures used for inter prediction.
  • the pictures used for inter prediction may be designated by a reference picture set or a reference picture list.
  • the reconstructed picture can be used as a reference picture for another picture.
  • the memory 260 may output the restored picture according to the output order.
  • Inter prediction can be performed on the current block as described above.
  • motion estimation and motion compensation may be the most critical processes or algorithms.
  • FIG. 3 illustrates an example in which the motion estimation is performed on the current block.
  • the motion estimation is a process of finding a block matching a current block with respect to reference pictures that have already been encoded / decoded before the encoding time of the current picture . That is, the motion estimation may include searching for a block having the highest correlation with the current block among the reconstructed blocks included in the reference pictures.
  • a block in a reference picture matched to the current block may be defined as a reference block.
  • the difference between the current block and the reference block derived by assuming that the reference block is within the same picture as the current block may be defined as a motion vector.
  • the motion compensation may be a process of predicting a sample value of the current block based on the inter prediction information derived through the motion estimation. That is, the motion compensation may refer to a process of deriving a position of a reference block in a reference picture based on a motion vector of the current block, and using the predicted sample value of the current block as sample values of the reference block.
  • the motion vector used for motion estimation and motion compensation may be a fractional sample unit for improving the prediction accuracy of the inter prediction. That is, motion estimation and motion compensation of a fractional sample unit can be performed.
  • a motion vector of 1/4 fractional sample unit is supported, and a motion vector resolution of 1/4 fractional sample unit or more may be supported.
  • a process of generating fractional samples from integer-number-of-reference samples based on an interpolation filter can be performed.
  • This process may be referred to as interpolation filtering.
  • the encoding apparatus may apply the interpolation filter to the reconstructed reference picture to generate blocks including fractional samples, and derive a reference block of the current block among the blocks.
  • a motion vector of a fractional sample unit indicating the reference block can be derived.
  • FIG. 4 illustrates an example in which fractional sample unit motion compensation is performed on the current block.
  • the motion vector of the current block may indicate a fractional sample generated based on the interpolation filter.
  • blocks including fractional samples of the reference picture can be derived based on an 8-tap filter in the case of a luma component, and 4-tap filters the blocks containing the fractional samples of the reference picture may be derived based on the filter.
  • the 8-tap filter may represent an interpolation filter that performs interpolation based on 8 filter coefficients
  • the 4-tap filter may represent an interpolation filter that performs interpolation based on 4 filter coefficients.
  • the filter coefficients of the 8-tap filter may be as shown in the following table.
  • a fractional sample may be generated based on eight integer samples and the 8-tap filter.
  • fractional samples can be generated by applying the interpolation filter in the horizontal and vertical directions to the reference picture of the luma component. For example, when the interpolation filter is applied in the horizontal direction, the interpolation filter is applied to four integer samples located on the left side and four integer samples located on the left side based on the generated fraction sample, A sample can be generated. In this case, a filter coefficient according to the position of the fractional sample as shown in Table 1 above may be applied.
  • the interpolation filter is applied in the vertical direction, the interpolation filter is applied to four integer samples located on the upper side and four integer samples positioned on the lower side based on the generated fraction sample, Lt; / RTI > In this case, a filter coefficient according to the position of the fractional sample as shown in Table 1 above may be applied.
  • the present invention proposes a method of selectively applying an interpolation filter according to the situation of an input image, unlike the conventional method of applying only one interpolation filter.
  • interpolation performance improves when the interpolation filter has a finite impulse response (FIR) shape, as the number of tapes of the interpolation filter increases.
  • FIR finite impulse response
  • the number of taps and the interpolation performance of the interpolation filter may not be proportional to the characteristics of the image.
  • a 12-tap filter can improve the inter prediction performance.
  • a low resolution may represent a resolution less than the HD resolution (1366x768 resolution).
  • the inter prediction performance can be improved by using the 4-tap filter rather than the 12-tap filter. Therefore, if the method of adjusting the number of taps of the interpolation filter is applied according to the characteristics of the input image or the characteristics of the current block, higher inter prediction performance can be expected.
  • the 12-tap filter may represent an interpolation filter that performs interpolation based on 12 filter coefficients.
  • the filter coefficients of the 12-tap filter may be as shown in the following table.
  • a fractional sample may be generated based on 12 integer samples and the 12-tap filter.
  • fractional samples can be generated by applying the interpolation filter in the horizontal and vertical directions to the reference picture.
  • the interpolation filter is applied in the horizontal direction, the interpolation filter is applied to six integer samples located on the left side and six integer samples positioned on the left side based on the generated fraction sample, A sample can be generated.
  • a filter coefficient depending on the position of the fractional sample as shown in Table 2 above may be applied.
  • the interpolation filter When the interpolation filter is applied in the vertical direction, the interpolation filter is applied to six integer samples located on the upper side and six integer samples positioned on the lower side based on the generated fraction sample, Lt; / RTI > In this case, a filter coefficient depending on the position of the fractional sample as shown in Table 2 above may be applied.
  • the 4-tap filter may represent an interpolation filter that performs interpolation based on four filter coefficients.
  • the filter coefficients of the 4-tap filter may be as shown in the following table.
  • fractional samples may be generated based on 4 integer samples and the 4-tap filter.
  • fractional samples can be generated by applying the interpolation filter in the horizontal and vertical directions to the reference picture. For example, when the interpolation filter is applied in the horizontal direction, the interpolation filter is applied to two integer samples located on the left side and two integer samples located on the left side based on the generated fraction sample, A sample can be generated. In this case, a filter coefficient according to the position of the fractional sample as shown in Table 3 above may be applied.
  • the interpolation filter When the interpolation filter is applied in the vertical direction, the interpolation filter is applied to two integer samples positioned on the upper side and two integer samples positioned on the lower side based on the generated fraction sample, Lt; / RTI > In this case, a filter coefficient according to the position of the fractional sample as shown in Table 3 above may be applied.
  • the above-mentioned Tables 1 to 3 are only examples of the interpolation filters, and the interpolation filters may have different filter coefficients.
  • the normalization may be performed with a number other than 64. That is, when one of the interpolation filters of Tables 1 to 3 is applied, the sum of the filter coefficients of the interpolation filter is 64 and the reference picture to which the interpolation filter is applied can be scaled 64 times, In addition to 64, fractional sample units can also be applied as 1/8 fractional samples, 1/16 fractional samples rather than 1/4 fractional samples. Meanwhile, an example of a process of performing motion compensation based on the 4-tap filter, the 8-tap filter, and the 12-tap filter may be as follows.
  • FIG. 5 illustrates an example of a process of performing motion compensation based on the 4-tap filter, the 8-tap filter, and the 12-tap filter.
  • the decoding apparatus entropy-decodes the inter prediction information acquired through the bit stream to obtain a motion vector of the current block (S500).
  • the inter prediction information may indicate whether one of a skip mode, a merge mode, and an adaptive motion vector prediction (AMVP) mode is applied to the current block.
  • AMVP adaptive motion vector prediction
  • the decoding apparatus may obtain a merge index indicating one neighboring block included in the merge candidate list.
  • the merge index may be included in the inter prediction information.
  • the decoding apparatus may derive motion information of a neighboring block indicated by the merge index as motion information of the current block.
  • the motion information may include a motion vector of the current block and a reference picture index.
  • the reference picture index may indicate a reference picture of the current block.
  • the decoding apparatus When the AMVP mode is applied to the current block, the decoding apparatus generates an MVP index indicating one of MVP candidates included in the generated MVP candidate list, a motion vector (MVP candidate) of a neighboring block indicated by the MVP index, A motion vector difference (MVD) with the motion vector of the current block can be obtained.
  • the MVP index and the MVD may be included in the inter prediction information.
  • the decoding apparatus can derive the motion vector of the current block based on the motion vector (MVP candidate) of the neighboring block indicated by the MVP index and the MVD.
  • the decoding apparatus may determine whether the motion vector of the current block is a motion vector of a fractional sample unit (S510).
  • the motion vector may indicate a fractional sample.
  • the fractional sample unit may be a 1/4 fractional sample, 1/8 fractional sample, or 1/16 fractional sample unit.
  • the number of taps of the interpolation filter of the current block may be determined based on an arbitrary condition (S520).
  • the decoding apparatus can determine the number of taps of the interpolation filter of the current block based on the resolution of the image including the current block. For example, if the resolution of the image including the current block is less than the HD resolution (1366x768 resolution), the interpolation filter of the current block may be determined as a 12-tap filter. Alternatively, if the resolution of the image including the current block is less than 4K resolution (3840x2160 resolution), the interpolation filter of the current block may be determined as a 4-tap filter.
  • the decoding apparatus may apply the 4-tap filter to the reference picture of the current block (S530). Specifically, the decoding device may generate fractional samples based on the 4-tap filter. The decoding device may generate a fractional sample based on four integer samples and the four tap filter. Specifically, the 4-tap filter can be applied to the reference picture in the horizontal and vertical directions to generate fractional samples.
  • the 4-tap filter when the 4-tap filter is applied in the horizontal direction, the 4-tap filter is applied to 2 integer samples to the left and 2 integer samples to the left based on the generated fraction sample, Lt; / RTI > When the 4-tap filter is applied in the vertical direction, the 4-tap filter is applied to two upper integer samples and a lower 2 integer samples based on the generated fraction sample to generate the fraction sample .
  • the decoding apparatus may apply the 8-tap filter to the reference picture of the current block (S540). Specifically, the decoding device may generate fractional samples based on the 8-tap filter. The decoding device may generate a fractional sample based on eight integer samples and the 8-tap filter. Specifically, the 8-tap filter can be applied to the reference pictures in the horizontal and vertical directions to generate fractional samples.
  • the 8-tap filter when the 8-tap filter is applied in the horizontal direction, the 8-tap filter is applied to 4 integer samples on the left side and 4 integer samples on the left side based on the generated fraction sample, Lt; / RTI > In addition, when the 8-tap filter is applied in the vertical direction, the 8-tap filter is applied to 4 upper integer samples and lower 4 integer samples based on the generated fraction sample to generate the fraction sample .
  • the decoding apparatus can apply the 12-tap filter to the reference picture of the current block (S550). Specifically, the decoding apparatus may generate fractional samples based on the 12-tap filter. The decoding apparatus may generate a fractional sample based on twelve integer samples and the twelve tap filter. Specifically, the 12-tap filter can be applied to the reference picture in the horizontal and vertical directions to generate fractional samples.
  • the 12-tap filter when the 12-tap filter is applied in the horizontal direction, the 12-tap filter is applied to 6 integer samples to the left and 6 integer samples to the left based on the fraction sample to be generated, Lt; / RTI > If the 12-tap filter is applied in the vertical direction, the 12-tap filter is applied to the upper 6 integer samples and the lower 6 integer samples based on the generated fraction sample to generate the fraction sample .
  • the decoding apparatus can perform motion compensation on the current block (S560).
  • the decoding apparatus can perform motion compensation on the current block based on the reference pictures including the fractional samples.
  • a merge mode is applied to the current block, the decoding apparatus can derive a reference block of a fractional sample unit of the current block based on the motion information of the current block, and based on the reference block, Prediction can be performed.
  • the AMVP mode is applied to the current block, the decoding apparatus can derive a reference block of a fractional sample unit of the current block based on the motion vector of the current block and the reference picture index,
  • the inter prediction of the current block can be performed.
  • the inter prediction information of the current block may include the reference picture index.
  • the decoding apparatus may perform motion compensation on the current block based on the reference picture of the current block. If a merge mode is applied to the current block, the decoding apparatus may derive a reference block of the current block based on the motion information of the current block, and perform inter-prediction of the current block based on the reference block . When the AMVP mode is applied to the current block, the decoding apparatus may derive a reference block of the current block based on the motion vector of the current block and the reference picture index, Can be performed.
  • the inter prediction information of the current block may include the reference picture index.
  • a 4-tap filter, an 8-tap filter, and a 12-tap filter can be used for motion compensation of the current block
  • information indicating an interpolation filter used in the encoding process of the current block may be signaled. That is, the encoding apparatus may determine an interpolation filter of the current block among the 4-tap filter, the 8-tap filter, and the 12-tap filter, and the information indicating the interpolation filter of the current block may be encoded and transmitted.
  • the decoding apparatus may decode and obtain information indicating the interpolation filter, and may perform motion compensation of the current block based on an interpolation filter indicated by the information indicating the interpolation filter.
  • the method of transmitting the information indicating the interpolation filter may be applied when the AMVP mode is applied to the current block and when the merge mode is applied.
  • the decoding apparatus can construct a motion vector predictor (MVP) candidate list based on motion vectors of neighboring blocks of the current block, and based on the received MVP flag And the selected candidate can be derived as a motion vector predictor (MVP) of the current block.
  • MVP motion vector predictor
  • the MVP flag may indicate one of the candidates included in the MVP candidate list.
  • the decoding apparatus can derive the motion vector of the current block based on the MVP and the received motion vector difference (MVD). Meanwhile, the MVD can be expressed through the MVD syntax. Further, the information indicating the interpolation filter may be received through the MVD syntax.
  • the MVD syntax including the information indicating the interpolation filter may be as shown in the following table.
  • the information indicating the interpolation filter may be called an interpolation filter index.
  • IF_idx [0] may be a syntax element indicating an interpolation filter index for the reference picture list 0 (List 0, L0).
  • IF_idx [0] may be a syntax element indicating an interpolation filter index for L0 prediction.
  • IF_idx [0] may be a syntax element indicating an interpolation filter index for the L0 direction.
  • the L0 prediction may indicate inter prediction that is performed based on the L0 motion information.
  • the L0 motion information may include an L0 reference picture index indicating a reference picture included in the reference picture list 0 and an L0 motion vector for the reference picture.
  • the L0 direction may be called a past direction or a forward direction.
  • IF_idx [1] may indicate an interpolation filter index for the reference picture list 1 (List 1, L1).
  • IF_idx [1] may represent an interpolation filter index for L1 prediction
  • IF_idx [1] may represent an interpolation filter index for L1 direction.
  • the L1 prediction may indicate inter prediction that is performed based on the L1 motion information.
  • the L1 motion information may include an L1 reference picture index indicating a reference picture included in the reference picture list 1 and an L1 motion vector for the reference picture.
  • the L1 direction may be referred to as a future direction or a reverse direction.
  • Abs_mvd_greater0_flag [n] may be a syntax element indicating a flag indicating whether the absolute value of the MVD with respect to the Ln direction is greater than zero.
  • Abs_mvd_greater1_flag [n] may be a syntax element indicating a syntax element for a flag indicating whether the absolute value of the MVD with respect to the Ln direction is greater than one.
  • inter prediction In performing inter prediction on the current block, inter prediction may be referred to as LO prediction when performing inter prediction on the basis of L0 motion information, and may be referred to as L1 prediction when inter prediction is performed based on L1 motion information, Prediction may be referred to as bi-prediction when inter prediction is performed based on the L0 motion information and the L1 motion information.
  • another interpolation filter index for the L0 direction and the L1 direction is not transmitted, and one interpolation filter index for the L0 direction and the L1 direction may be transmitted. That is, the same interpolation filter index may be applied to the L0 direction and the L1 direction.
  • the interpolation filter index may be omitted based on whether the value of the MVD of the current block is a fractional sample unit. For example, if the value of the MVD is a fractional sample unit, the encoding apparatus may transmit the interpolation filter index, and if the value of the MVD is not a fractional sample unit, the encoding apparatus may not transmit the interpolation filter index .
  • the interpolation filter index may be transmitted when the MVD of the current block is greater than one.
  • the binarization of the interpolation filter index may be applied to 0, 10, 11, and so on for an 8-tap filter, a 12-tap filter, and a 4-tap filter.
  • the interpolation filter index may be binarized to 0, 10, 11, and if the value of the interpolation filter index is 0, the interpolation filter index may point to the 8-tap filter and the value of the interpolation filter index 10, the interpolation filter index may indicate the 12-tap filter, and if the value of the interpolation filter index is 11, the interpolation filter index may indicate the 4-tap filter.
  • the encoding device may transmit the interpolation filter index after the merge index of the current block.
  • the decoding apparatus can derive the interpolation filter of the current block used in the encoding process based on the interpolation filter index.
  • the decoding apparatus can construct a merge candidate list based on the motion information of the neighboring blocks of the current block, and determine the motion information of the selected candidate based on the received merge index Can be derived as motion information of the current block.
  • the merge index may indicate one of the candidates included in the merge candidate list.
  • the syntax including the interpolation filter index may be as shown in the following table.
  • IF_idx may be a syntax element indicating the interpolation filter index
  • merge_idx may be a syntax element indicating the merge index
  • the same interpolation filter can be applied to each of the L0 prediction and the L1 prediction (or the L0 direction and the L1 direction) based on one interpolation filter index as shown in Table 5 above.
  • the same interpolation filter is applied to the L0 prediction and the L1 prediction based on one interpolation filter index.
  • an interpolation filter index for each of the L0 prediction and the L1 prediction may be transmitted.
  • the interpolation filter of the L0 prediction can be derived based on the interpolation filter index for the L0 prediction
  • the interpolation filter of the L1 prediction can be derived based on the interpolation filter index for the L1 prediction.
  • IF_idx [0] may represent a syntax element of the interpolation filter index for the L0 prediction
  • IF_idx [1] may represent a syntax element of the interpolation filter index for the L0 prediction.
  • the encoding apparatus can sequentially encode IF_idx [0] and IF_idx [1] and transmit the IF_idx [0] and IF_idx [1].
  • the interpolation filter index is not transmitted. Based on the information about the interpolation filter of the neighboring block of the current block selected based on the merge index, May be selected. That is, an interpolation filter applied to the neighboring block selected based on the merge index may be derived as an interpolation filter of the current block.
  • the candidate of the merge candidate list may include not only the motion information of the neighboring blocks of the current block but also information about the interpolation filter.
  • the candidate of the merge candidate list may include the motion information of the neighboring block and the interpolation filter index of the neighboring block.
  • the candidate motion information and the interpolation filter index selected based on the merge index may be derived from the motion information of the current block and the interpolation filter index of the current block.
  • FIG. 6 illustrates an example of deriving an interpolation filter index of the current block based on motion information of a neighboring block when a merge mode is applied to the current block.
  • spatial candidates indicating motion information of the spatial neighboring blocks A0, A1, B0 and B1 of the current block and motion candidates of the temporal neighboring block T0 of the current block A merge candidate list including a temporal candidate representing a candidate candidate candidate candidate may be constructed.
  • the candidate motion information indicated by the merge index of the current block among the candidates of the merge candidate list may be derived as motion information of the current block.
  • the candidate interpolation filter index may be derived as an interpolation filter index of the current block, and the interpolation filter indicated by the interpolation filter index may be derived as an interpolation filter of the current block.
  • the merge index of the current block may represent A1 among the candidates of the merge candidate list.
  • the interpolation filter used in the prediction of A1 may be used as an interpolation filter of the current block. That is, the interpolation filter index of A1 can be derived by an interpolation filter index of the current block, and the interpolation filter indicated by the interpolation filter index can be used for inter prediction of the current block.
  • information on the interpolation filter may be signaled through a level higher than the coding block level.
  • the information on the interpolation filter may be referred to as interpolation filter information.
  • information about the interpolation filter may be transmitted through a sequence parameter set (SPS), a picture parameter set (PPS), or a slice header, and blocks within a corresponding level range to which information about the interpolation filter is transmitted Inter prediction can be performed using an interpolation filter selected based on information about the interpolation filter.
  • the interpolation filter of the current block may be determined in the decoding apparatus without signaling the interpolation filter index of the current block.
  • the decoding apparatus may select the interpolation filter of the current block through rate-distortion optimization (RDO).
  • RDO rate-distortion optimization
  • the method of signaling the interpolation filter index of the current block may improve the accuracy of motion compensation of the current block, but in terms of rate, additional bits may be used to reduce coding efficiency.
  • a method may be proposed in which a decoding apparatus determines an interpolation filter of the current block and uses the interpolation filter for inter prediction of the current block without transmitting the information on the additional interpolation filter. The efficiency of motion compensation of the current block can be improved.
  • the compensation filter of the current block may be determined based on neighboring samples of the current block.
  • Information usable in the decoding apparatus may be surrounding samples of the current block and reference pictures. That is, the compensation filter of the current block may be determined based on the neighboring samples of the current block and the reference picture that have been reconstructed at the decoding time of the current block.
  • a template of the current block may be set, and a template of a reference block of the same type as the template of the current block may be set.
  • the interpolation filter may be determined by comparing the template of the current block with the template of the reference block.
  • the reference block may represent a block in a reference picture derived based on the motion information of the current block.
  • the template of the current block may be a specific region including neighboring samples of the current block.
  • the template may be a specific region including left neighboring samples, upper left neighboring samples, and upper neighboring samples of the current block.
  • the template may be a specific region including the left neighboring samples and the upper neighboring samples of the current block.
  • the template may be a specific region including the upper neighboring samples of the current block.
  • the template may be a specific region including the left neighboring samples of the current block.
  • the template of the current block may be set as shown in (a), (b), (c), or (d) have.
  • the decoding apparatus can determine the interpolation filter of the current block based on the template of the current block and the template of the reference block. For example, the frequency characteristic of the template of the current block and the template of the reference block may be different from each other, and the interpolation filter of the current block may be selected according to the case. Specifically, when the template of the current block includes more high frequency components than the template of the reference block, the probability that the data of the current block includes a higher high frequency component than the reference block is high, A filter may be derived as an interpolation filter of the current block. If the template of the current block includes fewer high frequency components than the template of the reference block, there is a high probability that the reference block includes a higher high frequency component than the current block. Therefore, And can be derived as an interpolation filter of the current block.
  • an 8-tap filter may be derived as the interpolation filter of the current block.
  • the method of comparing the frequency component of the template of the current block with the frequency component of the template of the reference block may be performed by using a method using dispersion in each template, a laplacian operation, a sobel operation, And a method of confirming the distribution of high-frequency components using frequency conversion.
  • a method of using the variance of the template may represent a method of calculating and comparing variance values in each template.
  • a variance value of sample values of neighboring samples included in the template of the current block may be derived, and a variance value of sample values of neighboring samples included in the template of the reference block may be derived.
  • the higher the variance value of the template the stronger the frequency characteristic of the high frequency component of the template.
  • the template of the current block when the variance value of the template of the current block is larger than the variance value of the template of the reference block, the template of the current block may include more high frequency components than the template of the reference block, When the variance value of the template is smaller than the variance value of the template of the reference block, the template of the current block may include less high frequency components than the template of the reference block. Accordingly, when the variance value of the template of the current block is larger than the variance value of the template of the reference block, the interpolation filter of the current block can be derived as a 12-tap filter, The interpolation filter of the current block may be derived as a 4-tap filter.
  • the interpolation filter of the current block may be derived as an 8-tap filter.
  • the difference between the variance value of the template of the current block and the variance value of the template of the reference block is within a specific range, Can be shown.
  • a method of using operations such as Laplacian operation and Sobel operation can be expressed as follows.
  • FIG. 8 shows an example of a Laplacian operation and a Sobel operation.
  • 8 (a) shows a Laplacian operator
  • FIG. 8 (b) shows a Sobel operator for the x-axis, that is, a Sobel operator for the x-component, Can represent a Sobel operator, i. E., A Sobel operator for the y component.
  • the decoding apparatus may further include a memory for storing a frequency component of the template of the current block and a reference value of the reference block based on a value derived by applying the Laplacian operator to the template of the current block and a value derived by applying the Laplacian operator to the template of the reference block.
  • the frequency components of the template can be indirectly compared.
  • the decoding apparatus may calculate the frequency component of the template of the current block and the reference value of the reference block based on the value derived by applying the Sobel operator to the template of the current block and the value derived by applying the Sobel operator to the template of the reference block.
  • the frequency components of the template of the block can be indirectly compared.
  • a method of confirming the distribution of high frequency components using frequency conversion can be expressed as follows.
  • Fig. 9 exemplarily shows the positions of the high-frequency component and the low-frequency component in the transform domain, i.e., the frequency domain.
  • a method using frequency conversion may represent a method of verifying the characteristics of a corresponding block in the frequency domain by converting a predicted block, a residual block, or a reconstructed block.
  • the transform coefficients occurring at the bottom right may represent the frequency with respect to the high frequency component. That is, the larger the transform coefficients located at the lower right end, the larger the high-frequency component of the corresponding block.
  • the degree of the high-frequency component may be expressed by the sum of the absolute values of the transform coefficients existing in an arbitrary region 910 corresponding to the high-frequency component.
  • the decoding apparatus can convert the template of the current block and the template of the reference block, and the high frequency component of the template of the current block
  • the interpolation filter of the current block may be determined based on the transform coefficient for the current block and the transform coefficient for the high frequency component of the template of the current block.
  • FIG. 10 shows an example of deriving the interpolation filter of the current block based on the template of the current block and the template of the reference block.
  • the decoding apparatus can determine the interpolation filter of the current block based on the template of the current block and the template of the reference block, and perform the inter prediction of the current block based on the interpolation filter .
  • the decoding apparatus can set the template of the current block (S1000).
  • the template of the current block may be a specific region including neighboring samples of the current block.
  • the template may be a specific region including left neighboring samples, upper left neighboring samples, and upper neighboring samples of the current block, or may include the left neighboring samples and the upper neighboring samples of the current block Lt; / RTI >
  • the template may be a specific region including the upper neighbor samples of the current block, or the template may be a specific region including the left neighbor samples of the current block.
  • Cur_tmp may be a syntax element indicating the template of the current block.
  • the decoding apparatus can set the template of the reference block (S1010).
  • the decoding apparatus can set the template of the reference block in the same form as the template of the current block. For example, when the template of the current block is set to a specific region including left neighboring samples, upper left neighboring samples, and upper neighboring samples of the current block, the template of the reference block is located on the left side of the reference block Samples may be set to a specific region including upper left side surrounding samples and upper side surrounding samples. Alternatively, when the template of the current block is set to a specific area including the left neighboring samples and the upper neighboring samples of the current block, the template of the reference block may include the left neighboring samples of the reference block, And may be set to a specific area including upper peripheral samples.
  • the template of the reference block when the template of the current block is set to a specific region including the left neighbor samples of the current block, the template of the reference block may be set to a specific region including the left neighbor samples of the reference block have.
  • the template of the reference block when the template of the current block is set to a specific region including the upper neighbor samples of the current block, the template of the reference block may be set to a specific region including the upper neighbor samples of the reference block have.
  • Ref_tmp may be a syntax element indicating the template of the reference block.
  • the decoding apparatus may determine whether the high-frequency component of the template of the current block is larger than the high-frequency component of the reference block (S1020).
  • the method of comparing the frequency component of the template of the current block with the frequency component of the template of the reference block may be a method of using a variance of a template, a laplacian operation, a Sobel operation, , A method of confirming the distribution of high-frequency components using frequency conversion, and the like.
  • the decoding apparatus may derive a variance value of the template of the current block. That is, the decoding apparatus may derive a variance value of sample values of neighboring samples included in the template of the current block. Also, the decoding apparatus can derive the variance value of the template of the reference block. That is, the decoding apparatus may derive a variance value of sample values of neighboring samples included in the template of the reference block. In this case, the higher the variance value of the template, the stronger the frequency characteristic of the high frequency component of the template. That is, the variance value of the template may indicate that the high frequency component of the template is large or small.
  • the decoding apparatus can determine whether the high frequency component of the template of the current block is larger than the high frequency component of the reference block based on the variance value of the template of the current block and the variance value of the template of the reference block. If the variance value of the template of the current block is larger than the variance value of the template of the reference block, the decoding apparatus can determine that the template of the current block has higher frequency components than the template of the reference block, If the variance value of the template is smaller than the variance value of the template of the reference block, it can be determined that the template of the current block has a lower high frequency component than the template of the reference block.
  • the decoding apparatus may calculate a high frequency component of the template of the current block based on a value derived by applying the Laplacian operator to the template of the current block and a value derived by applying the Laplacian operator to the template of the reference block Is higher than the high-frequency component of the reference block.
  • the decoding apparatus may be configured such that the high frequency component of the template of the current block is determined based on a value derived by applying the Sovell operator to the template of the current block and a value derived by applying the Sovell operator to the template of the reference block, Frequency component of the reference block.
  • the decoding apparatus may convert the template of the current block and the template of the reference block, and may include a transform coefficient for the high-frequency component of the template of the current block and a transform coefficient for the high- The interpolation filter of the current block can be determined.
  • the decoding apparatus may express the degree of the high-frequency component as the sum of the absolute values of the transform coefficients existing in an arbitrary region corresponding to the high-frequency component.
  • the absolute value of the transform coefficients included in the arbitrary region among the transform coefficients of the template of the current block and the absolute value of the transform coefficients included in the arbitrary region among the transform coefficients of the template of the reference block It is possible to determine whether the high frequency component of the template of the current block is larger than the high frequency component of the reference block.
  • the template of the block may be determined to have a higher frequency component than the template of the reference block and the sum of the absolute values of the transform coefficients included in the arbitrary region of the template of the current block may be larger than the sum
  • the template of the current block may be determined to have a lower frequency component than the template of the reference block.
  • the decoding apparatus may be configured to convert the position of the transform coefficient for the first-derived high-frequency component among the transform coefficients of the template of the current block and the transform coefficient for the first derived high-frequency component among the transform coefficients of the template of the reference block It is possible to determine whether the high frequency component of the template of the current block is larger than the high frequency component of the reference block.
  • the decoding apparatus can derive the transform coefficient for the first high frequency component and the distance from the lower right while zigzag from the lower right end to the upper left end of the current block in the transform domain (i.e., frequency domain) , The frequency domain) while moving from the lower right end to the upper left end of the reference block in a zigzag manner, the distance between the transform coefficient and the lower right end for the first high frequency component derived can be derived. It can be judged that the higher the frequency component is, the closer the distance between the transform coefficient for the high frequency component and the lower right end is.
  • the decoding apparatus can determine the interpolation filter of the current block as a 12-tap filter (S1030). If the interpolation filter of the current block is determined as the 12-tap filter, the decoding apparatus may perform motion compensation of the current block based on the 12-tap filter (S1040). That is, the decoding apparatus can perform inter prediction of the current block based on the 12-tap filter.
  • the decoding apparatus may derive a reference picture including a fractional sample by applying the 12-tap filter to a reference picture of the current block, and based on the motion information of the current block, a fractional sample A reference block of a current block may be derived, and inter prediction of the current block may be performed based on the reference block.
  • the decoding apparatus may be a method of using a distribution of a template, a method of using a template, a method of using a laplacian operation, an operation of a sobel operation, a method of confirming a distribution of a high frequency component using frequency conversion, It is possible to determine whether the high-frequency component of the template of the current block is smaller than the high-frequency component of the reference block.
  • the decoding apparatus may determine the interpolation filter of the current block as a 4-tap filter (S1060). If the interpolation filter of the current block is determined as the 4-tap filter, the decoding apparatus may perform motion compensation of the current block based on the 4-tap filter (S1040). That is, the decoding apparatus can perform inter prediction of the current block based on the 4-tap filter.
  • the decoding apparatus can derive a reference picture including a fractional sample by applying the 4-tap filter to a reference picture of the current block, and based on the motion information of the current block, a fractional sample A reference block of a current block may be derived, and inter prediction of the current block may be performed based on the reference block.
  • the decoding apparatus may perform motion compensation of the current block based on the 8-tap filter (S1040). That is, the decoding apparatus can perform inter prediction of the current block based on the 8-tap filter.
  • the decoding apparatus can derive a reference picture including a fractional sample by applying the 8-tap filter to a reference picture of the current block, and based on the motion information of the current block, a fractional sample A reference block of a current block may be derived, and inter prediction of the current block may be performed based on the reference block.
  • the decoding apparatus can determine the interpolation filter of the current block based on the frequency characteristic of the reference block, and perform the inter prediction of the current block based on the interpolation filter.
  • the decoding apparatus can digitize the high-frequency component of the reference block of the current block (S1100).
  • the method of digitizing the high-frequency component of the reference block includes a method using a variance of the reference block, a method using an operation such as a laplacian operation and a sobel operation, And the like.
  • the decoding apparatus may derive a variance value of the reference block. That is, the decoding apparatus can derive the variance value of the sample values of the reconstructed samples included in the reference block.
  • the higher the variance value of the reference block the stronger the high-frequency component of the reference block. That is, the variance value of the template may indicate that the high frequency component of the template is large or small.
  • the decoding apparatus may quantize the high-frequency component of the reference block based on the Laplacian operator described in the reference block.
  • the decoding apparatus can apply the Laplacian operator to the reference block and determine the high frequency component of the reference block based on the value derived by applying the Laplacian operator to the reference block.
  • the decoding apparatus can apply the above-described Sobel operator to the reference block, and determine a high-frequency component of the reference block based on the derived value by applying the Sobel operator to the reference block.
  • the decoding apparatus may convert the reference block and determine an interpolation filter of the current block based on a transform coefficient for the high-frequency component of the reference block.
  • the decoding apparatus may express the degree of the high-frequency component as the sum of the absolute values of the transform coefficients existing in an arbitrary region corresponding to the high-frequency component among the transform coefficients of the reference block.
  • the high-frequency component of the reference block may be determined based on the sum of the absolute values of the transform coefficients included in the arbitrary region among the transform coefficients of the reference block.
  • the decoding apparatus may determine the high-frequency component of the reference block based on the position of the transform coefficient for the first-derived high-frequency component among the transform coefficients of the reference block.
  • the decoding apparatus can derive the transform coefficient for the first high frequency component and the distance between the lower right end and the lower right end while moving zigzag from the lower right end to the upper left end of the reference block in the transform domain (i.e., frequency domain). It can be judged that the higher the frequency component is, the closer the distance between the transform coefficient for the high frequency component and the lower right end is.
  • the decoding apparatus may determine whether a high-frequency component of the reference block is smaller than a first threshold (S1110). When the numerical value of the high-frequency component of the reference block is smaller than the first threshold value, the high-frequency component of the reference block is weak. If the high-frequency component of the reference block is weak, the decoding apparatus can derive the interpolation filter of the current block as a 12-tap filter.
  • the decoding apparatus can determine whether the variance value of the reference block is smaller than the first threshold value.
  • the decoding apparatus may determine whether a value derived by applying the Laplacian operator to the reference block is smaller than the first threshold value.
  • the Sobel operator is applied to the reference block, the decoding apparatus can determine whether the value derived by applying the Sobel operator to the reference block is smaller than the first threshold value. If the sum of the absolute values of the transform coefficients existing in an arbitrary region corresponding to the high frequency component of the reference block is derived, the decoding device determines whether the sum of absolute values of the transform coefficients is less than the first threshold value can do.
  • the decoding device determines whether the distance is smaller than the first threshold can do.
  • the decoding apparatus may determine the interpolation filter of the current block as a 12-tap filter (S1120). If the interpolation filter of the current block is determined as the 12-tap filter, the decoding apparatus may perform motion compensation of the current block based on the 12-tap filter (S1130). That is, the decoding apparatus can perform inter prediction of the current block based on the 12-tap filter.
  • the decoding apparatus may derive a reference picture including a fractional sample by applying the 12-tap filter to a reference picture of the current block, and based on the motion information of the current block, a fractional sample A reference block of a current block may be derived, and inter prediction of the current block may be performed based on the reference block.
  • the decoding apparatus may determine whether a high-frequency component of the reference block is greater than a second threshold (S1140). When the numerical value of the high frequency component of the reference block is larger than the second threshold value, the high frequency component of the reference block can be strong. If the high-frequency component of the reference block is strong, the decoding apparatus can derive the interpolation filter of the current block by a 4-tap filter.
  • the decoding apparatus can determine whether the variance value of the reference block is greater than the second threshold value.
  • the decoding apparatus may determine whether a value derived by applying the Laplacian operator to the reference block is greater than the second threshold value.
  • the Sobel operator is applied to the reference block, the decoding apparatus may determine whether a value derived by applying the Sobel operator to the reference block is greater than the second threshold value.
  • the decoding apparatus determines whether the sum of the absolute values of the transform coefficients is larger than the second threshold .
  • the decoding apparatus determines whether the distance is larger than the second threshold .
  • the decoding apparatus may determine the interpolation filter of the current block as a 4-tap filter (S1150). If the interpolation filter of the current block is determined as the 4-tap filter, the decoding apparatus may perform motion compensation of the current block based on the 4-tap filter (S1130). That is, the decoding apparatus can perform inter prediction of the current block based on the 4-tap filter.
  • the decoding apparatus can derive a reference picture including a fractional sample by applying the 4-tap filter to a reference picture of the current block, and based on the motion information of the current block, a fractional sample A reference block of a current block may be derived, and inter prediction of the current block may be performed based on the reference block.
  • the decoding apparatus may determine the interpolation filter of the current block as an 8-tap filter (S1160). If the interpolation filter of the current block is determined as the 8-tap filter, the decoding apparatus may perform motion compensation of the current block based on the 8-tap filter (S1130). That is, the decoding apparatus can perform inter prediction of the current block based on the 8-tap filter.
  • the decoding apparatus can derive a reference picture including a fractional sample by applying the 8-tap filter to a reference picture of the current block, and based on the motion information of the current block, a fractional sample A reference block of a current block may be derived, and inter prediction of the current block may be performed based on the reference block.
  • the first threshold value may be derived as a predetermined value.
  • the first threshold may be the same value in all cases (i.e., the predetermined value).
  • information on the first threshold value may be signaled.
  • the information on the first threshold value may be transmitted through an upper level syntax such as a sequence parameter set (SPS) or a picture parameter set (PPS).
  • the information on the first threshold value may be transmitted in units of a slice, a coding unit (CU), or a PU.
  • the second threshold value may be derived as a predetermined value.
  • the second threshold value may be the same value in all cases (i.e., the predetermined value).
  • information about the second threshold value may be signaled.
  • the information on the second threshold value may be transmitted through an upper level syntax such as a sequence parameter set (SPS) or a picture parameter set (PPS).
  • the information on the second threshold value may be transmitted in units of a slice, a coding unit (CU), or a PU.
  • the high-frequency component analysis may be performed on a picture-by-picture basis. That is, an interpolation filter of the current block can be derived based on the reference picture.
  • the overall characteristics (e.g., frequency characteristics) of the reference picture may be analyzed before the current picture including the current block is encoded / decoded. If motion compensation is performed based on the reference picture, A specific interpolation filter may be set to be applied according to the characteristics of the analyzed reference picture.
  • the method of analyzing the high-frequency component of the reference picture can be applied in the same manner as the method of analyzing the high-frequency component of the reference block.
  • the method of transmitting the threshold value for the reference picture may be applied in the same manner as the method of transmitting the threshold value of the reference block.
  • FIG. 12 schematically shows a video encoding method by the encoding apparatus according to the present invention.
  • the method disclosed in Fig. 12 can be performed by the encoding apparatus disclosed in Fig. Specifically, for example, S1200 to S1220 in FIG. 12 may be performed by the predicting unit of the encoding apparatus, and S1230 may be performed by the entropy encoding unit of the encoding apparatus.
  • the encoding apparatus generates motion information of the current block (S1200).
  • the encoding apparatus may apply inter prediction to the current block.
  • the encoding apparatus When inter prediction is applied to the current block, the encoding apparatus generates motion information on the current block by applying any one of a skip mode, a merge mode, and an adaptive motion vector prediction (AMVP) mode can do.
  • the encoding apparatus In the skip mode and the merge mode, the encoding apparatus can generate motion information of the current block based on motion information of a neighboring block of the current block.
  • the motion information may include a motion vector and a reference picture index.
  • the motion information may be bi-prediction motion information, or may be uni-prediction motion information.
  • the bi-predictive motion information may include an L0 reference picture index, an L0 motion vector, an L1 reference picture index, and an L1 motion vector
  • the short motion prediction information may include an L0 reference picture index and a L0 motion vector
  • An L1 reference picture index and an L1 motion vector L0 denotes a reference picture list L0 (List 0)
  • L1 denotes a reference picture list L1 (List 1).
  • the encoding apparatus may derive a motion vector of the current block using a motion vector of a neighboring block of the current block as a motion vector predictor (MVP) of the current block, And motion vector information including a reference picture index for the motion vector.
  • MVP motion vector predictor
  • the encoding apparatus determines an interpolation filter of the current block among the plurality of interpolation filters (S1210).
  • the plurality of interpolation filters may include a 4-tap filter, an 8-tap filter, and a 12-tap filter.
  • the encoding apparatus may determine the interpolation filter of the current block based on the resolution of the current picture including the current block. For example, if the resolution of the current picture is less than the HD resolution (1366x768 resolution), the encoding apparatus can determine the interpolation filter of the current block as a 12-tap filter. If the resolution of the current picture is 4K resolution (3840x2160 resolution), the encoding apparatus may determine the interpolation filter of the current block as a 4-tap filter. If the resolution of the current picture is higher than the HD resolution (1366x768 resolution) and the resolution is not the 4K resolution, the encoding apparatus can determine the interpolation filter of the current block as an 8-tap filter.
  • the encoding apparatus may determine the interpolation filter of the current block based on the template of the current block and the template of the reference block. Specifically, the encoding apparatus can determine the interpolation filter of the current block by comparing the frequency characteristics of the template of the current block and the template of the reference block.
  • the reference block may be derived based on motion information of the current block. That is, the reference block may represent an intra-reference block reconstruction block indicated by the motion information.
  • the encoding apparatus can derive the template of the current block based on the surrounding samples of the current block.
  • the template of the current block may be a specific region including surrounding samples of the current block.
  • the template may be a specific region including left neighboring samples, upper left neighboring samples, and upper neighboring samples of the current block, or may include the left neighboring samples and the upper neighboring samples of the current block Lt; / RTI >
  • the template may be a specific region including the upper neighbor samples of the current block, or the template may be a specific region including the left neighbor samples of the current block.
  • the encoding apparatus can derive the template of the reference block based on the surrounding samples of the reference block, and can derive the template of the reference block in the same form as the template of the current block.
  • the template of the current block when the template of the current block is a specific region including left neighboring samples of the current block, upper left neighboring sample, and upper neighboring samples, the template of the reference block may be a left neighbor sample The upper left side surrounding sample, and the upper nearby sample.
  • the template of the reference block may include the left neighboring samples of the reference block, Lt; / RTI > can be derived to a particular region containing surrounding samples.
  • the template of the reference block when the template of the current block is a specific region including the left neighbor samples of the current block, the template of the reference block may be derived as a specific region including the left neighbor samples of the reference block .
  • the template of the reference block when the template of the current block is a specific region including the upper neighbor samples of the current block, the template of the reference block may be derived as a specific region including the upper neighbor samples of the reference block .
  • the encoding apparatus can determine the interpolation filter of the current block by comparing the frequency characteristic of the template of the current block with the template of the reference block.
  • the encoding apparatus can determine the interpolation filter of the current block as a 12-tap filter.
  • the encoding apparatus can determine the interpolation filter of the current block as a 4-tap filter.
  • the encoding apparatus can determine the interpolation filter of the current block as an 8-tap filter.
  • the variance value of each template may be used to compare high-frequency components of the template of the current block with the template of the reference block.
  • the encoding apparatus can derive the variance value of the template of the current block and derive the variance value of the template of the reference block .
  • the variance value of the template of the current block may represent a variance value of sample values of neighboring samples included in the template of the current block
  • the variance value of the template of the reference block may be represented as a restoration value Can represent the variance of the sample values of the samples.
  • the encoding apparatus may determine an interpolation filter of the current block based on a variance value of the template of the current block and a variance value of the template of the reference block.
  • the encoding apparatus can determine the interpolation filter of the current block as a 12-tap filter.
  • the variance value of the template of the current block is smaller than the variance value of the reference block (i.e., when the variance value of the template of the reference block minus the variance value of the current block is larger than a specific value)
  • the apparatus can determine the interpolation filter of the current block as a 4-tap filter.
  • the encoding apparatus can determine the interpolation filter of the current block as an 8-tap filter.
  • operations such as laplacian operation or Sobel operation may be used to compare high-frequency components of the template of the current block and the template of the reference block.
  • the encoding apparatus may derive a first value by applying a Laplacian operator to the template of the current block, A second value can be derived by applying a Laplacian operator. That is, the encoding apparatus can derive the first value of the template of the current block based on the Laplacian operator, and derive the second value of the template of the reference block based on the Laplacian operator. In this case, the encoding apparatus can determine the interpolation filter of the current block based on the first value of the template of the current block and the second value of the template of the reference block.
  • the encoding apparatus can determine the interpolation filter of the current block as a 12-tap filter. If the first value of the template of the current block is smaller than the second value of the reference block (i.e., the value obtained by subtracting the first value of the current block from the second value of the template of the reference block is larger than the specific value , The encoding apparatus can determine the interpolation filter of the current block as a 4-tap filter.
  • the encoding apparatus can determine the interpolation filter of the current block as an 8-tap filter .
  • the encoding apparatus may derive a first value by applying a Sobel operator to the template of the current block, and derive a second value by applying the Sobel operator to the template of the reference block. That is, the encoding apparatus can derive the first value of the template of the current block based on the Sobel operator, and derive the second value of the template of the reference block based on the Sobel operator. In this case, the encoding apparatus may derive the interpolation filter of the current block based on the first value of the template of the current block and the second value of the template of the reference block.
  • the encoding apparatus can determine the interpolation filter of the current block as a 12-tap filter. If the first value of the template of the current block is smaller than the second value of the reference block (i.e., the value obtained by subtracting the first value of the current block from the second value of the template of the reference block is larger than the specific value , The encoding apparatus can determine the interpolation filter of the current block as a 4-tap filter.
  • the encoding apparatus can determine the interpolation filter of the current block as an 8-tap filter .
  • a method of confirming the distribution of the high-frequency components using frequency conversion may be used.
  • the encoding apparatus may convert the template of the current block and the template of the reference block to derive the transform coefficients of the template of the current block and the transform coefficients of the template of the reference block, A second value which is a sum of a first value which is a sum of the absolute values of the transform coefficients included in the specific region among the transform coefficients of the reference block and an absolute value of the transform coefficients included in the specific region among the transform coefficients of the template of the reference block .
  • the specific region may represent an arbitrary region in the frequency domain.
  • the encoding apparatus can determine the interpolation filter of the current block based on the first value of the template of the current block and the second value of the template of the reference block.
  • the encoding apparatus can determine the interpolation filter of the current block as a 12-tap filter. If the first value of the template of the current block is smaller than the second value of the template of the reference block (i.e., a value obtained by subtracting the first value of the template of the current block from the second value of the template of the reference block Is greater than a specific value), the encoding apparatus can determine the interpolation filter of the current block as a 4-tap filter.
  • the encoding apparatus converts the interpolation filter of the current block into an 8-tap filter .
  • the encoding device can derive the transform coefficients of the template of the current block and the transform coefficients of the template of the reference block by transforming the template of the current block and the template of the reference block, It is possible to derive a first distance between a transformation coefficient derived first while moving zigzag from the lower right end to the upper left end of the template of the current block of the template and a lower right position of the template of the current block, It is possible to derive the second distance between the transform coefficient derived first while moving in zigzag from the lower right end to the upper left end of the template of the reference block among the transform coefficients of the template of the reference block and the lower right position of the template of the reference block .
  • the encoding apparatus can determine the interpolation filter of the current block based on the first distance of the template of the current block and the second distance of the template of the reference block. For example, if the first distance of the template of the current block is greater than the second distance of the template of the reference block (i.e., the first distance of the template of the current block minus the second distance of the template of the reference block Value is larger than a specific value), the encoding apparatus can determine the interpolation filter of the current block as a 12-tap filter.
  • the encoding apparatus can determine the interpolation filter of the current block as a 4-tap filter. If the first distance of the template of the current block is similar to the second distance of the template of the reference block (i.e., a value obtained by subtracting the second distance of the template of the reference block from the first distance of the template of the current block The difference between the first distance of the template of the current block and the second distance of the template of the reference block is included in the specific range), the encoding apparatus sets the interpolation filter of the current block to 8 Tap filter.
  • the encoding apparatus may determine an interpolation filter of the current block based on the reference block of the current block.
  • the encoding apparatus can set the first threshold value and the second threshold value, and can generate information on the first threshold value and information on the second threshold value.
  • the information on the first threshold value may be transmitted through a sequence parameter set (SPS) or a picture parameter set (PPS).
  • the information on the first threshold value may be transmitted on a slice or block basis.
  • the information on the second threshold value may be transmitted through a sequence parameter set (SPS) or a picture parameter set (PPS).
  • the information on the second threshold value may be transmitted on a slice or block basis.
  • the information on the first threshold value and the information on the second threshold value may be included in the inter prediction information of the current block.
  • the first threshold value may be derived as a predetermined value.
  • the second threshold value may be derived as a predetermined value.
  • the encoding apparatus may determine an interpolation filter of the current block based on the frequency characteristic of the reference block and the first threshold value and the second threshold value.
  • the encoding apparatus can determine the interpolation filter of the current block as a 12-tap filter. If the high frequency component of the reference block is larger than the second threshold value, the encoding apparatus may determine the interpolation filter of the current block as a 4-tap filter. If the high frequency component of the reference block is greater than or equal to the first threshold value and less than or equal to the second threshold value, the encoding apparatus may determine the interpolation filter of the current block as an 8-tap filter.
  • the variance value of the reference block may be used for comparison of the high-frequency components of the reference block.
  • the encoding apparatus may derive the variance value of the template of the reference block.
  • the encoding apparatus may determine an interpolation filter of the current block based on the variance value of the reference block. For example, when the variance value of the reference block is smaller than the first threshold value, the encoding apparatus can determine the interpolation filter of the current block as a 12-tap filter. If the variance value of the reference block is larger than the second threshold value, the encoding apparatus can determine the interpolation filter of the current block as a 4-tap filter. If the variance value of the reference block is greater than or equal to the first threshold value and less than or equal to the second threshold value, the encoding apparatus can determine the interpolation filter of the current block as an 8-tap filter.
  • the encoding apparatus may derive a first value by applying the Laplacian operator to the reference block. That is, the encoding device may derive a first value of the reference block based on the Laplacian operator. Where the first value may be referred to as a Laplacian result value.
  • the encoding apparatus can determine the interpolation filter of the current block based on the first value of the reference block. For example, if the first value of the template of the reference block is smaller than the first threshold value, the encoding apparatus can determine the interpolation filter of the current block as a 12-tap filter. If the first value of the reference block is larger than the second threshold value, the encoding apparatus may determine the interpolation filter of the current block as a 4-tap filter. In addition, when the first value of the reference block is equal to or greater than the first threshold value and equal to or less than the second threshold value, the encoding apparatus can determine the interpolation filter of the current block as an 8-tap filter.
  • the encoding apparatus may derive the first value by applying the Sobel operator to the reference block. That is, the encoding apparatus can derive the first value of the reference block based on the Sobel operator. Wherein the first value may be referred to as a Sobel result value.
  • the encoding apparatus can determine the interpolation filter of the current block based on the first value of the reference block. For example, if the first value of the template of the reference block is smaller than the first threshold value, the encoding apparatus can determine the interpolation filter of the current block as a 12-tap filter. If the first value of the reference block is larger than the second threshold value, the encoding apparatus may determine the interpolation filter of the current block as a 4-tap filter. In addition, when the first value of the reference block is equal to or greater than the first threshold value and equal to or less than the second threshold value, the encoding apparatus can determine the interpolation filter of the current block as an 8-tap filter.
  • the encoding apparatus may convert the reference block to derive the transform coefficients of the reference block, and may calculate a first value, which is the sum of the absolute values of the transform coefficients included in the specific region among the transform coefficients of the reference block, .
  • the specific region may represent an arbitrary region in the frequency domain.
  • the encoding apparatus can determine the interpolation filter of the current block based on the first value of the reference block. For example, if the first value of the template of the reference block is smaller than the first threshold value, the encoding apparatus can determine the interpolation filter of the current block as a 12-tap filter.
  • the encoding apparatus may determine the interpolation filter of the current block as a 4-tap filter.
  • the encoding apparatus can determine the interpolation filter of the current block as an 8-tap filter.
  • the encoding apparatus can derive the transform coefficients of the reference block by transforming the reference block, and the transform coefficients of the transform coefficients of the reference block, which are first derived while moving in the zigzag from the lower right end to the upper left end of the reference block, The first distance between the transform coefficient and the lower right position of the reference block can be derived.
  • the encoding apparatus can determine the interpolation filter of the current block based on the first distance of the reference block. For example, if the first distance of the reference block is smaller than the first threshold, the encoding apparatus can determine the interpolation filter of the current block as a 12-tap filter.
  • the encoding apparatus may determine the interpolation filter of the current block as a 4-tap filter. In addition, if the first distance of the reference block is equal to or greater than the first threshold value and equal to or less than the second threshold value, the encoding apparatus can determine the interpolation filter of the current block as an 8-tap filter.
  • the encoding apparatus can determine the interpolation filter of the current block based on the reference picture of the current block.
  • the interpolation filter of the current block may be determined based on the frequency characteristics of the reference picture and the first threshold value and the second threshold value of the current block.
  • the encoding apparatus may generate an interpolation filter index indicating an interpolation filter of the current block.
  • the interpolation filter index may indicate one of the plurality of interpolation filters.
  • the interpolation filter index may be transmitted on a block-by-block basis or may be transmitted via a sequence parameter set (SPS), a picture parameter set (PPS), or a slice header.
  • SPS sequence parameter set
  • PPS picture parameter set
  • the interpolation filter index may be included in inter prediction information of the current block.
  • the interpolation filter index may indicate an interpolation filter index for the L0.
  • the interpolation filter index may indicate an interpolation filter index for the L1.
  • the inter prediction information may include an interpolation filter index for the L0 and L1.
  • the L0 prediction and the L1 prediction of the current block may be performed based on the interpolation filter indicated by the interpolation filter index.
  • the inter prediction information may include an interpolation filter index for L0 and an interpolation filter index for L1.
  • the L0 prediction of the current block may be performed based on an interpolation filter indicated by the interpolation filter index for L0, and the L1 prediction is performed based on the interpolation filter indicated by the interpolation filter index for L1 .
  • the interpolation filter index for L0 may be referred to as an L0 interpolation filter index
  • the interpolation filter index for L1 may be referred to as an L1 interpolation filter index.
  • the interpolation filter index for L0 and the interpolation filter index for L1 may be included in the inter prediction information of the current block.
  • the encoding apparatus performs inter prediction of the current block based on the interpolation filter and the motion information (S1220).
  • the encoding apparatus may derive a reference block intra-reference block based on the motion information.
  • the motion information may include a motion vector and a reference picture index.
  • the encoding apparatus can derive a reference picture indicated by the reference picture index from the reference pictures in the reference picture list as a reference picture of the current block and convert the block indicated by the motion vector in the reference picture into a reference block of the current block . If the reference block is derived, integer samples included in the reference block and fractional samples based on the interpolation filter may be derived. That is, the integer samples may be interpolated based on the filter coefficients of the interpolation filter to derive the fractional samples.
  • the encoding device may apply the interpolation filter in the horizontal and vertical directions to the integer samples to generate the fractional samples.
  • the interpolation filter of the current block is a 4-tap filter and the interpolation filter is applied in the horizontal direction, two integer samples on the left side and two integer samples on the left side based on the generated fraction sample
  • the interpolation filter may be applied to generate the fractional samples.
  • the interpolation filter of the current block is a 4-tap filter and the interpolation filter is applied in the vertical direction
  • the interpolation filter is applied to the 2 upper integer samples and the lower 2 integer samples on the basis of the generated fraction sample
  • a filter may be applied to generate the fractional samples.
  • the interpolation filter of the current block is an 8-tap filter and the interpolation filter is applied in the horizontal direction, four integer samples on the left side and four integer samples on the right side based on the generated fraction sample
  • the interpolation filter may be applied to generate the fractional samples.
  • the interpolation filter of the current block is an 8-tap filter and the interpolation filter is applied in the vertical direction, the interpolation filter is applied to the 4 upper integer samples and the lower 4 integer samples on the basis of the generated fraction sample, A filter may be applied to generate the fractional samples.
  • the interpolation filter of the current block when the interpolation filter of the current block is a 12-tap filter and the interpolation filter is applied in the horizontal direction, six integer samples on the left side and six integer samples on the right side based on the generated fraction sample The interpolation filter may be applied to generate the fractional samples. If the interpolation filter of the current block is a 12-tap filter and the interpolation filter is applied in the vertical direction, the interpolation filter is applied to the upper six integer samples and the lower six integer samples based on the generated fraction sample, A filter may be applied to generate the fractional samples.
  • the encoding device may generate a predicted sample of the current block based on the fractional samples.
  • the encoding apparatus encodes the inter prediction information of the current block and outputs the inter prediction information (S1230).
  • the encoding device may generate a merge index indicating a merge candidate selected to derive the motion information of the current block.
  • the encoding apparatus can encode and output the merge index.
  • the merge index may be included in the inter prediction information.
  • the encoding apparatus can generate an MVP flag indicating one of the candidates of the MVP candidate list, and can encode and output the MVP flag.
  • the inter prediction information may include the MVP flag.
  • the inter prediction information may include a reference picture index.
  • the encoding apparatus can generate a reference picture index indicating a reference picture of the current block, and can encode and output the reference picture index.
  • the inter prediction information may include the reference picture index.
  • the information on the inter prediction may include a motion vector difference (MVD) of the current block.
  • MVP adaptive motion vector prediction
  • the inter prediction information may include information on L0 prediction and / or information on L1 prediction.
  • the motion information for the L0 prediction may be referred to as L0 motion information, and the motion information for the L1 prediction may be referred to as L1 motion information.
  • inter prediction In performing inter prediction on a current block, inter prediction may be referred to as LO prediction when inter prediction is performed based on L0 motion information, and may be referred to as L1 prediction when inter prediction is performed based on L1 motion information. Prediction may be referred to as bi-prediction when inter prediction is performed based on L0 motion information and L1 motion information.
  • the MVP flag When the L0 prediction is performed on the current block, the MVP flag may indicate the MVPL0 flag, and the reference picture index may indicate the L0 reference picture index.
  • the MVP flag when L1 prediction is performed on the current block, the MVP flag may indicate the MVPL1 flag, and the reference picture index may indicate the L1 reference picture index.
  • the MVP flag when the current block is predicted to be paired, the MVP flag may include an MVPL0 flag and an MVPL1 flag, and the reference picture index may include a L0 reference picture index and an L1 reference picture index.
  • the inter prediction information may include an interpolation filter index of the current block.
  • the interpolation filter index may point to one of the plurality of interpolation filters.
  • the interpolation filter index may be transmitted on a block-by-block basis or may be transmitted via a sequence parameter set (SPS), a picture parameter set (PPS), or a slice header.
  • SPS sequence parameter set
  • PPS picture parameter set
  • the interpolation filter index may indicate an interpolation filter index for the L0.
  • the interpolation filter index may indicate an interpolation filter index for the L1.
  • the inter prediction information may include an interpolation filter index for the L0 and L1.
  • the L0 prediction and the L1 prediction of the current block may be performed based on the interpolation filter indicated by the interpolation filter index.
  • the inter prediction information may include an interpolation filter index for L0 and an interpolation filter index for L1.
  • the L0 prediction of the current block may be performed based on an interpolation filter indicated by the interpolation filter index for L0
  • the L1 prediction is performed based on the interpolation filter indicated by the interpolation filter index for L1 .
  • the interpolation filter index for L0 may be referred to as an L0 interpolation filter index
  • the interpolation filter index for L1 may be referred to as an L1 interpolation filter index.
  • the inter prediction information may include information on a first threshold value and information on a second threshold value.
  • the information on the first threshold value may be transmitted through a sequence parameter set (SPS) or a picture parameter set (PPS).
  • the information on the first threshold value may be transmitted on a slice or block basis.
  • the information on the second threshold value may be transmitted through a sequence parameter set (SPS) or a picture parameter set (PPS).
  • the information on the second threshold value may be transmitted on a slice or block basis.
  • FIG. 13 schematically shows a video decoding method by a decoding apparatus according to the present invention.
  • the method disclosed in Fig. 13 can be performed by the decoding apparatus disclosed in Fig. Specifically, for example, S1300 of FIG. 13 may be performed by the entropy decoding unit of the decoding apparatus, and S1310 to S1330 may be performed by the predicting unit of the decoding apparatus.
  • the decoding apparatus acquires the inter prediction information of the current block through the bit stream (S1300).
  • the current block may be inter-predicted or intra-predicted.
  • the decoding apparatus can obtain the inter prediction information of the current block through the bit stream.
  • the decoding apparatus can generate a merge candidate list based on the neighboring blocks of the current block, and obtain the merge index through the bitstream.
  • the merge index may indicate a candidate included in the merge candidate list, and the inter prediction information may include the merge index.
  • the decoding apparatus uses a motion vector of the reconstructed spatial neighboring block and / or a motion vector corresponding to a Col block that is a temporal neighboring block, A motion vector predictor (MVP) candidate list can be generated. That is, the motion vector of the reconstructed spatial neighboring block and / or the motion vector corresponding to the Col block which is the temporal neighboring block can be used as the MVP candidate.
  • the spatial neighboring block may represent a neighboring block of the current block in the current picture
  • the temporal neighboring block may represent a block corresponding to the current block in a collocated picture.
  • the decoding apparatus can obtain the MVP flag through the bit stream.
  • the MVP flag may indicate a candidate included in the MVP candidate list, and the inter prediction information may include the MVP flag.
  • the inter prediction information may include a reference picture index.
  • the reference picture index may indicate a reference picture of the current block.
  • the information on the inter prediction may include a motion vector difference (MVD) of the current block.
  • the inter prediction information may include information on L0 prediction and / or information on L1 prediction.
  • the motion information for the L0 prediction may be referred to as L0 motion information, and the motion information for the L1 prediction may be referred to as L1 motion information.
  • inter prediction In performing inter prediction on a current block, inter prediction may be referred to as LO prediction when inter prediction is performed based on L0 motion information, and may be referred to as L1 prediction when inter prediction is performed based on L1 motion information. Prediction may be referred to as bi-prediction when inter prediction is performed based on L0 motion information and L1 motion information.
  • the MVP flag When the L0 prediction is performed on the current block, the MVP flag may indicate the MVPL0 flag, and the reference picture index may indicate the L0 reference picture index.
  • the MVP flag when L1 prediction is performed on the current block, the MVP flag may indicate the MVPL1 flag, and the reference picture index may indicate the L1 reference picture index.
  • the MVP flag when the current block is predicted to be paired, the MVP flag may include an MVPL0 flag and an MVPL1 flag, and the reference picture index may include a L0 reference picture index and an L1 reference picture index.
  • the inter prediction information may include an interpolation filter index of the current block.
  • the interpolation filter index may point to one of the plurality of interpolation filters.
  • the interpolation filter index may be signaled on a block-by-block basis or may be transmitted via a sequence parameter set (SPS), a picture parameter set (PPS), or a slice header.
  • SPS sequence parameter set
  • PPS picture parameter set
  • the interpolation filter index may indicate an interpolation filter index for the L0.
  • the interpolation filter index may indicate an interpolation filter index for the L1.
  • the inter prediction information may include an interpolation filter index for the L0 and L1.
  • the L0 prediction and the L1 prediction of the current block may be performed based on the interpolation filter indicated by the interpolation filter index.
  • the inter prediction information may include an interpolation filter index for L0 and an interpolation filter index for L1.
  • the L0 prediction of the current block may be performed based on an interpolation filter indicated by the interpolation filter index for L0
  • the L1 prediction is performed based on the interpolation filter indicated by the interpolation filter index for L1 .
  • the interpolation filter index for L0 may be referred to as an L0 interpolation filter index
  • the interpolation filter index for L1 may be referred to as an L1 interpolation filter index.
  • the inter prediction information may include information on a first threshold value and information on a second threshold value.
  • the information on the first threshold value may be transmitted through a sequence parameter set (SPS) or a picture parameter set (PPS).
  • the information on the first threshold value may be transmitted on a slice or block basis.
  • the information on the second threshold value may be transmitted through a sequence parameter set (SPS) or a picture parameter set (PPS).
  • the information on the second threshold value may be transmitted on a slice or block basis.
  • the decoding apparatus derives motion information of the current block based on the inter prediction information (S1310).
  • the motion information may include a motion vector of the current block and a reference picture.
  • the decoding apparatus may derive motion information of the candidate pointed to by the merge index among the candidates included in the merge candidate list as motion information of the current block.
  • the candidate motion vector indicated by the merge index may be derived as a motion vector of the current block
  • the reference picture index of the candidate indicated by the merge index may be derived as a reference picture index of the current block.
  • the reference picture indicated by the reference picture index may be derived as a reference picture of the current block.
  • the candidate indicated by the merge index may include L0 motion information and / or L1 motion information of a neighboring block of the current block.
  • the L0 motion information of the candidate may be derived as the L0 motion information of the current block and the L1 motion information of the selected merge candidate may be derived as the L1 motion information of the current block.
  • the L0 motion information of the current block includes an L0 reference picture index and a motion vector L0 (Motion Vector L0, MVL0) indicating an L0 reference picture included in a reference picture list L0 (List 0, L0) for the current block
  • the L1 motion information of the current block may include an L1 reference picture index and an MVL1 indicating an L1 reference picture contained in a reference picture list L0 (List 1, L1) for the current block.
  • the decoding apparatus when the AMVP mode is applied to the current block, the decoding apparatus generates an MVP flag indicating one of the MVP candidates included in the generated MVP candidate list and a motion vector MVP of the neighboring block indicated by the MVP flag (MVD) between the motion vector of the current block and the motion vector of the current block.
  • the MVP flag and the MVD may be included in the information on the inter prediction.
  • the decoding apparatus can derive the motion vector of the current block based on the motion vector (MVP candidate) of the neighboring block indicated by the MVP flag and the MVD.
  • the motion information may include a motion vector and a reference picture index.
  • the motion information may be bi-prediction motion information, or may be uni-prediction motion information.
  • the bi-predictive motion information may include an L0 reference picture index, an L0 motion vector, an L1 reference picture index, and an L1 motion vector
  • the short motion prediction information may include an L0 reference picture index and a L0 motion vector
  • An L1 reference picture index and an L1 motion vector An L1 reference picture index and an L1 motion vector.
  • L0 denotes a reference picture list L0 (List 0)
  • L1 denotes a reference picture list L1 (List 1).
  • the decoding apparatus derives an interpolation filter of the current block among the plurality of interpolation filters (S1320).
  • the decoding apparatus may derive an interpolation filter of the current block among the plurality of interpolation filters.
  • the plurality of interpolation filters may include a 4-tap filter, an 8-tap filter, and a 12-tap filter.
  • the 4-tap filter may represent an interpolation filter that performs interpolation based on 4 filter coefficients
  • the 8-tap filter may represent an interpolation filter that performs interpolation based on 8 filter coefficients
  • a filter may represent an interpolation filter that performs interpolation based on twelve filter coefficients.
  • the decoding apparatus may derive an interpolation filter of the current block based on the interpolation filter index. For example, if the interpolation filter index indicates a 4-tap filter, the interpolation filter of the current block may be derived as a 4-tap filter. Also, if the interpolation filter index indicates an 8-tap filter, the interpolation filter of the current block may be derived as an 8-tap filter. Also, if the interpolation filter index indicates a 12-tap filter, the interpolation filter of the current block may be derived as a 12-tap filter. Meanwhile, the number of bits of the interpolation filter index may be variable.
  • the interpolation filter index may indicate the 8-tap filter, and if the value of the interpolation filter index is 10, And if the value of the interpolation filter index is 11, the interpolation filter index may indicate the 4-tap filter.
  • the inter prediction information may include an L0 interpolation filter index and an L1 interpolation filter index.
  • the decoding apparatus can derive an interpolation filter for the L0 prediction of the current block based on the L0 interpolation filter index, derive an interpolation filter for the L1 prediction of the current block based on the L1 interpolation filter index can do.
  • the decoding apparatus may derive the interpolation filter index of the candidate pointed by the merge index among the candidates included in the merge candidate list as the interpolation filter index of the current block.
  • the decoding apparatus can derive the interpolation filter of the current block based on the interpolation filter index. That is, the decoding apparatus can derive the interpolation filter indicated by the derived interpolation filter index to the interpolation filter of the current block.
  • the interpolation filter of the current block may be derived by an interpolation filter indicated by a candidate interpolation filter index indicated by the merge index among the plurality of interpolation filters.
  • the decoding apparatus may derive an interpolation filter used in the candidate pointed by the merge index among the candidates included in the merge candidate list as the interpolation filter of the current block.
  • the decoding apparatus may derive the interpolation filter of the current block based on the template of the current block and the template of the reference block. Specifically, the decoding apparatus can derive the interpolation filter of the current block by comparing the frequency characteristics of the template of the current block and the template of the reference block.
  • the reference block may be derived based on motion information of the current block. That is, the reference block may represent an intra-reference block reconstruction block indicated by the motion information.
  • the decoding apparatus may derive a template of the current block based on surrounding samples of the current block.
  • the template of the current block may be a specific region including surrounding samples of the current block.
  • the template may be a specific region including left neighboring samples, upper left neighboring samples, and upper neighboring samples of the current block, or may include the left neighboring samples and the upper neighboring samples of the current block Lt; / RTI >
  • the template may be a specific region including the upper neighbor samples of the current block, or the template may be a specific region including the left neighbor samples of the current block.
  • the decoding apparatus can derive the template of the reference block based on the neighboring samples of the reference block, and can derive the template of the reference block in the same form as the template of the current block.
  • the template of the current block when the template of the current block is a specific region including left neighboring samples of the current block, upper left neighboring sample, and upper neighboring samples, the template of the reference block may be a left neighbor sample The upper left side surrounding sample, and the upper nearby sample.
  • the template of the reference block may include the left neighboring samples of the reference block, Lt; / RTI > can be derived to a particular region containing surrounding samples.
  • the template of the reference block when the template of the current block is a specific region including the left neighbor samples of the current block, the template of the reference block may be derived as a specific region including the left neighbor samples of the reference block .
  • the template of the reference block when the template of the current block is a specific region including the upper neighbor samples of the current block, the template of the reference block may be derived as a specific region including the upper neighbor samples of the reference block .
  • the decoding apparatus can derive the interpolation filter of the current block by comparing the frequency characteristic of the template of the current block with the template of the reference block.
  • the decoding apparatus may derive the interpolation filter of the current block by a 12-tap filter.
  • the decoding apparatus may derive the interpolation filter of the current block as a 4-tap filter.
  • the decoding apparatus may derive the interpolation filter of the current block by an 8-tap filter.
  • the variance value of each template may be used to compare high-frequency components of the template of the current block with the template of the reference block.
  • the decoding apparatus can derive the variance value of the template of the current block and derive the variance value of the template of the reference block .
  • the variance value of the template of the current block may represent a variance value of sample values of neighboring samples included in the template of the current block
  • the variance value of the template of the reference block may be represented as a restoration value Can represent the variance of the sample values of the samples.
  • the decoding apparatus may derive an interpolation filter of the current block based on a variance value of the template of the current block and a variance value of the template of the reference block.
  • the decoding apparatus can derive the interpolation filter of the current block by a 12-tap filter.
  • the variance value of the template of the current block is smaller than the variance value of the reference block (i.e., when the variance value of the template of the reference block minus the variance value of the current block is greater than a specific value)
  • the apparatus can derive the interpolation filter of the current block by a 4-tap filter.
  • the decoding apparatus can derive the interpolation filter of the current block by an 8-tap filter.
  • operations such as laplacian operation or Sobel operation may be used to compare high-frequency components of the template of the current block and the template of the reference block.
  • the decoding apparatus may derive a first value by applying a Laplacian operator to the template of the current block, A second value can be derived by applying a Laplacian operator. That is, the decoding apparatus can derive the first value of the template of the current block based on the Laplacian operator, and derive the second value of the template of the reference block based on the Laplacian operator. In this case, the decoding apparatus may derive the interpolation filter of the current block based on the first value of the template of the current block and the second value of the template of the reference block.
  • the decoding apparatus can derive the interpolation filter of the current block by a 12-tap filter. If the first value of the template of the current block is smaller than the second value of the reference block (i.e., the value obtained by subtracting the first value of the current block from the second value of the template of the reference block is larger than the specific value , The decoding apparatus can derive the interpolation filter of the current block by a 4-tap filter.
  • the decoding apparatus can derive the interpolation filter of the current block by an 8-tap filter have.
  • the decoding apparatus may derive the first value by applying the Sobel operator to the template of the current block, and derive the second value by applying the Sobel operator to the template of the reference block. That is, the decoding apparatus can derive the first value of the template of the current block based on the Sobel operator, and derive the second value of the template of the reference block based on the Sobel operator. In this case, the decoding apparatus may derive the interpolation filter of the current block based on the first value of the template of the current block and the second value of the template of the reference block.
  • the decoding apparatus can derive the interpolation filter of the current block by a 12-tap filter. If the first value of the template of the current block is smaller than the second value of the reference block (i.e., the value obtained by subtracting the first value of the current block from the second value of the template of the reference block is larger than the specific value , The decoding apparatus can derive the interpolation filter of the current block by a 4-tap filter.
  • the decoding apparatus can derive the interpolation filter of the current block by an 8-tap filter have.
  • a method of confirming the distribution of the high-frequency components using frequency conversion may be used.
  • the decoding apparatus may convert the template of the current block and the template of the reference block to derive the transform coefficients of the template of the current block and the transform coefficients of the template of the reference block,
  • the interpolation filter of the current block can be derived based on the transform coefficients of the current block and the transform coefficients of the template of the reference block.
  • the decoding apparatus includes a first value, which is a sum of absolute values of the transform coefficients included in the specific region among the transform coefficients of the template of the current block, and a transform coefficient, which is included in the specific region, A second value that is the sum of the absolute values of the two values.
  • the specific region may represent an arbitrary region in the frequency domain.
  • the decoding apparatus may derive the interpolation filter of the current block based on the first value of the template of the current block and the second value of the template of the reference block. For example, when the first value of the template of the current block is larger than the second value of the template of the reference block (i.e., the first value of the template of the current block minus the second value of the template of the reference block Value is larger than a specific value), the decoding apparatus can derive the interpolation filter of the current block by a 12-tap filter.
  • the decoding apparatus can derive the interpolation filter of the current block by a 4-tap filter.
  • the decoding apparatus converts the interpolation filter of the current block into an 8-tap filter . ≪ / RTI >
  • the decoding apparatus may derive the transform coefficients of the template of the current block and the transform coefficients of the template of the reference block by transforming the template of the current block and the template of the reference block, It is possible to derive a first distance between a transformation coefficient derived first while moving zigzag from the lower right end to the upper left end of the template of the current block of the template and a lower right position of the template of the current block, It is possible to derive the second distance between the transform coefficient derived first while moving in zigzag from the lower right end to the upper left end of the template of the reference block among the transform coefficients of the template of the reference block and the lower right position of the template of the reference block .
  • the decoding apparatus may derive the interpolation filter of the current block based on the first distance of the template of the current block and the second distance of the template of the reference block. For example, if the first distance of the template of the current block is greater than the second distance of the template of the reference block (i.e., the first distance of the template of the current block minus the second distance of the template of the reference block Value is larger than a specific value), the decoding apparatus can derive the interpolation filter of the current block by a 12-tap filter.
  • the decoding apparatus can derive the interpolation filter of the current block by a 4-tap filter. If the first distance of the template of the current block is similar to the second distance of the template of the reference block (i.e., a value obtained by subtracting the second distance of the template of the reference block from the first distance of the template of the current block The difference between the first distance of the template of the current block and the second distance of the template of the reference block is included in the specific range), the decoding apparatus sets the interpolation filter of the current block to 8 Tap filter.
  • the decoding apparatus may derive the interpolation filter of the current block based on the reference block of the current block.
  • the inter prediction information may include information on a first threshold value and information on a second threshold value.
  • the decoding apparatus may derive a first threshold value of the current block based on the information on the first threshold value and derive a first threshold value of the current block based on the information on the second threshold value .
  • the first threshold value may be derived as a predetermined value.
  • the second threshold value may be derived as a predetermined value.
  • the decoding apparatus may derive an interpolation filter of the current block based on the reference block, the first threshold value, and the second threshold value. That is, the decoding apparatus may derive the interpolation filter of the current block based on the frequency characteristic of the reference block, the first threshold value, and the second threshold value.
  • the decoding apparatus may derive the interpolation filter of the current block as a 12-tap filter. If the high frequency component of the reference block is larger than the second threshold value, the decoding apparatus may derive the interpolation filter of the current block as a 4-tap filter. Also, when the high-frequency component of the reference block is equal to or higher than the first threshold value and equal to or lower than the second threshold value, the decoding apparatus may derive the interpolation filter of the current block as an 8-tap filter.
  • the variance value of the reference block may be used for comparison of the high-frequency components of the reference block.
  • the decoding apparatus may derive the variance value of the template of the reference block.
  • the decoding apparatus may derive an interpolation filter of the current block based on the variance value of the reference block. For example, when the variance value of the reference block is smaller than the first threshold value, the decoding apparatus may derive the interpolation filter of the current block as a 12-tap filter. Also, when the variance value of the reference block is larger than the second threshold value, the decoding apparatus may derive the interpolation filter of the current block as a 4-tap filter. Also, when the variance value of the reference block is equal to or greater than the first threshold value and equal to or less than the second threshold value, the decoding apparatus may derive the interpolation filter of the current block as an 8-tap filter.
  • the decoding apparatus may derive a first value by applying the Laplacian operator to the reference block. That is, the decoding apparatus can derive the first value of the reference block based on the Laplacian operator. Where the first value may be referred to as a Laplacian result value.
  • the decoding apparatus may derive the interpolation filter of the current block based on the first value of the reference block. For example, if the first value of the template of the reference block is smaller than the first threshold value, the decoding apparatus may derive the interpolation filter of the current block as a 12-tap filter. If the first value of the reference block is larger than the second threshold value, the decoding apparatus may derive the interpolation filter of the current block as a 4-tap filter. Also, when the first value of the reference block is equal to or greater than the first threshold value and equal to or less than the second threshold value, the decoding apparatus may derive the interpolation filter of the current block as an 8-tap filter.
  • the decoding apparatus may derive the first value by applying the Sobel operator to the reference block. That is, the decoding apparatus can derive the first value of the reference block based on the Sobel operator. Wherein the first value may be referred to as a Sobel result value.
  • the decoding apparatus may derive the interpolation filter of the current block based on the first value of the reference block. For example, if the first value of the template of the reference block is smaller than the first threshold value, the decoding apparatus may derive the interpolation filter of the current block as a 12-tap filter. If the first value of the reference block is larger than the second threshold value, the decoding apparatus may derive the interpolation filter of the current block as a 4-tap filter. Also, when the first value of the reference block is equal to or greater than the first threshold value and equal to or less than the second threshold value, the decoding apparatus may derive the interpolation filter of the current block as an 8-tap filter.
  • the decoding apparatus may derive transform coefficients of the reference block by transforming the reference block, and a first value, which is the sum of the absolute values of the transform coefficients included in the specific region among the transform coefficients of the reference block, .
  • the specific region may represent an arbitrary region in the frequency domain.
  • the decoding apparatus may derive the interpolation filter of the current block based on the first value of the reference block. For example, if the first value of the template of the reference block is smaller than the first threshold value, the decoding apparatus may derive the interpolation filter of the current block as a 12-tap filter. If the first value of the reference block is larger than the second threshold value, the decoding apparatus may derive the interpolation filter of the current block as a 4-tap filter. Also, when the first value of the reference block is equal to or greater than the first threshold value and equal to or less than the second threshold value, the decoding apparatus may derive the interpolation filter of the current block as an 8-tap filter.
  • the decoding apparatus may derive the transform coefficients of the reference block by transforming the reference block, and may further include a transform unit for transforming the transform coefficients of the reference block, which are first derived while moving in the zigzag from the lower right end to the upper left end of the reference block, The first distance between the transform coefficient and the lower right position of the reference block can be derived.
  • the decoding apparatus may derive the interpolation filter of the current block based on the first distance of the reference block. For example, when the first distance of the reference block is smaller than the first threshold value, the decoding apparatus may derive the interpolation filter of the current block as a 12-tap filter.
  • the decoding apparatus may derive the interpolation filter of the current block as a 4-tap filter. Also, when the first distance of the reference block is equal to or greater than the first threshold value and equal to or less than the second threshold value, the decoding apparatus may derive the interpolation filter of the current block as an 8-tap filter.
  • the decoding apparatus may derive the interpolation filter of the current block based on the reference picture of the current block.
  • the interpolation filter of the current block may be derived based on the frequency characteristics of the reference picture and the first threshold value and the second threshold value of the current block.
  • the decoding apparatus performs inter-prediction of the current block based on the interpolation filter and the motion information (S1330).
  • the decoding apparatus may derive a reference block reference block based on the motion information.
  • the motion information may include a motion vector and a reference picture index.
  • the decoding apparatus can derive a reference picture indicated by the reference picture index of the reference pictures in the reference picture list as a reference picture of the current block, and a block indicated by the motion vector in the reference picture as a reference block of the current block . If the reference block is derived, integer samples included in the reference block and fractional samples based on the interpolation filter may be derived. That is, the integer samples may be interpolated based on the filter coefficients of the interpolation filter to derive the fractional samples.
  • the decoding apparatus may apply the interpolation filter in the horizontal and vertical directions to the integer samples to generate the fractional samples.
  • the interpolation filter of the current block is a 4-tap filter and the interpolation filter is applied in the horizontal direction, two integer samples on the left side and two integer samples on the left side based on the generated fraction sample
  • the interpolation filter may be applied to generate the fractional samples.
  • the interpolation filter of the current block is a 4-tap filter and the interpolation filter is applied in the vertical direction
  • the interpolation filter is applied to the 2 upper integer samples and the lower 2 integer samples on the basis of the generated fraction sample
  • a filter may be applied to generate the fractional samples.
  • the interpolation filter of the current block is an 8-tap filter and the interpolation filter is applied in the horizontal direction, four integer samples on the left side and four integer samples on the right side based on the generated fraction sample
  • the interpolation filter may be applied to generate the fractional samples.
  • the interpolation filter of the current block is an 8-tap filter and the interpolation filter is applied in the vertical direction, the interpolation filter is applied to the 4 upper integer samples and the lower 4 integer samples on the basis of the generated fraction sample, A filter may be applied to generate the fractional samples.
  • the interpolation filter of the current block when the interpolation filter of the current block is a 12-tap filter and the interpolation filter is applied in the horizontal direction, six integer samples on the left side and six integer samples on the right side based on the generated fraction sample The interpolation filter may be applied to generate the fractional samples. If the interpolation filter of the current block is a 12-tap filter and the interpolation filter is applied in the vertical direction, the interpolation filter is applied to the upper six integer samples and the lower six integer samples based on the generated fraction sample, A filter may be applied to generate the fractional samples.
  • the decoding device may generate a predicted sample of the current block based on the fractional samples.
  • the decoding apparatus may use the predicted sample as a reconstructed sample immediately according to a prediction mode, or add a residual sample to the predicted sample to generate a reconstructed sample.
  • the decoding apparatus may receive information on a residual from the bitstream, if there is a residual sample for the current block, for the current block.
  • the information on the residual may include a transform coefficient relating to the residual sample.
  • the decoding apparatus may derive the residual sample (or residual sample array) for the current block based on the residual information.
  • the decoding apparatus may generate a reconstructed sample based on the prediction sample and the residual sample, and may derive a reconstructed block or a reconstructed picture based on the reconstructed sample.
  • an in-loop filtering procedure such as deblocking filtering and / or SAO procedure to the restored picture in order to improve subjective / objective picture quality as necessary.
  • an interpolation filter can be determined according to characteristics of an input image or a current block, and inter prediction of the current block can be performed based on a determined interpolation filter.
  • prediction accuracy of a current block can be improved , Thereby improving the overall coding efficiency.
  • an interpolation filter of a current block can be derived from a decoding apparatus without transmitting information on an interpolation filter, thereby reducing the amount of bits used for an interpolation filter of the current block, Can be improved.
  • the above-described method according to the present invention can be implemented in software, and the encoding apparatus and / or decoding apparatus according to the present invention can perform image processing of, for example, a TV, a computer, a smart phone, a set- Device.
  • the above-described method may be implemented by a module (a process, a function, and the like) that performs the functions described above.
  • the module is stored in memory and can be executed by the processor.
  • the memory may be internal or external to the processor and may be coupled to the processor by any of a variety of well known means.
  • the processor may comprise an application-specific integrated circuit (ASIC), other chipset, logic circuitry and / or a data processing device.
  • the memory may include read-only memory (ROM), random access memory (RAM), flash memory, memory cards, storage media, and / or other storage devices.

Abstract

본 발명에 따른 디코딩 장치에 의하여 수행되는 영상 디코딩 방법은 비트스트림을 통하여 현재 블록의 인터 예측 정보를 획득하는 단계, 상기 인터 예측 정보를 기반으로 상기 현재 블록의 움직임 정보를 도출하는 단계, 복수의 보간 필터들 중 상기 현재 블록의 보간 필터를 도출하는 단계, 및 상기 보간 필터 및 상기 움직임 정보를 기반으로 상기 현재 블록의 인터 예측을 수행하는 단계를 포함하되, 상기 복수의 보간 필터들은 4탭 필터(4-tap filter), 8탭 필터 및 12탭 필터를 포함하는 것을 특징으로 한다.

Description

영상 코딩 시스템에서 현재 블록의 보간 필터에 기반한 인터 예측 방법 및 장치
본 발명은 영상 코딩 기술에 관한 것으로서 보다 상세하게는 영상 코딩 시스템에서 현재 블록의 선택된 보간 필터에 기반한 인터 예측 방법 및 장치에 관한 것이다.
최근 HD(High Definition) 영상 및 UHD(Ultra High Definition) 영상과 같은 고해상도, 고품질의 영상에 대한 수요가 다양한 분야에서 증가하고 있다. 영상 데이터가 고해상도, 고품질이 될수록 기존의 영상 데이터에 비해 상대적으로 전송되는 정보량 또는 비트량이 증가하기 때문에 기존의 유무선 광대역 회선과 같은 매체를 이용하여 영상 데이터를 전송하거나 기존의 저장 매체를 이용해 영상 데이터를 저장하는 경우, 전송 비용과 저장 비용이 증가된다.
이에 따라, 고해상도, 고품질 영상의 정보를 효과적으로 전송하거나 저장하고, 재생하기 위해 고효율의 영상 압축 기술이 요구된다.
본 발명의 기술적 과제는 영상 코딩 효율을 높이는 방법 및 장치를 제공함에 있다.
본 발명의 다른 기술적 과제는 복수의 보간 필터들 중 현재 블록의 보간 필터를 도출하고, 상기 도출된 보간 필터를 기반으로 현재 블록의 인터 예측을 수행하는 방법 및 장치를 제공함에 있다.
본 발명의 또 다른 기술적 과제는 별도의 보간 필터에 대한 정보 전송없이 현재 블록의 보간 필터를 도출하고, 상기 도출된 보간 필터를 기반으로 현재 블록의 인터 예측을 수행하는 방법 및 장치를 제공함에 있다.
본 발명의 또 다른 기술적 과제는 현재 블록의 템플릿 및 참조 블록의 템플릿을 기반으로 현재 블록의 보간 필터를 도출하고, 상기 도출된 보간 필터를 기반으로 현재 블록의 인터 예측을 수행하는 방법 및 장치를 제공함에 있다.
본 발명의 또 다른 기술적 과제는 현재 블록의 참조 블록을 기반으로 현재 블록의 보간 필터를 도출하고, 상기 도출된 보간 필터를 기반으로 현재 블록의 인터 예측을 수행하는 방법 및 장치를 제공함에 있다.
본 발명의 일 실시예에 따르면, 디코딩 장치에 의하여 수행되는 영상 디코딩 방법이 제공된다. 상기 방법은 비트스트림을 통하여 현재 블록의 인터 예측 정보를 획득하는 단계, 상기 인터 예측 정보를 기반으로 상기 현재 블록의 움직임 정보를 도출하는 단계, 복수의 보간 필터들 중 상기 현재 블록의 보간 필터를 도출하는 단계, 및 상기 보간 필터 및 상기 움직임 정보를 기반으로 상기 현재 블록의 인터 예측을 수행하는 단계를 포함하되, 상기 복수의 보간 필터들은 4탭 필터(4-tap filter), 8탭 필터 및 12탭 필터를 포함하는 것을 특징으로 한다.
본 발명의 다른 일 실시예에 따르면, 영상 디코딩을 수행하는 디코딩 장치가 제공된다. 상기 디코딩 장치는 비트스트림을 통하여 현재 블록의 인터 예측 정보를 획득하는 엔트로피 디코딩부, 및 상기 인터 예측 정보를 기반으로 상기 현재 블록의 움직임 정보를 도출하고, 복수의 보간 필터들 중 상기 현재 블록의 보간 필터를 도출하고, 및 상기 보간 필터 및 상기 움직임 정보를 기반으로 상기 현재 블록의 인터 예측을 수행하는 예측부를 포함하되, 상기 복수의 보간 필터들은 4탭 필터(4-tap filter), 8탭 필터 및 12탭 필터를 포함하는 것을 특징으로 한다.
본 발명의 또 다른 일 실시예에 따르면, 인코딩 장치에 의하여 수행되는 비디오 인코딩 방법을 제공한다. 상기 방법은 현재 블록의 움직임 정보를 생성하는 단계, 복수의 보간 필터들 중 상기 현재 블록의 보간 필터를 결정하는 단계, 상기 보간 필터 및 상기 움직임 정보를 기반으로 상기 현재 블록의 인터 예측을 수행하는 단계, 및 상기 현재 블록의 인터 예측 정보를 인코딩하여 전송하는 단계를 포함하되, 상기 복수의 보간 필터들은 4탭 필터(4-tap filter), 8탭 필터 및 12탭 필터를 포함하는 것을 특징으로 한다.
본 발명의 또 다른 일 실시예에 따르면, 비디오 인코딩 장치를 제공한다. 상기 인코딩 장치는 현재 블록의 움직임 정보를 생성하고, 복수의 보간 필터들 중 상기 현재 블록의 보간 필터를 결정하고, 상기 보간 필터 및 상기 움직임 정보를 기반으로 상기 현재 블록의 인터 예측을 수행하는 예측부, 및 상기 현재 블록의 인터 예측 정보를 인코딩하여 전송하는 엔트로피 인코딩부를 포함하되, 상기 복수의 보간 필터들은 4탭 필터(4-tap filter), 8탭 필터 및 12탭 필터를 포함하는 것을 특징으로 한다.
본 발명에 따르면 입력 영상 또는 현재 블록의 특성에 따라 보간 필터가 결정될 수 있고, 결정된 보간 필터를 기반으로 상기 현재 블록의 인터 예측을 수행할 수 있는바, 이를 통하여 현재 블록의 예측 정확도를 향상시키고, 전반적인 코딩 효율을 향상시킬 수 있다.
본 발명에 따르면 보간 필터에 대한 정보의 전송없이 디코딩 장치에서 현재 블록의 보간 필터를 도출할 수 있고, 이를 통하여 현재 블록의 보간 필터를 위하여 사용되는 비트량을 줄일 수 있고, 전반적인 코딩 효율을 향상시킬 수 있다.
도 1은 본 발명이 적용될 수 있는 비디오 인코딩 장치의 구성을 개략적으로 설명하는 도면이다.
도 2는 본 발명이 적용될 수 있는 비디오 디코딩 장치의 구성을 개략적으로 설명하는 도면이다.
도 3은 상기 현재 블록에 대하여 상기 움직임 추정이 수행되는 일 예를 나타낼 수 있다.
도 4는 상기 현재 블록에 대하여 분수 샘플 단위 움직임 보상이 수행되는 일 예를 나타낼 수 있다.
도 5는 상기 4탭 필터, 상기 8탭 필터 및 상기 12탭 필터를 기반으로 움직임 보상이 수행되는 과정의 일 예를 나타낸다.
도 6은 상기 현재 블록에 머지 모드가 적용된 경우, 주변 블록의 움직임 정보를 기반으로 상기 현재 블록의 보간 필터 인덱스를 도출하는 일 예를 나타낸다.
도 7은 상기 현재 블록의 템플릿(template)의 일 예를 나타낸다.
도 8은 라플라시안 오퍼레이션 및 소벨 오퍼레이션의 일 예를 나타낸다.
도 9는 변환 도메인(domain), 즉, 주파수 도메인에서 고주파 성분과 저주파 성분의 위치를 예시적으로 나타낸다.
도 10은 상기 현재 블록의 템플릿과 상기 참조 블록의 템플릿을 기반으로 상기 현재 블록의 보간 필터를 도출하는 일 예를 나타낸다.
도 11은 상기 현재 블록의 상기 참조 블록을 기반으로 상기 현재 블록의 보간 필터를 도출하는 일 예를 나타낸다.
도 12는 본 발명에 따른 인코딩 장치에 의한 비디오 인코딩 방법을 개략적으로 나타낸다.
도 13은 본 발명에 따른 디코딩 장치에 의한 비디오 디코딩 방법을 개략적으로 나타낸다.
본 발명은 다양한 변경을 가할 수 있고 여러 가지 실시예를 가질 수 있는 바, 특정 실시예들을 도면에 예시하고 상세하게 설명하고자 한다. 그러나, 이는 본 발명을 특정 실시예에 한정하려고 하는 것이 아니다. 본 명세서에서 상용하는 용어는 단지 특정한 실시예를 설명하기 위해 사용된 것으로, 본 발명의 기술적 사상을 한정하려는 의도로 사용되는 것은 아니다. 단수의 표현은 문맥상 명백하게 다르게 뜻하지 않는 한, 복수의 표현을 포함한다. 본 명세서에서 "포함하다" 또는 "가지다" 등의 용어는 명세서상에 기재된 특징, 숫자, 단계, 동작, 구성 요소, 부품 또는 이들을 조합한 것이 존재함을 지정하려는 것이지, 하나 또는 그 이상의 다른 특징들이나 숫자, 단계, 동작, 구성 요소, 부품 도는 이들을 조합한 것들의 존재 또는 부가 가능성을 미리 배제하지 않는 것으로 이해되어야 한다.
한편, 본 발명에서 설명되는 도면상의 각 구성들은 서로 다른 특징적인 기능들에 관한 설명의 편의를 위해 독립적으로 도시된 것으로서, 각 구성들이 서로 별개의 하드웨어나 별개의 소프트웨어로 구현된다는 것을 의미하지는 않는다. 예컨대, 각 구성 중 두 개 이상의 구성이 합쳐져 하나의 구성을 이룰 수도 있고, 하나의 구성이 복수의 구성으로 나뉘어질 수도 있다. 각 구성이 통합 및/또는 분리된 실시예도 본 발명의 본질에서 벗어나지 않는 한 본 발명의 권리범위에 포함된다.
이하, 첨부한 도면들을 참조하여, 본 발명의 바람직한 실시예를 보다 상세하게 설명하고자 한다. 이하, 도면상의 동일한 구성 요소에 대해서는 동일한 참조 부호를 사용하고 동일한 구성 요소에 대해서 중복된 설명은 생략한다.
본 명세서에서 픽처(picture)는 일반적으로 특정 시간대의 하나의 영상을 나타내는 단위를 의미하며, 슬라이스(slice)는 코딩에 있어서 픽처의 일부를 구성하는 단위이다. 하나의 픽처는 복수의 슬라이스로 구성될 수 있으며, 필요에 따라서 픽처 및 슬라이스는 서로 혼용되어 사용될 수 있다.
픽셀(pixel) 또는 펠(pel)은 하나의 픽처(또는 영상)을 구성하는 최소의 단위를 의미할 수 있다. 또한, 픽셀에 대응하는 용어로서 '샘플(sample)'이 사용될 수 있다. 샘플은 일반적으로 픽셀 또는 픽셀의 값을 나타낼 수 있으며, 휘도(luma) 성분의 픽셀/픽셀값만을 나타낼 수도 있고, 채도(chroma) 성분의 픽셀/픽셀 값만을 나타낼 수도 있다.
유닛(unit)은 영상 처리의 기본 단위를 나타낸다. 유닛은 픽처의 특정 영역 및 해당 영역에 관련된 정보 중 적어도 하나를 포함할 수 있다. 유닛은 경우에 따라서 블록(block) 또는 영역(area) 등의 용어와 혼용하여 사용될 수 있다. 일반적인 경우, MxN 블록은 M개의 열과 N개의 행으로 이루어진 샘플들 또는 변환 계수(transform coefficient)들의 집합을 나타낼 수 있다.
도 1은 본 발명이 적용될 수 있는 비디오 인코딩 장치의 구성을 개략적으로 설명하는 도면이다.
도 1을 참조하면, 비디오 인코딩 장치(100)는 픽처 분할부(105), 예측부(110), 레지듀얼 처리부(120), 엔트로피 인코딩부(130), 가산부(140), 필터부(150) 및 메모리(160)을 포함할 수 있다. 레지듀얼 처리부(120)는 감산부(121), 변환부(122), 양자화부(123), 재정렬부(124), 역양자화부(125) 및 역변환부(126)를 포함할 수 있다.
픽처 분할부(105)는 입력된 픽처를 적어도 하나의 처리 유닛(processing unit)으로 분할할 수 있다.
일 예로, 처리 유닛은 코딩 유닛(coding unit, CU)이라고 불릴 수 있다. 이 경우 코딩 유닛은 최대 코딩 유닛(largest coding unit, LCU)으로부터 QTBT (Quad-tree binary-tree) 구조에 따라 재귀적으로(recursively) 분할될 수 있다. 예를 들어, 하나의 코딩 유닛은 쿼드 트리 구조 및/또는 바이너리 트리 구조를 기반으로 하위(deeper) 뎁스의 복수의 코딩 유닛들로 분할될 수 있다. 이 경우 예를 들어 쿼드 트리 구조가 먼저 적용되고 바이너리 트리 구조가 나중에 적용될 수 있다. 또는 바이너리 트리 구조가 먼저 적용될 수도 있다. 더 이상 분할되지 않는 최종 코딩 유닛을 기반으로 본 발명에 따른 코딩 절차가 수행될 수 있다. 이 경우 영상 특성에 따른 코딩 효율 등을 기반으로, 최대 코딩 유닛이 바로 최종 코딩 유닛으로 사용될 수 있고, 또는 필요에 따라 코딩 유닛은 재귀적으로(recursively) 보다 하위 뎁스의 코딩 유닛들로 분할되어 최적의 사이즈의 코딩 유닛이 최종 코딩 유닛으로 사용될 수 있다. 여기서 코딩 절차라 함은 후술하는 예측, 변환, 및 복원 등의 절차를 포함할 수 있다.
다른 예로, 처리 유닛은 코딩 유닛(coding unit, CU) 예측 유닛(prediction unit, PU) 또는 변환 유닛(transform unit, TU)을 포함할 수도 있다. 코딩 유닛은 최대 코딩 유닛(largest coding unit, LCU)으로부터 쿼드 트리 구조를 따라서 하위(deeper) 뎁스의 코딩 유닛들로 분할(split)될 수 있다. 이 경우 영상 특성에 따른 코딩 효율 등을 기반으로, 최대 코딩 유닛이 바로 최종 코딩 유닛으로 사용될 수 있고, 또는 필요에 따라 코딩 유닛은 재귀적으로(recursively) 보다 하위 뎁스의 코딩 유닛들로 분할되어 최적의 사이즈의 코딩 유닛이 최종 코딩 유닛으로 사용될 수 있다. 최소 코딩 유닛(smallest coding unit, SCU)이 설정된 경우 코딩 유닛은 최소 코딩 유닛보다 더 작은 코딩 유닛으로 분할될 수 없다. 여기서 최종 코딩 유닛이라 함은 예측 유닛 또는 변환 유닛으로 파티셔닝 또는 분할되는 기반이 되는 코딩 유닛을 의미한다. 예측 유닛은 코딩 유닛으로부터 파티셔닝(partitioning)되는 유닛으로서, 샘플 예측의 유닛일 수 있다. 이 때, 예측 유닛은 서브 블록(sub block)으로 나뉠 수도 있다. 변환 유닛은 코딩 유닛으로부터 쿼드 트리 구조를 따라서 분할 될 수 있으며, 변환 계수를 유도하는 유닛 및/또는 변환 계수로부터 레지듀얼 신호(residual signal)를 유도하는 유닛일 수 있다. 이하, 코딩 유닛은 코딩 블록(coding block, CB), 예측 유닛은 예측 블록(prediction block, PB), 변환 유닛은 변환 블록(transform block, TB) 으로 불릴 수 있다. 예측 블록 또는 예측 유닛은 픽처 내에서 블록 형태의 특정 영역을 의미할 수 있고, 예측 샘플의 어레이(array)를 포함할 수 있다. 또한, 변환 블록 또는 변환 유닛은 픽처 내에서 블록 형태의 특정 영역을 의미할 수 있고, 변환 계수 또는 레지듀얼 샘플의 어레이를 포함할 수 있다.
예측부(110)는 처리 대상 블록(이하, 현재 블록이라 함)에 대한 예측을 수행하고, 상기 현재 블록에 대한 예측 샘플들을 포함하는 예측된 블록(predicted block)을 생성할 수 있다. 예측부(110)에서 수행되는 예측의 단위는 코딩 블록일 수 있고, 변환 블록일 수도 있고, 예측 블록일 수도 있다.
예측부(110)는 현재 블록에 인트라 예측이 적용되는지 인터 예측이 적용되는지를 결정할 수 있다. 일 예로, 예측부(110)는 CU 단위로 인트라 예측 또는 인터 예측이 적용되는지를 결정할 수 있다.
인트라 예측의 경우에, 예측부(110)는 현재 블록이 속하는 픽처(이하, 현재 픽처) 내의 현재 블록 외부의 참조 샘플을 기반으로 현재 블록에 대한 예측 샘플을 유도할 수 있다. 이 때, 예측부(110)는 (i) 현재 블록의 주변(neighboring) 참조 샘플들의 평균(average) 혹은 인터폴레이션(interpolation)을 기반으로 예측 샘플을 유도할 수 있고, (ii) 현재 블록의 주변 참조 샘플들 중 예측 샘플에 대하여 특정 (예측) 방향에 존재하는 참조 샘플을 기반으로 상기 예측 샘플을 유도할 수도 있다. (i)의 경우는 비방향성 모드 또는 비각도 모드, (ii)의 경우는 방향성(directional) 모드 또는 각도(angular) 모드라고 불릴 수 있다. 인트라 예측에서 예측 모드는 예를 들어 33개의 방향성 예측 모드와 적어도 2개 이상의 비방향성 모드를 가질 수 있다. 비방향성 모드는 DC 예측 모드 및 플래너 모드(Planar 모드)를 포함할 수 있다. 예측부(110)는 주변 블록에 적용된 예측 모드를 이용하여, 현재 블록에 적용되는 예측 모드를 결정할 수도 있다.
인터 예측의 경우에, 예측부(110)는 참조 픽처 상에서 움직임 벡터에 의해 특정되는 샘플을 기반으로, 현재 블록에 대한 예측 샘플을 유도할 수 있다. 예측부(110)는 스킵(skip) 모드, 머지(merge) 모드, 및 MVP(motion vector prediction) 모드 중 어느 하나를 적용하여 현재 블록에 대한 예측 샘플을 유도할 수 있다. 스킵 모드와 머지 모드의 경우에, 예측부(110)는 주변 블록의 움직임 정보를 현재 블록의 움직임 정보로 이용할 수 있다. 스킵 모드의 경우, 머지 모드와 달리 예측 샘플과 원본 샘플 사이의 차(레지듀얼)가 전송되지 않는다. MVP 모드의 경우, 주변 블록의 움직임 벡터를 움직임 벡터 예측자(Motion Vector Predictor)로 이용하여 현재 블록의 움직임 벡터 예측자로 이용하여 현재 블록의 움직임 벡터를 유도할 수 있다.
인터 예측의 경우에, 주변 블록은 현재 픽처 내에 존재하는 공간적 주변 블록(spatial neighboring block)과 참조 픽처(reference picture)에 존재하는 시간적 주변 블록(temporal neighboring block)을 포함할 수 있다. 상기 시간적 주변 블록을 포함하는 참조 픽처는 동일 위치 픽처(collocated picture, colPic)라고 불릴 수도 있다. 움직임 정보(motion information)는 움직임 벡터와 참조 픽처 인덱스를 포함할 수 있다. 예측 모드 정보와 움직임 정보 등의 정보는 (엔트로피) 인코딩되어 비트스트림 형태로 출력될 수 있다.
스킵 모드와 머지 모드에서 시간적 주변 블록의 움직임 정보가 이용되는 경우에, 참조 픽처 리스트(reference picture list) 상의 최상위 픽처가 참조 픽처로서 이용될 수도 있다. 참조 픽처 리스트(Picture Order Count)에 포함되는 참조 픽처들은 현재 픽처와 해당 참조 픽처 간의 POC(Picture order count) 차이 기반으로 정렬될 수 있다. POC는 픽처의 디스플레이 순서에 대응하며, 코딩 순서와 구분될 수 있다.
감산부(121)는 원본 샘플과 예측 샘플 간의 차이인 레지듀얼 샘플을 생성한다. 스킵 모드가 적용되는 경우에는, 상술한 바와 같이 레지듀얼 샘플을 생성하지 않을 수 있다.
변환부(122)는 변환 블록 단위로 레지듀얼 샘플을 변환하여 변환 계수(transform coefficient)를 생성한다. 변환부(122)는 해당 변환 블록의 사이즈와, 해당 변환 블록과 공간적으로 겹치는 코딩 블록 또는 예측 블록에 적용된 예측 모드에 따라서 변환을 수행할 수 있다. 예컨대, 상기 변환 블록과 겹치는 상기 코딩 블록 또는 상기 예측 블록에 인트라 예측이 적용되었고, 상기 변환 블록이 4×4의 레지듀얼 어레이(array)라면, 레지듀얼 샘플은 DST(Discrete Sine Transform) 변환 커널을 이용하여 변환되고, 그 외의 경우라면 레지듀얼 샘플은 DCT(Discrete Cosine Transform) 변환 커널을 이용하여 변환할 수 있다.
양자화부(123)는 변환 계수들을 양자화하여, 양자화된 변환 계수를 생성할 수 있다.
재정렬부(124)는 양자화된 변환 계수를 재정렬한다. 재정렬부(124)는 계수들 스캐닝(scanning) 방법을 통해 블록 형태의 양자화된 변환 계수들을 1차원 벡터 형태로 재정렬할 수 있다. 여기서 재정렬부(124)는 별도의 구성으로 설명하였으나, 재정렬부(124)는 양자화부(123)의 일부일 수 있다.
엔트로피 인코딩부(130)는 양자화된 변환 계수들에 대한 엔트로피 인코딩을 수행할 수 있다. 엔트로피 인코딩은 예를 들어 지수 골롬(exponential Golomb), CAVLC(context-adaptive variable length coding), CABAC(context-adaptive binary arithmetic coding) 등과 같은 인코딩 방법을 포함할 수 있다. 엔트로피 인코딩부(130)는 양자화된 변환 계수 외 비디오 복원에 필요한 정보들(예컨대 신택스 요소(syntax element)의 값 등)을 함께 또는 별도로 인코딩할 수도 있다. 엔트로피 인코딩된 정보들은 비트스트림 형태로 NAL(network abstraction layer) 유닛 단위로 전송 또는 저장될 수 있다.
역양자화부(125)는 양자화부(123)에서 양자화된 값(양자화된 변환 계수)들을 역양자화하고, 역변환부(126)는 역양자화부(125)에서 역양자화된 값들을 역변환하여 레지듀얼 샘플을 생성한다.
가산부(140)는 레지듀얼 샘플과 예측 샘플을 합쳐서 픽처를 복원한다. 레지듀얼 샘플과 예측 샘플은 블록 단위로 더해져서 복원 블록이 생성될 수 있다. 여기서 가산부(140)는 별도의 구성으로 설명하였으나, 가산부(140)는 예측부(110)의 일부일 수 있다. 한편, 가산부(140)는 복원부 또는 복원 블록 생성부로 불릴 수도 있다.
복원된 픽처(reconstructed picture)에 대하여 필터부(150)는 디블록킹 필터 및/또는 샘플 적응적 오프셋(sample adaptive offset)을 적용할 수 있다. 디블록킹 필터링 및/또는 샘플 적응적 오프셋을 통해, 복원 픽처 내 블록 경계의 아티팩트나 양자화 과정에서의 왜곡이 보정될 수 있다. 샘플 적응적 오프셋은 샘플 단위로 적용될 수 있으며, 디블록킹 필터링의 과정이 완료된 후 적용될 수 있다. 필터부(150)는 ALF(Adaptive Loop Filter)를 복원된 픽처에 적용할 수도 있다. ALF는 디블록킹 필터 및/또는 샘플 적응적 오프셋이 적용된 후의 복원된 픽처에 대하여 적용될 수 있다.
메모리(160)는 복원 픽처(디코딩된 픽처) 또는 인코딩/디코딩에 필요한 정보를 저장할 수 있다. 여기서 복원 픽처는 상기 필터부(150)에 의하여 필터링 절차가 완료된 복원 픽처일 수 있다. 상기 저장된 복원 픽처는 다른 픽처의 (인터) 예측을 위한 참조 픽처로 활용될 수 있다. 예컨대, 메모리(160)는 인터 예측에 사용되는 (참조) 픽처들을 저장할 수 있다. 이 때, 인터 예측에 사용되는 픽처들은 참조 픽처 세트(reference picture set) 혹은 참조 픽처 리스트(reference picture list)에 의해 지정될 수 있다.
도 2는 본 발명이 적용될 수 있는 비디오 디코딩 장치의 구성을 개략적으로 설명하는 도면이다.
도 2를 참조하면, 비디오 디코딩 장치(200)는 엔트로피 디코딩부(210), 레지듀얼 처리부(220), 예측부(230), 가산부(240), 필터부(250) 및 메모리(260)을 포함할 수 있다. 여기서 레지듀얼 처리부(220)는 재정렬부(221), 역양자화부(222), 역변환부(223)을 포함할 수 있다.
비디오 정보를 포함하는 비트스트림이 입력되면, 비디오 디코딩 장치(200)는 비디오 인코딩 장치에서 비디오 정보가 처리된 프로세스에 대응하여 비디오를 복원할 수 있다.
예컨대, 비디오 디코딩 장치(200)는 비디오 인코딩 장치에서 적용된 처리 유닛을 이용하여 비디오 디코딩을 수행할 수 있다. 따라서 비디오 디코딩의 처리 유닛 블록은 일 예로 코딩 유닛일 수 있고, 다른 예로 코딩 유닛, 예측 유닛 또는 변환 유닛일 수 있다. 코딩 유닛은 최대 코딩 유닛으로부터 쿼드 트리 구조 및/또는 바이너리 트리 구조를 따라서 분할될 수 있다.
예측 유닛 및 변환 유닛이 경우에 따라 더 사용될 수 있으며, 이 경우 예측 블록은 코딩 유닛으로부터 도출 또는 파티셔닝되는 블록으로서, 샘플 예측의 유닛일 수 있다. 이 때, 예측 유닛은 서브 블록으로 나뉠 수도 있다. 변환 유닛은 코딩 유닛으로부터 쿼드 트리 구조를 따라서 분할 될 수 있으며, 변환 계수를 유도하는 유닛 또는 변환 계수로부터 레지듀얼 신호를 유도하는 유닛일 수 있다.
엔트로피 디코딩부(210)는 비트스트림을 파싱하여 비디오 복원 또는 픽처 복원에 필요한 정보를 출력할 수 있다. 예컨대, 엔트로피 디코딩부(210)는 지수 골롬 부호화, CAVLC 또는 CABAC 등의 코딩 방법을 기초로 비트스트림 내 정보를 디코딩하고, 비디오 복원에 필요한 신택스 엘리먼트의 값, 레지듀얼에 관한 변환 계수의 양자화된 값 들을 출력할 수 있다.
보다 상세하게, CABAC 엔트로피 디코딩 방법은, 비트스트림에서 각 구문 요소에 해당하는 빈을 수신하고, 디코딩 대상 구문 요소 정보와 주변 및 디코딩 대상 블록의 디코딩 정보 혹은 이전 단계에서 디코딩된 심볼/빈의 정보를 이용하여 문맥(context) 모델을 결정하고, 결정된 문맥 모델에 따라 빈(bin)의 발생 확률을 예측하여 빈의 산술 디코딩(arithmetic decoding)를 수행하여 각 구문 요소의 값에 해당하는 심볼을 생성할 수 있다. 이때, CABAC 엔트로피 디코딩 방법은 문맥 모델 결정 후 다음 심볼/빈의 문맥 모델을 위해 디코딩된 심볼/빈의 정보를 이용하여 문맥 모델을 업데이트할 수 있다.
엔트로피 디코딩부(210)에서 디코딩된 정보 중 예측에 관한 정보는 예측부(230)로 제공되고, 엔트로피 디코딩부(210)에서 엔트로피 디코딩이 수행된 레지듀얼 값, 즉 양자화된 변환 계수는 재정렬부(221)로 입력될 수 있다.
재정렬부(221)는 양자화되어 있는 변환 계수들을 2차원의 블록 형태로 재정렬할 수 있다. 재정렬부(221)는 인코딩 장치에서 수행된 계수 스캐닝에 대응하여 재정렬을 수행할 수 있다. 여기서 재정렬부(221)는 별도의 구성으로 설명하였으나, 재정렬부(221)는 역양자화부(222)의 일부일 수 있다.
역양자화부(222)는 양자화되어 있는 변환 계수들을 (역)양자화 파라미터를 기반으로 역양자화하여 변환 계수를 출력할 수 있다. 이 때, 양자화 파라미터를 유도하기 위한 정보는 인코딩 장치로부터 시그널링될 수 있다.
역변환부(223)는 변환 계수들을 역변환하여 레지듀얼 샘플들을 유도할 수 있다.
예측부(230)는 현재 블록에 대한 예측을 수행하고, 상기 현재 블록에 대한 예측 샘플들을 포함하는 예측된 블록(predicted block)을 생성할 수 있다. 예측부(230)에서 수행되는 예측의 단위는 코딩 블록일 수도 있고, 변환 블록일 수도 있고, 예측 블록일 수도 있다.
예측부(230)는 상기 예측에 관한 정보를 기반으로 인트라 예측을 적용할 것인지 인터 예측을 적용할 것인지를 결정할 수 있다. 이 때, 인트라 예측과 인터 예측 중 어느 것을 적용할 것인지를 결정하는 단위와 예측 샘플을 생성하는 단위는 상이할 수 있다. 아울러, 인터 예측과 인트라 예측에 있어서 예측 샘플을 생성하는 단위 또한 상이할 수 있다. 예를 들어, 인터 예측과 인트라 예측 중 어느 것을 적용할 것인지는 CU 단위로 결정할 수 있다. 또한 예를 들어, 인터 예측에 있어서 PU 단위로 예측 모드를 결정하고 예측 샘플을 생성할 수 있고, 인트라 예측에 있어서 PU 단위로 예측 모드를 결정하고 TU 단위로 예측 샘플을 생성할 수도 있다.
인트라 예측의 경우에, 예측부(230)는 현재 픽처 내의 주변 참조 샘플을 기반으로 현재 블록에 대한 예측 샘플을 유도할 수 있다. 예측부(230)는 현재 블록의 주변 참조 샘플을 기반으로 방향성 모드 또는 비방향성 모드를 적용하여 현재 블록에 대한 예측 샘플을 유도할 수 있다. 이 때, 주변 블록의 인트라 예측 모드를 이용하여 현재 블록에 적용할 예측 모드가 결정될 수도 있다.
인터 예측의 경우에, 예측부(230)는 참조 픽처 상에서 움직임 벡터에 의해 참조 픽처 상에서 특정되는 샘플을 기반으로 현재 블록에 대한 예측 샘플을 유도할 수 있다. 예측부(230)는 스킵(skip) 모드, 머지(merge) 모드 및 MVP 모드 중 어느 하나를 적용하여 현재 블록에 대한 예측 샘플을 유도할 수 있다. 이때, 비디오 인코딩 장치에서 제공된 현재 블록의 인터 예측에 필요한 움직임 정보, 예컨대 움직임 벡터, 참조 픽처 인덱스 등에 관한 정보는 상기 예측에 관한 정보를 기반으로 획득 또는 유도될 수 있다
스킵 모드와 머지 모드의 경우에, 주변 블록의 움직임 정보가 현재 블록의 움직임 정보로 이용될 수 있다. 이 때, 주변 블록은 공간적 주변 블록과 시간적 주변 블록을 포함할 수 있다.
예측부(230)는 가용한 주변 블록의 움직임 정보로 머지 후보 리스트를 구성하고, 머지 인덱스가 머지 후보 리스트 상에서 지시하는 정보를 현재 블록의 움직임 벡터로 사용할 수 있다. 머지 인덱스는 인코딩 장치로부터 시그널링될 수 있다. 움직임 정보는 움직임 벡터와 참조 픽처를 포함할 수 있다. 스킵 모드와 머지 모드에서 시간적 주변 블록의 움직임 정보가 이용되는 경우에, 참조 픽처 리스트 상의 최상위 픽처가 참조 픽처로서 이용될 수 있다.
스킵 모드의 경우, 머지 모드와 달리 예측 샘플과 원본 샘플 사이의 차이(레지듀얼)이 전송되지 않는다.
MVP 모드의 경우, 주변 블록의 움직임 벡터를 움직임 벡터 예측자(motion vector predictor)로 이용하여 현재 블록의 움직임 벡터가 유도될 수 있다. 이 때, 주변 블록은 공간적 주변 블록과 시간적 주변 블록을 포함할 수 있다.
일 예로, 머지 모드가 적용되는 경우, 복원된 공간적 주변 블록의 움직임 벡터 및/또는 시간적 주변 블록인 Col 블록에 대응하는 움직임 벡터를 이용하여, 머지 후보 리스트가 생성될 수 있다. 머지 모드에서는 머지 후보 리스트에서 선택된 후보 블록의 움직임 벡터가 현재 블록의 움직임 벡터로 사용된다. 상기 예측에 관한 정보는 상기 머지 후보 리스트에 포함된 후보 블록들 중에서 선택된 최적의 움직임 벡터를 갖는 후보 블록을 지시하는 머지 인덱스를 포함할 수 있다. 이 때, 예측부(230)는 상기 머지 인덱스를 이용하여, 현재 블록의 움직임 벡터를 도출할 수 있다.
다른 예로, MVP(Motion Vector Prediction) 모드가 적용되는 경우, 복원된 공간적 주변 블록의 움직임 벡터 및/또는 시간적 주변 블록인 Col 블록에 대응하는 움직임 벡터를 이용하여, 움직임 벡터 예측자 후보 리스트가 생성될 수 있다. 즉, 복원된 공간적 주변 블록의 움직임 벡터 및/또는 시간적 주변 블록인 Col 블록에 대응하는 움직임 벡터는 움직임 벡터 후보로 사용될 수 있다. 상기 예측에 관한 정보는 상기 리스트에 포함된 움직임 벡터 후보 중에서 선택된 최적의 움직임 벡터를 지시하는 예측 움직임 벡터 인덱스를 포함할 수 있다. 이 때, 예측부(230)는 상기 움직임 벡터 인덱스를 이용하여, 움직임 벡터 후보 리스트에 포함된 움직임 벡터 후보 중에서, 현재 블록의 예측 움직임 벡터를 선택할 수 있다. 인코딩 장치의 예측부는 현재 블록의 움직임 벡터와 움직임 벡터 예측자 간의 움직임 벡터 차분(MVD)을 구할 수 있고, 이를 인코딩하여 비트스트림 형태로 출력할 수 있다. 즉, MVD는 현재 블록의 움직임 벡터에서 상기 움직임 벡터 예측자를 뺀 값으로 구해질 수 있다. 이 때, 예측부(230)는 상기 예측에 관한 정보에 포함된 움직임 벡터 차분을 획득하고, 상기 움직임 벡터 차분과 상기 움직임 벡터 예측자의 가산을 통해 현재 블록의 상기 움직임 벡터를 도출할 수 있다. 예측부는 또한 참조 픽처를 지시하는 참조 픽처 인덱스 등을 상기 예측에 관한 정보로부터 획득 또는 유도할 수 있다.
가산부(240)는 레지듀얼 샘플과 예측 샘플을 더하여 현재 블록 혹은 현재 픽처를 복원할 수 있다. 가산부(240)는 레지듀얼 샘플과 예측 샘플을 블록 단위로 더하여 현재 픽처를 복원할 수도 있다. 스킵 모드가 적용된 경우에는 레지듀얼이 전송되지 않으므로, 예측 샘플이 복원 샘플이 될 수 있다. 여기서는 가산부(240)를 별도의 구성으로 설명하였으나, 가산부(240)는 예측부(230)의 일부일 수도 있다. 한편, 가산부(240)는 복원부 또는 복원 블록 생성부로 불릴 수도 있다.
필터부(250)는 복원된 픽처에 디블록킹 필터링 샘플 적응적 오프셋, 및/또는 ALF 등을 적용할 수 있다. 이 때, 샘플 적응적 오프셋은 샘플 단위로 적용될 수 있으며, 디블록킹 필터링 이후 적용될 수도 있다. ALF는 디블록킹 필터링 및/또는 샘플 적응적 오프셋 이후 적용될 수도 있다.
메모리(260)는 복원 픽처(디코딩된 픽처) 또는 디코딩에 필요한 정보를 저장할 수 있다. 여기서 복원 픽처는 상기 필터부(250)에 의하여 필터링 절차가 완료된 복원 픽처일 수 있다. 예컨대, 메모리(260)는 인터 예측에 사용되는 픽처들을 저장할 수 있다. 이 때, 인터 예측에 사용되는 픽처들은 참조 픽처 세트 혹은 참조 픽처 리스트에 의해 지정될 수도 있다. 복원된 픽처는 다른 픽처에 대한 참조 픽처로서 이용될 수 있다. 또한, 메모리(260)는 복원된 픽처를 출력 순서에 따라서 출력할 수도 있다.
상술한 내용과 같이 현재 블록에 인터 예측이 수행될 수 있다. 상기 인터 예측에 있어서 움직임 추정(motion estimation) 및 움직임 보상(motion compensation)은 가장 핵심적인 과정 또는 알고리즘일 수 있다.
도 3은 상기 현재 블록에 대하여 상기 움직임 추정이 수행되는 일 예를 나타낼 수 있다. 도 3에 도시된 것과 같이 상기 움직임 추정은 현재 픽처(current picture)의 인코딩 시점 이전에 이미 인코딩/디코딩된 참조 픽처(reference picture)들을 대상으로 현재 블록(current block)에 정합되는 블록을 찾는 과정을 나타낼 수 있다. 즉, 상기 움직임 추정은 상기 참조 픽처들에 포함된 복원 블록들 중 상기 현재 블록과 가장 상관도(correlation)가 높은 블록을 탐색하는 과정을 나타낼 수 있다. 여기서, 상기 현재 블록에 정합되는 참조 픽처 내 블록은 참조 블록이라고 정의될 수 있다. 또한, 상기 참조 블록이 상기 현재 블록과 동일한 픽처 내에 있다고 가정하여 도출되는 상기 현재 블록과 상기 참조 블록간 위치의 차이는 움직임 벡터(motion vector)로 정의될 수 있다.
한편, 상기 움직임 보상은 상기 움직임 추정을 통하여 도출된 인터 예측 정보를 기반으로 상기 현재 블록의 샘플값을 예측하는 과정을 나타낼 수 있다. 즉, 상기 움직임 보상은 상기 현재 블록의 움직임 벡터를 기반으로 참조 픽처 내 참조 블록의 위치를 도출하고, 상기 참조 블록의 샘플값들을 상기 현재 블록의 예측 샘플 값을 사용하는 과정을 나타낼 수 있다.
상기 움직임 추정 및 움직임 보상에 사용되는 움직임 벡터는 인터 예측의 예측 정확도 향상을 위하여 분수 샘플 단위일 수 있다. 즉, 분수 샘플 단위의 움직임 추정 및 움직임 보상이 수행될 수 있다. 기존 AVC 또는 HEVC 표준의 경우, 1/4 분수 샘플 단위의 움직임 벡터까지 지원하며, 1/4 분수 샘플 단위 이상의 움직임 벡터 해상도를 지원하는 경우도 존재할 수 있다.
한편, 분수 샘플 단위의 움직임 추정 또는 움직임 보상을 수행하기 위해서는 보간 필터(interpolation filter, IF)를 기반으로 참조 픽처 내 정수 샘플들로부터 분수 샘플들을 생성하는 과정이 수행될 수 있다. 상기 과정은 보간 필터링(interpolation filtering)이라고 나타낼 수 있다. 구체적으로, 인코딩 장치는 복원된 참조 픽처에 상기 보간 필터를 적용하여 분수 샘플들을 포함하는 블록들을 생성할 수 있고, 상기 블록들 중 상기 현재 블록의 참조 블록을 도출할 수 있다. 이 경우, 상기 참조 블록을 가리키는 분수 샘플 단위의 움직임 벡터가 도출될 수 있다.
도 4는 상기 현재 블록에 대하여 분수 샘플 단위 움직임 보상이 수행되는 일 예를 나타낼 수 있다. 도 4를 참조하면 상기 현재 블록의 움직임 벡터는 보간 필터를 기반으로 생성된 분수 샘플을 가리킬 수 있다. 한편, HEVC 표준에서는 루마 성분의 경우, 8탭 필터(8-tap filter)를 기반으로 상기 참조 픽처의 분수 샘플들을 포함하는 블록들이 도출될 수 있고, 크로마 성분의 경우, 4탭 필터(4-tap filter)를 기반으로 상기 참조 픽처의 분수 샘플들을 포함하는 블록들이 도출될 수 있다. 여기서, 상기 8탭 필터는 8개의 필터 계수들을 기반으로 보간을 수행하는 보간 필터를 나타낼 수 있고, 4탭 필터는 4개의 필터 계수들을 기반으로 보간을 수행하는 보간 필터를 나타낼 수 있다. 상기 8탭 필터의 필터 계수는 다음의 표와 같을 수 있다.
Figure PCTKR2018000091-appb-T000001
상기 루마 성분의 경우, 8개의 정수 샘플들 및 상기 8탭 필터를 기반으로 분수 샘플이 생성될 수 있다. 구체적으로, 루마 성분의 참조 픽처에 대하여 가로 방향 및 세로 방향으로 상기 보간 필터를 적용하여 분수 샘플들이 생성될 수 있다. 예를 들어, 가로 방향으로 상기 보간 필터가 적용되는 경우, 생성되는 분수 샘플을 기준으로 좌측에 위치하는 4개의 정수 샘플들과 우측에 위치하는 4개의 정수 샘플들에 상기 보간 필터가 적용되어 상기 분수 샘플이 생성될 수 있다. 이 경우, 상기 표 1에 도시된 것과 같이 상기 분수 샘플의 위치에 따른 필터 계수가 적용될 수 있다. 또한, 세로 방향으로 상기 보간 필터가 적용되는 경우, 생성되는 분수 샘플을 기준으로 상측에 위치하는 4개의 정수 샘플들과 하측에 위치하는 4개의 정수 샘플들에 상기 보간 필터가 적용되어 상기 분수 샘플이 생성될 수 있다. 이 경우, 상기 표 1에 도시된 것과 같이 상기 분수 샘플의 위치에 따른 필터 계수가 적용될 수 있다.
한편, 본 발명에서는 기존에 하나의 보간 필터만을 적용하는 것과 달리 입력 영상의 상황에 따라 선택적으로 보간 필터를 적용하는 방법을 제안한다.
일반적으로 보간 필터의 형태가 FIR(finite impulse response) 인 경우, 보간 필터의 탭(tap) 수가 길수록 보간 성능이 향상된다고 알려져 있다. 하지만, 영상의 특성에 따라서 보간 필터의 탭 수와 보간 성능은 비례하지 않을 수도 있다.
구체적으로, 예를 들어, 낮은 해상도(resolution)의 입력 영상에 대한 움직임 보상에서는 12탭 필터가 사용되는 것이 인터 예측 성능을 보다 향상시킬 수 있다. 여기서, 낮은 해상도는 HD 해상도(1366x768 해상도) 미만의 해상도를 나타낼 수 있다. 하지만, 4K 해상도(3840x2160 해상도)의 입력 영상에 대한 움직임 보상에서는 상기 12탭 필터가 사용되는 것보다 4탭 필터가 사용되는 것이 인터 예측 성능을 보다 향상시킬 수 있다. 따라서, 입력 영상의 특성 또는 현재 블록의 특성에 따라 보간 필터의 탭 수를 조절하는 방법이 적용되면 보다 높은 인터 예측 성능을 기대할 수 있다.
한편, 상기 12탭 필터는 12개의 필터 계수들을 기반으로 보간을 수행하는 보간 필터를 나타낼 수 있다. 상기 12탭 필터의 필터 계수는 다음의 표와 같을 수 있다.
Figure PCTKR2018000091-appb-T000002
상기 12탭 필터가 적용되는 경우, 12개의 정수 샘플들 및 상기 12탭 필터를 기반으로 분수 샘플이 생성될 수 있다. 구체적으로, 참조 픽처에 대하여 가로 방향 및 세로 방향으로 상기 보간 필터를 적용하여 분수 샘플들이 생성될 수 있다. 예를 들어, 가로 방향으로 상기 보간 필터가 적용되는 경우, 생성되는 분수 샘플을 기준으로 좌측에 위치하는 6개의 정수 샘플들과 우측에 위치하는 6개의 정수 샘플들에 상기 보간 필터가 적용되어 상기 분수 샘플이 생성될 수 있다. 이 경우, 상기 표 2에 도시된 것과 같이 상기 분수 샘플의 위치에 따른 필터 계수가 적용될 수 있다. 또한, 세로 방향으로 상기 보간 필터가 적용되는 경우, 생성되는 분수 샘플을 기준으로 상측에 위치하는 6개의 정수 샘플들과 하측에 위치하는 6개의 정수 샘플들에 상기 보간 필터가 적용되어 상기 분수 샘플이 생성될 수 있다. 이 경우, 상기 표 2에 도시된 것과 같이 상기 분수 샘플의 위치에 따른 필터 계수가 적용될 수 있다.
또한, 상기 4탭 필터는 4개의 필터 계수들을 기반으로 보간을 수행하는 보간 필터를 나타낼 수 있다. 상기 4탭 필터의 필터 계수는 다음의 표와 같을 수 있다.
Figure PCTKR2018000091-appb-T000003
상기 4탭 필터가 적용되는 경우, 4개의 정수 샘플들 및 상기 4탭 필터를 기반으로 분수 샘플이 생성될 수 있다. 구체적으로, 참조 픽처에 대하여 가로 방향 및 세로 방향으로 상기 보간 필터를 적용하여 분수 샘플들이 생성될 수 있다. 예를 들어, 가로 방향으로 상기 보간 필터가 적용되는 경우, 생성되는 분수 샘플을 기준으로 좌측에 위치하는 2개의 정수 샘플들과 우측에 위치하는 2개의 정수 샘플들에 상기 보간 필터가 적용되어 상기 분수 샘플이 생성될 수 있다. 이 경우, 상기 표 3에 도시된 것과 같이 상기 분수 샘플의 위치에 따른 필터 계수가 적용될 수 있다. 또한, 세로 방향으로 상기 보간 필터가 적용되는 경우, 생성되는 분수 샘플을 기준으로 상측에 위치하는 2개의 정수 샘플들과 하측에 위치하는 2개의 정수 샘플들에 상기 보간 필터가 적용되어 상기 분수 샘플이 생성될 수 있다. 이 경우, 상기 표 3에 도시된 것과 같이 상기 분수 샘플의 위치에 따른 필터 계수가 적용될 수 있다.
한편, 상술한 표 1 내지 표 3은 보간 필터들의 일 예일뿐이며, 상기 보간 필터들은 다른 필터 계수를 가질 수도 있다. 또한, 노말라이제이션(normalization) 이 64가 아닌 다른 숫자로 수행될 수도 있다. 즉, 상술한 표 1 내지 표 3의 보간 필터들 중 하나가 적용되는 경우, 보간 필터의 필터 계수들의 합은 64이고, 상기 보간 필터가 적용된 참조 픽처는 64배 스케일링(scaling)될 수 있는바, 64가 아닌 다른 숫자로 또한, 분수 샘플 단위가 1/4 분수 샘플이 아닌 1/8 분수 샘플, 1/16 분수 샘플로도 적용될 수 있다. 한편, 상기 4탭 필터, 상기 8탭 필터 및 상기 12탭 필터를 기반으로 움직임 보상이 수행되는 과정의 일 예는 후술하는 바와 같을 수 있다.
도 5는 상기 4탭 필터, 상기 8탭 필터 및 상기 12탭 필터를 기반으로 움직임 보상이 수행되는 과정의 일 예를 나타낸다. 디코딩 장치는 비트스트림을 통하여 획득한 인터 예측 정보를 엔트로피 디코딩하여 현재 블록의 움직임 벡터를 획득할 수 있다(S500). 상기 인터 예측 정보는 상기 현재 블록에 스킵(skip) 모드, 머지(merge) 모드, 및 AMVP(adaptive motion vector prediction) 모드 중 어느 하나의 모드가 적용되는지 나타낼 수 있다. 상기 현재 블록에 스킵 모드 또는 머지 모드가 적용되는 경우, 디코딩 장치는 상기 머지 후보 리스트에 포함된 주변 블록들 중 하나의 주변 블록을 가리키는 머지 인덱스(merge index)를 획득할 수 있다. 상기 머지 인덱스는 상기 인터 예측 정보에 포함될 수 있다. 디코딩 장치는 상기 머지 인덱스가 가리키는 주변 블록의 움직임 정보를 상기 현재 블록의 움직임 정보로 도출할 수 있다. 상기 움직임 정보는 상기 현재 블록의 움직임 벡터 및 참조 픽처 인덱스를 포함할 수 있다. 상기 참조 픽처 인덱스는 상기 현재 블록의 참조 픽처를 가리킬 수 있다.
또한, 상기 현재 블록에 AMVP 모드가 적용되는 경우, 디코딩 장치는 상기 생성된 MVP 후보 리스트에 포함된 MVP 후보들 중 하나를 가리키는 MVP 인덱스 및 상기 MVP 인덱스가 가리키는 주변 블록의 움직임 벡터(MVP 후보)와 상기 현재 블록의 움직임 벡터와의 차분값(motion vector difference, MVD)을 획득할 수 있다. 상기 MVP 인덱스 및 상기 MVD는 상기 인터 예측 정보에 포함될 수 있다. 디코딩 장치는 상기 MVP 인덱스가 가리키는 주변 블록의 움직임 벡터(MVP 후보) 및 상기 MVD를 기반으로 상기 현재 블록의 상기 움직임 벡터를 도출할 수 있다.
디코딩 장치는 상기 현재 블록의 상기 움직임 벡터가 분수 샘플 단위의 움직임 벡터인지 판단할 수 있다(S510). 상기 움직임 벡터는 분수 샘플을 가리킬 수 있다. 또한, 상기 분수 샘플 단위는 1/4 분수 샘플, 1/8 분수 샘플 또는 1/16 분수 샘플 단위일 수 있다.
상기 현재 블록의 상기 움직임 벡터가 분수 샘플 단위의 움직임 벡터인 경우, 임의의 조건을 기반으로 상기 현재 블록의 보간 필터의 탭 수가 결정될 수 있다(S520). 예를 들어, 디코딩 장치는 상기 현재 블록이 포함된 영상의 해상도를 기반으로 상기 현재 블록의 보간 필터의 탭 수가 결정될 수 있다. 예를 들어, 상기 현재 블록이 포함된 영상의 해상도가 HD 해상도(1366x768 해상도) 미만인 경우, 상기 현재 블록의 보간 필터는 12탭 필터로 결정될 수 있다. 또는, 상기 현재 블록이 포함된 영상의 해상도가 4K 해상도(3840x2160 해상도) 미만인 경우, 상기 현재 블록의 보간 필터는 4탭 필터로 결정될 수 있다.
상기 현재 블록의 보간 필터가 4탭 필터로 결정된 경우, 디코딩 장치는 상기 현재 블록의 참조 픽처에 상기 4탭 필터를 적용할 수 있다(S530). 구체적으로, 디코딩 장치는 상기 4탭 필터를 기반으로 분수 샘플들을 생성할 수 있다. 디코딩 장치는 4개의 정수 샘플들 및 상기 4탭 필터를 기반으로 분수 샘플이 생성될 수 있다. 구체적으로, 참조 픽처에 대하여 가로 방향 및 세로 방향으로 상기 4탭 필터를 적용하여 분수 샘플들이 생성될 수 있다. 예를 들어, 가로 방향으로 상기 4탭 필터가 적용되는 경우, 생성되는 분수 샘플을 기준으로 좌측의 2개의 정수 샘플들과 우측의 2개의 정수 샘플들에 상기 4탭 필터가 적용되어 상기 분수 샘플이 생성될 수 있다. 또한, 세로 방향으로 상기 4탭 필터가 적용되는 경우, 생성되는 분수 샘플을 기준으로 상측의 2개의 정수 샘플들과 하측의 2개의 정수 샘플들에 상기 4탭 필터가 적용되어 상기 분수 샘플이 생성될 수 있다.
상기 현재 블록의 보간 필터가 8탭 필터로 결정된 경우, 디코딩 장치는 상기 현재 블록의 참조 픽처에 상기 8탭 필터를 적용할 수 있다(S540). 구체적으로, 디코딩 장치는 상기 8탭 필터를 기반으로 분수 샘플들을 생성할 수 있다. 디코딩 장치는 8개의 정수 샘플들 및 상기 8탭 필터를 기반으로 분수 샘플이 생성될 수 있다. 구체적으로, 참조 픽처에 대하여 가로 방향 및 세로 방향으로 상기 8탭 필터를 적용하여 분수 샘플들이 생성될 수 있다. 예를 들어, 가로 방향으로 상기 8탭 필터가 적용되는 경우, 생성되는 분수 샘플을 기준으로 좌측의 4개의 정수 샘플들과 우측의 4개의 정수 샘플들에 상기 8탭 필터가 적용되어 상기 분수 샘플이 생성될 수 있다. 또한, 세로 방향으로 상기 8탭 필터가 적용되는 경우, 생성되는 분수 샘플을 기준으로 상측의 4개의 정수 샘플들과 하측의 4개의 정수 샘플들에 상기 8탭 필터가 적용되어 상기 분수 샘플이 생성될 수 있다.
상기 현재 블록의 보간 필터가 12탭 필터로 결정된 경우, 디코딩 장치는 상기 현재 블록의 참조 픽처에 상기 12탭 필터를 적용할 수 있다(S550). 구체적으로, 디코딩 장치는 상기 12탭 필터를 기반으로 분수 샘플들을 생성할 수 있다. 디코딩 장치는 12개의 정수 샘플들 및 상기 12탭 필터를 기반으로 분수 샘플이 생성될 수 있다. 구체적으로, 참조 픽처에 대하여 가로 방향 및 세로 방향으로 상기 12탭 필터를 적용하여 분수 샘플들이 생성될 수 있다. 예를 들어, 가로 방향으로 상기 12탭 필터가 적용되는 경우, 생성되는 분수 샘플을 기준으로 좌측의 6개의 정수 샘플들과 우측의 6개의 정수 샘플들에 상기 12탭 필터가 적용되어 상기 분수 샘플이 생성될 수 있다. 또한, 세로 방향으로 상기 12탭 필터가 적용되는 경우, 생성되는 분수 샘플을 기준으로 상측의 6개의 정수 샘플들과 하측의 6개의 정수 샘플들에 상기 12탭 필터가 적용되어 상기 분수 샘플이 생성될 수 있다.
다음으로 디코딩 장치는 상기 현재 블록에 대한 움직임 보상을 수행할 수 있다(S560). 선택된 보간 필터를 기반으로 상기 분수 샘플이 생성된 경우, 디코딩 장치는 상기 분수 샘플이 포함된 참조 픽처를 기반으로 상기 현재 블록에 대한 움직임 보상을 수행할 수 있다. 상기 현재 블록에 머지 모드가 적용되는 경우, 디코딩 장치는 상기 현재 블록의 움직임 정보를 기반으로 상기 현재 블록의 분수 샘플 단위의 참조 블록을 도출할 수 있고, 상기 참조 블록을 기반으로 상기 현재 블록의 인터 예측을 수행할 수 있다. 또한, 상기 현재 블록에 AMVP 모드가 적용되는 경우, 디코딩 장치는 상기 현재 블록의 움직임 벡터 및 참조 픽처 인덱스를 기반으로 상기 현재 블록의 분수 샘플 단위의 참조 블록을 도출할 수 있고, 상기 참조 블록을 기반으로 상기 현재 블록의 인터 예측을 수행할 수 있다. 상기 현재 블록의 상기 인터 예측 정보는 상기 참조 픽처 인덱스를 포함할 수 있다.
또한, 상기 현재 블록의 움직임 벡터가 분수 샘플 단위의 움직임 벡터가 아닌 경우, 디코딩 장치는 상기 현재 블록의 참조 픽처를 기반으로 상기 현재 블록에 대한 움직임 보상을 수행할 수 있다. 상기 현재 블록에 머지 모드가 적용되는 경우, 디코딩 장치는 상기 현재 블록의 움직임 정보를 기반으로 상기 현재 블록의 참조 블록을 도출할 수 있고, 상기 참조 블록을 기반으로 상기 현재 블록의 인터 예측을 수행할 수 있다. 또한, 상기 현재 블록에 AMVP 모드가 적용되는 경우, 디코딩 장치는 상기 현재 블록의 움직임 벡터 및 참조 픽처 인덱스를 기반으로 상기 현재 블록의 참조 블록을 도출할 수 있고, 상기 참조 블록을 기반으로 상기 현재 블록의 인터 예측을 수행할 수 있다. 상기 현재 블록의 상기 인터 예측 정보는 상기 참조 픽처 인덱스를 포함할 수 있다.
한편, 상기 현재 블록의 움직임 보상을 위하여 4탭 필터, 8탭 필터 및 12탭 필터가 사용될 수 있는 경우, 상기 현재 블록의 인코딩 과정에서 사용된 보간 필터를 나타내는 정보가 시그널링될 수 있다. 즉, 상기 인코딩 장치는 상기 4탭 필터, 상기 8탭 필터 및 상기 12탭 필터 중 상기 현재 블록의 보간 필터를 결정할 수 있고, 상기 현재 블록의 보간 필터를 나타내는 정보가 인코딩되어 전송될 수 있다. 디코딩 장치는 상기 보간 필터를 나타내는 정보를 디코딩하여 획득할 수 있고, 상기 보간 필터를 나타내는 정보가 가리키는 보간 필터를 기반으로 상기 현재 블록의 움직임 보상을 수행할 수 있다.
상기 보간 필터를 나타내는 정보를 전송하는 방법은 상기 현재 블록에 상기 AMVP 모드가 적용되는 경우와 상기 머지 모드가 적용되는 경우로 적용될 수 있다.
일 예로, 상기 현재 블록에 상기 AMVP 모드가 적용되는 경우, MVD에 대한 신텍스(syntax) 상기 보간 필터를 나타내는 정보가 추가적으로 포함되어 전송될 수 있다. 상기 현재 블록에 상기 AMVP 모드가 적용되는 경우, 디코딩 장치는 상기 현재 블록의 주변 블록의 움직임 벡터들을 기반으로 MVP(motion vector predictor, MVP) 후보 리스트를 구성할 수 있고, 수신된 MVP 플래그를 기반으로 선택된 후보를 상기 현재 블록의 움직임 벡터 예측자(motion vector predictor, MVP)로 도출할 수 있다. 여기서, 상기 MVP 플래그는 상기 MVP 후보 리스트에 포함된 후보들 중 하나를 가리킬 수 있다. 디코딩 장치는 상기 MVP와 수신된 움직임 벡터 차분(motion, vector difference, MVD)를 기반으로 상기 현재 블록의 움직임 벡터를 도출할 수 있다. 한편, 상기 MVD는 MVD 신텍스를 통하여 나타낼 수 있다. 또한, 상기 보간 필터를 나타내는 정보는 상기 MVD 신텍스를 통하여 수신될 수 있다.
상기 보간 필터를 나타내는 정보가 포함된 상기 MVD 신텍스는 다음의 표와 같을 수 있다. 한편, 상기 보간 필터를 나타내는 정보는 보간 필터 인덱스라고 불릴 수 있다.
Figure PCTKR2018000091-appb-T000004
여기서, IF_idx[0] 는 참조 픽처 리스트 0(List 0, L0)에 대한 보간 필터 인덱스를 나타내는 신텍스 요소(syntax element)일 수 있다. 또는, 상기 IF_idx[0] 는 L0 예측에 대한 보간 필터 인덱스를 나타내는 신텍스 요소일 수 있다. 또는, 상기 IF_idx[0] 는 L0 방향에 대한 보간 필터 인덱스를 나타내는 신텍스 요소일 수 있다. 상기 L0 예측은 L0 움직임 정보를 기반으로 수행되는 인터 예측을 나타낼 수 있다. 상기 L0 움직임 정보는 상기 참조 픽처 리스트 0에 포함된 참조 픽처를 가리키는 L0 참조 픽처 인덱스 및 상기 참조 픽처에 대한 L0 움직임 벡터를 포함할 수 있다. 한편, 상기 L0 방향은 과거 방향 또는 순방향이라고 불릴 수도 있다.
또한, IF_idx[1] 는 참조 픽처 리스트 1(List 1, L1)에 대한 보간 필터 인덱스를 나타낼 수 있다. 또는, 상기 IF_idx[1] 는 L1 예측에 대한 보간 필터 인덱스를 나타낼 수 있다, 또는, 상기 IF_idx[1] 는 L1 방향에 대한 보간 필터 인덱스를 나타낼 수 있다. 상기 L1 예측은 L1 움직임 정보를 기반으로 수행되는 인터 예측을 나타낼 수 있다. 상기 L1 움직임 정보는 상기 참조 픽처 리스트 1에 포함된 참조 픽처를 가리키는 L1 참조 픽처 인덱스 및 상기 참조 픽처에 대한 L1 움직임 벡터를 포함할 수 있다. 한편, 상기 L1 방향은 미래 방향 또는 역방향이라고 불릴 수도 있다.
또한, abs_mvd_greater0_flag[n]는 Ln 방향에 대한 MVD의 절대값이 0보다 큰지를 가리키는 플래그 나타내는 신텍스 요소일 수 있다. 또한, abs_mvd_greater1_flag[n]는 Ln 방향에 대한 MVD의 절대값이 1보다 큰지를 가리키는 플래그에 대한 신텍스 요소를 나타내는 신텍스 요소일 수 있다.
상기 현재 블록에 대한 인터 예측을 수행함에 있어, L0 움직임 정보를 기반으로 인터 예측을 수행하는 경우 LO 예측이라고 불릴 수 있고, L1 움직임 정보를 기반으로 인터 예측을 수행하는 경우 L1 예측이라고 불릴 수 있으며, 상기 L0 움직임 정보 및 L1 움직임 정보를 기반으로 인터 예측을 수행하는 경우 쌍예측(bi-prediction)이라고 불릴 수 있다.
한편, 상술한 표 4와 같이 L0 방향 및 L1 방향 각각에 대한 별도의 보간 필터 인덱스가 전송되지 않고, 상기 L0 방향 및 L1 방향에 대한 하나의 보간 필터 인덱스가 전송될 수도 있다. 즉, 상기 L0 방향 및 상기 L1 방향에 동일한 보간 필터 인덱스가 적용될 수도 있다. 또한, 상기 현재 블록의 상기 MVD의 값이 분수 샘플 단위인지를 기반으로 상기 보간 필터 인덱스가 생략될 수도 있다. 예를 들어, 상기 MVD의 값이 분수 샘플 단위인 경우, 인코딩 장치는 상기 보간 필터 인덱스를 전송할 수 있고, 상기 MVD의 값이 분수 샘플 단위가 아닌 경우, 인코딩 장치는 상기 보간 필터 인덱스를 전송하지 않을 수 있다.
한편, 상술한 표 4에 도시된 것과 같이 상기 보간 필터 인덱스는 상기 현재 블록의 MVD가 1보다 큰 경우에 전송될 수 있다. 또한, 상기 보간 필터 인덱스의 이진화(binarization)는 8탭 필터, 12탭 필터, 4탭 필터에 대해 각각 0, 10, 11 등을 적용할 수 있다. 다시 말해, 상기 보간 필터 인덱스는 0, 10, 11으로 이진화될 수 있고, 상기 보간 필터 인덱스의 값이 0인 경우, 상기 보간 필터 인덱스는 상기 8탭 필터를 가리킬 수 있고, 상기 보간 필터 인덱스의 값이 10인 경우, 상기 보간 필터 인덱스는 상기 12탭 필터를 가리킬 수 있고, 상기 보간 필터 인덱스의 값이 11인 경우, 상기 보간 필터 인덱스는 상기 4탭 필터를 가리킬 수 있다.
다른 예로, 상기 현재 블록에 상기 머지 모드가 적용되는 경우, 인코딩 장치는 상기 현재 블록의 머지 인덱스 이후에 상기 보간 필터 인덱스를 전송할 수 있다. 이 경우, 디코딩 장치는 상기 보간 필터 인덱스를 기반으로 인코딩 과정에서 사용된 상기 현재 블록의 보간 필터를 도출할 수 있다. 한편, 상기 현재 블록에 상기 머지 모드가 적용되는 경우, 디코딩 장치는 상기 현재 블록의 주변 블록의 움직임 정보를 기반으로 머지 후보 리스트를 구성할 수 있고, 수신된 머지 인덱스를 기반으로 선택된 후보의 움직임 정보를 상기 현재 블록의 움직임 정보로 도출할 수 있다. 여기서, 상기 머지 인덱스는 상기 머지 후보 리스트에 포함된 후보들 중 하나를 가리킬 수 있다. 상기 보간 필터 인덱스가 포함된 신텍스는 다음의 표와 같을 수 있다.
Figure PCTKR2018000091-appb-T000005
여기서, IF_idx는 상기 보간 필터 인덱스를 나타내는 신텍스 요소일 수 있고, merge_idx 는 상기 머지 인덱스를 나타내는 신텍스 요소일 수 있다.
한편, 상술한 표 5에 도시된 것과 같이 하나의 보간 필터 인덱스를 기반으로 L0 예측 및 L1 예측(또는 L0 방향 및 L1 방향) 각각에 동일한 보간 필터가 적용될 수 있다. 머지 모드의 경우, 상기 머지 후보 리스트를 구성하지 않으면 쌍예측 수행 여부를 확인할 수 없는바, 하나의 보간 필터 인덱스를 기반으로 L0 예측 및 L1 예측에 동일한 보간 필터가 적용되는 것이 효율적일 수 있다. 그러나, 상기 L0 예측 및 상기 L1 예측(또는 상기 L0 방향 및 상기 L1 방향) 각각에 대한 보간 필터 인덱스가 전송될 수도 있다. 이 경우, 상기 L0 예측에 대한 보간 필터 인덱스를 기반으로 상기 L0 예측의 보간 필터가 도출될 수 있고, 상기 L1 예측에 대한 보간 필터 인덱스를 기반으로 상기 L1 예측의 보간 필터가 도출될 수 있다. IF_idx[0]는 상기 L0 예측에 대한 상기 보간 필터 인덱스의 신텍스 요소를 나타낼 수 있고, IF_idx[1]는 상기 L0 예측에 대한 상기 보간 필터 인덱스의 신텍스 요소를 나타낼 수 있다. 인코딩 장치는 상기 IF_idx[0] 및 IF_idx[1]를 순차적으로 인코딩하여 전송할 수 있다.
한편, 상기 현재 블록에 머지 모드가 적용되는 경우, 상기 보간 필터 인덱스가 전송되지 않고, 상기 머지 인덱스를 기반으로 선택된 상기 현재 블록의 주변 블록의 보간 필터에 대한 정보를 기반으로 상기 현재 블록의 보간 필터가 선택될 수도 있다. 즉, 상기 머지 인덱스를 기반으로 선택된 상기 주변 블록에 적용된 보간 필터가 상기 현재 블록의 보간 필터로 도출될 수 있다.
구체적으로, 상기 현재 블록의 머지 후보 리스트가 구성되는 경우, 상기 머지 후보 리스트의 후보는 상기 현재 블록의 주변 블록의 움직임 정보뿐만 아니라 보간 필터에 대한 정보를 포함할 수 있다. 다시 말해, 상기 머지 후보 리스트의 후보는 상기 주변 블록의 움직임 정보 및 상기 주변 블록의 보간 필터 인덱스를 포함할 수 있다. 상기 머지 인덱스를 기반으로 선택된 후보의 움직임 정보 및 상기 보간 필터 인덱스는 상기 현재 블록의 움직임 정보 및 상기 현재 블록의 보간 필터 인덱스로 도출될 수 있다.
도 6은 상기 현재 블록에 머지 모드가 적용된 경우, 주변 블록의 움직임 정보를 기반으로 상기 현재 블록의 보간 필터 인덱스를 도출하는 일 예를 나타낸다. 도 6을 참조하면 상기 현재 블록의 공간적(spatial) 주변 블록들 A0, A1, B0 및 B1의 움직임 정보들을 나타내는 공간적 후보(spatial candidate)들 및 상기 현재 블록의 시간적(temporal) 주변 블록 T0의 움직임 정보를 나타내는 시간적 후보(temporal candidate)를 포함한 머지 후보 리스트가 구성될 수 있다. 상기 머지 후보 리스트의 후보들 중 상기 현재 블록의 머지 인덱스가 가리키는 후보의 움직임 정보는 상기 현재 블록의 움직임 정보로 도출될 수 있다. 또한, 상기 후보의 보간 필터 인덱스는 상기 현재 블록의 보간 필터 인덱스로 도출될 수 있고, 상기 보간 필터 인덱스가 가리키는 보간 필터는 상기 현재 블록의 보간 필터로 도출될 수 있다. 예를 들어, 상기 현재 블록의 머지 인덱스는 상기 머지 후보 리스트의 후보들 중 A1을 나타낼 수 있고, 이 경우, 상기 A1의 예측에서 사용된 보간 필터는 상기 현재 블록의 보간 필터로 사용될 수 있다. 즉, 상기 A1의 보간 필터 인덱스는 상기 현재 블록의 보간 필터 인덱스로 도출될 수 있고, 상기 보간 필터 인덱스가 가리키는 보간 필터는 상기 현재 블록의 인터 예측에 사용될 수 있다.
한편, 상기 현재 블록에 AMVP 모드 또는 머지 모드가 적용되는지 여부와 상관없이 코딩 블록 레벨보다 상위의 레벨을 통하여 보간 필터에 대한 정보가 시그널링(signaling)될 수도 있다. 상기 보간 필터에 대한 정보는 보간 필터 정보라고 나타낼 수도 있다. 예를 들어, 상기 보간 필터에 대한 정보가 SPS(sequence parameter set), PPS(picture parameter set) 또는 슬라이스 헤더를 통하여 전송될 수 있고, 상기 보간 필터에 대한 정보가 전송되는 해당 레벨 범위 내 블록들은 상기 보간 필터에 대한 정보를 기반으로 선택된 보간 필터를 사용하여 인터 예측이 수행될 수 있다.
한편, 상기 현재 블록의 보간 필터 인덱스의 시그널링없이 디코딩 장치에서 상기 현재 블록의 보간 필터가 결정될 수도 있다. 예를 들어, 디코딩 장치는 RDO(rate-distortion optimization)을 통하여 상기 현재 블록의 보간 필터를 선택할 수 있다. 상기 현재 블록의 보간 필터 인덱스가 시그널링되는 방법은 상기 현재 블록의 움직임 보상의 정확도를 향상시킬 수 있으나, rate 측면에서는 추가적인 비트가 사용되어 코딩 효율이 저하될 수 있다. 이에, 추가적인 보간 필터에 대한 정보의 전송없이 디코딩 장치가 상기 현재 블록의 보간 필터를 결정하여 상기 현재 블록의 인터 예측에 사용하는 방법이 제안될 수 있다, 상술한 방법을 통하여 추가적인 비트의 사용 없이 상기 현재 블록의 움직임 보상의 효율을 향상시킬 수 있다.
일 예로, 현재 블록의 주변 샘플들을 기반으로 상기 현재 블록의 보상 필터가 결정될 수 있다. 디코딩 장치에서 사용할 수 있는 정보는 상기 현재 블록의 주변 샘플들 및 참조 픽처일 수 있다. 즉, 상기 현재 블록의 디코딩 시점에 이미 복원된 상기 현재 블록의 주변 샘플들 및 참조 픽처를 기반으로 상기 현재 블록의 보상 필터가 결정될 수 있다. 구체적으로, 상기 현재 블록의 템플릿(template)이 설정될 수 있고, 상기 현재 블록의 상기 템플릿과 동일한 형태의 참조 블록의 템플릿이 설정될 수 있다. 상기 현재 블록의 상기 템플릿과 상기 참조 블록의 상기 템플릿과의 비교를 통하여 상기 보간 필터가 결정될 수 있다. 여기서, 상기 참조 블록은 상기 현재 블록의 움직임 정보를 기반으로 도출된 참조 픽처 내 블록을 나타낼 수 있다.
도 7은 상기 현재 블록의 템플릿(template)의 일 예를 나타낸다. 여기서, 상기 현재 블록의 상기 템플릿은 상기 현재 블록의 주변 샘플들을 포함하는 특정 영역일 수 있다. 도 7의 (a)를 참조하면 상기 템플릿은 상기 현재 블록의 좌측 주변 샘플들, 좌상측 주변 샘플 및 상측 주변 샘플들을 포함하는 특정 영역일 수 있다. 또한, 도 7의 (b)를 참조하면 상기 템플릿은 상기 현재 블록의 상기 좌측 주변 샘플들 및 상기 상측 주변 샘플들을 포함하는 특정 영역일 수 있다. 또한, 도 7의 (c)를 참조하면 상기 템플릿은 상기 현재 블록의 상기 상측 주변 샘플들을 포함하는 특정 영역일 수 있다. 또한, 도 7의 (d)를 참조하면 상기 템플릿은 상기 현재 블록의 상기 좌측 주변 샘플들을 포함하는 특정 영역일 수 있다.
상기 현재 블록의 템플릿이 상기 도 7의 (a), (b), (c) 또는 (d)와 같이 설정될 수 있고, 상기 현재 블록의 템플릿과 동일한 형태로 상기 참조 블록의 템플릿이 설정될 수 있다. 상기 현재 블록의 템플릿과 상기 참조 블록의 템플릿이 도출된 경우, 디코딩 장치는 상기 현재 블록의 템플릿과 상기 참조 블록의 템플릿을 기반으로 상기 현재 블록의 보간 필터를 결정할 수 있다. 예를 들어, 상기 현재 블록의 템플릿과 상기 참조 블록의 템플릿의 주파수 특성이 서로 다른 경우와 유사한 경우로 나뉠 수 있고, 해당 경우에 따라 상기 현재 블록의 보간 필터가 선택될 수 있다. 구체적으로, 상기 현재 블록의 템플릿이 상기 참조 블록의 템플릿보다 고주파 성분을 더 많이 포함하는 경우, 상기 현재 블록의 데이터가 상기 참조 블록에 비해 더 높은 고주파 성분을 포함하고 있을 확률이 높으므로, 12탭 필터가 상기 현재 블록의 보간 필터로 도출될 수 있다. 또한, 상기 현재 블록의 템플릿이 상기 참조 블록의 템플릿보다 고주파 성분을 더 적게 포함하는 경우, 상기 참조 블록이 상기 현재 블록에 비해 더 높은 고주파 성분을 포함하고 있을 확률이 높으므로, 4탭 필터가 상기 현재 블록의 보간 필터로 도출될 수 있다.
또한, 상기 현재 블록의 템플릿의 고주파 성분과 상기 참조 블록의 템플릿의 고주파 성분이 유사한 경우, 8탭 필터가 상기 현재 블록의 보간 필터로 도출될 수 있다.
한편, 상기 현재 블록의 템플릿의 주파수 성분과 상기 참조 블록의 템플릿의 주파수 성분을 비교하는 방법은 각 템플릿 내의 분산을 이용하는 방법, 라플라시안 오퍼레이션(laplacian operation), 소벨 오퍼레이션(sobel operation) 등의 연산을 이용하는 방법, 주파수 변환을 이용하여 고주파 성분의 분포도를 확인하는 방법 등이 존재할 수 있다.
구체적으로, 예를 들어, 상기 템플릿의 분산을 이용하는 방법은 각 템플릿 내의 분산값을 계산하여 비교하는 방법을 나타낼 수 있다. 예를 들어, 상기 현재 블록의 템플릿에 포함된 주변 샘플들의 샘플값들의 분산값이 도출될 수 있고, 상기 참조 블록의 템플릿에 포함된 주변 샘플들의 샘플값들의 분산값이 도출될 수 있다. 이 경우, 템플릿의 분산값이 클수록 상기 템플릿의 고주파 성분이 강한 주파수 특성을 가질 수 있다. 다시 말해, 상기 현재 블록의 템플릿의 분산값이 상기 참조 블록의 템플릿의 분산값보다 큰 경우, 상기 현재 블록의 템플릿이 상기 참조 블록의 템플릿보다 고주파 성분을 더 많이 포함할 수 있고, 상기 현재 블록의 템플릿의 분산값이 상기 참조 블록의 템플릿의 분산값보다 작은 경우, 상기 현재 블록의 템플릿이 상기 참조 블록의 템플릿보다 고주파 성분을 더 적게 포함할 수 있다. 따라서, 상기 현재 블록의 템플릿의 분산값이 상기 참조 블록의 템플릿의 분산값보다 큰 경우, 상기 현재 블록의 보간 필터는 12탭 필터로 도출될 수 있고, 상기 현재 블록의 템플릿의 분산값이 상기 참조 블록의 템플릿의 분산값보다 작은 경우, 상기 현재 블록의 보간 필터는 4탭 필터로 도출될 수 있다. 또한, 상기 현재 블록의 템플릿의 분산값이 상기 참조 블록의 템플릿의 분산값과 유사한 경우, 상기 현재 블록의 보간 필터는 8탭 필터로 도출될 수 있다. 여기서, 상기 현재 블록의 템플릿의 분산값이 상기 참조 블록의 템플릿의 분산값과 유사한 경우는 상기 현재 블록의 템플릿의 분산값과 상기 참조 블록의 템플릿의 분산값과의 차분이 특정 범위 이내 또는 특정값보다 작은 경우를 나타낼 수 있다.
또한, 라플라시안 오퍼레이션, 소벨 오퍼레이션 등의 연산을 이용하는 방법은 다음과 같이 나타낼 수 있다.
도 8은 라플라시안 오퍼레이션 및 소벨 오퍼레이션의 일 예를 나타낸다. 도 8의 (a)는 라플라시안 오퍼레이터(operator)를 나타낼 수 있고, 도 8의 (b)는 x 축에 대한 소벨 오퍼레이터, 즉, x성분에 대한 소벨 오퍼레이터, 도 8의 (c)는 y 축에 대한 소벨 오퍼레이터, 즉, y성분에 대한 소벨 오퍼레이터를 나타낼 수 있다. 디코딩 장치는 상기 현재 블록의 템플릿에 상기 라플라시안 오퍼레이터를 적용하여 도출된 값과 상기 참조 블록의 템플릿에 상기 라플라시안 오퍼레이터를 적용하여 도출된 값을 기반으로 상기 현재 블록의 템플릿의 주파수 성분과 상기 참조 블록의 템플릿의 주파수 성분을 간접적으로 비교할 수 있다. 또는, 디코딩 장치는 상기 현재 블록의 템플릿에 상기 소벨 오퍼레이터를 적용하여 도출된 값과 상기 참조 블록의 템플릿에 상기 소벨 오퍼레이터를 적용하여 도출된 값을 기반으로 상기 현재 블록의 템플릿의 주파수 성분과 상기 참조 블록의 템플릿의 주파수 성분을 간접적으로 비교할 수 있다.
또한, 주파수 변환을 이용하여 고주파 성분의 분포도를 확인하는 방법은 다음과 같이 나타낼 수 있다.
도 9는 변환 도메인(domain), 즉, 주파수 도메인에서 고주파 성분과 저주파 성분의 위치를 예시적으로 나타낸다. 주파수 변환을 이용하는 방법은 예측 블록(predicted block), 레지듀얼 블록(residual block) 또는 복원 블록(reconstructed block)을 변환하여 주파수 도메인에서 해당 블록의 특성을 확인하는 방법을 나타낼 수 있다. 도 9에 도시된 바와 같이 주파수 도메인에서는 우하단에 발생하는 변환 계수들이 고주파 성분에 대한 빈도를 나타낼 수 있다. 즉, 우하단에 위치하는 변환 계수들이 클수록 해당 블록의 고주파 성분이 크다고 판단될 수 있다. 예를 들어, 고주파 성분에 해당하는 임의의 영역(910)에 존재하는 변환 계수들의 절대값의 합으로 고주파 성분의 정도를 표현할 수도 있다. 또는, 우하단에서 좌상단으로 지그재그로 이동하면서 고주파 성분이 처음 나타나는 위치와 우하단과의 거리를 고주파 성분의 정도로 사용할 수도 있다.
따라서, 상기 현재 블록의 템플릿과 상기 참조 블록의 템플릿의 주파수 특성을 비교하는 경우, 디코딩 장치는 상기 현재 블록의 템플릿과 상기 참조 블록의 템플릿을 변환할 수 있고, 상기 현재 블록의 템플릿의 고주파 성분에 대한 변환 계수 및 상기 현재 블록의 템플릿의 고주파 성분에 대한 변환 계수를 기반으로 상기 현재 블록의 보간 필터를 결정할 수 있다.
도 10은 상기 현재 블록의 템플릿과 상기 참조 블록의 템플릿을 기반으로 상기 현재 블록의 보간 필터를 도출하는 일 예를 나타낸다. 도 10을 참조하면 디코딩 장치는 상기 현재 블록의 템플릿과 상기 참조 블록의 템플릿을 기반으로 상기 현재 블록의 보간 필터를 결정할 수 있고, 상기 보간 필터를 기반으로 상기 현재 블록의 인터 예측을 수행할 수 있다.
디코딩 장치는 상기 현재 블록의 템플릿을 설정할 수 있다(S1000). 상기 현재 블록의 상기 템플릿은 상기 현재 블록의 주변 샘플들을 포함하는 특정 영역일 수 있다. 예를 들어, 상기 템플릿은 상기 현재 블록의 좌측 주변 샘플들, 좌상측 주변 샘플 및 상측 주변 샘플들을 포함하는 특정 영역일 수 있고, 또는 상기 현재 블록의 상기 좌측 주변 샘플들 및 상기 상측 주변 샘플들을 포함하는 특정 영역일 수 있다. 또는, 상기 템플릿은 상기 현재 블록의 상기 상측 주변 샘플들을 포함하는 특정 영역일 수 있고, 또는, 상기 템플릿은 상기 현재 블록의 상기 좌측 주변 샘플들을 포함하는 특정 영역일 수 있다. Cur_tmp 는 상기 현재 블록의 상기 템플릿을 나타내는 신텍스 요소일 수 있다.
디코딩 장치는 상기 참조 블록의 템플릿을 설정할 수 있다(S1010). 디코딩 장치는 상기 현재 블록의 상기 템플릿과 동일한 형태로 상기 참조 블록의 템플릿을 설정할 수 있다. 예를 들어, 상기 현재 블록의 상기 템플릿이 상기 현재 블록의 좌측 주변 샘플들, 좌상측 주변 샘플 및 상측 주변 샘플들을 포함하는 특정 영역으로 설정된 경우, 상기 참조 블록의 상기 템플릿은 상기 참조 블록의 좌측 주변 샘플들, 좌상측 주변 샘플 및 상측 주변 샘플들을 포함하는 특정 영역으로 설정될 수 있다. 또는, 상기 현재 블록의 상기 템플릿이 상기 현재 블록의 상기 좌측 주변 샘플들 및 상기 상측 주변 샘플들을 포함하는 특정 영역으로 설정된 경우, 상기 참조 블록의 상기 템플릿은 상기 참조 블록의 상기 좌측 주변 샘플들 및 상기 상측 주변 샘플들을 포함하는 특정 영역으로 설정될 수 있다. 또는, 상기 현재 블록의 상기 템플릿이 상기 현재 블록의 상기 좌측 주변 샘플들을 포함하는 특정 영역으로 설정된 경우, 상기 참조 블록의 상기 템플릿은 상기 참조 블록의 상기 좌측 주변 샘플들을 포함하는 특정 영역으로 설정될 수 있다. 또는, 상기 현재 블록의 상기 템플릿이 상기 현재 블록의 상기 상측 주변 샘플들을 포함하는 특정 영역으로 설정된 경우, 상기 참조 블록의 상기 템플릿은 상기 참조 블록의 상기 상측 주변 샘플들을 포함하는 특정 영역으로 설정될 수 있다. Ref_tmp 는 상기 참조 블록의 상기 템플릿을 나타내는 신텍스 요소일 수 있다.
디코딩 장치는 상기 현재 블록의 템플릿의 고주파 성분이 상기 참조 블록의 고주파 성분보다 많은지 판단할 수 있다(S1020). 상기 현재 블록의 템플릿의 주파수 성분과 상기 참조 블록의 템플릿의 주파수 성분을 비교하는 방법은 상술한 내용과 같이 템플릿의 분산을 이용하는 방법, 라플라시안 오퍼레이션(laplacian operation), 소벨 오퍼레이션(sobel operation) 등의 연산을 이용하는 방법, 주파수 변환을 이용하여 고주파 성분의 분포도를 확인하는 방법 등이 존재할 수 있다.
일 예로, 디코딩 장치는 상기 현재 블록의 템플릿의 분산값을 도출할 수 있다. 즉, 디코딩 장치는 상기 현재 블록의 템플릿에 포함된 주변 샘플들의 샘플값들의 분산값을 도출할 수 있다. 또한, 디코딩 장치는 상기 참조 블록의 템플릿의 분산값을 도출할 수 있다. 즉, 디코딩 장치는 상기 참조 블록의 템플릿에 포함된 주변 샘플들의 샘플값들의 분산값을 도출할 수 있다. 이 경우, 템플릿의 분산값이 클수록 상기 템플릿의 고주파 성분이 강한 주파수 특성을 가질 수 있다. 즉, 상기 템플릿의 분산값은 상기 템플릿의 고주파 성분의 많고 적음을 나타낼 수 있다. 디코딩 장치는 상기 현재 블록의 템플릿의 분산값 및 상기 참조 블록의 템플릿의 분산값을 기반으로 상기 현재 블록의 템플릿의 고주파 성분이 상기 참조 블록의 고주파 성분보다 많은지 판단할 수 있다. 상기 현재 블록의 템플릿의 분산값이 상기 참조 블록의 템플릿의 분산값보다 큰 경우, 디코딩 장치는 상기 현재 블록의 템플릿이 상기 참조 블록의 템플릿보다 고주파 성분이 더 많다고 판단할 수 있고, 상기 현재 블록의 템플릿의 분산값이 상기 참조 블록의 템플릿의 분산값보다 작은 경우, 상기 현재 블록의 템플릿이 상기 참조 블록의 템플릿보다 고주파 성분을 더 적다고 판단할 수 있다.
다른 일 예로, 디코딩 장치는 상기 현재 블록의 템플릿에 상술한 라플라시안 오퍼레이터를 적용하여 도출된 값과 상기 참조 블록의 템플릿에 상기 라플라시안 오퍼레이터를 적용하여 도출된 값을 기반으로 상기 현재 블록의 템플릿의 고주파 성분이 상기 참조 블록의 고주파 성분보다 많은지 판단할 수 있다. 또는, 디코딩 장치는 상기 현재 블록의 템플릿에 상술한 소벨 오퍼레이터를 적용하여 도출된 값과 상기 참조 블록의 템플릿에 상기 소벨 오퍼레이터를 적용하여 도출된 값을 기반으로 상기 현재 블록의 템플릿의 고주파 성분이 상기 참조 블록의 고주파 성분보다 많은지 판단할 수 있다.
다른 일 예로, 디코딩 장치는 상기 현재 블록의 템플릿과 상기 참조 블록의 템플릿을 변환할 수 있고, 상기 현재 블록의 템플릿의 고주파 성분에 대한 변환 계수 및 상기 현재 블록의 템플릿의 고주파 성분에 대한 변환 계수를 기반으로 상기 현재 블록의 보간 필터를 결정할 수 있다. 예를 들어, 디코딩 장치는 고주파 성분에 해당하는 임의의 영역에 존재하는 변환 계수들의 절대값의 합으로 고주파 성분의 정도를 표현할 수도 있다. 이 경우, 상기 현재 블록의 템플릿의 변환 계수들 중 상기 임의의 영역에 포함되는 변환 계수들의 절대값의 합과 상기 참조 블록의 템플릿의 변환 계수들 중 상기 임의의 영역에 포함되는 변환 계수들의 절대값의 합을 기반으로 상기 현재 블록의 템플릿의 고주파 성분이 상기 참조 블록의 고주파 성분보다 많은지 판단할 수 있다. 상기 현재 블록의 템플릿의 상기 임의의 영역에 포함되는 변환 계수들의 절대값의 합이 상기 참조 블록의 템플릿의 상기 임의의 영역에 포함되는 변환 계수들의 절대값의 합보다 큰 경우, 디코딩 장치는 상기 현재 블록의 템플릿이 상기 참조 블록의 템플릿보다 고주파 성분이 더 많다고 판단할 수 있고, 상기 현재 블록의 템플릿의 상기 임의의 영역에 포함되는 변환 계수들의 절대값의 합이 상기 참조 블록의 템플릿의 상기 임의의 영역에 포함되는 변환 계수들의 절대값의 합보다 작은 경우, 상기 현재 블록의 템플릿이 상기 참조 블록의 템플릿보다 고주파 성분을 더 적다고 판단할 수 있다.
또는, 디코딩 장치는 상기 현재 블록의 상기 템플릿의 상기 변환 계수들 중 최초로 도출된 고주파 성분에 대한 변환 계수의 위치 및 상기 참조 블록의 상기 템플릿의 상기 변환 계수들 중 최초로 도출된 고주파 성분에 대한 변환 계수의 위치를 기반으로 상기 현재 블록의 템플릿의 고주파 성분이 상기 참조 블록의 고주파 성분보다 많은지 판단할 수 있다. 디코딩 장치는 변환 도메인(즉, 주파수 도메인) 내 상기 현재 블록의 우하단에서 좌상단으로 지그재그로 이동하면서 최초로 도출된 고주파 성분에 대한 변환 계수와 우하단과의 거리를 도출할 수 있고, 변환 도메인(즉, 주파수 도메인) 내 상기 참조 블록의 우하단에서 좌상단으로 지그재그로 이동하면서 최초로 도출된 고주파 성분에 대한 변환 계수와 우하단과의 거리를 도출할 수 있다. 고주파 성분에 대한 변환 계수와 우하단과의 거리가 가까울수록 고주파 성분이 많다고 판단될 수 있다.
상기 현재 블록의 템플릿의 고주파 성분이 상기 참조 블록의 고주파 성분보다 많은 경우, 디코딩 장치는 상기 현재 블록의 보간 필터를 12탭 필터로 결정할 수 있다(S1030). 상기 현재 블록의 보간 필터가 상기 12탭 필터로 결정된 경우, 디코딩 장치는 상기 12탭 필터를 기반으로 상기 현재 블록의 움직임 보상을 수행할 수 있다(S1040). 즉, 디코딩 장치는 상기 12탭 필터를 기반으로 상기 현재 블록의 인터 예측을 수행할 수 있다. 디코딩 장치는 상기 12탭 필터를 상기 현재 블록의 참조 픽처에 적용하여 분수 샘플이 포함된 참조 픽처를 도출할 수 있고, 상기 현재 블록의 움직임 정보를 기반으로 상기 분수 샘플이 포함된 참조 픽처 내 분수 샘플 단위의 참조 블록을 도출할 수 있고, 상기 참조 블록을 기반으로 상기 현재 블록의 인터 예측을 수행할 수 있다.
상기 현재 블록의 템플릿의 고주파 성분이 상기 참조 블록의 고주파 성분보다 많지 않은 경우, 상기 현재 블록의 템플릿의 고주파 성분이 상기 참조 블록의 고주파 성분보다 적은지 판단할 수 있다(S1050). 디코딩 장치는 상술한 내용과 같이 템플릿의 분산을 이용하는 방법, 라플라시안 오퍼레이션(laplacian operation), 소벨 오퍼레이션(sobel operation) 등의 연산을 이용하는 방법, 주파수 변환을 이용하여 고주파 성분의 분포도를 확인하는 방법 등을 기반으로 상기 현재 블록의 템플릿의 고주파 성분이 상기 참조 블록의 고주파 성분보다 적은지 판단할 수 있다.
상기 현재 블록의 템플릿의 고주파 성분이 상기 참조 블록의 고주파 성분보다 적은 경우, 디코딩 장치는 상기 현재 블록의 보간 필터를 4탭 필터로 결정할 수 있다(S1060). 상기 현재 블록의 보간 필터가 상기 4탭 필터로 결정된 경우, 디코딩 장치는 상기 4탭 필터를 기반으로 상기 현재 블록의 움직임 보상을 수행할 수 있다(S1040). 즉, 디코딩 장치는 상기 4탭 필터를 기반으로 상기 현재 블록의 인터 예측을 수행할 수 있다. 디코딩 장치는 상기 4탭 필터를 상기 현재 블록의 참조 픽처에 적용하여 분수 샘플이 포함된 참조 픽처를 도출할 수 있고, 상기 현재 블록의 움직임 정보를 기반으로 상기 분수 샘플이 포함된 참조 픽처 내 분수 샘플 단위의 참조 블록을 도출할 수 있고, 상기 참조 블록을 기반으로 상기 현재 블록의 인터 예측을 수행할 수 있다.
상기 현재 블록의 템플릿의 고주파 성분이 상기 참조 블록의 고주파 성분보다 적지 않은 경우, 즉, 상기 현재 블록의 템플릿의 고주파 성분이 상기 참조 블록의 고주파 성분이 유사한 경우, 디코딩 장치는 상기 현재 블록의 보간 필터를 8탭 필터로 결정할 수 있다(S1070). 상기 현재 블록의 보간 필터가 상기 8탭 필터로 결정된 경우, 디코딩 장치는 상기 8탭 필터를 기반으로 상기 현재 블록의 움직임 보상을 수행할 수 있다(S1040). 즉, 디코딩 장치는 상기 8탭 필터를 기반으로 상기 현재 블록의 인터 예측을 수행할 수 있다. 디코딩 장치는 상기 8탭 필터를 상기 현재 블록의 참조 픽처에 적용하여 분수 샘플이 포함된 참조 픽처를 도출할 수 있고, 상기 현재 블록의 움직임 정보를 기반으로 상기 분수 샘플이 포함된 참조 픽처 내 분수 샘플 단위의 참조 블록을 도출할 수 있고, 상기 참조 블록을 기반으로 상기 현재 블록의 인터 예측을 수행할 수 있다.
한편, 상기 현재 블록의 보간 필터 인덱스의 시그널링없이 상기 현재 블록의 보간 필터를 결정하는 방법으로 상기 현재 블록의 참조 블록의 특성을 분석하여 보간 필터를 결정하는 방법이 제안될 수 있다.
도 11은 상기 현재 블록의 상기 참조 블록을 기반으로 상기 현재 블록의 보간 필터를 도출하는 일 예를 나타낸다. 도 11을 참조하면 디코딩 장치는 상기 참조 블록의 주파수 특성을 기반으로 상기 현재 블록의 보간 필터를 결정할 수 있고, 상기 보간 필터를 기반으로 상기 현재 블록의 인터 예측을 수행할 수 있다.
디코딩 장치는 현재 블록의 참조 블록의 고주파 성분을 수치화할 수 있다(S1100). 상기 참조 블록의 고주파 성분을 수치화하는 방법은 상기 참조 블록의 분산을 이용하는 방법, 라플라시안 오퍼레이션(laplacian operation), 소벨 오퍼레이션(sobel operation) 등의 연산을 이용하는 방법, 주파수 변환을 이용하여 고주파 성분의 분포도를 확인하는 방법 등을 포함할 수 있다.
일 예로, 디코딩 장치는 상기 참조 블록의 분산값을 도출할 수 있다. 즉, 디코딩 장치는 상기 참조 블록에 포함된 복원 샘플들의 샘플값들의 분산값을 도출할 수 있다. 이 경우, 참조 블록의 분산값이 클수록 상기 참조 블록은 고주파 성분이 강할 수 있다. 즉, 상기 템플릿의 분산값은 상기 템플릿의 고주파 성분의 많고 적음을 나타낼 수 있다.
다른 일 예로, 디코딩 장치는 상기 참조 블록에 상술한 라플라시안 오퍼레이터를 기반으로 상기 참조 블록의 고주파 성분을 수치화할 수 있다. 디코딩 장치는 상기 참조 블록에 상기 라플라시안 오퍼레이터를 적용할 수 있고, 상기 참조 블록에 상기 라플라시안 오퍼레이터를 적용하여 도출된 값을 기반으로 상기 참조 블록의 고주파 성분을 판단할 수 있다. 또는, 디코딩 장치는 상기 참조 블록에 상술한 소벨 오퍼레이터를 적용할 수 있고, 상기 참조 블록에 상기 소벨 오퍼레이터를 적용하여 도출된 값을 기반으로 상기 참조 블록의 고주파 성분을 판단할 수 있다.
다른 일 예로, 디코딩 장치는 상기 참조 블록을 변환할 수 있고, 상기 참조 블록의 고주파 성분에 대한 변환 계수를 기반으로 상기 현재 블록의 보간 필터를 결정할 수 있다. 예를 들어, 디코딩 장치는 상기 참조 블록의 변환 계수들 중 고주파 성분에 해당하는 임의의 영역에 존재하는 변환 계수들의 절대값의 합으로 고주파 성분의 정도를 표현할 수도 있다. 이 경우, 상기 참조 블록의 변환 계수들 중 상기 임의의 영역에 포함되는 변환 계수들의 절대값의 합을 기반으로 상기 참조 블록의 고주파 성분을 판단할 수 있다.
또는, 디코딩 장치는 상기 참조 블록의 상기 변환 계수들 중 최초로 도출된 고주파 성분에 대한 변환 계수의 위치를 기반으로 상기 참조 블록의 고주파 성분을 판단할 수 있다. 디코딩 장치는 변환 도메인(즉, 주파수 도메인) 내 상기 참조 블록의 우하단에서 좌상단으로 지그재그로 이동하면서 최초로 도출된 고주파 성분에 대한 변환 계수와 우하단과의 거리를 도출할 수 있다. 고주파 성분에 대한 변환 계수와 우하단과의 거리가 가까울수록 고주파 성분이 많다고 판단될 수 있다.
디코딩 장치는 상기 참조 블록의 고주파 성분이 제1 임계값(threshold)보다 작은지 판단할 수 있다(S1110). 상기 참조 블록의 고주파 성분의 수치화된 값이 상기 제1 임계값보다 작은 경우를 상기 참조 블록의 고주파 성분이 약하다고 할 수 있다. 상기 참조 블록의 고주파 성분이 약한 경우, 디코딩 장치는 상기 현재 블록의 보간 필터를 12탭 필터로 도출할 수 있다.
예를 들어, 상기 참조 블록의 분산값이 도출된 경우, 디코딩 장치는 상기 참조 블록의 분산값이 상기 제1 임계값보다 작은지 판단할 수 있다. 또한, 상기 참조 블록에 상기 라플라시안 오퍼레이터가 적용된 경우, 디코딩 장치는 상기 참조 블록에 상기 라플라시안 오퍼레이터를 적용하여 도출된 값이 상기 제1 임계값보다 작은지 판단할 수 있다. 또한, 상기 참조 블록에 상기 소벨 오퍼레이터가 적용된 경우, 디코딩 장치는 상기 참조 블록에 상기 소벨 오퍼레이터를 적용하여 도출된 값이 상기 제1 임계값보다 작은지 판단할 수 있다. 또한, 상기 참조 블록의 고주파 성분에 해당하는 임의의 영역에 존재하는 변환 계수들의 절대값의 합이 도출된 경우, 디코딩 장치는 상기 변환 계수들의 절대값의 합이 상기 제1 임계값보다 작은지 판단할 수 있다. 또한, 변환 도메인(즉, 주파수 도메인) 내 상기 참조 블록의 최초로 도출된 고주파 성분에 대한 변환 계수와 우하단과의 거리가 도출된 경우, 디코딩 장치는 상기 거리가 상기 제1 임계값보다 작은지 판단할 수 있다.
상기 참조 블록의 고주파 성분이 상기 제1 임계값보다 작은 경우, 디코딩 장치는 상기 현재 블록의 보간 필터를 12탭 필터로 결정할 수 있다(S1120). 상기 현재 블록의 보간 필터가 상기 12탭 필터로 결정된 경우, 디코딩 장치는 상기 12탭 필터를 기반으로 상기 현재 블록의 움직임 보상을 수행할 수 있다(S1130). 즉, 디코딩 장치는 상기 12탭 필터를 기반으로 상기 현재 블록의 인터 예측을 수행할 수 있다. 디코딩 장치는 상기 12탭 필터를 상기 현재 블록의 참조 픽처에 적용하여 분수 샘플이 포함된 참조 픽처를 도출할 수 있고, 상기 현재 블록의 움직임 정보를 기반으로 상기 분수 샘플이 포함된 참조 픽처 내 분수 샘플 단위의 참조 블록을 도출할 수 있고, 상기 참조 블록을 기반으로 상기 현재 블록의 인터 예측을 수행할 수 있다.
상기 참조 블록의 고주파 성분이 상기 제1 임계값보다 작지 않은 경우, 디코딩 장치는 상기 참조 블록의 고주파 성분이 제2 임계값(threshold)보다 큰지 판단할 수 있다(S1140). 상기 참조 블록의 고주파 성분의 수치화된 값이 상기 제2 임계값보다 큰 경우를 상기 참조 블록의 고주파 성분이 강하고 할 수 있다. 상기 참조 블록의 고주파 성분이 강한 경우, 디코딩 장치는 상기 현재 블록의 보간 필터를 4탭 필터로 도출할 수 있다.
예를 들어, 상기 참조 블록의 분산값이 도출된 경우, 디코딩 장치는 상기 참조 블록의 분산값이 상기 제2 임계값보다 큰지 판단할 수 있다. 또한, 상기 참조 블록에 상기 라플라시안 오퍼레이터가 적용된 경우, 디코딩 장치는 상기 참조 블록에 상기 라플라시안 오퍼레이터를 적용하여 도출된 값이 상기 제2 임계값보다 큰지 판단할 수 있다. 또한, 상기 참조 블록에 상기 소벨 오퍼레이터가 적용된 경우, 디코딩 장치는 상기 참조 블록에 상기 소벨 오퍼레이터를 적용하여 도출된 값이 상기 제2 임계값보다 큰지 판단할 수 있다. 또한, 상기 참조 블록의 고주파 성분에 해당하는 임의의 영역에 존재하는 변환 계수들의 절대값의 합이 도출된 경우, 디코딩 장치는 상기 변환 계수들의 절대값의 합이 상기 제2 임계값보다 큰지 판단할 수 있다. 또한, 변환 도메인(즉, 주파수 도메인) 내 상기 참조 블록의 최초로 도출된 고주파 성분에 대한 변환 계수와 우하단과의 거리가 도출된 경우, 디코딩 장치는 상기 거리가 상기 제2 임계값보다 큰지 판단할 수 있다.
상기 참조 블록의 고주파 성분이 상기 제2 임계값보다 큰 경우, 디코딩 장치는 상기 현재 블록의 보간 필터를 4탭 필터로 결정할 수 있다(S1150). 상기 현재 블록의 보간 필터가 상기 4탭 필터로 결정된 경우, 디코딩 장치는 상기 4탭 필터를 기반으로 상기 현재 블록의 움직임 보상을 수행할 수 있다(S1130). 즉, 디코딩 장치는 상기 4탭 필터를 기반으로 상기 현재 블록의 인터 예측을 수행할 수 있다. 디코딩 장치는 상기 4탭 필터를 상기 현재 블록의 참조 픽처에 적용하여 분수 샘플이 포함된 참조 픽처를 도출할 수 있고, 상기 현재 블록의 움직임 정보를 기반으로 상기 분수 샘플이 포함된 참조 픽처 내 분수 샘플 단위의 참조 블록을 도출할 수 있고, 상기 참조 블록을 기반으로 상기 현재 블록의 인터 예측을 수행할 수 있다.
상기 참조 블록의 고주파 성분이 상기 제2 임계값보다 크지 않은 경우, 디코딩 장치는 상기 현재 블록의 보간 필터를 8탭 필터로 결정할 수 있다(S1160). 상기 현재 블록의 보간 필터가 상기 8탭 필터로 결정된 경우, 디코딩 장치는 상기 8탭 필터를 기반으로 상기 현재 블록의 움직임 보상을 수행할 수 있다(S1130). 즉, 디코딩 장치는 상기 8탭 필터를 기반으로 상기 현재 블록의 인터 예측을 수행할 수 있다. 디코딩 장치는 상기 8탭 필터를 상기 현재 블록의 참조 픽처에 적용하여 분수 샘플이 포함된 참조 픽처를 도출할 수 있고, 상기 현재 블록의 움직임 정보를 기반으로 상기 분수 샘플이 포함된 참조 픽처 내 분수 샘플 단위의 참조 블록을 도출할 수 있고, 상기 참조 블록을 기반으로 상기 현재 블록의 인터 예측을 수행할 수 있다.
한편, 상기 제1 임계값은 기설정된 값으로 도출될 수 있다. 상기 제1 임계값은 모든 경우에 동일한 값(즉, 상기 기설정된 값)이 적용될 수 있다. 또는, 상기 제1 임계값에 대한 정보가 시그널링될 수 있다. 예를 들어, 상기 제1 임계값에 대한 정보는 SPS(sequence parameter set) 또는 PPS(picture parameter set)와 같은 상위 레벨 신텍스를 통하여 전송될 수 있다. 또는, 상기 제1 임계값에 대한 정보는 슬라이스, CU(coding unit) 또는 PU 단위로 전송될 수도 있다.
또한, 상기 제2 임계값은 기설정된 값으로 도출될 수 있다. 상기 제2 임계값은 모든 경우에 동일한 값(즉, 상기 기설정된 값)이 적용될 수 있다. 또는, 상기 제2 임계값에 대한 정보가 시그널링될 수 있다. 예를 들어, 상기 제2 임계값에 대한 정보는 SPS(sequence parameter set) 또는 PPS(picture parameter set)와 같은 상위 레벨 신텍스를 통하여 전송될 수 있다. 또는, 상기 제2 임계값에 대한 정보는 슬라이스, CU(coding unit) 또는 PU 단위로 전송될 수도 있다.
한편, 고주파 성분 분석은 픽처 단위로 수행될 수도 있다. 즉, 상기 참조 픽처를 기반으로 상기 현재 블록의 보간 필터가 도출될 수 있다. 이 경우, 상기 현재 블록이 포함된 현재 픽처가 인코딩/디코딩되기 이전에 참조 픽처의 전체적인 특성(예를 들어 주파수 특성)이 분석될 수 있고, 상기 참조 픽처를 기반으로 움직임 보상이 수행되는 경우, 상기 분석된 참조 픽처의 특성에 따라 특정 보간 필터가 적용되도록 설정될 수 있다. 이때, 상기 참조 픽처의 고주파 성분을 분석하는 방법은 상술한 참조 블록의 고주파 성분을 분석하는 방법과 동일하게 적용될 수 있다. 또한, 상기 참조 픽처에 대한 임계값을 전송하는 방법은 상기 참조 블록의 임계값을 전송하는 방법과 동일하게 적용될 수 있다.
도 12는 본 발명에 따른 인코딩 장치에 의한 비디오 인코딩 방법을 개략적으로 나타낸다. 도 12에서 개시된 방법은 도 1에서 개시된 인코딩 장치에 의하여 수행될 수 있다. 구체적으로 예를 들어, 도 12의 S1200 내지 S1220은 상기 인코딩 장치의 예측부에 의하여 수행될 수 있고, S1230은 상기 인코딩 장치의 엔트로피 인코딩부에 의하여 수행될 수 있다.
인코딩 장치는 현재 블록의 움직임 정보를 생성한다(S1200). 인코딩 장치는 상기 현재 블록에 대하여 인터 예측을 적용할 수 있다. 상기 현재 블록에 인터 예측이 적용되는 경우, 인코딩 장치는 스킵(skip) 모드, 머지(merge) 모드, 및 AMVP(adaptive motion vector prediction) 모드 중 어느 하나를 적용하여 상기 현재 블록에 대한 움직임 정보를 생성할 수 있다. 스킵 모드와 머지 모드의 경우에, 인코딩 장치는 상기 현재 블록의 주변 블록의 움직임 정보를 기반으로 상기 현재 블록의 움직임 정보로 생성할 수 있다. 상기 움직임 정보는 움직임 벡터와 참조 픽처 인덱스를 포함할 수 있다. 상기 움직임 정보는 쌍예측(bi-prediction) 움직임 정보일 수 있고, 또는 단예측(uni-prediction) 움직임 정보일 수 있다. 상기 쌍예측 움직임 정보는 L0 참조 픽처 인덱스 및 L0 움직임 벡터, L1 참조 픽처 인덱스 및 L1 움직임 벡터를 포함할 수 있고, 상기 단예측 움직임 정보는 L0 참조 픽처 인덱스 및 L0 움직임 벡터를 포함할 수 있고, 또는 L1 참조 픽처 인덱스 및 L1 움직임 벡터를 포함할 수 있다. 상기 L0은 참조 픽처 리스트 L0(List 0)를 나타내고, 상기 L1은 참조 픽처 리스트 L1(List 1)를 나타낸다.
AMVP 모드의 경우, 인코딩 장치는 상기 현재 블록의 주변 블록의 움직임 벡터를 상기 현재 블록의 움직임 벡터 예측자(motion vector predictor, MVP)로 이용하여 상기 현재 블록의 움직임 벡터를 유도할 수 있고, 상기 움직임 벡터 및 상기 움직임 벡터에 대한 참조 픽처 인덱스를 포함한 상기 움직임 정보를 생성할 수 있다.
인코딩 장치는 복수의 보간 필터들 중 상기 현재 블록의 보간 필터를 결정한다(S1210). 상기 복수의 보간 필터는 4탭 필터, 8탭 필터 및 12탭 필터를 포함할 수 있다. 인코딩 장치는 상기 현재 블록이 포함된 현재 픽처의 해상도를 기반으로 상기 현재 블록의 보간 필터를 결정할 수 있다. 예를 들어, 상기 현재 픽처의 해상도가 HD 해상도(1366x768 해상도) 미만의 해상도인 경우, 인코딩 장치는 상기 현재 블록의 보간 필터를 12탭 필터로 결정할 수 있다. 또한, 상기 현재 픽처의 해상도가 4K 해상도(3840x2160 해상도)인 경우, 인코딩 장치는 상기 현재 블록의 보간 필터를 4탭 필터로 결정할 수 있다. 또한, 상기 현재 픽처의 해상도가 HD 해상도(1366x768 해상도) 이상의 해상도이고 상기 4K 해상도가 아닌 경우, 인코딩 장치는 상기 현재 블록의 보간 필터를 8탭 필터로 결정할 수 있다.
다른 예로, 인코딩 장치는 상기 현재 블록의 템플릿 및 참조 블록의 템플릿을 기반으로 상기 현재 블록의 보간 필터를 결정할 수 있다. 구체적으로, 인코딩 장치는 상기 현재 블록의 템플릿 및 참조 블록의 템플릿의 주파수 특성을 비교하여 상기 현재 블록의 보간 필터를 결정할 수 있다. 여기서, 상기 참조 블록은 상기 현재 블록의 움직임 정보를 기반으로 도출될 수 있다. 즉, 상기 참조 블록은 상기 움직임 정보가 나타내는 참조 픽처 내 복원 블록을 나타낼 수 있다.
인코딩 장치는 상기 현재 블록의 주변 샘플들을 기반으로 상기 현재 블록의 템플릿을 도출할 수 있다. 상기 현재 블록의 템플릿은 상기 현재 블록의 주변 샘플들을 포함하는 특정 영역일 수 있다. 예를 들어, 상기 템플릿은 상기 현재 블록의 좌측 주변 샘플들, 좌상측 주변 샘플 및 상측 주변 샘플들을 포함하는 특정 영역일 수 있고, 또는 상기 현재 블록의 상기 좌측 주변 샘플들 및 상기 상측 주변 샘플들을 포함하는 특정 영역일 수 있다. 또는, 상기 템플릿은 상기 현재 블록의 상기 상측 주변 샘플들을 포함하는 특정 영역일 수 있고, 또는, 상기 템플릿은 상기 현재 블록의 상기 좌측 주변 샘플들을 포함하는 특정 영역일 수 있다.
또한, 인코딩 장치는 상기 참조 블록의 주변 샘플들을 기반으로 상기 참조 블록의 템플릿을 도출할 수 있는바, 상기 현재 블록의 템플릿과 동일한 형태로 상기 참조 블록의 템플릿을 도출할 수 있다. 예를 들어, 상기 현재 블록의 상기 템플릿이 상기 현재 블록의 좌측 주변 샘플들, 좌상측 주변 샘플 및 상측 주변 샘플들을 포함하는 특정 영역인 경우, 상기 참조 블록의 상기 템플릿은 상기 참조 블록의 좌측 주변 샘플들, 좌상측 주변 샘플 및 상측 주변 샘플들을 포함하는 특정 영역으로 도출될 수 있다. 또는, 상기 현재 블록의 상기 템플릿이 상기 현재 블록의 상기 좌측 주변 샘플들 및 상기 상측 주변 샘플들을 포함하는 특정 영역인 경우, 상기 참조 블록의 상기 템플릿은 상기 참조 블록의 상기 좌측 주변 샘플들 및 상기 상측 주변 샘플들을 포함하는 특정 영역으로 도출될 수 있다. 또는, 상기 현재 블록의 상기 템플릿이 상기 현재 블록의 상기 좌측 주변 샘플들을 포함하는 특정 영역인 경우, 상기 참조 블록의 상기 템플릿은 상기 참조 블록의 상기 좌측 주변 샘플들을 포함하는 특정 영역으로 도출될 수 있다. 또는, 상기 현재 블록의 상기 템플릿이 상기 현재 블록의 상기 상측 주변 샘플들을 포함하는 특정 영역인 경우, 상기 참조 블록의 상기 템플릿은 상기 참조 블록의 상기 상측 주변 샘플들을 포함하는 특정 영역으로 도출될 수 있다.
상기 현재 블록의 템플릿 및 상기 참조 블록의 템플릿이 도출된 경우, 인코딩 장치는 상기 현재 블록의 템플릿과 상기 참조 블록의 템플릿의 주파수 특성을 비교하여 상기 현재 블록의 보간 필터를 결정할 수 있다.
예를 들어, 상기 현재 블록의 템플릿이 상기 참조 블록의 템플릿보다 고주파 성분을 더 많이 포함하는 경우, 인코딩 장치는 상기 현재 블록의 보간 필터를 12탭 필터로 결정할 수 있다. 또한, 상기 현재 블록의 템플릿이 상기 참조 블록의 템플릿보다 고주파 성분을 더 적게 포함하는 경우, 인코딩 장치는 상기 현재 블록의 보간 필터를 4탭 필터로 결정할 수 있다. 또한, 상기 현재 블록의 템플릿과 상기 참조 블록의 템플릿이 유사한 정도의 고주파 성분을 포함하는 경우, 인코딩 장치는 상기 현재 블록의 보간 필터를 8탭 필터로 결정할 수 있다.
구체적으로, 상기 현재 블록의 템플릿과 상기 참조 블록의 템플릿의 고주파 성분을 비교하기 위하여 각 템플릿의 분산값이 이용될 수 있다.
예를 들어, 상기 현재 블록의 템플릿 및 상기 참조 블록의 템플릿이 도출된 경우, 인코딩 장치는 상기 현재 블록의 템플릿의 분산값을 도출할 수 있고, 상기 참조 블록의 템플릿의 분산값을 도출할 수 있다. 여기서, 상기 현재 블록의 템플릿의 분산값은 상기 현재 블록의 템플릿에 포함된 주변 샘플들의 샘플값의 분산값을 나타낼 수 있고, 상기 참조 블록의 템플릿의 분산값은 상기 참조 블록의 템플릿에 포함된 복원 샘플들의 샘플값의 분산값을 나타낼 수 있다. 인코딩 장치는 상기 현재 블록의 템플릿의 분산값 및 상기 참조 블록의 템플릿의 분산값을 기반으로 상기 현재 블록의 보간 필터를 결정할 수 있다. 예를 들어, 상기 현재 블록의 템플릿의 분산값이 상기 참조 블록의 분산값보다 큰 경우(즉, 상기 현재 블록의 템플릿의 분산값에서 상기 참조 블록의 분산값을 뺀 값이 특정값보다 큰 경우), 인코딩 장치는 상기 현재 블록의 보간 필터를 12탭 필터로 결정할 수 있다. 또한, 상기 현재 블록의 템플릿의 분산값이 상기 참조 블록의 분산값보다 작은 경우(즉, 상기 참조 블록의 템플릿의 분산값에서 상기 현재 블록의 분산값을 뺀 값이 특정값보다 큰 경우), 인코딩 장치는 상기 현재 블록의 보간 필터를 4탭 필터로 결정할 수 있다. 또한, 상기 현재 블록의 템플릿의 분산값과 상기 참조 블록의 분산값이 유사한 경우(즉, 상기 현재 블록의 템플릿의 분산값에서 상기 참조 블록의 분산값을 뺀 값이 특정값 이하인 경우 또는 상기 현재 블록의 템플릿의 분산값과 상기 참조 블록의 분산값과의 차분(difference)이 특정 범위에 포함되는 경우), 인코딩 장치는 상기 현재 블록의 보간 필터를 8탭 필터로 결정할 수 있다.
또한, 상기 현재 블록의 템플릿과 상기 참조 블록의 템플릿의 고주파 성분을 비교하기 위하여 라플라시안 오퍼레이션(laplacian operation) 또는 소벨 오퍼레이션(sobel operation) 등의 연산이 이용될 수 있다.
예를 들어, 상기 현재 블록의 템플릿 및 상기 참조 블록의 템플릿이 도출된 경우, 인코딩 장치는 상기 현재 블록의 템플릿에 라플라시안 오퍼레이터를 적용하여 제1값을 도출할 수 있고, 상기 참조 블록의 템플릿에 상기 라플라시안 오퍼레이터를 적용하여 제2값을 도출할 수 있다. 즉, 인코딩 장치는 상기 라플라시안 오퍼레이터를 기반으로 상기 현재 블록의 템플릿의 제1값을 도출할 수 있고, 상기 라플라시안 오퍼레이터를 기반으로 상기 참조 블록의 템플릿의 제2값을 도출할 수 있다. 이 경우, 인코딩 장치는 상기 현재 블록의 템플릿의 상기 제1값 및 상기 참조 블록의 템플릿의 상기 제2값을 기반으로 상기 현재 블록의 보간 필터를 결정할 수 있다. 예를 들어, 상기 현재 블록의 템플릿의 제1값이 상기 참조 블록의 제2값보다 큰 경우(즉, 상기 현재 블록의 템플릿의 제1값에서 상기 참조 블록의 제2값을 뺀 값이 특정값보다 큰 경우), 인코딩 장치는 상기 현재 블록의 보간 필터를 12탭 필터로 결정할 수 있다. 또한, 상기 현재 블록의 템플릿의 제1값이 상기 참조 블록의 제2값보다 작은 경우(즉, 상기 참조 블록의 템플릿의 제2값에서 상기 현재 블록의 제1값을 뺀 값이 특정값보다 큰 경우), 인코딩 장치는 상기 현재 블록의 보간 필터를 4탭 필터로 결정할 수 있다. 또한, 상기 현재 블록의 템플릿의 제1값과 상기 참조 블록의 제2값이 유사한 경우(즉, 상기 현재 블록의 템플릿의 제1값에서 상기 참조 블록의 제2값을 뺀 값이 특정값 이하인 경우 또는 상기 현재 블록의 템플릿의 제1값과 상기 참조 블록의 제2값과의 차분(difference)이 특정 범위에 포함되는 경우), 인코딩 장치는 상기 현재 블록의 보간 필터를 8탭 필터로 결정할 수 있다.
또한, 인코딩 장치는 상기 현재 블록의 템플릿에 소벨 오퍼레이터를 적용하여 제1값을 도출할 수 있고, 상기 참조 블록의 템플릿에 상기 소벨 오퍼레이터를 적용하여 제2값을 도출할 수 있다. 즉, 인코딩 장치는 상기 소벨 오퍼레이터를 기반으로 상기 현재 블록의 템플릿의 제1값을 도출할 수 있고, 상기 소벨 오퍼레이터를 기반으로 상기 참조 블록의 템플릿의 제2값을 도출할 수 있다. 이 경우, 인코딩 장치는 상기 현재 블록의 템플릿의 상기 제1값 및 상기 참조 블록의 템플릿의 상기 제2값을 기반으로 상기 현재 블록의 보간 필터를 도출할 수 있다. 예를 들어, 상기 현재 블록의 템플릿의 제1값이 상기 참조 블록의 제2값보다 큰 경우(즉, 상기 현재 블록의 템플릿의 제1값에서 상기 참조 블록의 제2값을 뺀 값이 특정값보다 큰 경우), 인코딩 장치는 상기 현재 블록의 보간 필터를 12탭 필터로 결정할 수 있다. 또한, 상기 현재 블록의 템플릿의 제1값이 상기 참조 블록의 제2값보다 작은 경우(즉, 상기 참조 블록의 템플릿의 제2값에서 상기 현재 블록의 제1값을 뺀 값이 특정값보다 큰 경우), 인코딩 장치는 상기 현재 블록의 보간 필터를 4탭 필터로 결정할 수 있다. 또한, 상기 현재 블록의 템플릿의 제1값과 상기 참조 블록의 제2값이 유사한 경우(즉, 상기 현재 블록의 템플릿의 제1값에서 상기 참조 블록의 제2값을 뺀 값이 특정값 이하인 경우 또는 상기 현재 블록의 템플릿의 제1값과 상기 참조 블록의 제2값과의 차분(difference)이 특정 범위에 포함되는 경우), 인코딩 장치는 상기 현재 블록의 보간 필터를 8탭 필터로 결정할 수 있다.
또한, 상기 현재 블록의 템플릿과 상기 참조 블록의 템플릿의 고주파 성분을 비교하기 위하여 주파수 변환을 이용하여 고주파 성분의 분포도를 확인하는 방법이 이용될 수 있다.
예를 들어, 인코딩 장치는 상기 현재 블록의 템플릿과 상기 참조 블록의 템플릿을 변환하여 상기 현재 블록의 템플릿의 변환 계수들 및 상기 참조 블록의 템플릿의 변환 계수들을 도출할 수 있고, 상기 현재 블록의 템플릿의 변환 계수들 중 특정 영역에 포함하는 변환 계수들의 절대값의 합인 제1값과 상기 참조 블록의 템플릿의 변환 계수들 중 상기 특정 영역에 포함하는 변환 계수들의 절대값의 합인 제2값을 도출할 수 있다. 상기 특정 영역은 주파수 도메인 상에서의 임의의 영역을 나타낼 수 있다. 이 경우, 인코딩 장치는 상기 현재 블록의 템플릿의 상기 제1값 및 상기 참조 블록의 템플릿의 상기 제2값을 기반으로 상기 현재 블록의 보간 필터를 결정할 수 있다. 예를 들어, 상기 현재 블록의 템플릿의 제1값이 상기 참조 블록의 템플릿의 제2값보다 큰 경우(즉, 상기 현재 블록의 템플릿의 제1값에서 상기 참조 블록의 템플릿의 제2값을 뺀 값이 특정값보다 큰 경우), 인코딩 장치는 상기 현재 블록의 보간 필터를 12탭 필터로 결정할 수 있다. 또한, 상기 현재 블록의 템플릿의 제1값이 상기 참조 블록의 템플릿의 제2값보다 작은 경우(즉, 상기 참조 블록의 템플릿의 제2값에서 상기 현재 블록의 템플릿의 제1값을 뺀 값이 특정값보다 큰 경우), 인코딩 장치는 상기 현재 블록의 보간 필터를 4탭 필터로 결정할 수 있다. 또한, 상기 현재 블록의 템플릿의 제1값과 상기 참조 블록의 템플릿의 제2값이 유사한 경우(즉, 상기 현재 블록의 템플릿의 제1값에서 상기 참조 블록의 템플릿의 제2값을 뺀 값이 특정값 이하인 경우 또는 상기 현재 블록의 템플릿의 제1값과 상기 참조 블록의 제2값과의 차분(difference)이 특정 범위에 포함되는 경우), 인코딩 장치는 상기 현재 블록의 보간 필터를 8탭 필터로 결정할 수 있다.
또한, 인코딩 장치는 상기 현재 블록의 템플릿과 상기 참조 블록의 템플릿을 변환하여 상기 현재 블록의 템플릿의 변환 계수들 및 상기 참조 블록의 템플릿의 변환 계수들을 도출할 수 있고, 주파수 도메인 내 상기 현재 블록의 템플릿의 변환 계수들 중 상기 현재 블록의 템플릿의 우하단에서 좌상단으로 지그재그로 이동하면서 최초로 도출된 변환 계수와 상기 현재 블록의 템플릿의 우하단 위치와의 제1 거리를 도출할 수 있고, 주파수 도메인 내 상기 참조 블록의 템플릿의 변환 계수들 중 상기 참조 블록의 템플릿의 우하단에서 좌상단으로 지그재그로 이동하면서 최초로 도출된 변환 계수와 상기 참조 블록의 템플릿의 우하단 위치와의 제2 거리를 도출할 수 있다. 이 경우, 인코딩 장치는 상기 현재 블록의 템플릿의 상기 제1 거리 및 상기 참조 블록의 템플릿의 상기 제2 거리를 기반으로 상기 현재 블록의 보간 필터를 결정할 수 있다. 예를 들어, 상기 현재 블록의 템플릿의 제1 거리가 상기 참조 블록의 템플릿의 제2 거리보다 큰 경우(즉, 상기 현재 블록의 템플릿의 제1 거리에서 상기 참조 블록의 템플릿의 제2 거리를 뺀 값이 특정값보다 큰 경우), 인코딩 장치는 상기 현재 블록의 보간 필터를 12탭 필터로 결정할 수 있다. 또한, 상기 현재 블록의 템플릿의 제1 거리가 상기 참조 블록의 제2 거리보다 작은 경우(즉, 상기 참조 블록의 템플릿의 제2 거리에서 상기 현재 블록의 템플릿의 제1 거리를 뺀 값이 특정값보다 큰 경우), 인코딩 장치는 상기 현재 블록의 보간 필터를 4탭 필터로 결정할 수 있다. 또한, 상기 현재 블록의 템플릿의 제1 거리와 상기 참조 블록의 템플릿의 제2 거리가 유사한 경우(즉, 상기 현재 블록의 템플릿의 제1 거리에서 상기 참조 블록의 템플릿의 제2 거리를 뺀 값이 특정값 이하인 경우 또는 상기 현재 블록의 템플릿의 제1 거리와 상기 참조 블록의 템플릿의 제2 거리와의 차분(difference)이 특정 범위에 포함되는 경우), 인코딩 장치는 상기 현재 블록의 보간 필터를 8탭 필터로 결정할 수 있다.
다른 예로, 인코딩 장치는 상기 현재 블록의 참조 블록을 기반으로 상기 현재 블록의 보간 필터를 결정할 수 있다. 이 경우, 인코딩 장치는 제1 임계값 및 제2 임계값을 설정할 수 있고, 상기 제1 임계값에 대한 정보 및 상기 제2 임계값에 대한 정보를 생성할 수 있다. 상기 제1 임계값에 대한 정보는 SPS(sequence parameter set) 또는 PPS(picture parameter set)를 통하여 전송될 수 있다. 또는, 상기 제1 임계값에 대한 정보는 슬라이스, 블록 단위로 전송될 수도 있다. 또한, 상기 제2 임계값에 대한 정보는 SPS(sequence parameter set) 또는 PPS(picture parameter set)를 통하여 전송될 수 있다. 또는, 상기 제2 임계값에 대한 정보는 슬라이스, 블록 단위로 전송될 수도 있다. 상기 제1 임계값에 대한 정보 및 상기 제2 임계값에 대한 정보는 상기 현재 블록의 인터 예측 정보에 포함될 수 있다.
또는, 상기 제1 임계값은 기설정된 값으로 도출될 수 있다. 또한, 상기 제2 임계값은 기설정된 값으로 도출될 수 있다. 인코딩 장치는 상기 참조 블록의 주파수 특성과 상기 제1 임계값 및 상기 제2 임계값을 기반으로 상기 현재 블록의 보간 필터를 결정할 수 있다.
예를 들어, 상기 참조 블록의 고주파 성분이 상기 제1 임계값보다 작은 경우, 인코딩 장치는 상기 현재 블록의 보간 필터를 12탭 필터로 결정할 수 있다. 또한, 상기 참조 블록의 고주파 성분이 상기 제2 임계값보다 큰 경우, 인코딩 장치는 상기 현재 블록의 보간 필터를 4탭 필터로 결정할 수 있다. 또한, 상기 참조 블록의 고주파 성분이 상기 제1 임계값 이상이고 상기 제2 임계값 이하인 경우, 인코딩 장치는 상기 현재 블록의 보간 필터를 8탭 필터로 결정할 수 있다.
구체적으로, 상기 참조 블록의 고주파 성분의 비교를 위하여 상기 참조 블록의 분산값이 이용될 수 있다.
예를 들어, 인코딩 장치는 상기 참조 블록의 템플릿의 분산값을 도출할 수 있다. 인코딩 장치는 상기 참조 블록의 분산값을 기반으로 상기 현재 블록의 보간 필터를 결정할 수 있다. 예를 들어, 상기 참조 블록의 분산값이 상기 제1 임계값보다 작은 경우, 인코딩 장치는 상기 현재 블록의 보간 필터를 12탭 필터로 결정할 수 있다. 또한, 상기 참조 블록의 분산값이 상기 제2 임계값보다 큰 경우, 인코딩 장치는 상기 현재 블록의 보간 필터를 4탭 필터로 결정할 수 있다. 또한, 상기 참조 블록의 분산값이 상기 제1 임계값 이상이고 상기 제2 임계값 이하인 경우, 인코딩 장치는 상기 현재 블록의 보간 필터를 8탭 필터로 결정할 수 있다.
또한, 상기 참조 블록의 고주파 성분의 비교를 위하여 라플라시안 오퍼레이션(laplacian operation) 또는 소벨 오퍼레이션(sobel operation) 등의 연산이 이용될 수 있다.
예를 들어, 인코딩 장치는 상기 참조 블록에 상기 라플라시안 오퍼레이터를 적용하여 제1값을 도출할 수 있다. 즉, 인코딩 장치는 상기 라플라시안 오퍼레이터를 기반으로 상기 참조 블록의 제1값을 도출할 수 있다. 여기서 상기 제1값은 라플라시안 결과값이라고 나타낼 수도 있다. 이 경우, 인코딩 장치는 상기 참조 블록의 상기 제1값을 기반으로 상기 현재 블록의 보간 필터를 결정할 수 있다. 예를 들어, 상기 참조 블록의 템플릿의 제1값이 상기 제1 임계값보다 작은 경우, 인코딩 장치는 상기 현재 블록의 보간 필터를 12탭 필터로 결정할 수 있다. 또한, 상기 참조 블록의 제1값이 상기 제2 임계값보다 큰 경우, 인코딩 장치는 상기 현재 블록의 보간 필터를 4탭 필터로 결정할 수 있다. 또한, 상기 참조 블록의 제1값이 상기 제1 임계값 이상이고 상기 제2 임계값 이하인 경우, 인코딩 장치는 상기 현재 블록의 보간 필터를 8탭 필터로 결정할 수 있다.
또한, 인코딩 장치는 상기 참조 블록에 상기 소벨 오퍼레이터를 적용하여 제1값을 도출할 수 있다. 즉, 인코딩 장치는 상기 소벨 오퍼레이터를 기반으로 상기 참조 블록의 제1값을 도출할 수 있다. 여기서 상기 제1값은 소벨 결과값이라고 나타낼 수도 있다. 이 경우, 인코딩 장치는 상기 참조 블록의 상기 제1값을 기반으로 상기 현재 블록의 보간 필터를 결정할 수 있다. 예를 들어, 상기 참조 블록의 템플릿의 제1값이 상기 제1 임계값보다 작은 경우, 인코딩 장치는 상기 현재 블록의 보간 필터를 12탭 필터로 결정할 수 있다. 또한, 상기 참조 블록의 제1값이 상기 제2 임계값보다 큰 경우, 인코딩 장치는 상기 현재 블록의 보간 필터를 4탭 필터로 결정할 수 있다. 또한, 상기 참조 블록의 제1값이 상기 제1 임계값 이상이고 상기 제2 임계값 이하인 경우, 인코딩 장치는 상기 현재 블록의 보간 필터를 8탭 필터로 결정할 수 있다.
또한, 상기 참조 블록의 고주파 성분의 비교를 위하여, 주파수 변환을 이용하여 고주파 성분의 분포도를 확인하는 방법이 이용될 수 있다.
예를 들어, 인코딩 장치는 상기 참조 블록을 변환하여 상기 참조 블록의 변환 계수들을 도출할 수 있고, 상기 참조 블록의 변환 계수들 중 상기 특정 영역에 포함하는 변환 계수들의 절대값의 합인 제1값을 도출할 수 있다. 상기 특정 영역은 주파수 도메인 상에서의 임의의 영역을 나타낼 수 있다. 이 경우, 인코딩 장치는 상기 참조 블록의 상기 제1값을 기반으로 상기 현재 블록의 보간 필터를 결정할 수 있다. 예를 들어, 상기 참조 블록의 템플릿의 제1값이 상기 제1 임계값보다 작은 경우, 인코딩 장치는 상기 현재 블록의 보간 필터를 12탭 필터로 결정할 수 있다. 또한, 상기 참조 블록의 제1값이 상기 제2 임계값보다 큰 경우, 인코딩 장치는 상기 현재 블록의 보간 필터를 4탭 필터로 결정할 수 있다. 또한, 상기 참조 블록의 제1값이 상기 제1 임계값 이상이고 상기 제2 임계값 이하인 경우, 인코딩 장치는 상기 현재 블록의 보간 필터를 8탭 필터로 결정할 수 있다.
또한, 인코딩 장치는 상기 참조 블록을 변환하여 상기 참조 블록의 변환 계수들을 도출할 수 있고, 주파수 도메인 내 상기 참조 블록의 변환 계수들 중 상기 참조 블록의 우하단에서 좌상단으로 지그재그로 이동하면서 최초로 도출된 변환 계수와 상기 참조 블록의 우하단 위치와의 제1 거리를 도출할 수 있다. 이 경우, 인코딩 장치는 상기 참조 블록의 상기 제1 거리를 기반으로 상기 현재 블록의 보간 필터를 결정할 수 있다. 예를 들어, 상기 참조 블록의 제1 거리가 상기 제1 임계값보다 작은 경우, 인코딩 장치는 상기 현재 블록의 보간 필터를 12탭 필터로 결정할 수 있다. 또한, 상기 참조 블록의 제1 거리가 상기 제2 임계값보다 큰 경우, 인코딩 장치는 상기 현재 블록의 보간 필터를 4탭 필터로 결정할 수 있다. 또한, 상기 참조 블록의 제1 거리가 상기 제1 임계값 이상이고 상기 제2 임계값 이하인 경우, 인코딩 장치는 상기 현재 블록의 보간 필터를 8탭 필터로 결정할 수 있다.
다른 예로, 인코딩 장치는 상기 현재 블록의 참조 픽처를 기반으로 상기 현재 블록의 보간 필터를 결정할 수 있다. 이 경우, 상기 참조 픽처의 주파수 특성 및 상기 현재 블록의 제1 임계값 및 제2 임계값을 기반으로 상기 현재 블록의 보간 필터가 결정될 수 있다.
한편, 인코딩 장치는 상기 현재 블록의 보간 필터를 가리키는 보간 필터 인덱스를 생성할 수 있다. 상기 보간 필터 인덱스는 상기 복수의 보간 필터들 중 하나를 가리킬 수 있다. 상기 보간 필터 인덱스는 블록 단위로 전송될 수 있고, 또는 SPS(sequence parameter set, SPS), PPS(picture parameter set, PPS) 또는 슬라이스 헤더를 통하여 전송될 수도 있다. 상기 보간 필터 인덱스는 상기 현재 블록의 인터 예측 정보에 포함될 수 있다.
한편, 상기 현재 블록에 L0 예측이 수행되는 경우, 상기 보간 필터 인덱스는 상기 L0에 대한 보간 필터 인덱스를 나타낼 수 있다. 또한, 상기 현재 블록에 L1 예측이 수행되는 경우, 상기 보간 필터 인덱스는 상기 L1에 대한 보간 필터 인덱스를 나타낼 수 있다. 또한, 상기 현재 블록에 쌍예측이 수행되는 경우, 상기 인터 예측 정보는 상기 L0 및 L1에 대한 보간 필터 인덱스를 포함할 수 있다. 이 경우, 상기 현재 블록의 상기 L0 예측 및 상기 L1 예측은 상기 보간 필터 인덱스가 가리키는 보간 필터를 기반으로 수행될 수 있다. 또는, 상기 현재 블록에 쌍예측이 수행되는 경우, 상기 인터 예측 정보는 상기 L0에 대한 보간 필터 인덱스 및 L1에 대한 보간 필터 인덱스를 포함할 수 있다. 이 경우, 상기 현재 블록의 상기 L0 예측은 상기 L0에 대한 보간 필터 인덱스가 가리키는 보간 필터를 기반으로 수행될 수 있고, 상기 L1 예측은 상기 L1에 대한 보간 필터 인덱스가 가리키는 보간 필터를 기반으로 수행될 수 있다. 여기서, 상기 L0에 대한 보간 필터 인덱스는 L0 보간 필터 인덱스라고 나타낼 수 있고, 상기 L1에 대한 보간 필터 인덱스는 L1 보간 필터 인덱스라고 나타낼 수 있다. 상기 L0에 대한 보간 필터 인덱스 및 상기 L1에 대한 보간 필터 인덱스는 상기 현재 블록의 인터 예측 정보에 포함될 수 있다.
인코딩 장치는 상기 보간 필터 및 상기 움직임 정보를 기반으로 상기 현재 블록의 인터 예측을 수행한다(S1220). 인코딩 장치는 상기 움직임 정보를 기반으로 참조 픽처 내 참조 블록을 도출할 수 있다. 상기 움직임 정보는 움직임 벡터 및 참조 픽처 인덱스를 포함할 수 있다. 인코딩 장치는 참조 픽처 리스트의 참조 픽처들 중 상기 참조 픽처 인덱스가 가리키는 참조 픽처를 상기 현재 블록의 참조 픽처로 도출할 수 있고, 상기 참조 픽처 내 상기 움직임 벡터가 가리키는 블록을 상기 현재 블록의 참조 블록으로 도출할 수 있다. 상기 참조 블록이 도출된 경우, 상기 참조 블록에 포함된 정수 샘플들 및 상기 보간 필터를 기반으로 분수 샘플들을 도출할 수 있다. 즉, 상기 보간 필터의 필터 계수들을 기반으로 상기 정수 샘플들을 보간하여 상기 분수 샘플들이 도출될 수 있다.
구체적으로, 인코딩 장치는 상기 정수 샘플들에 대하여 가로 방향 및 세로 방향으로 상기 보간 필터를 적용하여 상기 분수 샘플들을 생성할 수 있다. 예를 들어, 상기 현재 블록의 보간 필터가 4탭 필터이고, 가로 방향으로 상기 보간 필터가 적용되는 경우, 생성되는 분수 샘플을 기준으로 좌측의 2개의 정수 샘플들과 우측의 2개의 정수 샘플들에 상기 보간 필터가 적용되어 상기 분수 샘플이 생성될 수 있다. 또한, 상기 현재 블록의 보간 필터가 4탭 필터이고, 세로 방향으로 상기 보간 필터가 적용되는 경우, 생성되는 분수 샘플을 기준으로 상측의 2개의 정수 샘플들과 하측의 2개의 정수 샘플들에 상기 보간 필터가 적용되어 상기 분수 샘플이 생성될 수 있다.
또한, 예를 들어, 상기 현재 블록의 보간 필터가 8탭 필터이고, 가로 방향으로 상기 보간 필터가 적용되는 경우, 생성되는 분수 샘플을 기준으로 좌측의 4개의 정수 샘플들과 우측의 4개의 정수 샘플들에 상기 보간 필터가 적용되어 상기 분수 샘플이 생성될 수 있다. 또한, 상기 현재 블록의 보간 필터가 8탭 필터이고, 세로 방향으로 상기 보간 필터가 적용되는 경우, 생성되는 분수 샘플을 기준으로 상측의 4개의 정수 샘플들과 하측의 4개의 정수 샘플들에 상기 보간 필터가 적용되어 상기 분수 샘플이 생성될 수 있다.
또한, 예를 들어, 상기 현재 블록의 보간 필터가 12탭 필터이고, 가로 방향으로 상기 보간 필터가 적용되는 경우, 생성되는 분수 샘플을 기준으로 좌측의 6개의 정수 샘플들과 우측의 6개의 정수 샘플들에 상기 보간 필터가 적용되어 상기 분수 샘플이 생성될 수 있다. 또한, 상기 현재 블록의 보간 필터가 12탭 필터이고, 세로 방향으로 상기 보간 필터가 적용되는 경우, 생성되는 분수 샘플을 기준으로 상측의 6개의 정수 샘플들과 하측의 6개의 정수 샘플들에 상기 보간 필터가 적용되어 상기 분수 샘플이 생성될 수 있다.
상기 분수 샘플들이 도출된 경우, 인코딩 장치는 상기 분수 샘플들을 기반으로 상기 현재 블록의 예측 샘플(predicted sample)을 생성할 수 있다.
인코딩 장치는 상기 현재 블록의 인터 예측 정보를 인코딩하여 출력한다(S1230). 상기 현재 블록에 머지 모드가 적용되는 경우, 인코딩 장치는 상기 현재 블록의 움직임 정보를 도출하기 위하여 선택된 머지 후보를 가리키는 머지 인덱스를 생성할 수 있다. 인코딩 장치는 상기 머지 인덱스를 인코딩하여 출력할 수 있다. 상기 머지 인덱스는 상기 인터 예측 정보에 포함될 수 있다.
상기 현재 블록에 AMVP(adaptive motion vector prediction) 모드가 적용되는 경우, 인코딩 장치는 상기 MVP 후보 리스트의 후보들 중 하나를 가리키는 MVP 플래그를 생성할 수 있고, 상기 MVP 플래그를 인코딩하여 출력할 수 있다. 상기 인터 예측 정보는 상기 MVP 플래그를 포함할 수 있다. 또한, 상기 인터 예측 정보는 참조 픽처 인덱스를 포함할 수 있다. 또한, 인코딩 장치는 상기 현재 블록의 참조 픽처를 가리키는 참조 픽처 인덱스를 생성할 수 있고, 상기 참조 픽처 인덱스를 인코딩하여 출력할 수 있다. 상기 인터 예측 정보는 상기 참조 픽처 인덱스를 포함할 수 있다. 또한, 상기 인터 예측에 대한 정보는 상기 현재 블록의 MVD(motion vector difference, MVD)를 포함할 수 있다.
한편, 상기 인터 예측 정보는 L0 예측에 대한 정보 및/또는 L1 예측에 대한 정보를 포함할 수 있다. 상기 L0 예측은 참조 픽처 리스트 L0(list 0, L0)에 포함된 참조 픽처를 기반으로 수행되는 인터 예측을 나타낼 수 있고, 상기 L1 예측은 참조 픽처 리스트 L1(list 1, L1)에 포함된 참조 픽처를 기반으로 수행되는 인터 예측을 나타낼 수 있다. 또한, 상기 L0 예측에 대한 움직임 정보는 L0 움직임 정보, L1 예측에 대한 움직임 정보는 L1 움직임 정보라고 불릴 수 있다. 현재 블록에 대한 인터 예측을 수행함에 있어, L0 움직임 정보를 기반으로 인터 예측을 수행하는 경우 LO 예측이라고 불릴 수 있고, L1 움직임 정보를 기반으로 인터 예측을 수행하는 경우 L1 예측이라고 불릴 수 있으며, 상기 L0 움직임 정보 및 L1 움직임 정보를 기반으로 인터 예측을 수행하는 경우 쌍예측(bi-prediction)이라고 불릴 수 있다. 상기 현재 블록에 L0 예측이 수행되는 경우, 상기 MVP 플래그는 MVPL0 플래그를 나타낼 수 있고, 상기 참조 픽처 인덱스는 L0 참조 픽처 인덱스를 나타낼 수 있다. 또한, 상기 현재 블록에 L1 예측이 수행되는 경우, 상기 MVP 플래그는 MVPL1 플래그를 나타낼 수 있고, 상기 참조 픽처 인덱스는 L1 참조 픽처 인덱스를 나타낼 수 있다. 또한, 상기 현재 블록에 쌍예측이 수행되는 경우, 상기 MVP 플래그는 MVPL0 플래그 및 MVPL1 플래그를 포함할 수 있고, 상기 참조 픽처 인덱스는 L0 참조 픽처 인덱스 및 L1 참조 픽처 인덱스를 포함할 수 있다.
또한, 상기 인터 예측 정보는 상기 현재 블록의 보간 필터 인덱스를 포함할 수 있다. 상기 보간 필터 인덱스는 복수의 보간 필터들 중 하나의 보간 필터를 가리킬 수 있다. 상기 보간 필터 인덱스는 블록 단위로 전송될 수 있고, 또는 SPS(sequence parameter set, SPS), PPS(picture parameter set, PPS) 또는 슬라이스 헤더를 통하여 전송될 수도 있다. 한편, 상기 현재 블록에 L0 예측이 수행되는 경우, 상기 보간 필터 인덱스는 상기 L0에 대한 보간 필터 인덱스를 나타낼 수 있다. 또한, 상기 현재 블록에 L1 예측이 수행되는 경우, 상기 보간 필터 인덱스는 상기 L1에 대한 보간 필터 인덱스를 나타낼 수 있다. 또한, 상기 현재 블록에 쌍예측이 수행되는 경우, 상기 인터 예측 정보는 상기 L0 및 L1에 대한 보간 필터 인덱스를 포함할 수 있다. 이 경우, 상기 현재 블록의 상기 L0 예측 및 상기 L1 예측은 상기 보간 필터 인덱스가 가리키는 보간 필터를 기반으로 수행될 수 있다. 또는, 상기 현재 블록에 쌍예측이 수행되는 경우, 상기 인터 예측 정보는 상기 L0에 대한 보간 필터 인덱스 및 L1에 대한 보간 필터 인덱스를 포함할 수 있다. 이 경우, 상기 현재 블록의 상기 L0 예측은 상기 L0에 대한 보간 필터 인덱스가 가리키는 보간 필터를 기반으로 수행될 수 있고, 상기 L1 예측은 상기 L1에 대한 보간 필터 인덱스가 가리키는 보간 필터를 기반으로 수행될 수 있다. 여기서, 상기 L0에 대한 보간 필터 인덱스는 L0 보간 필터 인덱스라고 나타낼 수 있고, 상기 L1에 대한 보간 필터 인덱스는 L1 보간 필터 인덱스라고 나타낼 수 있다.
또한, 상기 인터 예측 정보는 제1 임계값에 대한 정보를 포함할 수 있고, 제2 임계값에 대한 정보를 포함할 수 있다. 상기 제1 임계값에 대한 정보는 SPS(sequence parameter set) 또는 PPS(picture parameter set)를 통하여 전송될 수 있다. 또는, 상기 제1 임계값에 대한 정보는 슬라이스, 블록 단위로 전송될 수도 있다. 또한, 상기 제2 임계값에 대한 정보는 SPS(sequence parameter set) 또는 PPS(picture parameter set)를 통하여 전송될 수 있다. 또는, 상기 제2 임계값에 대한 정보는 슬라이스, 블록 단위로 전송될 수도 있다.
도 13은 본 발명에 따른 디코딩 장치에 의한 비디오 디코딩 방법을 개략적으로 나타낸다. 도 13에서 개시된 방법은 도 2에서 개시된 디코딩 장치에 의하여 수행될 수 있다. 구체적으로 예를 들어, 도 13의 S1300은 상기 디코딩 장치의 엔트로피 디코딩부에 의하여 수행될 수 있고, S1310 내지 S1330은 상기 디코딩 장치의 예측부에 의하여 수행될 수 있다.
디코딩 장치는 비트스트림을 통하여 현재 블록의 인터 예측 정보를 획득한다(S1300). 상기 현재 블록은 인터 예측 또는 인트라 예측이 적용될 수 있다. 상기 현재 블록에 인터 예측이 적용되는 경우, 디코딩 장치는 상기 비트스트림을 통하여 상기 현재 블록의 인터 예측 정보를 획득할 수 있다.
예를 들어, 상기 현재 블록에 머지 모드가 적용되는 경우, 디코딩 장치는 상기 현재 블록의 주변 블록을 기반으로 머지 후보 리스트를 생성할 수 있고, 상기 비트스트림을 통하여 머지 인덱스를 획득할 수 있다. 상기 머지 인덱스는 상기 머지 후보 리스트에 포함된 후보를 가리킬 수 있고, 상기 인터 예측 정보는 상기 머지 인덱스를 포함할 수 있다.
또한, 상기 현재 블록에 AMVP(adaptive motion vector prediction) 모드가 적용되는 경우, 디코딩 장치는 복원된 공간적 주변 블록의 움직임 벡터 및/또는 시간적 주변 블록인 Col 블록에 대응하는 움직임 벡터를 이용하여, 움직임 벡터 예측자(motion vector predictor, MVP) 후보 리스트를 생성할 수 있다. 즉, 복원된 공간적 주변 블록의 움직임 벡터 및/또는 시간적 주변 블록인 Col 블록에 대응하는 움직임 벡터는 MVP 후보로 사용될 수 있다. 여기서, 상기 공간적 주변 블록은 현재 픽처 내 상기 현재 블록의 주변 블록을 나타낼 수 있고, 상기 시간적 주변 블록은 동일 위치 픽처(collocated picture) 내 상기 현재 블록과 대응하는 위치의 블록을 나타낼 수 있다. 디코딩 장치는 상기 비트스트림을 통하여 MVP 플래그를 획득할 수 있다. 상기 MVP 플래그는 상기 MVP 후보 리스트에 포함된 후보를 가리킬 수 있고, 상기 인터 예측 정보는 상기 MVP 플래그를 포함할 수 있다. 또한, 상기 인터 예측 정보는 참조 픽처 인덱스를 포함할 수 있다. 상기 참조 픽처 인덱스는 상기 현재 블록의 참조 픽처를 가리킬 수 있다. 또한, 상기 인터 예측에 대한 정보는 상기 현재 블록의 MVD(motion vector difference, MVD)를 포함할 수 있다.
한편, 상기 인터 예측 정보는 L0 예측에 대한 정보 및/또는 L1 예측에 대한 정보를 포함할 수 있다. 상기 L0 예측은 참조 픽처 리스트 L0(list 0, L0)에 포함된 참조 픽처를 기반으로 수행되는 인터 예측을 나타낼 수 있고, 상기 L1 예측은 참조 픽처 리스트 L1(list 1, L1)에 포함된 참조 픽처를 기반으로 수행되는 인터 예측을 나타낼 수 있다. 또한, 상기 L0 예측에 대한 움직임 정보는 L0 움직임 정보, L1 예측에 대한 움직임 정보는 L1 움직임 정보라고 불릴 수 있다. 현재 블록에 대한 인터 예측을 수행함에 있어, L0 움직임 정보를 기반으로 인터 예측을 수행하는 경우 LO 예측이라고 불릴 수 있고, L1 움직임 정보를 기반으로 인터 예측을 수행하는 경우 L1 예측이라고 불릴 수 있으며, 상기 L0 움직임 정보 및 L1 움직임 정보를 기반으로 인터 예측을 수행하는 경우 쌍예측(bi-prediction)이라고 불릴 수 있다. 상기 현재 블록에 L0 예측이 수행되는 경우, 상기 MVP 플래그는 MVPL0 플래그를 나타낼 수 있고, 상기 참조 픽처 인덱스는 L0 참조 픽처 인덱스를 나타낼 수 있다. 또한, 상기 현재 블록에 L1 예측이 수행되는 경우, 상기 MVP 플래그는 MVPL1 플래그를 나타낼 수 있고, 상기 참조 픽처 인덱스는 L1 참조 픽처 인덱스를 나타낼 수 있다. 또한, 상기 현재 블록에 쌍예측이 수행되는 경우, 상기 MVP 플래그는 MVPL0 플래그 및 MVPL1 플래그를 포함할 수 있고, 상기 참조 픽처 인덱스는 L0 참조 픽처 인덱스 및 L1 참조 픽처 인덱스를 포함할 수 있다.
또한, 상기 인터 예측 정보는 상기 현재 블록의 보간 필터 인덱스를 포함할 수 있다. 상기 보간 필터 인덱스는 복수의 보간 필터들 중 하나의 보간 필터를 가리킬 수 있다. 상기 보간 필터 인덱스는 블록 단위로 시그널링될 수 있고, 또는 SPS(sequence parameter set, SPS), PPS(picture parameter set, PPS) 또는 슬라이스 헤더를 통하여 전송될 수도 있다. 한편, 상기 현재 블록에 L0 예측이 수행되는 경우, 상기 보간 필터 인덱스는 상기 L0에 대한 보간 필터 인덱스를 나타낼 수 있다. 또한, 상기 현재 블록에 L1 예측이 수행되는 경우, 상기 보간 필터 인덱스는 상기 L1에 대한 보간 필터 인덱스를 나타낼 수 있다. 또한, 상기 현재 블록에 쌍예측이 수행되는 경우, 상기 인터 예측 정보는 상기 L0 및 L1에 대한 보간 필터 인덱스를 포함할 수 있다. 이 경우, 상기 현재 블록의 상기 L0 예측 및 상기 L1 예측은 상기 보간 필터 인덱스가 가리키는 보간 필터를 기반으로 수행될 수 있다. 또는, 상기 현재 블록에 쌍예측이 수행되는 경우, 상기 인터 예측 정보는 상기 L0에 대한 보간 필터 인덱스 및 L1에 대한 보간 필터 인덱스를 포함할 수 있다. 이 경우, 상기 현재 블록의 상기 L0 예측은 상기 L0에 대한 보간 필터 인덱스가 가리키는 보간 필터를 기반으로 수행될 수 있고, 상기 L1 예측은 상기 L1에 대한 보간 필터 인덱스가 가리키는 보간 필터를 기반으로 수행될 수 있다. 여기서, 상기 L0에 대한 보간 필터 인덱스는 L0 보간 필터 인덱스라고 나타낼 수 있고, 상기 L1에 대한 보간 필터 인덱스는 L1 보간 필터 인덱스라고 나타낼 수 있다.
또한, 상기 인터 예측 정보는 제1 임계값에 대한 정보를 포함할 수 있고, 제2 임계값에 대한 정보를 포함할 수 있다. 상기 제1 임계값에 대한 정보는 SPS(sequence parameter set) 또는 PPS(picture parameter set)를 통하여 전송될 수 있다. 또는, 상기 제1 임계값에 대한 정보는 슬라이스, 블록 단위로 전송될 수도 있다. 또한, 상기 제2 임계값에 대한 정보는 SPS(sequence parameter set) 또는 PPS(picture parameter set)를 통하여 전송될 수 있다. 또는, 상기 제2 임계값에 대한 정보는 슬라이스, 블록 단위로 전송될 수도 있다.
디코딩 장치는 상기 인터 예측 정보를 기반으로 상기 현재 블록의 움직임 정보를 도출한다(S1310). 상기 움직임 정보는 상기 현재 블록의 움직임 벡터 및 참조 픽처를 포함할 수 있다.
예를 들어, 상기 현재 블록에 머지 모드가 적용되는 경우, 디코딩 장치는 상기 머지 후보 리스트에 포함된 후보들 중 상기 머지 인덱스가 가리키는 후보의 움직임 정보를 상기 현재 블록의 움직임 정보로 도출할 수 있다. 구체적으로, 상기 머지 인덱스가 가리키는 후보의 움직임 벡터는 상기 현재 블록의 움직임 벡터로 도출될 수 있고, 상기 머지 인덱스가 가리키는 후보의 참조 픽처 인덱스는 상기 현재 블록의 참조 픽처 인덱스로 도출될 수 있다. 상기 참조 픽처 인덱스가 가리키는 참조 픽처는 상기 현재 블록의 참조 픽처로 도출될 수 있다.
한편, 상기 머지 인덱스가 가리키는 후보는 상기 현재 블록의 주변 블록의 L0 움직임 정보 및/또는 L1 움직임 정보를 포함할 수 있다. 상기 후보의 L0 움직임 정보는 상기 현재 블록의 상기 L0 움직임 정보로 도출될 수 있고, 상기 선택된 머지 후보의 L1 움직임 정보는 상기 현재 블록의 상기 L1 움직임 정보로 도출될 수 있다. 상기 현재 블록의 상기 L0 움직임 정보는 상기 현재 블록에 대한 참조 픽처 리스트 L0(List 0, L0)에 포함된 L0 참조 픽처를 가리키는 L0 참조 픽처 인덱스 및 움직임 벡터 L0(Motion Vector L0, MVL0)를 포함할 수 있고, 상기 현재 블록의 상기 L1 움직임 정보는 상기 현재 블록에 대한 참조 픽처 리스트 L0(List 1, L1)에 포함된 L1 참조 픽처를 가리키는 L1 참조 픽처 인덱스 및 MVL1를 포함할 수 있다.
또한, 예를 들어, 상기 현재 블록에 AMVP 모드가 적용되는 경우, 디코딩 장치는 상기 생성된 MVP 후보 리스트에 포함된 MVP 후보들 중 하나를 가리키는 MVP 플래그 및 상기 MVP 플래그가 가리키는 주변 블록의 움직임 벡터(MVP 후보)와 상기 현재 블록의 움직임 벡터와의 차분값(motion vector difference, MVD)을 획득할 수 있다. 상기 MVP 플래그 및 상기 MVD는 상기 인터 예측에 대한 정보에 포함될 수 있다. 디코딩 장치는 상기 MVP플래그가 가리키는 주변 블록의 움직임 벡터(MVP 후보) 및 상기 MVD를 기반으로 상기 현재 블록의 상기 움직임 벡터를 도출할 수 있다.
상기 움직임 정보는 움직임 벡터와 참조 픽처 인덱스를 포함할 수 있다. 상기 움직임 정보는 쌍예측(bi-prediction) 움직임 정보일 수 있고, 또는 단예측(uni-prediction) 움직임 정보일 수 있다. 상기 쌍예측 움직임 정보는 L0 참조 픽처 인덱스 및 L0 움직임 벡터, L1 참조 픽처 인덱스 및 L1 움직임 벡터를 포함할 수 있고, 상기 단예측 움직임 정보는 L0 참조 픽처 인덱스 및 L0 움직임 벡터를 포함할 수 있고, 또는 L1 참조 픽처 인덱스 및 L1 움직임 벡터를 포함할 수 있다. 상기 L0은 참조 픽처 리스트 L0(List 0)를 나타내고, 상기 L1은 참조 픽처 리스트 L1(List 1)를 나타낸다.
디코딩 장치는 복수의 보간 필터들 중 상기 현재 블록의 보간 필터를 도출한다(S1320). 디코딩 장치는 상기 복수의 보간 필터들 중 상기 현재 블록의 보간 필터를 도출할 수 있다. 상기 복수의 보간 필터들은 4탭 필터, 8탭 필터 및 12탭 필터를 포함할 수 있다. 여기서, 4탭 필터는 4개의 필터 계수들을 기반으로 보간을 수행하는 보간 필터를 나타낼 수 있고, 상기 8탭 필터는 8개의 필터 계수들을 기반으로 보간을 수행하는 보간 필터를 나타낼 수 있고, 상기 12탭 필터는 12개의 필터 계수들을 기반으로 보간을 수행하는 보간 필터를 나타낼 수 있다.
일 예로, 디코딩 장치는 상기 보간 필터 인덱스를 기반으로 상기 현재 블록의 보간 필터를 도출할 수 있다. 예를 들어, 상기 보간 필터 인덱스가 4탭 필터를 가리키는 경우, 상기 현재 블록의 보간 필터는 4탭 필터로 도출될 수 있다. 또한, 상기 보간 필터 인덱스가 8탭 필터를 가리키는 경우, 상기 현재 블록의 보간 필터는 8탭 필터로 도출될 수 있다. 또한, 상기 보간 필터 인덱스가 12탭 필터를 가리키는 경우, 상기 현재 블록의 보간 필터는 12탭 필터로 도출될 수 있다. 한편, 상기 보간 필터 인덱스의 비트수는 가변적(variable)일 수 있다. 예를 들어, 상기 보간 필터 인덱스의 값이 0 인 경우, 상기 보간 필터 인덱스는 상기 8탭 필터를 가리킬 수 있고, 상기 보간 필터 인덱스의 값이 10 인 경우, 상기 보간 필터 인덱스는 상기 12탭 필터를 가리킬 수 있고, 상기 보간 필터 인덱스의 값이 11 인 경우, 상기 보간 필터 인덱스는 상기 4탭 필터를 가리킬 수 있다.
또한, 상기 인터 예측 정보는 L0 보간 필터 인덱스 및 L1 보간 필터 인덱스를 포함할 수 있다. 이 경우, 디코딩 장치는 상기 L0 보간 필터 인덱스를 기반으로 상기 현재 블록의 L0 예측에 대한 보간 필터를 도출할 수 있고, 상기 L1 보간 필터 인덱스를 기반으로 상기 현재 블록의 L1 예측에 대한 보간 필터를 도출할 수 있다.
다른 예로, 상기 현재 블록에 머지 모드가 적용되는 경우, 디코딩 장치는 상기 머지 후보 리스트에 포함된 후보들 중 상기 머지 인덱스가 가리키는 후보의 보간 필터 인덱스를 상기 현재 블록의 보간 필터 인덱스로 도출할 수 있다. 이 경우, 디코딩 장치는 상기 보간 필터 인덱스를 기반으로 상기 현재 블록의 보간 필터를 도출할 수 있다. 즉, 디코딩 장치는 상기 도출된 보간 필터 인덱스가 가리키는 보간 필터를 상기 현재 블록의 보간 필터로 도출할 수 있다. 상기 현재 블록의 보간 필터는 상기 복수의 보간 필터들 중 상기 머지 인덱스가 가리키는 후보의 보간 필터 인덱스가 나타내는 보간 필터로 도출될 수 있다. 디코딩 장치는 상기 머지 후보 리스트에 포함된 후보들 중 상기 머지 인덱스가 가리키는 후보에 사용된 보간 필터를 상기 현재 블록의 보간 필터로 도출할 수 있다.
다른 예로, 디코딩 장치는 상기 현재 블록의 템플릿 및 참조 블록의 템플릿을 기반으로 상기 현재 블록의 보간 필터를 도출할 수 있다. 구체적으로, 디코딩 장치는 상기 현재 블록의 템플릿 및 참조 블록의 템플릿의 주파수 특성을 비교하여 상기 현재 블록의 보간 필터를 도출할 수 있다. 여기서, 상기 참조 블록은 상기 현재 블록의 움직임 정보를 기반으로 도출될 수 있다. 즉, 상기 참조 블록은 상기 움직임 정보가 나타내는 참조 픽처 내 복원 블록을 나타낼 수 있다.
디코딩 장치는 상기 현재 블록의 주변 샘플들을 기반으로 상기 현재 블록의 템플릿을 도출할 수 있다. 상기 현재 블록의 템플릿은 상기 현재 블록의 주변 샘플들을 포함하는 특정 영역일 수 있다. 예를 들어, 상기 템플릿은 상기 현재 블록의 좌측 주변 샘플들, 좌상측 주변 샘플 및 상측 주변 샘플들을 포함하는 특정 영역일 수 있고, 또는 상기 현재 블록의 상기 좌측 주변 샘플들 및 상기 상측 주변 샘플들을 포함하는 특정 영역일 수 있다. 또는, 상기 템플릿은 상기 현재 블록의 상기 상측 주변 샘플들을 포함하는 특정 영역일 수 있고, 또는, 상기 템플릿은 상기 현재 블록의 상기 좌측 주변 샘플들을 포함하는 특정 영역일 수 있다.
또한, 디코딩 장치는 상기 참조 블록의 주변 샘플들을 기반으로 상기 참조 블록의 템플릿을 도출할 수 있는바, 상기 현재 블록의 템플릿과 동일한 형태로 상기 참조 블록의 템플릿을 도출할 수 있다. 예를 들어, 상기 현재 블록의 상기 템플릿이 상기 현재 블록의 좌측 주변 샘플들, 좌상측 주변 샘플 및 상측 주변 샘플들을 포함하는 특정 영역인 경우, 상기 참조 블록의 상기 템플릿은 상기 참조 블록의 좌측 주변 샘플들, 좌상측 주변 샘플 및 상측 주변 샘플들을 포함하는 특정 영역으로 도출될 수 있다. 또는, 상기 현재 블록의 상기 템플릿이 상기 현재 블록의 상기 좌측 주변 샘플들 및 상기 상측 주변 샘플들을 포함하는 특정 영역인 경우, 상기 참조 블록의 상기 템플릿은 상기 참조 블록의 상기 좌측 주변 샘플들 및 상기 상측 주변 샘플들을 포함하는 특정 영역으로 도출될 수 있다. 또는, 상기 현재 블록의 상기 템플릿이 상기 현재 블록의 상기 좌측 주변 샘플들을 포함하는 특정 영역인 경우, 상기 참조 블록의 상기 템플릿은 상기 참조 블록의 상기 좌측 주변 샘플들을 포함하는 특정 영역으로 도출될 수 있다. 또는, 상기 현재 블록의 상기 템플릿이 상기 현재 블록의 상기 상측 주변 샘플들을 포함하는 특정 영역인 경우, 상기 참조 블록의 상기 템플릿은 상기 참조 블록의 상기 상측 주변 샘플들을 포함하는 특정 영역으로 도출될 수 있다.
상기 현재 블록의 템플릿 및 상기 참조 블록의 템플릿이 도출된 경우, 디코딩 장치는 상기 현재 블록의 템플릿과 상기 참조 블록의 템플릿의 주파수 특성을 비교하여 상기 현재 블록의 보간 필터를 도출할 수 있다.
예를 들어, 상기 현재 블록의 템플릿이 상기 참조 블록의 템플릿보다 고주파 성분을 더 많이 포함하는 경우, 디코딩 장치는 상기 현재 블록의 보간 필터를 12탭 필터로 도출할 수 있다. 또한, 상기 현재 블록의 템플릿이 상기 참조 블록의 템플릿보다 고주파 성분을 더 적게 포함하는 경우, 디코딩 장치는 상기 현재 블록의 보간 필터를 4탭 필터로 도출할 수 있다. 또한, 상기 현재 블록의 템플릿과 상기 참조 블록의 템플릿이 유사한 정도의 고주파 성분을 포함하는 경우, 디코딩 장치는 상기 현재 블록의 보간 필터를 8탭 필터로 도출할 수 있다.
구체적으로, 상기 현재 블록의 템플릿과 상기 참조 블록의 템플릿의 고주파 성분을 비교하기 위하여 각 템플릿의 분산값이 이용될 수 있다.
예를 들어, 상기 현재 블록의 템플릿 및 상기 참조 블록의 템플릿이 도출된 경우, 디코딩 장치는 상기 현재 블록의 템플릿의 분산값을 도출할 수 있고, 상기 참조 블록의 템플릿의 분산값을 도출할 수 있다. 여기서, 상기 현재 블록의 템플릿의 분산값은 상기 현재 블록의 템플릿에 포함된 주변 샘플들의 샘플값의 분산값을 나타낼 수 있고, 상기 참조 블록의 템플릿의 분산값은 상기 참조 블록의 템플릿에 포함된 복원 샘플들의 샘플값의 분산값을 나타낼 수 있다. 디코딩 장치는 상기 현재 블록의 템플릿의 분산값 및 상기 참조 블록의 템플릿의 분산값을 기반으로 상기 현재 블록의 보간 필터를 도출할 수 있다. 예를 들어, 상기 현재 블록의 템플릿의 분산값이 상기 참조 블록의 분산값보다 큰 경우(즉, 상기 현재 블록의 템플릿의 분산값에서 상기 참조 블록의 분산값을 뺀 값이 특정값보다 큰 경우), 디코딩 장치는 상기 현재 블록의 보간 필터를 12탭 필터로 도출할 수 있다. 또한, 상기 현재 블록의 템플릿의 분산값이 상기 참조 블록의 분산값보다 작은 경우(즉, 상기 참조 블록의 템플릿의 분산값에서 상기 현재 블록의 분산값을 뺀 값이 특정값보다 큰 경우), 디코딩 장치는 상기 현재 블록의 보간 필터를 4탭 필터로 도출할 수 있다. 또한, 상기 현재 블록의 템플릿의 분산값과 상기 참조 블록의 분산값이 유사한 경우(즉, 상기 현재 블록의 템플릿의 분산값에서 상기 참조 블록의 분산값을 뺀 값이 특정값 이하인 경우 또는 상기 현재 블록의 템플릿의 분산값과 상기 참조 블록의 분산값과의 차분(difference)이 특정 범위에 포함되는 경우), 디코딩 장치는 상기 현재 블록의 보간 필터를 8탭 필터로 도출할 수 있다.
또한, 상기 현재 블록의 템플릿과 상기 참조 블록의 템플릿의 고주파 성분을 비교하기 위하여 라플라시안 오퍼레이션(laplacian operation) 또는 소벨 오퍼레이션(sobel operation) 등의 연산이 이용될 수 있다.
예를 들어, 상기 현재 블록의 템플릿 및 상기 참조 블록의 템플릿이 도출된 경우, 디코딩 장치는 상기 현재 블록의 템플릿에 라플라시안 오퍼레이터를 적용하여 제1값을 도출할 수 있고, 상기 참조 블록의 템플릿에 상기 라플라시안 오퍼레이터를 적용하여 제2값을 도출할 수 있다. 즉, 디코딩 장치는 상기 라플라시안 오퍼레이터를 기반으로 상기 현재 블록의 템플릿의 제1값을 도출할 수 있고, 상기 라플라시안 오퍼레이터를 기반으로 상기 참조 블록의 템플릿의 제2값을 도출할 수 있다. 이 경우, 디코딩 장치는 상기 현재 블록의 템플릿의 상기 제1값 및 상기 참조 블록의 템플릿의 상기 제2값을 기반으로 상기 현재 블록의 보간 필터를 도출할 수 있다. 예를 들어, 상기 현재 블록의 템플릿의 제1값이 상기 참조 블록의 제2값보다 큰 경우(즉, 상기 현재 블록의 템플릿의 제1값에서 상기 참조 블록의 제2값을 뺀 값이 특정값보다 큰 경우), 디코딩 장치는 상기 현재 블록의 보간 필터를 12탭 필터로 도출할 수 있다. 또한, 상기 현재 블록의 템플릿의 제1값이 상기 참조 블록의 제2값보다 작은 경우(즉, 상기 참조 블록의 템플릿의 제2값에서 상기 현재 블록의 제1값을 뺀 값이 특정값보다 큰 경우), 디코딩 장치는 상기 현재 블록의 보간 필터를 4탭 필터로 도출할 수 있다. 또한, 상기 현재 블록의 템플릿의 제1값과 상기 참조 블록의 제2값이 유사한 경우(즉, 상기 현재 블록의 템플릿의 제1값에서 상기 참조 블록의 제2값을 뺀 값이 특정값 이하인 경우 또는 상기 현재 블록의 템플릿의 제1값과 상기 참조 블록의 제2값과의 차분(difference)이 특정 범위에 포함되는 경우), 디코딩 장치는 상기 현재 블록의 보간 필터를 8탭 필터로 도출할 수 있다.
또한, 디코딩 장치는 상기 현재 블록의 템플릿에 소벨 오퍼레이터를 적용하여 제1값을 도출할 수 있고, 상기 참조 블록의 템플릿에 상기 소벨 오퍼레이터를 적용하여 제2값을 도출할 수 있다. 즉, 디코딩 장치는 상기 소벨 오퍼레이터를 기반으로 상기 현재 블록의 템플릿의 제1값을 도출할 수 있고, 상기 소벨 오퍼레이터를 기반으로 상기 참조 블록의 템플릿의 제2값을 도출할 수 있다. 이 경우, 디코딩 장치는 상기 현재 블록의 템플릿의 상기 제1값 및 상기 참조 블록의 템플릿의 상기 제2값을 기반으로 상기 현재 블록의 보간 필터를 도출할 수 있다. 예를 들어, 상기 현재 블록의 템플릿의 제1값이 상기 참조 블록의 제2값보다 큰 경우(즉, 상기 현재 블록의 템플릿의 제1값에서 상기 참조 블록의 제2값을 뺀 값이 특정값보다 큰 경우), 디코딩 장치는 상기 현재 블록의 보간 필터를 12탭 필터로 도출할 수 있다. 또한, 상기 현재 블록의 템플릿의 제1값이 상기 참조 블록의 제2값보다 작은 경우(즉, 상기 참조 블록의 템플릿의 제2값에서 상기 현재 블록의 제1값을 뺀 값이 특정값보다 큰 경우), 디코딩 장치는 상기 현재 블록의 보간 필터를 4탭 필터로 도출할 수 있다. 또한, 상기 현재 블록의 템플릿의 제1값과 상기 참조 블록의 제2값이 유사한 경우(즉, 상기 현재 블록의 템플릿의 제1값에서 상기 참조 블록의 제2값을 뺀 값이 특정값 이하인 경우 또는 상기 현재 블록의 템플릿의 제1값과 상기 참조 블록의 제2값과의 차분(difference)이 특정 범위에 포함되는 경우), 디코딩 장치는 상기 현재 블록의 보간 필터를 8탭 필터로 도출할 수 있다.
또한, 상기 현재 블록의 템플릿과 상기 참조 블록의 템플릿의 고주파 성분을 비교하기 위하여 주파수 변환을 이용하여 고주파 성분의 분포도를 확인하는 방법이 이용될 수 있다.
예를 들어, 디코딩 장치는 상기 현재 블록의 템플릿과 상기 참조 블록의 템플릿을 변환하여 상기 현재 블록의 템플릿의 변환 계수들 및 상기 참조 블록의 템플릿의 변환 계수들을 도출할 수 있고, 상기 현재 블록의 템플릿의 변환 계수들 및 상기 참조 블록의 템플릿의 변환 계수들을 기반으로 상기 현재 블록의 보간 필터를 도출할 수 있다. 구체적으로, 디코딩 장치는 상기 현재 블록의 템플릿의 변환 계수들 중 특정 영역에 포함하는 변환 계수들의 절대값의 합인 제1값과 상기 참조 블록의 템플릿의 변환 계수들 중 상기 특정 영역에 포함하는 변환 계수들의 절대값의 합인 제2값을 도출할 수 있다. 상기 특정 영역은 주파수 도메인 상에서의 임의의 영역을 나타낼 수 있다. 이 경우, 디코딩 장치는 상기 현재 블록의 템플릿의 상기 제1값 및 상기 참조 블록의 템플릿의 상기 제2값을 기반으로 상기 현재 블록의 보간 필터를 도출할 수 있다. 예를 들어, 상기 현재 블록의 템플릿의 제1값이 상기 참조 블록의 템플릿의 제2값보다 큰 경우(즉, 상기 현재 블록의 템플릿의 제1값에서 상기 참조 블록의 템플릿의 제2값을 뺀 값이 특정값보다 큰 경우), 디코딩 장치는 상기 현재 블록의 보간 필터를 12탭 필터로 도출할 수 있다. 또한, 상기 현재 블록의 템플릿의 제1값이 상기 참조 블록의 템플릿의 제2값보다 작은 경우(즉, 상기 참조 블록의 템플릿의 제2값에서 상기 현재 블록의 템플릿의 제1값을 뺀 값이 특정값보다 큰 경우), 디코딩 장치는 상기 현재 블록의 보간 필터를 4탭 필터로 도출할 수 있다. 또한, 상기 현재 블록의 템플릿의 제1값과 상기 참조 블록의 템플릿의 제2값이 유사한 경우(즉, 상기 현재 블록의 템플릿의 제1값에서 상기 참조 블록의 템플릿의 제2값을 뺀 값이 특정값 이하인 경우 또는 상기 현재 블록의 템플릿의 제1값과 상기 참조 블록의 제2값과의 차분(difference)이 특정 범위에 포함되는 경우), 디코딩 장치는 상기 현재 블록의 보간 필터를 8탭 필터로 도출할 수 있다.
또한, 디코딩 장치는 상기 현재 블록의 템플릿과 상기 참조 블록의 템플릿을 변환하여 상기 현재 블록의 템플릿의 변환 계수들 및 상기 참조 블록의 템플릿의 변환 계수들을 도출할 수 있고, 주파수 도메인 내 상기 현재 블록의 템플릿의 변환 계수들 중 상기 현재 블록의 템플릿의 우하단에서 좌상단으로 지그재그로 이동하면서 최초로 도출된 변환 계수와 상기 현재 블록의 템플릿의 우하단 위치와의 제1 거리를 도출할 수 있고, 주파수 도메인 내 상기 참조 블록의 템플릿의 변환 계수들 중 상기 참조 블록의 템플릿의 우하단에서 좌상단으로 지그재그로 이동하면서 최초로 도출된 변환 계수와 상기 참조 블록의 템플릿의 우하단 위치와의 제2 거리를 도출할 수 있다. 이 경우, 디코딩 장치는 상기 현재 블록의 템플릿의 상기 제1 거리 및 상기 참조 블록의 템플릿의 상기 제2 거리를 기반으로 상기 현재 블록의 보간 필터를 도출할 수 있다. 예를 들어, 상기 현재 블록의 템플릿의 제1 거리가 상기 참조 블록의 템플릿의 제2 거리보다 큰 경우(즉, 상기 현재 블록의 템플릿의 제1 거리에서 상기 참조 블록의 템플릿의 제2 거리를 뺀 값이 특정값보다 큰 경우), 디코딩 장치는 상기 현재 블록의 보간 필터를 12탭 필터로 도출할 수 있다. 또한, 상기 현재 블록의 템플릿의 제1 거리가 상기 참조 블록의 제2 거리보다 작은 경우(즉, 상기 참조 블록의 템플릿의 제2 거리에서 상기 현재 블록의 템플릿의 제1 거리를 뺀 값이 특정값보다 큰 경우), 디코딩 장치는 상기 현재 블록의 보간 필터를 4탭 필터로 도출할 수 있다. 또한, 상기 현재 블록의 템플릿의 제1 거리와 상기 참조 블록의 템플릿의 제2 거리가 유사한 경우(즉, 상기 현재 블록의 템플릿의 제1 거리에서 상기 참조 블록의 템플릿의 제2 거리를 뺀 값이 특정값 이하인 경우 또는 상기 현재 블록의 템플릿의 제1 거리와 상기 참조 블록의 템플릿의 제2 거리와의 차분(difference)이 특정 범위에 포함되는 경우), 디코딩 장치는 상기 현재 블록의 보간 필터를 8탭 필터로 도출할 수 있다.
다른 예로, 디코딩 장치는 상기 현재 블록의 참조 블록을 기반으로 상기 현재 블록의 보간 필터를 도출할 수 있다. 이 경우, 상기 인터 예측 정보는 제1 임계값에 대한 정보 및 제2 임계값에 대한 정보를 포함할 수 있다. 디코딩 장치는 상기 제1 임계값에 대한 정보를 기반으로 상기 현재 블록의 제1 임계값을 도출할 수 있고, 상기 제2 임계값에 대한 정보를 기반으로 상기 현재 블록의 제1 임계값을 도출할 수 있다. 또는, 상기 제1 임계값은 기설정된 값으로 도출될 수 있다. 또한, 상기 제2 임계값은 기설정된 값으로 도출될 수 있다. 디코딩 장치는 상기 참조 블록과 상기 제1 임계값 및 상기 제2 임계값을 기반으로 상기 현재 블록의 보간 필터를 도출할 수 있다. 즉, 디코딩 장치는 상기 참조 블록의 주파수 특성과 상기 제1 임계값 및 상기 제2 임계값을 기반으로 상기 현재 블록의 보간 필터를 도출할 수 있다.
예를 들어, 상기 참조 블록의 고주파 성분이 상기 제1 임계값보다 작은 경우, 디코딩 장치는 상기 현재 블록의 보간 필터를 12탭 필터로 도출할 수 있다. 또한, 상기 참조 블록의 고주파 성분이 상기 제2 임계값보다 큰 경우, 디코딩 장치는 상기 현재 블록의 보간 필터를 4탭 필터로 도출할 수 있다. 또한, 상기 참조 블록의 고주파 성분이 상기 제1 임계값 이상이고 상기 제2 임계값 이하인 경우, 디코딩 장치는 상기 현재 블록의 보간 필터를 8탭 필터로 도출할 수 있다.
구체적으로, 상기 참조 블록의 고주파 성분의 비교를 위하여 상기 참조 블록의 분산값이 이용될 수 있다.
예를 들어, 디코딩 장치는 상기 참조 블록의 템플릿의 분산값을 도출할 수 있다. 디코딩 장치는 상기 참조 블록의 분산값을 기반으로 상기 현재 블록의 보간 필터를 도출할 수 있다. 예를 들어, 상기 참조 블록의 분산값이 상기 제1 임계값보다 작은 경우, 디코딩 장치는 상기 현재 블록의 보간 필터를 12탭 필터로 도출할 수 있다. 또한, 상기 참조 블록의 분산값이 상기 제2 임계값보다 큰 경우, 디코딩 장치는 상기 현재 블록의 보간 필터를 4탭 필터로 도출할 수 있다. 또한, 상기 참조 블록의 분산값이 상기 제1 임계값 이상이고 상기 제2 임계값 이하인 경우, 디코딩 장치는 상기 현재 블록의 보간 필터를 8탭 필터로 도출할 수 있다.
또한, 상기 참조 블록의 고주파 성분의 비교를 위하여 라플라시안 오퍼레이션(laplacian operation) 또는 소벨 오퍼레이션(sobel operation) 등의 연산이 이용될 수 있다.
예를 들어, 디코딩 장치는 상기 참조 블록에 상기 라플라시안 오퍼레이터를 적용하여 제1값을 도출할 수 있다. 즉, 디코딩 장치는 상기 라플라시안 오퍼레이터를 기반으로 상기 참조 블록의 제1값을 도출할 수 있다. 여기서 상기 제1값은 라플라시안 결과값이라고 나타낼 수도 있다. 이 경우, 디코딩 장치는 상기 참조 블록의 상기 제1값을 기반으로 상기 현재 블록의 보간 필터를 도출할 수 있다. 예를 들어, 상기 참조 블록의 템플릿의 제1값이 상기 제1 임계값보다 작은 경우, 디코딩 장치는 상기 현재 블록의 보간 필터를 12탭 필터로 도출할 수 있다. 또한, 상기 참조 블록의 제1값이 상기 제2 임계값보다 큰 경우, 디코딩 장치는 상기 현재 블록의 보간 필터를 4탭 필터로 도출할 수 있다. 또한, 상기 참조 블록의 제1값이 상기 제1 임계값 이상이고 상기 제2 임계값 이하인 경우, 디코딩 장치는 상기 현재 블록의 보간 필터를 8탭 필터로 도출할 수 있다.
또한, 디코딩 장치는 상기 참조 블록에 상기 소벨 오퍼레이터를 적용하여 제1값을 도출할 수 있다. 즉, 디코딩 장치는 상기 소벨 오퍼레이터를 기반으로 상기 참조 블록의 제1값을 도출할 수 있다. 여기서 상기 제1값은 소벨 결과값이라고 나타낼 수도 있다. 이 경우, 디코딩 장치는 상기 참조 블록의 상기 제1값을 기반으로 상기 현재 블록의 보간 필터를 도출할 수 있다. 예를 들어, 상기 참조 블록의 템플릿의 제1값이 상기 제1 임계값보다 작은 경우, 디코딩 장치는 상기 현재 블록의 보간 필터를 12탭 필터로 도출할 수 있다. 또한, 상기 참조 블록의 제1값이 상기 제2 임계값보다 큰 경우, 디코딩 장치는 상기 현재 블록의 보간 필터를 4탭 필터로 도출할 수 있다. 또한, 상기 참조 블록의 제1값이 상기 제1 임계값 이상이고 상기 제2 임계값 이하인 경우, 디코딩 장치는 상기 현재 블록의 보간 필터를 8탭 필터로 도출할 수 있다.
또한, 상기 참조 블록의 고주파 성분의 비교를 위하여, 주파수 변환을 이용하여 고주파 성분의 분포도를 확인하는 방법이 이용될 수 있다.
예를 들어, 디코딩 장치는 상기 참조 블록을 변환하여 상기 참조 블록의 변환 계수들을 도출할 수 있고, 상기 참조 블록의 변환 계수들 중 상기 특정 영역에 포함하는 변환 계수들의 절대값의 합인 제1값을 도출할 수 있다. 상기 특정 영역은 주파수 도메인 상에서의 임의의 영역을 나타낼 수 있다. 이 경우, 디코딩 장치는 상기 참조 블록의 상기 제1값을 기반으로 상기 현재 블록의 보간 필터를 도출할 수 있다. 예를 들어, 상기 참조 블록의 템플릿의 제1값이 상기 제1 임계값보다 작은 경우, 디코딩 장치는 상기 현재 블록의 보간 필터를 12탭 필터로 도출할 수 있다. 또한, 상기 참조 블록의 제1값이 상기 제2 임계값보다 큰 경우, 디코딩 장치는 상기 현재 블록의 보간 필터를 4탭 필터로 도출할 수 있다. 또한, 상기 참조 블록의 제1값이 상기 제1 임계값 이상이고 상기 제2 임계값 이하인 경우, 디코딩 장치는 상기 현재 블록의 보간 필터를 8탭 필터로 도출할 수 있다.
또한, 디코딩 장치는 상기 참조 블록을 변환하여 상기 참조 블록의 변환 계수들을 도출할 수 있고, 주파수 도메인 내 상기 참조 블록의 변환 계수들 중 상기 참조 블록의 우하단에서 좌상단으로 지그재그로 이동하면서 최초로 도출된 변환 계수와 상기 참조 블록의 우하단 위치와의 제1 거리를 도출할 수 있다. 이 경우, 디코딩 장치는 상기 참조 블록의 상기 제1 거리를 기반으로 상기 현재 블록의 보간 필터를 도출할 수 있다. 예를 들어, 상기 참조 블록의 제1 거리가 상기 제1 임계값보다 작은 경우, 디코딩 장치는 상기 현재 블록의 보간 필터를 12탭 필터로 도출할 수 있다. 또한, 상기 참조 블록의 제1 거리가 상기 제2 임계값보다 큰 경우, 디코딩 장치는 상기 현재 블록의 보간 필터를 4탭 필터로 도출할 수 있다. 또한, 상기 참조 블록의 제1 거리가 상기 제1 임계값 이상이고 상기 제2 임계값 이하인 경우, 디코딩 장치는 상기 현재 블록의 보간 필터를 8탭 필터로 도출할 수 있다.
다른 예로, 디코딩 장치는 상기 현재 블록의 참조 픽처를 기반으로 상기 현재 블록의 보간 필터를 도출할 수 있다. 이 경우, 상기 참조 픽처의 주파수 특성 및 상기 현재 블록의 제1 임계값 및 제2 임계값을 기반으로 상기 현재 블록의 보간 필터가 도출될 수 있다.
디코딩 장치는 상기 보간 필터 및 상기 움직임 정보를 기반으로 상기 현재 블록의 인터 예측을 수행한다(S1330). 디코딩 장치는 상기 움직임 정보를 기반으로 참조 픽처 내 참조 블록을 도출할 수 있다. 상기 움직임 정보는 움직임 벡터 및 참조 픽처 인덱스를 포함할 수 있다. 디코딩 장치는 참조 픽처 리스트의 참조 픽처들 중 상기 참조 픽처 인덱스가 가리키는 참조 픽처를 상기 현재 블록의 참조 픽처로 도출할 수 있고, 상기 참조 픽처 내 상기 움직임 벡터가 가리키는 블록을 상기 현재 블록의 참조 블록으로 도출할 수 있다. 상기 참조 블록이 도출된 경우, 상기 참조 블록에 포함된 정수 샘플들 및 상기 보간 필터를 기반으로 분수 샘플들을 도출할 수 있다. 즉, 상기 보간 필터의 필터 계수들을 기반으로 상기 정수 샘플들을 보간하여 상기 분수 샘플들이 도출될 수 있다.
구체적으로, 디코딩 장치는 상기 정수 샘플들에 대하여 가로 방향 및 세로 방향으로 상기 보간 필터를 적용하여 상기 분수 샘플들을 생성할 수 있다. 예를 들어, 상기 현재 블록의 보간 필터가 4탭 필터이고, 가로 방향으로 상기 보간 필터가 적용되는 경우, 생성되는 분수 샘플을 기준으로 좌측의 2개의 정수 샘플들과 우측의 2개의 정수 샘플들에 상기 보간 필터가 적용되어 상기 분수 샘플이 생성될 수 있다. 또한, 상기 현재 블록의 보간 필터가 4탭 필터이고, 세로 방향으로 상기 보간 필터가 적용되는 경우, 생성되는 분수 샘플을 기준으로 상측의 2개의 정수 샘플들과 하측의 2개의 정수 샘플들에 상기 보간 필터가 적용되어 상기 분수 샘플이 생성될 수 있다.
또한, 예를 들어, 상기 현재 블록의 보간 필터가 8탭 필터이고, 가로 방향으로 상기 보간 필터가 적용되는 경우, 생성되는 분수 샘플을 기준으로 좌측의 4개의 정수 샘플들과 우측의 4개의 정수 샘플들에 상기 보간 필터가 적용되어 상기 분수 샘플이 생성될 수 있다. 또한, 상기 현재 블록의 보간 필터가 8탭 필터이고, 세로 방향으로 상기 보간 필터가 적용되는 경우, 생성되는 분수 샘플을 기준으로 상측의 4개의 정수 샘플들과 하측의 4개의 정수 샘플들에 상기 보간 필터가 적용되어 상기 분수 샘플이 생성될 수 있다.
또한, 예를 들어, 상기 현재 블록의 보간 필터가 12탭 필터이고, 가로 방향으로 상기 보간 필터가 적용되는 경우, 생성되는 분수 샘플을 기준으로 좌측의 6개의 정수 샘플들과 우측의 6개의 정수 샘플들에 상기 보간 필터가 적용되어 상기 분수 샘플이 생성될 수 있다. 또한, 상기 현재 블록의 보간 필터가 12탭 필터이고, 세로 방향으로 상기 보간 필터가 적용되는 경우, 생성되는 분수 샘플을 기준으로 상측의 6개의 정수 샘플들과 하측의 6개의 정수 샘플들에 상기 보간 필터가 적용되어 상기 분수 샘플이 생성될 수 있다.
상기 분수 샘플들이 도출된 경우, 디코딩 장치는 상기 분수 샘플들을 기반으로 상기 현재 블록의 예측 샘플(predicted sample)을 생성할 수 있다.
한편, 비록 도면에서 도시되지는 않았으나 디코딩 장치는 예측 모드에 따라 상기 예측 샘플을 바로 복원 샘플로 이용할 수도 있고, 또는 상기 예측 샘플에 레지듀얼 샘플을 더하여 복원 샘플을 생성할 수도 있다. 디코딩 장치는 상기 현재 블록에 대한 레지듀얼 샘플이 존재하는 경우, 상기 비트스트림으로부터 상기 현재 블록에 대한 레지듀얼에 관한 정보를 수신할 수 있다. 상기 레지듀얼에 관한 정보는 상기 레지듀얼 샘플에 관한 변환 계수를 포함할 수 있다. 디코딩 장치는 상기 레지듀얼 정보를 기반으로 상기 현재 블록에 대한 상기 레지듀얼 샘플(또는 레지듀얼 샘플 어레이)을 도출할 수 있다. 디코딩 장치는 상기 예측 샘플과 상기 레지듀얼 샘플을 기반으로 복원 샘플을 생성할 수 있고, 상기 복원 샘플을 기반으로 복원 블록 또는 복원 픽처를 도출할 수 있다. 이후 디코딩 장치는 필요에 따라 주관적/객관적 화질을 향상시키기 위하여 디블록킹 필터링 및/또는 SAO 절차와 같은 인루프 필터링 절차를 상기 복원 픽처에 적용할 수 있음은 상술한 바와 같다.
상술한 본 발명에 따르면 입력 영상 또는 현재 블록의 특성에 따라 보간 필터가 결정될 수 있고, 결정된 보간 필터를 기반으로 상기 현재 블록의 인터 예측을 수행할 수 있는바, 이를 통하여 현재 블록의 예측 정확도를 향상시키고, 전반적인 코딩 효율을 향상시킬 수 있다.
또한, 본 발명에 따르면 보간 필터에 대한 정보의 전송없이 디코딩 장치에서 현재 블록의 보간 필터를 도출할 수 있고, 이를 통하여 현재 블록의 보간 필터를 위하여 사용되는 비트량을 줄일 수 있고, 전반적인 코딩 효율을 향상시킬 수 있다.
상술한 실시예에서, 방법들은 일련의 단계 또는 블록으로써 순서도를 기초로 설명되고 있지만, 본 발명은 단계들의 순서에 한정되는 것은 아니며, 어떤 단계는 상술한 바와 다른 단계와 다른 순서로 또는 동시에 발생할 수 있다. 또한, 당업자라면 순서도에 나타내어진 단계들이 배타적이지 않고, 다른 단계가 포함되거나 순서도의 하나 또는 그 이상의 단계가 본 발명의 범위에 영향을 미치지 않고 삭제될 수 있음을 이해할 수 있을 것이다.
상술한 본 발명에 따른 방법은 소프트웨어 형태로 구현될 수 있으며, 본 발명에 따른 인코딩 장치 및/또는 디코딩 장치는 예를 들어 TV, 컴퓨터, 스마트폰, 셋톱박스, 디스플레이 장치 등의 영상 처리를 수행하는 장치에 포함될 수 있다.
본 발명에서 실시예들이 소프트웨어로 구현될 때, 상술한 방법은 상술한 기능을 수행하는 모듈(과정, 기능 등)로 구현될 수 있다. 모듈은 메모리에 저장되고, 프로세서에 의해 실행될 수 있다. 메모리는 프로세서 내부 또는 외부에 있을 수 있고, 잘 알려진 다양한 수단으로 프로세서와 연결될 수 있다. 프로세서는 ASIC(application-specific integrated circuit), 다른 칩셋, 논리 회로 및/또는 데이터 처리 장치를 포함할 수 있다. 메모리는 ROM(read-only memory), RAM(random access memory), 플래쉬 메모리, 메모리 카드, 저장 매체 및/또는 다른 저장 장치를 포함할 수 있다.

Claims (15)

  1. 디코딩 장치에 의하여 수행되는 인터 예측 방법에 있어서,
    비트스트림을 통하여 현재 블록의 인터 예측 정보를 획득하는 단계;
    상기 인터 예측 정보를 기반으로 상기 현재 블록의 움직임 정보를 도출하는 단계;
    복수의 보간 필터들 중 상기 현재 블록의 보간 필터를 도출하는 단계; 및
    상기 보간 필터 및 상기 움직임 정보를 기반으로 상기 현재 블록의 인터 예측을 수행하는 단계를 포함하되,
    상기 복수의 보간 필터들은 4탭 필터(4-tap filter), 8탭 필터 및 12탭 필터를 포함하는 것을 특징으로 하는 인터 예측 방법.
  2. 제1항에 있어서,
    상기 보간 필터 및 상기 움직임 정보를 기반으로 상기 현재 블록의 인터 예측을 수행하는 단계는,
    상기 움직임 정보를 기반으로 상기 현재 블록의 참조 블록을 도출하는 단계;
    상기 참조 블록 및 상기 보간 필터를 기반으로 분수 샘플들을 생성하는 단계; 및
    상기 분수 샘플들을 기반으로 상기 현재 블록의 예측 샘플을 생성하는 단계를 포함하는 것을 특징으로 하는 인터 예측 방법.
  3. 제1항에 있어서,
    상기 인터 예측 정보는 보간 필터 인덱스를 포함하고, 상기 현재 블록의 보간 필터는 상기 보간 필터 인덱스를 기반으로 도출되되,
    상기 보간 필터 인덱스는 상기 복수의 보간 필터들 중 하나를 가리키는 것을 특징으로 하는 인터 예측 방법.
  4. 제1항에 있어서,
    상기 인터 예측 정보는 머지 인덱스를 포함하고,
    상기 인터 예측 정보를 기반으로 상기 현재 블록의 상기 움직임 정보를 도출하는 단계는,
    상기 현재 블록의 주변 블록을 기반으로 머지 후보 리스트를 생성하는 단계; 및
    머지 후보 리스트의 후보들 중 상기 머지 인덱스가 가리키는 후보의 움직임 정보를 상기 현재 블록의 움직임 정보로 도출하는 단계를 포함하는 것을 특징으로 하는 인터 예측 방법.
  5. 제4항에 있어서,
    상기 현재 블록의 보간 필터는 상기 복수의 보간 필터들 중 상기 머지 인덱스가 가리키는 후보의 보간 필터 인덱스가 나타내는 보간 필터로 도출되는 것을 특징으로 하는 인터 예측 방법.
  6. 제1항에 있어서,
    상기 복수의 보간 필터들 중 상기 현재 블록의 보간 필터를 도출하는 단계는,
    상기 움직임 정보를 기반으로 상기 현재 블록의 참조 블록을 도출하는 단계;
    상기 현재 블록의 주변 샘플들을 기반으로 현재 블록의 템플릿을 도출하고, 상기 참조 블록의 주변 샘플들을 기반으로 상기 참조 블록의 템플릿을 도출하는 단계; 및
    상기 현재 블록의 템플릿 및 상기 참조 블록의 템플릿을 기반으로 상기 현재 블록의 보간 필터를 도출하는 단계를 포함하는 것을 특징으로 하는 인터 예측 방법.
  7. 제6항에 있어서,
    상기 현재 블록의 템플릿의 분산값 및 상기 참조 블록의 템플릿의 분산값이 도출되고,
    상기 현재 블록의 템플릿의 분산값이 상기 참조 블록의 분산값보다 큰 경우, 상기 현재 블록의 보간 필터는 12탭 필터로 도출되고,
    상기 현재 블록의 템플릿의 분산값이 상기 참조 블록의 분산값보다 작은 경우, 상기 현재 블록의 보간 필터는 4탭 필터로 도출되는 것을 특징으로 하는 인터 예측 방법.
  8. 제6항에 있어서,
    상기 현재 블록의 템플릿 및 상기 참조 블록의 템플릿이 변환되어 상기 현재 블록의 템플릿의 변환 계수들 및 상기 참조 블록의 템플릿의 변환 계수들이 도출되고,
    상기 현재 블록의 템플릿의 변환 계수들 및 상기 참조 블록의 템플릿의 변환 계수들을 기반으로 상기 현재 블록의 보간 필터가 도출되는 것을 특징으로 하는 인터 예측 방법.
  9. 제1항에 있어서,
    상기 인터 예측 정보는 제1 임계값에 대한 정보 및 제2 임계값에 대한 정보를 포함하고,
    상기 복수의 보간 필터들 중 상기 현재 블록의 보간 필터를 도출하는 단계는,
    상기 제1 임계값에 대한 정보 및 상기 제2 임계값에 대한 정보를 기반으로 제1 임계값 및 제2 임계값을 도출하는 단계;
    상기 움직임 정보를 기반으로 상기 현재 블록의 참조 블록을 도출하는 단계; 및
    상기 참조 블록, 상기 제1 임계값 및 상기 제2 임계값을 기반으로 상기 현재 블록의 보간 필터를 도출하는 단계를 포함하는 것을 특징으로 하는 인터 예측 방법.
  10. 제9항에 있어서,
    상기 참조 블록의 분산값이 도출되고,
    상기 참조 블록의 템플릿의 분산값이 상기 제1 임계값보다 작은 경우, 상기 현재 블록의 보간 필터는 12탭 필터로 도출되고,
    상기 참조 블록의 템플릿의 분산값이 상기 제2 임계값보다 큰 경우, 상기 현재 블록의 보간 필터는 4탭 필터로 도출되는 것을 특징으로 하는 인터 예측 방법.
  11. 인터 예측을 수행하는 디코딩 장치에 있어서,
    비트스트림을 통하여 현재 블록의 인터 예측 정보를 획득하는 엔트로피 디코딩부; 및
    상기 인터 예측 정보를 기반으로 상기 현재 블록의 움직임 정보를 도출하고, 복수의 보간 필터들 중 상기 현재 블록의 보간 필터를 도출하고, 상기 보간 필터 및 상기 움직임 정보를 기반으로 상기 현재 블록의 인터 예측을 수행하는 예측부를 포함하되,
    상기 복수의 보간 필터들은 4탭 필터(4-tap filter), 8탭 필터 및 12탭 필터를 포함하는 것을 특징으로 하는 디코딩 장치.
  12. 제11항에 있어서,
    상기 예측부는 상기 움직임 정보를 기반으로 상기 현재 블록의 참조 블록을 도출하고, 상기 참조 블록 및 상기 보간 필터를 기반으로 분수 샘플들을 생성하고, 상기 분수 샘플들을 기반으로 상기 현재 블록의 예측 샘플을 생성하는 것을 특징으로 하는 디코딩 장치.
  13. 제11항에 있어서,
    상기 인터 예측 정보는 보간 필터 인덱스를 포함하고, 상기 현재 블록의 보간 필터는 상기 보간 필터 인덱스를 기반으로 도출되되,
    상기 보간 필터 인덱스는 상기 복수의 보간 필터들 중 하나를 가리키는 것을 특징으로 하는 디코딩 장치.
  14. 제11항에 있어서,
    상기 예측부는 상기 움직임 정보를 기반으로 상기 현재 블록의 참조 블록을 도출하고, 상기 현재 블록의 주변 샘플들을 기반으로 현재 블록의 템플릿을 도출하고, 상기 참조 블록의 주변 샘플들을 기반으로 상기 참조 블록의 템플릿을 도출하고, 상기 현재 블록의 템플릿 및 상기 참조 블록의 템플릿을 기반으로 상기 현재 블록의 보간 필터를 도출하는 것을 특징으로 하는 디코딩 장치.
  15. 제14항에 있어서,
    상기 현재 블록의 템플릿의 분산값 및 상기 참조 블록의 템플릿의 분산값이 도출되고,
    상기 현재 블록의 템플릿의 분산값이 상기 참조 블록의 분산값보다 큰 경우, 상기 현재 블록의 보간 필터는 12탭 필터로 도출되고,
    상기 현재 블록의 템플릿의 분산값이 상기 참조 블록의 분산값보다 작은 경우, 상기 현재 블록의 보간 필터는 4탭 필터로 도출되는 것을 특징으로 하는 디코딩 장치.
PCT/KR2018/000091 2018-01-03 2018-01-03 영상 코딩 시스템에서 현재 블록의 보간 필터에 기반한 인터 예측 방법 및 장치 WO2019135419A1 (ko)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/KR2018/000091 WO2019135419A1 (ko) 2018-01-03 2018-01-03 영상 코딩 시스템에서 현재 블록의 보간 필터에 기반한 인터 예측 방법 및 장치

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/KR2018/000091 WO2019135419A1 (ko) 2018-01-03 2018-01-03 영상 코딩 시스템에서 현재 블록의 보간 필터에 기반한 인터 예측 방법 및 장치

Publications (1)

Publication Number Publication Date
WO2019135419A1 true WO2019135419A1 (ko) 2019-07-11

Family

ID=67144199

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/KR2018/000091 WO2019135419A1 (ko) 2018-01-03 2018-01-03 영상 코딩 시스템에서 현재 블록의 보간 필터에 기반한 인터 예측 방법 및 장치

Country Status (1)

Country Link
WO (1) WO2019135419A1 (ko)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021043786A1 (en) * 2019-09-04 2021-03-11 Interdigital Vc Holdings France, Sas Switchable interpolation filters
WO2023200381A1 (en) * 2022-04-12 2023-10-19 Telefonaktiebolaget Lm Ericsson (Publ) Enhanced interpolation filtering

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110026599A1 (en) * 2008-04-23 2011-02-03 Kenneth Andersson Template-based pixel block processing
WO2012005537A2 (ko) * 2010-07-09 2012-01-12 한국전자통신연구원 템플릿 매칭을 이용한 영상 부호화 방법 및 장치, 그리고 복호화 방법 및 장치
US20120230407A1 (en) * 2011-03-11 2012-09-13 General Instrument Corporation Interpolation Filter Selection Using Prediction Index
KR20170078681A (ko) * 2014-11-04 2017-07-07 삼성전자주식회사 영상 특성을 반영한 보간 필터를 이용하는 비디오 부호화 방법 및 장치, 비디오 복호화 방법 및 장치

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110026599A1 (en) * 2008-04-23 2011-02-03 Kenneth Andersson Template-based pixel block processing
WO2012005537A2 (ko) * 2010-07-09 2012-01-12 한국전자통신연구원 템플릿 매칭을 이용한 영상 부호화 방법 및 장치, 그리고 복호화 방법 및 장치
US20120230407A1 (en) * 2011-03-11 2012-09-13 General Instrument Corporation Interpolation Filter Selection Using Prediction Index
KR20170078681A (ko) * 2014-11-04 2017-07-07 삼성전자주식회사 영상 특성을 반영한 보간 필터를 이용하는 비디오 부호화 방법 및 장치, 비디오 복호화 방법 및 장치

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
JCT-VC: "Test Model under Consideration", JOINT COLLABORATIVE TEAM ON VIDEO CODING (JCT-VC) OF ITU-T SG 16 WP3, 23 April 2010 (2010-04-23), Dresden. DE, XP055276596 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021043786A1 (en) * 2019-09-04 2021-03-11 Interdigital Vc Holdings France, Sas Switchable interpolation filters
WO2023200381A1 (en) * 2022-04-12 2023-10-19 Telefonaktiebolaget Lm Ericsson (Publ) Enhanced interpolation filtering

Similar Documents

Publication Publication Date Title
WO2019107916A1 (ko) 영상 코딩 시스템에서 인터 예측에 따른 영상 디코딩 방법 및 장치
WO2019103564A1 (ko) 영상 코딩 시스템에서 인터 예측에 따른 영상 디코딩 방법 및 장치
WO2018221817A1 (ko) 영상 코딩 시스템에서 인트라 예측에 따른 영상 디코딩 방법 및 장치
WO2019164031A1 (ko) 영상 코딩 시스템에서 블록 분할 구조에 따른 영상 디코딩 방법 및 장치
WO2018008906A1 (ko) 비디오 신호 처리 방법 및 장치
WO2018105757A1 (ko) 영상 코딩 시스템에서 영상 디코딩 방법 및 장치
WO2020166897A1 (ko) Dmvr 기반의 인터 예측 방법 및 장치
WO2017065357A1 (ko) 영상 코딩 시스템에서 예측 향상을 위한 필터링 방법 및 장치
WO2018008905A1 (ko) 비디오 신호 처리 방법 및 장치
WO2019117634A1 (ko) 2차 변환에 기반한 영상 코딩 방법 및 그 장치
WO2019117640A1 (ko) 영상 코딩 시스템에서 인터 예측에 따른 영상 디코딩 방법 및 장치
WO2019117639A1 (ko) 변환에 기반한 영상 코딩 방법 및 그 장치
WO2017082443A1 (ko) 영상 코딩 시스템에서 임계값을 이용한 적응적 영상 예측 방법 및 장치
WO2018021585A1 (ko) 영상 코딩 시스템에서 인트라 예측 방법 및 장치
WO2021137597A1 (ko) Ols에 대한 dpb 파라미터를 사용하는 영상 디코딩 방법 및 그 장치
WO2020262931A1 (ko) 비디오/영상 코딩 시스템에서 머지 데이터 신택스의 시그널링 방법 및 장치
WO2020235961A1 (ko) 영상 디코딩 방법 및 그 장치
WO2019182329A1 (ko) 영상 복호화 방법/장치, 영상 부호화 방법/장치 및 비트스트림을 저장한 기록 매체
WO2019245261A1 (ko) 영상 부호화/복호화 방법 및 장치
WO2021141227A1 (ko) 영상 디코딩 방법 및 그 장치
WO2020262930A1 (ko) 머지 데이터 신택스에서 중복적인 신택스의 제거 방법 및 장치
WO2019013363A1 (ko) 영상 코딩 시스템에서 주파수 도메인 잡음 감소 방법 및 장치
WO2017195917A1 (ko) 비디오 코딩 시스템에서 인트라 예측 방법 및 장치
WO2021125700A1 (ko) 예측 가중 테이블 기반 영상/비디오 코딩 방법 및 장치
WO2019135419A1 (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: 18898597

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: 18898597

Country of ref document: EP

Kind code of ref document: A1