WO2024025316A1 - Image encoding/decoding method and recording medium storing bitstream - Google Patents

Image encoding/decoding method and recording medium storing bitstream Download PDF

Info

Publication number
WO2024025316A1
WO2024025316A1 PCT/KR2023/010772 KR2023010772W WO2024025316A1 WO 2024025316 A1 WO2024025316 A1 WO 2024025316A1 KR 2023010772 W KR2023010772 W KR 2023010772W WO 2024025316 A1 WO2024025316 A1 WO 2024025316A1
Authority
WO
WIPO (PCT)
Prior art keywords
sample
interpolation
prediction
block
intra prediction
Prior art date
Application number
PCT/KR2023/010772
Other languages
French (fr)
Korean (ko)
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 주식회사 케이티
Publication of WO2024025316A1 publication Critical patent/WO2024025316A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/103Selection of coding mode or of prediction mode
    • H04N19/105Selection of the reference unit for prediction within a chosen coding or prediction mode, e.g. adaptive choice of position and number of pixels used for prediction
    • 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/132Sampling, masking or truncation of coding units, e.g. adaptive resampling, frame skipping, frame interpolation or high-frequency transform coefficient masking
    • 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/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/186Methods 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 a colour or a chrominance component
    • 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/59Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving spatial sub-sampling or interpolation, e.g. alteration of picture size or resolution
    • 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/593Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving spatial prediction techniques
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/70Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by syntax aspects related to video coding, e.g. related to compression standards

Definitions

  • the present invention relates to a video signal processing method and device.
  • High-resolution, high-quality images such as HD (High Definition) images and UHD (Ultra High Definition) images
  • UHD Ultra High Definition
  • Video data becomes higher resolution and higher quality
  • the amount of data increases relative to existing video data. Therefore, when video data is transmitted using media such as existing wired or wireless broadband lines or stored using existing storage media, transmission costs and Storage costs increase.
  • High-efficiency video compression technologies can be used to solve these problems that arise as video data becomes higher resolution and higher quality.
  • Inter-screen prediction technology that predicts the pixel value included in the current picture from pictures before or after the current picture using video compression technology
  • intra-screen prediction technology that predicts the pixel value included in the current picture using pixel information in the current picture
  • entropy coding technology which assigns short codes to values with a high frequency of occurrence and long codes to values with a low frequency of occurrence.
  • the purpose of the present disclosure is to provide a method and device for deriving fractional position samples within a reference picture when encoding/decoding a video signal.
  • the purpose of the present disclosure is to provide an interpolation method with variable directionality and a device therefor when encoding/decoding video signals.
  • the purpose of the present disclosure is to provide a method and device for determining the direction of interpolation based on prediction information in a reference block when encoding/decoding a video signal.
  • An image decoding method includes deriving a motion vector of a current block; and obtaining a prediction sample of the current block from a reference picture based on the motion vector.
  • the prediction sample is obtained by interpolating a first interpolation sample and a second interpolation sample obtained by interpolating integer position samples in the reference picture. Fractional position samples are set, and the positions of the first and second interpolation samples may be determined by the direction of interpolation.
  • An image encoding method includes deriving a motion vector of a current block; and obtaining a prediction sample of the current block from a reference picture based on the motion vector.
  • the prediction sample is obtained by interpolating a first interpolation sample and a second interpolation sample obtained by interpolating integer position samples in the reference picture. Fractional position samples are set, and the positions of the first and second interpolation samples may be determined by the direction of interpolation.
  • the first interpolation sample and the second interpolation sample may be placed on an angle line passing through the fractional position sample.
  • the angle line may correspond to the direction of the interpolation.
  • the direction of interpolation may be determined based on prediction information of a reference block including the position indicated by the motion vector.
  • the direction of interpolation may be the same as the direction of the intra prediction mode of the reference block.
  • the prediction information includes an intra prediction mode
  • the intra prediction mode of the reference block may be determined based on costs for a plurality of intra prediction mode candidates.
  • the cost for an intra prediction mode candidate is determined between a prediction sample obtained by applying intra prediction based on the intra prediction mode to the reference block and a restored sample within the reference block. It can be obtained based on the difference value of .
  • the plurality of intra prediction mode candidates may include at least one of a vertical mode, a horizontal mode, an upper left diagonal mode, an upper right diagonal mode, and a lower left diagonal mode. You can.
  • the first interpolation sample and the second interpolation sample may be located in a vertical or horizontal direction from the current fractional position sample. You can.
  • the direction of interpolation is determined based on prediction information of the reference block, and for the chroma component of the current block, the luma component is determined.
  • the directionality of interpolation for components can be reused.
  • a computer-readable recording medium that stores a bitstream encoded by the video encoding method according to the present disclosure may be provided.
  • prediction accuracy can be improved by obtaining fractional position samples based on interpolation with variable direction.
  • the present disclosure can improve encoding/decoding efficiency by determining the direction of interpolation based on prediction information in a reference block when encoding/decoding a video signal.
  • FIG. 1 is a block diagram showing a video encoding device according to an embodiment of the present disclosure.
  • Figure 2 is a block diagram showing a video decoding device according to an embodiment of the present disclosure.
  • FIG. 3 illustrates an image encoding/decoding method performed by the image encoding/decoding device according to the present disclosure.
  • Figures 4 and 5 show an example of a plurality of intra prediction modes according to the present disclosure.
  • Figure 6 illustrates a planar mode-based intra prediction method according to the present disclosure.
  • Figure 7 shows a DC mode-based intra prediction method according to the present disclosure.
  • Figure 8 illustrates a directional mode-based intra prediction method according to the present disclosure.
  • Figure 9 shows a method for deriving samples of fractional positions.
  • Figures 10 and 11 show that the tangent value for the angle is scaled by 32 times for each intra prediction mode.
  • Figure 12 is a diagram illustrating an intra prediction aspect when the directional mode is one of modes 34 to 49.
  • Figure 13 is a diagram for explaining an example of generating an upper reference sample by interpolating left reference samples.
  • Figure 14 shows an example in which intra prediction is performed using reference samples arranged in a 1D array.
  • FIGS 15 and 16 are flowcharts of the inter prediction method.
  • Figure 17 shows an example in which motion estimation is performed.
  • Figures 18 and 19 show an example in which a prediction block of the current block is generated based on motion information generated through motion estimation.
  • Figure 20 shows positions referenced to derive motion vector prediction values.
  • Figure 21 is a diagram for explaining a template-based motion estimation method.
  • Figure 22 shows examples of template configurations.
  • Figure 23 is a diagram for explaining a motion estimation method based on the bilateral matching method.
  • Figures 24 and 25 show examples of cases where the motion vector of the current block points to an integer position and a fractional position, respectively.
  • Figure 26 shows an example in which fractional position samples are derived by interpolating integer position samples.
  • Figures 27 and 28 show examples in which the current fractional position sample is derived by angular interpolation.
  • Figure 29 is a diagram for explaining an example of deriving a slope with respect to a reference area.
  • Figure 30 is a diagram showing masking aspects in the vertical and horizontal directions for each of the Sobel mask and the Prewitt mask.
  • Figure 31 shows an example in which intra prediction modes are classified into a plurality of groups.
  • first, second, etc. may be used to describe various components, but the components should not be limited by the terms. The above terms are used only for the purpose of distinguishing one component from another.
  • a first component may be named a second component, and similarly, the second component may also be named a first component without departing from the scope of the present invention.
  • the term and/or includes any of a plurality of related stated items or a combination of a plurality of related stated items.
  • Figure 1 is a block diagram showing a video encoding device according to an embodiment of the present invention.
  • the image encoding device 100 includes a picture segmentation unit 110, prediction units 120 and 125, a conversion unit 130, a quantization unit 135, a reordering unit 160, and an entropy encoding unit ( 165), an inverse quantization unit 140, an inverse transform unit 145, a filter unit 150, and a memory 155.
  • each component shown in FIG. 1 is shown independently to represent different characteristic functions in the video encoding device, and does not mean that each component is comprised of separate hardware or a single software component. That is, each component is listed and included as a separate component for convenience of explanation, and at least two of each component can be combined to form one component, or one component can be divided into a plurality of components to perform a function, and each of these components can be divided into a plurality of components. Integrated embodiments and separate embodiments of the constituent parts are also included in the scope of the present invention as long as they do not deviate from the essence of the present invention.
  • some components may not be essential components that perform essential functions in the present invention, but may simply be optional components to improve performance.
  • the present invention can be implemented by including only essential components for implementing the essence of the present invention excluding components used only to improve performance, and a structure including only essential components excluding optional components used only to improve performance. is also included in the scope of rights of the present invention.
  • the picture division unit 110 may divide the input picture into at least one processing unit.
  • the processing unit may be a prediction unit (PU), a transformation unit (TU), or a coding unit (CU).
  • the picture division unit 110 divides one picture into a combination of a plurality of coding units, prediction units, and transformation units, and combines one coding unit, prediction unit, and transformation unit based on a predetermined standard (for example, a cost function). You can encode the picture by selecting .
  • one picture may be divided into a plurality of coding units.
  • a recursive tree structure such as the Quad Tree Structure can be used. Coding is split into other coding units with one image or the largest coding unit as the root.
  • a unit can be divided into child nodes equal to the number of divided coding units.
  • a coding unit that is no longer divided according to certain restrictions becomes a leaf node. That is, assuming that only square division is possible for one coding unit, one coding unit can be divided into up to four different coding units.
  • the coding unit may be used to mean a unit that performs encoding, or may be used to mean a unit that performs decoding.
  • a prediction unit may be divided into at least one square or rectangular shape of the same size within one coding unit, and any one of the prediction units divided within one coding unit may be a prediction unit of another prediction unit. It may be divided to have a different shape and/or size than the unit.
  • intra prediction can be performed without dividing the prediction unit into a plurality of prediction units NxN.
  • the prediction units 120 and 125 may include an inter prediction unit 120 that performs inter prediction and an intra prediction unit 125 that performs intra prediction. It is possible to determine whether to use inter prediction or intra prediction for a prediction unit, and determine specific information (eg, intra prediction mode, motion vector, reference picture, etc.) according to each prediction method. At this time, the processing unit in which the prediction is performed and the processing unit in which the prediction method and specific contents are determined may be different. For example, the prediction method and prediction mode are determined in prediction units, and prediction may be performed in transformation units. The residual value (residual block) between the generated prediction block and the original block may be input to the conversion unit 130. Additionally, prediction mode information, motion vector information, etc.
  • the entropy encoder 165 may be encoded in the entropy encoder 165 together with the residual value and transmitted to the decoding device.
  • the inter prediction unit 120 may predict a prediction unit based on information on at least one picture among the pictures before or after the current picture, and in some cases, prediction based on information on a partially encoded region within the current picture. Units can also be predicted.
  • the inter prediction unit 120 may include a reference picture interpolation unit, a motion prediction unit, and a motion compensation unit.
  • the reference picture interpolation unit may receive reference picture information from the memory 155 and generate pixel information of an integer number of pixels or less from the reference picture.
  • a DCT-based 8-tap interpolation filter with different filter coefficients can be used to generate pixel information of an integer pixel or less in 1/4 pixel units.
  • a DCT-based 4-tap interpolation filter with different filter coefficients can be used to generate pixel information of an integer pixel or less in 1/8 pixel units.
  • the motion prediction unit may perform motion prediction based on a reference picture interpolated by the reference picture interpolation unit.
  • Various methods such as FBMA (Full search-based Block Matching Algorithm), TSS (Three Step Search), and NTS (New Three-Step Search Algorithm) can be used to calculate the motion vector.
  • the motion vector may have a motion vector value in units of 1/2 or 1/4 pixels based on the interpolated pixels.
  • the motion prediction unit can predict the current prediction unit by using a different motion prediction method.
  • various methods such as the skip method, the merge method, the Advanced Motion Vector Prediction (AMVP) method, and the intra block copy method can be used.
  • AMVP Advanced Motion Vector Prediction
  • the intra prediction unit 125 may generate a prediction unit based on reference pixel information around the current block, which is pixel information in the current picture. If the neighboring block of the current prediction unit is a block on which inter prediction has been performed and the reference pixel is a pixel on which inter prediction has been performed, the reference pixel included in the block on which inter prediction has been performed is the reference pixel of the block on which intra prediction has been performed. It can be used in place of information. That is, when a reference pixel is not available, the unavailable reference pixel information can be replaced with at least one reference pixel among available reference pixels.
  • the prediction mode can include a directional prediction mode that uses reference pixel information according to the prediction direction and a non-directional mode that does not use directional information when performing prediction.
  • the mode for predicting luminance information and the mode for predicting chrominance information may be different, and intra prediction mode information used to predict luminance information or predicted luminance signal information may be used to predict chrominance information.
  • intra prediction when performing intra prediction, if the size of the prediction unit and the size of the transformation unit are the same, intra prediction for the prediction unit is made based on the pixel on the left, the pixel on the top left, and the pixel on the top of the prediction unit. can be performed. However, when performing intra prediction, if the size of the prediction unit and the size of the transformation unit are different, intra prediction can be performed using a reference pixel based on the transformation unit. Additionally, intra prediction using NxN partitioning can be used only for the minimum coding unit.
  • the intra prediction method can generate a prediction block after applying an Adaptive Intra Smoothing (AIS) filter to the reference pixel according to the prediction mode.
  • AIS Adaptive Intra Smoothing
  • the type of AIS filter applied to the reference pixel may be different.
  • the intra prediction mode of the current prediction unit can be predicted from the intra prediction mode of prediction units existing around the current prediction unit.
  • predetermined flag information is used to predict the current prediction unit and neighboring prediction units.
  • Information that the prediction modes of are the same can be transmitted, and if the prediction modes of the current prediction unit and neighboring prediction units are different, entropy encoding can be performed to encode the prediction mode information of the current block.
  • a residual block may be generated that includes residual information that is the difference between the prediction unit on which prediction was performed and the original block of the prediction unit.
  • the generated residual block may be input to the conversion unit 130.
  • the transform unit 130 transforms the residual block, including the original block and the residual value information of the prediction unit generated through the prediction units 120 and 125, into DCT (Discrete Cosine Transform), DST (Discrete Sine Transform), KLT and It can be converted using the same conversion method. Whether to apply DCT, DST, or KLT to transform the residual block can be determined based on intra prediction mode information of the prediction unit used to generate the residual block.
  • DCT Discrete Cosine Transform
  • DST Discrete Sine Transform
  • KLT Discrete Sine Transform
  • the quantization unit 135 may quantize the values converted to the frequency domain by the conversion unit 130.
  • the quantization coefficient may change depending on the block or the importance of the image.
  • the value calculated by the quantization unit 135 may be provided to the inverse quantization unit 140 and the realignment unit 160.
  • the rearrangement unit 160 may rearrange coefficient values for the quantized residual values.
  • the rearrangement unit 160 can change the coefficients in a two-dimensional block form into a one-dimensional vector form through a coefficient scanning method.
  • the realignment unit 160 can scan from DC coefficients to coefficients in the high frequency region using a zig-zag scan method and change it into a one-dimensional vector form.
  • a vertical scan that scans the two-dimensional block-type coefficients in the column direction or a horizontal scan that scans the two-dimensional block-type coefficients in the row direction may be used instead of the zig-zag scan. That is, depending on the size of the transformation unit and the intra prediction mode, it can be determined which scan method among zig-zag scan, vertical scan, and horizontal scan will be used.
  • the entropy encoding unit 165 may perform entropy encoding based on the values calculated by the reordering unit 160.
  • Entropy coding can use various coding methods, such as Exponential Golomb, Context-Adaptive Variable Length Coding (CAVLC), and Context-Adaptive Binary Arithmetic Coding (CABAC).
  • the entropy encoding unit 165 receives the residual value coefficient information and block type information of the coding unit, prediction mode information, division unit information, prediction unit information and transmission unit information, and motion information from the reordering unit 160 and the prediction units 120 and 125.
  • Various information such as vector information, reference frame information, block interpolation information, and filtering information can be encoded.
  • the entropy encoding unit 165 may entropy encode the coefficient value of the coding unit input from the reordering unit 160.
  • the inverse quantization unit 140 and the inverse transformation unit 145 inversely quantize the values quantized in the quantization unit 135 and inversely transform the values transformed in the transformation unit 130.
  • the residual value generated in the inverse quantization unit 140 and the inverse transform unit 145 is restored by combining the prediction units predicted through the motion estimation unit, motion compensation unit, and intra prediction unit included in the prediction units 120 and 125. You can create a block (Reconstructed Block).
  • the filter unit 150 may include at least one of a deblocking filter, an offset correction unit, and an adaptive loop filter (ALF).
  • a deblocking filter may include at least one of a deblocking filter, an offset correction unit, and an adaptive loop filter (ALF).
  • ALF adaptive loop filter
  • the deblocking filter can remove block distortion caused by boundaries between blocks in the restored picture. To determine whether to perform deblocking, it is possible to determine whether to apply a deblocking filter to the current block based on the pixels included in several columns or rows included in the block. When applying a deblocking filter to a block, a strong filter or a weak filter can be applied depending on the required deblocking filtering strength. Additionally, when applying a deblocking filter, horizontal filtering and vertical filtering can be processed in parallel when vertical filtering and horizontal filtering are performed.
  • the offset correction unit may correct the offset of the deblocked image from the original image in pixel units.
  • the pixels included in the image are divided into a certain number of areas, then the area to perform offset is determined and the offset is applied to that area, or the offset is performed by considering the edge information of each pixel. You can use the method of applying .
  • Adaptive Loop Filtering can be performed based on a comparison between the filtered restored image and the original image. After dividing the pixels included in the image into predetermined groups, filtering can be performed differentially for each group by determining one filter to be applied to that group. Information related to whether to apply ALF may be transmitted for each coding unit (CU), and the shape and filter coefficients of the ALF filter to be applied may vary for each block. Additionally, an ALF filter of the same type (fixed type) may be applied regardless of the characteristics of the block to which it is applied.
  • ALF Adaptive Loop Filtering
  • the memory 155 may store the reconstructed block or picture calculated through the filter unit 150, and the stored reconstructed block or picture may be provided to the prediction units 120 and 125 when inter prediction is performed.
  • FIG. 2 is a block diagram showing an image decoding device according to an embodiment of the present invention.
  • the image decoding device 200 includes an entropy decoding unit 210, a reordering unit 215, an inverse quantization unit 220, an inverse transform unit 225, a prediction unit 230, 235, and a filter unit ( 240) and memory 245 may be included.
  • the input bitstream can be decoded in a procedure opposite to that of the video encoding device.
  • the entropy decoding unit 210 may perform entropy decoding in a procedure opposite to the procedure in which entropy encoding is performed in the entropy encoding unit of the video encoding device. For example, various methods such as Exponential Golomb, CAVLC (Context-Adaptive Variable Length Coding), and CABAC (Context-Adaptive Binary Arithmetic Coding) may be applied in response to the method performed in the image encoding device.
  • various methods such as Exponential Golomb, CAVLC (Context-Adaptive Variable Length Coding), and CABAC (Context-Adaptive Binary Arithmetic Coding) may be applied in response to the method performed in the image encoding device.
  • the entropy decoder 210 can decode information related to intra prediction and inter prediction performed by the encoding device.
  • the reordering unit 215 may rearrange the bitstream entropy-decoded by the entropy decoding unit 210 based on the method in which the encoder rearranges the bitstream. Coefficients expressed in the form of a one-dimensional vector can be restored and rearranged as coefficients in the form of a two-dimensional block.
  • the reordering unit 215 may receive information related to coefficient scanning performed by the encoder and perform reordering by reverse scanning based on the scanning order performed by the encoder.
  • the inverse quantization unit 220 may perform inverse quantization based on the quantization parameters provided by the encoding device and the coefficient values of the rearranged blocks.
  • the inverse transform unit 225 may perform inverse transform, that is, inverse DCT, inverse DST, and inverse KLT, on the transform performed by the transformer, that is, DCT, DST, and KLT, on the quantization result performed by the image encoding device. Inverse transformation may be performed based on the transmission unit determined by the video encoding device.
  • the inverse transform unit 225 of the video decoding device may selectively perform a transformation technique (eg, DCT, DST, KLT) according to a plurality of information such as a prediction method, the size of the current block, and the prediction direction.
  • a transformation technique eg, DCT, DST, KLT
  • the prediction units 230 and 235 may generate a prediction block based on prediction block generation-related information provided by the entropy decoder 210 and previously decoded block or picture information provided by the memory 245.
  • Intra prediction of the prediction unit is performed based on existing pixels, but when performing intra prediction, if the size of the prediction unit and the size of the transformation unit are different, intra prediction is performed using a reference pixel based on the transformation unit. can do. Additionally, intra prediction using NxN partitioning only for the minimum coding unit can be used.
  • the prediction units 230 and 235 may include a prediction unit determination unit, an inter prediction unit, and an intra prediction unit.
  • the prediction unit discriminator receives various information such as prediction unit information input from the entropy decoder 210, prediction mode information of the intra prediction method, and motion prediction-related information of the inter prediction method, distinguishes the prediction unit from the current coding unit, and makes predictions. It is possible to determine whether a unit performs inter-prediction or intra-prediction.
  • the inter prediction unit 230 uses the information required for inter prediction of the current prediction unit provided by the video encoding device to determine the current prediction unit based on the information included in at least one of the pictures before or after the current picture including the current prediction unit. Inter prediction can be performed on prediction units. Alternatively, inter prediction may be performed based on information on a pre-restored partial region within the current picture including the current prediction unit.
  • the motion prediction method of the prediction unit included in the coding unit is Skip Mode, Merge Mode, AMVP Mode, and Intra Block Copy Mode. You can judge whether it is a certain method or not.
  • the intra prediction unit 235 may generate a prediction block based on pixel information in the current picture. If the prediction unit is a prediction unit that has performed intra prediction, intra prediction may be performed based on intra prediction mode information of the prediction unit provided by the video encoding device.
  • the intra prediction unit 235 may include an Adaptive Intra Smoothing (AIS) filter, a reference pixel interpolation unit, and a DC filter.
  • AIS filter is a part that performs filtering on the reference pixels of the current block, and can be applied by determining whether or not to apply the filter according to the prediction mode of the current prediction unit.
  • AIS filtering can be performed on the reference pixel of the current block using the prediction mode and AIS filter information of the prediction unit provided by the video encoding device. If the prediction mode of the current block is a mode that does not perform AIS filtering, the AIS filter may not be applied.
  • the reference pixel interpolator may interpolate the reference pixel to generate a reference pixel in pixel units of an integer value or less. If the prediction mode of the current prediction unit is a prediction mode that generates a prediction block without interpolating the reference pixel, the reference pixel may not be interpolated.
  • the DC filter can generate a prediction block through filtering when the prediction mode of the current block is DC mode.
  • the restored block or picture may be provided to the filter unit 240.
  • the filter unit 240 may include a deblocking filter, an offset correction unit, and an ALF.
  • the deblocking filter of the video decoding device receives information related to the deblocking filter provided by the video encoding device, and the video decoding device can perform deblocking filtering on the corresponding block.
  • the offset correction unit may perform offset correction on the reconstructed image based on the type of offset correction applied to the image during encoding and offset value information.
  • ALF can be applied to the coding unit based on ALF application availability information, ALF coefficient information, etc. provided from the coding device. This ALF information may be included and provided in a specific parameter set.
  • the memory 245 can store the restored picture or block so that it can be used as a reference picture or reference block, and can also provide the restored picture to an output unit.
  • the term coding unit is used as a coding unit for convenience of explanation, but it may also be a unit that performs not only encoding but also decoding.
  • the current block represents an encoding/decoding target block and, depending on the encoding/decoding stage, is a coding tree block (or coding tree unit), a coding block (or coding unit), a transform block (or transform unit), or a prediction block. (or prediction unit), etc.
  • 'unit' may represent a basic unit for performing a specific encoding/decoding process
  • 'block' may represent a pixel array of a predetermined size.
  • ‘block’ and ‘unit’ can be used with the same meaning.
  • a coding block (coding block) and a coding unit (coding unit) may be understood to have equivalent meanings.
  • FIG. 3 illustrates an image encoding/decoding method performed by the image encoding/decoding device according to the present disclosure.
  • a reference line for intra prediction of the current block can be determined (S300).
  • the current block may use one or more of a plurality of reference line candidates pre-defined in the video encoding/decoding device as a reference line for intra prediction.
  • the plurality of pre-defined reference line candidates may include a neighboring reference line adjacent to the current block to be decoded and N non-neighboring reference lines that are 1-sample to N-sample away from the boundary of the current block.
  • N may be an integer of 1, 2, 3, or more.
  • the plurality of reference line candidates available for the current block consists of a neighboring reference line candidate and three non-neighboring reference line candidates, but is not limited thereto. That is, of course, the plurality of reference line candidates available for the current block may include four or more non-neighboring reference line candidates.
  • the video encoding device can determine an optimal reference line candidate among a plurality of reference line candidates and encode an index for specifying it.
  • the video decoding device can determine the reference line of the current block based on the index signaled through the bitstream.
  • the index may specify one of a plurality of reference line candidates.
  • the reference line candidate specified by the index can be used as the reference line of the current block.
  • the number of indices signaled to determine the reference line of the current block may be 1, 2, or more.
  • the current block may perform intra prediction using only a single reference line candidate specified by the signaled index among a plurality of reference line candidates.
  • the current block may perform intra prediction using a plurality of reference line candidates specified by a plurality of indices among a plurality of reference line candidates.
  • the intra prediction mode of the current block can be determined (S310).
  • the intra prediction mode of the current block may be determined from a plurality of intra prediction modes predefined in the video encoding/decoding device.
  • the plurality of pre-defined intra prediction modes will be examined with reference to FIGS. 4 and 5.
  • Figure 4 shows an example of a plurality of intra prediction modes according to the present disclosure.
  • a plurality of intra prediction modes pre-defined in the video encoding/decoding device may be comprised of a non-directional mode and a directional mode.
  • the non-directional mode may include at least one of planar mode or DC mode.
  • the directional mode may include directional modes numbered 2 to 66.
  • the directional mode may be expanded further than shown in FIG. 4.
  • Figure 5 shows an example in which the directional mode is expanded.
  • modes -1 to -14 and modes 67 to 80 are illustrated as being added. These directional modes may be referred to as wide angle intra prediction modes. Whether to use the wide angle intra prediction mode can be determined depending on the type of the current block. For example, if the current block is a non-square block with a width greater than the height, some directional modes (eg, 2 to 15) may be converted to wide angle intra prediction modes 67 to 80. On the other hand, if the current block is a non-square block with a height greater than the width, some directional modes (e.g., numbers 53 to 66) may be converted to wide angle intra prediction modes between -1 and -14. there is.
  • some directional modes e.g., numbers 53 to 66
  • the range of available wide-angle intra prediction modes can be adaptively determined depending on the width-to-height ratio of the current block.
  • Table 1 shows the range of available wide-angle intra prediction modes according to the width and height ratio of the current block.
  • K candidate modes (most probable mode, MPM) can be selected.
  • a candidate list including the selected candidate mode may be created.
  • An index indicating one of the candidate modes belonging to the candidate list may be signaled.
  • the intra prediction mode of the current block may be determined based on the candidate mode indicated by the index.
  • the candidate mode indicated by the index may be set as the intra prediction mode of the current block.
  • the intra prediction mode of the current block may be determined based on the value of the candidate mode indicated by the index and a predetermined difference value.
  • the difference value may be defined as the difference between the value of the intra prediction mode of the current block and the value of the candidate mode indicated by the index.
  • the difference value may be signaled through a bitstream.
  • the difference value may be a value pre-defined in the video encoding/decoding device.
  • the intra prediction mode of the current block may be a flag indicating whether a mode identical to the intra prediction mode of the current block exists in the candidate list. It can be decided based on . For example, when the flag is the first value, the intra prediction mode of the current block may be determined from the candidate list. In this case, an index indicating one of a plurality of candidate modes belonging to the candidate list may be signaled. The candidate mode indicated by the index may be set as the intra prediction mode of the current block. On the other hand, when the flag is the second value, one of the remaining intra prediction modes may be set as the intra prediction mode of the current block.
  • the remaining intra prediction modes may refer to modes excluding candidate modes belonging to the candidate list among a plurality of pre-defined intra prediction modes.
  • an index indicating one of the remaining intra prediction modes may be signaled.
  • the intra prediction mode indicated by the signaled index may be set as the intra prediction mode of the current block.
  • the intra prediction mode of the chroma block may be selected from among the intra prediction mode candidates of a plurality of chroma blocks. To this end, index information indicating one of the intra prediction mode candidates of the chroma block can be explicitly encoded and signaled through a bitstream. Table 2 illustrates intra prediction mode candidates for chroma block.
  • Luma Mode 0 Luma mode: 50 Luma Mode: 18 Luma Mode: 1 etc 0 66 0 0 0 0 One 50 66 50 50 50 2 18 18 66 18 18 3 One One One 66 One 4 DM
  • DM Direct Mode
  • intra prediction of the luma block If the mode (luma mode) is number 0 (flat mode) and the index points to number 2, the intra prediction mode of the chroma block may be determined as the horizontal mode (number 18).
  • the intra prediction mode of the luma block If (luma mode) is number 1 (DC mode) and the index points to number 0, the intra prediction mode of the chroma block can be determined as planar mode (number 0).
  • the intra prediction mode of the chroma block can also be set to one of the intra prediction modes shown in FIG. 4 or FIG. 5.
  • the intra prediction mode of the current block may be used to determine the reference line of the current block, in which case step S310 may be performed before step S300. Referring to Figure 3, the reference line and intra prediction mode of the current block Based on this, intra prediction can be performed on the current block (S320).
  • Figure 6 illustrates a planar mode-based intra prediction method according to the present disclosure.
  • T represents a reference sample located at the upper right corner of the current block
  • L represents a reference sample located at the lower left corner of the current block.
  • P1 can be generated through horizontal interpolation.
  • P1 can be generated by interpolating T with a reference sample located on the same horizontal line as P1.
  • P2 can be generated through interpolation in the vertical direction.
  • P2 can be generated by interpolating L with a reference sample located on the same vertical line as P2.
  • the current sample in the current block can be predicted through the weighted sum of P1 and P2, as shown in Equation 1 below.
  • the weights ⁇ and ⁇ can be determined considering the width and height of the current block. Depending on the width and height of the current block, weights ⁇ and ⁇ may have the same value or different values. If the width and height of the current block are the same, the weights ⁇ and ⁇ can be set to be the same, and the prediction sample of the current sample can be set to the average value of P1 and P2. If the width and height of the current block are not the same, the weights ⁇ and ⁇ may have different values. For example, if the width is greater than the height, a smaller value can be set to the weight corresponding to the width of the current block, and a larger value can be set to the weight corresponding to the height of the current block.
  • the weight corresponding to the width of the current block may mean ⁇
  • the weight corresponding to the height of the current block may mean ⁇ .
  • Figure 7 shows a DC mode-based intra prediction method according to the present disclosure.
  • the average value of neighboring samples adjacent to the current block can be calculated, and the calculated average value can be set as the predicted value of all samples in the current block.
  • the surrounding samples may include the top reference sample and the left reference sample of the current block.
  • the average value may be calculated using only the top reference sample or the left reference sample. For example, if the width of the current block is greater than the height, the average value can be calculated using only the top reference sample of the current block. Alternatively, if the ratio of the width and height of the current block is greater than or equal to a predetermined threshold, the average value can be calculated using only the top reference sample of the current block.
  • the average value can be calculated using only the upper reference sample of the current block.
  • the width of the current block is smaller than the height, the average value can be calculated using only the left reference sample of the current block.
  • the ratio of the width and height of the current block is less than or equal to a predetermined threshold, the average value can be calculated using only the left reference sample of the current block.
  • the ratio of the width and height of the current block is greater than or equal to a predetermined threshold, the average value can be calculated using only the left reference sample of the current block.
  • Figure 8 illustrates a directional mode-based intra prediction method according to the present disclosure.
  • the intra prediction mode of the current block is a directional mode
  • projection can be performed to a reference line according to the angle of the directional mode.
  • the reference sample can be set as the prediction sample of the current sample.
  • a sample corresponding to the projected position may be generated using one or more surrounding samples adjacent to the projected position. As an example, interpolation may be performed based on two or more neighboring samples in both directions based on the projected position, thereby generating a sample corresponding to the projected position.
  • one surrounding sample adjacent to the projected position can be set as the sample corresponding to the projected position. At this time, among a plurality of neighboring samples adjacent to the projected position, the neighboring sample closest to the projected position may be used.
  • the sample corresponding to the projected position can be set as the predicted sample of the current sample.
  • a reference sample exists at the projected position (i.e., a reference sample at an integer position, R3 ).
  • the reference sample of the projected position can be set as the predicted sample of the current sample B.
  • the reference sample A when projection is performed from that position to the reference line according to the angle of the intra prediction mode, there is no reference sample (i.e., reference sample at the integer position) at the projected position.
  • interpolation may be performed based on surrounding samples (e.g., R2 and R3) neighboring the projected position to generate a sample (r) of the fractional position.
  • the sample (r) at the generated fractional position can be set as the predicted sample of the current sample A.
  • Figure 9 shows a method for deriving samples of fractional positions.
  • variable h means the vertical distance (i.e., vertical distance) from the position of the predicted sample A to the reference sample line
  • variable w means the horizontal distance from the position of the predicted sample A to the fractional position sample. (i.e., horizontal distance).
  • variable ⁇ refers to an angle predefined according to the directionality of the intra prediction mode
  • variable x refers to the fractional position.
  • variable w can be derived as in Equation 2 below.
  • Fractional position samples can be generated by interpolating adjacent integer position reference samples.
  • the integer position reference sample R2 and the integer position reference sample R3 may be interpolated to generate a fractional position reference sample at the x position.
  • a scaling factor can be used to avoid real numbers.
  • the scaling factor f is set to 32
  • the distance between neighboring integer reference samples may be set to 32 instead of 1, as in the example shown in (b) of FIG. 8.
  • the tangent value for the angle ⁇ determined according to the directionality of the intra prediction mode can also be scaled up using the same scaling factor (eg, 32).
  • Figures 10 and 11 show that the tangent value for the angle is scaled by 32 times for each intra prediction mode.
  • FIG. 10 shows the scaled results of tangent values for the non-wide angle intra prediction mode
  • FIG. 11 shows the scaled results of the tangent values for the wide angle intra prediction mode.
  • tangent value (tan ⁇ ) to the angle value in intra prediction mode is positive, reference samples belonging to the top line of the current block (i.e., top reference samples) or reference samples belonging to the left line of the current block (i.e., left Intra prediction can be performed using only one of the reference samples. Meanwhile, when the tangent value for the angle value of the intra prediction mode is negative, both the reference samples located at the top and the reference samples located on the left are used.
  • the left reference samples are projected upward, or the upper reference samples are projected to the left, the reference samples are arranged in a 1D array, and intra prediction is performed using the reference samples in the 1D array. You may.
  • Figure 12 is a diagram illustrating an intra prediction aspect when the directional mode is one of modes 34 to 49.
  • intra prediction mode of the current block is one of modes 34 to 49
  • intra prediction is performed using not only the top reference samples of the current block but also the left reference samples.
  • the reference sample located on the left of the current block can be copied to the position of the top line, or the reference samples located on the left can be interpolated to generate the reference sample of the top line.
  • projection can be performed from the A position on the top line to the left line of the current block.
  • the projected position is called a
  • the value corresponding to the position a can be copied, or a fractional position value corresponding to a can be created and set as the value of the A position.
  • the position a is an integer position
  • the value of the position A can be generated by copying the integer position reference sample.
  • the reference sample located above the a position and the reference sample located below the a position can be interpolated, and the interpolated value can be set as the value of the A position.
  • the direction projected to the left line of the current block may be parallel to and opposite to the direction of the intra prediction mode of the current block.
  • Figure 13 is a diagram for explaining an example of generating an upper reference sample by interpolating left reference samples.
  • variable h represents the horizontal distance between the position A on the top line and the position A on the left line.
  • variable w represents the vertical distance between the position A on the top line and the position A on the left line.
  • variable ⁇ refers to an angle predefined according to the directionality of the intra prediction mode, and the variable x refers to the fractional position.
  • variable h can be derived as in Equation 3 below.
  • a scaling factor can be used to avoid real numbers.
  • the tangent value for variable ⁇ can be scaled using the scaling factor f1.
  • the scaled tangent value shown in FIGS. 10 and 11 may be used.
  • Equation 3 When the scaling factor f1 is applied, Equation 3 can be modified and used as shown in Equation 4 below.
  • a 1D reference sample array can be constructed only with reference samples belonging to the top line.
  • intra prediction for the current block can be performed using only the upper reference samples composed of a 1D array.
  • Figure 14 shows an example in which intra prediction is performed using reference samples arranged in a 1D array.
  • prediction samples of the current block can be obtained using only reference samples belonging to the top line.
  • the top reference sample may be projected onto the left line to form a 1D reference sample array using only reference samples belonging to the left line.
  • the reference samples belonging to the upper line are projected to the left line to generate the left reference sample.
  • overlapping data between pictures can be removed through inter prediction.
  • Inter prediction can be performed on a block basis.
  • a prediction block of the current block can be generated from a reference picture using motion information of the current block.
  • the motion information may include at least one of a motion vector, a reference picture index, and a prediction direction.
  • FIGS 15 and 16 are flowcharts of the inter prediction method.
  • Figure 15 shows the operation of the encoder
  • Figure 16 shows the operation of the decoder
  • the encoder performs motion estimation (S1510) and obtains a prediction block based on motion information derived as a motion estimation result (S1520).
  • the motion information may include at least one of a motion vector, reference picture index, motion vector precision, bidirectional weight, and whether L0 prediction is performed or L1 prediction is performed.
  • the encoder may determine an inter prediction mode for performing inter prediction and encode information for deriving motion information according to the determined inter prediction mode (S1530).
  • an inter prediction mode is determined based on information signaled from the bitstream (S1610), and motion information is obtained according to the determined inter prediction mode (S1620).
  • motion information is acquired, a prediction block of the current block can be obtained based on the obtained motion information (S1630).
  • Motion information of the current block can be generated through motion estimation.
  • Figure 17 shows an example in which motion estimation is performed.
  • the search range for motion estimation can be set from the same position as the reference point of the current block in the reference picture.
  • the reference point may be the location of the upper left sample of the current block.
  • a rectangle of size (w0+w01) and (h0+h1) is set as the search range, centered on the reference point.
  • w0, w1, h0, and h1 may have the same value.
  • at least one of w0, w1, h0, and h1 may be set to have a different value from the other.
  • the sizes of w0, w1, h0, and h1 may be determined so as not to exceed a Coding Tree Unit (CTU) boundary, slice boundary, tile boundary, or picture boundary.
  • CTU Coding Tree Unit
  • the cost of each reference block compared to the current block can be measured.
  • the cost can be calculated using the similarity between two blocks.
  • the cost may be calculated based on the Sum of Absolute Difference (SAD) of the difference values between the original samples in the current block and the original samples (or restored samples) in the reference block.
  • SAD Sum of Absolute Difference
  • the reference block with the optimal cost can be set as the prediction block of the current block.
  • the distance between the current block and the reference block can be set as a motion vector.
  • the x-coordinate difference and y-coordinate difference between the current block and the reference block may be set as a motion vector.
  • the index of the picture containing the reference block specified through motion estimation is set as the reference picture index.
  • the prediction direction can be set based on whether the reference picture belongs to the L0 reference picture list or the L1 reference picture list.
  • motion estimation may be performed for each of the L0 direction and L1 direction.
  • motion information in the L0 direction and motion information in the L1 direction can be generated respectively.
  • Figures 18 and 19 show an example in which a prediction block of the current block is generated based on motion information generated through motion estimation.
  • FIG. 18 shows an example of generating a prediction block through unidirectional (i.e., L0 direction) prediction
  • FIG. 19 shows an example of generating a prediction block through bidirectional (i.e., L0 and L1 directions) prediction.
  • a prediction block of the current block is generated using one piece of motion information.
  • the motion information may include an L0 motion vector, an L0 reference picture index, and prediction direction information indicating the L0 direction.
  • a prediction block is created using two pieces of motion information.
  • a reference block in the L0 direction specified based on motion information in the L0 direction (L0 motion information) is set as an L0 prediction block
  • the L1 direction specified based on motion information in the L1 direction (L1 motion information) is set as an L0 prediction block.
  • the reference block of can be set as the L1 prediction block.
  • the L0 prediction block and the L1 prediction block can be weighted to generate the prediction block of the current block.
  • the L0 reference picture exists in the direction before the current picture (i.e., the POC value is smaller than the current picture), and the L1 reference picture exists in the direction after the current picture (i.e., the POC value is smaller than the current picture). It is exemplified as existing in (the POC value is larger than the picture).
  • the L0 reference picture may exist in the direction after the current picture, or the L1 reference picture may exist in the direction before the current picture.
  • both the L0 reference picture and the L1 reference picture may exist in the previous direction of the current picture, or both may exist in the subsequent direction of the current picture.
  • bidirectional prediction may be performed using an L0 reference picture that exists in the direction after the current picture and an L1 reference picture that exists in the direction before the current picture.
  • Motion information of the block on which inter prediction was performed may be stored in memory. At this time, motion information may be stored in sample units. Specifically, motion information of the block to which a specific sample belongs may be stored as motion information of the specific sample. The stored motion information can be used to derive motion information of a neighboring block to be encoded/decoded later.
  • the encoder may signal information encoding a residual sample corresponding to the difference value between the sample of the current block (i.e., the original sample) and the prediction sample and the motion information necessary to generate the prediction block to the decoder.
  • the decoder may decode information about the signaled difference value to derive a difference sample, and add a prediction sample within a prediction block generated using motion information to the difference sample to generate a restored sample.
  • one of a plurality of inter prediction modes may be selected.
  • the plurality of inter prediction modes may include a motion information merge mode and a motion vector prediction mode.
  • the motion vector prediction mode is a mode in which the difference value between a motion vector and a motion vector predicted value is encoded and signaled.
  • the motion vector prediction value may be derived based on motion information of neighboring blocks or neighboring samples adjacent to the current block.
  • Figure 20 shows positions referenced to derive motion vector prediction values.
  • the current block has a size of 4x4.
  • 'LB' represents samples included in the leftmost column and bottommost row in the current block.
  • 'RT' represents the sample included in the rightmost column and topmost row in the current block.
  • A0 to A4 represent samples neighboring to the left of the current block
  • B0 to B5 represent samples neighboring to the top of the current block.
  • A1 represents a sample neighboring to the left of LB
  • B1 represents a sample neighboring to the top of RT.
  • a neighboring block containing a sample that is, one of A0 to A4 or one of B0 to B5 that is spatially adjacent to the current block may be referred to as a spatial neighboring block.
  • Col indicates the position of a sample neighboring the bottom right of the current block in the co-located picture.
  • the collocated picture is a different picture from the current picture, and information for specifying the collocated picture can be explicitly encoded and signaled in the bitstream.
  • a reference picture with a predefined reference picture index may be set as a collocated picture.
  • a neighboring block containing a sample (i.e., Col) temporally adjacent to the current block may be referred to as a temporal neighboring block.
  • the motion vector prediction value of the current block may be derived from at least one motion vector prediction candidate included in the motion vector prediction list.
  • the number of motion vector prediction candidates that can be inserted into the motion vector prediction list (i.e., the size of the list) may be predefined in the encoder and decoder.
  • the maximum number of motion vector prediction candidates may be two.
  • a motion vector stored at the position of a neighboring sample adjacent to the current block or a scaled motion vector derived by scaling the motion vector may be inserted into the motion vector prediction list as a motion vector prediction candidate.
  • a motion vector prediction candidate can be derived by scanning neighboring samples adjacent to the current block in a predefined order.
  • the earliest discovered available motion vector can be inserted into the motion vector prediction list as a motion vector prediction candidate.
  • a motion vector prediction candidate can be derived based on the available vector found first. Specifically, after scaling the first available motion vector found, the scaled motion vector can be inserted into the motion vector prediction list as a motion vector prediction candidate. At this time, scaling may be performed based on the output order difference between the current picture and the reference picture (i.e., POC difference) and the output order difference between the current picture and the reference picture of the neighboring sample (i.e., POC difference).
  • a motion vector prediction candidate can be derived based on the available vector found first. Specifically, after scaling the first available motion vector found, the scaled motion vector can be inserted into the motion vector prediction list as a motion vector prediction candidate. At this time, scaling may be performed based on the output order difference between the current picture and the reference picture (i.e., POC difference) and the output order difference between the current picture and the reference picture of the neighboring sample (i.e., POC difference).
  • a motion vector prediction candidate may be derived based on the motion vector of a block including a sample at a predetermined position.
  • a motion vector prediction candidate can be derived from a sample adjacent to the left of the current block, and a motion vector prediction candidate can be derived from a sample adjacent to the top of the current block.
  • the motion vector prediction candidate derived from the left sample may be inserted into the motion vector prediction list before the motion vector prediction candidate derived from the top sample.
  • the index assigned to the motion vector prediction candidate derived from the left sample may have a smaller value than the motion vector prediction candidate derived from the top sample.
  • the motion vector prediction candidate derived from the top sample may be inserted into the motion vector prediction list before the motion vector prediction candidate derived from the left sample.
  • the motion vector prediction candidate with the highest coding efficiency may be set as the motion vector predictor (MVP) of the current block.
  • index information indicating a motion vector prediction candidate that is set as the motion vector prediction value of the current block among a plurality of motion vector prediction candidates may be encoded and signaled to the decoder.
  • the index information may be a 1-bit flag (eg, MVP flag).
  • MVD motion vector difference
  • the decoder can construct a motion vector prediction list in the same way as the encoder. Additionally, index information may be decoded from the bitstream, and one of a plurality of motion vector prediction candidates may be selected based on the decoded index information. The selected motion vector prediction candidate can be set as the motion vector prediction value of the current block.
  • motion vector difference values can be decoded from the bitstream. Afterwards, the motion vector of the current block can be derived by combining the motion vector prediction value and the motion vector difference value.
  • a motion vector prediction list can be generated for each of the L0 direction and L1 direction. That is, the motion vector prediction list may be composed of motion vectors in the same direction. Accordingly, the motion vector of the current block and the motion vector prediction candidates included in the motion vector prediction list have the same direction.
  • the reference picture index and prediction direction information may be explicitly encoded and signaled to the decoder.
  • the reference picture index can be explicitly encoded and signaled to the decoder.
  • the reference picture list includes only one reference picture, encoding/decoding of the reference picture index may be omitted.
  • Prediction direction information may be an index indicating one of L0 unidirectional prediction, L1 unidirectional prediction, or bidirectional prediction.
  • the L0 flag indicating whether prediction in the L0 direction is performed and the L1 flag indicating whether prediction in the L1 direction is performed may be encoded and signaled, respectively.
  • the motion information merge mode is a mode that sets the motion information of the current block to be the same as the motion information of the neighboring block.
  • motion information can be encoded/decoded using a motion information merge list.
  • a motion information merge candidate may be derived based on motion information of a neighboring block or neighboring sample adjacent to the current block. For example, after pre-defining a reference position around the current block, it is possible to check whether motion information exists at the pre-defined reference position. If motion information exists at a predefined reference location, motion information at that location can be inserted into the motion information merge list as a motion information merge candidate.
  • the predefined reference position may include at least one of A0, A1, B0, B1, B5, and Col.
  • motion information merging candidates can be derived in the following order: A1, B1, B0, A0, B5, and Col.
  • a motion information merging candidate may be derived based on motion information of a block including a sample of a predefined reference position.
  • the motion information of the motion information merge candidate with the optimal cost can be set as the motion information of the current block.
  • index information eg, merge index
  • a motion information merge candidate selected from among a plurality of motion information merge candidates may be encoded and transmitted to the decoder.
  • a motion information merge list can be constructed in the same way as in the encoder. Then, a motion information merge candidate can be selected based on the merge index decoded from the bitstream. The motion information of the selected motion information merge candidate may be set as the motion information of the current block.
  • the motion information merge list consists of a single list regardless of the prediction direction. That is, the motion information merge candidate included in the motion information merge list may have only L0 motion information or L1 motion information, or may have bidirectional motion information (i.e., L0 motion information and L1 motion information).
  • Motion information of the current block can also be derived using the restored sample area around the current block.
  • the restored sample area used to derive motion information of the current block may be called a template.
  • Figure 21 is a diagram for explaining a template-based motion estimation method.
  • the prediction block of the current block is determined based on the cost between the current block and the reference block within the search range.
  • motion estimation for the current block is based on the cost between a template neighboring the current block (hereinafter referred to as the current template) and a reference template having the same size and shape as the current template. can be performed.
  • the cost may be calculated based on the absolute sum of difference values between restoration samples in the current template and restoration samples in the reference template. The smaller the absolute value sum, the lower the cost can be.
  • the reference block neighboring the reference template can be set as the prediction block of the current block.
  • motion information of the current block can be set based on the distance between the current block and the reference block, the index of the picture to which the reference block belongs, and whether the reference picture is included in the L0 or L1 reference picture list.
  • the decoder itself can perform motion estimation in the same manner as the encoder. Accordingly, when motion information is derived using a template, there is no need to encode and signal motion information other than information indicating whether the template is used.
  • the current template may include at least one of an area adjacent to the top of the current block or an area adjacent to the left. At this time, the area adjacent to the top may include at least one row, and the area adjacent to the left may include at least one column.
  • Figure 22 shows examples of template configurations.
  • a current template may be constructed following one of the examples shown in Figure 22.
  • the template may be configured only from the area adjacent to the left side of the current block, or may be configured only from the area adjacent to the top of the current block.
  • the size and/or shape of the current template may be predefined in the encoder and decoder.
  • index information specifying one of the plurality of template candidates can be encoded and signaled to the decoder.
  • one of a plurality of template candidates may be adaptively selected based on at least one of the size, shape, or location of the current block. For example, if the current block touches the upper border of the CTU, the current template can be constructed only from the area adjacent to the left side of the current block.
  • Template-based motion estimation can be performed for each reference picture stored in the reference picture list.
  • motion estimation may be performed on only some of the reference pictures.
  • motion estimation is performed only on reference pictures with a reference picture index of 0, or only on reference pictures whose reference picture index is smaller than the threshold, or on reference pictures whose POC difference with the current picture is smaller than the threshold. It can be done.
  • the reference picture index can be explicitly encoded and signaled, and then motion estimation can be performed only on the reference picture indicated by the reference picture index.
  • motion estimation can be performed targeting the reference picture of a neighboring block corresponding to the current template. For example, if the template consists of a left neighboring area and a top neighboring area, at least one reference picture can be selected using at least one of the reference picture index of the left neighboring block or the reference picture index of the top neighboring block. Afterwards, motion estimation can be performed on at least one selected reference picture.
  • Information indicating whether template-based motion estimation has been applied may be encoded and signaled to the decoder.
  • the information may be a 1-bit flag. For example, if the flag is true (1), it indicates that template-based motion estimation is applied to the L0 direction and L1 direction of the current block. On the other hand, if the flag is false (0), it indicates that template-based motion estimation is not applied. In this case, motion information of the current block may be derived based on the motion information merging mode or motion vector prediction mode.
  • template-based motion estimation can be applied only when it is determined that the motion information merge mode and motion vector prediction mode are not applied to the current block. For example, when the first flag indicating whether the motion information merge mode is applied and the second flag indicating whether the motion vector prediction mode is applied are both 0, motion estimation based on the template may be performed.
  • template-based motion estimation For each of the L0 direction and the L1 direction, information indicating whether template-based motion estimation has been applied may be signaled. That is, whether template-based motion estimation is applied to the L0 direction and whether template-based motion estimation is applied to the L1 direction can be determined independently of each other. Accordingly, template-based motion estimation may be applied to one of the L0 direction and the L1 direction, while another mode (eg, motion information merge mode or motion vector prediction mode) may be applied to the other direction.
  • another mode eg, motion information merge mode or motion vector prediction mode
  • a prediction block of the current block may be generated based on a weighted sum operation of the L0 prediction block and the L1 prediction block.
  • the prediction block of the current block is based on a weighted sum operation of the L0 prediction block and the L1 prediction block. This can be created.
  • a motion estimation method based on a template may be inserted as a motion information merging candidate in a motion information merging mode or a motion vector prediction candidate in a motion vector prediction mode.
  • whether to apply the template-based motion estimation method may be determined based on whether the selected motion information merge candidate or the selected motion vector prediction candidate indicates the template-based motion estimation method.
  • movement information of the current block can also be generated.
  • Figure 23 is a diagram for explaining a motion estimation method based on the bilateral matching method.
  • the two-way matching method can be performed only when the temporal order of the current picture (i.e., POC) exists between the temporal order of the L0 reference picture and the temporal order of the L1 reference picture.
  • POC temporal order of the current picture
  • the search range can be set for each of the L0 reference picture and L1 reference picture.
  • the L0 reference picture index for identifying the L0 reference picture and the L1 reference picture index for identifying the L1 reference picture may be encoded and signaled, respectively.
  • L1 reference picture can be encoded and signaled, and the L1 reference picture can be selected based on the distance between the current picture and the L0 reference picture (hereinafter referred to as L0 POC difference).
  • L1 POC difference an L1 reference whose absolute value of the distance to the current picture
  • the L1 reference picture that has a different temporal direction from the L0 reference picture can be used for bilateral matching. For example, if the POC of the L0 reference picture is smaller than that of the current picture, one of the L1 reference pictures whose POC is larger than the current picture can be selected.
  • the L1 reference picture index may be encoded and signaled, and the L0 reference picture may be selected based on the distance between the current picture and the L1 reference picture.
  • a two-way matching method may be performed using an L0 reference picture among L0 reference pictures that is closest in distance to the current picture, and an L1 reference picture among L1 reference pictures that is closest in distance to the current picture.
  • two-way A matching method can also be performed.
  • the LX (X is 0 or 1) reference picture is selected based on an explicitly signaled reference picture index, and the L
  • the L0 and/or L1 reference picture may be selected based on the motion information of the neighboring block of the current block.
  • the L0 and/or L1 reference picture to be used for two-way matching can be selected using the reference picture index of the left or top neighboring block of the current block.
  • the search range can be set to within a predetermined range from the collocated block in the reference picture.
  • the search range can be set based on initial motion information.
  • Initial motion information may be derived from a neighboring block of the current block. For example, motion information of the left neighboring block or the top neighboring block of the current block may be set as the initial motion information of the current block.
  • the L0 motion vector and the motion vector in the L1 direction are set in opposite directions. This indicates that the sign of the L0 motion vector and the motion vector in the L1 direction have opposite signs.
  • the size of the LX motion vector may be proportional to the distance (i.e., POC difference) between the current picture and the LX reference picture.
  • L0 reference block the reference block within the search range of the L0 reference picture
  • L1 reference block the reference block within the search range of the L1 reference picture
  • D can be determined by the ratio of the distance between the current picture and the L0 reference picture and the distance between the L1 reference picture and the current picture.
  • the absolute value of the distance between the current picture (T) and the L0 reference picture (T-1) and the distance between the current picture (T) and the L1 reference picture (T+1) The absolute values are mutually identical. Accordingly, in the illustrated example, the L0 motion vector (x0, y0) and the L1 motion vector (x1, y1) have the same size but opposite distances. If an L1 reference picture with a POC of (T+2) was used, the L1 motion vector (x1, y1) will be set to (-2*x0, -2*y0).
  • the L0 reference block and L1 reference block can be set as the L0 prediction block and L1 prediction block of the current block, respectively.
  • the final prediction block of the current block can be generated through a weighted sum operation of the L0 reference block and the L1 reference block.
  • a prediction block of the current block may be generated.
  • the decoder can perform motion estimation in the same way as the encoder. Accordingly, information indicating whether the two-way motion matching method is applied is explicitly encoded/decoded, while encoding/decoding of motion information such as motion vectors can be omitted. As described above, at least one of the L0 reference picture index or the L1 reference picture index may be explicitly encoded/decoded.
  • information indicating whether the two-way matching method has been applied may be explicitly encoded/decoded, but if the two-way matching method has been applied, the L0 motion vector or the L1 motion vector may be explicitly encoded and signaled. If the L0 motion vector is signaled, the L1 motion vector can be derived based on the POC difference between the current picture and the L0 reference picture and the POC difference between the current picture and the L1 reference picture. If the L1 motion vector is signaled, the L0 motion vector can be derived based on the POC difference between the current picture and the L0 reference picture and the POC difference between the current picture and the L1 reference picture. At this time, the encoder can explicitly encode the smaller one of the L0 motion vector and the L1 motion vector.
  • Information indicating whether the two-way matching method has been applied may be a 1-bit flag. As an example, if the flag is true (eg, 1), it may indicate that the two-way matching method is applied to the current block. If the flag is false (eg, 0), it may indicate that the two-way matching method is not applied to the current block. In this case, motion information merge mode or motion vector prediction mode may be applied to the current block.
  • the two-way matching method can be applied only when it is determined that the motion information merge mode and motion vector prediction mode are not applied to the current block. For example, when the first flag indicating whether the motion information merge mode is applied and the second flag indicating whether the motion vector prediction mode is applied are both 0, the two-way matching method may be applied.
  • the two-way matching method may be inserted as a motion information merge candidate in the motion information merge mode or a motion vector prediction candidate in the motion vector prediction mode.
  • whether to apply the two-way matching method may be determined based on whether the selected motion information merge candidate or the selected motion vector prediction candidate indicates the two-way matching method.
  • the temporal order of the current picture must exist between the temporal order of the L0 reference picture and the temporal order of the L1 reference picture. It is also possible to generate a prediction block of the current block by applying a one-way matching method that does not apply the constraints of the above two-way matching method.
  • a one-way matching method two reference pictures whose temporal order (i.e., POC) is smaller than that of the current block or two reference pictures whose temporal order is larger than the current block can be used.
  • both reference pictures may be derived from the L0 reference picture list or the L1 reference picture list.
  • one of the two reference pictures may be derived from the L0 reference picture list, and the other may be derived from the L1 reference picture list.
  • a reference block or reference template for the current block may be derived based on the motion information of the current block. At this time, if the motion vector of the current block points to a fractional position rather than an integer position, the integer position samples can be interpolated to generate a fractional position sample.
  • Figures 24 and 25 show examples of cases where the motion vector of the current block points to an integer position and a fractional position, respectively.
  • the size of the current block is assumed to be 4x4, and the position indicated by the motion vector of the current block is assumed to be a position away from the upper left sample of the current block by the motion vector of the current block.
  • a reference block of the same size i.e., 4x4
  • the current block composed of integer position samples is used for prediction of the current block.
  • a reference block of the same size as the current block composed of fractional position samples is set as the prediction block of the current block. It can be.
  • fractional position samples can be derived by interpolating surrounding integer position samples.
  • the interpolation may include at least one of horizontal interpolation and vertical interpolation.
  • Figure 26 shows an example in which fractional position samples are derived by interpolating integer position samples.
  • the fraction position sample to be generated is called the 'current fraction position sample'.
  • a first horizontally interpolated sample located in the vertical direction with the current fractional position sample and A second horizontal interpolation sample may be obtained.
  • the first horizontal interpolation sample (a in Figure 26) is derived by interpolating integer position samples (A and B in Figure 26) located at the top of the current fractional position sample
  • the second horizontal interpolation sample (B in FIG. 26) may be derived by interpolating integer position samples (C and D in FIG. 26) located at the bottom of the current fractional position sample.
  • the weight applied to each integer position sample may be determined based on the horizontal distance (i.e., x-coordinate difference) between the integer position sample and the current fractional position sample.
  • Equation 5 represents an example in which the first horizontal interpolation sample and the second horizontal interpolation sample are derived.
  • the current fractional position sample may be obtained through vertical interpolation for the first horizontal interpolation sample and the second horizontal interpolation sample generated through horizontal interpolation.
  • the weight applied to each of the first horizontal interpolation sample and the second horizontal interpolation sample may be determined by the vertical distance (i.e., y-coordinate difference) from the current fractional position sample.
  • the current fractional position sample p can be derived as in Equation 6 below.
  • the current fractional position sample is derived by performing operations in the order of horizontal interpolation and vertical interpolation.
  • the current fractional position sample may be derived by performing operations in the order of vertical interpolation and horizontal interpolation.
  • the first vertical interpolation sample and the second vertical interpolation sample may be interpolated in the horizontal direction to obtain a current fractional position sample.
  • the first vertical interpolation sample is obtained by interpolating integer position samples located to the left of the current fractional position pixel
  • the second vertical interpolation sample is obtained by interpolating integer position samples located to the right of the current fractional position pixel. It may have been obtained through this.
  • the above-described interpolation method can be applied to each of the fractional position samples in the reference block, and thus a reference block composed of fractional position samples can be obtained.
  • fractional position samples are derived by a bilinear interpolation method. Unlike what has been described, fractional position samples may be derived by applying a different interpolation method, such as cubic convolution interpolation, or by using an interpolation filter different from Equation 5 and Equation 6. As an example, an interpolation filter that is different from Equation 5 and Equation 6 in at least one of the number of taps or filter coefficients may be used.
  • a different interpolation method such as cubic convolution interpolation
  • an interpolation filter that is different from Equation 5 and Equation 6 in at least one of the number of taps or filter coefficients may be used.
  • one of a plurality of interpolation filters may be selected based on at least one of the precision (or resolution) of the motion vector, the size of the current block, or the position of the current block in the picture.
  • each of the plurality of interpolation filters may be different from other candidates in at least one of the number of taps or filter coefficients.
  • one of horizontal interpolation and vertical interpolation may be omitted depending on the fractional position indicated by the motion vector of the current block.
  • the horizontal component (i.e., x-axis component) of the motion vector of the current block has an integer value
  • the vertical component (i.e., y-axis component) of the motion vector of the current block has a real value
  • Directional interpolation can be omitted, and the current fractional position sample can be derived through vertical interpolation of reference samples located at the top and bottom of the current fractional position sample.
  • the vertical direction Interpolation is omitted, and the current fractional position sample can be derived through horizontal interpolation of reference samples located to the left and right of the current fractional position sample.
  • obtaining a current fractional position sample by interpolating interpolation samples located in the vertical or horizontal direction from the current fractional position sample may be referred to as a general interpolation method.
  • the current fractional position sample may be obtained by interpolating interpolation samples that are not located in the vertical or horizontal direction from the current fractional position sample. That is, depending on the direction of interpolation, the positions of the interpolation samples used to generate the current fractional position sample may be determined variably.
  • an interpolation method in which the positions of interpolation samples used to generate the current fractional position sample are variable depending on the direction of interpolation may be referred to as an angular interpolation method.
  • Information indicating whether to use the angular interpolation method may be explicitly encoded and signaled through the bitstream. If the above information indicates that an angular interpolation method is not used, fractional position samples may be derived by a general interpolation method.
  • whether to use the angular interpolation method will be determined based on the position indicated by the motion vector of the current block, the integer position closest to the position indicated by the motion vector, or the prediction information of the reference block including the position indicated by the motion vector. You can. For example, if prediction information at the integer position closest to the position indicated by the motion vector of the current block indicates intra prediction, the angular interpolation method may be used.
  • the directionality of angular interpolation may be determined based on the position indicated by the motion vector of the current block, the integer position closest to the position indicated by the motion vector, or the intra prediction mode of the reference block containing the position indicated by the integer portion of the motion vector. You can.
  • the position indicated by the motion vector of the current block may be determined based on the upper left position or center position of the current block.
  • the direction of the intra prediction mode of the corresponding block can be set to the direction of angular interpolation.
  • the direction of angular interpolation can be determined based on prediction information about a specific location sample within the reference block.
  • the specific location sample may include at least one of a center location sample within the reference block, an upper left corner sample, an upper right corner sample, a lower left corner sample, or a lower right corner sample.
  • the direction of angular interpolation may be determined based on whether the prediction information stored in the sample at the center location (center) in the reference block is inter-prediction or intra-prediction. If the prediction information stored in the sample at the central location indicates inter prediction, the directionality for angular interpolation may be determined to be non-directional. On the other hand, when the prediction information stored in the central location sample indicates intra prediction, the direction of angular interpolation may be set to be the same as the directionality of the intra prediction mode of the central location sample.
  • Figures 27 and 28 show examples in which the current fractional position sample is derived by angular interpolation.
  • the direction of the intra prediction mode of the position can be set to the direction of angular interpolation. 27 and 28, the direction of angular interpolation is illustrated as being set to be the same as intra prediction mode No. 47 in FIG. 3.
  • the integer position samples (A and B in Figure 27) located at the top of the current block are interpolated to produce the first horizontal interpolation sample (Figure 27), which lies on the same angular line as the current fractional position sample.
  • the angle line may correspond to the directionality of intra prediction mode No. 47.
  • the first horizontal interpolation sample and the second horizontal interpolation sample may be interpolated to derive the current fractional position sample (p in FIG. 27).
  • the weight given to each of the first horizontal interpolation sample and the second horizontal interpolation sample may be determined based on the distance from the current fractional position sample (d1 and d2 in FIG. 27).
  • variables w1, w2, w3, w4, d1, and d2 that represent the distance between samples are used.
  • the above variables can be derived based on the angle ( ⁇ ) according to the direction of angular interpolation, as in the example shown in FIG. 28.
  • the tan ⁇ value according to the directionality of the intra prediction mode may be predefined in the encoder and decoder.
  • the vertical distance (h1) from the current fractional position sample to the upper integer position sample and the vertical distance from the current fractional position sample to the lower integer position sample (h2) can be derived.
  • the sum of h1 and h2 represents the distance between integer position samples, so if one of h1 and h2 is derived, the other can also be derived.
  • the horizontal distance (w5) between the current fractional position sample and the first horizontal interpolation sample and the horizontal distance between the current fractional position sample and the second horizontal interpolation sample (w6) can be derived.
  • w5 is then added to the horizontal distance between the fractional position sample and the left integer position sample (i.e., the real part of the motion vector) to obtain the distance from the left integer position sample to the second horizontal interpolation sample (w3 ) can be derived.
  • the sum of the distance (w3) from the left integer position sample to the second horizontal interpolation sample and the distance (w4) from the second horizontal interpolation sample to the right integer position sample represents the distance between the integer position samples.
  • the ratio between the distance (d1) from the current fractional position sample to the first horizontal interpolation sample and the distance (d2) from the current fractional position sample to the second horizontal interpolation sample is, from the current fractional position sample, to the first horizontal interpolation sample. It is equal to the ratio between the vertical distance (h1) to the directional interpolation sample and the vertical distance (h2) from the current fractional position sample to the second horizontal interpolation sample. Accordingly, the current fractional position sample can be derived according to Equation 6 described above.
  • the current fractional position sample is obtained by vertically interpolating the first horizontal interpolation sample and the second horizontal interpolation sample obtained by performing horizontal interpolation on integer position samples.
  • the current fractional position sample may be obtained by horizontally interpolating the first vertical interpolation sample and the second vertical interpolation sample obtained by performing vertical interpolation on integer position samples.
  • which of horizontal interpolation and vertical interpolation is performed first may be determined based on the direction of angular interpolation.
  • the direction of angular interpolation is between the upper-left direction and the upper-right direction shown in FIG. 4 (i.e., in the range of 34 or more to 66 or less)
  • the first obtained by interpolating integer position samples in the horizontal direction The horizontal interpolation sample and the second horizontal interpolation sample may be vertically interpolated to obtain a current fractional position sample.
  • the direction of angular interpolation is between the upper-left direction and the lower-left direction shown in FIG.
  • second vertical interpolation obtained by interpolating integer position samples in the vertical direction.
  • a current fractional position sample may be obtained.
  • the intra prediction mode corresponding to the position indicated by the motion vector of the current block is a non-directional mode (i.e., DC mode or planner mode), as described with reference to FIGS. 25 and 26, horizontal interpolation and vertical interpolation Through directional interpolation, current fractional position samples can be obtained.
  • a non-directional mode i.e., DC mode or planner mode
  • the current fraction is obtained through horizontal interpolation and vertical interpolation, as described with reference to FIGS. 25 and 26. Location samples may be obtained.
  • an intra prediction mode can be determined for each of the partitioned regions. Specifically, for a partitioned area in a reference picture, the cost for each of the intra prediction modes can be calculated, and then the intra prediction mode with the optimal cost can be determined.
  • the area may be a square or non-square block. For example, it may be a block of size 4x4, 8x8, 16x16, 32x32, 64x64, or 128x128.
  • An area subject to directionality determination within a reference picture may be referred to as a reference area, and a sample within the reference area may be referred to as a reference sample.
  • the cost for intra prediction mode may be the Sum of Absoulte Difference (SAD) between prediction samples and reconstruction samples in the reference region. Specifically, the cost for the intra prediction mode can be calculated by adding the difference between the prediction samples derived when the intra prediction mode is applied to the reference region and the reconstructed samples of the reference region.
  • SAD Sum of Absoulte Difference
  • the cost may be calculated only for predefined intra prediction modes.
  • the cost may be calculated only for N predefined intra prediction modes, and one of the N predefined intra prediction modes may be set as the intra prediction mode of the reference region.
  • the N predefined intra prediction modes may include at least one of a vertical mode, a horizontal mode, an upper left diagonal mode, an upper right diagonal mode, or a lower left diagonal mode.
  • the intra prediction mode with the optimal cost (i.e., the smallest cost) among the plurality of intra prediction modes can be set as the intra prediction mode of the reference region.
  • the direction of the intra prediction mode assigned to the reference region including the position indicated by the motion vector of the current block may be set to the direction of angular interpolation. .
  • the optimal intra prediction mode for a reference region containing the position indicated by the motion vector of the current block is a non-directional mode (i.e. DC mode or planar mode)
  • the directionality of angular interpolation corresponding to that reference region exists. It may be decided not to do it.
  • the current fractional position sample can be derived by performing horizontal interpolation and vertical interpolation, as described with reference to FIGS. 25 and 26.
  • the intra prediction mode of the reference region may be determined based on the gradient for the reference region.
  • Figure 29 is a diagram for explaining an example of deriving a slope with respect to a reference area.
  • the reference area is assumed to be 8x8 in size.
  • Filtering or convolution within a region can be performed using a mask.
  • the filtering or convolution may be performed based on at least one of a Sobel mask or a Prewitt mask that can output a gradient value.
  • filtering or convolution may be performed for each of the horizontal and vertical directions.
  • Figure 30 is a diagram showing masking aspects in the vertical and horizontal directions for each of the Sobel mask and the Prewitt mask.
  • a different type of filter from that shown in FIG. 30 may be applied to the reference area.
  • a square filter with a size of 3x3, a 1D filter with a size of 1x3 or 3x1 a rectangular filter with a size of 2x3 or 2x3, a cross-shaped filter, or a diamond-shaped filter can be applied to the reference area.
  • a filter of a different size from that shown in FIG. 14 eg, 2x2, 4x4, or 5x5, etc. may be applied to the reference area.
  • the type of filter applied to the reference area may be predefined in the encoder and decoder.
  • index information indicating one of the plurality of filter candidates may be encoded and explicitly signaled through a bitstream.
  • the slope for each reference sample in the reference area can be obtained.
  • a vertical mask of size 3x3 is applied centering on a specific reference sample to obtain the vertical slope Dy for the specific reference sample, and a horizontal mask of size 3x3 is applied around the specific reference sample to obtain The horizontal slope Dx can be obtained.
  • a mask may not be applied to reference samples located at the boundary within the reference area, as in the example shown in FIG. 29. That is, when a 3x3 sized mask is used, the values of the vertical slope Dy and the horizontal slope Dx can be derived for 36 reference samples in an 8x8 block.
  • At least one of the intra prediction mode or the group to which the intra prediction mode belongs may be determined.
  • the group to which the intra prediction mode corresponding to the intra prediction mode of the reference sample in the reference region belongs is called the group to which the intra prediction mode for the reference sample belongs. Decisions can be made as a group.
  • Figure 31 shows an example in which intra prediction modes are classified into a plurality of groups.
  • the intra prediction modes are classified into four intra prediction mode groups (a to d) based on the horizontal mode (No. 18), the diagonal mode (No. 34), and the vertical mode (No. 50). This was exemplified.
  • group a and group b have a symmetrical structure with respect to the horizontal mode (no. 18), and group c and group d have a symmetrical structure with respect to the vertical mode (no. 50).
  • angles of intra prediction modes 36 to 66 are the same as the transposed angles of modes 2 to 34.
  • the group to which the intra prediction mode of the reference sample belongs can be determined by comparing the absolute values of the vertical slope Dy and the horizontal slope Dx of the corresponding sample. For example, when the absolute value of the horizontal slope Dx of the reference sample is greater than the absolute value of the vertical slope Dy, the intra prediction mode of the reference sample may belong to group a or group b.
  • the intra prediction mode of the reference sample may belong to group c or group d.
  • Table 3 shows the group to which the intra prediction mode of the reference sample belongs according to the magnitude of the horizontal slope Dx and the vertical slope Dy.
  • Equation 9 Using the horizontal slope Dx and the vertical slope Dy of the reference sample, the slope of the intra prediction mode to be assigned to the reference sample can be derived. To this end, a variable R representing the ratio between the horizontal slope and the vertical slope can be derived, as shown in Equation 9 below.
  • the variable R can be derived by using the larger absolute value of the horizontal slope Dx and the vertical slope Dy as the denominator.
  • the intra prediction mode of the reference sample can be determined by comparing the variable R and the tangent value (tan ⁇ ) for each angle of the directional modes. Specifically, an intra prediction mode with the same tangent value or the most similar tangent value as the variable R may be assigned to the reference sample.
  • the variable R is scaled using the same scaling factor, The intra prediction mode of the reference sample can be determined.
  • the amplitude of each reference sample can be derived.
  • the amplitude can be derived as the sum of the absolute value of the horizontal slope Dx and the absolute value of the vertical slope Dy, as shown in Equation 10 below.
  • the amplitude value of each reference sample to which the same intra prediction mode is assigned may be accumulated.
  • intra_mode represents the intra prediction mode.
  • the amplitude accumulation value for the intra prediction mode with mode number N is derived by summing the amplitude values of reference samples assigned to mode N in the reference region
  • the amplitude accumulation value for the intra prediction mode with mode number M Can be derived by summing the amplitude values of reference samples assigned to mode M in the reference area.
  • the buffer storing the amplitude accumulation value may be initialized in area units. As an example, starting from an initial value (i.e., 0), the amplitude accumulation value for the reference region within the reference picture may be calculated.
  • the intra prediction mode with the largest amplitude accumulation value in the histogram can be selected.
  • the intra prediction mode selected from the histogram can be set as the intra prediction mode of the reference area. Afterwards, the direction of the reference area indicated by the motion vector of the current block can be set to the direction of angular interpolation.
  • the intra prediction mode may be determined only for the reference block including the position indicated by the motion vector of the current block in the reference picture.
  • the reference block may be partitioned into a plurality of sub-blocks and then the intra prediction mode may be determined for each sub-block.
  • the direction of angular interpolation may be different on a sub-block basis.
  • the direction of angular interpolation can be determined for each luma component and chroma component.
  • the direction of angular interpolation of the chroma component may be set to be the same as the direction of angular interpolation of the luma component.
  • the direction of the component encoded/decoded first can be reused for the component encoded/decoded later.
  • the intra prediction mode for each of the reference regions for the Y component in the reference picture is set to the intra prediction mode for each of the reference regions for the Cb component or Cr component in the reference picture. can be reused.
  • the current fractional position sample is derived through bilinear interpolation.
  • cubic-convolution interpolation, B-spline interpolation, or Gaussian interpolation may be used to derive the first horizontal interpolation sample and the second horizontal interpolation sample.
  • bilinear interpolation may be set to be used as is.
  • each of the components (e.g., units, modules, etc.) constituting the block diagram may be implemented as a hardware device or software, and a plurality of components may be combined to form a single hardware device or software. It may be implemented.
  • the above-described embodiments may be implemented in the form of program instructions that can be executed through various computer components and recorded on a computer-readable recording medium.
  • the computer-readable recording medium may include program instructions, data files, data structures, etc., singly or in combination.
  • Examples of computer-readable recording media include magnetic media such as hard disks, floppy disks and magnetic tapes, optical recording media such as CD-ROMs and DVDs, and magneto-optical media such as floptical disks. media), and hardware devices specifically configured to store and perform program instructions, such as ROM, RAM, flash memory, etc.
  • the hardware device may be configured to operate as one or more software modules to perform processing according to the invention and vice versa.
  • Embodiments through this disclosure can be applied to electronic devices that encode or decode images.

Landscapes

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

Abstract

An image encoding/decoding method according to the present invention comprises the steps of: deriving a motion vector of the current block; and on the basis of the motion vector, acquiring a prediction sample of the current block from a reference picture. Here, if the location indicated by the motion vector within the reference picture is a fractional location, the prediction sample may be set to a fractional location sample acquired by interpolating a first interpolated sample and a second interpolated sample that are acquired by interpolating integer location samples within the reference picture, and the locations of the first interpolated sample and the second interpolated sample may be determine by the directionality of interpolation.

Description

영상 부호화/복호화 방법 및 비트스트림을 저장하는 기록 매체 Video encoding/decoding method and recording medium for storing bitstream
본 발명은 영상 신호 처리 방법 및 장치에 관한 것이다.The present invention relates to a video signal processing method and device.
최근 HD(High Definition) 영상 및 UHD(Ultra High Definition) 영상과 같은 고해상도, 고품질의 영상에 대한 수요가 다양한 응용 분야에서 증가하고 있다. 영상 데이터가 고해상도, 고품질이 될수록 기존의 영상 데이터에 비해 상대적으로 데이터량이 증가하기 때문에 기존의 유무선 광대역 회선과 같은 매체를 이용하여 영상 데이터를 전송하거나 기존의 저장 매체를 이용해 저장하는 경우, 전송 비용과 저장 비용이 증가하게 된다. 영상 데이터가 고해상도, 고품질화 됨에 따라 발생하는 이러한 문제들을 해결하기 위해서는 고효율의 영상 압축 기술들이 활용될 수 있다.Recently, demand for high-resolution, high-quality images such as HD (High Definition) images and UHD (Ultra High Definition) images is increasing in various application fields. As video data becomes higher resolution and higher quality, the amount of data increases relative to existing video data. Therefore, when video data is transmitted using media such as existing wired or wireless broadband lines or stored using existing storage media, transmission costs and Storage costs increase. High-efficiency video compression technologies can be used to solve these problems that arise as video data becomes higher resolution and higher quality.
영상 압축 기술로 현재 픽쳐의 이전 또는 이후 픽쳐로부터 현재 픽쳐에 포함된 화소값을 예측하는 화면 간 예측 기술, 현재 픽쳐 내의 화소 정보를 이용하여 현재 픽쳐에 포함된 화소값을 예측하는 화면 내 예측 기술, 출현 빈도가 높은 값에 짧은 부호를 할당하고 출현 빈도가 낮은 값에 긴 부호를 할당하는 엔트로피 부호화 기술 등 다양한 기술이 존재하고 이러한 영상 압축 기술을 이용해 영상 데이터를 효과적으로 압축하여 전송 또는 저장할 수 있다.Inter-screen prediction technology that predicts the pixel value included in the current picture from pictures before or after the current picture using video compression technology, intra-screen prediction technology that predicts the pixel value included in the current picture using pixel information in the current picture, There are various technologies, such as entropy coding technology, which assigns short codes to values with a high frequency of occurrence and long codes to values with a low frequency of occurrence. Using these video compression technologies, video data can be effectively compressed and transmitted or stored.
한편, 고해상도 영상에 대한 수요가 증가함과 함께, 새로운 영상 서비스로서 입체 영상 컨텐츠에 대한 수요도 함께 증가하고 있다. 고해상도 및 초고해상도의 입체 영상 콘텐츠를 효과적으로 제공하기 위한 비디오 압축 기술에 대하여 논의가 진행되고 있다.Meanwhile, as the demand for high-resolution video increases, the demand for three-dimensional video content as a new video service is also increasing. Discussions are underway regarding video compression technology to effectively provide high-resolution and ultra-high-resolution stereoscopic video content.
본 개시는 영상 신호를 부호화/복호화함에 있어서, 참조 픽처 내 분수 위치 샘플을 유도하는 방법 및 이를 위한 장치를 제공하는 것을 목적으로 한다.The purpose of the present disclosure is to provide a method and device for deriving fractional position samples within a reference picture when encoding/decoding a video signal.
본 개시는 영상 신호를 부호화/복호화함에 있어서, 방향성이 가변적인 보간 방법 및 이를 위한 장치를 제공하는 것을 목적으로 한다.The purpose of the present disclosure is to provide an interpolation method with variable directionality and a device therefor when encoding/decoding video signals.
본 개시는 영상 신호를 부호화/복호화함에 있어서, 참조 블록 내 예측 정보에 기반하여, 보간의 방향성을 결정하는 방법 및 이를 위한 장치를 제공하는 것을 목적으로 한다.The purpose of the present disclosure is to provide a method and device for determining the direction of interpolation based on prediction information in a reference block when encoding/decoding a video signal.
본 개시에서 이루고자 하는 기술적 과제들은 이상에서 언급한 기술적 과제들로 제한되지 않으며, 언급하지 않은 또 다른 기술적 과제들은 아래의 기재로부터 본 발명이 속하는 기술분야에서 통상의 지식을 가진 자에게 명확하게 이해될 수 있을 것이다.The technical problems to be achieved in the present disclosure are not limited to the technical problems mentioned above, and other technical problems not mentioned will be clearly understood by those skilled in the art from the description below. You will be able to.
본 개시에 따른 영상 복호화 방법은, 현재 블록의 움직임 벡터를 유도하는 단계; 및 상기 움직임 벡터에 기반하여, 참조 픽처로부터 상기 현재 블록의 예측 샘플을 획득하는 단계를 포함한다. 이때, 상기 참조 픽처 내 상기 움직임 벡터가 지시하는 위치가 분수 위치인 경우, 상기 예측 샘플은, 상기 참조 픽처 내 정수 위치 샘플들을 보간하여 획득되는 제1 보간 샘플 및 제2 보간 샘플을 보간함으로써 획득되는 분수 위치 샘플로 설정되고, 상기 제1 보간 샘플 및 제2 보간 샘플의 위치는, 보간의 방향성에 의해 결정될 수 있다.An image decoding method according to the present disclosure includes deriving a motion vector of a current block; and obtaining a prediction sample of the current block from a reference picture based on the motion vector. At this time, when the position indicated by the motion vector in the reference picture is a fractional position, the prediction sample is obtained by interpolating a first interpolation sample and a second interpolation sample obtained by interpolating integer position samples in the reference picture. Fractional position samples are set, and the positions of the first and second interpolation samples may be determined by the direction of interpolation.
본 개시에 따른 영상 부호화 방법은, 현재 블록의 움직임 벡터를 유도하는 단계; 및 상기 움직임 벡터에 기반하여, 참조 픽처로부터 상기 현재 블록의 예측 샘플을 획득하는 단계를 포함한다. 이때, 상기 참조 픽처 내 상기 움직임 벡터가 지시하는 위치가 분수 위치인 경우, 상기 예측 샘플은, 상기 참조 픽처 내 정수 위치 샘플들을 보간하여 획득되는 제1 보간 샘플 및 제2 보간 샘플을 보간함으로써 획득되는 분수 위치 샘플로 설정되고, 상기 제1 보간 샘플 및 제2 보간 샘플의 위치는, 보간의 방향성에 의해 결정될 수 있다.An image encoding method according to the present disclosure includes deriving a motion vector of a current block; and obtaining a prediction sample of the current block from a reference picture based on the motion vector. At this time, when the position indicated by the motion vector in the reference picture is a fractional position, the prediction sample is obtained by interpolating a first interpolation sample and a second interpolation sample obtained by interpolating integer position samples in the reference picture. Fractional position samples are set, and the positions of the first and second interpolation samples may be determined by the direction of interpolation.
본 개시에 따른 영상 복호화/부호화 방법에 있어서, 상기 제1 보간 샘플 및 상기 제2 보간 샘플은, 상기 분수 위치 샘플을 지나는 각도선 상에 놓일 수 있다. 이때, 상기 각도선은, 상기 보간의 방향성에 대응하는 것일 수 있다.In the video decoding/encoding method according to the present disclosure, the first interpolation sample and the second interpolation sample may be placed on an angle line passing through the fractional position sample. At this time, the angle line may correspond to the direction of the interpolation.
본 개시에 따른 영상 복호화/부호화 방법에 있어서, 상기 보간의 방향성은, 상기 움직임 벡터가 지시하는 위치를 포함하는 참조 블록의 예측 정보를 기반으로 결정될 수 있다.In the video decoding/coding method according to the present disclosure, the direction of interpolation may be determined based on prediction information of a reference block including the position indicated by the motion vector.
본 개시에 따른 영상 복호화/부호화 방법에 있어서, 상기 참조 블록이 인트라 예측으로 부호화된 경우, 상기 보간의 방향성은, 상기 참조 블록의 인트라 예측 모드의 방향성과 동일할 수 있다.In the image decoding/coding method according to the present disclosure, when the reference block is encoded by intra prediction, the direction of interpolation may be the same as the direction of the intra prediction mode of the reference block.
본 개시에 따른 영상 복호화/부호화 방법에 있어서, 상기 예측 정보는, 인트라 예측 모드를 포함하고, 상기 참조 블록의 상기 인트라 예측 모드는, 복수의 인트라 예측 모드 후보들에 대한 비용을 기반으로 결정될 수 있다.In the video decoding/encoding method according to the present disclosure, the prediction information includes an intra prediction mode, and the intra prediction mode of the reference block may be determined based on costs for a plurality of intra prediction mode candidates.
본 개시에 따른 영상 복호화/부호화 방법에 있어서, 인트라 예측 모드 후보에 대한 비용은, 상기 참조 블록에 대해 상기 인트라 예측 모드를 기반으로 인트라 예측을 적용함으로써 획득된 예측 샘플과 상기 참조 블록 내 복원 샘플 사이의 차분값을 기반으로 획득될 수 있다.In the image decoding/encoding method according to the present disclosure, the cost for an intra prediction mode candidate is determined between a prediction sample obtained by applying intra prediction based on the intra prediction mode to the reference block and a restored sample within the reference block. It can be obtained based on the difference value of .
본 개시에 따른 영상 복호화/부호화 방법에 있어서, 상기 복수의 인트라 예측 모드 후보들은, 수직 방향 모드, 수평 방향 모드, 좌상단 대각 방향 모드, 우상단 대각 방향 모드 또는 좌하단 대각 방향 모드 중 적어도 하나를 포함할 수 있다.In the video decoding/encoding method according to the present disclosure, the plurality of intra prediction mode candidates may include at least one of a vertical mode, a horizontal mode, an upper left diagonal mode, an upper right diagonal mode, and a lower left diagonal mode. You can.
본 개시에 따른 영상 복호화/부호화 방법에 있어서, 상기 참조 블록이 인트라 예측으로 부호화되지 않은 경우, 상기 제1 보간 샘플 및 상기 제2 보간 샘플은, 상기 현재 분수 위치 샘플로부터 수직 또는 수평 방향에 놓여 있을 수 있다.In the image decoding/coding method according to the present disclosure, when the reference block is not encoded with intra prediction, the first interpolation sample and the second interpolation sample may be located in a vertical or horizontal direction from the current fractional position sample. You can.
본 개시에 따른 영상 복호화/부호화 방법에 있어서, 상기 현재 블록의 루마 성분에 대해서는, 상기 참조 블록의 예측 정보에 기반하여, 상기 보간의 방향성이 결정되고, 상기 현재 블록의 크로마 성분에 대해서는, 상기 루마 성분에 대한 보간의 방향성이 재사용될 수 있다.In the video decoding/coding method according to the present disclosure, for the luma component of the current block, the direction of interpolation is determined based on prediction information of the reference block, and for the chroma component of the current block, the luma component is determined. The directionality of interpolation for components can be reused.
본 개시에 따른 영상 부호화 방법에 의해 부호화된 비트스트림을 저장하는 컴퓨터로 판독가능한 기록 매체가 제공될 수 있다.A computer-readable recording medium that stores a bitstream encoded by the video encoding method according to the present disclosure may be provided.
본 개시에 의하면, 방향성이 가변적인 보간을 기반으로 분수 위치 샘플을 획득함으로써, 예측 정확도를 향상시킬 수 있다. According to the present disclosure, prediction accuracy can be improved by obtaining fractional position samples based on interpolation with variable direction.
본 개시는 영상 신호를 부호화/복호화함에 있어서, 참조 블록 내 예측 정보에 기반하여, 보간의 방향성을 결정함으로써, 부호화/복호화 효율을 향상시킬 수 있다.The present disclosure can improve encoding/decoding efficiency by determining the direction of interpolation based on prediction information in a reference block when encoding/decoding a video signal.
본 개시에서 얻을 수 있는 효과는 이상에서 언급한 효과들로 제한되지 않으며, 언급하지 않은 또 다른 효과들은 아래의 기재로부터 본 개시가 속하는 기술분야에서 통상의 지식을 가진 자에게 명확하게 이해될 수 있을 것이다.The effects that can be obtained from the present disclosure are not limited to the effects mentioned above, and other effects not mentioned can be clearly understood by those skilled in the art from the description below. will be.
도 1은 본 개시의 일실시예에 따른 영상 부호화 장치를 나타낸 블록도이다. 1 is a block diagram showing a video encoding device according to an embodiment of the present disclosure.
도 2는 본 개시의 일실시예에 따른 영상 복호화 장치를 나타낸 블록도이다.Figure 2 is a block diagram showing a video decoding device according to an embodiment of the present disclosure.
도 3은 본 개시에 따른 영상 부호화/복호화 장치에 의해 수행되는 영상 부호화/복호화 방법을 도시한 것이다.FIG. 3 illustrates an image encoding/decoding method performed by the image encoding/decoding device according to the present disclosure.
도 4 및 도 5는 본 개시에 따른 복수의 인트라 예측 모드의 일예를 도시한 것이다.Figures 4 and 5 show an example of a plurality of intra prediction modes according to the present disclosure.
도 6은 본 개시에 따른 플래너 모드 기반의 인트라 예측 방법을 도시한 것이다.Figure 6 illustrates a planar mode-based intra prediction method according to the present disclosure.
도 7은 본 개시에 따른 DC 모드 기반의 인트라 예측 방법을 도시한 것이다.Figure 7 shows a DC mode-based intra prediction method according to the present disclosure.
도 8은 본 개시에 따른 방향성 모드 기반의 인트라 예측 방법을 도시한 것이다.Figure 8 illustrates a directional mode-based intra prediction method according to the present disclosure.
도 9는 분수 위치의 샘플을 유도하는 방법을 도시한 것이다.Figure 9 shows a method for deriving samples of fractional positions.
도 10 및 도 11은 인트라 예측 모드별, 각도에 대한 탄젠트 값이 32배 스케일링된 것을 도시한 것이다.Figures 10 and 11 show that the tangent value for the angle is scaled by 32 times for each intra prediction mode.
도 12는 방향성 모드가 34번 내지 49번 모드 중 하나인 경우, 인트라 예측 양상을 예시한 도면이다.Figure 12 is a diagram illustrating an intra prediction aspect when the directional mode is one of modes 34 to 49.
도 13은 좌측 참조 샘플들을 보간하여 상단 참조 샘플을 생성하는 예를 설명하기 위한 도면이다.Figure 13 is a diagram for explaining an example of generating an upper reference sample by interpolating left reference samples.
도 14는 1D 어레이로 배열된 참조 샘플들을 이용하여, 인트라 예측이 수행되는 예를 나타낸 것이다.Figure 14 shows an example in which intra prediction is performed using reference samples arranged in a 1D array.
도 15 및 도 16은 인터 예측 방법의 흐름도이다.Figures 15 and 16 are flowcharts of the inter prediction method.
도 17은 움직임 추정이 수행되는 예를 나타낸다. Figure 17 shows an example in which motion estimation is performed.
도 18 및 도 19는, 움직임 추정을 통해 생성된 움직임 정보를 기초로, 현재 블록의 예측 블록이 생성되는 예를 나타낸 것이다.Figures 18 and 19 show an example in which a prediction block of the current block is generated based on motion information generated through motion estimation.
도 20은 움직임 벡터 예측값을 유도하기 위해 참조되는 위치를 나타낸다.Figure 20 shows positions referenced to derive motion vector prediction values.
도 21은 템플릿 기반 움직임 추정 방법을 설명하기 위한 도면이다.Figure 21 is a diagram for explaining a template-based motion estimation method.
도 22는 템플릿의 구성 예들을 나타낸다.Figure 22 shows examples of template configurations.
도 23은 쌍방 매칭 방법을 기반의 움직임 추정 방법을 설명하기 위한 도면이다.Figure 23 is a diagram for explaining a motion estimation method based on the bilateral matching method.
도 24 및 도 25는 각각 현재 블록의 움직임 벡터가 정수 위치를 가리키는 경우 및 분수 위치를 가리키는 경우의 예를 나타낸다.Figures 24 and 25 show examples of cases where the motion vector of the current block points to an integer position and a fractional position, respectively.
도 26는 정수 위치 샘플들을 보간하여, 분수 위치 샘플이 유도되는 예를 나타낸 것이다.Figure 26 shows an example in which fractional position samples are derived by interpolating integer position samples.
도 27 및 도 28은 앵귤러 보간에 의해 현재 분수 위치 샘플이 유도되는 예를 나타낸 것이다.Figures 27 and 28 show examples in which the current fractional position sample is derived by angular interpolation.
도 29는 참조 영역에 대한 기울기를 유도하는 예를 설명하기 위한 도면이다. Figure 29 is a diagram for explaining an example of deriving a slope with respect to a reference area.
도 30은 소벨 마스크 및 프리윗 마스크 각각에 대한 수직 방향 및 수평 방향에 대한 마스킹 양상을 도시한 도면이다. Figure 30 is a diagram showing masking aspects in the vertical and horizontal directions for each of the Sobel mask and the Prewitt mask.
도 31은 인트라 예측 모드들이 복수개의 그룹들로 분류된 예를 나타낸 것이다. Figure 31 shows an example in which intra prediction modes are classified into a plurality of groups.
본 발명은 다양한 변경을 가할 수 있고 여러 가지 실시예를 가질 수 있는 바, 특정 실시예들을 도면에 예시하고 상세한 설명에 상세하게 설명하고자 한다. 그러나, 이는 본 발명을 특정한 실시 형태에 대해 한정하려는 것이 아니며, 본 발명의 사상 및 기술 범위에 포함되는 모든 변경, 균등물 내지 대체물을 포함하는 것으로 이해되어야 한다. 각 도면을 설명하면서 유사한 참조부호를 유사한 구성요소에 대해 사용하였다.Since the present invention can make various changes and have various embodiments, specific embodiments will be illustrated in the drawings and described in detail in the detailed description. However, this is not intended to limit the present invention to specific embodiments, and should be understood to include all changes, equivalents, and substitutes included in the spirit and technical scope of the present invention. While describing each drawing, similar reference numerals are used for similar components.
제1, 제2 등의 용어는 다양한 구성요소들을 설명하는데 사용될 수 있지만, 상기 구성요소들은 상기 용어들에 의해 한정되어서는 안 된다. 상기 용어들은 하나의 구성요소를 다른 구성요소로부터 구별하는 목적으로만 사용된다. 예를 들어, 본 발명의 권리 범위를 벗어나지 않으면서 제1 구성요소는 제2 구성요소로 명명될 수 있고, 유사하게 제2 구성요소도 제1 구성요소로 명명될 수 있다. 및/또는 이라는 용어는 복수의 관련된 기재된 항목들의 조합 또는 복수의 관련된 기재된 항목들 중의 어느 항목을 포함한다.Terms such as first, second, etc. may be used to describe various components, but the components should not be limited by the terms. The above terms are used only for the purpose of distinguishing one component from another. For example, a first component may be named a second component, and similarly, the second component may also be named a first component without departing from the scope of the present invention. The term and/or includes any of a plurality of related stated items or a combination of a plurality of related stated items.
어떤 구성요소가 다른 구성요소에 "연결되어" 있다거나 "접속되어"있다고 언급된 때에는, 그 다른 구성요소에 직접적으로 연결되어 있거나 또는 접속되어 있을 수도 있지만, 중간에 다른 구성요소가 존재할 수도 있다고 이해되어야 할 것이다. 반면에, 어떤 구성요소가 다른 구성요소에 "직접 연결되어"있다거나 "직접 접속되어"있다고 언급된 때에는, 중간에 다른 구성요소가 존재하지 않는 것으로 이해되어야 할 것이다.When a component is said to be "connected" or "connected" to another component, it is understood that it may be directly connected or connected to the other component, but that other components may exist in between. It should be. On the other hand, when it is mentioned that a component is “directly connected” or “directly connected” to another component, it should be understood that there are no other components in between.
본 출원에서 사용한 용어는 단지 특정한 실시예를 설명하기 위해 사용된 것으로, 본 발명을 한정하려는 의도가 아니다. 단수의 표현은 문맥상 명백하게 다르게 뜻하지 않는 한, 복수의 표현을 포함한다. 본 출원에서, "포함하다" 또는 "가지다" 등의 용어는 명세서상에 기재된 특징, 숫자, 단계, 동작, 구성요소, 부품 또는 이들을 조합한 것이 존재함을 지정하려는 것이지, 하나 또는 그 이상의 다른 특징들이나 숫자, 단계, 동작, 구성요소, 부품 또는 이들을 조합한 것들의 존재 또는 부가 가능성을 미리 배제하지 않는 것으로 이해되어야 한다.The terms used in this application are only used to describe specific embodiments and are not intended to limit the invention. Singular expressions include plural expressions unless the context clearly dictates otherwise. In this application, terms such as “comprise” or “have” are intended to designate the presence of features, numbers, steps, operations, components, parts, or combinations thereof described in the specification, but are not intended to indicate the presence of one or more other features. It should be understood that this does not exclude in advance the possibility of the existence or addition of elements, numbers, steps, operations, components, parts, or combinations thereof.
이하, 첨부한 도면들을 참조하여, 본 발명의 바람직한 실시예를 보다 상세하게 설명하고자 한다. 이하, 도면상의 동일한 구성요소에 대해서는 동일한 참조부호를 사용하고 동일한 구성요소에 대해서 중복된 설명은 생략한다.Hereinafter, preferred embodiments of the present invention will be described in more detail with reference to the attached drawings. Hereinafter, the same reference numerals will be used for the same components in the drawings, and duplicate descriptions of the same components will be omitted.
도 1은 본 발명의 일실시예에 따른 영상 부호화 장치를 나타낸 블록도이다. Figure 1 is a block diagram showing a video encoding device according to an embodiment of the present invention.
도 1을 참조하면, 영상 부호화 장치(100)는 픽쳐 분할부(110), 예측부(120, 125), 변환부(130), 양자화부(135), 재정렬부(160), 엔트로피 부호화부(165), 역양자화부(140), 역변환부(145), 필터부(150) 및 메모리(155)를 포함할 수 있다.Referring to FIG. 1, the image encoding device 100 includes a picture segmentation unit 110, prediction units 120 and 125, a conversion unit 130, a quantization unit 135, a reordering unit 160, and an entropy encoding unit ( 165), an inverse quantization unit 140, an inverse transform unit 145, a filter unit 150, and a memory 155.
도 1에 나타난 각 구성부들은 영상 부호화 장치에서 서로 다른 특징적인 기능들을 나타내기 위해 독립적으로 도시한 것으로, 각 구성부들이 분리된 하드웨어나 하나의 소프트웨어 구성단위로 이루어짐을 의미하지 않는다. 즉, 각 구성부는 설명의 편의상 각각의 구성부로 나열하여 포함한 것으로 각 구성부 중 적어도 두 개의 구성부가 합쳐져 하나의 구성부로 이루어지거나, 하나의 구성부가 복수개의 구성부로 나뉘어져 기능을 수행할 수 있고 이러한 각 구성부의 통합된 실시예 및 분리된 실시예도 본 발명의 본질에서 벗어나지 않는 한 본 발명의 권리범위에 포함된다.Each component shown in FIG. 1 is shown independently to represent different characteristic functions in the video encoding device, and does not mean that each component is comprised of separate hardware or a single software component. That is, each component is listed and included as a separate component for convenience of explanation, and at least two of each component can be combined to form one component, or one component can be divided into a plurality of components to perform a function, and each of these components can be divided into a plurality of components. Integrated embodiments and separate embodiments of the constituent parts are also included in the scope of the present invention as long as they do not deviate from the essence of the present invention.
또한, 일부의 구성 요소는 본 발명에서 본질적인 기능을 수행하는 필수적인 구성 요소는 아니고 단지 성능을 향상시키기 위한 선택적 구성 요소일 수 있다. 본 발명은 단지 성능 향상을 위해 사용되는 구성 요소를 제외한 본 발명의 본질을 구현하는데 필수적인 구성부만을 포함하여 구현될 수 있고, 단지 성능 향상을 위해 사용되는 선택적 구성 요소를 제외한 필수 구성 요소만을 포함한 구조도 본 발명의 권리범위에 포함된다.Additionally, some components may not be essential components that perform essential functions in the present invention, but may simply be optional components to improve performance. The present invention can be implemented by including only essential components for implementing the essence of the present invention excluding components used only to improve performance, and a structure including only essential components excluding optional components used only to improve performance. is also included in the scope of rights of the present invention.
픽쳐 분할부(110)는 입력된 픽쳐를 적어도 하나의 처리 단위로 분할할 수 있다. 이때, 처리 단위는 예측 단위(Prediction Unit: PU)일 수도 있고, 변환 단위(Transform Unit: TU)일 수도 있으며, 부호화 단위(Coding Unit: CU)일 수도 있다. 픽쳐 분할부(110)에서는 하나의 픽쳐에 대해 복수의 부호화 단위, 예측 단위 및 변환 단위의 조합으로 분할하고 소정의 기준(예를 들어, 비용 함수)으로 하나의 부호화 단위, 예측 단위 및 변환 단위 조합을 선택하여 픽쳐를 부호화 할 수 있다.The picture division unit 110 may divide the input picture into at least one processing unit. At this time, the processing unit may be a prediction unit (PU), a transformation unit (TU), or a coding unit (CU). The picture division unit 110 divides one picture into a combination of a plurality of coding units, prediction units, and transformation units, and combines one coding unit, prediction unit, and transformation unit based on a predetermined standard (for example, a cost function). You can encode the picture by selecting .
예를 들어, 하나의 픽쳐는 복수개의 부호화 단위로 분할될 수 있다. 픽쳐에서 부호화 단위를 분할하기 위해서는 쿼드 트리 구조(Quad Tree Structure)와 같은 재귀적인 트리 구조를 사용할 수 있는데 하나의 영상 또는 최대 크기 부호화 단위(largest coding unit)를 루트로 하여 다른 부호화 단위로 분할되는 부호화 유닛은 분할된 부호화 단위의 개수만큼의 자식 노드를 가지고 분할될 수 있다. 일정한 제한에 따라 더 이상 분할되지 않는 부호화 단위는 리프 노드가 된다. 즉, 하나의 코딩 유닛에 대하여 정방형 분할만이 가능하다고 가정하는 경우, 하나의 부호화 단위는 최대 4개의 다른 부호화 단위로 분할될 수 있다.For example, one picture may be divided into a plurality of coding units. To split the coding unit in a picture, a recursive tree structure such as the Quad Tree Structure can be used. Coding is split into other coding units with one image or the largest coding unit as the root. A unit can be divided into child nodes equal to the number of divided coding units. A coding unit that is no longer divided according to certain restrictions becomes a leaf node. That is, assuming that only square division is possible for one coding unit, one coding unit can be divided into up to four different coding units.
이하, 본 발명의 실시예에서는 부호화 단위는 부호화를 수행하는 단위의 의미로 사용할 수도 있고, 복호화를 수행하는 단위의 의미로 사용할 수도 있다.Hereinafter, in the embodiments of the present invention, the coding unit may be used to mean a unit that performs encoding, or may be used to mean a unit that performs decoding.
예측 단위는 하나의 부호화 단위 내에서 동일한 크기의 적어도 하나의 정사각형 또는 직사각형 등의 형태를 가지고 분할된 것일 수도 있고, 하나의 부호화 단위 내에서 분할된 예측 단위 중 어느 하나의 예측 단위가 다른 하나의 예측 단위와 상이한 형태 및/또는 크기를 가지도록 분할된 것일 수도 있다.A prediction unit may be divided into at least one square or rectangular shape of the same size within one coding unit, and any one of the prediction units divided within one coding unit may be a prediction unit of another prediction unit. It may be divided to have a different shape and/or size than the unit.
부호화 단위를 기초로 인트라 예측을 수행하는 예측 단위를 생성시 최소 부호화 단위가 아닌 경우, 복수의 예측 단위 NxN으로 분할하지 않고 인트라 예측을 수행할 수 있다.If the prediction unit for which intra prediction is performed based on the coding unit is not the minimum coding unit when generated, intra prediction can be performed without dividing the prediction unit into a plurality of prediction units NxN.
예측부(120, 125)는 인터 예측을 수행하는 인터 예측부(120)와 인트라 예측을 수행하는 인트라 예측부(125)를 포함할 수 있다. 예측 단위에 대해 인터 예측을 사용할 것인지 또는 인트라 예측을 수행할 것인지를 결정하고, 각 예측 방법에 따른 구체적인 정보(예컨대, 인트라 예측 모드, 모션 벡터, 참조 픽쳐 등)를 결정할 수 있다. 이때, 예측이 수행되는 처리 단위와 예측 방법 및 구체적인 내용이 정해지는 처리 단위는 다를 수 있다. 예컨대, 예측의 방법과 예측 모드 등은 예측 단위로 결정되고, 예측의 수행은 변환 단위로 수행될 수도 있다. 생성된 예측 블록과 원본 블록 사이의 잔차값(잔차 블록)은 변환부(130)로 입력될 수 있다. 또한, 예측을 위해 사용한 예측 모드 정보, 모션 벡터 정보 등은 잔차값과 함께 엔트로피 부호화부(165)에서 부호화되어 복호화 장치에 전달될 수 있다. 특정한 부호화 모드를 사용할 경우, 예측부(120, 125)를 통해 예측 블록을 생성하지 않고, 원본 블록을 그대로 부호화하여 복호화부에 전송하는 것도 가능하다.The prediction units 120 and 125 may include an inter prediction unit 120 that performs inter prediction and an intra prediction unit 125 that performs intra prediction. It is possible to determine whether to use inter prediction or intra prediction for a prediction unit, and determine specific information (eg, intra prediction mode, motion vector, reference picture, etc.) according to each prediction method. At this time, the processing unit in which the prediction is performed and the processing unit in which the prediction method and specific contents are determined may be different. For example, the prediction method and prediction mode are determined in prediction units, and prediction may be performed in transformation units. The residual value (residual block) between the generated prediction block and the original block may be input to the conversion unit 130. Additionally, prediction mode information, motion vector information, etc. used for prediction may be encoded in the entropy encoder 165 together with the residual value and transmitted to the decoding device. When using a specific encoding mode, it is possible to encode the original block as is and transmit it to the decoder without generating a prediction block through the prediction units 120 and 125.
인터 예측부(120)는 현재 픽쳐의 이전 픽쳐 또는 이후 픽쳐 중 적어도 하나의 픽쳐의 정보를 기초로 예측 단위를 예측할 수도 있고, 경우에 따라서는 현재 픽쳐 내의 부호화가 완료된 일부 영역의 정보를 기초로 예측 단위를 예측할 수도 있다. 인터 예측부(120)는 참조 픽쳐 보간부, 모션 예측부, 움직임 보상부를 포함할 수 있다. The inter prediction unit 120 may predict a prediction unit based on information on at least one picture among the pictures before or after the current picture, and in some cases, prediction based on information on a partially encoded region within the current picture. Units can also be predicted. The inter prediction unit 120 may include a reference picture interpolation unit, a motion prediction unit, and a motion compensation unit.
참조 픽쳐 보간부에서는 메모리(155)로부터 참조 픽쳐 정보를 제공받고 참조 픽쳐에서 정수 화소 이하의 화소 정보를 생성할 수 있다. 휘도 화소의 경우, 1/4 화소 단위로 정수 화소 이하의 화소 정보를 생성하기 위해 필터 계수를 달리하는 DCT 기반의 8탭 보간 필터(DCT-based Interpolation Filter)가 사용될 수 있다. 색차 신호의 경우 1/8 화소 단위로 정수 화소 이하의 화소 정보를 생성하기 위해 필터 계수를 달리하는 DCT 기반의 4탭 보간 필터(DCT-based Interpolation Filter)가 사용될 수 있다.The reference picture interpolation unit may receive reference picture information from the memory 155 and generate pixel information of an integer number of pixels or less from the reference picture. In the case of luminance pixels, a DCT-based 8-tap interpolation filter with different filter coefficients can be used to generate pixel information of an integer pixel or less in 1/4 pixel units. In the case of color difference signals, a DCT-based 4-tap interpolation filter with different filter coefficients can be used to generate pixel information of an integer pixel or less in 1/8 pixel units.
모션 예측부는 참조 픽쳐 보간부에 의해 보간된 참조 픽쳐를 기초로 모션 예측을 수행할 수 있다. 모션 벡터를 산출하기 위한 방법으로 FBMA(Full search-based Block Matching Algorithm), TSS(Three Step Search), NTS(New Three-Step Search Algorithm) 등 다양한 방법이 사용될 수 있다. 모션 벡터는 보간된 화소를 기초로 1/2 또는 1/4 화소 단위의 모션 벡터값을 가질 수 있다. 모션 예측부에서는 모션 예측 방법을 다르게 하여 현재 예측 단위를 예측할 수 있다. 모션 예측 방법으로 스킵(Skip) 방법, 머지(Merge) 방법, AMVP(Advanced Motion Vector Prediction) 방법, 인트라 블록 카피(Intra Block Copy) 방법 등 다양한 방법이 사용될 수 있다.The motion prediction unit may perform motion prediction based on a reference picture interpolated by the reference picture interpolation unit. Various methods such as FBMA (Full search-based Block Matching Algorithm), TSS (Three Step Search), and NTS (New Three-Step Search Algorithm) can be used to calculate the motion vector. The motion vector may have a motion vector value in units of 1/2 or 1/4 pixels based on the interpolated pixels. The motion prediction unit can predict the current prediction unit by using a different motion prediction method. As a motion prediction method, various methods such as the skip method, the merge method, the Advanced Motion Vector Prediction (AMVP) method, and the intra block copy method can be used.
인트라 예측부(125)는 현재 픽쳐 내의 화소 정보인 현재 블록 주변의 참조 픽셀 정보를 기초로 예측 단위를 생성할 수 있다. 현재 예측 단위의 주변 블록이 인터 예측을 수행한 블록이어서, 참조 픽셀이 인터 예측을 수행한 픽셀일 경우, 인터 예측을 수행한 블록에 포함되는 참조 픽셀을 주변의 인트라 예측을 수행한 블록의 참조 픽셀 정보로 대체하여 사용할 수 있다. 즉, 참조 픽셀이 가용하지 않는 경우, 가용하지 않은 참조 픽셀 정보를 가용한 참조 픽셀 중 적어도 하나의 참조 픽셀로 대체하여 사용할 수 있다.The intra prediction unit 125 may generate a prediction unit based on reference pixel information around the current block, which is pixel information in the current picture. If the neighboring block of the current prediction unit is a block on which inter prediction has been performed and the reference pixel is a pixel on which inter prediction has been performed, the reference pixel included in the block on which inter prediction has been performed is the reference pixel of the block on which intra prediction has been performed. It can be used in place of information. That is, when a reference pixel is not available, the unavailable reference pixel information can be replaced with at least one reference pixel among available reference pixels.
인트라 예측에서 예측 모드는 참조 픽셀 정보를 예측 방향에 따라 사용하는 방향성 예측 모드와 예측을 수행시 방향성 정보를 사용하지 않는 비방향성 모드를 가질 수 있다. 휘도 정보를 예측하기 위한 모드와 색차 정보를 예측하기 위한 모드가 상이할 수 있고, 색차 정보를 예측하기 위해 휘도 정보를 예측하기 위해 사용된 인트라 예측 모드 정보 또는 예측된 휘도 신호 정보를 활용할 수 있다.In intra prediction, the prediction mode can include a directional prediction mode that uses reference pixel information according to the prediction direction and a non-directional mode that does not use directional information when performing prediction. The mode for predicting luminance information and the mode for predicting chrominance information may be different, and intra prediction mode information used to predict luminance information or predicted luminance signal information may be used to predict chrominance information.
인트라 예측을 수행할 때 예측 단위의 크기와 변환 단위의 크기가 동일할 경우, 예측 단위의 좌측에 존재하는 픽셀, 좌측 상단에 존재하는 픽셀, 상단에 존재하는 픽셀을 기초로 예측 단위에 대한 인트라 예측을 수행할 수 있다. 그러나 인트라 예측을 수행할 때 예측 단위의 크기와 변환 단위의 크기가 상이할 경우, 변환 단위를 기초로 한 참조 픽셀을 이용하여 인트라 예측을 수행할 수 있다. 또한, 최소 부호화 단위에 대해서만 NxN 분할을 사용하는 인트라 예측을 사용할 수 있다.When performing intra prediction, if the size of the prediction unit and the size of the transformation unit are the same, intra prediction for the prediction unit is made based on the pixel on the left, the pixel on the top left, and the pixel on the top of the prediction unit. can be performed. However, when performing intra prediction, if the size of the prediction unit and the size of the transformation unit are different, intra prediction can be performed using a reference pixel based on the transformation unit. Additionally, intra prediction using NxN partitioning can be used only for the minimum coding unit.
인트라 예측 방법은 예측 모드에 따라 참조 화소에 AIS(Adaptive Intra Smoothing) 필터를 적용한 후 예측 블록을 생성할 수 있다. 참조 화소에 적용되는 AIS 필터의 종류는 상이할 수 있다. 인트라 예측 방법을 수행하기 위해 현재 예측 단위의 인트라 예측 모드는 현재 예측 단위의 주변에 존재하는 예측 단위의 인트라 예측 모드로부터 예측할 수 있다. 주변 예측 단위로부터 예측된 모드 정보를 이용하여 현재 예측 단위의 예측 모드를 예측하는 경우, 현재 예측 단위와 주변 예측 단위의 인트라 예측 모드가 동일하면 소정의 플래그 정보를 이용하여 현재 예측 단위와 주변 예측 단위의 예측 모드가 동일하다는 정보를 전송할 수 있고, 만약 현재 예측 단위와 주변 예측 단위의 예측 모드가 상이하면 엔트로피 부호화를 수행하여 현재 블록의 예측 모드 정보를 부호화할 수 있다.The intra prediction method can generate a prediction block after applying an Adaptive Intra Smoothing (AIS) filter to the reference pixel according to the prediction mode. The type of AIS filter applied to the reference pixel may be different. To perform the intra prediction method, the intra prediction mode of the current prediction unit can be predicted from the intra prediction mode of prediction units existing around the current prediction unit. When predicting the prediction mode of the current prediction unit using predicted mode information from neighboring prediction units, if the intra prediction mode of the current prediction unit and neighboring prediction units are the same, predetermined flag information is used to predict the current prediction unit and neighboring prediction units. Information that the prediction modes of are the same can be transmitted, and if the prediction modes of the current prediction unit and neighboring prediction units are different, entropy encoding can be performed to encode the prediction mode information of the current block.
또한, 예측부(120, 125)에서 생성된 예측 단위를 기초로 예측을 수행한 예측 단위와 예측 단위의 원본 블록과 차이값인 잔차값(Residual) 정보를 포함하는 잔차 블록이 생성될 수 있다. 생성된 잔차 블록은 변환부(130)로 입력될 수 있다. Additionally, based on the prediction units generated by the prediction units 120 and 125, a residual block may be generated that includes residual information that is the difference between the prediction unit on which prediction was performed and the original block of the prediction unit. The generated residual block may be input to the conversion unit 130.
변환부(130)에서는 원본 블록과 예측부(120, 125)를 통해 생성된 예측 단위의 잔차값(residual)정보를 포함한 잔차 블록을 DCT(Discrete Cosine Transform), DST(Discrete Sine Transform), KLT와 같은 변환 방법을 사용하여 변환시킬 수 있다. 잔차 블록을 변환하기 위해 DCT를 적용할지, DST를 적용할지 또는 KLT를 적용할지는 잔차 블록을 생성하기 위해 사용된 예측 단위의 인트라 예측 모드 정보를 기초로 결정할 수 있다. The transform unit 130 transforms the residual block, including the original block and the residual value information of the prediction unit generated through the prediction units 120 and 125, into DCT (Discrete Cosine Transform), DST (Discrete Sine Transform), KLT and It can be converted using the same conversion method. Whether to apply DCT, DST, or KLT to transform the residual block can be determined based on intra prediction mode information of the prediction unit used to generate the residual block.
양자화부(135)는 변환부(130)에서 주파수 영역으로 변환된 값들을 양자화할 수 있다. 블록에 따라 또는 영상의 중요도에 따라 양자화 계수는 변할 수 있다. 양자화부(135)에서 산출된 값은 역양자화부(140)와 재정렬부(160)에 제공될 수 있다.The quantization unit 135 may quantize the values converted to the frequency domain by the conversion unit 130. The quantization coefficient may change depending on the block or the importance of the image. The value calculated by the quantization unit 135 may be provided to the inverse quantization unit 140 and the realignment unit 160.
재정렬부(160)는 양자화된 잔차값에 대해 계수값의 재정렬을 수행할 수 있다.The rearrangement unit 160 may rearrange coefficient values for the quantized residual values.
재정렬부(160)는 계수 스캐닝(Coefficient Scanning) 방법을 통해 2차원의 블록 형태 계수를 1차원의 벡터 형태로 변경할 수 있다. 예를 들어, 재정렬부(160)에서는 지그-재그 스캔(Zig-Zag Scan)방법을 이용하여 DC 계수부터 고주파수 영역의 계수까지 스캔하여 1차원 벡터 형태로 변경시킬 수 있다. 변환 단위의 크기 및 인트라 예측 모드에 따라 지그-재그 스캔 대신 2차원의 블록 형태 계수를 열 방향으로 스캔하는 수직 스캔, 2차원의 블록 형태 계수를 행 방향으로 스캔하는 수평 스캔이 사용될 수도 있다. 즉, 변환 단위의 크기 및 인트라 예측 모드에 따라 지그-재그 스캔, 수직 방향 스캔 및 수평 방향 스캔 중 어떠한 스캔 방법이 사용될지 여부를 결정할 수 있다.The rearrangement unit 160 can change the coefficients in a two-dimensional block form into a one-dimensional vector form through a coefficient scanning method. For example, the realignment unit 160 can scan from DC coefficients to coefficients in the high frequency region using a zig-zag scan method and change it into a one-dimensional vector form. Depending on the size of the transformation unit and the intra prediction mode, a vertical scan that scans the two-dimensional block-type coefficients in the column direction or a horizontal scan that scans the two-dimensional block-type coefficients in the row direction may be used instead of the zig-zag scan. That is, depending on the size of the transformation unit and the intra prediction mode, it can be determined which scan method among zig-zag scan, vertical scan, and horizontal scan will be used.
엔트로피 부호화부(165)는 재정렬부(160)에 의해 산출된 값들을 기초로 엔트로피 부호화를 수행할 수 있다. 엔트로피 부호화는 예를 들어, 지수 골롬(Exponential Golomb), CAVLC(Context-Adaptive Variable Length Coding), CABAC(Context-Adaptive Binary Arithmetic Coding)과 같은 다양한 부호화 방법을 사용할 수 있다. The entropy encoding unit 165 may perform entropy encoding based on the values calculated by the reordering unit 160. Entropy coding can use various coding methods, such as Exponential Golomb, Context-Adaptive Variable Length Coding (CAVLC), and Context-Adaptive Binary Arithmetic Coding (CABAC).
엔트로피 부호화부(165)는 재정렬부(160) 및 예측부(120, 125)로부터 부호화 단위의 잔차값 계수 정보 및 블록 타입 정보, 예측 모드 정보, 분할 단위 정보, 예측 단위 정보 및 전송 단위 정보, 모션 벡터 정보, 참조 프레임 정보, 블록의 보간 정보, 필터링 정보 등 다양한 정보를 부호화할 수 있다. The entropy encoding unit 165 receives the residual value coefficient information and block type information of the coding unit, prediction mode information, division unit information, prediction unit information and transmission unit information, and motion information from the reordering unit 160 and the prediction units 120 and 125. Various information such as vector information, reference frame information, block interpolation information, and filtering information can be encoded.
엔트로피 부호화부(165)에서는 재정렬부(160)에서 입력된 부호화 단위의 계수값을 엔트로피 부호화할 수 있다.The entropy encoding unit 165 may entropy encode the coefficient value of the coding unit input from the reordering unit 160.
역양자화부(140) 및 역변환부(145)에서는 양자화부(135)에서 양자화된 값들을 역양자화하고 변환부(130)에서 변환된 값들을 역변환한다. 역양자화부(140) 및 역변환부(145)에서 생성된 잔차값(Residual)은 예측부(120, 125)에 포함된 움직임 추정부, 움직임 보상부 및 인트라 예측부를 통해서 예측된 예측 단위와 합쳐져 복원 블록(Reconstructed Block)을 생성할 수 있다. The inverse quantization unit 140 and the inverse transformation unit 145 inversely quantize the values quantized in the quantization unit 135 and inversely transform the values transformed in the transformation unit 130. The residual value generated in the inverse quantization unit 140 and the inverse transform unit 145 is restored by combining the prediction units predicted through the motion estimation unit, motion compensation unit, and intra prediction unit included in the prediction units 120 and 125. You can create a block (Reconstructed Block).
필터부(150)는 디블록킹 필터, 오프셋 보정부, ALF(Adaptive Loop Filter)중 적어도 하나를 포함할 수 있다.The filter unit 150 may include at least one of a deblocking filter, an offset correction unit, and an adaptive loop filter (ALF).
디블록킹 필터는 복원된 픽쳐에서 블록 간의 경계로 인해 생긴 블록 왜곡을 제거할 수 있다. 디블록킹을 수행할지 여부를 판단하기 위해 블록에 포함된 몇 개의 열 또는 행에 포함된 픽셀을 기초로 현재 블록에 디블록킹 필터 적용할지 여부를 판단할 수 있다. 블록에 디블록킹 필터를 적용하는 경우 필요한 디블록킹 필터링 강도에 따라 강한 필터(Strong Filter) 또는 약한 필터(Weak Filter)를 적용할 수 있다. 또한 디블록킹 필터를 적용함에 있어 수직 필터링 및 수평 필터링 수행시 수평 방향 필터링 및 수직 방향 필터링이 병행 처리되도록 할 수 있다.The deblocking filter can remove block distortion caused by boundaries between blocks in the restored picture. To determine whether to perform deblocking, it is possible to determine whether to apply a deblocking filter to the current block based on the pixels included in several columns or rows included in the block. When applying a deblocking filter to a block, a strong filter or a weak filter can be applied depending on the required deblocking filtering strength. Additionally, when applying a deblocking filter, horizontal filtering and vertical filtering can be processed in parallel when vertical filtering and horizontal filtering are performed.
오프셋 보정부는 디블록킹을 수행한 영상에 대해 픽셀 단위로 원본 영상과의 오프셋을 보정할 수 있다. 특정 픽쳐에 대한 오프셋 보정을 수행하기 위해 영상에 포함된 픽셀을 일정한 수의 영역으로 구분한 후 오프셋을 수행할 영역을 결정하고 해당 영역에 오프셋을 적용하는 방법 또는 각 픽셀의 에지 정보를 고려하여 오프셋을 적용하는 방법을 사용할 수 있다.The offset correction unit may correct the offset of the deblocked image from the original image in pixel units. In order to perform offset correction for a specific picture, the pixels included in the image are divided into a certain number of areas, then the area to perform offset is determined and the offset is applied to that area, or the offset is performed by considering the edge information of each pixel. You can use the method of applying .
ALF(Adaptive Loop Filtering)는 필터링한 복원 영상과 원래의 영상을 비교한 값을 기초로 수행될 수 있다. 영상에 포함된 픽셀을 소정의 그룹으로 나눈 후 해당 그룹에 적용될 하나의 필터를 결정하여 그룹마다 차별적으로 필터링을 수행할 수 있다. ALF를 적용할지 여부에 관련된 정보는 휘도 신호는 부호화 단위(Coding Unit, CU) 별로 전송될 수 있고, 각각의 블록에 따라 적용될 ALF 필터의 모양 및 필터 계수는 달라질 수 있다. 또한, 적용 대상 블록의 특성에 상관없이 동일한 형태(고정된 형태)의 ALF 필터가 적용될 수도 있다. Adaptive Loop Filtering (ALF) can be performed based on a comparison between the filtered restored image and the original image. After dividing the pixels included in the image into predetermined groups, filtering can be performed differentially for each group by determining one filter to be applied to that group. Information related to whether to apply ALF may be transmitted for each coding unit (CU), and the shape and filter coefficients of the ALF filter to be applied may vary for each block. Additionally, an ALF filter of the same type (fixed type) may be applied regardless of the characteristics of the block to which it is applied.
메모리(155)는 필터부(150)를 통해 산출된 복원 블록 또는 픽쳐를 저장할 수 있고, 저장된 복원 블록 또는 픽쳐는 인터 예측을 수행 시 예측부(120, 125)에 제공될 수 있다.The memory 155 may store the reconstructed block or picture calculated through the filter unit 150, and the stored reconstructed block or picture may be provided to the prediction units 120 and 125 when inter prediction is performed.
도 2는 본 발명의 일실시예에 따른 영상 복호화 장치를 나타낸 블록도이다.Figure 2 is a block diagram showing an image decoding device according to an embodiment of the present invention.
도 2를 참조하면, 영상 복호화 장치(200)는 엔트로피 복호화부(210), 재정렬부(215), 역양자화부(220), 역변환부(225), 예측부(230, 235), 필터부(240), 메모리(245)가 포함될 수 있다.Referring to FIG. 2, the image decoding device 200 includes an entropy decoding unit 210, a reordering unit 215, an inverse quantization unit 220, an inverse transform unit 225, a prediction unit 230, 235, and a filter unit ( 240) and memory 245 may be included.
영상 부호화 장치에서 영상 비트스트림이 입력된 경우, 입력된 비트스트림은 영상 부호화 장치와 반대의 절차로 복호화될 수 있다.When a video bitstream is input from a video encoding device, the input bitstream can be decoded in a procedure opposite to that of the video encoding device.
엔트로피 복호화부(210)는 영상 부호화 장치의 엔트로피 부호화부에서 엔트로피 부호화를 수행한 것과 반대의 절차로 엔트로피 복호화를 수행할 수 있다. 예를 들어, 영상 부호화 장치에서 수행된 방법에 대응하여 지수 골롬(Exponential Golomb), CAVLC(Context-Adaptive Variable Length Coding), CABAC(Context-Adaptive Binary Arithmetic Coding)과 같은 다양한 방법이 적용될 수 있다. The entropy decoding unit 210 may perform entropy decoding in a procedure opposite to the procedure in which entropy encoding is performed in the entropy encoding unit of the video encoding device. For example, various methods such as Exponential Golomb, CAVLC (Context-Adaptive Variable Length Coding), and CABAC (Context-Adaptive Binary Arithmetic Coding) may be applied in response to the method performed in the image encoding device.
엔트로피 복호화부(210)에서는 부호화 장치에서 수행된 인트라 예측 및 인터 예측에 관련된 정보를 복호화할 수 있다.The entropy decoder 210 can decode information related to intra prediction and inter prediction performed by the encoding device.
재정렬부(215)는 엔트로피 복호화부(210)에서 엔트로피 복호화된 비트스트림을 부호화부에서 재정렬한 방법을 기초로 재정렬을 수행할 수 있다. 1차원 벡터 형태로 표현된 계수들을 다시 2차원의 블록 형태의 계수로 복원하여 재정렬할 수 있다. 재정렬부(215)에서는 부호화부에서 수행된 계수 스캐닝에 관련된 정보를 제공받고 해당 부호화부에서 수행된 스캐닝 순서에 기초하여 역으로 스캐닝하는 방법을 통해 재정렬을 수행할 수 있다.The reordering unit 215 may rearrange the bitstream entropy-decoded by the entropy decoding unit 210 based on the method in which the encoder rearranges the bitstream. Coefficients expressed in the form of a one-dimensional vector can be restored and rearranged as coefficients in the form of a two-dimensional block. The reordering unit 215 may receive information related to coefficient scanning performed by the encoder and perform reordering by reverse scanning based on the scanning order performed by the encoder.
역양자화부(220)는 부호화 장치에서 제공된 양자화 파라미터와 재정렬된 블록의 계수값을 기초로 역양자화를 수행할 수 있다. The inverse quantization unit 220 may perform inverse quantization based on the quantization parameters provided by the encoding device and the coefficient values of the rearranged blocks.
역변환부(225)는 영상 부호화 장치에서 수행한 양자화 결과에 대해 변환부에서 수행한 변환 즉, DCT, DST, 및 KLT에 대해 역변환 즉, 역 DCT, 역 DST 및 역 KLT를 수행할 수 있다. 역변환은 영상 부호화 장치에서 결정된 전송 단위를 기초로 수행될 수 있다. 영상 복호화 장치의 역변환부(225)에서는 예측 방법, 현재 블록의 크기 및 예측 방향 등 복수의 정보에 따라 변환 기법(예를 들어, DCT, DST, KLT)이 선택적으로 수행될 수 있다.The inverse transform unit 225 may perform inverse transform, that is, inverse DCT, inverse DST, and inverse KLT, on the transform performed by the transformer, that is, DCT, DST, and KLT, on the quantization result performed by the image encoding device. Inverse transformation may be performed based on the transmission unit determined by the video encoding device. The inverse transform unit 225 of the video decoding device may selectively perform a transformation technique (eg, DCT, DST, KLT) according to a plurality of information such as a prediction method, the size of the current block, and the prediction direction.
예측부(230, 235)는 엔트로피 복호화부(210)에서 제공된 예측 블록 생성 관련 정보와 메모리(245)에서 제공된 이전에 복호화된 블록 또는 픽쳐 정보를 기초로 예측 블록을 생성할 수 있다. The prediction units 230 and 235 may generate a prediction block based on prediction block generation-related information provided by the entropy decoder 210 and previously decoded block or picture information provided by the memory 245.
전술한 바와 같이 영상 부호화 장치에서의 동작과 동일하게 인트라 예측을 수행시 예측 단위의 크기와 변환 단위의 크기가 동일할 경우, 예측 단위의 좌측에 존재하는 픽셀, 좌측 상단에 존재하는 픽셀, 상단에 존재하는 픽셀을 기초로 예측 단위에 대한 인트라 예측을 수행하지만, 인트라 예측을 수행시 예측 단위의 크기와 변환 단위의 크기가 상이할 경우, 변환 단위를 기초로 한 참조 픽셀을 이용하여 인트라 예측을 수행할 수 있다. 또한, 최소 부호화 단위에 대해서만 NxN 분할을 사용하는 인트라 예측을 사용할 수도 있다.As described above, when performing intra prediction in the same manner as the operation in the video encoding device, when the size of the prediction unit and the size of the transformation unit are the same, the pixel existing on the left of the prediction unit, the pixel existing on the upper left, and the size of the transformation unit are the same. Intra prediction of the prediction unit is performed based on existing pixels, but when performing intra prediction, if the size of the prediction unit and the size of the transformation unit are different, intra prediction is performed using a reference pixel based on the transformation unit. can do. Additionally, intra prediction using NxN partitioning only for the minimum coding unit can be used.
예측부(230, 235)는 예측 단위 판별부, 인터 예측부 및 인트라 예측부를 포함할 수 있다. 예측 단위 판별부는 엔트로피 복호화부(210)에서 입력되는 예측 단위 정보, 인트라 예측 방법의 예측 모드 정보, 인터 예측 방법의 모션 예측 관련 정보 등 다양한 정보를 입력 받고 현재 부호화 단위에서 예측 단위를 구분하고, 예측 단위가 인터 예측을 수행하는지 아니면 인트라 예측을 수행하는지 여부를 판별할 수 있다. 인터 예측부(230)는 영상 부호화 장치에서 제공된 현재 예측 단위의 인터 예측에 필요한 정보를 이용해 현재 예측 단위가 포함된 현재 픽쳐의 이전 픽쳐 또는 이후 픽쳐 중 적어도 하나의 픽쳐에 포함된 정보를 기초로 현재 예측 단위에 대한 인터 예측을 수행할 수 있다. 또는, 현재 예측 단위가 포함된 현재 픽쳐 내에서 기-복원된 일부 영역의 정보를 기초로 인터 예측을 수행할 수도 있다.The prediction units 230 and 235 may include a prediction unit determination unit, an inter prediction unit, and an intra prediction unit. The prediction unit discriminator receives various information such as prediction unit information input from the entropy decoder 210, prediction mode information of the intra prediction method, and motion prediction-related information of the inter prediction method, distinguishes the prediction unit from the current coding unit, and makes predictions. It is possible to determine whether a unit performs inter-prediction or intra-prediction. The inter prediction unit 230 uses the information required for inter prediction of the current prediction unit provided by the video encoding device to determine the current prediction unit based on the information included in at least one of the pictures before or after the current picture including the current prediction unit. Inter prediction can be performed on prediction units. Alternatively, inter prediction may be performed based on information on a pre-restored partial region within the current picture including the current prediction unit.
인터 예측을 수행하기 위해 부호화 단위를 기준으로 해당 부호화 단위에 포함된 예측 단위의 모션 예측 방법이 스킵 모드(Skip Mode), 머지 모드(Merge 모드), AMVP 모드(AMVP Mode), 인트라 블록 카피 모드 중 어떠한 방법인지 여부를 판단할 수 있다.To perform inter prediction, based on the coding unit, the motion prediction method of the prediction unit included in the coding unit is Skip Mode, Merge Mode, AMVP Mode, and Intra Block Copy Mode. You can judge whether it is a certain method or not.
인트라 예측부(235)는 현재 픽쳐 내의 화소 정보를 기초로 예측 블록을 생성할 수 있다. 예측 단위가 인트라 예측을 수행한 예측 단위인 경우, 영상 부호화 장치에서 제공된 예측 단위의 인트라 예측 모드 정보를 기초로 인트라 예측을 수행할 수 있다. 인트라 예측부(235)에는 AIS(Adaptive Intra Smoothing) 필터, 참조 화소 보간부, DC 필터를 포함할 수 있다. AIS 필터는 현재 블록의 참조 화소에 필터링을 수행하는 부분으로써 현재 예측 단위의 예측 모드에 따라 필터의 적용 여부를 결정하여 적용할 수 있다. 영상 부호화 장치에서 제공된 예측 단위의 예측 모드 및 AIS 필터 정보를 이용하여 현재 블록의 참조 화소에 AIS 필터링을 수행할 수 있다. 현재 블록의 예측 모드가 AIS 필터링을 수행하지 않는 모드일 경우, AIS 필터는 적용되지 않을 수 있다.The intra prediction unit 235 may generate a prediction block based on pixel information in the current picture. If the prediction unit is a prediction unit that has performed intra prediction, intra prediction may be performed based on intra prediction mode information of the prediction unit provided by the video encoding device. The intra prediction unit 235 may include an Adaptive Intra Smoothing (AIS) filter, a reference pixel interpolation unit, and a DC filter. The AIS filter is a part that performs filtering on the reference pixels of the current block, and can be applied by determining whether or not to apply the filter according to the prediction mode of the current prediction unit. AIS filtering can be performed on the reference pixel of the current block using the prediction mode and AIS filter information of the prediction unit provided by the video encoding device. If the prediction mode of the current block is a mode that does not perform AIS filtering, the AIS filter may not be applied.
참조 화소 보간부는 예측 단위의 예측 모드가 참조 화소를 보간한 화소값을 기초로 인트라 예측을 수행하는 예측 단위일 경우, 참조 화소를 보간하여 정수값 이하의 화소 단위의 참조 화소를 생성할 수 있다. 현재 예측 단위의 예측 모드가 참조 화소를 보간하지 않고 예측 블록을 생성하는 예측 모드일 경우 참조 화소는 보간되지 않을 수 있다. DC 필터는 현재 블록의 예측 모드가 DC 모드일 경우 필터링을 통해서 예측 블록을 생성할 수 있다.If the prediction mode of the prediction unit is a prediction unit that performs intra prediction based on pixel values obtained by interpolating the reference pixel, the reference pixel interpolator may interpolate the reference pixel to generate a reference pixel in pixel units of an integer value or less. If the prediction mode of the current prediction unit is a prediction mode that generates a prediction block without interpolating the reference pixel, the reference pixel may not be interpolated. The DC filter can generate a prediction block through filtering when the prediction mode of the current block is DC mode.
복원된 블록 또는 픽쳐는 필터부(240)로 제공될 수 있다. 필터부(240)는 디블록킹 필터, 오프셋 보정부, ALF를 포함할 수 있다.The restored block or picture may be provided to the filter unit 240. The filter unit 240 may include a deblocking filter, an offset correction unit, and an ALF.
영상 부호화 장치로부터 해당 블록 또는 픽쳐에 디블록킹 필터를 적용하였는지 여부에 대한 정보 및 디블록킹 필터를 적용하였을 경우, 강한 필터를 적용하였는지 또는 약한 필터를 적용하였는지에 대한 정보를 제공받을 수 있다. 영상 복호화 장치의 디블록킹 필터에서는 영상 부호화 장치에서 제공된 디블록킹 필터 관련 정보를 제공받고 영상 복호화 장치에서 해당 블록에 대한 디블록킹 필터링을 수행할 수 있다. Information on whether a deblocking filter has been applied to the corresponding block or picture can be provided from the video encoding device, and when a deblocking filter has been applied, information on whether a strong filter or a weak filter has been applied. The deblocking filter of the video decoding device receives information related to the deblocking filter provided by the video encoding device, and the video decoding device can perform deblocking filtering on the corresponding block.
오프셋 보정부는 부호화시 영상에 적용된 오프셋 보정의 종류 및 오프셋 값 정보 등을 기초로 복원된 영상에 오프셋 보정을 수행할 수 있다.The offset correction unit may perform offset correction on the reconstructed image based on the type of offset correction applied to the image during encoding and offset value information.
ALF는 부호화 장치로부터 제공된 ALF 적용 여부 정보, ALF 계수 정보 등을 기초로 부호화 단위에 적용될 수 있다. 이러한 ALF 정보는 특정한 파라메터 셋에 포함되어 제공될 수 있다.ALF can be applied to the coding unit based on ALF application availability information, ALF coefficient information, etc. provided from the coding device. This ALF information may be included and provided in a specific parameter set.
메모리(245)는 복원된 픽쳐 또는 블록을 저장하여 참조 픽쳐 또는 참조 블록으로 사용할 수 있도록 할 수 있고 또한 복원된 픽쳐를 출력부로 제공할 수 있다. The memory 245 can store the restored picture or block so that it can be used as a reference picture or reference block, and can also provide the restored picture to an output unit.
전술한 바와 같이 이하, 본 발명의 실시예에서는 설명의 편의상 코딩 유닛(Coding Unit)을 부호화 단위라는 용어로 사용하지만, 부호화 뿐만 아니라 복호화를 수행하는 단위가 될 수도 있다.As described above, hereinafter, in the embodiments of the present invention, the term coding unit is used as a coding unit for convenience of explanation, but it may also be a unit that performs not only encoding but also decoding.
또한, 현재 블록은, 부호화/복호화 대상 블록을 나타내는 것으로, 부호화/복호화 단계에 따라, 코딩 트리 블록(또는 코딩 트리 유닛), 부호화 블록(또는 부호화 유닛), 변환 블록(또는 변환 유닛) 또는 예측 블록(또는 예측 유닛) 등을 나타내는 것일 수 있다. 본 명세서에서, '유닛'은 특정 부호화/복호화 프로세스를 수행하기 위한 기본 단위를 나타내고, '블록'은 소정 크기의 화소 어레이를 나타낼 수 있다. 별도의 구분이 없는 한, '블록'과 '유닛'은 동등한 의미로 사용될 수 있다. 예컨대, 후술되는 실시예에서, 부호화 블록(코딩 블록) 및 부호화 유닛(코딩 유닛)은 상호 동등한 의미인 것으로 이해될 수 있다. In addition, the current block represents an encoding/decoding target block and, depending on the encoding/decoding stage, is a coding tree block (or coding tree unit), a coding block (or coding unit), a transform block (or transform unit), or a prediction block. (or prediction unit), etc. In this specification, 'unit' may represent a basic unit for performing a specific encoding/decoding process, and 'block' may represent a pixel array of a predetermined size. Unless otherwise specified, ‘block’ and ‘unit’ can be used with the same meaning. For example, in embodiments described later, a coding block (coding block) and a coding unit (coding unit) may be understood to have equivalent meanings.
도 3은 본 개시에 따른 영상 부호화/복호화 장치에 의해 수행되는 영상 부호화/복호화 방법을 도시한 것이다.FIG. 3 illustrates an image encoding/decoding method performed by the image encoding/decoding device according to the present disclosure.
도 3을 참조하면, 현재 블록의 인트라 예측을 위한 참조 라인을 결정할 수 있다(S300).Referring to FIG. 3, a reference line for intra prediction of the current block can be determined (S300).
현재 블록은 영상 부호화/복호화 장치에 기-정의된 복수의 참조 라인 후보 중 하나 또는 그 이상을 인트라 예측을 위한 참조 라인으로 이용할 수 있다. 여기서, 기-정의된 복수의 참조 라인 후보는, 복호화 대상인 현재 블록에 인접한 이웃 참조 라인과 현재 블록의 경계로부터 1-샘플 내지 N-샘플만큼 떨어진 N개의 비-이웃 참조 라인을 포함할 수 있다. N은 1, 2, 3, 또는 그 이상의 정수일 수 있다. 이하, 설명의 편의를 위해, 현재 블록이 이용 가능한 복수의 참조 라인 후보는, 이웃 참조 라인 후보과 3개의 비-이웃 참조 라인 후보로 구성됨을 가정하나, 이에 한정되지 아니한다. 즉, 현재 블록이 이용 가능한 복수의 참조 라인 후보는 4개 또는 그 이상의 비-이웃 참조 라인 후보를 포함할 수 있음은 물론이다.The current block may use one or more of a plurality of reference line candidates pre-defined in the video encoding/decoding device as a reference line for intra prediction. Here, the plurality of pre-defined reference line candidates may include a neighboring reference line adjacent to the current block to be decoded and N non-neighboring reference lines that are 1-sample to N-sample away from the boundary of the current block. N may be an integer of 1, 2, 3, or more. Hereinafter, for convenience of explanation, it is assumed that the plurality of reference line candidates available for the current block consists of a neighboring reference line candidate and three non-neighboring reference line candidates, but is not limited thereto. That is, of course, the plurality of reference line candidates available for the current block may include four or more non-neighboring reference line candidates.
영상 부호화 장치는, 복수의 참조 라인 후보 중 최적의 참조 라인 후보를 결정하고, 이를 특정하기 위한 인덱스를 부호화할 수 있다. 영상 복호화 장치는, 비트스트림을 통해 시그날링되는 인덱스에 기초하여, 현재 블록의 참조 라인을 결정할 수 있다. 상기 인덱스는, 복수의 참조 라인 후보 중 어느 하나를 특정할 수 있다. 상기 인덱스에 의해 특정된 참조 라인 후보가 현재 블록의 참조 라인으로 이용될 수 있다. The video encoding device can determine an optimal reference line candidate among a plurality of reference line candidates and encode an index for specifying it. The video decoding device can determine the reference line of the current block based on the index signaled through the bitstream. The index may specify one of a plurality of reference line candidates. The reference line candidate specified by the index can be used as the reference line of the current block.
현재 블록의 참조 라인을 결정하기 위해 시그날링되는 인덱스의 개수는 1개일 수도 있고, 2개 또는 그 이상일 수도 있다. 일 예로, 상기 시그날링되는 인덱스의 개수가 1개인 경우, 현재 블록은 복수의 참조 라인 후보 중에서 상기 시그날링된 인덱스에 의해 특정되는 단일의 참조 라인 후보만을 이용하여 인트라 예측을 수행할 수 있다. 또는, 상기 시그날링되는 인덱스의 개수가 2개 이상인 경우, 현재 블록은 복수의 참조 라인 후보 중에서 복수개의 인덱스에 의해 특정되는 복수의 참조 라인 후보를 이용하여 인트라 예측을 수행할 수 있다.The number of indices signaled to determine the reference line of the current block may be 1, 2, or more. For example, when the number of signaled indices is 1, the current block may perform intra prediction using only a single reference line candidate specified by the signaled index among a plurality of reference line candidates. Alternatively, when the number of signaled indices is two or more, the current block may perform intra prediction using a plurality of reference line candidates specified by a plurality of indices among a plurality of reference line candidates.
도 3을 참조하면, 현재 블록의 인트라 예측 모드를 결정할 수 있다(S310).Referring to FIG. 3, the intra prediction mode of the current block can be determined (S310).
현재 블록의 인트라 예측 모드는 영상 부호화/복호화 장치에 기-정의된 복수의 인트라 예측 모드 중에서 결정될 수 있다. 상기 기-정의된 복수의 인트라 예측 모드는 도 4 및 도 5를 참조하여 살펴보기로 한다.The intra prediction mode of the current block may be determined from a plurality of intra prediction modes predefined in the video encoding/decoding device. The plurality of pre-defined intra prediction modes will be examined with reference to FIGS. 4 and 5.
도 4는 본 개시에 따른 복수의 인트라 예측 모드의 일예를 도시한 것이다.Figure 4 shows an example of a plurality of intra prediction modes according to the present disclosure.
도 4를 참조하면, 영상 부호화/복호화 장치에 기-정의된 복수의 인트라 예측 모드는, 비방향성 모드와 방향성 모드로 구성될 수 있다. 비방향성 모드는, 플래너 모드 또는 DC 모드 중 적어도 하나를 포함할 수 있다. 방향성 모드는, 2번 내지 66번의 방향성 모드를 포함할 수 있다.Referring to FIG. 4, a plurality of intra prediction modes pre-defined in the video encoding/decoding device may be comprised of a non-directional mode and a directional mode. The non-directional mode may include at least one of planar mode or DC mode. The directional mode may include directional modes numbered 2 to 66.
도 4에 도시된 것보다, 방향성 모드를 더 확장할 수도 있다. 도 5는 방향성 모드가 확장된 예를 나타낸다. The directional mode may be expanded further than shown in FIG. 4. Figure 5 shows an example in which the directional mode is expanded.
도 5에서는, -1번부터 -14번 모드와 67번부터 80번 모드가 추가된 것으로 예시되었다. 이들 방향성 모드는 와이드 앵글 인트라 예측 모드라 호칭될 수 있다. 와이드 앵글 인트라 예측 모드를 이용할 것인지 여부는, 현재 블록의 형태에 따라, 결정될 수 있다. 일 예로, 현재 블록이 너비가 높이보다 큰 비정방 형태의 블록인 경우, 일부 방향성 모드(예컨대, 2번부터 15번)가 67번부터 80번 사이의 와이드 앵글 인트라 예측 모드로 전환될 수 있다. 반면, 현재 블록이 높이가 너비보다 큰 비정방 형태의 블록인 경우, 일부 방향성 모드(예컨대, 53번부터 66번)가, -1번부터 -14번 사이의 와이드 앵글 인트라 예측 모드로 전환될 수 있다. In Figure 5, modes -1 to -14 and modes 67 to 80 are illustrated as being added. These directional modes may be referred to as wide angle intra prediction modes. Whether to use the wide angle intra prediction mode can be determined depending on the type of the current block. For example, if the current block is a non-square block with a width greater than the height, some directional modes (eg, 2 to 15) may be converted to wide angle intra prediction modes 67 to 80. On the other hand, if the current block is a non-square block with a height greater than the width, some directional modes (e.g., numbers 53 to 66) may be converted to wide angle intra prediction modes between -1 and -14. there is.
이용 가능한 와이드 앵글 인트라 예측 모드들의 범위는, 현재 블록의 너비와 높이 비율에 따라, 적응적으로 결정될 수 있다. 표 1은 현재 블록의 너비 및 높이 비율에 따른, 이용 가능한 와이드 앵글 인트라 예측 모드들의 범위를 나타낸 것이다.The range of available wide-angle intra prediction modes can be adaptively determined depending on the width-to-height ratio of the current block. Table 1 shows the range of available wide-angle intra prediction modes according to the width and height ratio of the current block.
너비/높이width/height 이용 가능한 와이드 앵글 인트라 예측 모드 범위Wide angle intra prediction mode range available
W/H = 16W/H = 16 67~8067~80
W/H = 8W/H = 8 67~7867~78
W/H = 4W/H = 4 67~7667~76
W/H = 2W/H = 2 67~7467~74
W/H = 1W/H = 1 없음doesn't exist
W/H = 1/2W/H = 1/2 -1~-8-1~-8
W/H = 1/4W/H = 1/4 -1~-10-1~-10
W/H = 1/8W/H = 1/8 -1~-12-1~-12
W/H = 1/16W/H = 1/16 -1~-14-1~-14
상기 복수의 인트라 예측 모드 중에서 K개의 후보 모드(most probable mode, MPM)를 선택할 수 있다. 선택된 후보 모드를 포함한 후보 리스트가 생성될 수 있다. 후보 리스트에 속한 후보 모드 중 어느 하나를 지시하는 인덱스가 시그날링될 수 있다. 상기 인덱스에 의해 지시된 후보 모드에 기초하여 현재 블록의 인트라 예측 모드가 결정될 수 있다. 일 예로, 상기 인덱스에 의해 지시된 후보 모드가 현재 블록의 인트라 예측 모드로 설정될 수 있다. 또는, 현재 블록의 인트라 예측 모드는, 상기 인덱스에 의해 지시된 후보 모드의 값과 소정의 차분값에 기초하여 결정될 수도 있다. 상기 차분값은, 상기 현재 블록의 인트라 예측 모드의 값과 상기 인덱스에 의해 지시된 후보 모드의 값 간의 차이로 정의될 수 있다. 상기 차분값은 비트스트림을 통해 시그날링될 수 있다. 또는, 상기 차분값은 영상 부호화/복호화 장치에 기-정의된 값일 수도 있다.또는, 현재 블록의 인트라 예측 모드는, 상기 후보 리스트에 현재 블록의 인트라 예측 모드와 동일한 모드가 존재하는지 여부를 나타내는 플래그에 기초하여 결정될 수 있다. 일 예로, 상기 플래그가 제1 값인 경우, 현재 블록의 인트라 예측 모드는 상기 후보 리스트로부터 결정될 수 있다. 이 경우, 후보 리스트에 속한 복수의 후보 모드 중 어느 하나를 지시하는 인덱스가 시그날링될 수 있다. 상기 인덱스에 의해 지시된 후보 모드가 현재 블록의 인트라 예측 모드로 설정될 수 있다. 반면, 상기 플래그가 제2 값인 경우, 나머지 인트라 예측 모드 중 어느 하나가 현재 블록의 인트라 예측 모드로 설정될 수 있다. 상기 나머지 인트라 예측 모드는, 기-정의된 복수의 인트라 예측 모드 중 상기 후보 리스트에 속한 후보 모드를 제외한 모드를 의미할 수 있다. 상기 플래그가 제2 값인 경우, 상기 나머지 인트라 예측 모드 중 어느 하나를 지시하는 인덱스가 시그날링될 수 있다. 시그날링된 인덱스에 의해 지시된 인트라 예측 모드가 현재 블록의 인트라 예측 모드로 설정될 수 있다.크로마 블록의 인트라 예측 모드는, 복수의 크로마 블록의 인트라 예측 모드 후보들 중에서 선택될 수 있다. 이를 위해, 크로마 블록의 인트라 예측 모드 후보들 중 하나를 지시하는 인덱스 정보가 명시적으로 부호화되어 비트스트림을 통해 시그날링될 수 있다. 표 2는 크로마 블록의 인트라 예측 모드 후보들을 예시한 것이다.Among the plurality of intra prediction modes, K candidate modes (most probable mode, MPM) can be selected. A candidate list including the selected candidate mode may be created. An index indicating one of the candidate modes belonging to the candidate list may be signaled. The intra prediction mode of the current block may be determined based on the candidate mode indicated by the index. As an example, the candidate mode indicated by the index may be set as the intra prediction mode of the current block. Alternatively, the intra prediction mode of the current block may be determined based on the value of the candidate mode indicated by the index and a predetermined difference value. The difference value may be defined as the difference between the value of the intra prediction mode of the current block and the value of the candidate mode indicated by the index. The difference value may be signaled through a bitstream. Alternatively, the difference value may be a value pre-defined in the video encoding/decoding device. Alternatively, the intra prediction mode of the current block may be a flag indicating whether a mode identical to the intra prediction mode of the current block exists in the candidate list. It can be decided based on . For example, when the flag is the first value, the intra prediction mode of the current block may be determined from the candidate list. In this case, an index indicating one of a plurality of candidate modes belonging to the candidate list may be signaled. The candidate mode indicated by the index may be set as the intra prediction mode of the current block. On the other hand, when the flag is the second value, one of the remaining intra prediction modes may be set as the intra prediction mode of the current block. The remaining intra prediction modes may refer to modes excluding candidate modes belonging to the candidate list among a plurality of pre-defined intra prediction modes. When the flag is the second value, an index indicating one of the remaining intra prediction modes may be signaled. The intra prediction mode indicated by the signaled index may be set as the intra prediction mode of the current block. The intra prediction mode of the chroma block may be selected from among the intra prediction mode candidates of a plurality of chroma blocks. To this end, index information indicating one of the intra prediction mode candidates of the chroma block can be explicitly encoded and signaled through a bitstream. Table 2 illustrates intra prediction mode candidates for chroma block.
인덱스index 크로마 블록을 위한 인트라 예측 모드 후보Intra prediction mode candidates for chroma blocks
루마모드:0Luma Mode: 0 루마모드:50Luma mode: 50 루마모드:18Luma Mode: 18 루마모드:1Luma Mode: 1 그외 etc
00 6666 00 00 00 00
1One 5050 6666 5050 5050 5050
22 1818 1818 6666 1818 1818
33 1One 1One 1One 6666 1One
44 DMDM
표 2의 예에서, DM(Direct Mode)는, 크로마 블록과 동일 위치에 존재하는 루마 블록의 인트라 예측 모드를, 크로마 블록의 인트라 예측 모드로 설정하는 것을 의미한다.일 예로, 루마 블록의 인트라 예측 모드(루마 모드)가 0번(평면모드)이고, 인덱스가 2번을 가리킨다면, 크로마 블록의 인트라 예측 모드는, 수평 모드(18번)로 결정될 수 있다.일 예로, 루마 블록의 인트라 예측 모드(루마 모드)가 1번(DC모드)이고, 인덱스가 0번을 가리킨다면, 크로마 블록의 인트라 예측 모드는 플래너 모드(0번)로 결정될 수 있다. 결과적으로, 크로마 블록의 인트라 예측 모드도 도 4 또는 도 5에 도시된 인트라 예측 모드들 중 하나로 설정될 수 있다. 현재 블록의 인트라 예측 모드는 현재 블록의 참조 라인을 결정하기 위해 이용될 수도 있으며, 이 경우 S310 단계는 S300 단계 전에 수행될 수도 있다.도 3을 참조하면, 현재 블록의 참조 라인과 인트라 예측 모드에 기초하여 현재 블록에 대해 인트라 예측을 수행할 수 있다(S320).In the example of Table 2, DM (Direct Mode) means setting the intra prediction mode of the luma block existing at the same location as the chroma block to the intra prediction mode of the chroma block. As an example, intra prediction of the luma block If the mode (luma mode) is number 0 (flat mode) and the index points to number 2, the intra prediction mode of the chroma block may be determined as the horizontal mode (number 18). As an example, the intra prediction mode of the luma block If (luma mode) is number 1 (DC mode) and the index points to number 0, the intra prediction mode of the chroma block can be determined as planar mode (number 0). As a result, the intra prediction mode of the chroma block can also be set to one of the intra prediction modes shown in FIG. 4 or FIG. 5. The intra prediction mode of the current block may be used to determine the reference line of the current block, in which case step S310 may be performed before step S300. Referring to Figure 3, the reference line and intra prediction mode of the current block Based on this, intra prediction can be performed on the current block (S320).
이하, 도 6 내지 도 8을 참조하여 인트라 예측 모드 별 인트라 예측 방법에 대해서 자세히 살펴보기로 한다. 다만, 설명의 편의를 위해, 현재 블록의 인트라 예측을 위해 단일 참조 라인이 이용됨을 가정하나, 복수의 참조 라인이 이용되는 경우에도 후술하는 인트라 예측 방법이 동일/유사하게 적용될 수 있다.Hereinafter, we will look at the intra prediction method for each intra prediction mode in detail with reference to FIGS. 6 to 8. However, for convenience of explanation, it is assumed that a single reference line is used for intra prediction of the current block. However, even when multiple reference lines are used, the intra prediction method described later may be applied in the same/similar manner.
도 6은 본 개시에 따른 플래너 모드 기반의 인트라 예측 방법을 도시한 것이다.Figure 6 illustrates a planar mode-based intra prediction method according to the present disclosure.
도 6을 참조하면, T는 현재 블록의 우상단 코너에 위치하는 참조 샘플을, L은 현재 블록의 좌하단 코너에 위치하는 참조 샘플을 나타낸다. P1은 수평 방향의 보간을 통해 생성될 수 있다. 일 예로, P1은 P1과 동일한 수평 라인에 위치한 참조 샘플과 T를 보간하여 생성될 수 있다. P2는 수직 방향의 보간을 통해 생성될 수 있다. 일 예로, P2는 P2와 동일한 수직 라인에 위치한 참조 샘플과 L을 보간하여 생성될 수 있다. 현재 블록 내 현재 샘플은, 다음 수학식 1과 같이, P1과 P2의 가중합을 통해 예측될 수 있다.Referring to FIG. 6, T represents a reference sample located at the upper right corner of the current block, and L represents a reference sample located at the lower left corner of the current block. P1 can be generated through horizontal interpolation. As an example, P1 can be generated by interpolating T with a reference sample located on the same horizontal line as P1. P2 can be generated through interpolation in the vertical direction. As an example, P2 can be generated by interpolating L with a reference sample located on the same vertical line as P2. The current sample in the current block can be predicted through the weighted sum of P1 and P2, as shown in Equation 1 below.
Figure PCTKR2023010772-appb-img-000001
Figure PCTKR2023010772-appb-img-000001
수학식 1에서, 가중치 α와 β는, 현재 블록의 너비와 높이를 고려하여 결정될 수 있다. 현재 블록의 너비와 높이에 따라, 가중치 α와 β는 동일한 값을 가질 수도 있고, 서로 상이한 값을 가질 수도 있다. 만약 현재 블록의 너비와 높이가 같다면, 가중치 α와 β를 동일하게 설정할 수 있고, 현재 샘플의 예측 샘플은 P1과 P2의 평균값으로 설정될 수 있다. 현재 블록의 너비와 높이가 같지 않은 경우, 가중치 α와 β는 서로 상이한 값을 가질 수 있다. 일 예로, 너비가 높이보다 큰 경우, 현재 블록의 너비에 대응하는 가중치에 더 작은 값을 설정하고, 현재 블록의 높이에 대응하는 가중치에 더 큰 값을 설정할 수 있다. 역으로, 너비가 높이보다 큰 경우, 현재 블록의 너비에 대응하는 가중치에 더 큰 값을 설정하고, 현재 블록의 높이에 대응하는 가중치에 더 작은 값을 설정할 수 있다. 여기서, 현재 블록의 너비에 대응하는 가중치는 β를 의미하고, 현재 블록의 높이에 대응하는 가중치는 α를 의미할 수 있다.In Equation 1, the weights α and β can be determined considering the width and height of the current block. Depending on the width and height of the current block, weights α and β may have the same value or different values. If the width and height of the current block are the same, the weights α and β can be set to be the same, and the prediction sample of the current sample can be set to the average value of P1 and P2. If the width and height of the current block are not the same, the weights α and β may have different values. For example, if the width is greater than the height, a smaller value can be set to the weight corresponding to the width of the current block, and a larger value can be set to the weight corresponding to the height of the current block. Conversely, if the width is greater than the height, a larger value can be set to the weight corresponding to the width of the current block, and a smaller value can be set to the weight corresponding to the height of the current block. Here, the weight corresponding to the width of the current block may mean β, and the weight corresponding to the height of the current block may mean α.
도 7은 본 개시에 따른 DC 모드 기반의 인트라 예측 방법을 도시한 것이다.Figure 7 shows a DC mode-based intra prediction method according to the present disclosure.
도 7을 참조하면, 현재 블록에 인접한 주변 샘플의 평균값을 산출하고, 산출된 평균값을 현재 블록 내 모든 샘플의 예측값으로 설정할 수 있다. 여기서, 주변 샘플은, 현재 블록의 상단 참조 샘플과 좌측 참조 샘플을 포함할 수 있다. 다만, 현재 블록의 형태에 따라, 상단 참조 샘플 또는 좌측 참조 샘플만을 이용하여 평균값을 산출할 수도 있다. 일 예로, 현재 블록의 너비가 높이보다 큰 경우, 현재 블록의 상단 참조 샘플만을 이용하여 평균값을 산출할 수 있다. 또는, 현재 블록의 너비와 높이의 비율이 소정의 문턱값보다 크거나 같은 경우, 현재 블록의 상단 참조 샘플만을 이용하여 평균값을 산출할 수 있다. 또는, 현재 블록의 너비와 높이의 비율이 소정의 문턱값보다 작거나 같은 경우, 현재 블록의 상단 참조 샘플만을 이용하여 평균값을 산출할 수 있다. 반면, 현재 블록의 너비가 높이보다 작은 경우, 현재 블록의 좌측 참조 샘플만을 이용하여 평균값을 산출할 수 있다. 또는, 현재 블록의 너비와 높이의 비율이 소정의 문턱값보다 작거나 같은 경우, 현재 블록의 좌측 참조 샘플만을 이용하여 평균값을 산출할 수 있다. 또는, 현재 블록의 너비와 높이의 비율이 소정의 문턱값보다 크거나 같은 경우, 현재 블록의 좌측 참조 샘플만을 이용하여 평균값을 산출할 수 있다.Referring to FIG. 7, the average value of neighboring samples adjacent to the current block can be calculated, and the calculated average value can be set as the predicted value of all samples in the current block. Here, the surrounding samples may include the top reference sample and the left reference sample of the current block. However, depending on the type of the current block, the average value may be calculated using only the top reference sample or the left reference sample. For example, if the width of the current block is greater than the height, the average value can be calculated using only the top reference sample of the current block. Alternatively, if the ratio of the width and height of the current block is greater than or equal to a predetermined threshold, the average value can be calculated using only the top reference sample of the current block. Alternatively, if the ratio of the width and height of the current block is less than or equal to a predetermined threshold, the average value can be calculated using only the upper reference sample of the current block. On the other hand, if the width of the current block is smaller than the height, the average value can be calculated using only the left reference sample of the current block. Alternatively, if the ratio of the width and height of the current block is less than or equal to a predetermined threshold, the average value can be calculated using only the left reference sample of the current block. Alternatively, if the ratio of the width and height of the current block is greater than or equal to a predetermined threshold, the average value can be calculated using only the left reference sample of the current block.
도 8은 본 개시에 따른 방향성 모드 기반의 인트라 예측 방법을 도시한 것이다.Figure 8 illustrates a directional mode-based intra prediction method according to the present disclosure.
현재 블록의 인트라 예측 모드가 방향성 모드인 경우, 해당 방향성 모드의 각도에 따라 참조 라인으로 프로젝션(projection)을 수행할 수 있다. 프로젝션된 위치에 참조 샘플이 존재하면, 해당 참조 샘플을 현재 샘플의 예측 샘플로 설정할 수 있다. 만약 프로젝션된 위치에 참조 샘플이 존재하지 않으면, 프로젝션된 위치에 이웃한 하나 또는 그 이상의 주변 샘플을 이용하여 프로젝션된 위치에 대응하는 샘플을 생성할 수 있다. 일 예로, 프로젝션된 위치를 기준으로 양방향으로 이웃한 2개 또는 그 이상의 주변 샘플을 기반으로 보간을 수행하여, 프로젝션된 위치에 대응하는 샘플을 생성할 수 있다. 또는, 프로젝션된 위치에 이웃한 하나의 주변 샘플을 프로젝션된 위치에 대응하는 샘플로 설정할 수 있다. 이때, 프로젝션된 위치에 이웃한 복수의 주변 샘플 중 프로젝션된 위치에 가장 가까운 주변 샘플이 이용될 수 있다. 프로젝션된 위치에 대응하는 샘플을 현재 샘플의 예측 샘플로 설정할 수 있다.If the intra prediction mode of the current block is a directional mode, projection can be performed to a reference line according to the angle of the directional mode. If a reference sample exists at the projected position, the reference sample can be set as the prediction sample of the current sample. If a reference sample does not exist at the projected position, a sample corresponding to the projected position may be generated using one or more surrounding samples adjacent to the projected position. As an example, interpolation may be performed based on two or more neighboring samples in both directions based on the projected position, thereby generating a sample corresponding to the projected position. Alternatively, one surrounding sample adjacent to the projected position can be set as the sample corresponding to the projected position. At this time, among a plurality of neighboring samples adjacent to the projected position, the neighboring sample closest to the projected position may be used. The sample corresponding to the projected position can be set as the predicted sample of the current sample.
도 8을 참조하면, 현재 샘플 B의 경우, 해당 위치에서 인트라 예측 모드의 각도에 따라 참조 라인으로 프로젝션을 수행할 경우, 프로젝션된 위치에 참조 샘플이 존재한다(즉, 정수 위치의 참조 샘플, R3). 이 경우, 프로젝션된 위치의 참조 샘플을 현재 샘플 B의 예측 샘플로 설정할 수 있다. 현재 샘플 A의 경우, 해당 위치에서 인트라 예측 모드의 각도에 따라 참조 라인으로 프로젝션을 수행할 경우, 프로젝션된 위치에 참조 샘플(즉, 정수 위치의 참조 샘플)이 존재하지 않는다. 이 경우, 프로젝션된 위치에 이웃한 주변 샘플(예를 들어, R2와 R3)을 기반으로 보간을 수행하여 분수 위치의 샘플(r)을 생성할 수 있다. 생성된 분수 위치의 샘플(r)을 현재 샘플 A의 예측 샘플로 설정할 수 있다.Referring to FIG. 8, in the case of the current sample B, when projection is performed from that position to the reference line according to the angle of the intra prediction mode, a reference sample exists at the projected position (i.e., a reference sample at an integer position, R3 ). In this case, the reference sample of the projected position can be set as the predicted sample of the current sample B. In the case of the current sample A, when projection is performed from that position to the reference line according to the angle of the intra prediction mode, there is no reference sample (i.e., reference sample at the integer position) at the projected position. In this case, interpolation may be performed based on surrounding samples (e.g., R2 and R3) neighboring the projected position to generate a sample (r) of the fractional position. The sample (r) at the generated fractional position can be set as the predicted sample of the current sample A.
도 9는 분수 위치의 샘플을 유도하는 방법을 도시한 것이다. Figure 9 shows a method for deriving samples of fractional positions.
도 9의 예에서, 변수 h는 예측 샘플 A의 위치와 참조 샘플 라인 까지의 수직 방향거리(즉, 세로 거리)를 의미하고, 변수 w는 예측 샘플 A의 위치와 분수 위치 샘플 까지의 수평 방향 거리(즉, 가로 거리)를 의미한다. 또한, 변수 θ는, 인트라 예측 모드의 방향성에 따라 미리 정의된 각도를 의미하고, 변수 x는, 분수 위치를 의미한다.In the example of Figure 9, the variable h means the vertical distance (i.e., vertical distance) from the position of the predicted sample A to the reference sample line, and the variable w means the horizontal distance from the position of the predicted sample A to the fractional position sample. (i.e., horizontal distance). Additionally, the variable θ refers to an angle predefined according to the directionality of the intra prediction mode, and the variable x refers to the fractional position.
변수 w는 다음의 수학식 2와 같이 유도될 수 있다. The variable w can be derived as in Equation 2 below.
Figure PCTKR2023010772-appb-img-000002
Figure PCTKR2023010772-appb-img-000002
이후, 변수 w에서, 정수 위치를 제거하면, 최종적으로, 분수 위치가 유도될 수 있다. Then, by removing the integer positions from the variable w, finally, the fractional positions can be derived.
분수 위치 샘플은 인접하는 정수 위치 참조 샘플들을 보간하여 생성될 수 있다. 일 예로, 정수 위치 참조 샘플 R2 및 정수 위치 참조 샘플 R3를 보간하여, x 위치의 분수 위치 참조 샘플을 생성할 수 있다. Fractional position samples can be generated by interpolating adjacent integer position reference samples. As an example, the integer position reference sample R2 and the integer position reference sample R3 may be interpolated to generate a fractional position reference sample at the x position.
분수 위치 샘플을 유도함에 있어서, 실수 연산을 피하기 위해, 스케일링 팩터를 사용할 수 있다. 일 예로, 스케일링 팩터 f가 32로 설정된 경우, 도 8의 (b)에 도시된 예에서와 같이, 이웃하는 정수 참조 샘플들 사이의 거리가 1이 아닌 32로 설정될 수 있다. In deriving fractional position samples, a scaling factor can be used to avoid real numbers. For example, when the scaling factor f is set to 32, the distance between neighboring integer reference samples may be set to 32 instead of 1, as in the example shown in (b) of FIG. 8.
또한, 인트라 예측 모드의 방향성에 따라 결정되는 각도 θ에 대한 탄젠트 값도 동일한 스케일링 팩터(예컨대, 32)를 이용하여 스케일업할 수 있다. Additionally, the tangent value for the angle θ determined according to the directionality of the intra prediction mode can also be scaled up using the same scaling factor (eg, 32).
도 10 및 도 11은 인트라 예측 모드별, 각도에 대한 탄젠트 값이 32배 스케일링된 것을 도시한 것이다.Figures 10 and 11 show that the tangent value for the angle is scaled by 32 times for each intra prediction mode.
도 10은, 비-와이드 앵글 인트라 예측 모드에 대한, 탄젠트 값의 스케일링된 결과를 나타낸 것이고, 도 11은 와이드 앵글 인트라 예측 모드에 대한, 탄젠트 값의 스케일링된 결과를 나타낸 것이다.FIG. 10 shows the scaled results of tangent values for the non-wide angle intra prediction mode, and FIG. 11 shows the scaled results of the tangent values for the wide angle intra prediction mode.
인트라 예측 모드의 각도 값에 대한 탄젠트 값(tanθ)이 양수인 경우, 현재 블록의 상단 라인에 속하는 참조 샘플들(즉, 상단 참조 샘플들) 또는 현재 블록의 좌측 라인에 속하는 참조 샘플들(즉, 좌측 참조 샘플들) 중 한쪽만을 사용하여 인트라 예측이 수행될 수 있다. 한편, 인트라 예측 모드의 각도 값에 대한 탄젠트값이 음수인 경우, 상단에 위치하는 참조 샘플들과 좌측에 위치하는 참조 샘플들이 모두 이용된다. If the tangent value (tanθ) to the angle value in intra prediction mode is positive, reference samples belonging to the top line of the current block (i.e., top reference samples) or reference samples belonging to the left line of the current block (i.e., left Intra prediction can be performed using only one of the reference samples. Meanwhile, when the tangent value for the angle value of the intra prediction mode is negative, both the reference samples located at the top and the reference samples located on the left are used.
이때, 구현의 간소화를 위해, 좌측 참조 샘플들을 위쪽으로 프로젝션 하거나, 상단 참조 샘플들을 좌측으로 프로젝션 하여, 참조 샘플들을 1D 어레이 형태로 배열하고, 1D 어레이 형태의 참조 샘플들을 이용하여 인트라 예측을 수행하도록 할 수도 있다. At this time, to simplify implementation, the left reference samples are projected upward, or the upper reference samples are projected to the left, the reference samples are arranged in a 1D array, and intra prediction is performed using the reference samples in the 1D array. You may.
도 12는 방향성 모드가 34번 내지 49번 모드 중 하나인 경우, 인트라 예측 양상을 예시한 도면이다.Figure 12 is a diagram illustrating an intra prediction aspect when the directional mode is one of modes 34 to 49.
현재 블록의 인트라 예측 모드가 34번 내지 49번 모드 중 하나인 경우, 현재 블록의상단 참조 샘플들 뿐만 아니라, 좌측 참조 샘플들을 이용하여 인트라 예측이 수행된다. 이때, 도 12에 도시된 예에서와 같이, 현재 블록의 좌측에 위치하는 참조 샘플을 상단 라인의 위치로 복사하거나, 좌측에 위치하는 참조 샘플들을 보간하여 상단 라인의 참조 샘플을 생성할 수 있다. If the intra prediction mode of the current block is one of modes 34 to 49, intra prediction is performed using not only the top reference samples of the current block but also the left reference samples. At this time, as in the example shown in FIG. 12, the reference sample located on the left of the current block can be copied to the position of the top line, or the reference samples located on the left can be interpolated to generate the reference sample of the top line.
일 예로, 현재 블록 상단의 A 위치에 대한 참조 샘플을 획득하고자 하는 경우, 현재 블록의 인트라 예측 모드의 방향성을 고려하여, 상단 라인의 A 위치에서, 현재 블록의 좌측 라인에 프로젝션을 수행할 수 있다. 프로젝션된 위치를 a라 할 경우, a 위치에 대응하는 값을 복사하거나, a에 대응하는 분수 위치 값을 생성하여, A 위치의 값으로 설정할 수 있다. 일 예로, a 위치가 정수 위치인 경우, 정수 위치 참조 샘플을 복사하여 A 위치의 값을 생성할 수 있다. 반면, a 위치가 분수 위치인 경우, a 위치의 상측에 위치하는 참조 샘플 및 a 위치의 하측에 위치하는 참조 샘플을 보간하고, 보간된 값을 A 위치의 값으로 설정할 수 있다. 한편, 현재 블록 상단의 A 위치에서, 현재 블록의 좌측 라인으로 프로젝션되는 방향은, 현재 블록의 인트라 예측 모드의 방향과 평행이면서, 반대 방향일 수 있다. For example, if you want to obtain a reference sample for the A position at the top of the current block, considering the directionality of the intra prediction mode of the current block, projection can be performed from the A position on the top line to the left line of the current block. . If the projected position is called a, the value corresponding to the position a can be copied, or a fractional position value corresponding to a can be created and set as the value of the A position. For example, if the position a is an integer position, the value of the position A can be generated by copying the integer position reference sample. On the other hand, when the a position is a fractional position, the reference sample located above the a position and the reference sample located below the a position can be interpolated, and the interpolated value can be set as the value of the A position. Meanwhile, at position A at the top of the current block, the direction projected to the left line of the current block may be parallel to and opposite to the direction of the intra prediction mode of the current block.
도 13은 좌측 참조 샘플들을 보간하여 상단 참조 샘플을 생성하는 예를 설명하기 위한 도면이다.Figure 13 is a diagram for explaining an example of generating an upper reference sample by interpolating left reference samples.
도 13에서, 변수 h는, 상단 라인의 A 위치와 좌측 라인의 a 위치 사이의 수평 방향 거리를 나타낸다. 변수 w는, 상단 라인의 A 위치와 좌측 라인의 a 위치 사이의 수직 방향 거리를 나타낸다. 또한, 변수 θ는, 인트라 예측 모드의 방향성에 따라 미리 정의된 각도를 의미하고, 변수 x는, 분수 위치를 의미한다.In Figure 13, the variable h represents the horizontal distance between the position A on the top line and the position A on the left line. The variable w represents the vertical distance between the position A on the top line and the position A on the left line. Additionally, the variable θ refers to an angle predefined according to the directionality of the intra prediction mode, and the variable x refers to the fractional position.
변수 h는 다음의 수학식 3과 같이 유도될 수 있다. The variable h can be derived as in Equation 3 below.
Figure PCTKR2023010772-appb-img-000003
Figure PCTKR2023010772-appb-img-000003
이후, 변수 h에서, 정수 위치를 제거하면, 최종적으로, 분수 위치가 유도될 수 있다. Then, by removing the integer positions from the variable h, finally, the fractional positions can be derived.
분수 위치 샘플을 유도함에 있어서, 실수 연산을 피하기 위해, 스케일링 팩터를 사용할 수 있다. 일 예로, 변수 θ에 대한 탄젠트 값을 스케일링 팩터 f1을 이용하여 스케일링할 수 있다. 여기서, 좌측 라인으로 프로젝션되는 방향은, 방향성 예측 모와 평행이면서 반대이므로, 도 10 및 도 11에 도시된 스케일된 탄젠트 값을 사용할 수도 있다. In deriving fractional position samples, a scaling factor can be used to avoid real numbers. As an example, the tangent value for variable θ can be scaled using the scaling factor f1. Here, since the direction projected to the left line is parallel and opposite to the directional prediction model, the scaled tangent value shown in FIGS. 10 and 11 may be used.
스케일링 팩터 f1이 적용된 경우, 수학식 3은, 다음의 수학식 4와 같이, 변형 사용될 수 있다. When the scaling factor f1 is applied, Equation 3 can be modified and used as shown in Equation 4 below.
Figure PCTKR2023010772-appb-img-000004
Figure PCTKR2023010772-appb-img-000004
위와 같은 방식으로, 상단 라인에 속하는 참조 샘플들만으로 1D 참조 샘플 어레이를 구성할 수 있다. 이 결과, 1D 어레이로 구성된 상단 참조 샘플들만을 이용하여, 현재 블록에 대한 인트라 예측을 수행할 수 있다. In the same way as above, a 1D reference sample array can be constructed only with reference samples belonging to the top line. As a result, intra prediction for the current block can be performed using only the upper reference samples composed of a 1D array.
도 14는 1D 어레이로 배열된 참조 샘플들을 이용하여, 인트라 예측이 수행되는 예를 나타낸 것이다.Figure 14 shows an example in which intra prediction is performed using reference samples arranged in a 1D array.
도 14에 도시된 예에서와 같이, 좌측 참조 샘플들을 프로젝션하여, 상단 참조 샘플들을 생성함으로써, 상단 라인에 속하는 참조 샘플들만을 이용하여 현재 블록의 예측 샘플들이 획득될 수 있다. As in the example shown in FIG. 14, by projecting left reference samples to generate top reference samples, prediction samples of the current block can be obtained using only reference samples belonging to the top line.
도 12 및 도 14에 도시된 것과 반대로, 상단 참조 샘플을 좌측 라인에 프로젝션하여, 좌측 라인에 속하는 참조 샘플들만으로 1D 참조 샘플 어레이를 구성할 수도 있다. 구체적으로, 방향성 모드의 각도에 대한 탄젠트 값(tanθ)이 음수인 방향성 모드들 중 19번 내지 33번 모드들에 대해서는, 상단 라인에 속한 참조 샘플들을 좌측 라인으로 프로젝션 하여, 좌측 참조 샘플을 생성할 수 있다. Contrary to what is shown in FIGS. 12 and 14, the top reference sample may be projected onto the left line to form a 1D reference sample array using only reference samples belonging to the left line. Specifically, for modes 19 to 33 among the directional modes in which the tangent value (tanθ) for the angle of the directional mode is negative, the reference samples belonging to the upper line are projected to the left line to generate the left reference sample. You can.
현재 픽처의 부호화시, 픽처간 중복된 데이터는 인터 예측을 통해 제거될 수 있다. 인터 예측은, 블록 단위로 수행될 수 있다. 구체적으로, 현재 블록의 움직임 정보를 이용하여, 참조 픽처로부터 현재 블록의 예측 블록을 생성할 수 있다. 여기서, 움직임 정보는, 움직임 벡터, 참조 픽처 인덱스 및 예측 방향 중 적어도 하나를 포함할 수 있다.When encoding the current picture, overlapping data between pictures can be removed through inter prediction. Inter prediction can be performed on a block basis. Specifically, a prediction block of the current block can be generated from a reference picture using motion information of the current block. Here, the motion information may include at least one of a motion vector, a reference picture index, and a prediction direction.
도 15 및 도 16은 인터 예측 방법의 흐름도이다.Figures 15 and 16 are flowcharts of the inter prediction method.
도 15는 부호화기의 동작을 나타낸 것이고, 도 16은 복호화기의 동작을 나타낸 것이다. Figure 15 shows the operation of the encoder, and Figure 16 shows the operation of the decoder.
부호화기에서는, 움직임 추정을 수행하고(S1510), 움직임 추정 결과로 도출된 움직임 정보를 기초로, 예측 블록을 획득한다(S1520). 여기서, 움직임 정보는, 움직임 벡터, 참조 픽처 인덱스, 움직임 벡터 정밀도, 양방향 가중치, L0 예측 수행 여부 또는 L1 예측 수행 여부 중 적어도 하나를 포함할 수 있다.The encoder performs motion estimation (S1510) and obtains a prediction block based on motion information derived as a motion estimation result (S1520). Here, the motion information may include at least one of a motion vector, reference picture index, motion vector precision, bidirectional weight, and whether L0 prediction is performed or L1 prediction is performed.
나아가, 부호화기에서는, 인터 예측을 수행하기 위한 인터 예측 모드를 결정하고, 결정된 인터 예측 모드에 따라, 움직임 정보를 유도하기 위한 정보를 부호화할 수 있다(S1530). Furthermore, the encoder may determine an inter prediction mode for performing inter prediction and encode information for deriving motion information according to the determined inter prediction mode (S1530).
복호화기에서는, 비트스트림으로부터 시그날링되는 정보를 기초로, 인터 예측 모드를 결정하고(S1610), 결정된 인터 예측 모드에 따라, 움직임 정보를 획득한다(S1620). 움직임 정보가 획득되면, 획득된 움직임 정보를 기초로, 현재 블록의 예측 블록을 획득할 수 있다(S1630).In the decoder, an inter prediction mode is determined based on information signaled from the bitstream (S1610), and motion information is obtained according to the determined inter prediction mode (S1620). When motion information is acquired, a prediction block of the current block can be obtained based on the obtained motion information (S1630).
이하, 각 단계에 대해 상세히 설명하기로 한다. Hereinafter, each step will be described in detail.
현재 블록의 움직임 정보는, 움직임 추정(Motion Estimation)을 통해 생성될 수 있다. Motion information of the current block can be generated through motion estimation.
도 17은 움직임 추정이 수행되는 예를 나타낸다. Figure 17 shows an example in which motion estimation is performed.
도 17에서, 현재 픽처의 POC(Picture Order Count)는 T이고, 참조 픽처의 POC는, (T-1)인 것으로 가정하였다. In Figure 17, it is assumed that the POC (Picture Order Count) of the current picture is T, and the POC of the reference picture is (T-1).
참조 픽처 내 현재 블록의 기준점과 동일한 위치로부터, 움직임 추정을 위한 탐색 범위를 설정할 수 있다. 여기서, 기준 점은, 현재 블록의 좌상단 샘플의 위치일 수 있다. The search range for motion estimation can be set from the same position as the reference point of the current block in the reference picture. Here, the reference point may be the location of the upper left sample of the current block.
일 예로, 도 17에서는, 기준점을 중심으로, (w0+w01) 및 (h0+h1) 크기의 사각형이 탐색 범위로 설정되는 것으로 예시되었다. 위 예시에서, w0, w1, h0, 및 h1은 상호 동일한 값을 가질 수 있다. 또는, w0, w1, h0 및 h1 중 적어도 하나는 다른 하나의 상이한 값을 갖도록 설정될 수 있다. 또는, CTU(Coding Tree Unit) 경계, 슬라이스 경계, 타일 경계 또는 픽처 경계를 초과하지 않도록, w0, w1, h0 및 h1의 크기가 결정될 수도 있다.As an example, in FIG. 17, it is illustrated that a rectangle of size (w0+w01) and (h0+h1) is set as the search range, centered on the reference point. In the above example, w0, w1, h0, and h1 may have the same value. Alternatively, at least one of w0, w1, h0, and h1 may be set to have a different value from the other. Alternatively, the sizes of w0, w1, h0, and h1 may be determined so as not to exceed a Coding Tree Unit (CTU) boundary, slice boundary, tile boundary, or picture boundary.
탐색 범위 내, 현재 블록과 동일한 크기를 갖는 참조 블록들을 설정한 뒤, 각 참조 블록들에 대해 현재 블록과의 비용(Cost)를 측정할 수 있다. 비용은, 두 블록간 유사도를 이용하여 계산될 수 있다. After setting reference blocks with the same size as the current block within the search range, the cost of each reference block compared to the current block can be measured. The cost can be calculated using the similarity between two blocks.
일 예로, 현재 블록 내 원본 샘플들과 참조 블록 내 원본 샘플들(또는 복원 샘플들) 간의 차분값들의 절대값 합(SAD : Sum of Absolute Difference)을 기반으로, 비용을 계산할 수 있다. 절대값 합이 작을수록, 비용은 감소할 수 있다. As an example, the cost may be calculated based on the Sum of Absolute Difference (SAD) of the difference values between the original samples in the current block and the original samples (or restored samples) in the reference block. The smaller the absolute value sum, the lower the cost can be.
이후, 참조 블록들 각각의 비용을 비교한 뒤, 최적의 비용을 갖는 참조 블록을, 현재 블록의 예측 블록으로 설정할 수 있다.Afterwards, after comparing the costs of each reference block, the reference block with the optimal cost can be set as the prediction block of the current block.
그리고, 현재 블록과 참조 블록 간 거리를 움직임 벡터로 설정할 수 있다. 구체적으로, 현재 블록과 참조 블록 간의 x 좌표 차분 및 y 좌표 차분이 움직임 벡터로 설정될 수 있다.Additionally, the distance between the current block and the reference block can be set as a motion vector. Specifically, the x-coordinate difference and y-coordinate difference between the current block and the reference block may be set as a motion vector.
나아가, 움직임 추정을 통해 특정된 참조 블록이 포함된 픽처의 인덱스를 참조 픽처 인덱스로 설정한다. Furthermore, the index of the picture containing the reference block specified through motion estimation is set as the reference picture index.
또한, 참조 픽처가 L0 참조 픽처 리스트에 속하는지 또는 L1 참조 픽처 리스트에 속하는지 여부에 기반하여, 예측 방향을 설정할 수 있다. Additionally, the prediction direction can be set based on whether the reference picture belongs to the L0 reference picture list or the L1 reference picture list.
또한, L0 방향 및 L1 방향 각각에 대해 움직임 추정이 수행될 수 있다. L0 방향 및 L1방향 모두에 대해 예측이 수행된 경우, L0 방향의 움직임 정보 및 L1 방향의 움직임 정보가 각각 생성될 수 있다. Additionally, motion estimation may be performed for each of the L0 direction and L1 direction. When prediction is performed in both the L0 direction and the L1 direction, motion information in the L0 direction and motion information in the L1 direction can be generated respectively.
도 18 및 도 19는, 움직임 추정을 통해 생성된 움직임 정보를 기초로, 현재 블록의 예측 블록이 생성되는 예를 나타낸 것이다. Figures 18 and 19 show an example in which a prediction block of the current block is generated based on motion information generated through motion estimation.
도 18은 단방향(즉, L0 방향) 예측으로 예측 블록을 생성하는 예를 나타낸 것이고, 도 19는 양방향(즉, L0 및 L1 방향) 예측으로 예측 블록을 생성하는 예를 나타낸 것이다.FIG. 18 shows an example of generating a prediction block through unidirectional (i.e., L0 direction) prediction, and FIG. 19 shows an example of generating a prediction block through bidirectional (i.e., L0 and L1 directions) prediction.
단방향 예측의 경우, 하나의 움직임 정보를 이용하여 현재 블록의 예측 블록을 생성한다. 일 예로, 상기 움직임 정보는 L0 움직임 벡터, L0 참조 픽처 인덱스 및 L0 방향을 가리지는 예측 방향 정보를 포함할 수 있다.In the case of unidirectional prediction, a prediction block of the current block is generated using one piece of motion information. As an example, the motion information may include an L0 motion vector, an L0 reference picture index, and prediction direction information indicating the L0 direction.
양방향 예측의 경우, 두개의 움직임 정보를 이용하여 예측 블록을 생성한다. 일 예로, L0 방향에 대한 움직임 정보(L0 움직임 정보)를 기초로 특정된 L0 방향의 참조 블록을 L0 예측 블록으로 설정하고, L1 방향에 대한 움직임 정보(L1 움직임 정보)를 기초로 특정된 L1 방향의 참조 블록을 L1 예측 블록으로 설정할 수 있다. 이후, L0 예측 블록 및 L1 예측 블록을 가중합하여, 현재 블록의 예측 블록을 생성할 수 있다. In the case of bidirectional prediction, a prediction block is created using two pieces of motion information. As an example, a reference block in the L0 direction specified based on motion information in the L0 direction (L0 motion information) is set as an L0 prediction block, and the L1 direction specified based on motion information in the L1 direction (L1 motion information) is set as an L0 prediction block. The reference block of can be set as the L1 prediction block. Afterwards, the L0 prediction block and the L1 prediction block can be weighted to generate the prediction block of the current block.
도 17 내지 도 19에 도시된 예에서는, L0 참조 픽처는, 현재 픽처의 이전 방향(즉, 현재 픽처보다 POC값이 작음)에 존재하고, L1 참조 픽처는, 현재 픽처의 이후 방향(즉, 현재 픽처보다 POC 값이 큼)에 존재하는 것으로 예시하였다.In the examples shown in FIGS. 17 to 19, the L0 reference picture exists in the direction before the current picture (i.e., the POC value is smaller than the current picture), and the L1 reference picture exists in the direction after the current picture (i.e., the POC value is smaller than the current picture). It is exemplified as existing in (the POC value is larger than the picture).
다만, 도시된 예와 달리, L0 참조 픽처가 현재 픽처의 이후 방향에 존재하거나, L1 참조 픽처가 현재 픽처의 이전 방향에 존재할 수 있다. 일 예로, L0 참조 픽처 및 L1 참조 픽처는 모두 현재 픽처의 이전 방향에 존재하거나, 또는 모두 현재 픽처의 이후 방향에 존재할 수 있다. 또는, 현재 픽처의 이후 방향에 존재하는 L0 참조 픽처 및 현재 픽처의 이전 방향에 존재하는 L1 참조 픽처를 이용하여 양방향 예측이 수행될 수도 있다. However, unlike the example shown, the L0 reference picture may exist in the direction after the current picture, or the L1 reference picture may exist in the direction before the current picture. For example, both the L0 reference picture and the L1 reference picture may exist in the previous direction of the current picture, or both may exist in the subsequent direction of the current picture. Alternatively, bidirectional prediction may be performed using an L0 reference picture that exists in the direction after the current picture and an L1 reference picture that exists in the direction before the current picture.
인터 예측이 수행된 블록의 움직임 정보는 메모리에 저장될 수 있다. 이때, 움직임 정보는 샘플 단위로 저장될 수 있다. 구체적으로, 특정 샘플이 속하는 블록의 움직임 정보가, 특정 샘플의 움직임 정보로 저장될 수 있다. 저장된 움직임 정보는, 차후 부/복호화될 이웃 블록의 움직임 정보를 유도하는 것에 이용될 수 있다. Motion information of the block on which inter prediction was performed may be stored in memory. At this time, motion information may be stored in sample units. Specifically, motion information of the block to which a specific sample belongs may be stored as motion information of the specific sample. The stored motion information can be used to derive motion information of a neighboring block to be encoded/decoded later.
부호화기에서는, 현재 블록의 샘플(즉, 원본(Original) 샘플)과 예측 샘플 사이의 차분값에 해당하는 잔차 샘플을 부호화한 정보 및 예측 블록을 생성하는데 필요한 움직임 정보를 복호화기로 시그날링할 수 있다. 복호화기에서는, 시그날링된 차분값에 대한 정보를 복호화하여 차분 샘플을 유도하고, 상기 차분 샘플에 움직임 정보를 이용하여 생성된 예측 블록 내 예측 샘플을 더하여, 복원 샘플을 생성할 수 있다.The encoder may signal information encoding a residual sample corresponding to the difference value between the sample of the current block (i.e., the original sample) and the prediction sample and the motion information necessary to generate the prediction block to the decoder. The decoder may decode information about the signaled difference value to derive a difference sample, and add a prediction sample within a prediction block generated using motion information to the difference sample to generate a restored sample.
이때, 복호화기로 시그날링되는 움직임 정보를 효과적으로 압축하기 위해, 복수의 인터 예측 모드들 중 하나가 선택될 수 있다. 여기서, 복수의 인터 예측 모드들은, 움직임 정보 병합 모드 및 움직임 벡터 예측 모드가 포함될 수 있다.At this time, in order to effectively compress the motion information signaled to the decoder, one of a plurality of inter prediction modes may be selected. Here, the plurality of inter prediction modes may include a motion information merge mode and a motion vector prediction mode.
움직임 벡터 예측 모드는, 움직임 벡터와 움직임 벡터 예측값 사이의 차분값을 부호화하여 시그날링하는 모드이다. 여기서, 움직임 벡터 예측값은, 현재 블록에 인접하는 주변 블록 또는 주변 샘플의 움직임 정보를 기초로 유도될 수 있다.The motion vector prediction mode is a mode in which the difference value between a motion vector and a motion vector predicted value is encoded and signaled. Here, the motion vector prediction value may be derived based on motion information of neighboring blocks or neighboring samples adjacent to the current block.
도 20은 움직임 벡터 예측값을 유도하기 위해 참조되는 위치를 나타낸다.Figure 20 shows positions referenced to derive motion vector prediction values.
설명의 편의를 위해, 현재 블록은 4x4 크기를 갖는 것으로 가정한다.For convenience of explanation, it is assumed that the current block has a size of 4x4.
도시된 예에서, 'LB'는, 현재 블록 내 최좌측열 및 최하단행에 포함된 샘플을 나타낸다. 'RT'은, 현재 블록 내 최우측열 및 최상단행에 포함된 샘플을 나타낸다. A0 내지 A4는 현재 블록의 좌측에 이웃하는 샘플들을 나타내고, B0 내지 B5는, 현재 블록의 상단에 이웃하는 샘플들을 나타낸다. 일 예로, A1은, LB의 좌측에 이웃하는 샘플을 나타내고, B1은, RT의 상단에 이웃하는 샘플을 나타낸다. 현재 블록에 공간적으로 인접하는 샘플(즉, A0 내지 A4 중 하나 또는 B0 내지 B5 중 하나)을 포함하는 이웃 블록을 공간적 이웃 블록이라 호칭할 수 있다.In the illustrated example, 'LB' represents samples included in the leftmost column and bottommost row in the current block. 'RT' represents the sample included in the rightmost column and topmost row in the current block. A0 to A4 represent samples neighboring to the left of the current block, and B0 to B5 represent samples neighboring to the top of the current block. As an example, A1 represents a sample neighboring to the left of LB, and B1 represents a sample neighboring to the top of RT. A neighboring block containing a sample (that is, one of A0 to A4 or one of B0 to B5) that is spatially adjacent to the current block may be referred to as a spatial neighboring block.
Col은, 콜로케이티드(Co-located) 픽처 내 현재 블록의 우하단에 이웃하는 샘플의 위치를 나타낸다. 콜로케이티드 픽처는 현재 픽처와 상이한 픽처이고, 콜로케이티드 픽처를 특정하기 위한 정보가 명시적으로 비트스트림에 부호화되어 시그날링될 수 있다. 또는, 기 정의된 참조 픽처 인덱스를 갖는 참조 픽처를 콜로케이티드 픽처로 설정할 수도 있다. 현재 블록에 시간적으로 인접하는 샘플(즉, Col)을 포함하는 이웃 블록을 시간적 이웃 블록이라 호칭할 수 있다.Col indicates the position of a sample neighboring the bottom right of the current block in the co-located picture. The collocated picture is a different picture from the current picture, and information for specifying the collocated picture can be explicitly encoded and signaled in the bitstream. Alternatively, a reference picture with a predefined reference picture index may be set as a collocated picture. A neighboring block containing a sample (i.e., Col) temporally adjacent to the current block may be referred to as a temporal neighboring block.
현재 블록의 움직임 벡터 예측값은, 움직임 벡터 예측 리스트(Motion Vector Prediction List)에 포함된 적어도 하나의 움직임 벡터 예측 후보로부터 유도될 수 있다. The motion vector prediction value of the current block may be derived from at least one motion vector prediction candidate included in the motion vector prediction list.
움직임 벡터 예측 리스트에 삽입될 수 있는 움직임 벡터 예측 후보들의 개수(즉, 리스트의 크기)가 부호화기 및 복호화기에 기 정의되어 있을 수 있다. 일 예로, 움직임 벡터 예측 후보들의 최대 개수는 2개일 수 있다. The number of motion vector prediction candidates that can be inserted into the motion vector prediction list (i.e., the size of the list) may be predefined in the encoder and decoder. As an example, the maximum number of motion vector prediction candidates may be two.
현재 블록에 인접하는 이웃 샘플의 위치에 저장된 움직임 벡터 또는 상기 움직임 벡터를 스케일링하여 유도된 스케일링된 움직임 벡터를 움직임 벡터 예측 후보로서 움직임 벡터 예측 리스트에 삽입할 수 있다. 이때, 현재 블록에 인접하는 이웃 샘플들을 기 정의된 순서에 따라 스캔하여, 움직임 벡터 예측 후보를 유도할 수 있다. A motion vector stored at the position of a neighboring sample adjacent to the current block or a scaled motion vector derived by scaling the motion vector may be inserted into the motion vector prediction list as a motion vector prediction candidate. At this time, a motion vector prediction candidate can be derived by scanning neighboring samples adjacent to the current block in a predefined order.
일 예로, A0부터 A4의 순서로 각 위치에 움직임 벡터가 저장되어 있는지 여부를 확인할 수 있다. 그리고, 위 스캔 순서에 따라, 가장 먼저 발견된 이용 가능한 움직임 벡터를 움직임 벡터 예측 후보로서 움직임 벡터 예측 리스트에 삽입할 수 있다. As an example, it can be checked whether a motion vector is stored at each location in the order from A0 to A4. And, according to the above scan order, the earliest discovered available motion vector can be inserted into the motion vector prediction list as a motion vector prediction candidate.
다른 예로, A0 부터 A4의 순서로, 각 위치에 움직임 벡터가 저장되어 있는지 여부를 확인하되, 가장 먼저 발견된, 현재 블록과 동일한 참조 픽처를 갖는 위치의 움직임 벡터를 움직임 벡터 예측 후보로서 움직임 벡터 예측 리스트에 삽입할 수 있다. 현재 블록과 동일한 참조 픽처를 갖는 이웃 샘플이 존재하지 않는 경우, 가장 먼저 발견된 이용 가능한 벡터를 기초로 움직임 벡터 예측 후보를 유도할 수 있다. 구체적으로, 가장 먼저 발견된 이용 가능한 움직임 벡터를 스케일링한 뒤, 스케일링된 움직임 벡터를 움직임 벡터 예측 후보로서 움직임 벡터 예측 리스트에 삽입할 수 있다. 이때, 스케일링은, 현재 픽처와 참조 픽처 사이의 출력 순서 차이(즉, POC 차이) 및 현재 픽처와 이웃 샘플의 참조 픽처 사이의 출력 순서 차이(즉, POC 차이)에 기초하여 수행될 수 있다. As another example, check whether a motion vector is stored at each location in the order from A0 to A4, and predict the motion vector using the motion vector of the position that has the same reference picture as the current block found first as a motion vector prediction candidate. It can be inserted into the list. If there is no neighboring sample having the same reference picture as the current block, a motion vector prediction candidate can be derived based on the available vector found first. Specifically, after scaling the first available motion vector found, the scaled motion vector can be inserted into the motion vector prediction list as a motion vector prediction candidate. At this time, scaling may be performed based on the output order difference between the current picture and the reference picture (i.e., POC difference) and the output order difference between the current picture and the reference picture of the neighboring sample (i.e., POC difference).
나아가, B0 부터 B5의 순서로, 각 위치에 움직임 벡터가 저장되어 있는지 여부를 확인할 수 있다. 그리고, 위 스캔 순서에 따라, 가장 먼저 발견된 이용 가능한 움직임 벡터를 움직임 벡터 예측 후보로서 움직임 벡터 예측 리스트에 삽입할 수 있다. Furthermore, it is possible to check whether a motion vector is stored at each location in the order from B0 to B5. And, according to the above scan order, the earliest discovered available motion vector can be inserted into the motion vector prediction list as a motion vector prediction candidate.
다른 예로, B0 부터 B5의 순서로, 각 위치에 움직임 벡터가 저장되어 있는지 여부를 확인하되, 가장 먼저 발견된, 현재 블록과 동일한 참조 픽처를 갖는 위치의 움직임 벡터를 움직임 벡터 예측 후보로서 움직임 벡터 예측 리스트에 삽입할 수 있다. 현재 블록과 동일한 참조 픽처를 갖는 이웃 샘플이 존재하지 않는 경우, 가장 먼저 발견된 이용 가능한 벡터를 기초로 움직임 벡터 예측 후보를 유도할 수 있다. 구체적으로, 가장 먼저 발견된 이용 가능한 움직임 벡터를 스케일링한 뒤, 스케일링된 움직임 벡터를 움직임 벡터 예측 후보로서 움직임 벡터 예측 리스트에 삽입할 수 있다. 이때, 스케일링은, 현재 픽처와 참조 픽처 사이의 출력 순서 차이(즉, POC 차이) 및 현재 픽처와 이웃 샘플의 참조 픽처 사이의 출력 순서 차이(즉, POC 차이)에 기초하여 수행될 수 있다. As another example, check whether a motion vector is stored at each location in the order from B0 to B5, and predict the motion vector using the motion vector at the position that has the same reference picture as the current block found first as a motion vector prediction candidate. It can be inserted into the list. If there is no neighboring sample having the same reference picture as the current block, a motion vector prediction candidate can be derived based on the available vector found first. Specifically, after scaling the first available motion vector found, the scaled motion vector can be inserted into the motion vector prediction list as a motion vector prediction candidate. At this time, scaling may be performed based on the output order difference between the current picture and the reference picture (i.e., POC difference) and the output order difference between the current picture and the reference picture of the neighboring sample (i.e., POC difference).
블록 단위(예컨대, 4x4)로 움직임 벡터가 저장되는 경우, 소정 위치의 샘플을 포함하는 블록의 움직임 벡터를 기초로, 움직임 벡터 예측 후보가 유도될 수 있다.When motion vectors are stored in block units (eg, 4x4), a motion vector prediction candidate may be derived based on the motion vector of a block including a sample at a predetermined position.
상술한 예에서와 같이, 현재 블록의 좌측에 인접하는 샘플로부터 움직임 벡터 예측 후보를 유도하고, 현재 블록의 상단에 인접하는 샘플로부터 움직임 벡터 예측 후보를 유도할 수 있다. As in the above example, a motion vector prediction candidate can be derived from a sample adjacent to the left of the current block, and a motion vector prediction candidate can be derived from a sample adjacent to the top of the current block.
이때, 좌측 샘플로부터 유도된 움직임 벡터 예측 후보가 상단 샘플로부터 유도된 움직임 벡터 예측 후보보다 먼저 움직임 벡터 예측 리스트에 삽입될 수 있다. 이 경우, 좌측 샘플로부터 유도된 움직임 벡터 예측 후보에 할당되는 인덱스가 상단 샘플로부터 유도된 움직임 벡터 예측 후보보다 작은 값을 가질 수 있다.At this time, the motion vector prediction candidate derived from the left sample may be inserted into the motion vector prediction list before the motion vector prediction candidate derived from the top sample. In this case, the index assigned to the motion vector prediction candidate derived from the left sample may have a smaller value than the motion vector prediction candidate derived from the top sample.
위와 반대로, 상단 샘플로부터 유도된 움직임 벡터 예측 후보를 좌측 샘플로부터 유도된 움직임 벡터 예측 후보보다 먼저 움직임 벡터 예측 리스트에 삽입할 수도 있다. Contrary to the above, the motion vector prediction candidate derived from the top sample may be inserted into the motion vector prediction list before the motion vector prediction candidate derived from the left sample.
상기 움직임 벡터 예측 리스트에 포함된 움직임 벡터 예측 후보들 중 부호화 효율이 가장 높은 움직임 벡터 예측 후보를, 현재 블록의 움직임 벡터 예측값(Motion Vector Predictor, MVP)으로 설정할 수 있다. 그리고, 복수의 움직임 벡터 예측 후보들 중 현재 블록의 움직임 벡터 예측값으로 설정되는 움직임 벡터 예측 후보를 가리키는 인덱스 정보를 부호화하여 복호화기로 시그날링할 수 있다. 움직임 벡터 예측 후보들의 개수가 2개인 경우, 상기 인덱스 정보는 1비트의 플래그(예컨대, MVP 플래그)일 수 있다. 또한, 현재 블록의 움직임 벡터와 움직임 벡터 예측값 사이의 차분인 움직임 벡터 차분값(Motion Vector Difference, MVD)를 부호화하여 복호화기로 시그날링할 수 있다.Among the motion vector prediction candidates included in the motion vector prediction list, the motion vector prediction candidate with the highest coding efficiency may be set as the motion vector predictor (MVP) of the current block. Additionally, index information indicating a motion vector prediction candidate that is set as the motion vector prediction value of the current block among a plurality of motion vector prediction candidates may be encoded and signaled to the decoder. When the number of motion vector prediction candidates is two, the index information may be a 1-bit flag (eg, MVP flag). Additionally, a motion vector difference (MVD), which is the difference between the motion vector of the current block and the motion vector predicted value, can be encoded and signaled to the decoder.
복호화기는, 부호화기와 동일하게 움직임 벡터 예측 리스트를 구성할 수 있다. 또한, 비트스트림으로부터 인덱스 정보를 복호화하고, 복호화된 인덱스 정보를 기초로 복수의 움직임 벡터 예측 후보들 중 하나를 선택할 수 있다. 선택된 움직임 벡터 예측 후보를, 현재 블록의 움직임 벡터 예측값으로 설정할 수 있다. The decoder can construct a motion vector prediction list in the same way as the encoder. Additionally, index information may be decoded from the bitstream, and one of a plurality of motion vector prediction candidates may be selected based on the decoded index information. The selected motion vector prediction candidate can be set as the motion vector prediction value of the current block.
또한, 비트스트림으로부터 움직임 벡터 차분값을 복호화할 수 있다. 이후, 움직임 벡터 예측값과 움직임 벡터 차분값을 합하여, 현재 블록의 움직임 벡터를 유도할 수 있다. Additionally, motion vector difference values can be decoded from the bitstream. Afterwards, the motion vector of the current block can be derived by combining the motion vector prediction value and the motion vector difference value.
현재 블록에 양방향 예측이 적용되는 경우, L0 방향 및 L1 방향 각각에 대해 움직임 벡터 예측 리스트가 생성될 수 있다. 즉, 움직임 벡터 예측 리스트는, 동일 방향의 움직임 벡터들로 구성될 수 있다. 이에 따라, 현재 블록의 움직임 벡터와, 움직임 벡터 예측 리스트에 포함된 움직임 벡터 예측 후보들은 동일한 방향을 갖는다.When bidirectional prediction is applied to the current block, a motion vector prediction list can be generated for each of the L0 direction and L1 direction. That is, the motion vector prediction list may be composed of motion vectors in the same direction. Accordingly, the motion vector of the current block and the motion vector prediction candidates included in the motion vector prediction list have the same direction.
움직임 벡터 예측 모드가 선택된 경우, 참조 픽처 인덱스 및 예측 방향 정보가 명시적으로 부호화되어 복호화기로 시그날링될 수 있다. 일 예로, 참조 픽처 리스트 상에 복수의 참조 픽처들이 존재하고, 복수 참조 픽처들 각각에 대해 움직임 추정이 수행된 경우, 상기 복수 참조 픽처들 중 현재 블록의 움직임 정보가 유도된 참조 픽처를 특정하기 위한 참조 픽처 인덱스가 명시적으로 부호화되어 복호화기로 시그날링될 수 있다. When the motion vector prediction mode is selected, the reference picture index and prediction direction information may be explicitly encoded and signaled to the decoder. As an example, when a plurality of reference pictures exist in the reference picture list, and motion estimation is performed for each of the plurality of reference pictures, a method for specifying a reference picture from which motion information of the current block is derived among the plurality of reference pictures The reference picture index can be explicitly encoded and signaled to the decoder.
이때, 참조 픽처 리스트에 하나의 참조 픽처만이 포함된 경우에는 상기 참조 픽처 인덱스의 부/복호화가 생략될 수 있다.At this time, if the reference picture list includes only one reference picture, encoding/decoding of the reference picture index may be omitted.
예측 방향 정보는, L0 단방향 예측, L1 단방향 예측, 또는 양방향 예측 중 하나를 가리키는 인덱스일 수 있다. 또는, L0 방향에 대한 예측이 수행되는지 여부를 나타내는 L0 플래그 및 L1 방향에 대한 예측이 수행되는지 여부를 나타내는 L1 플래그가 각각 부호화되어 시그날링될 수도 있다.Prediction direction information may be an index indicating one of L0 unidirectional prediction, L1 unidirectional prediction, or bidirectional prediction. Alternatively, the L0 flag indicating whether prediction in the L0 direction is performed and the L1 flag indicating whether prediction in the L1 direction is performed may be encoded and signaled, respectively.
움직임 정보 병합 모드는, 현재 블록의 움직임 정보를 이웃 블록의 움직임 정보와 동일하게 설정하는 모드이다. 움직임 정보 병합 모드에서는, 움직임 정보 병합 리스트를 이용하여, 움직임 정보가 부/복호화될 수 있다.The motion information merge mode is a mode that sets the motion information of the current block to be the same as the motion information of the neighboring block. In the motion information merge mode, motion information can be encoded/decoded using a motion information merge list.
움직임 정보 병합 후보는, 현재 블록에 인접하는 이웃 블록 또는 이웃 샘플의 움직임 정보를 기초로 유도될 수 있다. 일 예로, 현재 블록에 주변에 참조할 위치를 기 정의한 뒤, 기 정의된 참조 위치에 움직임 정보가 존재하는지 여부를 확인할 수 있다. 기 정의된 참조 위치에 움직임 정보가 존재하는 경우, 해당 위치의 움직임 정보를 움직임 정보 병합 후보로서 움직임 정보 병합 리스트에 삽입할 수 있다.A motion information merge candidate may be derived based on motion information of a neighboring block or neighboring sample adjacent to the current block. For example, after pre-defining a reference position around the current block, it is possible to check whether motion information exists at the pre-defined reference position. If motion information exists at a predefined reference location, motion information at that location can be inserted into the motion information merge list as a motion information merge candidate.
도 20의 예시에서, 기 정의된 참조 위치는, A0, A1, B0, B1, B5 및 Col 중 적어도 하나를 포함할 수 있다. 나아가, A1, B1, B0, A0, B5 및 Col의 순서로, 움직임 정보 병합 후보를 유도할 수 있다.In the example of FIG. 20, the predefined reference position may include at least one of A0, A1, B0, B1, B5, and Col. Furthermore, motion information merging candidates can be derived in the following order: A1, B1, B0, A0, B5, and Col.
블록 단위(예컨대, 4x4)로 움직임 정보가 저장되는 경우, 기 정의된 참조 위치의 샘플을 포함하는 블록의 움직임 정보를 기초로, 움직임 정보 병합 후보가 유도될 수 있다.When motion information is stored in block units (eg, 4x4), a motion information merging candidate may be derived based on motion information of a block including a sample of a predefined reference position.
움직임 정보 병합 리스트에 포함된 움직임 정보 병합 후보들 중 최적의 비용을 갖는 움직임 정보 병합 후보의 움직임 정보를 현재 블록의 움직임 정보로 설정할 수 있다. 나아가, 복수의 움직임 정보 병합 후보들 중 선택된 움직임 정보 병합 후보를 가리키는 인덱스 정보(예컨대, 병합 인덱스)를 부호화하여 복호화기로 전송할 수 있다.Among the motion information merge candidates included in the motion information merge list, the motion information of the motion information merge candidate with the optimal cost can be set as the motion information of the current block. Furthermore, index information (eg, merge index) indicating a motion information merge candidate selected from among a plurality of motion information merge candidates may be encoded and transmitted to the decoder.
복호화기에서는, 부호화기에서와 동일하게 움직임 정보 병합 리스트를 구성할 수 있다. 그리고, 비트스트림으로부터 복호화된 병합 인덱스를 기초로, 움직임 정보 병합 후보를 선택할 수 있다. 선택된 움직임 정보 병합 후보의 움직임 정보가, 현재 블록의 움직임 정보로 설정될 수 있다. In the decoder, a motion information merge list can be constructed in the same way as in the encoder. Then, a motion information merge candidate can be selected based on the merge index decoded from the bitstream. The motion information of the selected motion information merge candidate may be set as the motion information of the current block.
움직임 정보 병합 리스트는 움직임 벡터 예측 리스트와는 달리, 예측 방향과 상관없이 단일의 리스트로 구성된다. 즉, 움직임 정보 병합 리스트에 포함된 움직임 정보 병합 후보는 L0 움직임 정보 또는 L1 움직임 정보만을 가질 수도 있고, 양방향 움직임 정보(즉, L0 움직임 정보 및 L1 움직임 정보)를 가질 수도 있다. Unlike the motion vector prediction list, the motion information merge list consists of a single list regardless of the prediction direction. That is, the motion information merge candidate included in the motion information merge list may have only L0 motion information or L1 motion information, or may have bidirectional motion information (i.e., L0 motion information and L1 motion information).
현재 블록 주변 복원 샘플 영역을 이용하여, 현재 블록의 움직임 정보를 유도할 수도 있다. 여기서, 현재 블록의 움직임 정보를 유도하는데 이용되는 복원 샘플 영역을 템플릿(Template)이라 호칭할 수도 있다. Motion information of the current block can also be derived using the restored sample area around the current block. Here, the restored sample area used to derive motion information of the current block may be called a template.
도 21은 템플릿 기반 움직임 추정 방법을 설명하기 위한 도면이다.Figure 21 is a diagram for explaining a template-based motion estimation method.
도 17에서는, 탐색 범위 내 현재 블록과 참조 블록 간의 비용을 기반으로, 현재 블록의 예측 블록을 결정하는 것으로 설명하였다. 본 실시예에 따르면, 도 17과 달리, 현재 블록에 이웃하는 템플릿(이하, 현재 템플릿이라 함) 및 현재 템플릿과 동일한 크기 및 형태를 갖는 참조 템플릿 사이의 비용을 기반으로, 현재 블록에 대한 움직임 추정을 수행할 수 있다. In Figure 17, it was explained that the prediction block of the current block is determined based on the cost between the current block and the reference block within the search range. According to this embodiment, unlike FIG. 17, motion estimation for the current block is based on the cost between a template neighboring the current block (hereinafter referred to as the current template) and a reference template having the same size and shape as the current template. can be performed.
일 예로, 현재 템플릿 내 복원 샘플들과 참조 템플릿 내 복원 샘플들 간의 차분값의 절대값 합을 기반으로, 비용을 계산할 수 있다. 절대값 합이 작을수록, 비용은 감소할 수 있다. As an example, the cost may be calculated based on the absolute sum of difference values between restoration samples in the current template and restoration samples in the reference template. The smaller the absolute value sum, the lower the cost can be.
탐색 범위 내 현재 템플릿과 최적의 비용을 갖는 참조 템플릿이 결정되면, 참조 템플릿에 이웃하는 참조 블록을 현재 블록의 예측 블록으로 설정할 수 있다. Once the current template within the search range and the reference template with the optimal cost are determined, the reference block neighboring the reference template can be set as the prediction block of the current block.
그리고, 현재 블록과 참조 블록 사이의 거리, 참조 블록이 속하는 픽처의 인덱스 및 참조 픽처가 L0 또는 L1 참조 픽처 리스트에 포함되는지 여부를 기반으로, 현재 블록의 움직임 정보를 설정할 수 있다. Additionally, motion information of the current block can be set based on the distance between the current block and the reference block, the index of the picture to which the reference block belongs, and whether the reference picture is included in the L0 or L1 reference picture list.
템플릿은 현재 블록 주변 기 복원된 영역이 템플릿으로 정의되는 바, 복호화기 스스로 부호화기와 동일한 방식으로 움직임 추정을 수행할 수 있다. 이에 따라, 템플릿을 이용하여 움직임 정보를 유도하는 경우, 템플릿 이용 여부를 나타내는 정보 외, 움직임 정보를 부호화하여 시그날링할 필요가 없다.Since the template is defined as the previously restored area around the current block, the decoder itself can perform motion estimation in the same manner as the encoder. Accordingly, when motion information is derived using a template, there is no need to encode and signal motion information other than information indicating whether the template is used.
현재 템플릿은 현재 블록 상단에 인접하는 영역 또는 좌측에 인접하는 영역 중 적어도 하나를 포함할 수 있다. 이때, 상단에 인접하는 영역은, 적어도 하나의 행을 포함하고, 좌측에 인접하는 영역은, 적어도 하나의 열을 포함할 수 있다.The current template may include at least one of an area adjacent to the top of the current block or an area adjacent to the left. At this time, the area adjacent to the top may include at least one row, and the area adjacent to the left may include at least one column.
도 22는 템플릿의 구성 예들을 나타낸다.Figure 22 shows examples of template configurations.
도 22에 도시된 예들 중 하나를 따라, 현재 템플릿이 구성될 수 있다. A current template may be constructed following one of the examples shown in Figure 22.
또는, 도 22에 도시된 예와 달리, 현재 블록의 좌측에 인접하는 영역만으로 템플릿을 구성하거나, 현재 블록의 상단에 인접하는 영역만으로 템플릿을 구성할 수도 있다.Alternatively, unlike the example shown in FIG. 22, the template may be configured only from the area adjacent to the left side of the current block, or may be configured only from the area adjacent to the top of the current block.
현재 템플릿의 크기 및/또는 형태는 부호화기 및 복호화기에서 기 정의되어 있을 수 있다.The size and/or shape of the current template may be predefined in the encoder and decoder.
또는, 크기 및/또는 형태가 상이한 복수의 템플릿 후보들을 기 정의한 뒤, 복수의 템플릿 후보들 중 하나를 특정하는 인덱스 정보를 부호화하여 복호화기로 시그날링할 수 있다. Alternatively, after pre-defining a plurality of template candidates with different sizes and/or shapes, index information specifying one of the plurality of template candidates can be encoded and signaled to the decoder.
또는, 현재 블록의 크기, 형태 또는 위치 중 적어도 하나에 기초하여, 복수의 템플릿 후보들 중 하나를 적응적으로 선택할 수도 있다. 일 예로, 현재 블록이 CTU의 상단 경계에 접하는 경우, 현재 블록의 좌측에 인접하는 영역만으로 현재 템플릿을 구성할 수 있다. Alternatively, one of a plurality of template candidates may be adaptively selected based on at least one of the size, shape, or location of the current block. For example, if the current block touches the upper border of the CTU, the current template can be constructed only from the area adjacent to the left side of the current block.
참조 픽처 리스트에 저장된 참조 픽처들 각각에 대해 템플릿에 기반한 움직임 추정을 수행할 수 있다. 또는, 참조 픽처들 중 일부에 대해서만 움직임 추정을 수행할 수도 있다. 일 예로, 참조 픽처 인덱스가 0인 참조 픽처에 대해서만 움직임 추정을 수행하거나, 참조 픽처 인덱스가 문턱값보다 작은 참조 픽처들 또는 현재 픽처와의 POC 차분이 문턱값보다 작은 참조 픽처들에 대해서만 움직임 추정을 수행할 수 있다. Template-based motion estimation can be performed for each reference picture stored in the reference picture list. Alternatively, motion estimation may be performed on only some of the reference pictures. As an example, motion estimation is performed only on reference pictures with a reference picture index of 0, or only on reference pictures whose reference picture index is smaller than the threshold, or on reference pictures whose POC difference with the current picture is smaller than the threshold. It can be done.
또는, 참조 픽처 인덱스를 명시적으로 부호화하여 시그날링한 뒤, 상기 참조 픽처 인덱스가 가리키는 참조 픽처에 대해서만 움직임 추정을 수행할 수 있다.Alternatively, the reference picture index can be explicitly encoded and signaled, and then motion estimation can be performed only on the reference picture indicated by the reference picture index.
또는, 현재 템플릿에 대응하는 이웃 블록의 참조 픽처를 대상으로 움직임 추정을 수행할 수 있다. 일 예로, 템플릿이 좌측 인접 영역 및 상단 인접 영역으로 구성되어 있다면, 좌측 이웃 블록의 참조 픽처 인덱스 또는 상단 이웃 블록의 참조 픽처 인덱스 중 적어도 하나를 이용하여 적어도 하나의 참조 픽처를 선택할 수 있다. 이후, 선택된 적어도 하나의 참조 픽처를 대상으로, 움직임 추정을 수행할 수 있다. Alternatively, motion estimation can be performed targeting the reference picture of a neighboring block corresponding to the current template. For example, if the template consists of a left neighboring area and a top neighboring area, at least one reference picture can be selected using at least one of the reference picture index of the left neighboring block or the reference picture index of the top neighboring block. Afterwards, motion estimation can be performed on at least one selected reference picture.
템플릿에 기반한 움직임 추정이 적용되었는지 여부를 나타내는 정보가 부호화되어 복호화기로 시그날링될 수 있다. 상기 정보는 1비트의 플래그일 수 있다. 일 예로, 상기 플래그가 참(1)인 것은, 현재 블록의 L0 방향 및 L1 방향에 템플릿에 기반한 움직임 추정이 적용됨을 가리킨다. 반면, 상기 플래그가 거짓(0)인 것은, 템플릿에 기반한 움직임 추정이 적용되지 않음을 나타낸다. 이 경우, 움직임 정보 병합 모드 또는 움직임 벡터 예측 모드를 기반으로, 현재 블록의 움직임 정보가 유도될 수 있다. Information indicating whether template-based motion estimation has been applied may be encoded and signaled to the decoder. The information may be a 1-bit flag. For example, if the flag is true (1), it indicates that template-based motion estimation is applied to the L0 direction and L1 direction of the current block. On the other hand, if the flag is false (0), it indicates that template-based motion estimation is not applied. In this case, motion information of the current block may be derived based on the motion information merging mode or motion vector prediction mode.
위와 반대로, 현재 블록에 움직임 정보 병합 모드 및 움직임 벡터 예측 모드가 적용되지 않는 것으로 결정된 경우에 한하여, 템플릿에 기반한 움직임 추정이 적용될 수 있다. 일 예로, 움직임 정보 병합 모드가 적용되는지 여부를 나타내는 제1 플래그 및 움직임 벡터 예측 모드가 적용되는지 여부를 나타내는 제2 플래그가 모두 0인 경우, 템플릿에 기반한 움직임 추정이 수행될 수 있다.Contrary to the above, template-based motion estimation can be applied only when it is determined that the motion information merge mode and motion vector prediction mode are not applied to the current block. For example, when the first flag indicating whether the motion information merge mode is applied and the second flag indicating whether the motion vector prediction mode is applied are both 0, motion estimation based on the template may be performed.
L0 방향 및 L1 방향 각각에 대해, 템플릿에 기반한 움직임 추정이 적용되었는지 여부를 나타내는 정보가 시그날링될 수 있다. 즉, L0 방향에 템플릿에 기반한 움직임 추정이 적용되는지 여부 및 L1 방향에 템플릿에 기반한 움직임 추정이 적용되는지 여부가 상호 독립적으로 결정될 수 있다. 이에 따라, L0 방향 및 L1 방향 중 어느 하나에는 템플릿에 기반한 움직임 추정이 적용되는 반면, 다른 하나에는, 타 모드(예컨대, 움직임 정보 병합 모드 또는 움직임 벡터 예측 모드)가 적용될 수 있다.For each of the L0 direction and the L1 direction, information indicating whether template-based motion estimation has been applied may be signaled. That is, whether template-based motion estimation is applied to the L0 direction and whether template-based motion estimation is applied to the L1 direction can be determined independently of each other. Accordingly, template-based motion estimation may be applied to one of the L0 direction and the L1 direction, while another mode (eg, motion information merge mode or motion vector prediction mode) may be applied to the other direction.
L0 방향 및 L1 방향에 모두 템플릿에 기반한 움직임 추정이 적용되는 경우, L0 예측 블록 및 L1 예측 블록의 가중합 연산을 기초로, 현재 블록의 예측 블록이 생성될 수 있다. 또는, L0 방향 및 L1 방향 중 하나에는 템플릿에 기반한 움직임 추정이 적용되었으나, 다른 하나에는, 타 모드가 적용된 경우에도, L0 예측 블록 및 L1 예측 블록의 가중합 연산을 기초로, 현재 블록의 예측 블록이 생성될 수 있다. When template-based motion estimation is applied to both the L0 direction and the L1 direction, a prediction block of the current block may be generated based on a weighted sum operation of the L0 prediction block and the L1 prediction block. Alternatively, even when template-based motion estimation is applied to one of the L0 direction and the L1 direction, but another mode is applied to the other, the prediction block of the current block is based on a weighted sum operation of the L0 prediction block and the L1 prediction block. This can be created.
또는, 템플릿에 기반한 움직임 추정 방법이, 움직임 정보 병합 모드 상의 움직임 정보 병합 후보 또는 움직임 벡터 예측 모드 상의 움직임 벡터 예측 후보로 삽입될 수도 있다. 이 경우, 선택된 움직임 정보 병합 후보 또는 선택된 움직임 벡터 예측 후보가 템플릿에 기반한 움직임 추정 방법을 가리키는지 여부에 기초하여, 템플릿에 기반한 움직임 추정 방법의 적용 여부가 결정될 수 있다.Alternatively, a motion estimation method based on a template may be inserted as a motion information merging candidate in a motion information merging mode or a motion vector prediction candidate in a motion vector prediction mode. In this case, whether to apply the template-based motion estimation method may be determined based on whether the selected motion information merge candidate or the selected motion vector prediction candidate indicates the template-based motion estimation method.
쌍방 매칭 방법을 기반으로, 현재 블록의 움직임 정보를 생성할 수도 있다. Based on the two-way matching method, movement information of the current block can also be generated.
도 23은 쌍방 매칭 방법을 기반의 움직임 추정 방법을 설명하기 위한 도면이다.Figure 23 is a diagram for explaining a motion estimation method based on the bilateral matching method.
쌍방 매칭 방법은, 현재 픽처의 시간적 순서(즉, POC)가 L0 참조 픽처의 시간적 순서 및 L1 참조 픽처의 시간적 순서 사이에 존재하는 경우에 한하여 수행될 수 있다. The two-way matching method can be performed only when the temporal order of the current picture (i.e., POC) exists between the temporal order of the L0 reference picture and the temporal order of the L1 reference picture.
쌍방 매칭 방법이 적용되는 경우, L0 참조 픽처 및 L1 참조 픽처 각각에 탐색 범위를 설정할 수 있다. 이때, L0 참조 픽처를 식별하기 위한 L0 참조 픽처 인덱스 및 L1 참조 픽처를 식별하기 위한 L1 참조 픽처 인덱스가 각각 부호화되어 시그날링될 수 있다. When the two-way matching method is applied, the search range can be set for each of the L0 reference picture and L1 reference picture. At this time, the L0 reference picture index for identifying the L0 reference picture and the L1 reference picture index for identifying the L1 reference picture may be encoded and signaled, respectively.
다른 예로, L0 참조 픽처 인덱스만을 부호화하여 시그날링하고, 현재 픽처와 L0 참조 픽처 사이의 거리(이하, L0 POC 차분이라 함)을 기초로, L1 참조 픽처를 선택할 수 있다. 일 예로, L1 참조 픽처 리스트에 포함된 L1 참조 픽처들 중, 현재 픽처와의 거리(이하, L1 POC 차분이라 함)의 절대값이 현재 픽처와 L0 참조 픽처 사이의 거리의 절대값과 동일한 L1 참조 픽처를 선택할 수 있다. L0 POC 차분과 동일한 L1 POC 차분을 갖는 L1 참조 픽처가 존재하지 않는 경우, L1 참조 픽처들 중 L1 POC 차분이 L0 POC 차분과 가장 유사한 L1 참조 픽처를 선택할 수 있다.As another example, only the L0 reference picture index can be encoded and signaled, and the L1 reference picture can be selected based on the distance between the current picture and the L0 reference picture (hereinafter referred to as L0 POC difference). As an example, among the L1 reference pictures included in the L1 reference picture list, an L1 reference whose absolute value of the distance to the current picture (hereinafter referred to as L1 POC difference) is the same as the absolute value of the distance between the current picture and the L0 reference picture. You can select a picture. If there is no L1 reference picture with the same L1 POC difference as the L0 POC difference, the L1 reference picture whose L1 POC difference is most similar to the L0 POC difference among the L1 reference pictures can be selected.
이때, L1 참조 픽처들 중 L0 참조 픽처와 시간적 방향이 상이한 L1 참조 픽처 만이 쌍방 매칭에 이용될 수 있다. 일 예로, L0 참조 픽처의 POC가 현재 픽처보다 작은 경우, 현재 픽처보다 POC가 큰 L1 참조 픽처들 중에서 하나를 선택할 수 있다.At this time, among the L1 reference pictures, only the L1 reference picture that has a different temporal direction from the L0 reference picture can be used for bilateral matching. For example, if the POC of the L0 reference picture is smaller than that of the current picture, one of the L1 reference pictures whose POC is larger than the current picture can be selected.
위와 반대로, L1 참조 픽처 인덱스만을 부호화하여 시그날링하고, 현재 픽처와 L1 참조 픽처 사이의 거리를 기초로, L0 참조 픽처를 선택할 수도 있다. Contrary to the above, only the L1 reference picture index may be encoded and signaled, and the L0 reference picture may be selected based on the distance between the current picture and the L1 reference picture.
또는, L0 참조 픽처들 중 현재 픽처와의 거리가 가장 가까운 L0 참조 픽처 및, L1 참조 픽처들 중 현재 픽처와의 거리가 가장 가까운 L1 참조 픽처를 이용하여 쌍방 매칭 방법을 수행할 수도 있다.Alternatively, a two-way matching method may be performed using an L0 reference picture among L0 reference pictures that is closest in distance to the current picture, and an L1 reference picture among L1 reference pictures that is closest in distance to the current picture.
또는, L0 참조 픽처 리스트 내 기 정의된 인덱스가 할당된 L0 참조 픽처(예컨대, 인덱스 0) 및 L1 참조 픽처 리스트 내 기 정의된 인덱스가 할당된 L1 참조 픽처(예컨대, 인덱스 0)를 이용하여, 쌍방 매칭 방법을 수행할 수도 있다.Or, using an L0 reference picture assigned a predefined index in the L0 reference picture list (e.g., index 0) and an L1 reference picture assigned a predefined index in the L1 reference picture list (e.g., index 0), two-way A matching method can also be performed.
또는, LX (X는 0 또는 1) 참조 픽처는 명시적으로 시그날링되는 참조 픽처 인덱스를 기반으로 선택하고, L|X-1| 참조 픽처는, L|X-1| 참조 픽처들 중 현재 픽처와 가장 가까운 거리를 갖는 참조 픽처, 또는 L|X-1| 참조 픽처 리스트 내 기 정의된 인덱스를 갖는 참조 픽처로 선택될 수 있다.Alternatively, the LX (X is 0 or 1) reference picture is selected based on an explicitly signaled reference picture index, and the L| It can be selected as a reference picture with the closest distance to, or a reference picture with a predefined index in the L|X-1| reference picture list.
다른 예로, 현재 블록의 이웃 블록의 움직임 정보를 기초로 L0 및/또는 L1 참조 픽처를 선택할 수 있다. 일 예로, 현재 블록의 좌측 또는 상단 이웃 블록의 참조 픽처 인덱스를 이용하여, 쌍방 매칭에 이용될 L0 및/또는 L1 참조 픽처를 선택할 수 있다.As another example, the L0 and/or L1 reference picture may be selected based on the motion information of the neighboring block of the current block. As an example, the L0 and/or L1 reference picture to be used for two-way matching can be selected using the reference picture index of the left or top neighboring block of the current block.
탐색 범위는 참조 픽처 내 콜로케이티드 블록으로부터 소정 범위 이내로 설정될 수 있다.The search range can be set to within a predetermined range from the collocated block in the reference picture.
다른 예로, 초기 움직임 정보를 기초로 탐색 범위를 설정할 수 있다. 초기 움직임 정보는, 현재 블록의 이웃 블록으로부터 유도될 수 있다. 일 예로, 현재 블록의 좌측 이웃 블록 또는 상단 이웃 블록의 움직임 정보가, 현재 블록의 초기 움직임 정보로 설정될 수 있다.As another example, the search range can be set based on initial motion information. Initial motion information may be derived from a neighboring block of the current block. For example, motion information of the left neighboring block or the top neighboring block of the current block may be set as the initial motion information of the current block.
쌍방 매칭 방법이 적용되는 경우, L0 움직임 벡터와 L1 방향의 움직임 벡터는 서로 반대 방향으로 설정된다. 이는, L0 움직임 벡터의 부호와 L1 방향의 움직임 벡터가 서로 반대 부호를 가짐을 나타낸다. 아울러, LX 움직임 벡터의 크기는, 현재 픽처와 LX 참조 픽처 사이의 거리(즉, POC 차분)에 비례할 수 있다. When the two-way matching method is applied, the L0 motion vector and the motion vector in the L1 direction are set in opposite directions. This indicates that the sign of the L0 motion vector and the motion vector in the L1 direction have opposite signs. In addition, the size of the LX motion vector may be proportional to the distance (i.e., POC difference) between the current picture and the LX reference picture.
이후, L0 참조 픽처의 탐색 범위에 속하는 참조 블록(이하, L0 참조 블록이라 함) 및 L1 참조 픽처의 탐색 범위에 속하는 참조 블록(이하, L1 참조 블록이라 함) 사이의 비용(cost)를 이용하여, 움직임 추정을 수행할 수 있다. Afterwards, the cost between the reference block within the search range of the L0 reference picture (hereinafter referred to as L0 reference block) and the reference block within the search range of the L1 reference picture (hereinafter referred to as L1 reference block) is used. , motion estimation can be performed.
현재 블록과의 벡터가 (x, y)인 L0 참조 블록을 선택한 경우, 현재 블록으로부터 (-Dx, -Dy) 만큼 이격된 위치의 L1 참조 블록을 선택할 수 있다. 여기서, D는, 현재 픽처와 L0 참조 픽처 사이의 거리 및 L1 참조 픽처와 현재 픽처 사이의 거리의 비율에 의해 결정될 수 있다.If you select an L0 reference block whose vector with the current block is (x, y), you can select an L1 reference block located at a distance of (-Dx, -Dy) from the current block. Here, D can be determined by the ratio of the distance between the current picture and the L0 reference picture and the distance between the L1 reference picture and the current picture.
일 예로, 도 23에 도시된 예에서, 현재 픽처(T)와 L0 참조 픽처(T-1) 사이의 거리의 절대값 및 현재 픽처(T)와 L1 참조 픽처(T+1) 사이의 거리의 절대값은 상호 동일하다. 이에 따라, 도시된 예에서, L0 움직임 벡터 (x0, y0) 및 L1 움직임 벡터 (x1, y1)는 상호 크기는 동일하나 거리는 반대이다. 만약, POC가 (T+2)인 L1 참조 픽처가 이용되었다면, L1 움직임 벡터 (x1, y1)은, (-2*x0, -2*y0)로 설정될 것이다. For example, in the example shown in Figure 23, the absolute value of the distance between the current picture (T) and the L0 reference picture (T-1) and the distance between the current picture (T) and the L1 reference picture (T+1) The absolute values are mutually identical. Accordingly, in the illustrated example, the L0 motion vector (x0, y0) and the L1 motion vector (x1, y1) have the same size but opposite distances. If an L1 reference picture with a POC of (T+2) was used, the L1 motion vector (x1, y1) will be set to (-2*x0, -2*y0).
최적의 비용을 갖는 L0 참조 블록 및 L1 참조 블록이 선택되면, L0 참조 블록 및 L1 참조 블록 각각을 현재 블록의 L0 예측 블록 및 L1 예측 블록으로 설정할 수 있다. 이후, L0 참조 블록 및 L1 참조 블록의 가중합 연산을 통해, 현재 블록의 최종 예측 블록을 생성할 수 있다. 일 예로, 현재 블록의 예측 블록이 생성될 수 있다. Once the L0 reference block and L1 reference block with optimal cost are selected, the L0 reference block and L1 reference block can be set as the L0 prediction block and L1 prediction block of the current block, respectively. Afterwards, the final prediction block of the current block can be generated through a weighted sum operation of the L0 reference block and the L1 reference block. As an example, a prediction block of the current block may be generated.
쌍방 매칭 방법이 적용되는 경우, 복호화기에서는 부호화기와 동일한 방법으로 움직임 추정을 수행할 수 있다. 이에 따라, 쌍방 움직임 매칭 방법이 적용되는지 여부를 나타내는 정보는 명시적으로 부/복호화하는 한편, 움직임 벡터 등의 움직임 정보의 부/복호화는 생략할 수 있다. 앞서 설명한 바와 같이, L0 참조 픽처 인덱스 또는 L1 참조 픽처 인덱스 중 적어도 하나가 명시적으로 부/복호화될 수도 있다. When the bilateral matching method is applied, the decoder can perform motion estimation in the same way as the encoder. Accordingly, information indicating whether the two-way motion matching method is applied is explicitly encoded/decoded, while encoding/decoding of motion information such as motion vectors can be omitted. As described above, at least one of the L0 reference picture index or the L1 reference picture index may be explicitly encoded/decoded.
다른 예로, 쌍방 매칭 방법이 적용되었는지 여부를 나타내는 정보를 명시적으로 부/복호화하되, 쌍방 매칭 방법이 적용된 경우, L0 움직임 벡터 또는 L1 움직임 벡터를 명시적으로 부호화하여 시그날링할 수도 있다. L0 움직임 벡터가 시그날링된 경우, L1 움직임 벡터는, 현재 픽처와 L0 참조 픽처간의 POC 차분 및 현재 픽처와 L1 참조 픽처간의 POC 차분을 기초로 유도될 수 있다. L1 움직임 벡터가 시그날링된 경우, L0 움직임 벡터는, 현재 픽처와 L0 참조 픽처간의 POC 차분 및 현재 픽처와 L1 참조 픽처간의 POC 차분을 기초로 유도될 수 있다. 이때, 부호화기에서는, L0 움직임 벡터 및 L1 움직임 벡터 중 크기가 작은 것을 명시적으로 부호화할 수 있다. As another example, information indicating whether the two-way matching method has been applied may be explicitly encoded/decoded, but if the two-way matching method has been applied, the L0 motion vector or the L1 motion vector may be explicitly encoded and signaled. If the L0 motion vector is signaled, the L1 motion vector can be derived based on the POC difference between the current picture and the L0 reference picture and the POC difference between the current picture and the L1 reference picture. If the L1 motion vector is signaled, the L0 motion vector can be derived based on the POC difference between the current picture and the L0 reference picture and the POC difference between the current picture and the L1 reference picture. At this time, the encoder can explicitly encode the smaller one of the L0 motion vector and the L1 motion vector.
쌍방 매칭 방법이 적용되었는지 여부를 나타내는 정보는 1비트의 플래그일 수 있다. 일 예로, 상기 플래그가 참(예컨대, 1)인 것은, 현재 블록에 쌍방 매칭 방법이 적용됨을 나타낼 수 있다. 상기 플래그가 거짓(예컨대, 0)인 것은, 현재 블록에 쌍방 매칭 방법이 적용되지 않음을 나타낼 수 있다. 이 경우, 현재 블록에는, 움직임 정보 병합 모드 또는 움직임 벡터 예측 모드가 적용될 수 있다.Information indicating whether the two-way matching method has been applied may be a 1-bit flag. As an example, if the flag is true (eg, 1), it may indicate that the two-way matching method is applied to the current block. If the flag is false (eg, 0), it may indicate that the two-way matching method is not applied to the current block. In this case, motion information merge mode or motion vector prediction mode may be applied to the current block.
위와 반대로, 현재 블록에 움직임 정보 병합 모드 및 움직임 벡터 예측 모드가 적용되지 않는 것으로 결정된 경우에 한하여, 쌍방 매칭 방법이 적용될 수 있다. 일 예로, 움직임 정보 병합 모드가 적용되는지 여부를 나타내는 제1 플래그 및 움직임 벡터 예측 모드가 적용되는지 여부를 나타내는 제2 플래그가 모두 0인 경우, 쌍방 매칭 방법이 적용될 수 있다. Contrary to the above, the two-way matching method can be applied only when it is determined that the motion information merge mode and motion vector prediction mode are not applied to the current block. For example, when the first flag indicating whether the motion information merge mode is applied and the second flag indicating whether the motion vector prediction mode is applied are both 0, the two-way matching method may be applied.
또는, 쌍방 매칭 방법이, 움직임 정보 병합 모드 상의 움직임 정보 병합 후보 또는 움직임 벡터 예측 모드 상의 움직임 벡터 예측 후보로 삽입될 수도 있다. 이 경우, 선택된 움직임 정보 병합 후보 또는 선택된 움직임 벡터 예측 후보가 쌍방 매칭 방법을 가리키는지 여부에 기초하여, 쌍방 매칭 방법의 적용 여부가 결정될 수 있다.Alternatively, the two-way matching method may be inserted as a motion information merge candidate in the motion information merge mode or a motion vector prediction candidate in the motion vector prediction mode. In this case, whether to apply the two-way matching method may be determined based on whether the selected motion information merge candidate or the selected motion vector prediction candidate indicates the two-way matching method.
쌍방 매칭 방법에서는, 현재 픽처의 시간적 순서가, L0 참조 픽처의 시간적 순서 및 L1 참조 픽처의 시간적 순서 사이에 존재해야 하는 것으로 예시되었다. 위 쌍방 매칭 방법의 제약이 적용되지 않는 단방향 매칭 방법을 적용하여, 현재 블록의 예측 블록을 생성할 수도 있다. 구체적으로, 단방향 매칭 방법에서는, 현재 블록보다 시간적 순서(즉, POC)가 작은 2개의 참조 픽처들 또는 현재 블록보다 시간적 순서가 큰 2개의 참조 픽처들이 이용될 수 있다. 이때, 2개의 참조 픽처들은 모두 L0 참조 픽처 리스트 또는 L1 참조 픽처 리스트로부터 유도된 것일 수 있다. 또는, 2개의 참조 픽처들 중 1개는 L0 참조 픽처 리스트로부터 유도되고, 다른 하나는 L1 참조 픽처 리스트로부터 유도될 수도 있다.In the two-way matching method, it is exemplified that the temporal order of the current picture must exist between the temporal order of the L0 reference picture and the temporal order of the L1 reference picture. It is also possible to generate a prediction block of the current block by applying a one-way matching method that does not apply the constraints of the above two-way matching method. Specifically, in the one-way matching method, two reference pictures whose temporal order (i.e., POC) is smaller than that of the current block or two reference pictures whose temporal order is larger than the current block can be used. At this time, both reference pictures may be derived from the L0 reference picture list or the L1 reference picture list. Alternatively, one of the two reference pictures may be derived from the L0 reference picture list, and the other may be derived from the L1 reference picture list.
상술한 예에서와 같이, 현재 블록의 움직임 정보에 기초하여, 현재 블록에 대한 참조 블록 또는 참조 템플릿이 유도될 수 있다. 이때, 현재 블록의 움직임 벡터가 정수 위치가 아닌 분수 위치를 가리킨다면, 정수 위치 샘플들을 보간하여, 분수 위치 샘플을 생성할 수 있다.As in the above-described example, a reference block or reference template for the current block may be derived based on the motion information of the current block. At this time, if the motion vector of the current block points to a fractional position rather than an integer position, the integer position samples can be interpolated to generate a fractional position sample.
도 24 및 도 25는 각각 현재 블록의 움직임 벡터가 정수 위치를 가리키는 경우 및 분수 위치를 가리키는 경우의 예를 나타낸다.Figures 24 and 25 show examples of cases where the motion vector of the current block points to an integer position and a fractional position, respectively.
도 24 및 도 25에서, 현재 블록의 크기는 4x4 인 것으로 가정하였고, 현재 블록의 움직임 벡터가 가리키는 위치는, 현재 블록의 좌상단 샘플로부터 현재 블록의 움직임 벡터 만큼 떨어진 위치인 것으로 가정하였다.In Figures 24 and 25, the size of the current block is assumed to be 4x4, and the position indicated by the motion vector of the current block is assumed to be a position away from the upper left sample of the current block by the motion vector of the current block.
도 24에 도시된 예에서와 같이, 현재 블록의 움직임 벡터가 지시하는 위치가 정수 위치인 경우, 정수 위치 샘플들로 구성된 현재 블록과 동일한 크기(즉, 4x4)의 참조 블록이, 현재 블록의 예측 블록으로 설정될 수 있다.As in the example shown in FIG. 24, when the position indicated by the motion vector of the current block is an integer position, a reference block of the same size (i.e., 4x4) as the current block composed of integer position samples is used for prediction of the current block. Can be set as a block.
반면, 도 25에 도시된 예에서와 같이, 현재 블록의 움직임 벡터가 지시하는 위치가 분수 위치인 경우, 분수 위치 샘플들로 구성된 현재 블록과 동일한 크기의 참조 블록이, 현재 블록의 예측 블록으로 설정될 수 있다. On the other hand, as in the example shown in FIG. 25, when the position indicated by the motion vector of the current block is a fractional position, a reference block of the same size as the current block composed of fractional position samples is set as the prediction block of the current block. It can be.
한편, 분수 위치 샘플은, 주변 정수 위치 샘플들을 보간하여 유도될 수 있다. 이때, 상기 보간은, 가로 방향 보간 및 세로 방향 보간 중 적어도 하나를 포함할 수 있다. Meanwhile, fractional position samples can be derived by interpolating surrounding integer position samples. At this time, the interpolation may include at least one of horizontal interpolation and vertical interpolation.
도 26는 정수 위치 샘플들을 보간하여, 분수 위치 샘플이 유도되는 예를 나타낸 것이다. Figure 26 shows an example in which fractional position samples are derived by interpolating integer position samples.
도 26에서는, 양선형(Bi-linear) 보간 방식이 사용된 것으로 가정하였다. In Figure 26, it is assumed that a bi-linear interpolation method is used.
생성하고자 하는 분수 위치 샘플을, '현재 분수 위치 샘플'이라 호칭한다.The fraction position sample to be generated is called the 'current fraction position sample'.
현재 분수 위치 샘플의 수평 및 수직 방향 좌표가 모두 분수 위치인 경우, 도 26에 도시된 예에서와 같이, 가로 방향 보간을 통해, 현재 분수 위치 샘플과 수직 방향에 놓인, 제1 가로 방향 보간 샘플 및 제2 가로 방향 보간 샘플을 획득할 수 있다. 여기서, 제1 가로 방향 보간 샘플(도 26의 a)은, 현재 분수 위치 샘플의 상단에 위치하는 정수 위치 샘플들(도 26의 A 및 B)을 보간하여 유도된 것이고, 제2 가로 방향 보간 샘플(도 26의 b)은, 현재 분수 위치 샘플의 하단에 위치하는 정수 위치 샘플들(도 26의 C 및 D)을 보간하여 유도된 것일 수 있다. 이때, 각 정수 위치 샘플에 적용되는 가중치는, 정수 위치 샘플과 현재 분수 위치 샘플 사이의 수평 방향 거리(즉, x좌표 차분)에 기반하여 결정될 수 있다. 일 예로, 수학식 5는, 제1 가로 방향 보간 샘플 및 제2 가로 방향 보간 샘플이 유도되는 예를 나타낸다.When both the horizontal and vertical coordinates of the current fractional position sample are fractional positions, as in the example shown in FIG. 26, through horizontal interpolation, a first horizontally interpolated sample located in the vertical direction with the current fractional position sample and A second horizontal interpolation sample may be obtained. Here, the first horizontal interpolation sample (a in Figure 26) is derived by interpolating integer position samples (A and B in Figure 26) located at the top of the current fractional position sample, and the second horizontal interpolation sample (B in FIG. 26) may be derived by interpolating integer position samples (C and D in FIG. 26) located at the bottom of the current fractional position sample. At this time, the weight applied to each integer position sample may be determined based on the horizontal distance (i.e., x-coordinate difference) between the integer position sample and the current fractional position sample. As an example, Equation 5 represents an example in which the first horizontal interpolation sample and the second horizontal interpolation sample are derived.
Figure PCTKR2023010772-appb-img-000005
Figure PCTKR2023010772-appb-img-000005
이후, 가로 방향 보간을 통해 생성된 제1 가로 방향 보간 샘플 및 제2 가로 방향 보간 샘플에 대해, 세로 방향 보간을 통해, 현재 분수 위치 샘플을 획득할 수 있다. 이때, 제1 가로 방향 보간 샘플 및 제2 가로 방향 보간 샘플 각각에 적용되는 가중치는, 현재 분수 위치 샘플과의 수직 방향 거리(즉, y좌표 차분)에 의해 결정될 수 있다. 일 예로, 현재 분수 위치 샘플 p는, 다음의 수학식 6과 같이 유도될 수 있다. Thereafter, the current fractional position sample may be obtained through vertical interpolation for the first horizontal interpolation sample and the second horizontal interpolation sample generated through horizontal interpolation. At this time, the weight applied to each of the first horizontal interpolation sample and the second horizontal interpolation sample may be determined by the vertical distance (i.e., y-coordinate difference) from the current fractional position sample. As an example, the current fractional position sample p can be derived as in Equation 6 below.
Figure PCTKR2023010772-appb-img-000006
Figure PCTKR2023010772-appb-img-000006
상술한 예에서는, 가로 방향 보간 및 세로 방향 보간 순서로 연산을 수행하여, 현재 분수 위치 샘플을 유도하는 것으로 설명하였다. 설명한 바와 반대로, 세로 방향 보간 및 가로 방향 보간 순서로 연산을 수행하여, 현재 분수 위치 샘플을 유도할 수도 있다. 구체적으로, 제1 세로 방향 보간 샘플 및 제2 세로 방향 보간 샘플을 가로 방향으로 보간하여, 현재 분수 위치 샘플을 획득할 수 있다. 여기서, 제1 세로 방향 보간 샘플은, 현재 분수 위치 화소의 좌측에 위치하는 정수 위치 샘플들을 보간하여 획득되고, 제2 세로 방향 보간 샘플은, 현재 분수 위치 화소의 우측에 위치하는 정수 위치 샘플들을 보간하여 획득된 것일 수 있다. In the above example, it was explained that the current fractional position sample is derived by performing operations in the order of horizontal interpolation and vertical interpolation. Contrary to what has been described, the current fractional position sample may be derived by performing operations in the order of vertical interpolation and horizontal interpolation. Specifically, the first vertical interpolation sample and the second vertical interpolation sample may be interpolated in the horizontal direction to obtain a current fractional position sample. Here, the first vertical interpolation sample is obtained by interpolating integer position samples located to the left of the current fractional position pixel, and the second vertical interpolation sample is obtained by interpolating integer position samples located to the right of the current fractional position pixel. It may have been obtained through this.
상술한 보간 방법은, 참조 블록 내 분수 위치 샘플들 각각에 대해, 적용될 수 있고, 이에 따라, 분수 위치 샘플들로 구성된 참조 블록이 획득될 수 있다. The above-described interpolation method can be applied to each of the fractional position samples in the reference block, and thus a reference block composed of fractional position samples can be obtained.
도 26에서는, 양선형 보간 방식에 의해 분수 위치 샘플이 유도되는 것으로 설명하였다. 설명한 바와 달리, 큐빅 콘볼루션(Cubic Convolution) 보간법 과 같이 상이한 보간 방법을 적용하거나, 수학식 5 및 수학식 6과 상이한 보간 필터를 이용하여 분수 위치 샘플을 유도할 수도 있다. 일 예로, 수학식 5 및 수학식 6과 탭수 또는 필터 계수 중 적어도 하나가 상이한 보간 필터가 이용될 수 있다.In Figure 26, it is explained that fractional position samples are derived by a bilinear interpolation method. Unlike what has been described, fractional position samples may be derived by applying a different interpolation method, such as cubic convolution interpolation, or by using an interpolation filter different from Equation 5 and Equation 6. As an example, an interpolation filter that is different from Equation 5 and Equation 6 in at least one of the number of taps or filter coefficients may be used.
한편, 움직임 벡터의 정밀도(또는, 해상도), 현재 블록의 크기 또는 픽처 내 현재 블록의 위치 중 적어도 하나에 기반하여, 복수의 보간 필터들 중 하나를 선택할 수도 있다. 이때, 복수의 보간 필터들 각각은, 탭수 또는 필터 계수 중 적어도 하나가 다른 후보와 상이할 수 있다.Meanwhile, one of a plurality of interpolation filters may be selected based on at least one of the precision (or resolution) of the motion vector, the size of the current block, or the position of the current block in the picture. At this time, each of the plurality of interpolation filters may be different from other candidates in at least one of the number of taps or filter coefficients.
한편, 현재 블록의 움직임 벡터가 지시하는 분수 위치에 따라, 가로 방향 보간 및 세로 방향 보간 중 하나를 생략할 수도 있다. 일 예로, 현재 블록의 움직임 벡터의 수평 방향 성분(즉, x축 성분)은 정수값을 갖는 반면, 현재 블록의 움직임 벡터의 수직 방향 성분(즉, y축 성분)은 실수값을 갖는 경우, 가로 방향 보간을 생략하고, 현재 분수 위치 샘플의 상하단에 놓인 참조 샘플들의 세로 방향 보간을 통해, 현재 분수 위치 샘플을 유도할 수 있다. 또는, 현재 블록의 움직임 벡터의 수평 방향 성분(즉, x축 성분)은 실수값을 갖는 반면, 현재 블록의 움직임 벡터의 수직 방향 성분(즉, y축 성분)은 정수값을 갖는 경우, 세로 방향 보간을 생략하고, 현재 분수 위치 샘플의 좌우에 놓인 참조 샘플들의 가로 방향 보간을 통해, 현재 분수 위치 샘플을 유도할 수 있다.Meanwhile, depending on the fractional position indicated by the motion vector of the current block, one of horizontal interpolation and vertical interpolation may be omitted. As an example, if the horizontal component (i.e., x-axis component) of the motion vector of the current block has an integer value, while the vertical component (i.e., y-axis component) of the motion vector of the current block has a real value, Directional interpolation can be omitted, and the current fractional position sample can be derived through vertical interpolation of reference samples located at the top and bottom of the current fractional position sample. Alternatively, if the horizontal component (i.e., x-axis component) of the motion vector of the current block has a real value, while the vertical component (i.e., y-axis component) of the motion vector of the current block has an integer value, the vertical direction Interpolation is omitted, and the current fractional position sample can be derived through horizontal interpolation of reference samples located to the left and right of the current fractional position sample.
상술한 바와 같이, 현재 분수 위치 샘플로부터 수직 방향 또는 수평 방향에 위치하는 보간 샘플들을 보간하여 현재 분수 위치 샘플을 획득하는 것을 일반적인 보간 방법이라 호칭할 수 있다. As described above, obtaining a current fractional position sample by interpolating interpolation samples located in the vertical or horizontal direction from the current fractional position sample may be referred to as a general interpolation method.
한편, 현재 분수 위치 샘플로부터 수직 방향 또는 수평 방향에 위치하는 않은 보간 샘플들을 보간하여 현재 분수 위치 샘플을 획득할 수도 있다. 즉, 보간의 방향성에 따라, 현재 분수 위치 샘플을 생성하는데 이용되는 보간 샘플들을 위치가 가변적으로 결정될 수 있다. 위와 같이, 보간의 방향성에 따라, 현재 분수 위치 샘플을 생성하는데 이용되는 보간 샘플들의 위치가 가변적인 보간 방법을, 앵귤러(Augular) 보간 방법이라 호칭할 수 있다.Meanwhile, the current fractional position sample may be obtained by interpolating interpolation samples that are not located in the vertical or horizontal direction from the current fractional position sample. That is, depending on the direction of interpolation, the positions of the interpolation samples used to generate the current fractional position sample may be determined variably. As above, an interpolation method in which the positions of interpolation samples used to generate the current fractional position sample are variable depending on the direction of interpolation may be referred to as an angular interpolation method.
앵귤러 보간 방법을 이용할 것인지 여부를 나타내는 정보가 명시적으로 부호화되어 비트스트림을 통해 시그날링될 수 있다. 상기 정보가 앵귤러 보간 방법이 이용되지 않음을 나타내는 경우, 일반적인 보간 방법에 의해, 분수 위치 샘플이 유도될 수 있다.Information indicating whether to use the angular interpolation method may be explicitly encoded and signaled through the bitstream. If the above information indicates that an angular interpolation method is not used, fractional position samples may be derived by a general interpolation method.
또는, 현재 블록의 움직임 벡터가 지시하는 위치, 움직임 벡터에 의해 지시된 위치와 가장 가까운 정수 위치 또는 움직임 벡터가 가리키는 위치를 포함하는 참조 블록의 예측 정보에 기반하여, 앵귤러 보간 방법의 이용 여부가 결정될 수 있다. 일 예로, 현재 블록의 움직임 벡터가 가리키는 위치와 가장 가까운 정수 위치에서의 예측 정보가 인트라 예측을 가리키는 경우에는, 앵귤러 보간 방법이 이용될 수 있다. Alternatively, whether to use the angular interpolation method will be determined based on the position indicated by the motion vector of the current block, the integer position closest to the position indicated by the motion vector, or the prediction information of the reference block including the position indicated by the motion vector. You can. For example, if prediction information at the integer position closest to the position indicated by the motion vector of the current block indicates intra prediction, the angular interpolation method may be used.
이하, 앵귤러 보간 방법에 대해 상세히 설명하기로 한다.Hereinafter, the angular interpolation method will be described in detail.
앵귤러 보간의 방향성은, 현재 블록의 움직임 벡터가 지시하는 위치, 움직임 벡터에 의해 지시된 위치와 가장 가까운 정수 위치 또는 움직임 벡터의 정수 부분이 가리키는 위치를 포함하는 참조 블록의 인트라 예측 모드에 기반하여 결정될 수 있다. 여기서, 현재 블록의 움직임 벡터가 지시하는 위치는, 현재 블록의 좌상단 위치 또는 중앙 위치를 기준으로 결정될 수 있다. The directionality of angular interpolation may be determined based on the position indicated by the motion vector of the current block, the integer position closest to the position indicated by the motion vector, or the intra prediction mode of the reference block containing the position indicated by the integer portion of the motion vector. You can. Here, the position indicated by the motion vector of the current block may be determined based on the upper left position or center position of the current block.
일 예로, 참조 픽처 내 현재 블록의 좌상단 위치 또는 중앙 위치로부터 현재 블록의 움직임 벡터 만큼 이격된 위치(또는, 이 위치에 가장 근접하는 정수 위치)를 포함하는 참조 블록이 인트라 예측으로 부/복호화된 경우, 해당 블록의 인트라 예측 모드의 방향성을, 앵귤러 보간의 방향성으로 설정할 수 있다.As an example, when a reference block containing a position spaced from the upper left position or center position of the current block in the reference picture by the motion vector of the current block (or the integer position closest to this position) is encoded/decoded by intra prediction. , the direction of the intra prediction mode of the corresponding block can be set to the direction of angular interpolation.
또는, 참조 블록 내 특정 위치 샘플에 대한 예측 정보를 기반으로, 앵귤러 보간의 방향성을 결정할 수 있다. 여기서, 특정 위치 샘플은, 참조 블록 내 중앙 위치 샘플, 좌상단 코너 샘플, 우상단 코너 샘플, 좌하단 코너 샘플 또는 우하단 코너 샘플 중 적어도 하나를 포함할 수 있다. Alternatively, the direction of angular interpolation can be determined based on prediction information about a specific location sample within the reference block. Here, the specific location sample may include at least one of a center location sample within the reference block, an upper left corner sample, an upper right corner sample, a lower left corner sample, or a lower right corner sample.
일 예로, 참조 블록 내 중앙 위치(center)의 샘플에 저장된 예측 정보가 인터 예측인지 또는 인트라 예측인지 여부에 기반하여, 앵귤러 보간의 방향성을 결정할 수 있다. 중앙 위치의 샘플에 저장된 예측 정보가 인터 예측을 가리키는 경우, 앵귤러 보간에 대한 방향성은 비-방향성인 것으로 결정될 수 있다. 반면, 중앙 위치 샘플에 저장된 예측 정보가 인트라 예측을 가리키는 경우, 앵귤러 보간의 방향성은, 중앙 위치 샘플의 인트라 예측 모드의 방향성과 동일하게 설정될 수 있다.As an example, the direction of angular interpolation may be determined based on whether the prediction information stored in the sample at the center location (center) in the reference block is inter-prediction or intra-prediction. If the prediction information stored in the sample at the central location indicates inter prediction, the directionality for angular interpolation may be determined to be non-directional. On the other hand, when the prediction information stored in the central location sample indicates intra prediction, the direction of angular interpolation may be set to be the same as the directionality of the intra prediction mode of the central location sample.
가로 방향 보간 또는 세로 방향 보간을 통해, 앵귤러 보간의 방향성에 맞는 복수의 보간 샘플들을 획득할 수 있다. 이후, 보간 샘플들을 보간하여, 현재 분수 위치 샘플이 유도될 수 있다.Through horizontal interpolation or vertical interpolation, a plurality of interpolation samples that match the direction of angular interpolation can be obtained. Then, by interpolating the interpolation samples, the current fractional position sample can be derived.
도 27 및 도 28은 앵귤러 보간에 의해 현재 분수 위치 샘플이 유도되는 예를 나타낸 것이다.Figures 27 and 28 show examples in which the current fractional position sample is derived by angular interpolation.
현재 블록의 움직임 벡터에 의해 지시되는 위치가 인트라 예측으로 부호화된 경우, 해당 위치의 인트라 예측 모드의 방향성을, 앵귤로 보간의 방향성으로 설정할 수 있다. 도 27 및 도 28에서는, 앵귤러 보간의 방향성이 도 3의 47번 인트라 예측 모드와 동일하게 설정되는 것으로 예시되었다. If the position indicated by the motion vector of the current block is encoded by intra prediction, the direction of the intra prediction mode of the position can be set to the direction of angular interpolation. 27 and 28, the direction of angular interpolation is illustrated as being set to be the same as intra prediction mode No. 47 in FIG. 3.
이 경우, 현재 블록의 상단에 위치하는 정수 위치 샘플들(도 27의 A 및 B)을 보간하여, 현재 분수 위치 샘플과 동일한 각도선(Angular Line) 상에 놓인, 제1 가로 방향 보간 샘플(도 27의 a)을 획득할 수 있다. 여기서, 각도선은, 47번 인트라 예측 모드의 방향성에 부합하는 것일 수 있다.In this case, the integer position samples (A and B in Figure 27) located at the top of the current block are interpolated to produce the first horizontal interpolation sample (Figure 27), which lies on the same angular line as the current fractional position sample. You can obtain a) of 27. Here, the angle line may correspond to the directionality of intra prediction mode No. 47.
위와 유사하게, 현재 블록의 하단에 위치하는 정수 위치 샘플들(도 27의 C 및 D)을 보간하여, 현재 분수 위치 샘플과 동일한 각도선 상에 놓인, 제2 가로 방향 보간 샘플(도 27의 b)을 획득할 수 있다. Similar to above, the integer position samples located at the bottom of the current block (C and D in Figure 27) are interpolated to produce a second horizontally interpolated sample (Figure 27b), which lies on the same angle line as the current fractional position sample. ) can be obtained.
이후, 제1 가로 방향 보간 샘플 및 제2 가로 방향 보간 샘플을 보간하여, 현재 분수 위치 샘플(도 27의 p)를 유도할 수 있다. 이때, 제1 가로 방향 보간 샘플 및 제2 가로 방향 보간 샘플 각각에 부여되는 가중치는, 현재 분수 위치 샘플과의 거리(도 27의 d1 및 d2)를 기반으로 결정될 수 있다. Thereafter, the first horizontal interpolation sample and the second horizontal interpolation sample may be interpolated to derive the current fractional position sample (p in FIG. 27). At this time, the weight given to each of the first horizontal interpolation sample and the second horizontal interpolation sample may be determined based on the distance from the current fractional position sample (d1 and d2 in FIG. 27).
한편, 보간 과정에서, 샘플들 간의 거리를 나타내는 변수 w1, w2, w3, w4, d1 및 d2 등이 이용된다. 위 변수들은, 도 28에 도시된 예에서와 같이, 앵귤러 보간의 방향성에 따른 각도(θ)를 기반으로 유도될 수 있다. Meanwhile, in the interpolation process, variables w1, w2, w3, w4, d1, and d2 that represent the distance between samples are used. The above variables can be derived based on the angle (θ) according to the direction of angular interpolation, as in the example shown in FIG. 28.
한편, 도 10 및 도 11을 통해 설명한 바와 같이, 인트라 예측 모드의 방향성에 따른, tanθ 값이 부호화기 및 복호화기에서 기 정의되어 있을 수 있다. Meanwhile, as explained through FIGS. 10 and 11, the tanθ value according to the directionality of the intra prediction mode may be predefined in the encoder and decoder.
현재 블록의 움직임 벡터에 의해, 현재 분수 위치 샘플의 좌표가 결정되면, 현재 분수 위치 샘플로부터 상단 정수 위치 샘플 까지의 수직 방향 거리(h1) 및 현재 분수 위치 샘플로부터 하단 정수 위치 샘플 까지의 수직 방향 거리(h2)를 유도할 수 있다. 구체적으로, h1 및 h2를 합한 것은, 정수 위치 샘플들간의 거리를 나타내므로, h1 및 h2 중 하나가 유도되면, 다른 하나도 유도될 수 있다. If the coordinates of the current fractional position sample are determined by the motion vector of the current block, the vertical distance (h1) from the current fractional position sample to the upper integer position sample and the vertical distance from the current fractional position sample to the lower integer position sample (h2) can be derived. Specifically, the sum of h1 and h2 represents the distance between integer position samples, so if one of h1 and h2 is derived, the other can also be derived.
그리고 나서, 다음의 수학식 7에 기반하여, 현재 분수 위치 샘플과 제1 가로 방향 보간 샘플 까지의 수평 방향 거리(w5) 및 현재 분수 위치 샘플과 제2 가로 방향 보간 샘플 간의 수평 방향 거리(w6)가 유도될 수 있다. Then, based on the following Equation 7, the horizontal distance (w5) between the current fractional position sample and the first horizontal interpolation sample and the horizontal distance between the current fractional position sample and the second horizontal interpolation sample (w6) can be derived.
Figure PCTKR2023010772-appb-img-000007
Figure PCTKR2023010772-appb-img-000007
다음으로, 분수 위치 샘플과 좌측 정수 위치 샘플 사이의 수평 방향 거리(즉, 움직임 벡터의 실수 부분)에서, w5를 차분하여, 좌측 정수 위치 샘플로부터 제1 가로 방향 보간 샘플 까지의 거리(w1)을 유도할 수 있다. 또한, 좌측 정수 위치 샘플로부터 제1 가로 방향 보간 샘플까지의 거리(w1) 및 제1 가로 방향 보간 샘플로부터 우측 정수 위치 샘플까지의 거리(w2)의 합은 정수 위치 샘플들 간의 거리를 나타내므로, 정수 위치 샘플들 간의 거리로부터 w1을 차분하여, w2를 유도할 수 있다. Next, by differentiating w5 from the horizontal distance between the fractional position sample and the left integer position sample (i.e., the real part of the motion vector), we obtain the distance from the left integer position sample to the first horizontal interpolation sample (w1): It can be induced. In addition, the sum of the distance (w1) from the left integer position sample to the first horizontal interpolation sample and the distance (w2) from the first horizontal interpolation sample to the right integer position sample represents the distance between the integer position samples, By subtracting w1 from the distance between integer position samples, w2 can be derived.
또한, 다음으로, 분수 위치 샘플과 좌측 정수 위치 샘플 사이의 수평 방향 거리(즉, 움직임 벡터의 실수 부분)에서, w5를 가산하여, 좌측 정수 위치 샘플로부터 제2 가로 방향 보간 샘플 까지의 거리(w3)을 유도할 수 있다. 또한, 좌측 정수 위치 샘플로부터 제2 가로 방향 보간 샘플까지의 거리(w3) 및 제2 가로 방향 보간 샘플로부터 우측 정수 위치 샘플까지의 거리(w4)의 합은 정수 위치 샘플들 간의 거리를 나타내므로, 정수 위치 샘플들 간의 거리로부터 w3을 차분하여, w4를 유도할 수 있다. 위 변수들에 기반하여, 제1 가로 방향 보간 샘플 및 제2 가로 방향 보간 샘플은 다음의 수학식 8에 기반하여 유도될 수 있다.Additionally, w5 is then added to the horizontal distance between the fractional position sample and the left integer position sample (i.e., the real part of the motion vector) to obtain the distance from the left integer position sample to the second horizontal interpolation sample (w3 ) can be derived. In addition, the sum of the distance (w3) from the left integer position sample to the second horizontal interpolation sample and the distance (w4) from the second horizontal interpolation sample to the right integer position sample represents the distance between the integer position samples, By differentiating w3 from the distance between integer position samples, w4 can be derived. Based on the above variables, the first horizontal interpolation sample and the second horizontal interpolation sample can be derived based on Equation 8 below.
Figure PCTKR2023010772-appb-img-000008
Figure PCTKR2023010772-appb-img-000008
한편, 현재 분수 위치 샘플에서 제1 가로 방향 보간 샘플 까지의 거리(d1) 및 현재 분수 위치 샘플에서 제2 가로 방향 보간 샘플 까지의 거리(d2) 간의 비율은, 현재 분수 위치 샘플에서, 제1 가로 방향 보간 샘플 까지의 수직 방향 거리(h1) 및 현재 분수 위치 샘플에서 제2 가로 방향 보간 샘플 까지의 수직 방향 거리(h2) 간의 비율과 동일하다. 이에 따라, 현재 분수 위치 샘플은, 상술한 수학식 6에 따라 유도될 수 있다. Meanwhile, the ratio between the distance (d1) from the current fractional position sample to the first horizontal interpolation sample and the distance (d2) from the current fractional position sample to the second horizontal interpolation sample is, from the current fractional position sample, to the first horizontal interpolation sample. It is equal to the ratio between the vertical distance (h1) to the directional interpolation sample and the vertical distance (h2) from the current fractional position sample to the second horizontal interpolation sample. Accordingly, the current fractional position sample can be derived according to Equation 6 described above.
상술한 예에서는, 정수 위치 샘플들에 대한 가로 방향 보간을 수행함으로써 획득된 제1 가로 방향 보간 샘플 제2 가로 방향 보간 샘플을 세로 방향으로 보간함으로써, 현재 분수 위치 샘플이 획득되는 것으로 설명하였다. 도시된 바와 달리, 정수 위치 샘플들에 대한 세로 방향 보간을 수행함으로써 획득된 제1 세로 방향 보간 샘플 및 제2 세로 방향 보간 샘플을 가로 방향으로 보간함으로써, 현재 분수 위치 샘플을 획득할 수도 있다.In the above example, it has been described that the current fractional position sample is obtained by vertically interpolating the first horizontal interpolation sample and the second horizontal interpolation sample obtained by performing horizontal interpolation on integer position samples. Unlike shown, the current fractional position sample may be obtained by horizontally interpolating the first vertical interpolation sample and the second vertical interpolation sample obtained by performing vertical interpolation on integer position samples.
이때, 가로 방향 보간 및 세로 방향 보간 중 어느 것이 먼저 수행되는지는, 앵귤러 보간의 방향성에 기반하여 결정될 수 있다. 일 예로, 앵귤로 보간의 방향성이, 도 4에 도시된 좌상단 방향 및 우상단 방향 사이인 경우(즉, 34번 이상 내지 66번 이하의 범위), 정수 위치 샘플들을 가로 방향으로 보간함으로써 획득된 제1 가로 방향 보간 샘플 및 제2 가로 방향 보간 샘플을 세로 방향으로 보간하여, 현재 분수 위치 샘플을 획득할 수 있다. 앵귤러 보간의 방향성이, 도 4에 도시된 좌상단 방향 및 좌하단 방향 사이인 경우(즉, 2번 이상 내지 34번 미만의 범위), 정수 위치 샘플들을 세로 방향으로 보간함으로써 획득된 제2 세로 방향 보간 샘플 및 제2 세로 방향 보간 샘플을 가로 방향으로 보간하여, 현재 분수 위치 샘플을 획득할 수 있다. At this time, which of horizontal interpolation and vertical interpolation is performed first may be determined based on the direction of angular interpolation. As an example, when the direction of angular interpolation is between the upper-left direction and the upper-right direction shown in FIG. 4 (i.e., in the range of 34 or more to 66 or less), the first obtained by interpolating integer position samples in the horizontal direction The horizontal interpolation sample and the second horizontal interpolation sample may be vertically interpolated to obtain a current fractional position sample. When the direction of angular interpolation is between the upper-left direction and the lower-left direction shown in FIG. 4 (i.e., in the range of 2 or more to less than 34), second vertical interpolation obtained by interpolating integer position samples in the vertical direction. By horizontally interpolating the sample and the second vertically interpolated sample, a current fractional position sample may be obtained.
한편, 현재 블록의 움직임 벡터에 의해 지시되는 위치에 대응하는 인트라 예측 모드가 비방향성 모드(즉, DC 모드 또는 플래너 모드)인 경우, 도 25 및 도 26을 통해 설명한 바에 따라, 가로 방향 보간 및 세로 방향 보간을 통해, 현재 분수 위치 샘플이 획득될 수 있다.On the other hand, if the intra prediction mode corresponding to the position indicated by the motion vector of the current block is a non-directional mode (i.e., DC mode or planner mode), as described with reference to FIGS. 25 and 26, horizontal interpolation and vertical interpolation Through directional interpolation, current fractional position samples can be obtained.
또는, 현재 블록의 움직임 벡터에 의해 지시되는 위치를 포함하는 블록이 인트라 예측으로 부/복호화되지 않은 경우, 도 25 및 도 26을 통해 설명한 바에 따라, 가로 방향 보간 및 세로 방향 보간을 통해, 현재 분수 위치 샘플이 획득될 수 있다. Alternatively, if the block containing the position indicated by the motion vector of the current block is not encoded/decoded by intra prediction, the current fraction is obtained through horizontal interpolation and vertical interpolation, as described with reference to FIGS. 25 and 26. Location samples may be obtained.
다른 예로, 참조 픽처를 복수 영역들로 구획한 뒤, 구획된 영역들 각각에 대해 인트라 예측 모드를 결정할 수 있다. 구체적으로, 참조 픽처 내 구획된 영역에 대해, 인트라 예측 모드들 각각에 대한 비용을 산출한 뒤, 최적의 비용을 갖는 인트라 예측 모드를 결정할 수 있다. 여기서, 영역은, 정방형 또는 비정방 형태의 블록일 수 있다. 일 예로, 4x4, 8x8, 16x16, 32x32, 64x64 또는 128x128 크기의 블록일 수 있다. 참조 픽처 내 방향성 결정 대상인 영역을 참조 영역이라 호칭할 수 있고, 참조 영역 내 샘플을 참조 샘플이라 호칭할 수 있다. As another example, after partitioning a reference picture into multiple regions, an intra prediction mode can be determined for each of the partitioned regions. Specifically, for a partitioned area in a reference picture, the cost for each of the intra prediction modes can be calculated, and then the intra prediction mode with the optimal cost can be determined. Here, the area may be a square or non-square block. For example, it may be a block of size 4x4, 8x8, 16x16, 32x32, 64x64, or 128x128. An area subject to directionality determination within a reference picture may be referred to as a reference area, and a sample within the reference area may be referred to as a reference sample.
인트라 예측 모드에 대한 비용은, 참조 영역 내 예측 샘플들 및 복원 샘플들 간의 SAD(Sum of Absoulte Difference)일 수 있다. 구체적으로, 참조 영역에 인트라 예측 모드를 적용하였을 때 유도된 예측 샘플들과, 참조 영역의 복원 샘플들 간의 차분을 합하여, 인트라 예측 모드에 대한 비용을 산출할 수 있다. The cost for intra prediction mode may be the Sum of Absoulte Difference (SAD) between prediction samples and reconstruction samples in the reference region. Specifically, the cost for the intra prediction mode can be calculated by adding the difference between the prediction samples derived when the intra prediction mode is applied to the reference region and the reconstructed samples of the reference region.
부호화기 및 복호화기에 기 저장된 모든 인트라 예측 모드들에 대해 비용을 산출하는 대신, 기 정의된 인트라 예측 모드들에 대해서만, 비용을 산출할 수도 있다. 일 예로, 기 정의된 N개의 인트라 예측 모드들에 대해서만 비용을 산출하고, 기 정의된 N개의 인트라 예측 모드들 중 하나를 참조 영역의 인트라 예측 모드로 설정할 수 있다. 기 정의된 N개의 인트라 예측 모드들은, 수직 방향 모드, 수평 방향 모드, 좌상단 대각 방향 모드, 우상단 대각 방향 모드 또는 좌하단 대각 방향 모드 중 적어도 하나를 포함할 수 있다.Instead of calculating the cost for all intra prediction modes previously stored in the encoder and decoder, the cost may be calculated only for predefined intra prediction modes. For example, the cost may be calculated only for N predefined intra prediction modes, and one of the N predefined intra prediction modes may be set as the intra prediction mode of the reference region. The N predefined intra prediction modes may include at least one of a vertical mode, a horizontal mode, an upper left diagonal mode, an upper right diagonal mode, or a lower left diagonal mode.
복수의 인트라 예측 모드들 중 최적의 비용(즉, 가장 작은 비용)을 갖는 인트라 예측 모드를, 참조 영역의 인트라 예측 모드로 설정할 수 있다. 참조 픽처 내 참조 영역들 각각에 대한 인트라 예측 모드가 결정되면, 현재 블록의 움직임 벡터에 의해 지시되는 위치를 포함하는 참조 영역에 할당된 인트라 예측 모드의 방향성이, 앵귤러 보간의 방향성으로 설정될 수 있다. The intra prediction mode with the optimal cost (i.e., the smallest cost) among the plurality of intra prediction modes can be set as the intra prediction mode of the reference region. Once the intra prediction mode for each of the reference regions in the reference picture is determined, the direction of the intra prediction mode assigned to the reference region including the position indicated by the motion vector of the current block may be set to the direction of angular interpolation. .
현재 블록의 움직임 벡터에 의해 지시되는 위치를 포함하는 참조 영역에 대한 최적의 인트라 예측 모드가 비방향성 모드(즉, DC 모드 또는 플래너 모드)인 경우, 해당 참조 영역에 대응하는 앵귤러 보간의 방향성은 존재하지 않는 것으로 결정될 수 있다. 이 경우, 현재 분수 위치 샘플은, 도 25 및 도 26을 통해 설명한 바와 같이, 가로 방향 보간 및 세로 방향 보간을 수행함으로써 유도될 수 있다. If the optimal intra prediction mode for a reference region containing the position indicated by the motion vector of the current block is a non-directional mode (i.e. DC mode or planar mode), the directionality of angular interpolation corresponding to that reference region exists. It may be decided not to do it. In this case, the current fractional position sample can be derived by performing horizontal interpolation and vertical interpolation, as described with reference to FIGS. 25 and 26.
참조 영역에 대해, 인트라 예측 모드별로 비용을 산출하는 대신, 참조 영역에 대한 기울기(Gradient)에 기반하여, 참조 영역의 인트라 예측 모드를 결정할 수도 있다.For the reference region, instead of calculating the cost for each intra prediction mode, the intra prediction mode of the reference region may be determined based on the gradient for the reference region.
도 29는 참조 영역에 대한 기울기를 유도하는 예를 설명하기 위한 도면이다. Figure 29 is a diagram for explaining an example of deriving a slope with respect to a reference area.
도시된 예에서, 참조 영역은 8x8 크기인 것으로 가정한다.In the example shown, the reference area is assumed to be 8x8 in size.
마스크를 이용하여 영역 내 필터링 또는 컨볼루션을 수행할 수 있다. 상기 필터링 또는 컨볼루션은, 기울기 값을 출력할 수 있는 소벨 마스크 또는 프리윗 마스크 중 적어도 하나에 기반하여 수행될 수 있다. 이때, 수평 방향 및 수직 방향 각각에 대해 필터링 또는 컨볼루션이 수행될 수 있다. Filtering or convolution within a region can be performed using a mask. The filtering or convolution may be performed based on at least one of a Sobel mask or a Prewitt mask that can output a gradient value. At this time, filtering or convolution may be performed for each of the horizontal and vertical directions.
도 30은 소벨 마스크 및 프리윗 마스크 각각에 대한 수직 방향 및 수평 방향에 대한 마스킹 양상을 도시한 도면이다. Figure 30 is a diagram showing masking aspects in the vertical and horizontal directions for each of the Sobel mask and the Prewitt mask.
도 30에 도시된 것과 상이한 종류의 필터를 참조 영역에 적용할 수도 있다. 일 예로, 3x3 크기의 정사각형 필터 대신, 1x3 또는 3x1 크기의 1D 필터, 2x3 또는 2x3 크기의 직사각형 필터, 십자 형태 필터 또는 다이아몬드 형태 필터를 참조 영역에 적용할 수 있다. 또는, 도 14에 도시된 것과 상이한 크기의 필터(예컨대, 2x2, 4x4 또는 5x5 등)를 참조 영역에 적용할 수도 있다.A different type of filter from that shown in FIG. 30 may be applied to the reference area. For example, instead of a square filter with a size of 3x3, a 1D filter with a size of 1x3 or 3x1, a rectangular filter with a size of 2x3 or 2x3, a cross-shaped filter, or a diamond-shaped filter can be applied to the reference area. Alternatively, a filter of a different size from that shown in FIG. 14 (eg, 2x2, 4x4, or 5x5, etc.) may be applied to the reference area.
참조 영역에 적용되는 필터의 타입은 부호화기 및 복호화기에서 기 정의되어 있을 수 있다. The type of filter applied to the reference area may be predefined in the encoder and decoder.
또는, 복수의 필터 후보들을 기 정의한 뒤, 복수의 필터 후보들 중 하나를 가리키는 인덱스 정보를 부호화하여 비트스트림을 통해 명시적으로 시그날링할 수도 있다. Alternatively, after pre-defining a plurality of filter candidates, index information indicating one of the plurality of filter candidates may be encoded and explicitly signaled through a bitstream.
마스크를 수직 또는 수평 방향으로 1만큼 슬라이딩하면서, 참조 영역 내 참조 샘플들 각각에 대한 기울기를 획득할 수 있다. 구체적으로, 특정 참조 샘플을 중심으로 3x3 크기의 수직 마스크를 적용하여, 특정 참조 샘플에 대한 수직 방향 기울기 Dy를 획득하고, 특정 참조 샘플을 중심으로 3x3 크기의 수평 마스크를 적용하여, 특정 참조 샘플에 대한 수평 방향 기울기 Dx를 획득할 수 있다. By sliding the mask by 1 in the vertical or horizontal direction, the slope for each reference sample in the reference area can be obtained. Specifically, a vertical mask of size 3x3 is applied centering on a specific reference sample to obtain the vertical slope Dy for the specific reference sample, and a horizontal mask of size 3x3 is applied around the specific reference sample to obtain The horizontal slope Dx can be obtained.
한편, 3x3 크기의 마스크를 사용하는 경우, 참조 영역의 경계에 위치하는 참조 샘플에 대해서는, 참조 영역 바깥에 위치하는 샘플들이 마스킹 영역에 포함된다. 참조 영역 내 참조 샘플들만을 이용하기 위해, 도 29에 도시된 예에서와 같이, 참조 영역 내 경계에 위치하는 참조 샘플들에 대해서는 마스크를 적용하지 않을 수 있다. 즉, 3x3 크기의 마스크가 사용되는 경우, 8x8 블록 내 36개 참조 샘플들에 대해, 수직 방향 기울기 Dy 및 수평 방향 기울기 Dx의 값이 도출될 수 있다.Meanwhile, when using a 3x3 mask, for reference samples located on the border of the reference area, samples located outside the reference area are included in the masking area. In order to use only reference samples within the reference area, a mask may not be applied to reference samples located at the boundary within the reference area, as in the example shown in FIG. 29. That is, when a 3x3 sized mask is used, the values of the vertical slope Dy and the horizontal slope Dx can be derived for 36 reference samples in an 8x8 block.
참조 영역 내 기울기가 출력된 참조 샘플들 각각에 대해, 인트라 예측 모드 또는 인트라 예측 모드가 속하는 그룹 중 적어도 하나를 결정할 수 있다. 일 예로, 도 6에 도시된 인트라 예측 모드들을 복수개의 그룹들로 분류하였을 때, 참조 영역 내 참조 샘플의 인트라 예측 모드에 대응하는 인트라 예측 모드가 속하는 그룹을, 참조 샘플에 대한 인트라 예측 모드가 속하는 그룹으로 결정할 수 있다. For each of the reference samples for which the gradient within the reference area is output, at least one of the intra prediction mode or the group to which the intra prediction mode belongs may be determined. As an example, when the intra prediction modes shown in FIG. 6 are classified into a plurality of groups, the group to which the intra prediction mode corresponding to the intra prediction mode of the reference sample in the reference region belongs is called the group to which the intra prediction mode for the reference sample belongs. Decisions can be made as a group.
도 31은 인트라 예측 모드들이 복수개의 그룹들로 분류된 예를 나타낸 것이다. Figure 31 shows an example in which intra prediction modes are classified into a plurality of groups.
도 31에서는, 수평 방향 모드(18번), 대각 방향 모드(34번) 및 수직 방향 모드(50번)을 기준으로, 인트라 예측 모드들이 4개의 인트라 예측 모드 그룹들(a 내지 d)로 분류된 것으로 예시되었다. In Figure 31, the intra prediction modes are classified into four intra prediction mode groups (a to d) based on the horizontal mode (No. 18), the diagonal mode (No. 34), and the vertical mode (No. 50). This was exemplified.
도시된 예에서, 그룹 a 및 그룹 b는, 수평 방향 모드(18번)를 기준으로 대칭 구조이고, 그룹 c 및 그룹 d는, 수직 방향 모드(50번)를 기준으로 대칭 구조이다. In the illustrated example, group a and group b have a symmetrical structure with respect to the horizontal mode (no. 18), and group c and group d have a symmetrical structure with respect to the vertical mode (no. 50).
또한, 36번부터 66번 인트라 예측 모드의 각도는, 2번부터 34번 모드의 각도를 트랜스포즈한 것과 동일하다. Additionally, the angles of intra prediction modes 36 to 66 are the same as the transposed angles of modes 2 to 34.
참조 샘플의 인트라 예측 모드가 속하는 그룹은, 해당 샘플의 수직 방향 기울기 Dy 및 수평 방향 기울기 Dx의 절대값을 비교하여 결정될 수 있다. 일 예로, 참조 샘플의 수평 방향 기울기 Dx의 절대값이 수직 방향 기울기 Dy의 절대값보다 큰 경우, 해당 참조 샘플의 인트라 예측 모드는, 그룹 a 또는 그룹 b에 속할 수 있다.The group to which the intra prediction mode of the reference sample belongs can be determined by comparing the absolute values of the vertical slope Dy and the horizontal slope Dx of the corresponding sample. For example, when the absolute value of the horizontal slope Dx of the reference sample is greater than the absolute value of the vertical slope Dy, the intra prediction mode of the reference sample may belong to group a or group b.
이와 반대로, 참조 샘플의 수직 방향 기울기 Dy의 절대값이 수평 방향 기울기 Dx의 기울기보다 큰 경우, 해당 참조 샘플의 인트라 예측 모드는, 그룹 c 또는 그룹 d에 속할 수 있다. Conversely, if the absolute value of the vertical slope Dy of the reference sample is greater than the slope of the horizontal slope Dx, the intra prediction mode of the reference sample may belong to group c or group d.
표 3은, 수평 방향 기울기 Dx 및 수직 방향 기울기 Dy의 크기에 따라, 참조 샘플의 인트라 예측 모드가 속하는 그룹을 나타낸 것이다. Table 3 shows the group to which the intra prediction mode of the reference sample belongs according to the magnitude of the horizontal slope Dx and the vertical slope Dy.
if (|Dx| > |Dy|)if (|Dx| > |Dy|) ElseElse
Dx >= 0Dx >= 0 Dy >= 0Dy >= 0 bb Dx >= 0Dx >= 0 Dy >= 0Dy >= 0 cc
Dx < 0Dx < 0 Dy >= 0Dy >= 0 aa Dx < 0Dx < 0 Dy >= 0Dy >= 0 dd
Dx >= 0Dx >= 0 Dy < 0Dy < 0 aa Dx >= 0Dx >= 0 Dy < 0Dy < 0 dd
Dx < 0Dx < 0 Dy < 0Dy < 0 bb Dx < 0Dx < 0 Dy < 0Dy < 0 cc
참조 샘플의 수평 방향 기울기 Dx 및 수직 방향 기울기 Dy를 이용하여, 참조 샘플에 할당될 인트라 예측 모드의 기울기를 유도할 수 있다. 이를 위해, 아래 수학식 9에서와 같이, 수평 방향 기울기 및 수직 방향 기울기 사이의 비율을 나타내는 변수 R을 유도할 수 있다. Using the horizontal slope Dx and the vertical slope Dy of the reference sample, the slope of the intra prediction mode to be assigned to the reference sample can be derived. To this end, a variable R representing the ratio between the horizontal slope and the vertical slope can be derived, as shown in Equation 9 below.
Figure PCTKR2023010772-appb-img-000009
Figure PCTKR2023010772-appb-img-000009
수학식 9에 예시된 바와 같이, 수평 방향 기울기 Dx 및 수직 방향 기울기 Dy 중 절대값이 큰 것을 분모로 사용하여, 변수 R을 유도할 수 있다.As illustrated in Equation 9, the variable R can be derived by using the larger absolute value of the horizontal slope Dx and the vertical slope Dy as the denominator.
이후, 변수 R과 방향성 모드들 각각의 각도에 대한 탄젠트값(tanθ)을 비교하여, 참조 샘플의 인트라 예측 모드를 결정할 수 있다. 구체적으로, 변수 R과 동일한 탄젠트 값 또는 가장 유사한 탄젠트 값을 갖는 인트라 예측 모드가 참조 샘플에 할당될 수 있다.Thereafter, the intra prediction mode of the reference sample can be determined by comparing the variable R and the tangent value (tanθ) for each angle of the directional modes. Specifically, an intra prediction mode with the same tangent value or the most similar tangent value as the variable R may be assigned to the reference sample.
이때, 도 10 또는 도 11에 도시된 예에서와 같이, 방향성 모드들 각각의 각도에 대한 탄젠트 값이 스케일링된 상태로 부호화기 및 복호화기에 저장되어 있다면, 동일한 스케일링 팩터를 이용하여 변수 R을 스케일링하여, 참조 샘플의 인트라 예측 모드를 결정할 수 있다. At this time, as in the example shown in FIG. 10 or FIG. 11, if the tangent value for each angle of the directional modes is stored in the encoder and decoder in a scaled state, the variable R is scaled using the same scaling factor, The intra prediction mode of the reference sample can be determined.
다음으로, 참조 샘플들 각각의 진폭(Amplitude)를 유도할 수 있다. 진폭은, 다음의 수학식 10과 같이, 수평 방향 기울기 Dx의 절대값 및 수직 방향 기울기 Dy의 절대값의 합으로 유도될 수 있다.Next, the amplitude of each reference sample can be derived. The amplitude can be derived as the sum of the absolute value of the horizontal slope Dx and the absolute value of the vertical slope Dy, as shown in Equation 10 below.
Figure PCTKR2023010772-appb-img-000010
Figure PCTKR2023010772-appb-img-000010
다음으로, 인트라 예측 모드들 각각에 대해, 동일한 인트라 예측 모드가 할당된 참조 샘플들 각각의 진폭값을 누적할 수 있다.Next, for each of the intra prediction modes, the amplitude value of each reference sample to which the same intra prediction mode is assigned may be accumulated.
Figure PCTKR2023010772-appb-img-000011
Figure PCTKR2023010772-appb-img-000011
수학식 11에서, intra_mode는, 인트라 예측 모드를 나타낸다. 일 예로, 모드 번호가 N인 인트라 예측 모드에 대한 진폭 누적값은, 참조 영역 내 N번 모드가 할당된 참조 샘플들의 진폭값을 합하여 유도되고, 모드 번호가 M인 인트라 예측 모드에 대한 진폭 누적값은, 참조 영역 내 M번 모드가 할당된 참조 샘플들의 진폭값을 합하여 유도될 수 있다.In Equation 11, intra_mode represents the intra prediction mode. For example, the amplitude accumulation value for the intra prediction mode with mode number N is derived by summing the amplitude values of reference samples assigned to mode N in the reference region, and the amplitude accumulation value for the intra prediction mode with mode number M Can be derived by summing the amplitude values of reference samples assigned to mode M in the reference area.
진폭 누적값을 저장하는 버퍼는, 영역 단위로 초기화될 수 있다. 일 예로, 초기값(즉, 0)을 시작으로 하여, 참조 픽처 내 참조 영역에 대한 진폭 누적값이 산출될 수 있다. The buffer storing the amplitude accumulation value may be initialized in area units. As an example, starting from an initial value (i.e., 0), the amplitude accumulation value for the reference region within the reference picture may be calculated.
위 과정을 통해, 인트라 예측 모드들 각각에 대한 진폭 누적값을 기록한 히스토그램(histogram)이 유도되면, 히스토그램 내 진폭 누적값이 가장 큰 인트라 예측 모드를 선택할 수 있다. If a histogram recording the amplitude accumulation value for each of the intra prediction modes is derived through the above process, the intra prediction mode with the largest amplitude accumulation value in the histogram can be selected.
히스토그램으로부터 선택된 인트라 예측 모드를, 참조 영역의 인트라 예측 모드로 설정할 수 있다. 이후, 현재 블록의 움직임 벡터에 의해 지시된 참조 영역의 방향성을, 앵귤러 보간의 방향성으로 설정할 수 있다. The intra prediction mode selected from the histogram can be set as the intra prediction mode of the reference area. Afterwards, the direction of the reference area indicated by the motion vector of the current block can be set to the direction of angular interpolation.
한편, 참조 픽처 내 모든 참조 영역들에 대해 인트라 예측 모드를 결정하는 대신, 참조 픽처 내 현재 블록의 움직임 벡터에 의해 지시된 위치를 포함하는 참조 블록에 대해서만, 인트라 예측 모드를 결정할 수도 있다. Meanwhile, instead of determining the intra prediction mode for all reference regions in the reference picture, the intra prediction mode may be determined only for the reference block including the position indicated by the motion vector of the current block in the reference picture.
또는, 참조 블록을 복수의 서브 블록들로 구획한 뒤, 서브 블록별로 인트라 예측 모드를 결정할 수도 있다. 이 경우, 서브 블록 단위로, 앵귤러 보간의 방향성이 상이할 수 있다.Alternatively, the reference block may be partitioned into a plurality of sub-blocks and then the intra prediction mode may be determined for each sub-block. In this case, the direction of angular interpolation may be different on a sub-block basis.
한편, 루마 성분 및 크로마 성분 각각에 대해, 앵귤러 보간의 방향성을 결정할 수 있다. Meanwhile, the direction of angular interpolation can be determined for each luma component and chroma component.
또는, 루마 성분의 앵귤러 보간의 방향성과 동일하게, 크로마 성분의 앵귤러 보간의 방향성이 설정될 수도 있다. 구체적으로, 코딩 순서에 따라, 먼저 부호화/복호화된 성분의 방향성을, 나중에 부호화/복호화되는 성분에 대해 재사용할 수 있다. 일 예로, Y, Cb 및 Cr 순서로 부호화/복호화가 진행되는 경우, 참조 픽처 내 Y 성분에 대한 참조 영역들 각각에 대한 인트라 예측 모드를, 참조 픽처 내 Cb 성분 또는 Cr 성분에 대한 참조 영역들 각각에 재사용할 수 있다. Alternatively, the direction of angular interpolation of the chroma component may be set to be the same as the direction of angular interpolation of the luma component. Specifically, according to the coding order, the direction of the component encoded/decoded first can be reused for the component encoded/decoded later. For example, when encoding/decoding is performed in the order of Y, Cb, and Cr, the intra prediction mode for each of the reference regions for the Y component in the reference picture is set to the intra prediction mode for each of the reference regions for the Cb component or Cr component in the reference picture. can be reused.
상술한 예에서는, 양선형 보간을 통해 현재 분수 위치 샘플이 유도되는 것으로 가정하였다. 설명한 예와 달리, 고차수 보간법을 통해 현재 분수 위치 샘플을 유도할 수도 있다. 일 예로, 도 28에 도시된 예에서, 제1 가로 방향 보간 샘플 및 제2 가로 방향 보간 샘플을 유도하기 위해, 큐빅 컨볼루션(Cubic-convolution) 보간법, B-spline 보간법 또는 가우시안 보간법을 이용할 수 있다. 한편, 정수 위치 샘플들을 보간하여 획득된 보간 샘플들(예컨대, 제1 가로 방향 보간 샘플 및 제2 가로 방향 보간 샘플)을 보간하는 경우에는, 그대로 양선형 보간을 사용하도록 설정할 수도 있다.In the above-described example, it was assumed that the current fractional position sample is derived through bilinear interpolation. Unlike the examples described, it is also possible to derive current fractional position samples through higher-order interpolation. For example, in the example shown in FIG. 28, cubic-convolution interpolation, B-spline interpolation, or Gaussian interpolation may be used to derive the first horizontal interpolation sample and the second horizontal interpolation sample. . Meanwhile, when interpolating interpolation samples (eg, first horizontal interpolation sample and second horizontal interpolation sample) obtained by interpolating integer position samples, bilinear interpolation may be set to be used as is.
상술한 실시예들에서 사용된 신택스들의 명칭은, 설명의 편의를 위해 명명된 것에 불과하다.The names of syntaxes used in the above-described embodiments are merely named for convenience of explanation.
복호화 과정 또는 부호화 과정을 중심으로 설명된 실시예들을, 부호화 과정 또는 복호화 과정에 적용하는 것은, 본 발명의 범주에 포함되는 것이다. 소정의 순서로 설명된 실시예들을, 설명된 것과 상이한 순서로 변경하는 것 역시, 본 발명의 범주에 포함되는 것이다.Applying the embodiments described with a focus on the decoding process or encoding process to the encoding process or decoding process is included in the scope of the present invention. Modification of the embodiments described in the given order to an order different from that described is also within the scope of the present invention.
상술한 실시예는 일련의 단계 또는 순서도를 기초로 설명되고 있으나, 이는 발명의 시계열적 순서를 한정한 것은 아니며, 필요에 따라 동시에 수행되거나 다른 순서로 수행될 수 있다. 또한, 상술한 실시예에서 블록도를 구성하는 구성요소(예를 들어, 유닛, 모듈 등) 각각은 하드웨어 장치 또는 소프트웨어로 구현될 수도 있고, 복수의 구성요소가 결합하여 하나의 하드웨어 장치 또는 소프트웨어로 구현될 수도 있다. 상술한 실시예는 다양한 컴퓨터 구성요소를 통하여 수행될 수 있는 프로그램 명령어의 형태로 구현되어 컴퓨터 판독 가능한 기록 매체에 기록될 수 있다. 상기 컴퓨터 판독 가능한 기록 매체는 프로그램 명령어, 데이터 파일, 데이터 구조 등을 단독으로 또는 조합하여 포함할 수 있다. 컴퓨터 판독 가능한 기록 매체의 예에는, 하드 디스크, 플로피 디스크 및 자기 테이프와 같은 자기 매체, CD-ROM, DVD와 같은 광기록 매체, 플롭티컬 디스크(floptical disk)와 같은 자기-광 매체(magneto-optical media), 및 ROM, RAM, 플래시 메모리 등과 같은 프로그램 명령어를 저장하고 수행하도록 특별히 구성된 하드웨어 장치가 포함된다. 상기 하드웨어 장치는 본 발명에 따른 처리를 수행하기 위해 하나 이상의 소프트웨어 모듈로서 작동하도록 구성될 수 있으며, 그 역도 마찬가지이다.Although the above-described embodiments are explained based on a series of steps or flowcharts, this does not limit the chronological order of the invention, and may be performed simultaneously or in a different order as needed. Additionally, in the above-described embodiment, each of the components (e.g., units, modules, etc.) constituting the block diagram may be implemented as a hardware device or software, and a plurality of components may be combined to form a single hardware device or software. It may be implemented. The above-described embodiments may be implemented in the form of program instructions that can be executed through various computer components and recorded on a computer-readable recording medium. The computer-readable recording medium may include program instructions, data files, data structures, etc., singly or in combination. Examples of computer-readable recording media include magnetic media such as hard disks, floppy disks and magnetic tapes, optical recording media such as CD-ROMs and DVDs, and magneto-optical media such as floptical disks. media), and hardware devices specifically configured to store and perform program instructions, such as ROM, RAM, flash memory, etc. The hardware device may be configured to operate as one or more software modules to perform processing according to the invention and vice versa.
본 개시를 통한 실시예들은 영상을 부호화 또는 복호화하는 전자기기에 적용될 수 있다. Embodiments through this disclosure can be applied to electronic devices that encode or decode images.

Claims (15)

  1. 현재 블록의 움직임 벡터를 유도하는 단계; 및Deriving a motion vector of the current block; and
    상기 움직임 벡터에 기반하여, 참조 픽처로부터 상기 현재 블록의 예측 샘플을 획득하는 단계를 포함하고,Based on the motion vector, obtaining a prediction sample of the current block from a reference picture,
    상기 참조 픽처 내 상기 움직임 벡터가 지시하는 위치가 분수 위치인 경우, 상기 예측 샘플은, 상기 참조 픽처 내 정수 위치 샘플들을 보간하여 획득되는 제1 보간 샘플 및 제2 보간 샘플을 보간함으로써 획득되는 분수 위치 샘플로 설정되고,When the position indicated by the motion vector in the reference picture is a fractional position, the prediction sample is a fractional position obtained by interpolating a first interpolation sample and a second interpolation sample obtained by interpolating integer position samples in the reference picture. set as a sample,
    상기 제1 보간 샘플 및 제2 보간 샘플의 위치는, 보간의 방향성에 의해 결정되는 것을 특징으로 하는, 영상 복호화 방법.An image decoding method, wherein the positions of the first and second interpolation samples are determined by the direction of interpolation.
  2. 제1 항에 있어서,According to claim 1,
    상기 제1 보간 샘플 및 상기 제2 보간 샘플은, 상기 분수 위치 샘플을 지나는 각도선 상에 놓인 것을 특징으로 하고, wherein the first interpolation sample and the second interpolation sample lie on an angular line passing through the fractional position sample,
    상기 각도선은, 상기 보간의 방향성에 대응하는 것을 특징으로 하는, 영상 복호화 방법. The video decoding method, characterized in that the angle line corresponds to the direction of the interpolation.
  3. 제1 항에 있어서,According to claim 1,
    상기 보간의 방향성은, 상기 움직임 벡터가 지시하는 위치를 포함하는 참조 블록의 예측 정보를 기반으로 결정되는 것을 특징으로 하는, 영상 복호화 방법.The direction of interpolation is determined based on prediction information of a reference block including the position indicated by the motion vector.
  4. 제3 항에 있어서,According to clause 3,
    상기 참조 블록이 인트라 예측으로 부호화된 경우, 상기 보간의 방향성은, 상기 참조 블록의 인트라 예측 모드의 방향성과 동일한 것을 특징으로 하는, 영상 복호화 방법.When the reference block is encoded by intra prediction, the direction of interpolation is the same as the direction of the intra prediction mode of the reference block.
  5. 제3 항에 있어서,According to clause 3,
    상기 예측 정보는, 인트라 예측 모드를 포함하고,The prediction information includes an intra prediction mode,
    상기 참조 블록의 상기 인트라 예측 모드는, 복수의 인트라 예측 모드 후보들에 대한 비용을 기반으로 결정되는 것을 특징으로 하는, 영상 복호화 방법.The intra prediction mode of the reference block is determined based on costs for a plurality of intra prediction mode candidates.
  6. 제5 항에 있어서,According to clause 5,
    인트라 예측 모드 후보에 대한 비용은, 상기 참조 블록에 대해 상기 인트라 예측 모드를 기반으로 인트라 예측을 적용함으로써 획득된 예측 샘플과 상기 참조 블록 내 복원 샘플 사이의 차분값을 기반으로 획득되는 것을 특징으로 하는, 영상 복호화 방법. The cost for an intra prediction mode candidate is obtained based on a difference value between a prediction sample obtained by applying intra prediction based on the intra prediction mode to the reference block and a restored sample within the reference block. , Video decoding method.
  7. 제5 항에 있어서,According to clause 5,
    상기 복수의 인트라 예측 모드 후보들은, 수직 방향 모드, 수평 방향 모드, 좌상단 대각 방향 모드, 우상단 대각 방향 모드 또는 좌하단 대각 방향 모드 중 적어도 하나를 포함하는 것을 특징으로 하는, 영상 복호화 방법.The plurality of intra prediction mode candidates include at least one of a vertical mode, a horizontal mode, an upper left diagonal mode, an upper right diagonal mode, and a lower left diagonal mode.
  8. 제3 항에 있어서,According to clause 3,
    상기 참조 블록이 인트라 예측으로 부호화되지 않은 경우, 상기 제1 보간 샘플 및 상기 제2 보간 샘플은, 상기 현재 분수 위치 샘플로부터 수직 또는 수평 방향에 놓인 것을 특징으로 하는, 영상 복호화 방법.When the reference block is not encoded by intra prediction, the first interpolation sample and the second interpolation sample are located in a vertical or horizontal direction from the current fractional position sample.
  9. 제3 항에 있어서,According to clause 3,
    상기 현재 블록의 루마 성분에 대해서는, 상기 참조 블록의 예측 정보에 기반하여, 상기 보간의 방향성이 결정되고,For the luma component of the current block, the direction of interpolation is determined based on prediction information of the reference block,
    상기 현재 블록의 크로마 성분에 대해서는, 상기 루마 성분에 대한 보간의 방향성이 재사용되는 것을 특징으로 하는, 영상 복호화 방법.An image decoding method, characterized in that, for the chroma component of the current block, the direction of interpolation for the luma component is reused.
  10. 현재 블록의 움직임 벡터를 유도하는 단계; 및Deriving a motion vector of the current block; and
    상기 움직임 벡터에 기반하여, 참조 픽처로부터 상기 현재 블록의 예측 샘플을 획득하는 단계를 포함하고,Based on the motion vector, obtaining a prediction sample of the current block from a reference picture,
    상기 참조 픽처 내 상기 움직임 벡터가 지시하는 위치가 분수 위치인 경우, 상기 예측 샘플은, 상기 참조 픽처 내 정수 위치 샘플들을 보간하여 획득되는 제1 보간 샘플 및 제2 보간 샘플을 보간함으로써 획득되는 분수 위치 샘플로 설정되고,When the position indicated by the motion vector in the reference picture is a fractional position, the prediction sample is a fractional position obtained by interpolating a first interpolation sample and a second interpolation sample obtained by interpolating integer position samples in the reference picture. set as a sample,
    상기 제1 보간 샘플 및 제2 보간 샘플의 위치는, 보간의 방향성에 의해 결정되는 것을 특징으로 하는, 영상 부호화 방법.An image encoding method, wherein the positions of the first and second interpolation samples are determined by the direction of interpolation.
  11. 제10 항에 있어서,According to claim 10,
    상기 제1 보간 샘플 및 상기 제2 보간 샘플은, 상기 분수 위치 샘플을 지나는 각도선 상에 놓인 것을 특징으로 하고, wherein the first interpolation sample and the second interpolation sample lie on an angular line passing through the fractional position sample,
    상기 각도선은, 상기 보간의 방향성에 대응하는 것을 특징으로 하는, 영상 부호화 방법. The video encoding method, characterized in that the angle line corresponds to the direction of the interpolation.
  12. 제10 항에 있어서,According to claim 10,
    상기 보간의 방향성은, 상기 움직임 벡터가 지시하는 위치를 포함하는 참조 블록의 예측 정보를 기반으로 결정되는 것을 특징으로 하는, 영상 부호화 방법.The direction of interpolation is determined based on prediction information of a reference block including the position indicated by the motion vector.
  13. 제12 항에 있어서,According to claim 12,
    상기 참조 블록이 인트라 예측으로 부호화된 경우, 상기 보간의 방향성은, 상기 참조 블록의 인트라 예측 모드의 방향성과 동일한 것을 특징으로 하는, 영상 부호화 방법.When the reference block is encoded by intra prediction, the direction of interpolation is the same as the direction of the intra prediction mode of the reference block.
  14. 제12 항에 있어서,According to claim 12,
    상기 예측 정보는, 인트라 예측 모드를 포함하고,The prediction information includes an intra prediction mode,
    상기 참조 블록의 상기 인트라 예측 모드는, 복수의 인트라 예측 모드 후보들에 대한 비용을 기반으로 결정되는 것을 특징으로 하는, 영상 부호화 방법.The intra prediction mode of the reference block is determined based on costs for a plurality of intra prediction mode candidates.
  15. 현재 블록의 움직임 벡터를 유도하는 단계; 및Deriving a motion vector of the current block; and
    상기 움직임 벡터에 기반하여, 참조 픽처로부터 상기 현재 블록의 예측 샘플을 획득하는 단계를 포함하고,Based on the motion vector, obtaining a prediction sample of the current block from a reference picture,
    상기 참조 픽처 내 상기 움직임 벡터가 지시하는 위치가 분수 위치인 경우, 상기 예측 샘플은, 상기 참조 픽처 내 정수 위치 샘플들을 보간하여 획득되는 제1 보간 샘플 및 제2 보간 샘플을 보간함으로써 획득되는 분수 위치 샘플로 설정되고,When the position indicated by the motion vector in the reference picture is a fractional position, the prediction sample is a fractional position obtained by interpolating a first interpolation sample and a second interpolation sample obtained by interpolating integer position samples in the reference picture. set as a sample,
    상기 제1 보간 샘플 및 제2 보간 샘플의 위치는, 보간의 방향성에 의해 결정되는 것을 특징으로 하는, 영상 부호화 방법에 의해 부호화된 비트스트림을 저장하는 컴퓨터로 판독 가능한 기록 매체.A computer-readable recording medium storing a bitstream encoded by an image encoding method, wherein the positions of the first interpolation sample and the second interpolation sample are determined by the direction of interpolation.
PCT/KR2023/010772 2022-07-25 2023-07-25 Image encoding/decoding method and recording medium storing bitstream WO2024025316A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
KR10-2022-0091985 2022-07-25
KR20220091985 2022-07-25

Publications (1)

Publication Number Publication Date
WO2024025316A1 true WO2024025316A1 (en) 2024-02-01

Family

ID=89706931

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/KR2023/010772 WO2024025316A1 (en) 2022-07-25 2023-07-25 Image encoding/decoding method and recording medium storing bitstream

Country Status (2)

Country Link
KR (1) KR20240014456A (en)
WO (1) WO2024025316A1 (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20180041211A (en) * 2015-09-10 2018-04-23 엘지전자 주식회사 Image processing method based on inter-intra merging prediction mode and apparatus therefor
US20210195174A1 (en) * 2016-09-20 2021-06-24 Kt Corporation Method and apparatus for processing video signal
JP2021122146A (en) * 2016-10-11 2021-08-26 エルジー エレクトロニクス インコーポレイティド Image decoding method and apparatus relying on intra prediction in image coding system
JP2021175090A (en) * 2020-04-24 2021-11-01 日本放送協会 Image encoding device, image decoding device and program for these
AU2021201808B2 (en) * 2017-05-31 2022-05-12 Lg Electronics Inc. Method and device for performing image decoding on basis of intra prediction in image coding system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20180041211A (en) * 2015-09-10 2018-04-23 엘지전자 주식회사 Image processing method based on inter-intra merging prediction mode and apparatus therefor
US20210195174A1 (en) * 2016-09-20 2021-06-24 Kt Corporation Method and apparatus for processing video signal
JP2021122146A (en) * 2016-10-11 2021-08-26 エルジー エレクトロニクス インコーポレイティド Image decoding method and apparatus relying on intra prediction in image coding system
AU2021201808B2 (en) * 2017-05-31 2022-05-12 Lg Electronics Inc. Method and device for performing image decoding on basis of intra prediction in image coding system
JP2021175090A (en) * 2020-04-24 2021-11-01 日本放送協会 Image encoding device, image decoding device and program for these

Also Published As

Publication number Publication date
KR20240014456A (en) 2024-02-01

Similar Documents

Publication Publication Date Title
WO2017204532A1 (en) Image encoding/decoding method and recording medium for same
WO2017171370A1 (en) Method and apparatus for processing video signal
WO2017176030A1 (en) Method and apparatus for processing video signal
WO2018026118A1 (en) Image encoding/decoding method
WO2018026219A1 (en) Video signal processing method and device
WO2018066867A1 (en) Method and apparatus for encoding and decoding image, and recording medium for storing bitstream
WO2020096389A1 (en) Image signal encoding/decoding method and apparatus therefor
WO2018012851A1 (en) Image encoding/decoding method and recording medium therefor
WO2018030773A1 (en) Method and apparatus for image encoding/decoding
WO2019182385A1 (en) Image encoding/decoding method and device, and recording medium in which bitstream is stored
WO2018047995A1 (en) Intra-prediction mode-based image processing method and apparatus therefor
WO2020256442A1 (en) Method for encoding/decoding image signal and apparatus therefor
WO2019050292A1 (en) Method and device for processing video signal
WO2020096428A1 (en) Method for encoding/decoding image signal and device therefor
WO2019050291A1 (en) Method and device for processing video signal
WO2018056701A1 (en) Method and apparatus for processing video signal
WO2020213963A1 (en) Method for encoding/decoding image signal, and device for same
WO2020184979A1 (en) Method for encoding/decoding image signal, and device therefor
WO2020060327A1 (en) Image signal encoding/decoding method and device therefor
WO2019225994A1 (en) Method and apparatus for processing video signal
WO2019190199A1 (en) Video signal processing method and device
WO2020096427A1 (en) Image signal encoding/decoding method and apparatus therefor
WO2020004978A1 (en) Method and apparatus for processing video signal
WO2021040321A1 (en) Image signal encoding/decoding method and apparatus therefor
WO2020141904A1 (en) Image signal encoding/decoding method and device for same

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

Country of ref document: EP

Kind code of ref document: A1