WO2026023972A1 - 비디오 신호 처리 방법 및 이를 위한 장치 - Google Patents

비디오 신호 처리 방법 및 이를 위한 장치

Info

Publication number
WO2026023972A1
WO2026023972A1 PCT/KR2025/010290 KR2025010290W WO2026023972A1 WO 2026023972 A1 WO2026023972 A1 WO 2026023972A1 KR 2025010290 W KR2025010290 W KR 2025010290W WO 2026023972 A1 WO2026023972 A1 WO 2026023972A1
Authority
WO
WIPO (PCT)
Prior art keywords
block
prediction
mode
current block
video signal
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
PCT/KR2025/010290
Other languages
English (en)
French (fr)
Inventor
김경용
손주형
곽진삼
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wilus Institute of Standards and Technology Inc
Original Assignee
Wilus Institute of Standards and Technology Inc
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 Wilus Institute of Standards and Technology Inc filed Critical Wilus Institute of Standards and Technology Inc
Publication of WO2026023972A1 publication Critical patent/WO2026023972A1/ko
Pending legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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/117Filters, e.g. for pre-processing or post-processing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/119Adaptive subdivision aspects, e.g. subdivision of a picture into rectangular or non-rectangular coding blocks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/136Incoming video signal characteristics or properties
    • H04N19/137Motion inside a coding unit, e.g. average field, frame or block difference
    • H04N19/139Analysis of motion vectors, e.g. their magnitude, direction, variance or reliability
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • H04N19/176Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a block, e.g. a macroblock
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/503Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal prediction
    • H04N19/51Motion estimation or motion compensation
    • H04N19/523Motion estimation or motion compensation with sub-pixel accuracy
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/503Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal prediction
    • H04N19/51Motion estimation or motion compensation
    • H04N19/583Motion compensation with overlapping blocks
    • 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

Definitions

  • the present invention relates to a method and device for processing a video signal, and more particularly, to a method and device for processing a video signal for encoding or decoding a video signal.
  • Compression coding refers to a series of signal processing techniques for transmitting digitized information over communication lines or storing it in a format suitable for storage media.
  • Objects subject to compression coding include audio, video, and text, and the technology that performs compression coding on video in particular is called video compression.
  • Compression coding of video signals is achieved by removing redundant information by considering spatial, temporal, and probabilistic correlations.
  • the purpose of this specification is to provide a video signal processing method and a device therefor to improve the coding efficiency of a video signal.
  • a video signal decoding device includes a processor.
  • the processor generates a mixed vector based on a block vector for a current block and motion information for the current block, and generates a predicted block for the current block using the mixed vector.
  • the above mixed vector may include a block vector indicated by block vector information for the current block and a motion vector indicated by motion information for the current block.
  • the processor may obtain a first prediction block based on the block vector, obtain a second prediction block based on the motion vector, and then perform a weighted average of the first prediction block and the second prediction block to generate a prediction block for the current block.
  • the processor can construct a mixed vector list using block vector information derived from a first surrounding block of the current block and motion information derived from a second surrounding block of the current block, and obtain a block vector for the current block and motion information for the current block from the mixed vector list.
  • the above processor can derive a block vector from a reference block of a reference picture indicated by motion information of a surrounding block of the current block.
  • the processor can determine whether to use information of a block surrounding the current block as a candidate of the mixed vector candidate list according to an encoding mode of the block surrounding the current block.
  • a video signal decoding device includes a processor.
  • the processor generates a first prediction block using first motion information of a current block, generates a second prediction block using neighboring blocks of the current block and an intra prediction mode derived from the neighboring blocks, and generates a final prediction block by weighting the first prediction block and the second prediction block.
  • the processor may generate the second prediction block using a decoder side intra mode derivation (DIMD) mode derived using restored samples of the surrounding blocks.
  • DIMD decoder side intra mode derivation
  • the above processor may not use intrafusion when generating the second prediction block.
  • the above processor may not use PDPC (position dependent intra prediction combination) when generating the second prediction block.
  • PDPC position dependent intra prediction combination
  • the above processor can perform filtering on the final prediction block.
  • a video signal encoding device includes a processor.
  • the processor generates a mixture vector based on a block vector for a current block and motion information for the current block, and generates a prediction block for the current block using the mixture vector.
  • the above mixed vector may include a block vector indicated by block vector information for the current block and a motion vector indicated by motion information for the current block.
  • the processor may obtain a first prediction block based on the block vector, obtain a second prediction block based on the motion vector, and then perform a weighted average of the first prediction block and the second prediction block to generate a prediction block for the current block.
  • the processor can construct a mixed vector list using block vector information derived from a first surrounding block of the current block and motion information derived from a second surrounding block of the current block, and obtain a block vector for the current block and motion information for the current block from the mixed vector list.
  • the above processor can derive a block vector from a reference block of a reference picture indicated by motion information of a surrounding block of the current block.
  • the processor can generate the second prediction block using a decoder side intra mode derivation (DIMD) mode derived using restored samples of the surrounding blocks.
  • DIMD decoder side intra mode derivation
  • a bitstream is disclosed, which is included in a storage medium and includes a video signal.
  • a method of generating a bitstream includes the steps of: generating a first prediction block using first motion information of a current block; generating a second prediction block using neighboring blocks of the current block and intra-prediction modes derived from the neighboring blocks; and generating a final prediction block by weighting the first prediction block and the second prediction block.
  • This specification provides a method for efficiently processing a video signal.
  • FIG. 1 is a schematic block diagram of a video signal encoding device according to one embodiment of the present specification.
  • FIG. 2 is a schematic block diagram of a video signal decoding device according to one embodiment of the present specification.
  • Figure 3 illustrates an embodiment in which a coding tree unit within a picture is divided into coding units.
  • FIG. 14 illustrates how a current block is encoded in IBC-CIIP mode according to one embodiment of the present specification.
  • FIG. 17 illustrates a transformation set table for LFNST and NSPT transformations according to one embodiment of the present specification.
  • Figure 52 shows a matrix-based intra prediction method according to an embodiment of the present invention.
  • FIG. 56 illustrates a search method for obtaining a cost value related to corrected motion information of a coding block according to one embodiment of the present specification.
  • FIG. 61 and FIG. 62 illustrate a method for performing correction of motion information based on BDOF according to one embodiment of the present specification.
  • FIG. 75 illustrates a method for deriving TMVP motion candidates according to one embodiment of the present specification.
  • FIG. 76 illustrates a method for deriving a TMVP based on a motion shift candidate list according to one embodiment of the present specification.
  • FIG. 77 illustrates a method for reordering a motion candidate list using template cost according to one embodiment of the present specification.
  • FIGS. 79 and 80 illustrate a method for deriving affine candidates from a history parameter-based affine model according to one embodiment of the present disclosure.
  • FIG. 81 illustrates the locations of non-adjacent surrounding blocks according to one embodiment of the present specification.
  • Figure 82 illustrates a method for deriving automatic relocation motion candidates according to one embodiment of the present specification.
  • FIG. 84 shows a video signal processing device according to an embodiment of the present invention deriving automatic rearrangement motion information from temporal surrounding blocks.
  • FIG. 86 shows a video signal processing device according to an embodiment of the present invention predicting a current block using a mixed vector.
  • FIG. 87 illustrates a method for signaling whether automatic repositioning motion vectors are activated according to one embodiment of the present specification.
  • 'A and/or B' may be interpreted to mean 'comprising at least one of A or B'.
  • Coding may be interpreted as encoding or decoding, depending on the case.
  • a device that encodes a video signal to generate a video signal bitstream is referred to as an encoding device or encoder
  • a device that decodes a video signal bitstream to restore a video signal is referred to as a decoding device or decoder.
  • a video signal processing device is used as a term that includes both an encoder and a decoder.
  • Information is a term that includes values, parameters, coefficients, elements, etc., and since the meaning may be interpreted differently depending on the case, the present invention is not limited thereto.
  • 'Unit' is used to mean a basic unit of image processing or a specific location of a picture, and refers to an image area that includes at least one of a luminance component and a chroma component.
  • 'block' refers to an image area including specific components among luminance components and chrominance components (i.e., Cb and Cr).
  • terms such as 'unit', 'block', 'partition', 'signal', and 'region' may be used interchangeably.
  • 'current block' means a block that is currently scheduled to be encoded
  • 'reference block' means a block that has already been encoded or decoded and is used as a reference in the current block.
  • the terms 'intra prediction mode', 'intra prediction directional mode', 'intra-screen prediction mode', and 'intra-screen prediction directional mode' may be used interchangeably.
  • the terms 'motion', 'movement', and the like may be used interchangeably.
  • the size of a block can be the sum or product of the horizontal length and the vertical length of the block.
  • the size of a block can represent the number of samples in the block.
  • Bit depth can be an expression of the range of sample values in bit units. Specifically, when the bit depth is 8 bits, the range of the sample value can be from 0 to 255.
  • the internal bit depth can represent the bit depth when the bit depth is expanded to effectively encode an image in a video signal processing device.
  • the video signal processing device can expand the bit depth before encoding the image and reduce the bit depth to the bit depth of the input original image when outputting after decoding. For example, the video signal processing device performs encoding and decoding by expanding an image with an 8-bit depth to an image with a 10-bit depth.
  • the transform unit (110) obtains a transform coefficient value by transforming the residual signal, which is the difference between the input video signal and the prediction signal generated by the prediction unit (150).
  • a discrete cosine transform DCT
  • DST discrete sine transform
  • the discrete cosine transform and the discrete sine transform divide the input picture signal into blocks and perform the transformation.
  • the coding efficiency may vary depending on the distribution and characteristics of the values within the transform domain during the transformation.
  • the transform kernel used for the transformation on the residual block may be a transform kernel having separable characteristics of vertical transformation and horizontal transformation. In this case, the transformation on the residual block may be performed separately as vertical transformation and horizontal transformation.
  • the encoder may perform vertical transformation by applying the transform kernel in the vertical direction of the residual block.
  • the encoder can perform horizontal transformation by applying a transformation kernel in the horizontal direction of the residual block.
  • the transformation kernel may be used as a term referring to a set of parameters used for transformation of the residual signal, such as a transformation matrix, a transformation array, a transformation function, or a transformation.
  • the transformation kernel may be any one of a plurality of available kernels. Additionally, transformation kernels based on different transformation types may be used for each of the vertical transformation and the horizontal transformation.
  • the transformation coefficients are distributed in a way that increases toward the upper left corner of the block, and decreases toward 0 toward the lower right corner. As the current block size increases, there is a high probability of a significant number of 0 coefficients in the lower right corner. To reduce the transformation complexity of large blocks, the remaining regions can be reset to 0, leaving only the upper left corner as an arbitrary region.
  • error signals may exist only in some regions of a coding block.
  • the conversion process may be performed only on some arbitrary regions.
  • an error signal may exist only in the first 2NxN block, and the conversion process may be performed only on the first 2NxN block, but the conversion process may not be performed on the second 2NxN block and may not be encoded or decoded.
  • N can be any positive integer.
  • the encoder may perform an additional transform before the transform coefficients are quantized.
  • the aforementioned transform method may be referred to as a primary transform, and the additional transform may be referred to as a secondary transform.
  • the secondary transform may be optional for each residual block.
  • the encoder may improve coding efficiency by performing the secondary transform on areas where it is difficult to concentrate energy in the low-frequency region using only the primary transform.
  • the secondary transform may be additionally performed on blocks where residual values appear large in directions other than the horizontal or vertical direction of the residual block.
  • the secondary transform may not be performed separately into a vertical transform and a horizontal transform.
  • Such a secondary transform may be referred to as a Low Frequency Non-Separable Transform (LFNST).
  • LTNST Low Frequency Non-Separable Transform
  • a method is used to predict a picture using an already coded area through a prediction unit (150), and to obtain a restored picture by adding the residual value between the original picture and the predicted picture to the predicted picture.
  • a prediction unit 150
  • the encoder performs prediction, information that is also available to the decoder must be used. To this end, the encoder performs a process of restoring the encoded current block.
  • the inverse quantization unit (120) inversely quantizes the transform coefficient value, and the inverse transform unit (125) restores the residual value using the inverse quantized transform coefficient value.
  • a deblocking filter is a filter that removes distortion within blocks generated at the boundaries between blocks in a reconstructed picture.
  • the encoder can determine whether to apply a deblocking filter to a certain boundary based on the distribution of pixels in several columns or rows based on an arbitrary boundary (edge) within the block.
  • the encoder can apply a long filter, a strong filter, or a weak filter depending on the deblocking filtering strength.
  • horizontal and vertical filtering can be processed in parallel.
  • Sample adaptive offset (SAO) can be used to correct the offset from the original image on a pixel-by-pixel basis for the residual block to which the deblocking filter has been applied.
  • the encoder can divide the pixels contained in the image into a certain number of regions, determine the regions to perform offset correction, and apply the offset to those regions (Band Offset).
  • the encoder can use a method (Edge Offset) that applies an offset by considering the edge information of each pixel.
  • CC-SAO cross component SAO
  • the video signal processing device can classify the restored samples into categories, similar to the existing SAO, and derive an offset for each category and add it to the restored samples.
  • the adaptive loop filter is a method that divides the pixels included in the image into a predetermined group, determines one filter to be applied to the group, and performs filtering differentially for each group.
  • Information related to whether to apply the ALF can be signaled in units of coding units, and the shape and filter coefficients of the ALF filter to be applied can vary depending on each block.
  • the same form (fixed form) of the ALF filter can be applied regardless of the characteristics of the target block to which it is applied.
  • BF (Bilateral Filter) filtering is a method of applying a sample-by-sample offset derived from the difference in change between surrounding samples.
  • the prediction unit (150) includes an intra prediction unit (152) and an inter prediction unit (154).
  • the intra prediction unit (152) performs intra prediction within a current picture
  • the inter prediction unit (154) performs inter prediction to predict the current picture using a reference picture stored in a decoded picture buffer (156).
  • the intra prediction unit (152) performs intra prediction from reconstructed regions within the current picture and transfers intra encoding information to the entropy coding unit (160).
  • the intra encoding information may include at least one of an intra prediction mode, an MPM (Most Probable Mode) flag, an MPM index, and information about a reference sample.
  • the inter prediction unit (154) may be configured to include a motion estimation unit (154a) and a motion compensation unit (154b).
  • the motion estimation unit (154a) refers to a specific area of the restored reference picture to find the part most similar to the current area and obtains a motion vector value, which is the distance between the areas.
  • the motion information (reference direction indication information (L0 prediction, L1 prediction, bidirectional prediction), reference picture index, motion vector information, etc.) for the reference area obtained by the motion estimation unit (154a) is transferred to the entropy coding unit (160) so that it can be included in the bitstream.
  • the motion compensation unit (154b) uses the motion information transferred from the motion estimation unit (154a), performs inter-motion compensation to generate a prediction block for the current block.
  • the inter-prediction unit (154) transfers inter-encoding information including motion information for the reference area to the entropy coding unit (160).
  • the transformation unit (110) obtains a transformation coefficient value by transforming the residual value between the original picture and the predicted picture.
  • the transformation can be performed in units of specific blocks within the picture, and the size of the specific block can be varied within a preset range.
  • the quantization unit (115) quantizes the transformation coefficient value generated by the transformation unit (110) and transfers the quantized transformation coefficient to the entropy coding unit (160).
  • the quantized transform coefficients in the form of a two-dimensional array can be rearranged into a one-dimensional array for entropy coding.
  • the method of scanning the quantized transform coefficients can be determined by which scanning method is used depending on the size of the transform block and the prediction mode within the screen. For example, diagonal, vertical, and horizontal scanning can be applied.
  • This scanning information can be signaled on a block-by-block basis and can be derived according to predetermined rules.
  • the entropy coding unit (160) entropy-codes information representing quantized transform coefficients, intra-coding information, inter-coding information, etc. to generate a video signal bitstream.
  • the entropy coding unit (160) may use a variable length coding (VLC) method and an arithmetic coding method.
  • VLC variable length coding
  • the variable length coding (VLC) method converts input symbols into continuous codewords, and the length of the codewords may be variable. For example, frequently occurring symbols are expressed as short codewords, and infrequently occurring symbols are expressed as long codewords.
  • a context-based adaptive variable length coding (CAVLC) method may be used as a variable length coding method.
  • Arithmetic coding converts continuous data symbols into a single prime number by using the probability distribution of each data symbol, and arithmetic coding can obtain the optimal prime number bits required to express each symbol.
  • Context-based Adaptive Binary Arithmetic Coding (CABAC) can be used as an arithmetic coding.
  • CABAC is a binary arithmetic coding method that uses multiple context models generated based on experimentally obtained probabilities.
  • the context models can also be referred to as context models.
  • the encoder binarizes each symbol using exp-Golomb, etc.
  • the binarized 0 or 1 can be described as a bin.
  • the CABAC initialization process is divided into context initialization and arithmetic coding initialization.
  • Context initialization is the process of initializing the occurrence probability of each symbol, and is determined by the symbol type, quantization parameter (QP), and slice type (I, P, B).
  • QP quantization parameter
  • I, P, B slice type
  • the context model provides the occurrence probability of the Least Probable Symbol (LPS) or Most Probable Symbol (MPS) for the symbol to be currently encoded, as well as information (valMPS) on which bin value corresponds to the MPS between 0 and 1.
  • LPS Least Probable Symbol
  • MPS Most Probable Symbol
  • valMPS information on which bin value corresponds to the MPS between 0 and 1.
  • One of several context models is selected through the context index (ctxIdx), and the context index can be derived from information about the current block to be encoded or information about the surrounding blocks. Initialization for binary arithmetic coding is performed based on the probability model selected from the context model.
  • Binary arithmetic coding is performed by dividing the data into probability intervals based on the occurrence probabilities of 0 and 1, and then encoding is performed through a process in which the probability interval corresponding to the bin to be processed becomes the entire probability interval for the bin to be processed next.
  • the location information within the probability interval in which the last bin has been processed is output.
  • a renormalization process is performed to expand the probability interval and output the corresponding location information.
  • a probability update process can be performed in which the probability for the next bin to be processed is newly set based on the information of the processed bin.
  • a bitstream may consist of one or more coded video sequences (CVSs), and a CVS may be encoded independently of other CVSs.
  • CVS may consist of one or more layers, and each layer may represent a specific quality level, a specific resolution, or a general image, a depth map, or a transparency map.
  • a CLVS may mean a layer-wise CVS composed of consecutive (in decoding order) PUs within the same layer. For example, there may be a CLVS for a specific quality layer, and there may be a CLVS for a depth map.
  • NAL Network Abstraction Layer
  • NAL units are divided into VCL (Video Coding Layer) NAL units containing video data and non-VCL NAL units containing parameter information for decoding video data, and there are various types of VCL or non-VCL NAL units.
  • a NAL unit consists of NAL header information and RBSP (Raw Byte Sequence Payload) data, and the NAL header information includes summary information about the RBSP.
  • the RBSP of a VCL NAL unit includes an integer number of encoded coding tree units. In order to decode a bitstream in a video decoder, the bitstream must first be divided into NAL unit units, and then each divided NAL unit must be decoded.
  • VPS Video Parameter Set
  • SPS Sequence Parameter Set
  • PPS Picture Parameter Set
  • APS Adaptation Parameter Set
  • An RBSP of a VCL NAL unit can include an integer number of coding tree units.
  • a VPS is a parameter set configured with a common syntax by extracting duplicate parameters from an SPS parameter set signaled for each layer in a bitstream that supports image quality, resolution, and frame rate scalability or a bitstream that supports multi-view.
  • SPS is a parameter set that includes at least one of the following: Profile, which contains information about acceptable coding tools (or algorithms) and video formats; Level, which contains information about the decoder's processing capabilities, such as the resolution and frame rate of processable video and the allowable memory size; Tier, which contains information about the maximum bit rate that can be processed; and information about the resolution, bit depth, and whether or not a function can be enabled.
  • PPS is a parameter set that includes at least one of the following: resolution of the video, tile division information, whether or not to enable weight prediction, quantization parameters, and filtering-related information.
  • APS is a parameter set that includes one of the following: ALF filter coefficient information, LMCS-related parameters, and quantization scale parameters, depending on the APS type.
  • APS is divided into prefix APS, which is signaled before the VCL NAL unit, and suffix APS, which is signaled after the VCL NAL unit.
  • prefix APS which is signaled before the VCL NAL unit
  • suffix APS which is signaled after the VCL NAL unit.
  • FIG. 1 illustrates an encoding device (100) according to one embodiment of the present specification, and the blocks shown separately logically distinguish elements of the encoding device (100). Accordingly, the elements of the encoding device (100) described above may be mounted as one chip or as multiple chips depending on the design of the device. According to one embodiment, the operations of each element of the encoding device (100) described above may be performed by a processor (not shown).
  • Fig. 2 is a schematic block diagram of a video signal decoding device (200) according to one embodiment of the present specification.
  • the decoding device (200) of the present invention includes an entropy decoding unit (210), an inverse quantization unit (220), an inverse transformation unit (225), a filtering unit (230), and a prediction unit (250).
  • the entropy decoding unit (210) entropy decodes the video signal bitstream to extract transform coefficient information, intra-coding information, inter-coding information, etc. for each region. For example, the entropy decoding unit (210) can obtain a binarization code for transform coefficient information of a specific region from the video signal bitstream. In addition, the entropy decoding unit (210) inversely binarizes the binarization code to obtain a quantized transform coefficient. The inverse quantization unit (220) inversely quantizes the quantized transform coefficient, and the inverse transform unit (225) restores the residual value using the inverse quantized transform coefficient. The video signal processing device (200) restores the original pixel value by adding the residual value obtained by the inverse transform unit (225) and the prediction value obtained by the prediction unit (250).
  • the filtering unit (230) performs filtering on the picture to improve the image quality. This may include a deblocking filter to reduce block distortion and/or an adaptive loop filter to remove distortion from the entire picture.
  • the filtered picture is output or stored in the decoded picture buffer (DPB, 256) to be used as a reference picture for the next picture.
  • the prediction unit (250) includes an intra prediction unit (252) and an inter prediction unit (254).
  • the prediction unit (250) generates a prediction picture by utilizing the encoding type decoded through the entropy decoding unit (210) described above, the transform coefficients for each region, intra/inter encoding information, etc.
  • the decoded region of the current picture or other pictures including the current block may be used.
  • a picture (or tile/slice) that uses only the current picture for restoration, i.e., performs intra prediction or intra BC prediction, is called an intra picture or I picture (or tile/slice), and a picture (or tile/slice) that can perform all of intra prediction, inter prediction, and intra BC prediction is called an inter picture (or tile/slice).
  • a picture (or tile/slice) that uses at most one motion vector and reference picture index to predict sample values of each block among inter-pictures (or tiles/slices) is called a predictive picture or P-picture (or tile/slice), and a picture (or tile/slice) that uses at most two motion vectors and reference picture indices is called a bi-predictive picture or B-picture (or tile/slice).
  • a P-picture (or tile/slice) uses at most one motion information set to predict each block
  • a B-picture (or tile/slice) uses at most two motion information sets to predict each block.
  • a motion information set includes one or more motion vectors and one reference picture index.
  • the intra prediction unit (252) generates a prediction block using intra encoding information and reconstructed samples within the current picture. Specifically, a sample within the current block can be predicted using a reference sample derived using the sample position within the current block and the directionality of the intra prediction mode. If the position of the reference sample is not an integer unit sample, the video signal processing device can predict the current block sample using an interpolated reference sample through an interpolation method using adjacent reference samples. This may be referred to as linear-based intra prediction. As described above, the intra encoding information may include at least one of an intra prediction mode, a Most Probable Mode (MPM) flag, and an MPM index.
  • MPM Most Probable Mode
  • the intra prediction unit (252) predicts sample values of the current block using reconstructed samples located on the left and/or above the current block as reference samples.
  • the reconstructed samples, the reference samples, and the samples of the current block may represent pixels. Additionally, the sample values may represent pixel values.
  • the reference samples may be samples included in a neighboring block of the current block.
  • the reference samples may be samples adjacent to the left boundary of the current block and/or samples adjacent to the upper boundary.
  • the reference samples may be samples located on a line within a preset distance from the left boundary of the current block and/or samples located on a line within a preset distance from the upper boundary of the current block among the samples of the neighboring blocks of the current block.
  • the neighboring blocks of the current block may include at least one of a left (L) block, an upper (A) block, a lower left (BL) block, an above right (AR) block, or an above left (AL) block adjacent to the current block.
  • the neighboring blocks of the current block may be reference blocks for predicting the current block.
  • the inter prediction unit (254) generates a prediction block using the reference picture and inter encoding information stored in the decoded picture buffer (256).
  • the inter encoding information may include a set of motion information (reference picture index, motion vector information, etc.) of the current block with respect to the reference block.
  • Inter prediction may include L0 prediction, L1 prediction, and bi-prediction.
  • L0 prediction is prediction using one reference picture included in the L0 picture list
  • L1 prediction means prediction using one reference picture included in the L1 picture list.
  • one set of motion information e.g., motion vector and reference picture index
  • up to two reference areas can be used, and these two reference areas may exist in the same reference picture or may exist in different pictures, respectively.
  • the bi-prediction method up to two sets of motion information (e.g., motion vectors and reference picture indices) can be used, and the two motion vectors may correspond to the same reference picture index or may correspond to different reference picture indices.
  • the reference pictures are pictures that are located temporally before or after the current picture, and may be completed pictures that have already been restored.
  • the two reference areas used in the bi-prediction method may be areas selected from each of the L0 picture list and the L1 picture list.
  • a prediction method that uses only reference pictures having a POC smaller than the POC of the current picture or uses only reference pictures having a POC larger than the POC of the current picture based on the POC (picture order count) indicating the display order of the current picture can be called uni-directional prediction.
  • a prediction method that uses both a reference picture with a POC (picture order count) smaller than that of the current picture and a reference picture with a POC larger than that of the current picture based on the POC indicating the display order of the current picture can be called bi-directional prediction.
  • a prediction method that uses only one reference picture in uni-directional prediction can be called uni-prediction
  • a prediction method that uses two reference pictures in uni-directional prediction can be called bi-prediction or bi-prediction.
  • the inter prediction unit (254) can obtain a reference block of the current block using a motion vector and a reference picture index.
  • the reference block exists in a reference picture corresponding to the reference picture index.
  • a sample value of a block specified by the motion vector or an interpolated value thereof can be used as a predictor of the current block.
  • an 8-tap interpolation filter can be used for a luminance signal and a 4-tap interpolation filter can be used for a chrominance signal.
  • the interpolation filter for sub-pel unit motion prediction is not limited thereto. In this way, the inter prediction unit (254) performs motion compensation to predict the texture of the current unit from a previously restored picture. At this time, the inter prediction unit can use a motion information set.
  • the prediction unit (250) may include an IBC prediction unit (not shown).
  • the IBC prediction unit may reconstruct the current region by referring to a specific region including reconstructed samples within the current picture.
  • the IBC prediction unit may perform IBC prediction using IBC encoding information obtained from the entropy decoding unit (210).
  • the IBC encoding information may include block vector information.
  • a restored video picture is generated by adding the predicted value output from the intra prediction unit (252) or inter prediction unit (254) and the residual value output from the inverse transformation unit (225). That is, the video signal decoding device (200) restores the current block using the predicted block generated from the prediction unit (250) and the residual obtained from the inverse transformation unit (225).
  • FIG. 2 illustrates a decoding device (200) according to one embodiment of the present specification, and the blocks shown separately illustrate logically distinguishing elements of the decoding device (200). Accordingly, the elements of the aforementioned decoding device (200) may be mounted as one chip or as multiple chips depending on the design of the device. According to one embodiment, the operations of each element of the aforementioned decoding device (200) may be performed by a processor (not shown).
  • signaling can be described as encoding each syntax from the encoder's perspective
  • parsing can be described as interpreting each syntax from the decoder's perspective. That is, each syntax can be included in the bitstream from the encoder and signaled, and the decoder can parse the syntax and use it in the restoration process.
  • sequence of bits for each syntax listed in the prescribed hierarchical structure can be referred to as a bitstream.
  • a picture can be encoded by dividing it into sub-pictures, slices, tiles, etc.
  • a sub-picture can include one or more slices or tiles. When a picture is encoded by dividing it into multiple slices or tiles, all slices or tiles within the picture must be decoded before it can be displayed on the screen. On the other hand, when a picture is encoded into multiple sub-pictures, only any sub-picture can be decoded and displayed on the screen.
  • a slice can include multiple tiles or sub-pictures, or a tile can include multiple sub-pictures or slices.
  • Sub-pictures, slices, and tiles can be encoded or decoded independently, which is effective for parallel processing and improving processing speed. However, there is a disadvantage in that the amount of bits increases because the encoded information of adjacent sub-pictures, slices, and tiles cannot be used.
  • Sub-pictures, slices, and tiles can be encoded by dividing them into multiple coding tree units (CTUs).
  • CTUs coding tree units
  • FIG. 3 illustrates an embodiment in which a Coding Tree Unit (CTU) within a picture is divided into Coding Units (CUs).
  • CTU Coding Tree Unit
  • CU Coding Unit
  • a Coding Tree Unit may be composed of a luminance (luma) Coding Tree Block (CTB), two chroma (chroma) Coding Tree Blocks, and their encoded syntax information.
  • CB luminance Coding Tree Block
  • chroma chroma Coding Tree Blocks
  • One Coding Tree Unit may be composed of one Coding Unit, or one Coding Tree Unit may be split into multiple Coding Units.
  • One Coding Unit may be composed of a luminance Coding Block (CB), two chroma Coding Blocks, and their encoded syntax information.
  • CB luminance Coding Block
  • One Coding Block may be split into multiple Sub-Coding Blocks.
  • One Coding Unit may be composed of one Transform Unit (TU), or one Coding Unit may be split into multiple Transform Units.
  • a single transform unit may consist of a luminance transform block (TB), two chrominance transform blocks, and their encoded syntax information.
  • a coding tree unit may be divided into multiple coding units.
  • a coding tree unit may not be divided and may also be a leaf node. In this case, the coding tree unit itself may be a coding unit.
  • a coding unit refers to a basic unit for processing a picture in the video signal processing described above, such as intra/inter prediction, transformation, quantization, and/or entropy coding.
  • the size and shape of a coding unit within a picture may not be constant.
  • a coding unit may have a square or rectangular shape.
  • a rectangular coding unit (or rectangular block) includes a vertical coding unit (or vertical block) and a horizontal coding unit (or horizontal block).
  • a vertical block is a block whose height is greater than its width
  • a horizontal block is a block whose width is greater than its height.
  • a non-square block in the present specification may refer to a rectangular block, but the present invention is not limited thereto.
  • the coding tree unit is first partitioned into a Quad Tree (QT) structure. That is, in the Quad Tree structure, one node with a size of 2NX2N can be partitioned into four nodes with a size of NXN.
  • the Quad Tree may also be referred to as a quaternary tree.
  • the Quad Tree partitioning can be performed recursively, and not all nodes need to be partitioned to the same depth.
  • the leaf node of the aforementioned quad tree can be further split into a multi-type tree (MTT) structure.
  • MTT multi-type tree
  • one node can be split into a binary or ternary tree structure of horizontal or vertical split. That is, the multi-type tree structure has four split structures: vertical binary split, horizontal binary split, vertical ternary split, and horizontal ternary split.
  • the width and height of the node can both have a power of 2 value.
  • a node of size 2NX2N can be split into two NX2N nodes by vertical binary split, and can be split into two 2NXN nodes by horizontal binary split.
  • a node of size 2NX2N can be split into nodes of size (N/2)X2N, NX2N, and (N/2)X2N by vertical ternary splitting, and into nodes of size 2NX(N/2), 2NXN, and 2NX(N/2) by horizontal ternary splitting.
  • This multi-type tree splitting can be performed recursively.
  • a leaf node of a multi-type tree can be a coding unit. If the coding unit is not larger than the maximum transformation length, the coding unit can be used as a unit of prediction and/or transformation without further splitting. In one embodiment, if the width or height of the current coding unit is larger than the maximum transformation length, the current coding unit can be split into multiple transformation units without explicit signaling regarding the splitting. Meanwhile, in the quad tree and multi-type tree described above, at least one of the following parameters can be predefined or transmitted through an RBSP of a higher-level set, such as a PPS, an SPS, or a VPS.
  • CTU size The size of the root node of the quad tree
  • MinQtSize The minimum allowed QT leaf node size
  • MaxBtSize The maximum allowed BT root node size
  • MaxTT size MaxTtSize
  • MaxMttDepth The maximum allowed depth of an MTT split from a leaf node of a QT
  • MinBT size MinBtSize
  • MinTT size MinTtSize
  • Fig. 4 illustrates one embodiment of a method for signaling splitting of a quad tree and a multi-type tree.
  • Pre-configured flags may be used to signal splitting of the quad tree and the multi-type tree described above.
  • a flag 'split_cu_flag' indicating whether a current node is split may be signaled first. If the value of 'split_cu_flag' is 0, it indicates that the current node is not split, and the current node becomes a coding unit. If the current node is a coding tree unit, the coding tree unit includes one coding unit that is not split. If the current node is a quad tree node 'QT node', the current node is a leaf node 'QT leaf node' of the quad tree and becomes a coding unit. If the current node is a multi-type tree node 'MTT node', the current node is a leaf node 'MTT leaf node' of the multi-type tree and becomes a coding unit.
  • the current node can be split into nodes of a quad tree or a multi-type tree depending on the value of 'split_qt_flag'.
  • the coding tree unit is the root node of the quad tree and can be first split into a quad tree structure. In the quad tree structure, 'split_qt_flag' is signaled for each node 'QT node'.
  • quad tree splitting can be limited depending on the type of the current node. Quad tree splitting may be allowed if the current node is a coding tree unit (root node of a quad tree) or a quad tree node, and quad tree splitting may not be allowed if the current node is a multi-type tree node.
  • Each quad tree leaf node 'QT leaf node' may be further split into a multi-type tree structure. As described above, if 'split_qt_flag' is 0, the current node may be split into multi-type nodes. To indicate the splitting direction and splitting shape, 'mtt_split_cu_vertical_flag' and 'mtt_split_cu_binary_flag' may be signaled.
  • 'mtt_split_cu_vertical_flag' a vertical split of the node 'MTT node' is indicated, and if the value of 'mtt_split_cu_vertical_flag' is 0, a horizontal split of the node 'MTT node' is indicated. Additionally, if the value of 'mtt_split_cu_binary_flag' is 1, the node 'MTT node' is split into two rectangular nodes, and if the value of 'mtt_split_cu_binary_flag' is 0, the node 'MTT node' is split into three rectangular nodes.
  • the tree partitioning structure allows luminance blocks and chrominance blocks to be partitioned in the same manner. That is, the chrominance blocks can be partitioned by referring to the partitioning form of the luminance blocks. If the current chrominance block is smaller than a predetermined size, the chrominance block may not be partitioned even if the luminance block is partitioned.
  • the luminance block and the chrominance block may have the same tree partitioning structure, which may be referred to as a single tree. If the current block is encoded with a single tree, the partitioning structure, encoding mode information, motion information, etc. of the luminance block and the chrominance block may be the same, and information related to other error signals may be different between the luminance block and the chrominance block. In addition, the luminance block and the chrominance block may have different tree partitioning structures, which may be referred to as a dual tree. If the current block is encoded with a dual tree, the partitioning structure, encoding mode information, motion information, etc. of the luminance block and the chrominance block may be different in at least one or more.
  • the encoder and decoder can use the segmentation information, encoding mode information, and motion information of the luminance block to encode the chrominance block.
  • a node to be divided into the smallest unit can be processed as a single coding block.
  • the coding block can be divided into multiple sub-blocks (sub-coding blocks), and the prediction information of each sub-block can be the same or different.
  • the coding unit is an intra mode
  • the intra prediction modes of each sub-block can be the same or different.
  • the coding unit is an inter mode
  • the motion information of each sub-block can be the same or different.
  • each sub-block can be encoded or decoded independently.
  • Each sub-block can be distinguished by a sub-block index (sbIdx).
  • a coding unit when a coding unit is divided into sub-blocks, it can be divided horizontally, vertically, or diagonally.
  • ISP Intra Sub-Partitions
  • GPM Gaometric partitioning mode
  • the position and direction of the diagonal line are derived using a predefined angle table, and the index information of the angle table is signaled.
  • the motion information may include one or more of reference direction indication information, reference picture information, motion vector, motion resolution, affine model, CPMV (control point motion vector), block vector, block vector resolution, MHP information, LIC information, filtering information, BCW information, and RRIBC information.
  • the reference direction indication information is composed of L0 prediction, L1 prediction, L0 and L1 prediction, and L0 prediction and L1 prediction are uni-prediction and unidirectional prediction, and L0 and L1 prediction are bi-prediction. And L0 and L1 prediction can be uni-prediction or bi-directional prediction.
  • L0 prediction is predicted using reference pictures in the L0 reference picture list
  • L1 prediction can be predicted using reference pictures in the L1 reference picture list.
  • a reference picture with a POC smaller than the POC of the current picture can be added to the reference picture list based on the POC of the current picture.
  • the L0 reference picture list can be composed in order from a reference picture with a POC closer to the POC of the current picture to a reference picture with a POC farther from the POC.
  • a reference picture with a POC larger than the POC of the current picture can be added to the reference picture list based on the POC of the current picture.
  • the L1 reference picture list can be organized in the order of reference pictures with a POC closer to the POC of the current picture to reference pictures with a POC farther away.
  • the L0 and L1 reference picture lists can vary for each slice, subpicture, and picture.
  • the L0 reference picture list can include reference pictures of the L1 reference picture list.
  • the L1 reference picture list can include reference pictures of the L0 reference picture list.
  • Reference picture information may vary for each block and may be index information indicating which reference picture in the L0 reference picture list and/or the L1 reference picture list is used to predict the current block.
  • the reference picture information may include one or more of L0 reference picture information and L1 reference picture information.
  • a motion vector is information that indicates the block that best matches the current block in a reference picture. It is a value that represents the distance to the reference block in horizontal and vertical coordinates based on the upper left position of the current block in the picture.
  • Motion resolution represents the resolution of the motion vector, and motion resolution can be expressed in units of 4 pixels, 1 pixel (integer pixel), 1/2 pixel, 1/4 pixel, 1/8 pixel, 1/16 pixel, etc.
  • a block vector is information indicating the block that best matches the current block in the already restored area within the current picture. It is a value that represents the distance to the reference block in horizontal and vertical coordinates based on the upper left position of the current block within the picture.
  • Block vector resolution can be expressed in units of 4 pixels, 1 pixel (integer pixel), 1/2 pixel, 1/4 pixel, 1/8 pixel, 1/16 pixel, etc.
  • MHP information may include whether additional motion information is applied and additional motion information.
  • LIC information may include whether LIC applies to the current block.
  • Filtering information may include filtering type and coefficient information applied according to the motion resolution of the current block.
  • BCW information may include whether BCW is applied to the current block.
  • RRIBC information may include information about whether RRIBC is applied and the RRIBC type if the current block is encoded in IBC mode.
  • Picture prediction (motion compensation) for coding is performed on coding units that are no longer divisible (i.e., leaf nodes of a coding tree unit).
  • the basic unit performing this prediction is referred to below as a prediction unit or prediction block.
  • unit used in this specification may be used as a replacement for the prediction unit, which is the basic unit for performing prediction.
  • the present invention is not limited thereto, and can be understood more broadly as a concept that includes the coding unit.
  • Figures 5 and 6 illustrate an intra prediction method according to an embodiment of the present invention in more detail.
  • the intra prediction unit predicts sample values of the current block using restored samples located to the left and/or above the current block as reference samples.
  • FIG. 5 illustrates an embodiment of reference samples used for prediction of a current block in an intra prediction mode.
  • the reference samples may be samples adjacent to a left boundary of the current block and/or samples adjacent to an upper boundary.
  • reference samples may be set using at most 2W+2H+1 surrounding samples located on the left and/or upper sides of the current block.
  • pixels of multiple reference lines may be used for intra prediction of the current block.
  • the multiple reference lines may be composed of n lines located within a preset range from the current block.
  • separate index information indicating the lines to be set as reference pixels may be signaled, and this may be referred to as a reference line index.
  • the intra prediction unit may perform a reference sample padding process to obtain a reference sample.
  • the intra prediction unit may perform a reference sample filtering process to reduce an error in intra prediction. That is, filtering may be performed on the surrounding samples and/or the reference samples obtained by the reference sample padding process to obtain filtered reference samples.
  • the intra prediction unit predicts samples of the current block using the reference samples obtained in this manner.
  • the intra prediction unit predicts samples of the current block using unfiltered reference samples or filtered reference samples.
  • the surrounding samples may include samples on at least one reference line.
  • the surrounding samples may include adjacent samples on a line adjacent to a boundary of the current block.
  • FIG. 6 illustrates an embodiment of prediction modes used for intra prediction.
  • intra prediction mode information indicating an intra prediction direction may be signaled.
  • the intra prediction mode information indicates any one of a plurality of intra prediction modes constituting an intra prediction mode set. If the current block is an intra prediction block, the decoder receives intra prediction mode information of the current block from the bitstream. The intra prediction unit of the decoder performs intra prediction on the current block based on the extracted intra prediction mode information.
  • an intra prediction mode set may include all intra prediction modes used for intra prediction (e.g., a total of 67 intra prediction modes). More specifically, the intra prediction mode set may include a planar mode, a DC mode, and a plurality of (e.g., 65) angular modes (i.e., directional modes). Each intra prediction mode may be indicated by a preset index (i.e., an intra prediction mode index). For example, as illustrated in FIG. 6, an intra prediction mode index 0 indicates a planar mode, and an intra prediction mode index 1 indicates a DC mode.
  • intra prediction mode indices 2 to 66 may each indicate different angular modes. The angular modes each indicate different angles within a preset angular range.
  • an angular mode may indicate an angle within an angular range from 45 degrees to -135 degrees clockwise (i.e., a first angular range).
  • the angular mode may be defined based on the 12 o'clock direction.
  • intra prediction mode index 2 indicates horizontal diagonal (HDIA) mode
  • intra prediction mode index 18 indicates horizontal (HOR) mode
  • intra prediction mode index 34 indicates diagonal (DIA) mode
  • intra prediction mode index 50 indicates vertical (VER) mode
  • intra prediction mode index 66 indicates vertical diagonal (VDIA) mode.
  • the preset angle range may be set differently depending on the shape of the current block. For example, if the current block is a rectangular block, a wide-angle mode indicating an angle exceeding 45 degrees or less than -135 degrees in a clockwise direction may be additionally used. If the current block is a horizontal block, the angle mode may indicate an angle within an angle range (i.e., a second angle range) between (45+offset1) degrees and (-135+offset1) degrees in a clockwise direction. At this time, angle modes 67 to 76 that are outside the first angle range may be additionally used.
  • an angle range i.e., a second angle range
  • the angle mode may indicate an angle within an angle range (i.e., a third angle range) between (45-offset2) degrees and (-135-offset2) degrees in a clockwise direction.
  • angle modes -10 to -1 that are outside the first angle range may be additionally used.
  • the values of offset1 and offset2 may be determined differently depending on the ratio between the width and height of the rectangular block. Also, offset1 and offset2 can be positive.
  • the plurality of angular modes constituting the intra prediction mode set may include a basic angular mode and an extended angular mode.
  • the extended angular mode may be determined based on the basic angular mode.
  • the basic angle mode may be a mode corresponding to an angle used in intra prediction of the existing HEVC (High Efficiency Video Coding) standard
  • the extended angle mode may be a mode corresponding to an angle newly added in intra prediction of the next-generation video codec standard.
  • the basic angle mode may be an angle mode corresponding to any one of the intra prediction modes ⁇ 2, 4, 6, ... , 66 ⁇
  • the extended angle mode may be an angle mode corresponding to any one of the intra prediction modes ⁇ 3, 5, 7, ... , 65 ⁇ . That is, the extended angle mode may be an angle mode between the basic angle modes within the first angle range. Therefore, the angle indicated by the extended angle mode may be determined based on the angle indicated by the basic angle mode.
  • the basic angle mode may be a mode corresponding to an angle within a preset first angle range
  • the extended angle mode may be a wide-angle mode outside the first angle range. That is, the basic angle mode may be an angle mode corresponding to any one of the intra prediction modes ⁇ 2, 3, 4, ... , 66 ⁇
  • the extended angle mode may be an angle mode corresponding to any one of the intra prediction modes ⁇ -14, –13, –12, ... , –1 ⁇ and ⁇ 67, 68, ... , 80 ⁇ .
  • the angle indicated by the extended angle mode may be determined as an opposite angle to the angle indicated by the corresponding basic angle mode. Accordingly, the angle indicated by the extended angle mode may be determined based on the angle indicated by the basic angle mode.
  • the number of extended angle modes is not limited thereto, and additional extended angles may be defined according to the size and/or shape of the current block. Meanwhile, the total number of intra prediction modes included in the intra prediction mode set may vary depending on the configuration of the basic angle mode and the extended angle mode described above.
  • the spacing between the extended angular modes may be set based on the spacing between the corresponding basic angular modes.
  • the spacing between the extended angular modes ⁇ 3, 5, 7, ... , 65 ⁇ may be determined based on the spacing between the corresponding basic angular modes ⁇ 2, 4, 6, ... , 66 ⁇ .
  • the spacing between the extended angular modes ⁇ -14, -13, ... , -1 ⁇ may be determined based on the spacing between the corresponding opposite basic angular modes ⁇ 53, 53, ... , 66 ⁇ , and the spacing between the extended angular modes ⁇ 67, 68, ... , 80 ⁇ may be determined based on the spacing between the corresponding opposite basic angular modes ⁇ 2, 3, 4, ... , 15 ⁇ .
  • the angular spacing between the extended angular modes may be set to be equal to the angular spacing between the corresponding basic angular modes.
  • the number of the extended angular modes in the intra prediction mode set may be set to be less than or equal to the number of the basic angular modes.
  • an extended angular mode may be signaled based on a base angular mode.
  • a wide-angle mode i.e., an extended angular mode
  • the replaced base angular mode may be an angular mode corresponding to an opposite side of the wide-angle mode. That is, the replaced base angular mode is an angular mode corresponding to an angle in an opposite direction to an angle indicated by the wide-angle mode or an angle that is different from the angle in the opposite direction by a preset offset index.
  • the preset offset index is 1.
  • An intra prediction mode index corresponding to the replaced base angular mode may be remapped to the wide-angle mode to signal the corresponding wide-angle mode.
  • the wide-angle modes ⁇ -14, -13, ... , -1 ⁇ may be signaled by intra prediction mode indices ⁇ 52, 53, ... , 66 ⁇
  • the wide-angle modes ⁇ 67, 68, ... , 69 ⁇ may be signaled by intra prediction mode indices ⁇ 52, 53, ... , 66 ⁇ , respectively.
  • 80 ⁇ can be signaled by intra prediction mode indices ⁇ 2, 3, ... , 15 ⁇ , respectively.
  • the intra prediction mode index for the basic angular mode signal the extended angular mode in this way, even if the configurations of the angular modes used for intra prediction of each block are different, the same set of intra prediction mode indices can be used to signal the intra prediction mode. Therefore, the signaling overhead due to changes in the intra prediction mode configuration can be minimized.
  • whether to use the extended angle mode may be determined based on at least one of the shape and size of the current block.
  • the extended angle mode may be used for intra prediction of the current block, and otherwise, only the default angle mode may be used for intra prediction of the current block.
  • the extended angle mode may be used for intra prediction of the current block, and if the current block is a square block, only the default angle mode may be used for intra prediction of the current block.
  • the intra prediction unit determines reference samples and/or interpolated reference samples to be used for intra prediction of the current block based on intra prediction mode information of the current block. If the intra prediction mode index indicates a specific angular mode, the reference sample or interpolated reference sample corresponding to the specific angle from the current sample of the current block is used for prediction of the current pixel. Therefore, different sets of reference samples and/or interpolated reference samples can be used for intra prediction depending on the intra prediction mode.
  • the decoder restores the sample values of the current block by adding the residual signal of the current block obtained from the inverse transform unit to the intra prediction value of the current block.
  • Motion information used for inter prediction may include reference direction indication information (inter_pred_idc), reference picture indexes (ref_idx_l0, ref_idx_l1), and motion vectors (mvL0, mvL1).
  • Reference picture list utilization information predFlagL0, predFlagL1 may be set according to the reference direction indication information.
  • a method for deriving motion information in Merge or AMVP may be to construct a motion candidate list using motion prediction values derived from neighboring blocks of the current block, and then signal the index information for the optimal motion candidate.
  • AMVP since motion candidate lists are derived for each of L0 and L1, the optimal motion candidate indices (mvp_l0_flag, mvp_l1_flag) for each of L0 and L1 are signaled.
  • merge index (merge_idx) is signaled.
  • the motion candidate lists derived from one coding unit may vary, and a motion candidate index or merge index may be signaled for each motion candidate list.
  • MergeSkip mode a mode in which there is no information about the remaining blocks in a block encoded in Merge mode.
  • Bidirectional motion information for the current block can be derived using a combination of AMVP and Merge modes.
  • motion information in the L0 direction can be derived using AMVP
  • motion information in the L1 direction can be derived using Merge.
  • Merge can be applied to L0
  • AMVP can be applied to L1.
  • This encoding mode can be referred to as AMVP-merge mode.
  • the motion candidates and motion information candidates in this specification may have the same meaning. Furthermore, the motion candidate list and motion information candidate list in this specification may have the same meaning.
  • SMVD Symmetric MVD
  • MVD Motion Vector Difference
  • OBMC Overlapped Block Motion Compensation
  • merge motion candidates have low motion accuracy.
  • the MMVD (Merge mode with MVD) method can be used.
  • the MMVD method is a method of compensating motion information using one candidate selected from several motion difference value candidates.
  • Information about the compensation value of the motion information obtained through the MMVD method e.g., an index indicating one candidate selected from among the motion difference value candidates
  • the inclusion of information about the compensation value of the motion information in the bitstream can save bits.
  • MBVD (merge mode with block vector differences) mode is a mode that encodes the differential value for a block vector, similar to MMVD, which is a mode that encodes the differential value for a motion vector in merge mode.
  • the MBVD method is a method that determines a block vector by using one candidate selected from several block vector difference value candidates.
  • Information about the differential value of the block vector obtained through the MBVD method e.g., an index indicating one candidate selected from among the block vector difference value candidates
  • the amount of bits can be saved by including only a part of the information about the differential value of the block vector in the bitstream.
  • TM Temporal Matching
  • BM Breast Matching
  • BM Bilateral Matching
  • the DMVR (Decoder-side Motion Vector Refinement) method is a method of compensating motion information through the correlation of already restored reference images to find slightly more accurate motion information. It is a method of using the bidirectional motion information of the current block to use the best matching point between reference blocks within an arbitrary set area of two reference pictures as a new bidirectional motion.
  • the encoder performs DMVR on a block basis to compensate for the motion information, and then divides the block into sub-blocks and performs DMVR on each sub-block basis to compensate for the motion information of the sub-block again.
  • MP-DMVR Multi-pass DMVR
  • the LIC (Local Illumination Compensation) method is a method of compensating for luminance changes between blocks. It is a method of deriving a linear model using neighboring pixels adjacent to the current block, and then compensating for the luminance information of the current block through the linear model.
  • Existing video encoding methods perform motion compensation that only considers parallel translation in all directions, which reduces encoding efficiency when encoding videos containing motions commonly encountered in the real world, such as zooming in, zooming out, and rotation.
  • an affine model-based motion prediction technique utilizing a four-parameter (rotation) or six-parameter (zoom in, zoom out, rotation) model can be applied.
  • Bi-Directional Optical Flow is used to compensate for predicted blocks by estimating pixel changes based on optical flow from a reference block of a block composed of bidirectional motion.
  • the motion information derived from BDOF in VVC can be used to compensate for the motion of the current block.
  • PROF Prediction Refinement with Optical Flow
  • PROF calculates a correction value on a pixel-by-pixel basis for affine motion-compensated pixel values on a sub-block-by-subblock basis based on optical flow to obtain a final prediction signal.
  • the CIIP (Combined Inter-/Intra-picture Prediction) method is a method of generating a final prediction block by weighting and averaging prediction blocks generated by the intra-picture prediction method and prediction blocks generated by the inter-picture prediction method when generating a prediction block for the current block.
  • the Intra Block Copy (IBC) method finds the most similar part to the current block in a previously restored area within the current picture and uses that reference block as a prediction block for the current block. At this time, information related to the block vector, which represents the distance between the current block and the reference block, can be included in the bitstream.
  • the decoder can parse the block vector information contained in the BeastStream to calculate or set the block vector for the current block.
  • the BCW (Bi-prediction with CU-level Weights) method is a method that performs a weighted average on two motion-compensated prediction blocks by adaptively applying weights on a block-by-block basis, rather than generating a prediction block by averaging two motion-compensated prediction blocks from different reference pictures.
  • the Intra TMP (Template Matching Prediction) method is a method in which a video signal processing device constructs a reference template using pixel values of neighboring blocks adjacent to the current block, finds the part most similar to the constructed reference template in an already restored area within the current picture, and then uses the reference block (the part found in the already restored area) as a prediction block for the current block.
  • the MHP (Multi-hypothesis prediction) method is a method of performing weight prediction using various prediction signals by transmitting additional motion information to unidirectional and bidirectional motion information during inter-screen prediction.
  • CCLM Cross-component linear model
  • CCP Cross-Component Prediction
  • GLM Gradient Linear Model
  • CCP Cross-Component Prediction
  • the CCP merge method is a method of predicting the chrominance block of the current block using the CCP model (models such as CCLM, MMLM, and CCCM) used in the surrounding blocks.
  • encoding modes prediction modes
  • CCLM mode may be described as the CCLM method or CCLM.
  • the MIP (Matrix Intra Prediction) method is a matrix-based intra prediction method. Unlike the prediction method that has directionality from the pixels of the surrounding blocks adjacent to the current block, it is a method of obtaining a prediction signal using a predefined matrix and offset values for the pixels on the left and top of the surrounding blocks.
  • a template which is a random region adjacent to the current block and reconstructed, is used.
  • the intra-prediction mode derived from the template's surrounding pixels can be used to reconstruct the current block.
  • the decoder generates a prediction template for the template using the surrounding pixels (reference) adjacent to the template.
  • the intra-prediction mode that generates the prediction template most similar to the already reconstructed template can then be used to reconstruct the current block. This method is called TIMD (Template intra-mode derivation).
  • TIMD merge mode is a mode that inherits the intra prediction directionality mode, information on whether to apply a weighted average, weighting information for each intra prediction mode, and transformation type information from neighboring blocks encoded with TIMD or TIMD merge mode, and uses them in the current block.
  • the video signal processing device can construct a TIMD merge list using the TIMD information used in the neighboring blocks.
  • the video signal processing device can add a predetermined maximum number of TIMD information derived from neighboring blocks to the TIMD merge list in order of distance.
  • the predetermined maximum number can be a positive integer greater than or equal to 1. For example, the predetermined maximum number can be 5.
  • the video signal processing device can rearrange the TIMD merge list based on the template cost and use the candidate with the minimum cost as the TIMD mode of the current block. If the current block is encoded with TIMD merge mode, the video signal processing device can use an implicit DST7 transform for the residual signal if the size of the current block is greater than or equal to 4 and less than or equal to 16. In other cases, the video signal processing device can use a transformation type derived from a neighboring block. The transformation type derived from a neighboring block may be transformation type information within a TIMD candidate for the current block determined from the TIMD merge list.
  • the template cost can be calculated through SATD. If the calculation method of the template cost changes, the derived intra prediction mode may also change.
  • the TIMD SAD mode is similar to the TIMD mode, but the method of calculating the template cost uses the MR-SAD method instead of SATD.
  • an encoder can determine a prediction mode for generating a prediction block and generate a bitstream containing information about the determined prediction mode.
  • a decoder can parse the received bitstream to set an intra-prediction mode.
  • the bit amount of information about the prediction mode may be about 10% of the total bitstream size.
  • the encoder may not include information about the intra-prediction mode in the bitstream. Accordingly, the decoder can derive (determine) an intra-prediction mode for restoring the current block using the characteristics of the surrounding blocks, and can restore the current block using the derived intra-prediction mode.
  • the decoder can use a method of applying a Sobel filter in the horizontal and vertical directions to each neighboring pixel (pixel) of the current block to infer directional information, and then mapping the directional information to the intra-prediction mode to derive the intra-prediction mode.
  • the method by which the decoder derives the intra prediction mode using surrounding blocks can be described as Decoder side intra mode derivation (DIMD).
  • the video signal processing device can derive an intra prediction mode through the DIMD and TIMD methods. If the current block is a chroma block, since there is an already reconstructed luminance block corresponding to the chroma block, the video signal processing device can derive an intra prediction mode by applying the DIMD and TIMD methods using the reconstructed luminance block, and then use the derived intra prediction mode as the intra prediction mode of the chroma block. That is, the video signal processing device can derive directional information if the current block is a luminance block, and can not derive directional information if the current block is a chroma block, and can apply the directional information found in the luminance block to the chroma block. This mode can be called the 'DIMD Chroma' mode or the 'TIMD Chroma' mode.
  • Figure 7 is a diagram showing the locations of surrounding blocks used to construct a motion candidate list in inter prediction.
  • the neighboring blocks can be blocks of spatial position or blocks of temporal position.
  • the neighboring block spatially adjacent to the current block can be at least one of a left (A1) block, a left below (A0) block, an above (B1) block, an above right (B0) block, and an above left (B2) block.
  • the neighboring block temporally adjacent to the current block can be a block that includes an upper left pixel position of a bottom right (BR) block of the current block in a corresponding picture (Collocated picture).
  • a block that includes a horizontal and vertical center (Center, Ctr) pixel position of the current block in the picture corresponding to the current picture (Collocated picture) can be used as the temporal neighboring block.
  • Motion candidate information derived from corresponding pictures can be referred to as a Temporal Motion Vector Predictor (TMVP). Only one TMVP can be derived from a single block, or a block can be divided into multiple sub-blocks, and then a separate TMVP candidate can be derived for each sub-block.
  • the method for deriving TMVPs at the sub-block level can be referred to as a sub-block Temporal Motion Vector Predictor (sbTMVP).
  • Whether the methods described in this specification are applied may be determined based on at least one of information about the slice type (e.g., whether it is an I slice, a P slice, or a B slice), whether it is a tile, whether it is a subpicture, the number of samples of the current block, the horizontal size of the current block, the vertical size of the current block, the depth of the coding unit, whether the current block is a luminance block or a chrominance block, whether it is a reference frame or a non-reference frame, the temporal layer according to the reference order and layer, etc.
  • the information used to determine whether the methods described in this specification are applied may be information agreed upon in advance between the decoder and the encoder.
  • Such information may be determined according to a profile and a level. Such information may be expressed as a variable value, and the bitstream may include information about the variable value. That is, the decoder may parse the information about the variable value included in the bitstream to determine whether the above-described methods are applied.
  • the methods described in this specification may be performed on a luminance block and a chrominance block. The methods described in this specification may be performed only on luminance blocks and not on chrominance blocks. The methods described in this specification may not be performed on luminance blocks and may only be performed on chrominance blocks. Whether the methods described in this specification are performed may be determined based on information about whether the current picture is used as a reference picture or not.
  • whether the above-described methods are applied may be determined based on the horizontal length or the vertical length of the coding unit. If the horizontal length or the vertical length is 32 or more (e.g., 32, 64, 128, etc.), the above-described methods may be applied. In addition, when the horizontal length or the vertical length is less than 32 (e.g., 2, 4, 8, 16), the above-described methods may be applied. In addition, when the horizontal length or the vertical length is 4 or 8, the above-described methods may be applied.
  • FIG. 8 illustrates a method for determining a reference pixel line based on a template according to one embodiment of the present specification.
  • the reference pixel line may have the same meaning as the reference sample line.
  • a video signal processing device can construct a reference template using reference pixel lines adjacent to a current block.
  • the video signal processing device can generate prediction samples for the positions of the reference template using reference pixel lines 1, 2, 3, etc.
  • the video signal processing device can calculate a cost between the generated prediction samples and samples of the reference template.
  • the cost can be calculated using a method such as SAD (Sum of Absolute Differences) or MRSAD (Mean-Removed SAD).
  • the reference pixel corresponding to the minimum cost may be the optimal reference pixel.
  • the encoder can rearrange the calculated costs in ascending order, construct a list for reference pixel lines, and then generate and signal a bitstream including information on an index for the optimal reference pixel line.
  • the decoder can construct a list for reference pixel lines using the above-described method, parse the index for the optimal reference pixel line included in the bitstream, and generate a prediction sample using the reference pixel line indicated by the index.
  • a method for a video signal processing device to determine a reference pixel line based on a template can be described as a Template-based Multiple Reference Line (TMRL) method or a TMRL intra prediction method.
  • TMRL Template-based Multiple Reference Line
  • FIG. 9 is a diagram illustrating a block vector related to an IBC encoding method according to one embodiment of the present specification.
  • the IBC coding method is a method of finding the part (reference block) that is most similar to the current block in an already reconstructed area within the current picture and using the reference block as a prediction block for the current block.
  • the encoder can generate a bitstream that includes information related to a block vector, which is the distance between the current block and the reference block.
  • the decoder can parse information related to the block vector included in the BeastStream to calculate or set the block vector for the current block.
  • the IBC coding method can be applied to chrominance blocks.
  • the block vector of the luminance block corresponding to the chrominance block can be used as the block vector of the chrominance block without finding a new block vector, and this coding method can be called DBV (Direct Block Vector) mode.
  • DBV Direct Block Vector
  • the RRIBC (Reconstruction-Reordered IBC) encoding mode can be used in IBC blocks (blocks to which the IBC encoding method is applied).
  • RRIBC can be composed of vertical flips and horizontal flips.
  • the reconstructed block of a block to which RRIBC is applied is flipped according to the RRIBC type of the current block.
  • the encoder can flip the original block to be encoded before finding the most similar part to the current block from the reference picture. That is, the most similar part from the reference picture is found using the flipped original block. Therefore, the prediction block uses a block that has not been flipped, and the residual block can also be a block that has not been flipped.
  • the decoder can flip the final reconstructed block according to the RRIBC type of the current block.
  • Figure 10 illustrates a method for predicting the current block using RRIBC in the horizontal direction.
  • Figure 11 illustrates a method for predicting the current block using RRIBC in the vertical direction.
  • (Xn, Yn) represents the center position of the surrounding blocks
  • (Xc, Yc) represents the center position of the current block
  • BV n h and BV n v represent the horizontal block vector and the vertical block vector of the surrounding blocks, respectively
  • BV C h and BV C v represent the horizontal block vector and the vertical block vector of the current block, respectively.
  • BV C h can be calculated as 2 * (Xn - Xc) + BV n h , and as shown in FIG.
  • BV C v when the RRIBC type of the current block is vertical, BV C v can be calculated as 2 * (y n - y c ) + BV n v .
  • the signs of BV n h and BV n v can be negative.
  • the video signal processing device can determine an optimal block vector by constructing a block vector candidate list. At this time, the video signal processing device can construct the block vector candidate list according to the RRIBC type of the current block. For example, when the RRIBC type of the current block is horizontal, the video signal processing device can construct the block vector candidate list using only the neighboring blocks of the current block encoded with RRIBC in the horizontal direction. In addition, the video signal processing device can construct the block vector candidate list regardless of the RRIBC type of the current block.
  • the block vector candidate list can be constructed using not only the neighboring blocks of the current block encoded with RRIBC in the horizontal direction, but also the neighboring blocks of the current block encoded with RRIBC in the vertical direction, and/or blocks encoded with general motion, and/or blocks encoded with block vectors.
  • the video signal processing device can construct a motion candidate list depending on whether the neighboring blocks of the current block are encoded in the IBC mode or the RRIBC mode. At this time, if the neighboring blocks of the current block are encoded in the RRIBC mode, the video signal processing device can construct the motion candidate list by additionally considering the RRIBC type. For example, when the video signal processing device constructs a motion candidate list for the current block, if the encoding mode of the neighboring blocks of the current block is the RRIBC mode and the RRIBC type is the vertical direction or the horizontal direction, the block vector of the neighboring blocks may not be included in the motion candidate list.
  • the video signal processing device when the video signal processing device predicts the current block using general motion, the video signal processing device can construct a motion candidate list regardless of the encoding mode of the neighboring blocks of the current block. In other words, the video signal processing device can construct a motion candidate list regardless of whether the neighboring blocks of the current block are encoded in the IBC mode or the RRIBC mode.
  • the video signal processing device may include block vectors of the surrounding blocks in the motion candidate list even if the encoding mode of the surrounding blocks of the current block is the IBC mode and the RRIBC type is the vertical direction or the horizontal direction.
  • the RRIBC encoding method is effective for images with symmetrical characteristics.
  • Symmetry can mean perfect horizontal (or vertical) symmetry with equal distances between the current block and the reference block around a central axis.
  • the vertical (or horizontal) direction (symmetry axis) of the current block can be colinear with the vertical (or horizontal) direction (symmetry axis) of the reference block.
  • the block vector in the vertical (or horizontal) direction can be set to '0'
  • the block vector in the horizontal direction can be set to any negative value other than '0'.
  • the current block and the reference block can be configured to be symmetric with different distances apart from one central axis between the current block and the reference block, and the current block and the reference block can be located on different vertical lines.
  • the block vector in the vertical direction can be set to any negative value other than '0'. That is, the video signal processing device can encode or decode the current block using a symmetric block having a block vector value of an arbitrary negative value other than '0' in both the horizontal and vertical directions.
  • FIG. 12 illustrates a block vector of a block encoded in Intra TMP mode according to one embodiment of the present specification.
  • the Intra TMP method is a method in which a video signal processing device constructs a reference template using pixel values of neighboring blocks adjacent to a current block, then finds the most similar part to the reference template in an already reconstructed area (reference block) within the current picture, and then uses the reference block (Ref. luma block of FIG. 12) as a prediction block for the current block.
  • the reference block Ref. luma block of FIG. 12
  • the video signal processing device can generate a prediction block for the luminance block by weighting and averaging the reference blocks predicted from the two block vectors of the current luminance block. This can be referred to as a fusion mode.
  • the video signal processing device can derive a block vector from a luminance block corresponding to the chrominance block, and then generate a chrominance prediction block using the block vector.
  • the block vector of the chrominance block may be the same as or different from the block vector derived from the luminance block.
  • the video signal processing device can derive filter coefficients using the correlation between samples around the reference block indicated by the block vector and samples around the current block, and apply filtering to the reference block indicated by the block vector using the derived filter coefficients.
  • the video signal processing device can use the filtered reference block as a prediction block of the current block. This can be referred to as the Intra TMP filtering mode.
  • the video signal processing device can apply compensation to the current prediction block through the block vector similar to the LIC method using motion information.
  • FIG. 13 illustrates a case where a current block is divided by GPM mode according to one embodiment of the present specification and the divided area is encoded by IBC mode.
  • the current block can be encoded or decoded in IBC-GPM mode.
  • IBC-GPM mode may mean a mode in which the current block is divided using GPM mode, and the divided region is encoded in intra prediction mode or IBC prediction mode.
  • the current block can be divided into two regions based on a dotted line.
  • one of the divided regions can be encoded in intra prediction mode, and the other can be encoded in IBC prediction mode.
  • the left region among the divided regions can be encoded in intra prediction mode, and the right region can be encoded in IBC prediction mode.
  • the region encoded in IBC prediction mode can be encoded in Intra TMP prediction mode, and this can be described as IntraTMP-GPM mode.
  • FIG. 14 illustrates how a current block is encoded in IBC-CIIP mode according to one embodiment of the present specification.
  • a video signal processing device can predict the current block using a weighted average between a block predicted in Intra mode and a block predicted in IBC mode, which can be referred to as IBC-CIIP mode.
  • a block predicted in Intra TMP mode can be used instead of a block predicted in IBC mode, which can be referred to as Intra TMP-CIIP mode.
  • a video signal processing device can obtain a reconstructed luminance block by adding a residual signal for a luminance prediction block of a current block and a luminance block, and can configure a CCP model by using a correlation between the reconstructed luminance block and the luminance prediction block.
  • the CCP model can be one of CCLM, MMLM, GLM, CCCM, MM-CCCM, GL-CCCM, CCCM-ND, and CCCM-MDF.
  • the CCP model derived from the luminance block can be applied to a chrominance prediction block to generate a first chrominance prediction block to which the CCP model is applied.
  • a final chrominance block can be generated by adding an error signal for the first chrominance prediction block and the chrominance block.
  • the video signal processing device can derive a CCP model through the correlation between the luminance block and the chrominance block of the reference block indicated by the block vector of the current luminance block.
  • the derived CCP model and the currently reconstructed luminance block can be used to generate Cb and Cr prediction blocks, which are chrominance prediction blocks for the current block. This is referred to as BVG CCP (block vector guided cross component prediction).
  • the CCP model can include at least one of CCLM, MMLM, GLM, MM-GLM, CCCM, MM-CCCM, GL-CCCM, GL-MM-CCCM, CCCM-ND, MM-CCCM-ND, CCCM-MDF, MM-CCCM-MDF, and Chroma Fusion.
  • the type of a CCP model may include at least one of CCLM, MMLM, GLM, MM-GLM, CCCM, MM-CCCM, GL-CCCM, MM-GL-CCCM, CCCM-ND, MM-CCCM-ND, CCCM-MDF, MM-CCCM-MDF, chroma fusion, BVG-CCCM, and CCP merge.
  • An MMLM may be composed of two CCLMs. If the types of CCP models between CCP models are different, they may be considered different CCP models. If the types of CCP models between CCP models are the same but the parameters between the CCP models are different, they may be considered different CCP models.
  • CCP models between CCP models may be considered different CCP models.
  • the type of a CCP model may be referred to as a CCP mode.
  • a video signal processing device can predict a chrominance signal through a weighted average between a chrominance block predicted through intra prediction mode and the current luminance block, without using the linear model (LM) mode.
  • the weight parameters can be derived using the CCCM method.
  • a video processing device constructs a model by additionally reflecting the gradient between a luminance sample corresponding to a chrominance sample in a linear model and surrounding luminance samples adjacent to the luminance sample, and can predict a chrominance signal through the model.
  • the CCP model used to predict a chroma block can construct a CCP candidate list using the CCP models used in the surrounding blocks of the current block, and derive the optimal CCP candidate from the CCP candidate list. This can be called CCP merge mode.
  • FIG. 15 illustrates an example of a reference region and filter shape used to derive CCCM parameters according to one embodiment of the present specification.
  • CCCM Convolutional cross-component intra prediction model
  • Fig. 15(a) shows the positional relationship between reference samples (vertical hatching, 1520) for applying CCCM to the current prediction block (diagonal hatching, 1510) and side samples (horizontal hatching) required when applying a cross-shaped filter.
  • the current prediction block (MxN) can be composed of reference samples in the upper 6 rows (2Mx6), reference samples in the left 6 rows (6x2N), and 6x6 reference samples in the upper left, where the ratio of the number of chroma to luma samples is 1:1.
  • a video signal processing device applies a cross-shaped sample (Fig. 15(b)) filter to a chroma sample prediction relationship (Fig. 15(c)) for CCCM, cases where the reference sample area is exceeded may occur. At this time, additionally required samples may be side samples.
  • the chroma sample prediction relationship of Fig. 15(c) may be applied to each chroma component (i.e., Cb, Cr). The sample at the C (Center) position in Fig.
  • Fig. 15(c) may be a luma sample corresponding to the Cb and Cr chroma samples, and N (North), E (East), S (South), and W (West) may be luma samples adjacent to the luma sample at the C position. Side samples may additionally require one sample for an area other than the reference sample depending on the position of the C sample. If the sample value existing at the position of the side sample is not available, the sample value at the unavailable position may be padded with the C sample value.
  • the B value can be an integer offset value as a bias value.
  • the B value can be an intermediate value of bitDepth (bit depth). In the case of 10-bit content, the B value can be 512.
  • MM-CCCM (multi-model CCCM) is a method that derives two CCCM parameters based on the average value of the reference area (or the restored current luminance block).
  • GL-CCCM Gradient and location based convolutional cross-component model
  • the video signal processing device can derive the chrominance sample for the current block using the luminance sample at the corresponding position from the predicted chrominance sample position, four samples around the luminance sample, and coefficient information.
  • the video signal processing device can derive the chrominance sample for the current block by reflecting the vertical and horizontal differences for the luminance sample at the corresponding position from the predicted chrominance sample position and eight samples around the luminance sample, and also using the position value of the current luminance sample and its coefficient information.
  • the video signal processing device can apply a downsampling filter to match the resolution difference between the luminance block and the chrominance block. This is to reduce the resolution of the luminance block to that of the chrominance block.
  • the mode that applies the downsampling filter can be described as CCCM-MDF (CCCM with multiple downsampling filters).
  • the video signal processing device can derive linear and nonlinear models between the luminance prediction block (Y') derived using the motion information of the current block and the first chrominance prediction block (Cb', Cr') derived using the motion information of the current block (Derive filter), and then generate a reconstructed luminance block of the current block using the luminance residual block of the current block, and apply the derived linear and nonlinear models to the reconstructed luminance block of the current block (Apply filter) to generate a second chrominance prediction block of the current block.
  • the video signal processing device can add the chrominance residual block to the second chrominance prediction block of the current block predicted using the linear and nonlinear models to finally generate the chrominance block (Cb, Cr) of the current block.
  • This method can be described as a cross-component residual model (CCRM).
  • CCRM, Inter CCCM, and Inter CCP may have the same meaning.
  • a method may be used in which the transform coefficient values obtained by transforming the residual signal are quantized and the quantized transform coefficients are coded.
  • the transform unit may obtain the transform coefficient values by transforming the residual signal.
  • the residual signal of a specific block may be distributed across the entire region of the current block. Accordingly, by performing a frequency-domain transformation on the residual signal, energy can be concentrated in the low-frequency region, thereby improving coding efficiency.
  • the encoder can obtain at least one residual block containing a residual signal for the current block.
  • the residual block may be the current block or one of the blocks split from the current block.
  • the residual block may be described as a residual array or a residual matrix containing residual samples of the current block.
  • the residual block may represent a block having the same size as the size of a transform unit or a transform block.
  • An encoder can transform a residual block using a transform kernel.
  • the transform kernel used for transforming the residual block may be a transform kernel having separable vertical and horizontal transform properties.
  • the transform for the residual block may be performed separately as a vertical transform and a horizontal transform.
  • the encoder may perform a vertical transform by applying a transform kernel in the vertical direction of the residual block.
  • the encoder may perform a horizontal transform by applying a transform kernel in the horizontal direction of the residual block.
  • a transform kernel may be used as a term referring to a set of parameters used for transforming a residual signal, such as a transform matrix, a transform array, a transform function, or a transform.
  • the transform kernel may be any one of a plurality of available kernels. Additionally, transform kernels based on different transform types may be used for each of the vertical and horizontal transforms. That is, before performing the first transformation, the transformation method for the vertical and horizontal directions can be derived using at least one or more of the intra prediction mode of the current block, the encoding mode, the transformation method parsed from the bitstream, and the size information of the current block. In addition, in order to reduce the computational complexity in the transformation process for large blocks, a process of processing the high-frequency region as '0' while leaving only the low-frequency region can be performed. This process is called high-frequency zeroing, and the transformation size at the time of the actual first transformation can be set for this zeroing. In the high-frequency zeroing process, the low-frequency region can be set to an arbitrary fixed size, and for example, the horizontal or vertical size can be a combination of 4, 8, 16, 32, etc.
  • the encoder can quantize the transform block transformed from the residual block by passing it to the quantization unit.
  • the transform block can include multiple transform coefficients.
  • the transform block can be composed of multiple transform coefficients arranged in a two-dimensional array.
  • the size of the transform block like the residual block, can be the same as either the current block or a block split from the current block.
  • the transform coefficients passed to the quantization unit can be expressed as quantized values.
  • the encoder may perform an additional transform before the transform coefficients are quantized.
  • the aforementioned transform method may be referred to as a primary transform, and the additional transform may be referred to as a secondary transform.
  • the secondary transform may be optional for each residual block.
  • the encoder may perform the secondary transform for areas where it is difficult to focus energy in the low-frequency region using only the primary transform, thereby improving coding efficiency.
  • the secondary transform may be added for blocks in which the residual values appear significantly in directions other than the horizontal or vertical directions of the residual block.
  • the residual values of an intra-predicted block may be more likely to change in directions other than the horizontal or vertical directions compared to the residual values of an inter-predicted block.
  • the encoder may additionally perform the secondary transform on the residual signal of the intra-predicted block. Additionally, the encoder may omit the secondary transform on the residual signal of an inter-predicted block. High-frequency zeroing in the first conversion can also be performed in the second conversion process.
  • whether to perform a secondary transform may be determined based on the size of the current block or the remaining block.
  • transform kernels of different sizes may be used based on the size of the current block or the remaining block.
  • an 8X8 secondary transform may be applied to a block in which the length of a shorter side among the width or the height is greater than or equal to a first preset length.
  • a 4X4 secondary transform may be applied to a block in which the length of a shorter side among the width or the height is greater than or equal to a second preset length and less than the first preset length.
  • the first preset length may be a value greater than the second preset length, but the present disclosure is not limited thereto.
  • the secondary transform may not be performed separately into a vertical transform and a horizontal transform.
  • Such a secondary transform may be referred to as a low frequency non-separable transform (LFNST).
  • transform for the residual signal in a specific region may be omitted.
  • Whether or not to perform transform for the residual signal in a specific region may be determined by a syntax element related to the transform of the specific region.
  • the syntax element may include transform skip information.
  • the transform skip information may be a transform skip flag. If the transform skip information for a residual block indicates transform skip, transform for the corresponding residual block is not performed. In this case, the encoder can immediately quantize the residual signal in the region where the transform is not performed.
  • the aforementioned transformation-related syntax elements may be information parsed from a video signal bitstream.
  • a decoder may entropy decode the video signal bitstream to obtain the transformation-related syntax elements.
  • an encoder may entropy code the transformation-related syntax elements to generate a video signal bitstream.
  • the decoder can obtain encoding information necessary for decoding by parsing the transmitted bitstream.
  • information related to the transformation process includes index information for the first and second transformation types and quantized transformation coefficients.
  • the inverse transformation unit can obtain a residual signal by inversely transforming the inverse quantized transformation coefficients.
  • the inverse transformation unit can detect whether an inverse transformation is performed for a specific region from a transformation-related syntax element of the specific region. According to one embodiment, if a transformation-related syntax element for a specific transformation block indicates a transformation skip, the transformation for the corresponding transformation block may be skipped. In this case, both the first inverse transformation and the second inverse transformation for the transformation block may be skipped.
  • the inverse quantized transformation coefficients can be used as a residual signal.
  • the decoder can use the inverse quantized transformation coefficients as a residual signal to reconstruct the current block.
  • the second inverse transform may be performed and the first inverse transform may be omitted, and the second inverse transformed value may be used as the residual signal.
  • the first inverse transform described above represents the inverse transform for the first transform and may be referred to as the inverse primary transform.
  • the second inverse transform represents the inverse transform for the second transform and may be referred to as the inverse secondary transform or the inverse LFNST.
  • the first (inverse) transform may be referred to as the first (inverse) transform
  • the second (inverse) transform may be referred to as the second (inverse) transform.
  • FIG. 16 illustrates types of transform kernels that can be used in video coding according to one embodiment of the present specification.
  • Fig. 16 shows the formulas of DCT-II, DCT-V (discrete cosine transform type-V), DCT-VIII (discrete cosine transform type-VIII), DST-I (discrete sine transform type-I), and DST-VII kernels applied to MTS.
  • DCT and DST can be expressed as functions of cosine and sine, respectively, and when the basis function of the transform kernel for the number of samples N is expressed as Ti(j), the index i represents the index in the frequency domain, and the index j represents the index within the basis function. That is, as i becomes smaller, it represents a low-frequency basis function, and as i becomes larger, it represents a high-frequency basis function.
  • the basis function Ti(j) When the basis function Ti(j) is expressed as a two-dimensional matrix, it can represent the j-th element of the i-th row, and since the transform kernels illustrated in Fig. 16 all have a separable characteristic, they can perform transformations in the horizontal and vertical directions respectively for the residual signal X. That is, when the residual signal block is X and the transform kernel matrix is T, the transform for the residual signal X can be expressed as TXT'.
  • T' means the transpose of the transform kernel matrix T. Since DCT and DST are in decimal form, not integer form, it is burdensome to implement them as they are in hardware encoders and decoders. Therefore, the decimal form transform kernel must be approximated to an integer form transform kernel through scaling and rounding.
  • the integer precision of the transform kernel can be determined as 8-bit or 10-bit, but if the precision is low, the encoding efficiency may decrease. Depending on the approximation, the orthonormal property of DCT and DST may not be maintained, but since the encoding efficiency loss due to this is not large, approximating the transform kernel to an integer form is advantageous in terms of implementing a hardware encoder and decoder.
  • IDTR Identity Transform
  • identity transformation constructs a transformation matrix by setting '1' at positions where rows and columns have the same value. However, here, the identity transformation uses an arbitrary fixed value other than '1' to increase or decrease the value of the input residual signal equally.
  • the transform is calculated by applying the transform kernel to the vertical and horizontal directions of the error block respectively, so it can be said to be a separable transform method.
  • the transform is calculated by applying the transform kernel only once without applying the transform kernel to the vertical and horizontal directions respectively, so it can be said to be a non-separable transform method.
  • the above-mentioned second-order transform is additionally applied to the first-order transformed transform coefficients of the block to which the DCT-2 transform is applied, so it can be said to be a two-step transform technique.
  • the above-mentioned second-order transform has high encoding efficiency, but it has the disadvantage of being complex because the transform kernel is applied a total of three times.
  • the NSPT (Non-separable primary transform) method which is a method of applying the transform using only the second-order transform method, can be applied.
  • the NSPT transform method is a non-separable transform method, and is calculated by applying the transform kernel only once to the vertical and horizontal directions of the error block, without applying the transform kernel separately.
  • the error block of the current block can be transformed or inversely transformed using one of the following transform methods: MTS, DCT2 + LFNST, or NSPT transform.
  • NSPT transform can be a transform method that replaces the existing DCT2 + LFNST transform method.
  • NSPT4x4 (16x16 kernel), NSPT4x8 (32x20 kernel), NSPT8x4 (32x20 kernel), NSPT8x8 (64x32 kernel), NSPT4x16 (64x24 kernel), NSPT16x4 (64x24 kernel), NSPT8x16 (128x40 kernel), NSPT16x8 (128x40 kernel), NSPT4x32 (128x20 kernel), NSPT32x4 (128x20 kernel), NSPT8x32 (256x24 kernel), NSPT32x8 (256x24 kernel).
  • NSPT similar to LFNST, consists of 35 sets of transform kernels, each of which can have three candidates.
  • the encoder can derive a set of transform kernels according to the intra prediction mode, and then generate and signal a bitstream containing information about the index of the optimal candidate among the three candidates.
  • the decoder can parse the information about the signaled index, and then use the transform kernel candidate indicated by the index information among the set of transform kernels derived using the intra prediction mode to inversely transform the current transform coefficients and obtain a residual block. Zero-out may not be performed on a 4x4 block to which NSPT is applied. In addition, the number of coefficients to be zeroed out may vary depending on the size of the NSPT kernel.
  • NSPT with a size of 32x20 can be applied to a 4x8 block or an 8x4 block. Therefore, out of the 32 transform coefficients, only 20 transform coefficients can be zeroed out, while the remaining 12 transform coefficients can be zeroed out.
  • FIG. 17 illustrates a transformation set table for LFNST and NSPT transformations according to one embodiment of the present specification.
  • the video signal processing device can derive the transform set index of the LFNST and NSPT transforms corresponding to the intra prediction mode (see FIG. 6) by referring to the transform set table of FIG. 17.
  • the LFNST and NSPT transform sets can vary depending on the intra prediction mode, information on whether the current block is a luminance block or a chrominance block, the horizontal and vertical sizes of the current block, and whether the intra prediction directional mode of the current block is an extended angle mode.
  • the arbitrary number can be an integer greater than or equal to 1, and can be 3.
  • the encoder can signal the index information for the optimal transform matrix among multiple transform matrices in the transform set by including it in the bitstream. After the decoder parses the index for the optimal transformation matrix, it can apply the inverse transformation using the transformation matrix corresponding to the index in the transformation set.
  • the encoder and decoder can apply three types of transformation kernels, LFNST4, LFNST8, and LFNST16, depending on the size of the transformation block. If the width and height of the current transformation block are greater than or equal to 16, the encoder and decoder can apply the LFNST16 transformation kernel. If the width and height of the current transformation block are greater than or equal to 8, the encoder and decoder can apply the LFNST8 transformation kernel. If the width and height of the current transformation block are less than 8, the encoder and decoder can apply the LFNST4 transformation kernel.
  • Figure 18 shows an example of ROI after LFNST transformation.
  • FIG. 19 illustrates a method for deriving a multi-transform set and a LFNST/NSPT set according to one embodiment of the present specification.
  • the encoder can select which one of MTS, DCT2 + LFNST, and NSPT to apply to the residual block, and can transform the residual block and obtain transform coefficients based on the selected transform method.
  • the encoder can signal information on which transform method was applied by including it in the bitstream. If the MTS transform is applied to the residual block, the transform coefficients of the residual block can be obtained by applying the MTS transform, and LFNST and NSPT transforms may not be applied. If the DCT2 + LFNST transform is applied to the residual block, the encoder can apply the DCT2 transform to the residual block to obtain the first transform coefficients, and apply the LFNST transform to the first transform coefficients to obtain the second transform coefficients.
  • the MTS and NSPT transforms may not be applied.
  • the video encoder can output transform coefficients by applying the NSPT transform to the residual block, and at this time, the MTS and DCT2 + LFNST transforms may not be applied to the residual block.
  • the decoder can parse information about which transform method was applied from the bitstream, and determine whether to apply one of the inverse transform methods among MTS, DCT2 + LFNST, and NSPT to the current transform coefficient based on the parsed information. Then, the decoder can perform an inverse transform on the transform coefficient based on the determined transform method and obtain a residual block. If the MTS transform is applied to the current transform coefficient, the decoder can perform an inverse MTS transform on the transform coefficient to obtain a residual block, and at this time, the LFNST and NSPT inverse transforms may not be applied.
  • the decoder can perform an inverse LFNST transform on the secondary transform coefficient to output a primary transform coefficient, and perform an inverse DCT2 transform on the primary transform coefficient to obtain a residual block, and at this time, the MTS and NSPT transforms may not be applied. If the NSPT transform is applied to the current transform coefficients, the decoder can obtain a residual block by performing the NSPT inverse transform on the current transform coefficients, and at this time, the MTS and DCT2 + LFNST transforms may not be applied.
  • a video signal processing device can derive a transform kernel for each of MTS, LFNST, and NSPT transforms (or inverse transforms) using an intra prediction mode.
  • the video signal processing device can determine which transform (or inverse transform) is applied among MTS, DCT2 + LFNST, and NSPT.
  • IBC Intra TMP
  • Merge e.g., AMVP, GPM, SGPM, CCLM, CCCM
  • Figure 20 illustrates a mapping table according to one embodiment of the present specification.
  • Figure 21 illustrates a conversion type set table according to one embodiment of the present specification.
  • Figure 22 illustrates a conversion type combination table according to one embodiment of the present specification.
  • FIG. 23 illustrates a threshold value table for an IDT conversion type according to one embodiment of the present specification.
  • a method for selecting a set of multiple transforms available to the current block in a video signal processing device is described.
  • the video signal processing device can derive the nSzIdxW and nSzIdxH values based on the size of the current block to map the horizontal and vertical sizes of the current block into a single variable.
  • nSzIdxW can be the minimum value among the logarithm of 2 calculated for the width of the current block, the difference of 2 with the decimal places discarded, and the three.
  • nSzIdxH can be the minimum value among the logarithm of 2 calculated for the height of the current block, the difference of 2 with the decimal places discarded, and the three.
  • the video signal processing device can derive the intra-directional mode (predMode) of the current block.
  • predMode intra-directional mode
  • the number of intra-prediction modes expanded from the existing 67 to 131 can be used, reducing the precision of the existing 67 modes.
  • the video signal processing device can derive the ucMode, nMdIdx, and isTrTransposed values.
  • ucMode can be set to '0'
  • nMdIdx can be set to '35'
  • isTrTransposed can be set to a value derived from MIP.
  • ucMode can be set to the intra directional mode (predMode) of the current block.
  • predMode can mean an index value of the intra directional mode.
  • predMode can be determined through an extended angle mode according to the aspect ratio of the current block.
  • the video signal processing device can clip predMode to a value between 2 and 66. If predMode is greater than the 34th angle mode, which is a diagonal mode, the isTrTransposed value can be set to 1, and if predMode is less than or equal to 34, the isTrTransposed value can be set to 0.
  • predMode is greater than 34
  • the video signal processing device resets the value of predMode to a value that is a difference between 67 (the maximum value of the intra directional mode index) plus 1. For example, if predMode is 35, the video signal processing device can reset the 35th angle mode to the 33rd angle mode (67+1-35(predMode)). If predMode is 66, the video signal processing device can reset the 66th angle mode to the 2nd angle mode (67+1-66(predMode)). That is, by making it symmetrical with respect to the 34th angle mode, which is a diagonal mode, there is an effect of reducing the size of the transformation mapping table of Fig. 35 by about half.
  • the video signal processing device can derive the nSzIdx value through nSzIdxW, nSzIdxH, and isTrTransposed values. If the isTrTransposed value is '1', the value obtained by multiplying nSzIdxH by 4 and then adding nSzIdxW can be set to nSzIdx. If the isTrTransposed value is '0', the value obtained by multiplying nSzIdxW by 4 and then adding nSzIdxH can be set to nSzIdx.
  • the video signal processing device can derive nTrSet, which is an index of an available transformation type set, according to the predefined table of FIG. 20 using nSzIdx, which is the size information of the current block, and nMdIdx, which is the intra-directional mode information of the current block.
  • FIG. 20 defines an index of a transformation type set according to the intra-screen directional mode (0 to 34 and MIP) of the current block and the size index (0 to 15) of the current block.
  • nTrSet can be 80, and if the size of the current block is 4x8 and the intra-screen directional mode of the current block is 13, nTrSet can be '7'.
  • the video signal processing device can derive a set of transformation types corresponding to nTrSet from the table of FIG. 21 by parsing mts_idx included in the bitstream.
  • the transformation types in the vertical and horizontal directions are set differently depending on whether predMode is a value greater than the 34th angle mode, which is a diagonal mode.
  • 0 to 79 in the vertical column of FIG. 21 may correspond to nTrSet, and 0 to 3 in the horizontal column may correspond to mts_idx.
  • 22 may be selected from (2, 17, 18, 22).
  • DST1 and DCT5 corresponding to index 22 of the transformation type combination table of FIG. 22 are selected, and the vertical transformation type of the current block may be set to DST1 and the horizontal transformation type may be set to DCT5.
  • 0 to 24 in the horizontal column of FIG. 22 are indices selected through FIG. 21, and 0 to 1 in the vertical column may represent vertical and horizontal transformation types, respectively. If the predicted directionality mode within the screen of the current block is greater than 34, which is a diagonal mode, the vertical and horizontal transformation types may be interchanged.
  • the vertical or horizontal transformation type can be reset to the IDT transformation type through the process described below.
  • the vertical transformation type may be reset to the IDT transformation type. If the absolute difference between the index of the on-screen prediction directional mode of the current block and the index of the horizontal mode, 50, is less than any predetermined value, the horizontal transformation type may be reset to the IDT transformation type.
  • the predetermined value is an integer and may be determined based on the horizontal or vertical size of the current block. For example, the predetermined value may be determined through the table of Fig. 20.
  • the table of Fig. 23 (a) shows a case where the threshold value is set differently whenever the horizontal or vertical size differs by 4, and the table of Fig.
  • the video signal processing device may not reset the vertical transformation type to the IDT transformation type, but may maintain the existing transformation type as is.
  • the encoder and decoder can reduce the amount of bits for encoding mts_idx by adaptively changing the number of transform type sets for each block.
  • the encoder and decoder can determine the number of transform type sets to be one, four, or six, depending on the sum of the absolute values of the transform coefficients of the current transform block. If the number of transform type sets changes, the maximum number of bins for signaling mts_idx may change. If the sum of the absolute values of the transform coefficients is less than or equal to 6, the number of transform type sets is one. Therefore, the encoder may not signal mts_idx. In this case, the decoder may not parse mts_idx.
  • the number of transform type sets may be four. If the sum of the absolute values of the transform coefficients is greater than 32, the number of transform kernel candidates may be six.
  • the encoder can signal mts_idx based on the maximum number of transformation type sets. Additionally, the decoder can parse mts_idx based on the maximum number of transformation type sets.
  • the encoder and decoder can use one of four transform kernel sets: ⁇ (DST7, DST7), (DST7, DCT8), (DCT8, DST7), (DCT8, DCT8) ⁇ .
  • the encoder can signal an index of which transform kernel set it used.
  • the decoder can parse the index to determine which transform kernel set to use for the current transform block.
  • the configured transform kernel set is (DST7, DCT8)
  • the encoder and decoder transform or inversely transform the current block using DST7 in the horizontal direction, and transform or inversely transform the current block using DCT8 in the vertical direction.
  • the encoder and decoder can set the maximum CU size to which Inter MTS can be applied to 32x32 for images larger than 1920x1080 resolution.
  • the encoder and decoder set the maximum CU size to which Inter MTS can be applied to images with a resolution other than 1920x1080 to 16x16. Therefore, the encoder and decoder can apply DCT2 transform in the horizontal and vertical directions without applying Inter MTS to transform blocks larger than 16x16, for example, transform blocks of size 32x32.
  • the encoder and decoder can use separable KLT instead of DST7 and DCT8 in transform and inverse transform of transform blocks of size equal to or smaller than 16x16.
  • FIG. 24 illustrates block boundaries and samples around the boundaries in a deblocking filtering process according to one embodiment of the present specification.
  • the part indicated by the dotted line between the P block and the Q block may denote a block boundary.
  • the block boundary may exist at any fixed size, and a block boundary may exist at every size of 4.
  • Figure 24 (b) shows samples for which filtering is performed based on block boundaries.
  • the video signal processing device can perform a process of alleviating blocking artifacts occurring at block boundaries by performing deblocking filtering on the currently restored block.
  • the deblocking filtering process can include a process of determining a transform block boundary, determining a sub-block boundary, determining a length of a filter to perform filtering, determining a filtering strength (bS), determining a filtering parameter, determining whether to perform filtering, and determining a filtering type.
  • the reconstructed coefficient t'k for an input coefficient tk depends only on the associated quantization index qk. That is, the quantization index for any reconstructed coefficient has a different value from the quantization indices for other reconstructed coefficients.
  • t'k may be a value of tk that includes quantization error, and may be different or the same depending on the quantization parameter.
  • t'k can be named a reconstructed transform coefficient or an inverse quantized transform coefficient, and the quantization index can also be named a quantized transform coefficient.
  • the reconstructed coefficients are spaced at equal intervals.
  • the distance between two adjacent reconstructed values is referred to as the quantization step size.
  • Reconstructed values can include zeros, and the entire set of available reconstructed values can be uniquely defined by the quantization step size.
  • the quantization step size can vary depending on the quantization parameter.
  • quantization reduces the set of acceptable reconstructed transform coefficients, and the number of elements in this set can be finite. This limits the ability to minimize the average error between the original and reconstructed images.
  • Vector quantization can be used as a method to minimize this average error.
  • a simple form of vector quantization used in video encoding is sign data hiding. This is a method in which the encoder does not encode the sign of a non-zero coefficient, and the decoder determines the sign of the coefficient based on whether the sum of the absolute values of all coefficients is even or odd. To achieve this, the encoder may increase or decrease the value of at least one coefficient, and at least one coefficient may be selected and adjusted to be optimal in terms of rate-distortion cost. In one implementation, a coefficient having a value close to the boundary of the quantization interval may be selected.
  • Trellis-Coded Quantization is used in video coding as an optimal path search technique to obtain optimized quantization values in dependent quantization.
  • Block-wise, quantization candidates for all coefficients in the block are arranged in a trellis graph, and the optimal trellis path between the optimized quantization candidates is searched for by considering the cost for rate-distortion.
  • dependent quantization applied to video coding can be designed so that the set of allowable reconstructed transform coefficients for a transform coefficient depends on the value of the transform coefficient preceding the current transform coefficient in the restoration order. At this time, by selectively using multiple quantizers according to the transform coefficients, the average error between the original image and the reconstructed image can be minimized, thereby increasing the encoding efficiency.
  • FIG. 25 is a diagram illustrating a process of generating a prediction block using DIMD according to one embodiment of the present invention.
  • the decoder can derive a predicted block using surrounding samples (blocks, pixels).
  • the surrounding samples may be blocks (pixels) surrounding the current block.
  • the decoder can determine intra-prediction modes and weight information for restoring the current block through a histogram of directional information (angle information) using the surrounding samples as input.
  • FIG. 26 is a diagram showing the locations of surrounding pixels used to derive directional information according to one embodiment of the present invention.
  • Figure 26 (a) shows when all neighboring blocks of the current block are available for deriving directional information
  • Figure 26 (b) shows when the upper boundary of the current block is a sub-picture, slice, tile, or CTU boundary
  • Figure 26 (c) shows when the left boundary of the current block is a sub-picture, slice, tile, or CTU boundary.
  • the neighboring blocks and the current block do not belong to the same sub-picture, slice, tile, or CTU, the neighboring blocks may not be used for deriving directional information.
  • the gray dots in Figure 26 indicate the locations of pixels actually used for deriving directional information
  • the dotted lines indicate sub-picture, slice, tile, and CTU boundaries.
  • pixels located at the boundary may be padded by one pixel outside the boundary to derive directional information. Such padding may enable more accurate directional information to be derived.
  • Equation 1 In order to derive direction information for a pixel at a specific location, a 3x3 Sobel filter of Equation 1 can be applied in the horizontal and vertical directions, respectively.
  • a in Equation 1 can denote pixel information (values) of the reconstructed neighboring blocks of the current block of 3x3 size.
  • the direction information ( ⁇ ) can be determined using Equation 2.
  • the decoder In order to reduce the computational complexity for deriving direction information, the decoder can derive the direction information ( ⁇ ) only by calculating Gy/Gx of Equation 1 without calculating the atan function of Equation 2.
  • directional information can be calculated for each gray dot shown in Fig. 26, and the directional information can be mapped to an angle of an intra prediction mode.
  • the intra prediction mode set can include a planar mode, a DC mode, and a plurality of (e.g., 65) angular modes (i.e., directional modes).
  • the intra prediction modes can be 67 modes, and the directional information (angle, ⁇ ) calculated through mathematical expression 2 can be a value in real units. Therefore, a process of mapping directional information to a specific intra prediction directional mode is required.
  • the directional mode described herein can be the same as the angular mode.
  • FIG. 27 is a diagram illustrating a method for mapping directional modes according to one embodiment of the present invention.
  • the intra prediction directional mode can be divided into four sections based on 0 degrees (index 18), 45 degrees (index 34), 90 degrees (index 50), and 135 degrees (index 66) (see FIG. 6).
  • the sections for determining the intra prediction directional mode can be divided into four sections from section 0 to section 3.
  • Section 0 can be from -45 degrees to 0 degrees
  • section 1 can be from 0 degrees to 45 degrees
  • section 2 can be from 45 degrees to 90 degrees
  • section 3 can be from 90 degrees to 135 degrees.
  • each section can include 16 intra prediction directional modes.
  • the directional mode can be determined as one of the four sections by comparing the signs and magnitudes of Gx and Gy calculated through mathematical expression 1.
  • interval 1 can be selected.
  • the intra prediction directional mode mapped to each interval can be determined through the directional information ( ⁇ ) calculated from mathematical expression 2. Specifically, the decoder extends the value by multiplying the directional information ( ⁇ ) by 2 ⁇ 16. Then, the decoder can compare the extended value with the numbers in the predefined table to find the value closest to the extended value and determine the intra prediction directional mode based on the closest value. At this time, there can be 17 values in the predefined table.
  • the values of the predefined table can be ⁇ 0, 2048, 4096, 6144, 8192, 12288, 16384, 20480, 24576, 28672, 32768, 36864, 40960, 47104, 53248, 59392, 65536 ⁇ .
  • the difference between the predefined table values can be set differently depending on the difference between the angles of the intra prediction directional mode.
  • the difference between the predefined table values may not match the distance between the angles of the intra prediction directional mode.
  • atan has a characteristic that the slope gradually decreases as the input value increases. Therefore, the above-defined table should also be set in numerical value by considering not only the difference between the angles of the intra prediction directional mode but also the nonlinear characteristic of atan. For example, the difference between the above-defined table values may be set to gradually decrease. Conversely, the difference between the above-defined table values may be set to gradually increase.
  • the available intra prediction directional modes may vary. That is, if the width and height of the current block are different, the interval for deriving the intra prediction directional mode may vary. In other words, the interval for deriving the intra prediction directional mode may change based on the width and height of the current block (e.g., the ratio of the width and height). For example, if the width of the current block is longer than the height, the intra prediction mode may be remapped to 67 to 80, and the intra prediction mode in the opposite direction may be excluded to 2 to 15.
  • a histogram can be used to derive an intra-prediction directional mode for restoring the current block. If, after obtaining directional information for surrounding blocks, there are more non-directional blocks than directional blocks, the prediction mode for the non-directional block may have the highest cumulative value in the histogram. However, since a directional mode must be derived for restoring the current block, the prediction mode for the non-directional block may be excluded even if it has the highest cumulative value in the histogram. That is, a smooth region with no gradient or directionality between surrounding pixels may not be used to derive an intra-prediction directional mode. For example, the prediction mode for a block without directional information may be planar or DC.
  • the left neighboring block may not be used to derive directional information, and directional information may be derived using only the upper neighboring block.
  • the decoder can generate a histogram using the G value calculated as in Equation 3 to emphasize the directionality.
  • the histogram may be a cumulative value in which the calculated G value is added to each generated intra prediction directional mode, rather than a frequency-based one in which '1' is added to each generated intra prediction directional mode.
  • FIG. 28 is a diagram showing a histogram for deriving an intra prediction directional mode according to one embodiment of the present invention.
  • the X-axis of Fig. 28 represents an intra prediction directional mode
  • the Y-axis represents the accumulated value of G values.
  • the decoder can select an intra prediction directional mode having the largest accumulated value of G values among the intra prediction directional modes. In other words, the decoder can select an intra prediction directional mode for the current block based on the accumulated value. Referring to Fig. 35, modeA having the largest accumulated value and modeB having the second largest accumulated value can be selected as the intra prediction directional modes.
  • the decoder can generate a final prediction block by weighting the prediction block generated with modeA, the prediction block generated with modeB, and finally the prediction block generated with the planar mode to generate a prediction block for the current block.
  • the weight of each prediction block can be determined using the accumulated value of modeA and modeB.
  • the weight for the prediction block generated with the planar mode can be set to 1/3 of the total weight.
  • the weight for the prediction block generated by modeA can be set to a weight corresponding to the value obtained by dividing the modeA accumulated value by the sum of the accumulated values of modeA and modeB.
  • the weight for the prediction block generated by modeB can be determined as a difference value between the modeA weight and 1/3 of the total weight.
  • the decoder can expand the range of the weight by multiplying the weight for the prediction block generated by modeA by an arbitrary value.
  • the weight for the prediction block generated by modeB and the weight for the prediction block generated in the planar mode can also be expanded in the same way.
  • FIG. 29 is a diagram illustrating a method for generating a prediction sample using intra prediction directional mode information and weights according to one embodiment of the present invention.
  • Fig. 29 illustrates the 'Intra prediction' and 'weighted prediction' processes described above.
  • the decoder can obtain a prediction sample by performing weighted prediction using the weight information of each of the multiple intra prediction directional modes.
  • the weight information can be reset based on at least one of the horizontal length of the current block, the vertical length, the quantization parameter information, and information on whether the current block is luminance or chrominance (Additional information).
  • the video signal processing device can perform the following process.
  • the video signal processing device can generate left, top, and top-left histograms by deriving directionality from the restored samples at the left, top, and top-left positions adjacent to the current block, respectively.
  • the video signal processing device can generate an entire histogram by deriving directionality from all of the restored samples at the left, top, and top-left positions. At this time, the video signal processing device can select the top five directionality with high frequency values using the entire histogram.
  • the video signal processing device can classify each of the top five directional modes into vertical, horizontal, and diagonal characteristics, depending on whether the directional mode is frequently induced from the left sample or from the upper sample.
  • the video signal processing device can classify each directional mode into vertical, horizontal, and diagonal characteristics by comparing the frequency values in the entire histogram of each directional mode with the frequency values in the left, upper, and upper-left histograms of each directional mode. This can be referred to as a position-specific feature weight.
  • the video signal processing device may determine whether to apply a weighted average to the current block by using at least one of the directional modes, the frequency value for the directional modes, and whether the directional modes have a characteristic (vertical, horizontal, or diagonal). If the frequency value of the upper second directional mode is greater than 0, and the first and second upper directional modes are angular modes (not planar mode or DC mode), the video signal processing device may apply the weighted average to the current block. Otherwise, the video signal processing device may not apply the weighted average to the current block.
  • the video signal processing device may set the upper second directional mode to the planar mode and apply the weighted average by using a weight of 3:1 between blocks predicted by the first directional mode and the second planar mode.
  • the video signal processing device can set the weight for each directional mode based on the frequency value for the directional mode and the sum of the frequency values.
  • the video signal processing device can perform a first block-by-block weighted average between the prediction blocks of the directional modes classified with the same characteristic using the previously calculated weights. Through this, the video signal processing device can generate a vertical characteristic prediction block, a horizontal characteristic prediction block, and a diagonal characteristic prediction block.
  • the video signal processing device can calculate a vertical feature weight, a horizontal feature weight, and a diagonal feature weight by calculating a weighted sum between the weights for the directional modes classified by the same feature.
  • the video signal processing device can perform a second sample-by-sample weighted average between the first weighted averaged blocks.
  • the video signal processing device can determine the mode of the second sample-by-sample weighted average by using at least one of a comparison between the horizontal and vertical size difference of the current block, the size of the current block, the vertical feature weight, the horizontal feature weight, and the diagonal feature weight.
  • the mode of the second sample-by-sample weighted average can be determined as the diagonal mode. If the vertical feature weight is greater than '0', the video signal processing device can determine the mode of the second sample-by-sample weighted average as the vertical mode. If the vertical feature weight is not greater than '0', the video signal processing device can determine the mode of the second sample-by-sample weighted average as the horizontal mode. When the mode of the second sample-wise weighted average is a vertical mode, the video signal processing device can apply a sample-wise weighted average using a vertical feature prediction block, a diagonal feature prediction block, and the vertical feature weights, and the diagonal feature weights.
  • the vertical feature weights may decrease and the diagonal feature weights may increase as the distance from the upper boundary of the current block increases.
  • the video signal processing device can apply a sample-wise weighted average using a horizontal feature prediction block, a diagonal feature prediction block, and the horizontal feature weights, and the diagonal feature weights.
  • the horizontal feature weights may decrease and the diagonal feature weights may increase as the distance from the left boundary of the current block increases.
  • the video signal processing device can apply a sample-wise weighted average using a horizontal feature prediction block, a vertical feature prediction block, a diagonal feature prediction block, and the horizontal feature weights, the vertical feature weights, and the diagonal feature weights.
  • the horizontal feature weights and vertical feature weights may decrease and the diagonal feature weights may increase as the distance from the left boundary and the top boundary of the current block increases.
  • FIG. 30 and FIG. 31 are diagrams showing templates used to derive an intra prediction mode of a current block according to one embodiment of the present invention.
  • the decoder can use a template, which is a reconstructed arbitrary region (pixel(s)) adjacent to the current block, to derive an intra-prediction mode of the current block.
  • the decoder can generate a prediction template for the template using neighboring pixels (reference) adjacent to the template. Then, the decoder can use the intra-prediction mode for the prediction template that is most similar to the already reconstructed template to reconstruct the current block.
  • TIMD Tempolate intra-mode derivation
  • the intra-prediction mode can be a mode with an index of 0 to 67, and may only be an intra-prediction mode within the MPM list derived from the neighboring blocks of the current block.
  • the intra-prediction mode can be an intra-prediction mode within the MPM list derived from the neighboring blocks of the current block and modes that differ from the intra-prediction mode by an arbitrary number.
  • the arbitrary number can be 1, 2, 3, ...
  • the intra prediction mode for the template may only correspond to a directional mode, and may not correspond to a non-directional mode (planar mode, DC mode).
  • the decoder can set the size of the template.
  • the width or height of the template can be 4, and if the width or height of the current block is 8 or less, the width or height of the template can be set to 2.
  • the decoder can set the type of the template.
  • the type of the template can be classified into a type that uses only left samples, a type that uses only upper samples, and a type that uses all of the left, upper, and upper-left samples.
  • the decoder can determine the type of the template based on whether the neighboring blocks are valid or whether the neighboring blocks can be used to derive an intra-prediction directional mode.
  • the TIMD mode can be set to a planar mode, and weighted averaging may not be performed.
  • the decoder can configure a template for the current block.
  • the decoder can derive intra prediction directional modes for neighboring blocks located to the left, above, upper-left, upper-right, and lower-left of the current block to determine whether the current block has directionality. v) If none of the neighboring blocks of the current block have directionality (e.g., non-directional mode (DC mode, planar mode, MIP mode, etc.)), the decoder can select one intra prediction directional mode with the minimum cost and not perform the TIMD mode.
  • directionality e.g., non-directional mode (DC mode, planar mode, MIP mode, etc.
  • weighted averaging using multiple prediction blocks may not be performed.
  • the process described below can be performed based on the intra prediction directional modes existing in the MPM list. This is because complexity may increase if all 67 intra prediction directional modes are checked.
  • the decoder can construct an MPM list.
  • the decoder can modify the MPM list by adding DC mode, horizontal mode, and vertical mode to the MPM list if they do not exist in the MPM list.
  • the decoder can compare costs by evaluating all intra prediction directional modes in the modified list.
  • the decoder can select a first mode with a lowest cost and a second mode with a second lowest cost.
  • the decoder can additionally perform an evaluation for an intra prediction directional mode corresponding to an index that is one less than or greater than the intra prediction directional mode index of the first mode and the intra prediction directional mode index of the second mode to improve accuracy.
  • the decoder can perform an additional evaluation and again select a third mode with a lowest cost and a fourth mode with a second lowest cost. Meanwhile, the first mode and the third mode may be the same, and the second mode and the fourth mode may be the same.
  • the decoder can determine whether to perform weighted averaging based on the costs of the third mode and the fourth mode.
  • the decoder can perform weighted averaging, and the weights of the third and fourth modes can be determined based on the costs of the third and fourth modes. If the difference between the cost of the third mode and the cost of the fourth mode is greater than a specific value, the decoder can generate a prediction block using only the third mode without performing weighted averaging.
  • the specific value may be a predetermined value.
  • the size of the template may vary depending on the horizontal or vertical length of the current block.
  • an above template may be configured that is longer than the horizontal length of the current block.
  • the vertical length of the above template may be a predetermined length.
  • a left template may be configured that is longer than the vertical length of the current block.
  • the horizontal length of the left template may be a predetermined length.
  • the predetermined length may be 1, 2, 3, ...
  • the reference pixels for deriving/predicting the template used for the TIMD mode can be changed.
  • the decoder can perform the TIMD mode by constructing only the left template of the current block, without constructing the upper template of the current block.
  • the reference pixels for predicting the left template can be the above reference pixel and the left reference pixel of the current block.
  • the height of the left template can be the same as the height of the current block, as shown in Fig. 31 (a).
  • the decoder can check whether the block adjacent to the left of the current block is a block that has already been restored, and if it is a block that has been restored, the height of the left template can be configured to be greater than the height of the current block.
  • the accuracy of prediction samples for the current block can be increased as the decoder references more adjacent pixels of the current block.
  • referencing more adjacent pixels increases the required memory.
  • the length of the upper template can be set to be equal to the horizontal length of the current block
  • the length of the left template can be set to be equal to the vertical length of the current block.
  • the decoder can use an intra prediction mode derived from a template to obtain prediction samples for the current block.
  • the decoder can generate prediction samples using neighboring pixels adjacent to the current block and adaptively select which neighboring pixels to use for prediction sample generation.
  • the decoder can use multiple reference lines to generate prediction samples, and the index information for these multiple reference lines can be included in the bitstream.
  • a new context for the indices of multiple reference lines for TIMD mode can be defined.
  • the increased number of contexts can be associated with increased memory and context switching complexity. Therefore, the context used to encode and decode the indices of multiple reference lines in TIMD mode can be reused from the existing context for the indices of multiple reference lines.
  • the transformation of the residual signal of the current block can be performed in two steps.
  • the first transform can be a transform such as DCT-II, DST-VII, DCT-VIII, DCT5, DST4, DST1, identity transformation (IDT), etc., which are adaptively applied horizontally and vertically, respectively.
  • a second transform can be additionally applied to the transform coefficients for which the first transform has been completed, and the second transform can be calculated as a matrix multiplication between the first-transformed transform coefficients and a predefined matrix.
  • the second transform can be described as a low frequency non-separable transform (LFNST).
  • the matrix transform set for the second transform can vary depending on the intra prediction mode of the current block. Coefficient information of the transform matrix used for the second transform can be included in the bitstream.
  • a transform set for the secondary transform can be determined based on an intra prediction mode derived from the DIMD mode or the TIMD mode.
  • Coefficient information of a transform matrix used for the secondary transform can be included in a bitstream.
  • a decoder can parse the coefficient information included in the bitstream to set matrix coefficient information of the secondary transform for the DIMD mode or the TIMD mode.
  • one of the two intra prediction modes derived from the TIMD mode can be used to select the primary transform or the secondary transform set.
  • each of the two intra prediction directional modes can be compared, and the intra prediction directional mode with the smallest cost can be used to select the primary transform or the secondary transform set.
  • one of the two intra prediction directional modes derived from DIMD can be used to select the primary transform or the secondary transform set.
  • the weights of each of the two intra prediction modes can be compared, and the intra prediction directional mode with the highest weight can be used to select the first or second transformation set.
  • TIMD mode is highly complex because it predicts the template of the current block and uses the intra prediction mode derived from the template to generate the prediction block of the current block. Therefore, when the decoder generates the prediction template for the template region, the existing reference sample filtering process may not be performed.
  • TIMD mode may not be applied if the ISP mode is applied to the current block or if the CIIP mode is applied to the current block.
  • the ISP mode or CIIP mode may not be applied to the current block to which TIMD mode is applied, or the syntax related to the ISP or CIIP may not be parsed. In this case, the value of the syntax related to the ISP or CIIP that is not parsed can be inferred as a predetermined value.
  • Template prediction can be performed by dividing the current block into a left template region and an upper template region, and an intra prediction mode can be derived for each template.
  • two or more intra prediction modes can be derived for each template, and there can be four or more intra prediction modes for the current block.
  • a prediction sample for the current block can be generated using all of the derived intra prediction modes, and the decoder can generate a final prediction block for the current block by performing a weighted average of the generated prediction samples.
  • at least three or more of the two or more intra prediction modes derived from template prediction, a planar mode, a DC mode, and a MIP mode can be used to generate the prediction sample.
  • the decoder when the decoder generates (obtains) a prediction sample for the current block, the decoder can generate a final prediction sample by performing a weighted average of the prediction samples generated using the intra prediction modes derived from template prediction and the planar mode.
  • prediction samples can be generated using the methods described above.
  • CIIP mode utilizes both intra-prediction and inter-prediction when generating prediction samples (blocks) for the current block.
  • the prediction sample for the current block can be generated as a weighted average of the intra-prediction samples and inter-prediction samples.
  • the DIMD mode or the TIMD mode can be used.
  • the intra prediction sample can be generated based on the DIMD combination information.
  • the decoder can generate the first prediction sample using the intra prediction mode with the highest weight and the second prediction sample using the intra prediction mode with the second highest weight.
  • the decoder can generate the final intra prediction block by performing a weighted average of the first prediction sample and the second prediction sample.
  • the decoder can generate the final intra prediction block by performing a weighted average of three prediction samples, including the planar mode predicted sample, the first prediction sample, and the second prediction sample among the neighboring blocks of the current block.
  • the intra prediction sample can be generated based on the TIMD combination information.
  • the decoder can generate two prediction samples using each of the two intra prediction modes. Then, the decoder can generate a final intra prediction sample by weighting the two prediction samples. At this time, the decoder can generate a final intra prediction sample by weighting the two prediction samples and the sample predicted in planar mode.
  • Intra prediction samples may have varying accuracy depending on their location. That is, pixels located farther away from the surrounding pixels used for prediction within a prediction sample may contain more residual signals than pixels located closer to the surrounding pixels. Therefore, the decoder can divide the prediction sample into vertical, horizontal, and diagonal directions depending on the direction of the intra prediction mode, and set different weights depending on the distance from the surrounding pixels used for prediction. This can be applied to intra prediction blocks generated using the CIIP mode or intra prediction blocks generated using two or more intra prediction modes, and different weights can be set for each pixel within the prediction block depending on the distance between the location of the reference pixel and the pixel location within the prediction block.
  • the intra prediction mode of the current block is a mode having a vertical or vertical-like direction
  • a higher weight can be set for each pixel location within the prediction block as the pixel location is closer to the top pixel
  • a lower weight can be set for each pixel location as the pixel location is farther away from the top pixel.
  • the decoder can generate a final prediction block by weighting the intra-prediction samples and inter-prediction samples.
  • the pixel-wise weights of the inter-prediction samples can be set by considering the pixel-wise weights of the intra-prediction samples.
  • the pixel-wise weights of the inter-prediction samples can be a value obtained by subtracting the pixel-wise weights of the intra-prediction samples from the sum of the total weights.
  • the sum of the total weights can be a value obtained by adding the weights of the intra-prediction samples and the weights of the inter-prediction samples at the pixel level.
  • the decoder can generate prediction samples based on each intra prediction mode, and then weight and average the generated prediction samples to generate a final prediction sample.
  • pixel-wise weights according to the intra prediction mode can be applied.
  • the pixel-level weights may be set based on at least one of the following: an intra prediction mode, the horizontal length and vertical length of the current block, a quantization parameter, information about whether the current block is luminance or chrominance, whether the surrounding block is intra coded, and information about the presence or absence of residual transform coefficients of the surrounding block.
  • FIG. 32 is a diagram illustrating a method for generating prediction samples (pixels) based on a plurality of reference pixel lines according to one embodiment of the present invention.
  • the video signal processing device can generate a prediction sample (4102) within the current block based on a first reference pixel line (reference line 1) adjacent to the current block (4101) and a second reference pixel line (reference line 2) adjacent above the first reference pixel line.
  • the prediction sample (4102) of FIG. 32 (a) is only a sample corresponding to a position according to an embodiment of the present invention, and the position of the pixel is not limited thereto. In the present specification, the meaning of “generate” by the video signal processing device may be the same as the meaning of “acquire” by the video signal processing device.
  • (b) of FIG. 32 is a drawing showing (a) of FIG. 32 in more detail.
  • the video signal processing device can generate a first prediction pixel (4103) using a smoothing filter, a cubic filter, or a Gaussian filter according to an intra prediction mode through six reference pixels of the first reference pixel line.
  • the video signal processing device can generate a second prediction pixel (4104) using a smoothing filter, a cubic filter, or a Gaussian filter according to the intra prediction mode through the six reference pixels of the second reference pixel line.
  • the video signal processing device can generate a third prediction pixel (4105) by performing a weighted average through an arbitrary set of weights on the generated first prediction pixel (4103) and second prediction pixel (4104).
  • the six reference pixels of the second reference pixel line may be reference pixels at a position shifted by one pixel to the right of each pixel of the first reference pixel line in consideration of the intra prediction mode of the current block, the position of the pixel to be generated, the position of the reference pixel line, etc.
  • the video signal processing device can generate a prediction sample (4102) within the current block based on the third prediction pixel (4105).
  • the video signal processing device may generate a prediction sample (4102) within the current block based on the third prediction pixel (4105) and the distance between the third prediction pixel (4105) and the prediction sample (4102) within the current block.
  • the weight used by the video signal processing device to generate the third prediction pixel (4105) may be an integer greater than or equal to 0.
  • the weight of the first prediction pixel (4103) may be 3, and the weight of the second prediction pixel (4104) may be 1.
  • the positions of the reference pixels used to generate the prediction sample may vary based on at least one of the following: the intra prediction mode of the current block, the positions of the pixels to be generated (e.g., the positions of the first prediction pixel (4103), the second prediction pixel (4104), the third prediction pixel (4105) in FIG. 41), the positions of the reference pixel lines (e.g., the positions of the first reference pixel line and the second reference pixel line in FIG. 41).
  • the video signal processing device can obtain a prediction sample within a current block according to the directionality of the intra prediction mode by using a sample of a pre-specified or signaled reference sample line.
  • the pre-specified reference sample line may be a reference sample adjacent to the current block.
  • the signaled reference sample line may be a sample at a position -X samples from the boundary of the current block, and X may be a signaled value. X may be 1, 2, 3, etc.
  • the video signal processing device can generate a prediction block by using a plurality of reference sample lines.
  • the pre-specified reference sample line or the signaled reference sample line may be referred to as a main reference sample line.
  • the video signal processing device can set a sub-reference sample line based on the main reference sample line.
  • the sub-reference sample line may be a reference sample line at a position Y samples apart from the main reference sample line.
  • Y may be an integer, and may be -3, -2, -1, 1, 2, 3, etc.
  • An encoder can signal information about a sub-reference sample line and include it in the bitstream, and a decoder can parse the information to set the sub-reference sample line.
  • a prediction block can be generated from each of the main reference pixel line and the sub-reference sample line using one intra prediction mode, and then a final prediction block can be generated by weighting and averaging each prediction block. This method can be called intra fusion.
  • FIG. 33 illustrates a method for predicting a sample using a plurality of reference pixel lines according to one embodiment of the present invention.
  • a video signal processing device may receive a plurality of reference pixel lines as input and perform intra prediction to generate a prediction block within a current block. Depending on which reference pixel line is used, a different prediction block may be generated, and the video signal processing device may generate a final prediction block by performing a weighted average according to the weights input for each prediction block.
  • the weights may be preset values. For example, the weight of a sample predicted by a main reference pixel line may be 3, and the weight of a sample predicted by a sub-reference pixel line may be 1.
  • the weights may be determined based on at least one or more of the size of the current block, the horizontal or vertical size of the current block, the intra-prediction mode of the current block, quantization parameter information, and the distance (or difference) between the main reference pixel line and the sub-reference pixel line.
  • the reference pixel line may be determined based on at least one or more of the size of the current block, the horizontal or vertical size of the current block, the intra-prediction mode of the current block, quantization parameter information, and MRL information.
  • the main reference pixel line may be a reference pixel line adjacent to the current block
  • the sub-reference pixel line may be a reference pixel line indicated by the MRL.
  • the main reference pixel line may be a reference pixel line indicated by the MRL
  • the sub-reference pixel line may be a reference pixel line that is located at an arbitrary fixed position relative to the reference pixel line indicated by the MRL, and the arbitrary fixed position may be an integer from -N to +N, where N may be an integer greater than 0.
  • the intra prediction mode used in the method for generating prediction samples within the current block described above may be the same for each reference pixel line. Or, conversely, the intra prediction mode used in the method for generating prediction samples within the current block described above may be different for each reference pixel line. That is, a signaled intra prediction mode may be used in the main reference pixel line, and a prediction mode (corresponding to the index) that is added or subtracted by an arbitrary value from (the index of) the intra prediction mode used in the main reference pixel line may be used in the sub-reference pixel line. At this time, the arbitrary value may be an integer greater than or equal to 1.
  • the video signal processing device may determine whether to increase or decrease the arbitrary value depending on the value of the intra prediction mode used in the main reference pixel line. For example, the video signal processing device may increase the intra prediction mode by an arbitrary value when the angle is negative, and may decrease the intra prediction mode by an arbitrary value when the angle is positive.
  • FIG. 34 is a structural diagram illustrating a method for determining an optimal reference pixel line using a plurality of reference pixel lines based on a template according to one embodiment of the present invention.
  • an encoder can receive multiple reference pixel lines as input and perform intra prediction to generate prediction blocks for a template. Depending on which reference pixel line is used, different prediction blocks can be generated. The encoder can perform weighted averaging based on various weight information input to each prediction block to ultimately generate a prediction block for the template. Depending on which reference pixel lines are used and which weights are used, multiple prediction blocks can be generated. After calculating the cost between each prediction block and the reference template, the encoder can rearrange the prediction blocks in ascending order based on the cost corresponding to each prediction block and construct a separate list using only a predetermined number of top candidates. In this case, the predetermined number can be an integer greater than or equal to 2, and can be 10.
  • the encoder can generate a prediction block for the current block using the combination information used to generate the prediction blocks in the separate list.
  • the encoder can then select the optimal candidate from the list in terms of image quality and bit rate, and then generate and signal a bitstream containing information about the index of the optimal candidate.
  • the decoder can then construct a separate list identical to the above-described method, parse the information about the optimal candidate index contained in the bitstream, and use the optimal combination information indicated by the index of the optimal candidate to generate prediction samples.
  • the encoded intra prediction mode can be any one of angular mode, planar mode, DC mode, and MIP mode. Prediction according to the angular mode can be performed according to 65 different angles, and prediction according to the MIP mode can be performed based on a predefined matrix.
  • the angular mode can be effective in blocks that have characteristics such as edges within the current block. However, if the current block has smooth characteristics, blocks predicted using the angular mode can generate discontinuous edges at the boundary between blocks or visible outlines within the block. This can be a factor that reduces encoding efficiency.
  • the DC mode can have the disadvantage of generating visible edges at the boundary between blocks at low bit rates.
  • the planar mode can improve the edge problems that occur in the angular and DC modes, and can generate predicted blocks without discontinuities.
  • FIG. 35 illustrates a method for generating prediction samples using a planar mode according to one embodiment of the present invention.
  • the video signal processing device can generate a linearly predicted value in the vertical direction and a linearly predicted value in the horizontal direction to generate a prediction sample within the current block.
  • the video signal processing device can generate a prediction sample (value) within the current block by weighting the linearly predicted value in the vertical direction and the linearly predicted value in the horizontal direction.
  • a linearly predicted value in the vertical direction (predV (x, y)) can be generated based on Equation 4, and a linearly predicted value in the horizontal direction (predH (x, y)) can be generated based on Equation 5. And, a new predicted value (pred (x, y)) can be generated based on Equation 6.
  • W may be the horizontal size (width) of the current block
  • H may be the vertical size (height) of the current block.
  • rec(x, y) may mean a pixel value at the (x, y) coordinate.
  • Predicted values (predV(x, y), predH(x, y), pred(x, y)) may mean a predicted pixel value at the (x, y) coordinate.
  • a video signal processing device may use only vertical linear prediction when performing prediction related to a current block according to a planar mode.
  • the video signal processing device may use only horizontal linear prediction when performing prediction related to a current block according to a planar mode. Therefore, the planar mode can be divided into three modes. That is, in addition to the method of weighting and averaging prediction blocks generated using conventional vertical and horizontal linear prediction, it can be divided into a vertical planar mode that uses only vertical linear prediction, and a horizontal planar mode that uses only horizontal linear prediction.
  • An encoder can generate and signal a bitstream including information on which of the three planar modes a current block used.
  • a decoder can generate a prediction block for the current block based on a planar mode determined by parsing information on which prediction mode was used included in the bitstream.
  • Figure 36 illustrates an intra prediction mode based on an extrapolation filter according to one embodiment of the present invention.
  • FIG. 36 illustrates an EIP (Extrapolation filter-based Intra Prediction) mode, which is an intra prediction mode based on an extrapolation filter according to one embodiment of the present invention.
  • EIP Extrapolation filter-based Intra Prediction
  • FIG. 36 A method for performing EIP mode by a video signal processing device according to an embodiment of the present invention is described through FIG. 36.
  • a video signal processing device can derive non-linear model parameters using a template configured using neighboring samples adjacent to a current block.
  • the template may be configured (L-shape) with left neighboring samples and upper neighboring samples of the current block, the template may be configured (left-only) with left samples of the current block, and the template may be configured (above-only) with upper samples of the current block.
  • the non-linear model may be CCCM.
  • a filter shape used to derive non-linear model parameters may be one of a square shape, a horizontally elongated (longer than wide) rectangular shape, and a vertically elongated (longer than wide) rectangular shape.
  • An encoder can obtain a bitstream including first information indicating a template type and a filter shape, and a decoder can determine the template type and the filter shape through the first information of the bitstream.
  • a video signal processing device can derive non-linear model parameters based on the template type and the filter shape, and can predict a current block sample by sample using the derived non-linear model parameters. When predicting the current block sample by sample, the video signal processing device can predict diagonally.
  • the video signal processing device can perform filtering on a predicted block using the EIP mode.
  • the encoder can generate and signal a bitstream including information indicating whether filtering is to be applied to a block predicted in the EIP mode.
  • the information indicating whether filtering is to be applied to the predicted block can be parsed to set whether filtering is to be applied to the predicted block.
  • the filtering can be as shown in Table 1 below. Table 1 shows filtering related to a 3x3 kernel and a 5x5 kernel according to one embodiment of the present invention.
  • a video signal processing device can derive an intra prediction mode using a block predicted in the EIP mode for a residual signal of a block encoded in the EIP mode, and then derive a transform kernel for MTS, NSPT, LFNST, etc. using the derived intra prediction mode.
  • the video signal processing device can use the DIMD method or a method similar to DIMD.
  • the EIP merge mode may be a mode in which a video signal processing device constructs an EIP merge list using filter shapes and filter coefficients of neighboring blocks previously encoded in the EIP mode, and then determines an EIP merge candidate having an optimal filter shape and filter coefficients for the current block.
  • the EIP merge candidate (optimal filter shape and filter coefficient) may be determined through an index included in the bitstream.
  • the EIP merge list may be constructed using adjacent spatial candidates, non-adjacent spatial candidates, temporal candidates, shifted temporal candidates, and history-based candidates of the current block.
  • the EIP merge list may be reordered based on a template cost.
  • the video signal processing device may store any one of the planar mode, the DC mode, the derived DIMD mode, and the intra prediction mode at the position indicated by the block vector (BV) for the intra prediction mode of the current block.
  • the derived DIMD mode may be an intra prediction mode derived by the DIMD method using pre-reconstructed samples adjacent to the current block.
  • the derived DIMD mode may be an intra prediction mode derived by the DIMD method using the current prediction block.
  • the derived DIMD mode may be an intra prediction mode derived by the DIMD method using samples of the current block that have been reconstructed after the reconstruction of the current block is completed.
  • the intra prediction mode indicated by the BV may be an intra prediction mode of a reference block indicated by the BV used for intra TMP prediction.
  • the stored intra prediction mode may be used to derive an MPM list for intra prediction of the next block.
  • the video signal processing device can use the intra prediction mode of the reference block indicated by the BV to derive an intra prediction mode to be stored for a block encoded in the IBC or intra TMP mode.
  • the intra prediction mode of the block adjacent to the current block can be derived as any one of the planar mode, the DC mode, the derived DIMD mode, and the intra prediction mode at the position indicated by the BV.
  • the video signal processing device may set a value obtained by converting an angle of a diagonal line dividing the current block into an intra prediction mode as the intra prediction mode of the current block when the current block is encoded in either the Spatial Geometry Partitioning Mode (SGPM) or the Geometry Partitioning Mode (GPM).
  • SGPM Spatial Geometry Partitioning Mode
  • GPSM Geometry Partitioning Mode
  • the intra prediction mode representing the current block may be the intra prediction mode applied to the region encoded in the intra prediction mode among the two regions.
  • the intra prediction mode representing the current block may be an intra prediction mode corresponding to the directional mode (any one of modes 2 to 66). If the intra prediction mode is not a directional mode (one of modes 2 to 66), the intra prediction mode representing the current block may be a value obtained by converting the angle of the diagonal line used in the segmentation process of the current block into the intra prediction mode.
  • the encoding mode of a neighboring block of a current block is one of SGPM and GPM, and one of two divided regions of the current block can be encoded with an intra prediction mode.
  • the intra prediction mode of a region encoded with an intra prediction mode among two divided regions of the neighboring block of the current block can be set to the intra prediction mode of the neighboring block.
  • the intra prediction mode is a directional mode (any one of modes 2 to 66)
  • the intra prediction mode of the neighboring block can be an intra prediction mode of the directional mode (any one of modes 2 to 66).
  • the intra prediction mode is not a directional mode (any one of modes 2 to 66)
  • the value can be obtained by converting the angle of the diagonal line used in the segmentation process of the current block into the intra prediction mode.
  • the derived intra prediction mode of the neighboring block can be added to the MPM list.
  • the intra prediction mode of the current block can be one of the derived DIMD mode and the intra prediction mode at the position indicated by the BV.
  • the derived DIMD mode can be an intra prediction mode derived by the DIMD method using already reconstructed samples adjacent to the current block.
  • the derived DIMD mode can be an intra prediction mode derived by the DIMD method using the current prediction block.
  • the derived DIMD mode can be an intra prediction mode derived by the DIMD method using samples of the current block that have been reconstructed after the current block has been reconstructed.
  • the intra prediction mode indicated by the BV can be an intra prediction mode of a reference block indicated by the BV that is used for IBC prediction. If the coding mode of the current block is the RRIBC coding mode, the intra prediction mode of the reference block indicated by the BV can be converted according to the flip direction of the current block, and the intra prediction mode of the current block can be the converted intra prediction mode.
  • Figure 37 illustrates a method for selecting an optimal intra prediction mode combination according to one embodiment of the present invention.
  • Figures 38 and 39 illustrate neighboring blocks of a current block according to one embodiment of the present invention.
  • the optimal combination of intra prediction modes can be determined based on the occurrence frequency of the intra prediction modes.
  • OBIC Currence-based intra coding
  • an intra coding mode based on the occurrence frequency of the intra prediction modes can be performed in the following order.
  • the video signal processing device can determine whether the OBIC mode is applicable to the current block. Whether the OBIC mode is applicable can be determined using at least one of the position of the current block, whether the current block is a luminance block or a chrominance block, whether the current block is encoded in an intra prediction mode, whether DIMD is applicable, the horizontal and vertical sizes of the current block, and the number of blocks used to derive the OBIC mode among the neighboring blocks of the current block. If the number of blocks used to derive the OBIC mode among the neighboring blocks of the current block is less than a predetermined number, the OBIC mode may not be applied to the current block, and syntax elements related to OBIC may not be signaled or parsed.
  • the video signal processing device can derive the intra prediction mode from the neighboring blocks of the current block.
  • the neighboring blocks may be blocks adjacent to the current block.
  • the blocks at positions A0, A1, B0, B1, and B2 in FIG. 38 may be neighboring blocks.
  • the neighboring blocks may be blocks that are not adjacent to the current block.
  • the blocks at positions Ax, Bx, Cx, ax, bx, and cx in FIG. 39 may be neighboring blocks. If the neighboring blocks of the current block are encoded in the IBC or Intra TMP mode, the reference block indicated by the BV of the current block can be used as the neighboring block for the OBIC mode.
  • a temporal neighboring block corresponding to the current block from another reference picture that is not identical to the POC (picture order count) of the current picture can also be used as the neighboring block for the OBIC mode.
  • a temporal neighboring block may be a block whose position has been moved using motion information from blocks adjacent to the current block.
  • neighboring blocks can be used as neighboring blocks for deriving an intra prediction mode for the OBIC mode can be determined based on one or more of the encoding mode of the neighboring block and the distance between the neighboring block and the current block. If the neighboring block is not encoded in the intra mode, the neighboring block cannot be used as neighboring blocks for the OBIC mode. Even if the neighboring block is encoded in the intra mode, if the encoding mode is one of the EIP, Intra TMP, and MIP modes, the neighboring block cannot be used as neighboring blocks for the OBIC mode.
  • the neighboring block can be used as neighboring blocks for the OBIC mode.
  • the neighboring block can be used as neighboring blocks for the OBIC mode.
  • the neighboring blocks available for OBIC mode can be sorted based on their distance from the current block. Only a pre-specified number of neighboring blocks in the sorted order can be used as neighboring blocks for OBIC mode.
  • the pre-specified number is an integer greater than or equal to 1, and can be 20.
  • the video signal processing device can derive an intra prediction mode from the selected surrounding block. Then, the video signal processing device can generate a histogram for the intra prediction mode based on the value of the derived intra prediction mode and the product of the horizontal length and the vertical length of the surrounding block (or the sum of the horizontal and vertical lengths of the surrounding block).
  • the value of the derived intra prediction mode can be an X-axis component (which can be described as a class in this specification) value of the histogram
  • the product of the horizontal length and the vertical length of the surrounding block (or the sum of the horizontal and vertical lengths of the surrounding block) can be a Y-axis component (which can be described as a degree in this specification) value of the histogram.
  • the intra prediction mode of the surrounding block is DIMD or TIMD mode
  • the intra prediction mode used for combination (blending) can also be added to the histogram.
  • the intra prediction mode of the surrounding block is OBIC mode
  • a predetermined number of intra prediction modes can be added to the histogram, and the added intra prediction mode can be an intra prediction mode other than the first intra prediction mode (the mode with the highest frequency in the histogram).
  • the frequency value can be the product of the horizontal length and the vertical length of the surrounding block (or the sum of the horizontal and vertical lengths of the surrounding block).
  • the frequency can be a value smaller (or larger) than the product of the horizontal length and the vertical length of the surrounding block (or the sum of the horizontal and vertical lengths of the surrounding block).
  • a small value (or large value) can be half (or twice) the product of the horizontal length and the vertical length of the surrounding block (or the sum of the horizontal and vertical lengths of the surrounding block).
  • the intra prediction mode of the surrounding blocks is the SGPM mode
  • the intra prediction mode of each region can be added to the histogram, and additionally, a value obtained by converting the segmentation angle into the intra prediction mode can be added to the histogram.
  • the intra-prediction mode stored in the surrounding blocks can be added to the histogram. If the intra-prediction mode of the surrounding blocks is GPM mode, the intra-prediction mode of each region can be added to the histogram, and additionally, the value of the segmentation angle converted to the intra-prediction mode can be added to the histogram.
  • the histogram frequency value for the intra prediction mode derived from the surrounding blocks may vary depending on the encoding mode of the surrounding blocks.
  • the encoding mode and the frequency value may be agreed upon in advance.
  • the pre-agreed encoding mode may be one of the intra prediction modes based on DIMD, TIMD, TMRL, SGPM, and MPM.
  • the pre-agreed frequency value may be the product of the horizontal length and the vertical length of the surrounding blocks (or the sum of the horizontal and vertical lengths of the surrounding blocks).
  • the frequency may be a value smaller (or larger) than the product of the horizontal length and the vertical length of the surrounding blocks (or the sum of the horizontal and vertical lengths of the surrounding blocks).
  • the small value (or large value) may be half (or twice) the product of the horizontal length and the vertical length of the surrounding blocks (or the sum of the horizontal and vertical lengths of the surrounding blocks).
  • the frequency value can be the product of the width and height of the surrounding blocks (or the sum of the width and height of the surrounding blocks).
  • the frequency can be a value smaller (or larger) than the product of the width and height of the surrounding blocks (or the sum of the width and height of the surrounding blocks).
  • a small value can be half (or twice) the product of the width and height of the surrounding blocks (or the sum of the width and height of the surrounding blocks).
  • intra prediction modes derived based on history can also be added to the histogram.
  • the histogram frequency value for the intra prediction mode derived from the surrounding blocks may vary depending on the distance between the surrounding blocks and the current block. The closer the distance between the surrounding blocks and the current block, the higher the histogram frequency value. Furthermore, the farther the distance between the surrounding blocks and the current block, the lower the histogram frequency value. For example, a value obtained by subtracting the distance between the surrounding blocks and the current block from the histogram frequency value for the intra prediction mode derived from the surrounding blocks (the product of the horizontal and vertical lengths of the surrounding blocks (or the sum of the horizontal and vertical lengths of the surrounding blocks)) may be used as the frequency value.
  • a method based on the occurrence frequency of an intra prediction mode can be used by a video signal processing device to construct a motion candidate list, a block vector candidate list, or a CCP candidate list.
  • the video signal processing device can construct the candidate list based on the occurrence frequency of surrounding blocks or reorder the candidates in order of occurrence frequency.
  • a method based on occurrence frequency can be used by a video signal processing device to derive a BV.
  • a video signal processing device can construct a BV histogram based on the occurrence frequency of BVs used in surrounding blocks, and then use the top N most frequently occurring BVs based on the BV histogram as the BV for the current block.
  • This can be called OBVC (Occurrence-based BV coding) mode.
  • N can be an integer greater than or equal to 1, such as 1, 2, or 3.
  • a method based on occurrence frequency can be used by a video signal processing device to derive LIC information.
  • the video signal processing device can construct an LIC histogram based on the occurrence frequency of LIC information used in surrounding blocks, and then use the most frequently occurring LIC based on the LIC histogram as the LIC information for the current block.
  • the above-mentioned occurrence frequency-based method can be used to determine one of the CCP model, MV, EIP model, and conversion method (MTS, LFNST, NSPT).
  • the video signal processing device can determine whether to apply the prediction method using multiple reference pixel lines described based on FIG. 32 based on whether the AIDR mode is applied to the current block. For example, if the AIDR mode is applied to the current block and the AIDR mode is the third range mode, the prediction method using multiple reference pixel lines may not be applied.
  • an MPM list may be used. Candidates in the MPM list may be reordered based on a template cost.
  • the video signal processing device may perform scaling and inverse scaling processes for the intra prediction mode of each candidate in the MPM list depending on whether the AIDR mode of the current block is applied. For example, if the AIDR mode of the current block is the first range mode, the intra prediction mode of each candidate in the MPM list may also be the first range mode.
  • the video signal processing device may scale the intra prediction mode of each candidate in the MPM list to the third range mode, and then generate a prediction template to calculate a template cost for the prediction template.
  • the intra prediction mode of each candidate in the MPM list may also be the third range mode.
  • the video signal processing device can generate a prediction template by using the intra prediction mode for each candidate in the MPM list as is without a scaling process, and can calculate a template cost for the prediction template.
  • the video signal processing device can determine whether the AIDR mode is allowed by using at least one of the encoding mode of the current block (DIMD, TIMD, Intra TMP, MIP, EIP, SGPM, TMRL, BDPCM, ISP), reference sample line information, horizontal and vertical size information of the current block, and information on whether the current block is a luminance component block. For example, if the encoding mode of the current block is not DIMD, TIMD, Intra TMP, MIP, EIP, SGPM, TMRL, BDPCM, or ISP mode, the reference sample line is 0, and the current block is a luminance component block, the AIDR mode may be allowed for the current block. If the AIDR mode is allowed, the encoder can generate and signal a bitstream including information related to AIDR, and the decoder can parse the information related to AIDR to determine whether the AIDR mode is applied to the current block.
  • the encoding mode of the current block DIMD, TIMD, Intra TMP,
  • Figure 40 illustrates a method of using a candidate list based on a prediction mode according to one embodiment of the present invention.
  • a video signal processing device can generate a prediction block of a current block using a candidate list based on a prediction mode.
  • the video signal processing device can configure a prediction mode candidate list for the current block.
  • the video signal processing device can configure the prediction mode candidate list using at least one of neighboring block information, DIMD information of the current block, TIMD information of the current block, MPM list of the current block, and Non-MPM list of the current block.
  • the neighboring block information may be a block adjacent to the current block, a block that is not adjacent to the current block and is separated by a predetermined distance, a neighboring block stored in a separate memory, etc.
  • the neighboring block information may be intra-prediction directional mode information of the neighboring block and a weight value for each mode.
  • the predetermined distance may be determined based on at least one of the upper-left sample position of the current block, the horizontal and vertical sizes of the current block, and the predetermined horizontal and vertical sizes. For example, a video signal processing device can derive a neighboring block based on a position shifted horizontally to the left by the width of the current block based on the upper left sample position of the current block and a position shifted vertically upward based on the upper left sample position of the current block.
  • a method for a video signal processing device to construct a candidate list based on a prediction mode is described.
  • the video signal processing device can generate a prediction mode candidate using at least one of neighboring block information, DIMD information of a current block, TIMD information of the current block, an MPM list of the current block, a Non-MPM list of the current block, DIMD information derived from a cumulative histogram of multiple histograms used to derive DIMD from neighboring blocks, and a top N (predetermined number) intra prediction modes with a high occurrence frequency among intra prediction modes used in neighboring blocks.
  • the predetermined number may be an integer of 5.
  • a prediction mode candidate based on occurrence frequency may include five intra prediction modes.
  • the prediction mode may be composed of two or more intra prediction directional modes, and the intra prediction directional modes of one prediction mode candidate may be different from each other.
  • the prediction mode may only include intra prediction directional modes that have directionality.
  • the prediction mode may not include a planar mode, which is a non-directional mode. If the intra prediction directional mode derived from the neighboring block is a planar mode, the intra prediction directional mode derived from the neighboring block may be excluded from the prediction mode. In addition, the prediction mode may not include the DC mode, which is a non-directional mode. If the intra prediction directional mode derived from the neighboring block is a DC mode, the intra prediction directional mode derived from the neighboring block may be excluded from the prediction mode.
  • the prediction mode candidate generated by the above-described method may be added to the prediction mode candidate list.
  • the video signal processing device may determine whether the same prediction mode candidate exists in the prediction mode candidate list, and only if it does not exist, may add the generated prediction mode candidate to the prediction mode candidate list.
  • the maximum size of the prediction mode candidate list may be a pre-specified number, and the pre-specified number may be an integer, such as 25. If the maximum size of the prediction mode candidate list is the pre-specified number, the video signal processing device may not add any more prediction mode candidates.
  • a video signal processing device can generate a reordered prediction mode candidate list by reordering a prediction mode candidate list based on template costs. Alternatively, the reordering process may not be performed. Reordering based on template costs may be performed in the above-described manner using the templates of FIG. 30 or FIG. 31.
  • the video signal processing device can configure a reference template using reconstructed neighboring samples adjacent to a current block.
  • the video signal processing device can generate a prediction template for the reference template using prediction mode candidates in the prediction mode candidate list and pre-designated reference sample lines (e.g., Reference lines 1, 2, 3, ... of FIG. 8).
  • the pre-designated reference sample line may be Reference line 1 (e.g., a line adjacent to the current block template).
  • the video signal processing device can calculate a cost between the reference template and the prediction template.
  • the cost may be the sum of the absolute values of the differences (SAD) between samples.
  • the cost may be the sum of the absolute values of the differences (MR-SAD) between the mean difference sample values obtained by subtracting the mean of each template from each sample value.
  • the prediction templates generated using each intra-prediction directional mode may be weighted averaged by applying a predetermined weight, and the video signal processing device may generate the weighted averaged prediction template.
  • the weight may be a predetermined value, and the weights for each intra-prediction directional mode may be the same or different.
  • the list of prediction mode candidates may be re-sorted based on the calculated cost, and may be re-sorted in ascending order.
  • a video signal processing device can reconstruct a prediction mode candidate list using an MPM list and a rearranged prediction mode candidate list. At this time, the video signal processing device can construct a prediction mode candidate list using a portion of the MPM list and a portion of the rearranged prediction mode candidate list. Candidates starting from the first candidate of the MPM list up to a predetermined number can be added to the prediction mode candidate list, and the predetermined number can be 5. Candidates from among the prediction mode candidates of the rearranged prediction mode candidate list can be added to the prediction mode candidate list in a predetermined number in order from lowest cost to highest cost, and the predetermined number can be an integer and can be 16.
  • the encoder can determine an optimal prediction mode candidate for the current block from the derived prediction mode candidate list (or the prediction mode candidate list if the prediction mode candidate list reconstruction process is not performed), and then generate and signal a bitstream including index information for the optimal prediction mode candidate.
  • the decoder can parse the index information for the optimal prediction mode candidate from the bitstream and obtain a prediction block for the current block using the determined optimal prediction mode candidate.
  • the video signal processing device can obtain a final prediction block of the current block through a weighted average between a prediction block obtained based on a planar mode (or a DC mode) and a prediction block obtained using the optimal prediction mode candidate.
  • Whether a method for generating a prediction block using a candidate list based on a prediction mode is activated may be determined based on at least one of whether the current block is a luminance block or a chrominance block, whether an intra prediction mode is applied to the current block, whether one of DIMD, TIMD, SGPM, ISP, MIP, Intra TMP, and TMRL modes is applied to the current block, reference pixel line information of the current block, horizontal and vertical sizes of the current block, and whether the current block is located at the upper boundary of a CTU including the current block.
  • the method for generating a prediction block using a candidate list based on a prediction mode may not be activated, and the video signal processing device may not signal or parse syntax related to the method for generating a prediction block using a candidate list based on a prediction mode.
  • the candidate list based on the derived prediction mode can be used when the coding mode of the current block is one of DIMD, TIMD, SGPM, MIP, Intra TMP, and TMRL.
  • the video signal processing device can add the prediction mode derived using DIMD to a candidate list based on the derived prediction mode.
  • the candidate list based on the derived prediction mode can be reordered based on the template cost.
  • the encoder can generate and signal a bitstream including index information for the optimal prediction mode within the candidate list based on the derived prediction mode, and the decoder can parse the index information to determine the prediction mode for the current block within the candidate list based on the derived prediction mode.
  • the video signal processing device can add the prediction mode derived using TIMD to a candidate list based on the derived prediction mode, and the candidate list based on the derived prediction mode can be reordered based on the template cost.
  • the encoder can generate and signal a bitstream including index information for the optimal prediction mode in the candidate list based on the derived prediction mode, and the decoder can parse the index information for the optimal prediction mode to determine the optimal prediction mode in the candidate list based on the derived prediction mode.
  • the video signal processing device can use a candidate list based on the derived prediction mode to derive an intra prediction mode of the two divided regions, the encoder can generate and signal a bitstream including index information on an optimal prediction mode for one or more regions among the two divided regions, and the decoder can parse the index information to determine a prediction mode for one or more regions among the two divided regions from the list.
  • the video signal processing device can add block vector candidates derived using intra-TMP to a candidate list based on the derived prediction mode, and the candidate list based on the derived prediction mode can be reordered based on the template cost.
  • the encoder can generate and signal a bitstream including index information for an optimal prediction mode within the candidate list based on the derived prediction mode, and the decoder can parse the index information to determine the optimal prediction mode within the candidate list based on the derived prediction mode.
  • the video signal processing device can construct a unified candidate list using the candidate list based on the induced prediction mode and the reference sample line.
  • the unified list can be reordered based on the template cost.
  • the encoder can generate and signal a bitstream including index information for the optimal prediction mode and reference sample line in the candidate list based on the induced prediction mode, and the decoder can parse the information for the index to determine the optimal prediction mode reference sample line in the candidate list based on the induced prediction mode from the unified list.
  • the Non-MPM list can be reordered based on template cost using templates, and the Non-MPM list can be used to signal or parse the optimal intra prediction mode.
  • the MPM list (e.g., Primary MPM list, Secondary MPM list) or Non-MPM list for the current block can be organized or reordered according to the occurrence frequency of intra prediction modes used in the neighboring blocks.
  • the intra prediction modes used in the neighboring blocks can be at most J intra prediction modes if the neighboring blocks are DIMD mode, at most K intra prediction modes if the neighboring blocks are TIMD mode, at most L intra prediction modes if the neighboring blocks are SGPM mode, and if the neighboring blocks are intra TMP or IBC mode, they can be intra prediction modes stored in the block to which the intra TMP or IBC mode is applied (or intra prediction modes of the block indicated by the block vector of the block to which the intra TMP or IBC mode is applied).
  • Information about the neighboring blocks can include blocks adjacent to the current block, blocks that are not adjacent to the current block but are separated by a predetermined distance, neighboring blocks stored in a separate memory, etc.
  • information about the surrounding blocks may include intra prediction directional mode information of the surrounding blocks and weight values for each mode.
  • the video signal processing device may generate a histogram for the intra prediction mode using the intra prediction mode derived from the surrounding blocks. At this time, J, K, and L may be integers, and may be 5, 2, and 2, respectively.
  • the video signal processing device may construct an MPM list for the current block using the histogram for the intra prediction mode.
  • MPMs may be added to the primary MPM list in order of highest occurrence frequency to lowest occurrence frequency, and when the primary MPM list is filled to a predetermined maximum number, they may be added to the secondary MPM list in order of the next occurrence frequency. When the secondary MPM list is filled to a predetermined maximum number, they may be added to the non-MPM list in order of the next occurrence frequency.
  • the histogram for the intra prediction mode may be updated for each block and used to construct the MPM list or the non-MPM list of the block.
  • the video signal processing device can first configure the MPM list of the current block, and then reorder the MPM list or the Non-MPM list using the histogram for the intra prediction mode. Specifically, the video signal processing device can sequentially set the reference intra prediction mode in the order of high occurrence frequency to low occurrence frequency in the histogram for the intra prediction mode, and then reorder the MPM list or the Non-MPM list based on the reference intra prediction mode. In addition, the video signal processing device can change the order of the intra prediction mode that is the same as the reference intra prediction mode or has a difference of a predetermined value in the MPM list or the Non-MPM list to a higher order in the MPM list or the Non-MPM list.
  • the predetermined value can be an integer of 3.
  • the order in which the video signal processing device adds intra prediction modes to the Non-MPM list may vary based on the horizontal and vertical sizes of the current block. For example, if the horizontal size of the current block is greater than the vertical size, intra prediction modes (e.g., the prediction modes of FIG. 6) may be added in the order from a pre-specified first intra prediction mode to a pre-specified second intra prediction mode.
  • the first intra prediction mode may be the prediction mode of index 66
  • the second intra may be the prediction mode of index 2.
  • the intra prediction modes may be added in the order of a pre-specified first intra prediction mode to a pre-specified second intra prediction mode, and then in the order of a pre-specified third intra prediction mode to a pre-specified fourth intra prediction mode.
  • the first intra prediction mode may be a prediction mode of index 34
  • the second intra prediction mode may be a prediction mode of index 66
  • the third intra prediction mode may be a prediction mode of index 33
  • the fourth intra prediction mode may be a prediction mode of index 2.
  • a video signal processing device can use one intra prediction mode as a reference intra prediction mode and additionally derive one or more intra prediction modes through a predefined rule.
  • the video signal processing device can generate one or more prediction blocks using the reference intra prediction mode and the derived intra prediction mode.
  • the video signal processing device can generate a final prediction block by weighted averaging (fusion) the plurality of prediction blocks.
  • the predefined rule may configure an additional intra prediction mode by adding or subtracting a predefined value based on the reference intra prediction mode.
  • the predefined value may be an integer greater than or equal to 1.
  • the reference intra prediction mode is mode 18, the additionally derived intra prediction modes may be mode 17 (18-1) or mode 19 (18+1).
  • the video signal processing device can generate a plurality of prediction blocks using one or more reference pixel lines and then weighted averaging (fusion) the prediction blocks to generate a final prediction block.
  • the method of generating a final prediction block by weighting and averaging multiple prediction blocks can be described as a fusion method based on a reference intra prediction mode.
  • a fusion method based on a reference intra prediction mode can be applied in various ways. For example, it can be applied based on a candidate list for the reference intra prediction mode.
  • a video signal processing device can determine whether a fusion method based on a reference intra prediction mode is applied to the current block using one or more of the position of the current block, the horizontal and vertical sizes of the current block, whether the current block is a luminance block or a chrominance block, whether the coding mode of the current block is an intra mode, and whether the coding mode of the current block is one of BDPCM, DIMD, TIMD, Intra TMP, MIP, SGPM, TMRL, EIP, and IBC modes.
  • the video signal processing device can configure a candidate list for the reference intra prediction mode.
  • the candidate list can include all intra prediction modes.
  • the candidate list can include only pre-specified intra prediction modes.
  • the candidate list can include only directional intra prediction modes excluding the planar mode and the DC mode.
  • the candidate list may include only directional intra prediction modes excluding the planar mode, the DC mode, the 2nd mode (see FIG. 6), and the 66th mode (see FIG. 6).
  • the video signal processing device may calculate a cost based on the template cost for each intra prediction mode in the candidate list, and then reorder the candidate list based on the cost.
  • the video signal processing device may configure the final candidate list using only a pre-specified number of candidates with low template costs in the candidate list.
  • the pre-specified number may be an integer greater than or equal to 2.
  • the encoder may generate and signal a bitstream including information indicating whether a fusion mode based on a reference intra prediction mode is applied to the current block.
  • the encoder may generate and signal a bitstream including an index indicating an optimal candidate in the candidate list when the fusion mode based on the reference intra prediction mode is applied.
  • the decoder can parse information indicating whether a fusion mode based on a reference intra prediction mode is applied to the current block, and determine whether a fusion mode based on the reference intra prediction mode is applied to the current block based on the parsing result.
  • the decoder can parse an index indicating an optimal candidate, and determine an optimal candidate within a candidate list based on the parsing result.
  • the video signal processing device can additionally derive one or more intra prediction modes through a predefined rule using the optimal reference intra prediction mode for the current block.
  • the video signal processing device can then generate a plurality of prediction blocks using the optimal reference intra prediction mode and the derived intra prediction modes, and then perform a weighted average (fusion) of the plurality of prediction blocks to generate a final prediction block.
  • the video signal processing device can determine a candidate with a minimum template cost from among the candidate list as the optimal reference intra prediction mode.
  • the encoder may not include the index indicating the optimal candidate in the bitstream, and the decoder may not parse the index indicating the optimal candidate.
  • the weights used may be predefined.
  • the weight for the reference intra prediction mode may be greater than the weight for the derived intra prediction mode.
  • the weight for the reference intra prediction mode may be 32, and the weight for the derived intra prediction mode may be 16. Since the range of samples is widened as the weights are multiplied by each prediction block, the video signal processing device may perform a process of adjusting the range back to the original sample range. To this end, the video signal processing device may adjust the range by applying (X >> 6) to each sample.
  • X may represent the value of the sample.
  • the video signal processing device may perform weighted averaging by applying a predefined weight derivation method when performing weighted averaging (fusion) of multiple prediction blocks.
  • the predefined weight derivation method may be a method of determining a weight for each prediction block based on a template cost. In order to set a higher weight as the template cost is smaller, the video signal processing device can calculate an integer weight for each intra prediction mode by multiplying the total weight value by the sum of all template costs for each intra prediction mode (A) minus the value of each template cost, dividing the result by A, and then multiplying the result by the total weight value.
  • the total weight value can be 64.
  • a video signal processing device may use a predefined probability model when encoding and/or decoding information indicating whether a fusion mode based on a reference intra prediction mode is applied to a current block.
  • the predefined probability models may vary, and the video signal processing device may select one of the various probability models based on information of neighboring blocks adjacent to the current block and encoding information of the current block. For example, if both the left neighboring block and the upper neighboring block adjacent to the current block have the fusion mode based on the reference intra prediction mode applied, the video signal processing device may use a predefined first probability model.
  • the video signal processing device may use a predefined second probability model. If neither the left neighboring block nor the upper neighboring block adjacent to the current block has the fusion mode based on the reference intra prediction mode applied, the video signal processing device may use a predefined third probability model. At this time, the first probability model, the second probability model, and the third probability model may be different from each other. At this time, the initial values of the first probability model, the second probability model, and the third probability model may be the same.
  • Information indicating whether a fusion mode based on a reference intra prediction mode is applied to a current block can be signaled as a sub-mode of a pre-specified encoding mode.
  • the pre-specified encoding mode can be one of DIMD, TIMD, Intra TMP, MIP, EIP, TMRL, SGPM, and ISP.
  • the video signal processing device can signal or parse information indicating whether a fusion mode based on a reference intra prediction mode is applied to a current block only when the DIMD mode is applied to the current block.
  • the video signal processing device can apply the fusion mode based on the reference intra prediction mode to the intra prediction mode derived by the DIMD method to generate a prediction block.
  • the video signal processing device may apply the fusion method based on the reference intra prediction mode to all encoding modes in which a prediction block is generated based on the intra prediction mode, without signaling or parsing information indicating whether the fusion method based on the reference intra prediction mode is applied to the current block.
  • the fusion method based on the reference intra prediction mode may be applied to all modes in which a prediction block is generated based on the intra prediction mode among intra prediction modes based on DIMD, TIMD, Intra TMP, MIP, EIP, TMRL, SGPM, ISP, and MPM.
  • a video signal processing device can convert the intra prediction mode into a wider range of intra prediction modes to generate a prediction block.
  • the conversion to a wider range can be calculated as "(MODE ⁇ 1) - 2", and the planar mode and DC mode may not be converted.
  • the conversion to the original range can be calculated as "(MODE>>1) + 1".
  • MODE can be an index of the intra prediction mode of FIG. 6.
  • the wider range of intra prediction modes can also be used when calculating template costs.
  • the fusion method based on the reference intra prediction mode can be applied to each intra prediction mode when the intra prediction mode is used in DIMD, TIMD, intra TMP, MIP, EIP, TMRL, SGPM, and ISP.
  • the fusion method based on the reference intra prediction mode can be applied only to a pre-specified reference sample line.
  • the reference sample line may be a reference sample adjacent to the current block.
  • PDPC based on the intra prediction mode may be applied to each block predicted using the fusion method based on the reference intra prediction mode.
  • a prediction block generated using the reference intra prediction mode and the derived intra prediction mode can be obtained (generated) using one or more reference sample lines.
  • a video signal processing device can obtain multiple prediction blocks using one or more reference sample lines and a reference intra prediction mode, and the video signal processing device can obtain a fused first prediction block by performing a weighted average on each of the obtained prediction blocks.
  • the video signal processing device can generate a plurality of prediction blocks using one or more reference sample lines and the derived intra prediction mode A, and then perform a weighted average on each of the prediction blocks to generate a fused second prediction block.
  • the video signal processing device can generate a plurality of prediction blocks using one or more reference sample lines and the derived intra prediction mode B, and then perform a weighted average on each of the prediction blocks to generate a fused third prediction block.
  • Weights used when generating the first, second, and third prediction blocks can be defined in advance.
  • the weight for a block predicted using the main reference sample line may be greater than (or equal to or less than) the weight for a block predicted using the sub-reference sample line.
  • the weight for a block predicted using the main reference sample line may be 3, and the weight for a block predicted using the sub-reference sample line may be 1.
  • a prediction block for a current block acquired by a video signal processing device may be a prediction block fused using one or more intra prediction modes within an MPM list.
  • the video signal processing device may acquire the fused prediction block using one or more intra prediction modes from among a Primary MPM list, a Secondary MPM list, and a Non-MPM list.
  • the video signal processing device may acquire the fused prediction block using only all candidates within the Primary MPM list.
  • the video signal processing device may configure an intra prediction mode combination candidate using one or more intra prediction modes from among the Primary MPM list, the Secondary MPM list, and the Non-MPM list, and then configure a combination candidate list using the combination candidate.
  • the encoder may acquire and signal a bitstream including information indicating whether a fusion-based intra prediction mode is applied and an index indicating an optimal combination candidate within the combination candidate list.
  • the decoder can parse information indicating whether a fusion-based intra prediction mode is applied and an index indicating an optimal combination candidate in a combination candidate list, configure a combination candidate based on the parsing result, and then obtain a prediction block for the current block based on the combination candidate.
  • a weight for an intra prediction mode or an intra prediction mode in a combination candidate can be a preset weight or a weight derived using the weight derivation method described above.
  • the number of intra prediction modes in a combination candidate can be two or more. For example, a combination candidate composed of two intra prediction modes can exist, or a combination candidate composed of 3, 4, 5, ... N intra prediction modes can exist.
  • the range of intra prediction modes can be directional modes from modes 2 to 66, excluding the planar mode (mode 0 in Fig. 6) and the DC mode (mode 1 in Fig. 6).
  • modes that derive intra prediction modes and use them for intra prediction such as TIMD and TMRL
  • the range of intra prediction modes can be expanded by two times from modes 2 to 130 by narrowing the angle between each mode and used for prediction.
  • the DIMD mode is a method of calculating directional modes from modes 2 to 66 from reconstructed surrounding samples and using them as intra prediction modes.
  • the range of directional modes calculated from reconstructed surrounding samples can be calculated as directional modes from modes 2 to 130 and used as intra prediction modes for the current block.
  • the video signal processing apparatus can apply a method of expanding the range of directional modes in the DIMD mode to all blocks.
  • the method of expanding the range of directional modes in the DIMD mode can be selectively applied to each block.
  • An encoder can include and signal information indicating a directional range in a bitstream when the current block is encoded in DIMD mode.
  • a decoder can parse the information indicating the directional range when encoded in DIMD mode and use it to calculate (derive) a DIMD intra prediction mode for the current block.
  • the information indicating the directional range can indicate whether the range of directional modes from 2 to 66 is used or the range of directional modes from 2 to 130 is used.
  • a video signal processing device can reduce the range of the directional mode of the current block to the range from 2 to 66 for the next block to be encoded and store the intra prediction mode.
  • the video signal processing device can store the intra prediction mode according to the range of the extended intra prediction mode. For the calculation of the range of extended intra prediction modes in DIMD mode, the range of the predefined table can be extended from 17 to 33.
  • the values in the predefined table are ⁇ 0, 2048, 4096, 6144, 8192, 12288, 16384, 20480, 24576, 28672, 32768, 36864, 40960, 47104, 53248, 59392, 65536 ⁇ to ⁇ 0, 1024, 2048, 3072, 4096, 5120, 6144, 7168, 8192, 10240, 12288, 14336, 16384, 18432, 20480, 22528, 24576, 26624, 28672, ⁇ 30720, 32768, 34816, 36864, 38912, 40960, 44032, 47104, 50176, 53248, 56320, 59392, 62464, 65536 ⁇ can be used to calculate the directional mode.
  • the video signal processing device can set the range of the intra prediction mode differently based on at least one of the size of the current block, the difference (or ratio) between the horizontal size and the vertical size of the current block, and the intra prediction directional mode. For example, if the horizontal size of the current block is greater than the vertical size and the intra prediction directional mode is greater than mode 34 (see FIG. 6), the video signal processing device can scale the range of the current intra prediction mode so that the range of the intra prediction mode of the current block is used in the range from 2 to 130. At this time, the scaling can be performed using "(MODE ⁇ 1) - 2".
  • the video signal processing device can set the type of the angle of the intra prediction mode and the number of intra prediction modes differently based on at least one of the size of the current block, the difference (or ratio) between the horizontal size and the vertical size of the current block. For example, if the horizontal size of the current block is greater than the vertical size, the video signal processing device can reduce the number of modes from 32 to 16 by deleting odd modes and leaving only even modes among modes 2 to 34 of FIG. 6. In addition, if the horizontal size of the current block is greater than the vertical size, the video signal processing device can expand the number of modes from 31 to 47 by adding 16 new angle modes between each of modes 34 to 66 of FIG. 6. At this time, the new angle modes can be pre-specified angle modes, and can be modes such as angles between modes 34 and 35, or angles between modes 35 and 36.
  • the video signal processing device can scale the range of the intra prediction mode to the range of the extended intra prediction mode if the intra prediction mode derived from the surrounding block is a mode that does not use the range of the extended intra prediction mode or is a mode stored in the range of the basic intra prediction mode (range from 2 to 66).
  • the scaling method can be calculated as "(MODE ⁇ 1) - 2", and the planar mode and DC mode may not be converted.
  • the inverse scaling to the original range can be calculated as "(MODE>>1) + 1", and the planar mode and DC mode may not be converted.
  • the mode that does not use the range of the extended intra prediction mode may be an encoding mode other than DIMD, TIMD, and TMRL, and may be a mode based on SGPM, ISP, MIP, Intra TMP, IBC, EIP, or MPM. Therefore, the encoding mode of the surrounding blocks can be scaled to the range of extended intra prediction modes in the case of SGPM, ISP, MIP, Intra TMP, IBC, EIP, and MPM-based modes, and can be used to derive the TIMD intra prediction mode of the current block.
  • the video signal processing device can perform inverse scaling of the range of the extended intra prediction mode to the range of the basic intra prediction mode if the intra prediction mode derived from the surrounding block is a mode that uses the range of the extended intra prediction mode.
  • the encoding mode of the surrounding block is a DIMD, TIMD, or TMRL-based mode
  • the video signal processing device can inversely scale the range of the intra prediction mode to the range of the basic intra prediction mode, which can be used to derive the intra prediction mode of the current block.
  • the range of the basic intra prediction mode (the range from 2 to 66) can be used. Accordingly, the video signal processing device can, if the intra prediction mode derived from the luminance block corresponding to the current chrominance block is a mode that uses the range of the extended intra prediction mode, reverse-scale the range of the extended intra prediction mode to the range of the basic intra prediction mode.
  • the video signal processing device can, if the encoding mode of the luminance block corresponding to the current chrominance block is a DIMD, TIMD, or TMRL-based mode, reverse-scale the range of the extended intra prediction mode to the range of the basic intra prediction mode to derive the intra prediction mode of the current chrominance block.
  • the encoding mode of the luminance block corresponding to the current chrominance block is a DIMD, TIMD, or TMRL-based mode
  • the video signal processing device may use a range of an extended intra prediction mode for the current block. Accordingly, when the DIMD mode is applied to the current block, the video signal processing device may descale the range of the extended intra prediction mode to a range of a basic intra prediction mode when deriving a transform kernel.
  • the video signal processing device may derive one of a set of transform kernels, such as MTS, LFNST, and NSPT, a transform kernel, and a transform type based on the intra prediction mode descaled to the range of the basic intra prediction mode.
  • a video signal processing device can determine a final intra prediction mode by compensating an intra prediction mode for a current block. At this time, the video signal processing device can perform compensation for the intra prediction mode by deriving an additional intra prediction mode using the intra prediction mode of the current block and then determining an intra prediction mode with a lower cost based on a template cost.
  • the additional intra prediction mode can be obtained by adding or subtracting a predetermined compensation value from the intra prediction mode, and the predetermined compensation value can be an integer greater than or equal to 1. For example, if the intra prediction mode for the current block is 24, the video signal processing device can derive additional intra prediction modes 23 (24-1) and 25 (24+1).
  • the video signal processing device can calculate a template cost using intra prediction modes 23, 24, and 25, and apply the intra prediction mode with the smallest template cost as the intra prediction mode of the current block.
  • the video signal processing device can generate intra prediction modes from 2 to 130 and set them as additional intra prediction modes.
  • the video signal processing device can set the additional intra prediction mode as the final intra prediction mode.
  • the video signal processing device can obtain the prediction block of the current block based on the final intra prediction mode.
  • the method for correcting the intra prediction mode for the current block can be applied to modes based on DIMD, TIMD, TMRL, SGPM, ISP, MIP, Intra TMP, IBC, EIP, and MPM.
  • the range of the intra prediction mode can be selectively applied to each block, and the method of selectively applying the intra prediction mode to each block can be called Adaptive Intra Directional mode Resolution (AIDR).
  • the range of the intra prediction mode can be configured in various ways.
  • the first range mode can be the range from 2 to 34
  • the second range mode can be the range from 2 to 66
  • the third range mode can be the range from 2 to 130.
  • the encoder can signal information indicating the range mode by including it in the bitstream.
  • the information indicating the range mode can be signaled before the Primary MPM index is signaled.
  • the information indicating the range mode may be signaled before the Secondary MPM index is signaled.
  • the information indicating the range mode may be signaled before the Non-MPM index is signaled.
  • the information indicating the range mode may be signaled after any one of the Primary MPM index, the Secondary MPM index, and the Non-MPM index is signaled.
  • the decoder can parse the information indicating the range mode to set the range of the intra prediction mode for the current block.
  • the encoding mode of the current block is a mode that implicitly induces an intra prediction mode (e.g., DIMD, TIMD, TMRL, SGPM, ISP, MIP, Intra TMP, IBC, EIP), the range of the extended intra prediction mode, which is the third range mode, may be used. If the encoding mode of the current block is a mode that implicitly induces an intra prediction mode, the intra prediction mode of a neighboring block may be used.
  • an intra prediction mode e.g., DIMD, TIMD, TMRL, SGPM, ISP, MIP, Intra TMP, IBC, EIP
  • the intra prediction mode of a neighboring block may be used.
  • the video signal processing device may scale the range of the intra prediction mode to the range of the extended intra prediction mode.
  • the range of the basic intra prediction mode (the range from 2 to 66) can be used. Therefore, when the intra prediction mode derived from the surrounding block is the first range mode or the third range mode, the video signal processing device can scale or inversely scale the derived intra prediction mode to the range of the basic intra prediction mode. That is, when a mode that is encoded in the range of the basic intra prediction mode is applied to the current block, and the encoding mode of the surrounding block is the first range mode, the video signal processing device can scale the encoding mode of the surrounding block to the range of the basic intra prediction mode, and the scaled intra prediction mode range can be used to derive the intra prediction mode of the current block.
  • the video signal processing device can descale the encoding mode of the surrounding block to the range of the basic intra prediction mode, and the descaled intra prediction mode range can be used to derive the intra prediction mode of the current block.
  • the range of the basic intra prediction mode (the range from 2 to 66) can be used. Accordingly, when the intra prediction mode derived from the luminance block corresponding to the current chrominance block is the first range mode or the third range mode, the video signal processing device can scale or inversely scale the derived intra prediction mode to the range of the basic intra prediction mode.
  • the first range mode can be scaled to the range of the basic intra prediction mode, and the scaled prediction mode range can be used to derive the intra prediction mode of the current chrominance block.
  • the third range mode can be inversely scaled to the range of the basic intra prediction mode, and the inversely scaled prediction mode range can be used to derive the intra prediction mode of the current chrominance block.
  • the video signal processing device may scale the intra prediction mode to the range of the basic intra prediction mode and then derive the transformation kernel based on the scaled intra prediction mode.
  • the video signal processing device may descale the intra prediction mode to the range of the basic intra prediction mode and then derive the transformation kernel based on the descaled intra prediction mode.
  • the scaling and descale processes for the intra prediction mode may be applied to MTS, LFNST, NSPT, etc.
  • the extended intra prediction mode range can be applied to all blocks.
  • the video signal processing device can use one or more of the information about the encoding mode of the current block or the range mode of the current block to perform scaling and descaling on the intra prediction mode derived from the surrounding blocks, thereby deriving the intra prediction mode for the current block.
  • the method of configuring the Primary MPM, Secondary MPM, and Non-MPM lists may vary depending on the information about the range mode.
  • the number of Primary MPM, Secondary MPM, and Non-MPM lists may vary depending on the information about the range mode.
  • the number of Primary MPM lists may be A excluding the planar mode, the Secondary MPM is not used, and the number of Non-MPM lists may be B.
  • a and B may be integers greater than or equal to 1, and A may be 5 and B may be 29. Alternatively, A may be 3 and B may be 31.
  • the number of Primary MPM lists can be F excluding the planar mode
  • the number of Secondary MPM lists can be G
  • the number of Third MPM lists can be H
  • the number of Non-MPM lists can be I.
  • F may be 8
  • G may be 27
  • H may be 32
  • I may be 64.
  • the method of configuring the Primary MPM, Secondary MPM, and Non-MPM lists may be the same as the method of configuring the second range mode.
  • the encoder may generate and signal a bitstream including information indicating an additional correction value
  • the decoder may parse the information indicating the additional correction value to determine the correction value.
  • the video signal processing device may determine the final intra prediction mode by adding an additional correction value to the intra prediction mode obtained from the MPM list.
  • the range of the additional correction value may be one of -1, 0, and +1.
  • the method of configuring the Primary MPM, Secondary MPM, and Non-MPM lists may be the same as the method of configuring the second range mode.
  • the video signal processing device may derive an additional intra prediction mode to become the mode of the third range using the determined intra prediction mode, and then determine the final intra prediction mode of the third range based on the template cost. At this time, the intra prediction mode with the lowest template cost can become the final intra prediction mode. Even at this time, additional correction values can be applied.
  • the video signal processing device can generate a prediction block using multiple intra prediction modes configured based on the additional correction values, and then weight-average the multiple prediction blocks to generate the final prediction block.
  • Figure 41 shows reference sample filtering according to an embodiment of the present invention.
  • a video signal processing device uses the restored surrounding samples in intra prediction. At this time, the video signal processing device can perform filtering on the reference samples. Through this, the video signal processing device can prevent the subjective image quality reduction of the prediction block caused by noise in the surrounding samples.
  • Fig. 41 (a) shows reference sample filtering using a ⁇ 1, 2, 1 ⁇ filter. When filtering is performed using surrounding samples A and B for the reference sample position (X), the video signal processing device can calculate the filtered sample (X') as '(A + 2 * X + B) / 4'. The video signal processing device can perform filtering on all reference samples adjacent to the block to be currently predicted.
  • Fig. 41 (b) shows reference sample filtering for the side array.
  • the video signal processing device can copy the reference samples of the filtered side array to the main array and use them for intra prediction.
  • the video signal processing device can determine the main array and the side array according to the intra prediction directional mode of the current block.
  • the intra prediction directionality mode is 34 or greater
  • the video signal processing device may determine the upper sample as the main array and the left sample as the side array.
  • the intra prediction directionality mode is less than 34
  • the video signal processing device may determine the upper sample as the side array and the left sample as the main array.
  • the video signal processing device may copy some of the reference samples located in the side array to the main array without modification.
  • the video signal processing device may filter the reference samples located in the side array using adjacent reference samples and then copy the reference samples of the filtered side array to the main array.
  • the filtering may be any one of a cubic filter, a Gaussian filter, a low-pass filter, a high-pass filter, and a smoothing filter.
  • the smoothing filter may be a 1:2:1 filter.
  • the video signal processing device can derive a reference sample position in units of decimal samples by using at least one of the horizontal and vertical sizes of the current block, the intra prediction directional mode, the position of the reference sample line, and the position of the main array to which the reference sample derived from the side array is to be copied.
  • the video signal processing device can perform filtering by using a reference sample adjacent to the reference sample position in units of decimal samples. Furthermore, the video signal processing device can copy the filtered reference sample to the main array to use for intra prediction.
  • the unit of decimal samples can be one of 1/2 pixel, 1/4 pixel, 1/16 pixel, and 1/32 pixel.
  • the video signal processing device can determine whether to perform filtering on the reference sample by using at least one of the horizontal and vertical sizes of the current block, the intra prediction directional mode, the position of the reference sample line, and the position of the main array to which the reference sample derived from the side array is to be copied. Specifically, when the derived reference sample position in units of decimal samples is an integer unit sample position, the video signal processing device may not perform filtering. At this time, the video signal processing device can copy integer-unit reference samples to the main array and use them for intra prediction.
  • Figure 42 shows PDPC filtering according to an embodiment of the present invention.
  • Discontinuous sample value changes may occur at the boundary between an intra-prediction block and an adjacent block.
  • the discontinuity may occur at the top and left borders of the prediction block.
  • the video signal processing device may perform filtering within the prediction block. Through this, the video signal processing device may remove the discontinuity between the intra-prediction block and the adjacent block. Specifically, the video signal processing device may perform filtering that weights the predicted value in the intra mode and the values of one or more pre-reconstructed surrounding samples. At this time, the surrounding samples may be selected from samples at a predetermined position or based on the direction of the intra mode. This is referred to as position-dependent intra-prediction combination (PDPC).
  • PDPC position-dependent intra-prediction combination
  • the video signal processing device may determine a filtering method according to the intra-prediction directional mode.
  • Figure 42 (a) shows a PDPC filtering method when the intra-prediction directional mode is horizontal.
  • the video signal processing device when the encoder and decoder perform filtering on the (1, 0) sample within the prediction block, the video signal processing device can perform filtering on the (1, 0) sample by weighting and averaging at least one of the reconstructed surrounding samples R(-1, 0), R(-1, -1), and R(1, -1) with the (1, 0) sample. At this time, the video signal processing device can apply the difference between the intra reference samples to the (1, 0) sample within the prediction block.
  • the encoder and decoder can perform filtering on the (1, 1) sample by weighting and averaging at least one of the reconstructed surrounding samples R(3, -1), and R(-1, 3) with the (1, 1) sample of the prediction block. Specifically, if the (1, 1) sample within the prediction block is predicted from the upper peripheral sample R(3, -1), the video signal processing device can apply compensation for the (1, 1) sample using the left peripheral sample R(-1, 3) indicated by the intra prediction directional mode.
  • R(x, y) may be a reconstructed sample adjacent to the current block.
  • the video signal processing device can perform prediction for a sample within the prediction block from a first peripheral sample corresponding to the sample within the prediction block using the intra prediction mode, at a first reference sample.
  • the video signal processing device can perform PDPC using a second reference sample, at a sample within the prediction block and/or a second peripheral sample corresponding to the first reference sample.
  • PDPC when PDPC is applied, filtering is performed on samples within a prediction block based on differences between neighboring samples.
  • a left neighboring sample corresponding to an upper neighboring sample may not be derived.
  • an upper neighboring sample corresponding to a left neighboring sample may not be derived.
  • the video signal processing device may not apply PDPC in intra prediction where an intra prediction mode that cannot derive a difference in change between neighboring samples from the upper neighboring sample and the left neighboring sample is applied.
  • the video signal processing device may determine whether to apply PDPC to the current block based on at least one of the horizontal or vertical size of the current block and the intra prediction mode.
  • the upper neighboring sample and the left neighboring sample may include the upper left neighboring sample.
  • At least one of the first reference sample and the second reference sample may be a sample generated through filtering between neighboring samples.
  • the filtering between neighboring samples may be one of a cubic filter, a Gaussian filter, a low-pass filter, a high-pass filter, and a smoothing filter.
  • the smoothing filter can be a 1:2:1 filter.
  • Figure 43 shows a gradient PDPC according to an embodiment of the present invention.
  • the video signal processing device may apply the difference between the samples corresponding to the intra prediction mode among the surrounding samples to the sample within the prediction block, without using the surrounding samples corresponding to the samples within the prediction block.
  • the video signal processing device does not perform the PDPC process using the left reference sample corresponding to the sample (X) within the prediction block.
  • the encoder and decoder may perform PDPC on the sample (X) within the prediction block using the difference between the r(-1+d, -1) sample and the r(-1, y) sample corresponding to the current intra prediction mode among the reference samples. This is referred to as gradient PDPC.
  • y may be the vertical coordinate of the sample within the prediction block, and d may be the decimal point position of the sample indicated by the intra prediction mode. In addition, y may be changed to a horizontal coordinate according to the intra prediction mode.
  • the surrounding samples may be the r(-1, -1+d) sample and the r(x, -1) sample.
  • a video signal processing device may select a first reference sample and a second reference sample that do not correspond to a sample within a prediction block using an intra prediction mode, and perform PDPC applying the difference between the first reference sample and the second reference sample to the sample within the prediction block. At least one of the first reference sample and the second reference sample may be derived from a sample within the prediction block using one of vertical and/or horizontal coordinates.
  • the video signal processing device may determine that at least one of the first reference sample and the second reference sample may be an upper-left sample.
  • at least one of the first reference sample and the second reference sample may be a sample generated through filtering between neighboring samples.
  • the filtering between neighboring samples may be one of a cubic filter, a Gaussian filter, a low-pass filter, a high-pass filter, and a smoothing filter.
  • the smoothing filter may be a 1:2:1 filter.
  • CIIP PDPC refers to a mode that applies PDPC to intra prediction blocks in CIIP mode.
  • edge components may appear in letters or shapes.
  • smoothing filtering may include at least one of reference sample filtering, PDPC, and intra fusion.
  • PDPC may include at least one of gradient PDPC and CIIP PDPC.
  • a plurality of flags indicating whether to disable each of gradient PDPC and CIIP PDPC may be included in the bitstream. In the embodiments described below, the flag indicating whether to disable PDPC may be a plurality of flags indicating whether to disable each of gradient PDPC and CIIP PDPC.
  • the encoder can include smoothing filter information in the bitstream, indicating whether smoothing filtering is disabled.
  • the decoder can obtain the smoothing filter information from the bitstream and determine whether the smoothing filter is disabled.
  • the smoothing filter information can be applied at a pre-specified level.
  • the pre-specified level can be any one of the video parameter set (VPS), sequence parameter set (SPS), picture parameter set (PPS), picture, slice tile, and block.
  • the video signal processing device may not perform the filtering applied to the reference sample of the side array described through (b) of FIG. 41. At this time, the video signal processing device may use the reference sample of the side array to be used in the main array as a reference sample in integer sample units. Due to the angle of the intra prediction directional mode, it may be difficult for the encoder and decoder to obtain a reference sample that matches the integer sample unit.
  • the video signal processing device may derive the reference sample position in decimal sample units by using at least one of the horizontal and vertical sizes of the current block, the intra prediction directional mode, the position of the reference sample line, and the position in the main array to which the reference sample derived from the side array is to be copied. At this time, the video signal processing device may copy the reference sample of the side array in integer sample units that is closest to the derived decimal sample unit reference sample position to the main array and use it for intra prediction.
  • the reference sample position in decimal sample units can be one of 1/2 pixel, 1/4 pixel, 1/16 pixel, and 1/32 pixel.
  • the smoothing filter information described above can be set as one or more flags, and one or more flags can be set for each smoothing filter.
  • FIG. 44 is a diagram illustrating a process of performing OBMC according to one embodiment of the present specification.
  • the decoder can obtain motion information (e.g., motion vector) of the current block (e.g., current coding unit) and motion information of surrounding blocks of the current block (S810).
  • the decoder can determine whether OBMC is applied to the sub-blocks of the current block (S820). At this time, the decoder can determine whether OMBC is applied to each sub-block.
  • the decoder can determine that OBMC is applied to the sub-blocks of the current block. This is because motion information between sub-blocks may be different when the affine mode, sbTMVP mode, or MP-DMVR mode is applied to the current block.
  • the decoder can perform CU-based OBMC (S830). CU-based OBMC can be performed independently for each sub-block including the upper boundary and the left boundary of the current block.
  • the decoder can divide the current block into sub-blocks.
  • the size of each sub-block can be any size and have a positive value.
  • the arbitrary size can be 4.
  • the decoder can perform OBMC on a sub-block basis based on whether OBMC is applied to the sub-block of the current block (S840). That is, if the decoder determines that OBMC is applied to the sub-block, it can perform OBMC on a sub-block basis.
  • OBMC in step S840 can be performed on sub-blocks of the current block unit that do not include the upper/left boundary. That is, OBMC can be performed on the remaining sub-blocks except for the sub-blocks on which OBMC is performed in step S830.
  • the decoder can perform OBMC on the sub-blocks of the current block and obtain a prediction block of the current block (S850).
  • the decoder can determine whether the motion information of the first sub-block of the current block and the motion information of the surrounding blocks of the first sub-block are the same. If the motion information is different, the decoder can perform OBMC on the first sub-block. Then, the decoder can determine whether the motion information of the second sub-block of the current block and the motion information of the surrounding blocks of the second sub-block are the same. Similarly, if the motion information is different, the decoder can perform OBMC on the second sub-block.
  • the decoder can group the first and second sub-blocks into one sub-block and then perform OBMC. This has the effect of reducing the number of memory accesses, although the result is the same, by performing the OBMC process of the first and second sub-blocks at once instead of performing them separately.
  • sub-blocks having the same motion difference can be grouped into one sub-block to perform OBMC.
  • the decoder may not perform OBMC on the first sub-block and may perform step S830 again on another sub-block (e.g., the second sub-block).
  • the decoder may not perform OBMC on the sub-blocks having the same motion information.
  • step S830 may be performed first on sub-blocks including the upper boundary of the current block and then on sub-blocks including the left boundary of the current block.
  • step S830 may be performed first on sub-blocks including the left boundary of the current block and then on sub-blocks including the upper boundary of the current block.
  • step S830 may be performed starting from the sub-block on the left for sub-blocks including the upper boundary.
  • Step S830 may be performed starting from the sub-block on the upper for sub-blocks including the left boundary.
  • FIG. 45 is a diagram illustrating a method for performing OMBC of CU units according to one embodiment of the present specification.
  • FIG. 45 is a drawing illustrating step S830 in more detail.
  • the decoder can perform OBMC on the A0 block, which is the upper left block of the current block (Case 1). If the motion information of the A0 block and the motion information of the Ne-A0 block, which is the upper block adjacent to the A0 block, are different from each other, the decoder can perform OBMC on the A0 block. At this time, in order to perform OBMC, the decoder can obtain a first prediction block (ref A0) from reference picture 0 using the motion information of the A0 block, and can obtain a second prediction block from reference picture 0 by projecting the motion information of the Ne-A0 block to the position of the A0 block. Then, the decoder can obtain a final prediction block for the A0 block by performing a weighted average of the first prediction block and the second prediction block based on preset weights.
  • a first prediction block (ref A0) from reference picture 0 using the motion information of the A0 block
  • a second prediction block from reference picture 0 by projecting the motion
  • the decoder can perform OBMC on the L2 block, which is the left block of the current block (Case 2). If the motion information of the L2 block and the motion information of the Ne-L2 block, which is the left block adjacent to the L2 block, are different from each other, the decoder can perform OBMC on the L2 block.
  • the decoder can obtain a first prediction block (ref L2) from reference picture 0 using the motion information of the L2 block, and obtain a second prediction block of Ne-L2 from reference picture 1 by projecting the motion information of Ne-L2 to the location of the L2 block. Then, the decoder can obtain a final prediction block for the L2 block by performing a weighted average of the first prediction block and the second prediction block based on preset weights.
  • the preset weights can be defined in table form.
  • the reference pictures between the current block and surrounding blocks may be identical, as in case 1, or different, as in case 2.
  • the decoder can perform OBMC twice on the A0 block. For example, the decoder can compare the motion information of the A0 block with the motion information of the Ne-A0 block, and if the motion information is different, it can perform the first OBMC on the A0 block. Afterwards, the decoder can compare the motion information of the A0 block with the motion information of the Ne-L0 block, and if the motion information is different, it can additionally perform the second OBMC on the A0 block on which the first OBMC was performed.
  • the decoder can obtain the final prediction block for the A0 block by performing the second OBMC on the prediction block obtained by performing the first OBMC and the prediction block obtained by performing the first OBMC.
  • Two OBMCs can be performed consecutively (or sequentially) on the A0 block. Therefore, the first OBMC can affect the second OBMC. That is, there is a dependency between the first OBMC and the second OBMC. To remove this dependency, the decoder can perform OBMC in parallel when there are multiple adjacent neighboring blocks of the sub-block.
  • the decoder can obtain a prediction block based on the motion information of the A0 block and the motion information of the Ne-A0 block, and a prediction block based on the motion information of the A0 block and the motion information of the Ne-L0 block, in parallel. Thereafter, the decoder can obtain the final prediction block for the A0 block by performing a weighted average of the prediction blocks obtained in parallel. Meanwhile, if there are multiple adjacent neighboring blocks of a sub-block, the decoder can perform OBMC based on the motion information of one of the neighboring blocks.
  • the decoder can obtain the first motion difference, which is the difference between the motion information of the A0 block and the motion information of the Ne-A0 block, and the second motion difference, which is the difference between the motion information of the A0 block and the motion information of the Ne-L0 block. Then, the decoder can compare the first and second motion differences and perform OBMC for A0 using the motion information of the neighboring block corresponding to the larger motion difference. For example, if the first motion difference is larger than the second motion difference, the decoder can perform OBMC only for the upper boundary of the A0 block using the motion information of the Ne-A0 block, which is the neighboring block corresponding to the first motion difference.
  • FIG. 46 is a diagram illustrating a method for performing OBMC in sub-block units according to one embodiment of the present invention.
  • FIG. 46 is a drawing illustrating step S840 in more detail.
  • CU-based OBMC refers to OBMC for sub-blocks adjacent to the current CU boundary, and may be described as CU boundary sub-block OBMC.
  • Sub-block-based OBMC refers to OBMC for sub-blocks within the current CU (sub-blocks not adjacent to the CU boundary), and may be described as CU intra-sub-block OBMC.
  • the reference picture of the current block is used to perform OBMC, the reference picture in all sub-block units can be the same.
  • the decoder can compare the motion information of each neighboring block above, below, left, and right of the current sub-block with the motion information of the current sub-block. Furthermore, the decoder can perform OBMC on the current sub-block using motion information for neighboring blocks that have different motion information from the motion information of the current sub-block.
  • the current sub-block is a luminance component sub-block, and the motion information of the current sub-block and the motion information of the neighboring blocks adjacent to the top, bottom, left, and right of the current sub-block may be different from each other.
  • the decoder may project the motion information for each neighboring block onto the current sub-block to generate a prediction block, respectively. That is, referring to FIG. 10, a prediction block generated based on the motion information for the neighboring block adjacent to the top of the current sub-block may be a Ref.
  • a block, a prediction block generated based on the motion information for the neighboring block adjacent to the bottom of the current sub-block may be a Ref. B block, a prediction block generated based on the motion information for the neighboring block adjacent to the left of the current sub-block may be a Ref. L block, and a prediction block generated based on the motion information for the neighboring block adjacent to the right of the current sub-block may be a Ref. R block.
  • the decoder can obtain a prediction block for the current sub-block by performing a weighted average among the Ref. A block, Ref. B block, Ref. L block, and Ref. R block.
  • the decoder can perform a weighted average using an extended pixel range and then restore it to the original pixel range.
  • the difference value obtained by subtracting the sum of the weights according to each pixel position of the surrounding blocks corresponding to the upper, lower, left, and right from the total weight of the extended pixel range can be the weight for each pixel of the current prediction block.
  • the weight of the neighboring block can be set to 0.
  • the weight of the unusable neighboring block can be set to 0.
  • a video signal processing device e.g., encoder, decoder
  • the pixel value of each prediction block can be reduced to an arbitrary range of values and the weighted average calculation can be applied.
  • a method for reducing the range of arbitrary values can be used by performing a right shift operation ">>" on each pixel value of the prediction block an arbitrary number of times, where the arbitrary number can be an integer greater than or equal to 1, and can be 2.
  • a method for performing a left shift operation " ⁇ " an arbitrary number of times to restore the original range after the weighted average is performed can be used, where the arbitrary number can be the same as the number by which the range of values is reduced.
  • a method for performing OBMC on a chrominance component sub-block is described. For example, if the component format of the current picture is 4:2:0, the width and height of the chrominance component block are half of the width and height of the luminance component block. That is, if the size of the luminance component block is 4x4, the size of the chrominance component block is 2x2. Therefore, the values of the weight table can also only exist as 2x2.
  • the method for performing OBMC on a chrominance component sub-block may be similar to the method for performing OBMC on a luminance component sub-block.
  • the resolution of the motion information of the chrominance component sub-block may be half of the resolution of the motion information of the luminance component sub-block. That is, a difference may exist between the motion information of the luminance component sub-block and the motion information of the surrounding blocks of the luminance component sub-block, but a difference may not exist between the motion information of the chrominance component sub-block and the motion information of the surrounding blocks of the chrominance component sub-block.
  • OBMC may be applied only to the luminance component sub-block, and OBMC may not be applied to the chrominance component sub-block. Therefore, a blocking phenomenon that did not occur in the luminance component sub-block may occur in the chrominance component sub-block.
  • OBMC may also be applied to the chrominance component sub-block.
  • CU-based OBMC may be performed on each of the Y, U, and V components, and in the case of the chrominance component block, OBMC may be performed on the first adjacent pixel line. Of course, it is not limited to the first pixel line.
  • FIG. 47 is a diagram showing a table in which weights are defined according to one embodiment of the present specification.
  • the weights can be determined based on the positions of adjacent blocks and the color components (luminance components or chrominance components) of the current block. For example, when performing CU-based OBMC, if the current sub-block is a block that includes the upper boundary of the current block and is a block of luminance components, the weights for the prediction blocks of the current sub-block can be set to increase from the upper side to the lower side (see Case 1 in FIG. 45). In addition, when performing CU-based OBMC, if the current sub-block is a block that includes the left boundary of the current block and is a block of luminance components, the weights for the prediction blocks of the current sub-block can be set to increase from the left side to the right side (see Case 2 in FIG. 45).
  • the weights in this specification can be determined based on whether the neighboring blocks of the current block (sub-blocks of the current block) are blocks that have been reconstructed or blocks that have only been predicted. For example, if the neighboring blocks are blocks that have been reconstructed, blocking artifacts may be strongly present, so filtering based on high weights may be performed. That is, the weight for the neighboring blocks adjacent to the boundary of the current block may be set higher than the weight for the predicted block of the current block. Conversely, since the boundary may be a characteristic of the image itself, the weight for the neighboring blocks adjacent to the boundary of the current block may be set lower than the weight for the predicted block of the current block.
  • the decoder can determine whether the boundary is a characteristic of the image itself through the quantization parameter information of the current block and the pixel distribution around the boundary. If it is a characteristic of the image itself, the decoder can apply a conventional deblocking filtering method.
  • Sub-block-based OBMC can be performed according to any fixed block size (unit).
  • the decoder can perform OBMC on a 4x4 sized sub-block.
  • the sub-block units for affine mode, sbTMVP mode, and MP-DMVR mode may be different.
  • Affine mode processes 4x4 sub-block units
  • sbTMVP mode processes 8x8 sub-block units
  • MP-DMVR mode processes 8x8, 8x4, 4x8, and 4x4 sub-block units, so that motion information may be different for each unit.
  • the sub-block unit for OBMC needs to be changed according to each encoding mode.
  • the sbTMVP mode has different motion information in units of 8x8 sub-blocks
  • the unit of the sub-block for sub-block OBMC processing may be 8x8.
  • the unit of the sub-block for sub-block OBMC processing may be set to be the same as the MP-DMVR processing unit.
  • OBMC can only be applied when the motion information of the current block is unidirectionally predicted. OBMC may not be performed if there is no difference between the motion information of the current block and the motion information of its neighboring blocks. This may be to enhance the bidirectional prediction effect by utilizing diverse motion information. That is, to apply diverse motion information when performing OBMC, the decoder can selectively utilize neighboring blocks, use motion information for multiple neighboring blocks, or use scaled motion information for other reference pictures.
  • the decoder can selectively utilize neighboring blocks of the current block when performing OBMC. For example, when performing OBMC on block A0 of FIG. 45, the decoder can additionally utilize motion information of blocks Ne-AL and Ne-A1 in addition to the motion information of block Ne-A0. The decoder can additionally utilize motion information for neighboring blocks and adjacent blocks of the current block.
  • the decoder can perform OBMC using different reference pictures. For example, when performing OBMC on the L2 block of FIG. 45, the decoder can use the motion information of the Ne-L2 block scaled to reference picture 0 in addition to the reference block of reference picture 1. That is, the decoder can obtain a prediction block for the L2 block by weighting three prediction blocks (a prediction block obtained based on the motion information of the L2 block, a prediction block obtained based on the motion information of the Ne-L2 block, and a prediction block obtained based on the motion information of the scaled Ne-L2 block).
  • the decoder can obtain a prediction block for the L2 block by weighting two prediction blocks (a prediction block obtained based on the motion information of the L2 block, and a prediction block obtained based on the scaled Ne-L2 block).
  • the decoder can perform OBMC using only the reference pictures used by the motion information of the L2 block. In this case, there is only one reference picture, so the effect is that memory usage is reduced.
  • OBMC can reduce blocking between blocks, it can also cause afterimages, such as the halo effect, when the characteristics of the surrounding blocks differ from those of the current block. Because the halo effect can be caused by the different movements of different objects, OBMC is not applied uniformly to all blocks, but rather is applied based on the characteristics of the surrounding blocks.
  • FIG. 48 is a diagram illustrating a method for configuring a template for performing OBMC according to one embodiment of the present specification.
  • the decoder can determine whether to perform (apply) OBMC on the current block (coding block) based on a template.
  • a method for constructing a template using neighboring blocks (pixels) adjacent to the current block is described.
  • Whether OBMC is performed can be determined on a coding block basis, and the encoder can generate a bitstream containing information related to whether OBMC is performed.
  • the decoder can parse the bitstream to determine whether OBMC is performed on the current block. If OBMC is applied to the current block, OBMC can be applied to all subblocks (blocks A0/L0, A1, A2, A3, L1, L2, and L3 in Figure 48) that include the boundaries of the current block. At this time, since each subblock has different characteristics, the decoder can determine whether OBMC is applied to each subblock.
  • the decoder can determine whether to perform OBMC on the current block (each sub-block of the current block) based on the similarity between the current block and its neighboring blocks. In addition, the decoder can determine the length and weight of the filtering for OBMC to be applied to each sub-block based on the similarity between the current block and its neighboring blocks.
  • the decoder can determine whether to perform OBMC on each sub-block, and the length and weight of the filtering for OBMC based on at least one of the difference between the motion information of the current block and the motion information of the neighboring blocks of the current block, the motion resolution information of the current block, the motion resolution information of the neighboring blocks of the current block, the prediction direction information of the current block (e.g., L0 prediction, L1 prediction, bidirectional prediction), the width of the current block, the height of the current block, the product of the width and height of the current block, and the encoding mode of the current block (e.g., merge mode, affine mode, sbTMVP mode, etc.).
  • the prediction direction information of the current block e.g., L0 prediction, L1 prediction, bidirectional prediction
  • the width of the current block e.g., the height of the current block, the product of the width and height of the current block
  • the encoding mode of the current block e.g., merge mode, affine mode
  • the length and weight of the filtering for OBMC can also be applied to the predicted sample.
  • the length and weight of the filtering applied to the sample predicted using the motion information of the current sub-block can be the same as or different from the length and weight of the filtering applied to the sample predicted using the motion information of the block adjacent to the current sub-block.
  • OBMC can be performed on the blocks surrounding the upper (or left) side of the current block.
  • the length of the filtering applied to the sample predicted using the motion information of the current sub-block is 3 pixel lines (or 3 pixel columns)
  • the length of the filtering applied to the sample predicted using the motion information of the block adjacent to the upper (or left) side of the current sub-block can also be set to 3 pixel lines (or 3 pixel columns).
  • the weights for each pixel line can be set to '7, 15, 31'.
  • the length of OBMC filtering applied to a sample predicted through motion information of a block adjacent to the upper (or left) side of the current sub-block is set to 3 pixel lines (or 3 pixel columns), and the weight for each pixel line (or weight for each pixel column) can be set to '1, 1, 1'.
  • the decoder can determine whether OBMC is performed on the current block based on a template.
  • the decoder can construct a template including pixels of a reconstructed block adjacent to the current block, which can be referred to as a reference template for convenience of explanation.
  • the width of the upper template can be determined based on the horizontal size of each sub-block, and the height of the upper template can be a preset size.
  • the height of the left template can be determined based on the vertical size of each sub-block, and the width of the left template can be a preset size.
  • the preset size is a natural number, and can be 1.
  • the upper template for each sub-block can vary based on the size of the sub-block, and when the size of the sub-block is 4x4, the size of the upper template can be 4x1.
  • the decoder can calculate three costs for each sub-block. The first cost (Cost 1) is obtained based on the motion information of the current sub-block, the second cost (Cost 2) is obtained based on the motion information of the block adjacent to the current sub-block, and the third cost (Cost 3) can be obtained based on the motion information of the current sub-block and the motion information of the block adjacent to the current sub-block.
  • the costs described in this specification can be obtained by calculating the pixel-wise Sum of Absolute Differences (SAD) or Mean-Removed SAD (MRSAD) between samples predicted for an area corresponding to the template using the template and the motion information of each sub-block.
  • the first cost can be obtained based on a template (reference template) including pixels of a reconstructed block adjacent to the current sub-block and a first reference template predicted by projecting the motion information of the current sub-block onto the reference template.
  • the second cost can be obtained based on a second reference template predicted by projecting the motion information of the reference template and the block adjacent to the current sub-block onto the reference template.
  • the third cost can be obtained based on the first reference template and the second reference template.
  • the third cost can be obtained based on the reference template and the prediction sample obtained by weighting the sample that predicted the region corresponding to the template using the motion information of the current sub-block and the sample that predicted the region corresponding to the template using the motion information of the block adjacent to the current sub-block.
  • the weight may be a preset value and may be a decimal value greater than or equal to 0.
  • the preset value may be 1/4, 3/4, etc.
  • the decoder can derive whether to perform OBMC for the current sub-block, the filtering length for OBMC, and the weight based on the obtained cost. For example, if Cost 1 (the first cost) is the smallest among the obtained costs, OBMC may not be performed on the corresponding sub-block.
  • the second OBMC mode or a new OBMC mode whose filtering length is smaller than the filtering length for the second OBMC mode may be performed on the corresponding sub-block.
  • the value of "(Cost 2 + (Cost 2 >> 2) + (Cost 2 >> 3))" is less than or equal to Cost 1
  • the first OBMC mode can be performed on the corresponding sub-block.
  • "X>>Y" is a right shift operation, and the quotient of X divided by 2 for Y times can be output. If Cost 1 is less than or equal to Cost 2, the second OBMC mode can be performed on the corresponding sub-block. Conversely, if Cost 1 is greater than Cost 2, the third OBMC mode can be performed on the corresponding sub-block.
  • FIG. 49 is a diagram illustrating a method for generating a prediction block according to each OBMC mode according to one embodiment of the present specification.
  • the first OBMC mode, the second OBMC mode, and the third OBMC mode described in this specification are described with reference to FIG. 49.
  • the ref A0 block and the Ne-A0 block of Fig. 49 may be 4x4 blocks.
  • the ref A0 of Fig. 49 may be a current sub-block and may be identical to the ref A0 block of Fig. 9.
  • the Ne-A0 block of Fig. 49 may be a neighboring block adjacent to the upper side of the current sub-block and may be identical to the Ne-A0 block of Fig. 45.
  • the numbers shown next to the ref A0 block and the Ne-A0 block may represent the length and weight of the OBMC filtering.
  • the decoder may obtain the current sub-block A0 to which the OBMC filtering is applied by weighting the prediction blocks ref A0 and Ne-A0 blocks.
  • the first OBMC mode, the second OBMC mode, and the third OBMC mode may be applied to the luminance component block and the chrominance component block, respectively.
  • the first OBMC mode may be a mode for obtaining the current luminance component sub-block by performing a weighted average of four pixel lines of the current luminance component sub-block and four pixel lines of the luminance component block adjacent to the upper side of the current sub-block.
  • the second OBMC mode When the second OBMC mode is applied to the luminance component block, the second OBMC mode may be a mode for obtaining the current luminance component sub-block by performing a weighted average of two pixel lines of the current luminance component sub-block and two pixel lines of the luminance component block adjacent to the upper side of the current sub-block.
  • the third OBMC mode When the third OBMC mode is applied to the luminance component block, the third OBMC mode may be a mode for obtaining the current luminance component sub-block by performing a weighted average of three pixel lines of the current luminance component sub-block and three pixel lines of the luminance component block adjacent to the upper side of the current sub-block.
  • the first OBMC mode, the second OBMC mode, and the third OBMC mode may be modes for obtaining the current chrominance component sub-block by weighting one pixel line of the current chrominance component sub-block and one pixel line of the chrominance component block adjacent to the upper side of the current sub-block.
  • the first OBMC mode when the first OBMC mode is applied to the luminance component block, four pixels of the first pixel line of the luminance component block of the ref A0 block may be multiplied by the weight '26', four pixels of the second pixel line may be multiplied by the weight '7', four pixels of the third pixel line may be multiplied by the weight '15', and four pixels of the fourth pixel line may be multiplied by the weight '31', thereby generating a weighted 'ref A0' luminance component prediction block.
  • a weighted 'Ne-A0' luminance component prediction block can be generated by multiplying the weight '6' to four pixels in the first pixel line of the Ne-A0 block, multiplying the weight '1' to four pixels in the second pixel line, multiplying the weight '1' to four pixels in the third pixel line, and multiplying the weight '1' to four pixels in the fourth pixel line.
  • the decoder can generate a final prediction block for A0 by weighting the weighted 'ref A0' prediction block and the weighted 'Ne-A0' prediction block.
  • the decoder can also apply the second OBMC mode and the third OBMC mode in the same manner to generate a final prediction block for A0.
  • template-based OBMC can be determined based on the cost obtained using the motion information of the current sub-block and the motion information of the surrounding blocks of the current sub-block.
  • template-based OBMC can be performed only on sub-blocks that include the boundary of the current block.
  • the decoder can determine whether to apply OBMC for each sub-block. Template-based OBMC may not be applied to sub-blocks that do not include the boundary of the current block. Meanwhile, if OBMC is applied to at least one sub-block among the sub-blocks that include the boundary of the current block, OBMC can also be applied to sub-blocks that do not include the boundary of the current block.
  • OBMC can be applied to sub-blocks that do not include the boundary of the current block.
  • Whether OBMC is applied to the current block can be determined by comparing the image quality and bit rate when OBMC is applied to the current block with the image quality and bit rate when OBMC is not applied to the current block. That is, if the compression efficiency when OBMC is applied to the current block is good by comparing the image quality and bit rate when OBMC is applied to the current block with the image quality and bit rate when OBMC is not applied to the current block, OBMC is applied, and if it is not good, OBMC may not be applied.
  • the encoder can generate a bitstream including information (e.g., syntax elements) on whether OBMC is applied to the current block.
  • the decoder can parse the information on whether OBMC is applied to the current block from the bitstream to determine whether OBMC is applied to the current block. If the parsing result indicates that OBMC is applied to the current block, the decoder can divide the current block into multiple subblocks and then perform template-based OBMC on each subblock. At this time, whether OBMC is performed on each subblock can be determined. If the parsing result shows that OBMC is not applied to the current block, template-based OBMC may not be performed on all sub-blocks of the current block.
  • FIG. 50 shows a method for a video signal processing device according to an embodiment of the present invention to perform OBMC Intra.
  • On-Bottom Multi-Prediction mitigates the blocking phenomenon between neighboring blocks that occurs during the motion compensation process.
  • OBMC On-Bottom Multi-Prediction
  • the video signal processing device can derive a DIMD mode from the neighboring blocks and generate an intra-prediction block for the current block using the derived DIMD mode.
  • the video signal processing device can derive the DIMD mode using reconstructed samples of neighboring blocks adjacent to the current block.
  • the video signal processing device can perform OBMC using the intra-prediction block for the current block and the inter-prediction block generated using the motion information of the current block, and generate a final prediction block.
  • the weights applied to each of the intra-prediction block and the inter-prediction block may be the weights applied in the OBMC embodiments described above, for example, the embodiment described through FIG. 47.
  • the weights for the intra-prediction block and the weights for the inter-prediction block may be the same. Additionally, the weights for intra-prediction blocks and inter-prediction blocks may be different.
  • neighboring blocks of sub-blocks A1, A2, A0/L0, and L2 within the current block are encoded in intra mode.
  • the video signal processing device can derive an intra prediction mode using reconstructed samples adjacent to sub-blocks A1, A2, A0/L0, and L2 within the current block.
  • the video signal processing device can generate an intra prediction block through the derived intra prediction mode.
  • the video signal processing device can generate a block to which OBMC is applied by performing a weighted average of an intra prediction block and an inter prediction block generated using motion information of the current block.
  • neighboring blocks of block A0/L0 among the sub-blocks within the current block may be blocks encoded in intra mode and inter mode.
  • the video signal processing device may perform OBMC on sub-block A0/L0 using only motion information of neighboring blocks encoded in inter mode.
  • neighboring blocks of block A0/L0 among the sub-blocks within the current block may be blocks encoded in intra mode and inter mode.
  • the video signal processing device can generate a first prediction block using motion information of a neighboring block encoded in an inter mode.
  • the video signal processing device can generate a second prediction block using an intra prediction mode derived using reconstructed samples adjacent to sub-blocks A0/L0.
  • the video signal processing device can generate a third prediction block using motion information of the current block.
  • the video signal processing device can generate a final OBMC prediction block by performing a weighted average of the first prediction block, the second prediction block, and the third prediction block.
  • the reference sample line used by the video signal processing device to generate the intra prediction block may include the reference sample line '0' adjacent to the current block.
  • the video signal processing device may use intrafusion, which predicts using multiple reference sample lines, in the process of generating the intra prediction block used in OBMC.
  • the video signal processing device may not use intrafusion in the process of generating the intra prediction block used in OBMC.
  • the video signal processing device may use PDPC in the process of generating the intra prediction block used in OBMC.
  • the video signal processing device may not use PDPC in the process of generating the intra prediction block used in OBMC.
  • the video signal processing device may generate the intra prediction block using one of TIMD, OBIC, EIP, MIP, and PDP in the process of generating the intra prediction block used in OBMC. PDP will be described in detail later.
  • the video signal processing device may apply OBMC using the intra prediction block to a luminance block or a chrominance block.
  • OBMC intra the intra prediction block used in OBMC is referred to as OBMC intra.
  • the video signal processing device can generate a first prediction block for the current block using the block vector of the surrounding blocks, generate a second prediction block predicted using motion information of the current block, and generate a final prediction block by weighting and averaging the first prediction block and the second prediction block.
  • the video signal processing device may apply OBMC to a sub-block within the current block using at least one of intra prediction, IBC prediction (or intra TMP prediction), and inter prediction.
  • the video signal processing device can derive a block vector through the Intra TMP method using the reconstructed samples of the surrounding blocks and generate an Intra TMP prediction block for the current block.
  • the video signal processing device can generate the final prediction block of the OBMC by performing a weighted average of the Intra TMP prediction block and the prediction block predicted using the motion information of the current block.
  • the video signal processing device can perform filtering on the boundary samples of the current block during the OBMC process. Through this, the video signal processing device can alleviate the blocking artifact. Specifically, if the surrounding block is encoded in intra mode, the video signal processing device can apply PDPC to the boundary samples of the current block using an intra prediction mode derived from the surrounding block. At this time, the intra prediction mode can be derived using one of the intra prediction mode of the surrounding block, DIMD, and TIMD. At this time, the video signal processing device can use the prediction block to which the PDPC is applied as the OBMC block.
  • the video signal processing device can use the OBMC block, which is the prediction block to which the PDPC is applied, as the final prediction block for the current block.
  • the video signal processing device can generate the final prediction block for the current block by performing a weighted average of the prediction block to which the PDPC is applied and the inter prediction block.
  • the PDPC applied to the OBMC block can be applied to a luminance block or a chrominance block.
  • the PDPC used in the OBMC process is referred to as OBMC PDPC.
  • the encoder can include information about a prediction method used instead of inter prediction in OBMC in the bitstream. For convenience of explanation, this is referred to as alternative prediction method information.
  • the information about the alternative prediction method can indicate a prediction method used to generate a prediction block instead of inter prediction, such as PDPC and intra prediction.
  • a decoder performing OBMC can obtain information about the alternative prediction method from the bitstream and generate a prediction block by generating an alternative prediction method instead of inter prediction according to the alternative prediction information. If the alternative prediction information indicates the use of an intra prediction mode, the decoder can perform OBMC using an intra prediction block instead of an inter prediction block.
  • the decoder can perform PDPC on boundary samples of the prediction block using an intra prediction mode derived from the neighboring block for the inter prediction block. Furthermore, if the alternative prediction information indicates the use of a DIMD mode, the decoder can generate an intra prediction block using a DIMD intra prediction mode derived from the neighboring block. At this time, the decoder can generate a final prediction block by weighting the generated intra prediction block and the inter prediction block of the current block.
  • the video signal processing device can determine whether to use an intra prediction block instead of an inter prediction block or to apply PDPC, at least one of the length of filtering, and the weight based on the template cost.
  • the method for determining whether to apply based on the template cost can be applied according to the embodiment described in FIG. 48.
  • the video signal processing device can configure a reference template using reconstructed pixels adjacent to the current block.
  • the video signal processing device can predict a reference template region based on motion information of the current block to configure a first reference template.
  • the video signal processing device can predict a reference template region using an intra prediction mode derived using neighboring samples adjacent to the current block to configure a second reference template.
  • the video signal processing device can determine whether to use an intra prediction block for the current block to which OBMC is applied, at least one of the length of filtering, and the weight using at least one of the derived reference template, the first reference template, and the second reference template. Specifically, the video signal processing device can obtain the first cost by calculating the sum of absolute differences (SAD) or mean-removed SAD (MRSAD) per pixel between the reference template and the first reference template. The video signal processing device can obtain the second cost by calculating the SAD or MRSAD per pixel between the reference template and the second reference template. The video signal processing device can obtain the third cost by calculating the SAD or MRSAD per pixel between the first reference template and the second reference template.
  • SAD sum of absolute differences
  • MRSAD mean-removed SAD
  • the video signal processing device may not perform OBMC on the corresponding block.
  • the video signal processing device may perform the first OBMC mode on the corresponding block.
  • the video signal processing device can obtain a value from the second cost (Cost 2) by applying a predetermined calculation formula to the second cost (Cost 2).
  • the predefined calculation formula may be (Cost 2 + (Cost 2 >> 2) + (Cost 2 >> 3)). If the first cost (Cost 1) is less than or equal to the second cost (Cost 2), the video signal processing device may perform the second OBMC mode on the corresponding block.
  • the video signal processing device may perform the third OBMC mode on the corresponding block.
  • Different filtering lengths and weight values may be applied to the first OBMC, the second OBMC, and the third OBMC modes.
  • the embodiment described through FIG. 49 may be applied.
  • the same cost-based OBMC application method may be applied to a chrominance block.
  • the video signal processing device can determine whether to apply PDPC, the length of filtering, and at least one of the weights based on the cost. Specifically, the video signal processing device can generate a prediction block for the current block based on the motion information of the current block. The video signal processing device can apply PDPC to a block predicted using the motion information by using an intra prediction mode derived using neighboring samples adjacent to the current block, thereby generating a PDPC prediction block. The video signal processing device can obtain a cost by calculating a pixel-wise SAD or MRSAD between the prediction block for the current block and the PDPC prediction block.
  • the video signal processing device may not apply PDPC to the corresponding block. If the cost is less than or equal to the predetermined value, the video signal processing device may use the prediction block to which the PDPC is applied as the final prediction block of the current block. In another specific embodiment, the video signal processing device can generate a final prediction block of the current block by weighting the block predicted using the motion information and the prediction block to which the PDPC is applied. The same cost-based method can be applied to the chroma blocks as well.
  • FIG. 51 shows a method for determining the strength of deblocking filtering for a block to which OBMC is applied by a video signal processing device according to an embodiment of the present invention.
  • the video signal processing device can apply OBMC to some sub-blocks of the current block using an intra-prediction block.
  • OBMC can be applied to some sub-blocks as intra-prediction blocks. Blocking artifacts may occur at the boundaries between intra-prediction blocks and inter-prediction blocks during the OBMC process. Even if intra-prediction is applied to a sub-block during the OBMC process, the current block is in inter-coding mode during the deblocking filtering process.
  • the video signal processing device can apply weak filtering applied in the inter-coding mode to the boundaries between the intra-prediction block and the inter-prediction block.
  • the video signal processing device can apply strong filtering applied in the intra-coding mode to the boundaries between the intra-prediction block and the inter-prediction block during the deblocking filtering process.
  • the video signal processing device can store the intra-coding mode and the intra-prediction mode in units of sub-blocks, and determine the strength of the deblocking filtering filtering based on the encoding mode and the prediction mode.
  • a video signal processing device can store whether or not the OBMC intra mode is applied in units of sub-blocks, and determine the strength of filtering of deblocking filtering based on whether or not the OBMC intra mode is applied.
  • p and q in FIG. 51 may be a p block including p pixels and a q block including q pixels in FIG. 51.
  • the p block and the q block may be blocks on which deblocking filtering is performed. For example, when deblocking filtering is performed on a boundary between sub-blocks of a coding block, the p block and the q block may be sub-blocks of the coding block including the boundary.
  • the p block may be a neighboring block of the coding block
  • the q block may be a sub-block of the coding block (a sub-block including a boundary of the coding block).
  • the decoder can determine whether the coding mode of at least one of the p block and the q block is intra mode, CIIP mode, or OBMC intra. If the coding mode of at least one of the blocks is intra mode, CIIP mode, or OBMC intra, the decoder can set the value of bS indicating the filtering strength for the current block to 2. In addition, if the coding mode of at least one of the blocks is neither intra mode, CIIP mode, nor OBMC intra, the decoder can determine whether an edge between the p block and the q block is a transform block edge or whether at least one of the p block and the q block includes an encoded transform coefficient.
  • the decoder can set the value of bS to 1.
  • the decoder can determine whether the IBC mode is applied to at least one of the p block and the q block. If the IBC mode is applied to at least one of the blocks, the decoder can set the value of bS to 1.
  • the decoder can determine whether the difference between the motion information of the p block and the motion information of the q block is 4 or more, or the reference picture of the p block and the reference picture of the q block are different. If neither the p block nor the q block is a block to which the OBMC is applied, and the difference between the motion information of the p block and the motion information of the q block is 4 or more, or the reference picture of the p block and the reference picture of the q block are different, the decoder can set the value of bS to 1.
  • the decoder may set the value of bS to 0.
  • pixel values around the boundary between the p block and the q block may be changed by a predetermined number or more.
  • pixel values less than the predetermined number may be changed.
  • the predetermined number may be an integer.
  • the predetermined number may be 6.
  • a video signal processing device can perform OBMC on sub-blocks A1, A2, A0/L0, and L2 within a current block using an intra prediction block. As described above, this can be referred to as OBMC Intra.
  • the video signal processing device can perform filtering on the boundary portion of the OBMC Intra prediction block generated by the intra prediction to generate a filtered OBMC Intra prediction block. At this time, the filtering can be 1:2:1 low-pass filtering. For example, filtering can be performed on all boundaries of the OBMC Intra block of FIG. 50.
  • the video signal processing device can apply filtering.
  • the video signal processing device can perform filtering on a sub-block basis.
  • Figure 52 shows a matrix-based intra prediction method according to an embodiment of the present invention.
  • a method of performing intra prediction using a model (or matrix) that infers the relationship between the current block and reference samples through a large amount of image data may be referred to as a matrix-based position dependent intra prediction (PDP) method.
  • the video signal processing device may generate a prediction block P(x, y) for the current block through a calculation ((b) of FIG. 52) between a reconstructed reference sample (r) r(k) adjacent to the current block to be predicted and a predefined matrix F(x, y, k).
  • the matrix may vary depending on the size of the current block and the intra prediction directionality mode.
  • the size of the reference sample may vary depending on the size of the current block.
  • T1 and T2 may be a second size specified in advance.
  • T1 and T2 may be a third size specified in advance.
  • the first size specified in advance may be 16.
  • the second pre-specified size may be 2.
  • the third pre-specified size may be 1.
  • W and H in FIG. 47 each represent the width and height of the current block.
  • the video signal processing device may generate a prediction block for the current block using matrix-based intra prediction through a PDP, without using intra prediction using an intra prediction directional mode.
  • whether a PDP can be applied to the current block can be determined using at least one of the size of the current block, the intra prediction directional mode of the current block, whether the current block is a luminance block or a chrominance block, whether an inferred matrix exists, whether a reference sample exists, the encoding mode of the current block, and the reference sample line.
  • the video signal processing device may not be able to use the PDP-based method for the current block.
  • FIGS. 53 and 54 illustrate a method of compensating motion information using DMVR according to one embodiment of the present disclosure.
  • DMVR is a method of obtaining corrected motion information for the current block using the BM (Bilateral Matching) method.
  • the BM (Bilateral Matching) method finds the most similar part between the surrounding search area of the L0 reference block and the surrounding search area of the L1 reference block in a block with bidirectional motion, corrects the initial motion information, and uses the corrected motion information to predict the current block.
  • the size of the search area can be set to an arbitrary size (m x n) based on a specific point in the reference block.
  • the specific point can be the upper left or center of the reference block, and the arbitrary size can be 16 x 16.
  • the most similar part can be the point corresponding to the smallest cost value by calculating the cost value per pixel between each block.
  • the cost value can be calculated using the SAD (Sum of Absolute Differences) or MRSAD (Mean-Removed SAD) method.
  • Information regarding the method used to calculate the cost value may be included in at least one of the SPS, PPS, picture header, and slice header of the bitstream.
  • the decoder can parse the information and calculate the cost value based on the configured method.
  • the cost value may vary depending on the search area, and the corrected motion information may also vary.
  • the decoder can divide the current block into multiple sub-blocks and correct the motion information for each sub-block using DMVR. This is because the motion information for smaller blocks is more accurate than that for larger blocks.
  • DMVR may not be performed on the larger block, but only on the smaller blocks (e.g., sub-blocks) into which it is divided.
  • a single block may be divided into multiple (e.g., four) sub-blocks.
  • the decoder can obtain corrected motion information for each of the divided sub-blocks using DMVR.
  • the decoder can use a multi-DMVR method that derives more accurate motion information through DMVR from the smaller blocks into which it is divided using the corrected motion information found through DMVR in the larger block.
  • Figure 55 illustrates a process of performing multiple DMVR according to one embodiment of the present specification.
  • Figure 55 (a) shows a general process in which multiple DMVR is performed
  • Figure 55 (b) shows the general process of multiple DMVR in more detail.
  • a multi-DMVR can obtain one or more corrected motion information by performing DMVR of a coding unit (block) unit based on initial motion information (S3310). If TM is applied to the current coding block, the decoder can perform TM using one or more corrected motion information obtained in step S3310 (S3320). If the corrected motion information of the current coding block determined by performing TM has changed from bidirectional to unidirectional, the DMVR process cannot be performed, so steps (S3330, S3340) after S3320 are not performed, and the motion of the current block is finally determined to be unidirectional.
  • the decoder can obtain corrected motion information of a sub-block unit for each sub-block by performing DMVR of a sub-block unit (S3330). And the decoder can re-correct the sub-block unit corrected motion information obtained in step S3340 based on BDOF, and finally obtain the corrected motion information based on BDOF.
  • step S3310 of (a) of FIG. 55 can be subdivided into a step (S3301) of performing DMVR in units of coding units (blocks) using an integer-unit search and a step (S3302) of performing DMVR in units of coding units (blocks) using a half-pixel-unit search.
  • the decoder can use a 3x3 Square search to calculate corrected motion information and a pixel-based cost value of the current coding unit (block).
  • the motion resolution can be set in units of integers in step S3301 and in units of half-pixels (1/2) in step S3302.
  • the decoder can obtain corrected motion information using initial motion information and integer-unit correction values.
  • step S3330 of (a) of Fig. 55 is described in detail.
  • the decoder divides the current coding block into multiple sub-blocks, and then steps S3304 and S3305 of (b) of FIG. 55 may be performed for each sub-block.
  • the size of the sub-block may be up to 16 x 16.
  • the decoder can set the corrected motion information acquired in step S3320 as the initial motion information for steps S3304 and S3305.
  • the decoder can perform a global search in integer units using the initial motion information and obtain optimal motion information for the current sub-block and a cost value for the optimal motion information (S3304).
  • the decoder can perform a 3x3 Square search in half-pixel (1/2) units.
  • the motion information acquired through step S3304 can be used as reference motion information for step S3305. That is, a new motion candidate is acquired based on the information acquired through step S3304, and the decoder can evaluate the new motion candidate (S3305).
  • the decoder can evaluate the new motion candidate and store the final motion information for the current sub-block.
  • Steps S3304 and S3305 can be repeatedly performed for all sub-blocks.
  • the DMVR process at the sub-block level has the advantage that all sub-blocks can perform DMVR in parallel because there is no dependency between sub-blocks.
  • the encoder can generate a bitstream containing information indicating whether template matching (TM) of S3320 and S3303 is performed (applied).
  • the decoder can parse the information indicating whether template matching is applied to determine whether template matching is applied to the current block.
  • template matching can be determined on a per-block or per-CU basis. For example, if template matching is applied to the current block and the motion information of the current block is bidirectional, template matching can be performed on both the L0 motion information and the L1 motion information. Otherwise, template matching may not be performed on either the L0 motion information or the L1 motion information.
  • template matching can be determined based on the direction of the motion information of the current block. For example, if template matching is applied to the L0 motion direction of the current block and not to the L1 motion direction, template matching may be applied to the L0 motion information of the current block and not to the L1 motion information. Alternatively, the encoder and decoder may implicitly apply template matching only to the L0 motion direction of the current block, and the L1 motion information may be corrected based on the distance between the corrected L0 motion information and the reference picture in the L1 motion direction.
  • a context model for signaling whether a template is applied to the L1 motion direction can be determined based on at least one of the size of the current block, the ratio of the width and height of the current block, the size of the difference value of the motion information, and whether a template is applied to the L0 motion direction.
  • a video signal processing device can reconstruct a motion information candidate list based on cost values of motion information candidates in the motion information candidate list and information on whether TM is applied to the motion information candidate.
  • the motion information candidate list may include a motion information candidate for which TM is applied to the motion information candidate with the minimum cost value and a motion information candidate for which TM is not applied to the motion information candidate with the minimum cost value.
  • the order of the motion information candidate list may be such that the motion information candidate for which TM is applied is first, and the motion information candidate for which TM is not applied is second. Alternatively, the reverse order may also be possible. That is, the motion candidate list may be constructed based on whether TM is applied.
  • information on whether TM is applied and information on the optimal motion information candidate may be integrated, and index information indicating which motion information candidate was used and whether TM was applied among the integrated motion information candidate list may be included in the bitstream.
  • the decoder may parse the index information to determine the motion information candidate for the current block.
  • FIG. 56 illustrates a search method for obtaining a cost value related to corrected motion information of a coding block according to one embodiment of the present specification.
  • the decoder can obtain initial motion information and set motion candidates to be searched based on the obtained initial motion information. Then, the decoder can obtain corrected motion information based on the cost value obtained by evaluating the set motion candidates. Then, the decoder can obtain the final corrected motion information using model-based fractional MVD optimization according to the motion information resolution of the current block.
  • the corrected motion information obtained in steps S3301, S3302, S3304, S3305, and S3306 of FIG. 55 (b) can be obtained through the method described with reference to FIGS. 56 and 57.
  • Figure 57 illustrates a 3x3 Square search method according to one embodiment of the present specification.
  • the decoder can obtain (calculate) a cost value for the motion information corrected in the previous step (S3501). If a cost value for the previously obtained corrected motion information exists, step S3501 may be omitted.
  • the cost value obtained in step S3501 may be obtained in different ways depending on the motion resolution. For example, if the motion resolution is in integer units, it can be obtained as a pixel-based cost value for the corrected motion information and used as a reference cost value. If the motion resolution is in half-pixel (1/2) units, the decoder obtains a cost value based on the motion information obtained using the initial motion information and the corrected motion information, and obtains a pixel-based cost value for the corrected motion information.
  • the decoder can set compensation values for motion candidates to be searched (S3502). Specifically, motion compensation candidate values can be derived according to a predetermined 3x3 Square search pattern. At this time, the motion compensation candidate values can be set based on the motion resolution. Depending on the motion resolution, the motion compensation candidate values can be scaled to expand their range.
  • the horizontal and vertical directions of the predetermined 3x3 Square search pattern can be Mv(-1, 1), Mv(0, 1), Mv(1, 1), Mv(1, 0), Mv(1, -1), Mv(0, -1), Mv(-1, -1), Mv(-1, 0).
  • the motion resolution is in half-pixel (1/2) units, in order to reduce computational complexity, evaluation may be performed only on odd-numbered motions in the 3x3 Square search pattern, and evaluation may not be performed on even-numbered motions.
  • the decoder can set a new motion candidate using the compensated motion candidate and the motion compensation candidate values.
  • the decoder can reconstruct motion information for a reference block of a picture in the L0 picture list and motion information for a reference block of a picture in the L1 picture list (S3504).
  • the decoder can generate a new motion candidate by adding a motion compensation candidate value to a corrected L0 motion candidate and by differentiating a motion compensation candidate value to a corrected L1 motion candidate.
  • the decoder can generate a new motion candidate by adding a motion compensation candidate value to a corrected L1 motion candidate without modifying the corrected L0 motion candidate.
  • the decoder can generate a new motion candidate by adding a motion compensation candidate value to a corrected L0 motion candidate without modifying the corrected L1 motion candidate.
  • the decoder can calculate a cost value based on motion information for the new motion candidate (S3505).
  • the decoder can compare the motion information-based cost value for the new motion candidate with the reference cost value (S3506). If the motion information-based cost value is greater than the reference cost value, the decoder can store a value that is twice the motion information-based cost value in memory. Then, the decoder can repeat the process from step S3502 without performing the process after step S3506.
  • the decoder can obtain a pixel-based cost value for the new motion candidate (S3507). Then, the reference cost value can be updated to a value that is the sum of the motion information-based cost value and the pixel-based cost value for the new motion candidate. If the motion resolution is in half-pixel (1/2) units, the decoder can repeat the process from step S3501 again to evaluate another new motion candidate. That is, when the motion resolution is in half-pixel (1/2) units, the decoder may only store the evaluation result for the new motion candidate and not use it as the optimal motion candidate. The evaluation result (cost value) for the stored new motion candidate may be used in the model-based fractional MVD optimization step that may be performed later.
  • the decoder may store the new motion candidate as the optimal motion information. If the motion resolution is in integer units, the decoder may store the pixel-based cost value for the new motion candidate acquired in step S3507 as the cost value for the optimal motion information. Thereafter, the decoder may check whether there are motion candidates that have not yet been explored (S3508).
  • the decoder can repeat step S3501 to evaluate new motion candidates, and if all motion candidates have been evaluated, the motion candidate corresponding to the smallest cost value among the cost values for the explored motion candidates can be stored as the final corrected motion (S3509). If the motion resolution is in half-pixel (1/2) units, the decoder can recalculate the optimal half-pixel-unit corrected motion information by performing a model-based fractional MVD optimization process using the cost values for the motion candidates stored in the previous step (S3510). Step S3510 may be similar to the process of decimal-pixel-unit motion inducing using integer-unit pixel-based cost values in DMVR of VVC (Versatile Video Coding). The decoder can obtain optimal motion information by using the cost values for the surrounding (left, right, up, down) motion information adjacent to the location of the optimal motion information.
  • the search method described with reference to FIG. 57 can be repeated an arbitrary number of times, and when repeated, the decoder can only search for locations surrounding the optimal motion information obtained in the previous search.
  • Figure 58 illustrates a search area divided into zones for an integer unit global search process according to one embodiment of the present specification.
  • the integer-unit global search may be a search performed by dividing the search area into several zones centered on a center position and setting different weights for each zone.
  • the center position of the search area may be the upper left pixel position of the reference block indicated by the initial motion information.
  • the weights for each zone may be set differently according to the motion characteristics of the neighboring blocks of the current block and the current block. For example, if the similarity between the motions of the neighboring blocks of the current block and the current block is high, the weights may be set to increase in order from the center zone to the edge zone.
  • the weights may be set to decrease in order from the center zone to the edge zone. If the pixel-based cost value for the corrected motion information acquired in step S3310 of Fig. 55 (a) is less than a certain value, the integer-unit global search may not be performed. Additionally, if the pixel-based cost value for any motion compensation value within the search area is smaller than a certain value, the certain motion compensation value becomes the final compensated motion information, and the integer-unit global search can be terminated.
  • the certain value can be the number of pixels in the current block or the size of the current block. For example, the size of the current block can be 16x16.
  • Figures 59 and 60 illustrate a global search process in integer units according to one embodiment of the present specification.
  • the decoder can set motion candidates to search based on the input initial motion information.
  • the decoder can then evaluate the motion candidates to obtain final corrected motion information.
  • a global search in integer units can be performed for all positions in each region, starting from the center region and moving on to the edge region, as illustrated in Figure 30.
  • the decoder can reset the search position for each region within the search area according to the size of the block (S3801). At this time, if the size of the block is smaller than an arbitrary value, the decoder evaluates only the search area reduced by an arbitrary value based on the center position of Fig. 58 to reduce computational complexity.
  • the arbitrary value can be half the size of the current block or a positive integer, for example, '8'. After calculating a pixel-based cost value using the initial motion information, it is set as the minimum cost value.
  • the decoder can set a motion compensation value for the search position of the motion candidate and reset the motion compensation value to match the motion resolution to be used in the current block (S3802, S3803).
  • the decoder can set a new motion candidate using the motion compensation value reset in step S3803.
  • the decoder can reconstruct motion information for a reference block of a picture in the L0 picture list and motion information for a reference block of a picture in the L1 picture list (S3804).
  • the decoder can generate a new motion candidate by adding a motion compensation candidate value to the corrected L0 motion candidate and by differentiating the motion compensation candidate value to the corrected L1 motion candidate.
  • the decoder can generate a new motion candidate by adding a motion compensation candidate value to the corrected L1 motion candidate without modifying the corrected L0 motion candidate.
  • the decoder can generate a new motion candidate by adding a motion compensation candidate value to the corrected L0 motion candidate without modifying the corrected L1 motion candidate.
  • the decoder can obtain a pixel-based cost value for the new motion candidate (S3805).
  • the decoder can re-acquire the cost values using the predefined weight values for each region (S3806).
  • the weight values can be positive integer values obtained through experiments.
  • the weight values can be '1', '2', ..., '63'. If the re-acquired cost value is smaller than the minimum cost value, the decoder can update the minimum cost value with the re-acquired cost value. The decoder can evaluate whether the evaluation of all motion candidates has been completed (S3807). If there are motion candidates for which evaluation has not yet been completed, the decoder can restart from step S3802 using the minimum cost value. If the evaluation of all motion candidates has been completed, the decoder can set the information of the motion candidate corresponding to the smallest cost value among the cost values of each motion candidate as the final corrected motion information.
  • the integer-level global search can be applied with an early termination method to reduce the complexity.
  • step S3808 may be performed without checking step S3807, and the integer-unit global search may be terminated.
  • the arbitrary value may be the size or number of pixels of the current block, for example, 16x16.
  • FIG. 61 and FIG. 62 illustrate a method for performing correction of motion information based on BDOF according to one embodiment of the present specification.
  • the correction of motion information based on BDOF of FIG. 61 and FIG. 62 specifically shows the correction of motion information based on BDOF of steps S3340 and S3306 of FIG. 55.
  • the decoder can obtain final corrected motion information by calculating a correction value of BDOF-based motion information based on input initial motion information after dividing the current block into sub-blocks.
  • BDOF can be used to correct a prediction block by estimating the amount of change in pixels from a reference block of a block composed of bidirectional motion.
  • the motion information derived from BDOF can be used to correct the motion of the current block. If the current block is encoded in at least one mode among affine, LIC, OBMC, sub-block MC, CIIP, SMVD, BCW with different weight, and MMVD, BDOF-based motion compensation may not be performed. Meanwhile, BDOF-based motion compensation may be performed when any one of the following conditions is satisfied.
  • the conditions for performing BDOF-based motion compensation may be that the current block i) has a bidirectional motion in merge mode, ii) has the same distance between reference pictures and the current picture, iii) is a block to which weighted prediction between reference blocks is not applied, and iv) has a size greater than any predetermined size.
  • the predetermined size may be the width and height of the block. For example, the width of the block may be '8' and the height may be '8'.
  • BDOF-based motion compensation may be performed in units of sub-blocks, and the size of the sub-block may be at most 16x16.
  • motion information may be identical between adjacent sub-blocks, and BDOF can be performed only once by merging sub-blocks having identical motion information (S4001, S4002).
  • it may be determined whether to merge sub-blocks in the horizontal or vertical direction. For example, if the height is greater than the width of the current block, the sub-blocks may be merged in the vertical direction, and if the width is greater than the height of the current block, the sub-blocks may be merged in the horizontal direction.
  • the decoder may repeatedly perform steps S4003 to S4014 for each sub-block or merged sub-blocks to obtain compensated motion information or a predicted block.
  • the decoder can obtain BDOF parameters using the L0 reference block and the L1 reference block (S4003).
  • the BDOF parameters may include variations between pixel values, etc.
  • the decoder can divide the current block into sub-blocks of a maximum size of 8x8 (S4004), and then repeat steps S4005 to S4012 for each sub-block.
  • the decoder can obtain a pixel-based cost value between L0 and L1 reference blocks (S4005).
  • the decoder can compare the cost value with a preset threshold value (S4006). If the comparison result shows that the cost value is less than the preset threshold value, the decoder can generate a prediction block for the sub-block using the L0 and L1 reference blocks by assigning (0,0) to the motion compensation value without performing motion compensation (S4007, S4009). Conversely, if the comparison result shows that the cost value is equal to or greater than the preset threshold value, the decoder can obtain a motion compensation value based on BDOF (S4008). The decoder can check whether the motion compensation value is (0,0) (S4010).
  • the decoder can generate a prediction block based on BDOF, and if the motion compensation value is not (0,0), the compensation value obtained in step S4008 can be stored (S4011, S4012).
  • the compensated motion information stored in step S4012 may be the final compensated motion information of FIG. 61.
  • the decoder can check whether steps S4003 to S4012 have been performed for every 8x8 sub-block (S4013). If there is an 8x8 sub-block for which steps S4005 to S4012 have not been performed, the decoder can repeat steps S4005 to S4012. If steps S4005 to S4012 have been performed for all 8x8 sub-blocks, the decoder can check whether steps S4003 to S4012 have been performed for all 16x16 sub-blocks (S4014). If there is a 16x16 sub-block for which steps S4003 to S4012 have not been performed, the decoder can repeat steps S4003 to S4012.
  • the BDOF-based motion compensation can be terminated.
  • the 8x8 sub-block may be a sub-block constituting a 16x16 sub-block.
  • FIG. 63 and FIG. 64 illustrate a method for generating a prediction block for a current block based on BDOF according to one embodiment of the present specification.
  • the decoder can generate a prediction block for the current block using the final corrected motion information obtained by performing the process described in FIGS. 61 and 62.
  • the decoder can divide the current block into sub-blocks and generate a prediction block for the current block based on BDOF using the final corrected motion information for each sub-block.
  • the decoder can divide the current block into 8x8 sub-blocks (S4201).
  • the decoder can obtain final corrected motion information by adding the corrected motion information obtained by performing steps S3330 or S3304, and S3305 of FIG. 55 and the motion compensation value obtained by performing steps S3340 or S3306 (S4202).
  • the decoder can check whether the motion compensation value obtained in steps S3340 or S3306 of FIG. 55 is (0,0) (S4203). If the motion compensation value is (0,0), the decoder can use the prediction block obtained in steps S4009 and S4011 of FIG. 62 as a prediction block for the luminance component (S4204).
  • the decoder can generate a prediction block for the chrominance component (S4206).
  • the decoder can generate a prediction block for the luminance component and the chrominance component based on BDOF (S4205).
  • the decoder can check whether the above-described steps S4202 to S4206 have been performed for all 8x8 sub-blocks, and if there are sub-blocks for which the steps S4202 to S4206 have not been performed, the decoder can repeat the steps S4202 to S4206 (S4207).
  • FIG. 65 illustrates a chrominance block and a luminance block corresponding to the chrominance block according to one embodiment of the present specification.
  • a video signal processing device can derive motion information for a chrominance block based on motion information of a luminance block corresponding to the chrominance block.
  • the luminance block corresponding to the chrominance block can be described as a co-located luminance block. Referring to FIG. 65, the position of the upper left pixel (pixel) of the luminance block can be (xCbL, yCbL), and the position of the upper left pixel of the chrominance block can be (xCbC, yCbC).
  • the motion information can include a motion vector.
  • the luminance block for deriving motion information for the chrominance block in the present specification can be a block encoded in IBC mode or intra TMP mode.
  • a video signal processing device can derive (set) motion information for a chrominance block using motion information of a luminance block corresponding to the chrominance block.
  • the video signal processing device can generate a prediction block for the chrominance block using the motion information derived from the luminance block.
  • the video format is 4:4:4
  • the luminance block and the chrominance block have the same size, so the motion information derived from the luminance block can be used as is (identically) for the chrominance block.
  • the video signal processing device can scale the motion information derived from the luminance block and use the scaled motion information as motion information for the chrominance block.
  • the motion information derived from the luminance block can be scaled according to the size ratio between the luminance block and the chrominance block.
  • the video signal processing device can generate a prediction block for the chrominance block using the scaled motion information. For example, when the video format is 4:2:0, the video signal processing device can obtain scaled motion information by scaling a motion vector among the motion information derived from the luminance block.
  • the video signal processing device can obtain scaled motion information by dividing the vertical or horizontal component of the motion vector derived from the luminance block by 2 (or the vertical or horizontal component of the motion vector >> 1).
  • the X >> Y operation is a right shift operation that outputs the quotient of X divided by 2 for the number of Y.
  • the partition structures of the chrominance block and the luminance block of the current block may be different from each other.
  • a method for the video signal processing device to effectively derive the motion information of the chrominance block will be described.
  • a video signal processing device can determine whether a luminance block corresponding to one chrominance block has been divided. At this time, the video signal processing device can determine whether the luminance block has been divided through the division information of the luminance block. The video signal processing device can determine whether the luminance block has been divided based on whether motion information at specific locations of the luminance block is the same. At this time, the specific locations may be the upper left pixel (TL), the upper right pixel (TR), the middle pixel (C), the lower left pixel (BL), and the lower right pixel (BR) of the luminance block, as shown in FIG. 30.
  • the video signal processing device can infer that the luminance block is not divided.
  • the video signal processing device can infer that the luminance block has been divided into two or more blocks.
  • the method for deriving motion information for a chrominance block may vary depending on whether the luminance block is segmented. If the luminance block is not segmented, the video signal processing device can use the motion information of the luminance block corresponding to a specific location in the chrominance block as motion information for the chrominance block. Below, a method for a video signal processing device to derive motion information for a chrominance block when the luminance block is segmented is described.
  • a video signal processing device can construct a motion candidate list using motion information of the multiple luminance blocks.
  • the video signal processing device can determine any one of the motion information included in the motion candidate list as motion information for the chrominance block based on a cost.
  • the video signal processing device can construct a reference template using reconstructed surrounding pixels adjacent to the chrominance block.
  • the video signal processing device can construct a reference template using surrounding pixels in a reference picture at a location indicated by each motion candidate in the motion candidate list.
  • the video signal processing device can calculate the cost of each motion candidate included in the motion candidate list using a SAD (or MR-SAD) between the reference template and the reference template, and re-arrange the motion candidates in ascending order to reconstruct the motion candidate list.
  • the video signal processing device can determine a motion candidate with the lowest cost among the re-arranged motion candidates as motion information for the chrominance block.
  • a video signal processing device can divide a chrominance block into multiple sub-blocks, and then determine motion information of each chrominance sub-block by using motion information of a luminance block corresponding to a specific position of each chrominance sub-block.
  • the video signal processing device can construct a motion information candidate list using at least one of motion information derived from spatial surrounding blocks, motion information derived from temporal surrounding blocks, history-based motion information, motion information using an average value, predetermined motion information, and zero (0,0) motion information.
  • a video signal processing device can determine whether a new motion information candidate exists in a motion information candidate list and determine whether to add the new motion information candidate to the motion information candidate list. At this time, the determination of whether the new motion information candidate exists in the motion information candidate list can be determined based on whether the motion information candidates in the motion information candidate list and the new motion information candidate are the same or similar. If the motion information candidates in the motion information candidate list and the new motion information candidate are the same or similar, the video signal processing device can determine that the new motion information candidate is a duplicate and not add it to the motion information candidate list. The video signal processing device can determine the identity between the motion information candidates by determining whether the horizontal and vertical components (x, y) between the motion information candidates are the same.
  • the video signal processing device can determine the similarity between the motion information candidates by determining whether the difference between the horizontal and vertical components (x, y) between the motion information candidates is within a predetermined value.
  • the arbitrary value can be determined based on at least one of whether TM or DMVR is applied to the current block, the horizontal or vertical size of the current block, the motion resolution of the current block, whether the RRIBC mode is applied to the current block, and whether the zeroComp mode is applied to the current block.
  • the arbitrary value can be 1, 2, 4, etc.
  • a video signal processing device can use a mode that sets one of the horizontal and vertical components of the block vector to '0' and only has a value in the remaining components, which can be called zeroComp mode.
  • the encoder can generate and signal a bitstream that includes information that zeroComp mode is applied to the current block and information about whether the horizontal direction of the block vector is '0' or '0' in the vertical direction.
  • the decoder can parse the information included in the bitstream that zeroComp mode is applied to the current block and information about whether the horizontal direction of the block vector is '0' or '0', and use it when parsing the block vector difference value for the current block or when calculating the block vector for the current block. For example, if zeroComp mode is applied to the current block and the horizontal direction of the block vector is '0', the decoder can parse only the block vector difference value for the vertical direction without parsing the block vector difference value for the horizontal direction. And, when the decoder finally calculates the block vector for the current block, the horizontal direction component of the block vector can be set to '0', and only the vertical direction component can be calculated by adding the predicted value and the differential value of the block vector.
  • the neighboring blocks used in the process of constructing the motion information candidate list can be either spatially adjacent to the current block or distant but not spatially adjacent. Furthermore, temporal neighboring blocks corresponding to the current block from other reference pictures that do not have the same POC as the current picture can be used.
  • the motion information candidates derived from these temporal neighboring blocks can be described as Temporal Motion Vector Predictors (TMVPs).
  • the video signal processing device can construct a motion information candidate list based on at least one of the following information derived from the surrounding blocks: motion information, RRIBC type information, information on whether LIC is performed, information on whether the block is a GPM block, information on whether the motion information is IntraTMP or IBC motion information, information on MHP, and BCW information. For example, if the temporal surrounding block is a horizontal RRIBC block, the video signal processing device can set the motion information candidate for the current block as the horizontal RRIBC motion information.
  • the video signal processing device may use at least one or more of the following information: RRIBC type information of a neighboring block, information on whether LIC is performed on the neighboring block, information on whether the neighboring block is a GPM block, information on whether the neighboring block is a CIIP block (or an IBC-CIIP block), information on whether the neighboring block is an IntraTMP block or an IBC block, information on whether the neighboring block is a spatially derived block or a temporally derived block, information on the MHP of the neighboring block, BCW information of the neighboring block, information on whether TM is applied to the current block, information on whether the current block is in an encoding mode that signals a BVD (Block Vector Difference), information on whether the current block is an IntraTMP block or an IBC block, and information on whether the current block uses at least one or more of the RRIBC, GPM, LIC, and CIIP encoding modes, to
  • the video signal processing device may determine whether to add a motion information candidate determined by using the encoding information of the neighboring block to the motion information candidate list. For example, if the current block is in AMVP encoding mode, the current block is not in RRIBC mode, the current block does not use TM, the block vector of the current block is not a block vector having BVD (or MBVD (merge mode with block vector differences)), the neighboring block is an IBC block, and the RRIBC type of the neighboring block is in the horizontal direction, the video signal processing device may not store the motion information candidate of the neighboring block in the motion information candidate list of the current block.
  • BVD or MBVD (merge mode with block vector differences)
  • the video signal processing device can know in advance which RRIBC mode the current block is, and therefore, depending on the RRIBC mode of the neighboring block, the video signal processing device may add the motion information candidate of the neighboring block to the motion information candidate list, change (or reset) the motion information candidate of the neighboring block and then add it to the motion information candidate list, or not use it as a motion information candidate and add it to the motion information candidate list. That is, the video signal processing device may determine whether to add the motion information candidate of the neighboring block to the motion information candidate list for the current block depending on which RRIBC mode of the neighboring block is. can be.
  • composition of the motion information candidate list for the current block may vary depending on the RRIBC mode of the surrounding blocks. If the surrounding blocks are encoded in the RRIBC mode, the video signal processing device can change the motion information of the surrounding blocks to fit the RRIBC type and then use it as a motion information candidate for the current block, and add it to the motion information candidate list.
  • a method for a video signal processing device to select a temporal neighboring block may be as shown in FIG. 7, wherein the block corresponding to an arbitrary coordinate of the current block in a picture (collocated picture) corresponding to the current picture may be a BR position or a Ctr position in FIG. 7.
  • a block indicated by a vector generated using the motion vector of the A1 block (see FIG. 7) adjacent to the left side of the current block and the Ctr (see FIG. 7) position coordinate of the current block may be used as the temporal neighboring block.
  • a neighboring block corresponding to a position moved by the motion vector of the A1 block adjacent to the left side of the current block based on the Ctr (or BR) position coordinate of the current block in the reference picture may be used as the temporal neighboring block.
  • Figure 66 shows a location for deriving a peripheral block according to one embodiment of the present specification.
  • a video signal processing device can derive motion information from various predefined positions according to the horizontal and vertical sizes of the current block.
  • motion information of temporal neighboring blocks can be derived as many as a predefined number, and for example, the predefined number can be 4.
  • the video signal processing device can derive motion information from positions BR0, Ctr0, BR1, and Ctr1 based on the horizontal and vertical sizes of the current block.
  • the video signal processing device can derive motion information from positions BR0, Ctr0, BR1, and Ctr1 that have been recalculated based on the two horizontal and vertical sizes of the current block.
  • the method of deriving motion information can be repeated until the predefined number of motion information has been filled. That is, the video signal processing device can derive recalculated motion information based on a size N times the horizontal and vertical sizes of the current block until the predefined number of motion information has been filled.
  • N can be 5.
  • the video signal processing device may determine whether to use the motion information derived from the temporal neighboring blocks as a motion information candidate by judging whether the derived motion information is within an arbitrary value when the motion information is further away from the position of the current block, since the derived motion information may not fit the current block. For example, the video signal processing device may determine whether to use the motion information derived from the temporal neighboring blocks as a motion information candidate by using the horizontal and vertical sizes of the neighboring blocks, the horizontal and vertical sizes of the current block, the horizontal and vertical values for the central position of the neighboring blocks, or the horizontal and vertical values for the central position of the current block.
  • the video signal processing device may not use the motion information derived from the temporal neighboring blocks as a block vector candidate.
  • the absolute value of the difference between the vertical value for the center position of the surrounding block and the vertical value for the center position of the current block is greater than the value obtained by multiplying the height of the current block (or the surrounding block) by an arbitrary value
  • the video signal processing device may not use the motion information derived from the temporal surrounding block as a motion information candidate.
  • the arbitrary value may be an integer, and may be '3'.
  • Whether the motion information of a neighboring block can be used as a motion information candidate for the current block or whether the motion information of the neighboring block is added to the motion information candidate list may depend on the horizontal and vertical sizes of the neighboring block, the coding mode information of the neighboring block (IBC, Intra TMP), whether the neighboring block is a spatially derived block or a temporally derived block, the RRIBC type information of the neighboring block, and whether at least one of TM (or DMVR), GPM, LIC, OBMC, MHP, and Affine is applied to the neighboring block.
  • IBC coding mode information of the neighboring block
  • Intra TMP the neighboring block is a spatially derived block or a temporally derived block
  • the RRIBC type information of the neighboring block and whether at least one of TM (or DMVR), GPM, LIC, OBMC, MHP, and Affine is applied to the neighboring block.
  • the motion information of the neighboring block can be used as a motion information candidate for the current block and can be added to the motion information candidate list.
  • the motion information of the neighboring block cannot be used as a motion information candidate for the current block and may not be included in the motion information candidate list.
  • the video signal processing device may use the RRIBC motion information of the neighboring block as a motion information candidate for the current block without changing it, or may generate new motion information by adding an arbitrary value to the horizontal and vertical direction components and then use it as a motion information candidate.
  • the arbitrary value is an integer value determined based on the horizontal and vertical sizes of the neighboring block or the horizontal and vertical sizes of the current block, and may be -3, -2, -1, 0, 1, 2, or 3.
  • Motion information candidates for the current block can be derived from motion information of neighboring blocks located at arbitrary positions in the horizontal and vertical directions from the upper left position of the current block. Neighboring blocks located at arbitrary positions can be described as non-adjacent blocks, and motion information of neighboring blocks located at arbitrary positions can be described as motion information of the non-adjacent blocks.
  • the arbitrary position can vary depending on the horizontal and vertical sizes of the current block or can be set to an arbitrary integer value. In this case, the arbitrary integer value can be 16, 32, etc. In this case, the arbitrary position can be set as long as it does not exceed the IBC reference area memory.
  • non-adjacent motion information can be used as a motion information candidate or added to the motion information candidate list can vary depending on whether the non-adjacent motion information is RRIBC motion information. For example, if the current block is encoded in AMVP mode, not RRIBC mode, and the motion information derived from non-adjacent neighboring blocks is RRIBC motion information, the video signal processing device may not use the motion information derived from non-adjacent neighboring blocks as a motion information candidate and may not include it in the motion information candidate list.
  • the video signal processing device may use the motion information derived from non-adjacent neighboring blocks as a motion information candidate and may add it to the motion information candidate list.
  • the motion information candidate for the current block can be derived from motion information stored in a separate memory.
  • the motion information stored in the separate memory can be referred to as a History-based Block Vector Predictor (HBVP), and the HBVP can be obtained from previously used motion information.
  • HBVP candidate can be used as a motion information candidate or added to the motion information candidate list may depend on whether the HBVP candidate is RRIBC motion information.
  • Whether the HBVP candidate is added to the motion information candidate list may depend on the RRIBC type of the temporally neighboring blocks.
  • the video signal processing device may not use the HBVP candidate as a motion information candidate and may not include it in the motion information candidate list.
  • the video signal processing device may use the HBVP candidate as a motion information candidate.
  • the video signal processing device may not use the HBVP candidate as a motion information candidate and may not include it in the motion information candidate list.
  • the video signal processing device may not use the RRIBC motion information as a motion information candidate and may not add it to the motion information candidate list.
  • a video signal processing device can generate a new motion information candidate from the motion information candidates in the motion information candidate list of the current block and add the new motion information candidate to the motion information candidate list.
  • the newly added motion information candidate can be described as a pair-wise motion information candidate.
  • the video signal processing device can obtain a first motion information candidate and a second motion information candidate from the motion information candidate list, and generate a new motion information candidate by calculating an average between the horizontal components and an average between the vertical components of the two motion information candidates.
  • the video signal processing device can add the new motion information candidate to the motion information candidate list.
  • the first motion information candidate and the second motion information candidate may be different motion information.
  • the video signal processing device can sequentially add predefined motion information candidates to the motion information candidate list.
  • the newly added motion information candidate may be motion information using a zero vector in which horizontal and vertical components of the motion information are (0, 0).
  • the reference picture for each zero vector-based motion candidate may be different, and the reference picture for the zero vector-based motion candidate may be set based on the reference picture list.
  • Figures 67 to 70 illustrate affine motion prediction according to one embodiment of the present specification.
  • a video signal processing device can predict a current block by referring to a reference block (4520) that has a different shape, size, and angle from the prediction block (4510) of the current picture.
  • the reference block (4520) may be a block that is expressed as an affine transformation of the current block (4510). Through this, stretching (scaling), rotation, shearing, reflection, orthogonal projection, etc. can be expressed.
  • Affine motion, or affine transformation can have a variety of parameters. While more parameters can represent a wider variety of motions than fewer parameters, this can incur overhead in signaling and computation.
  • an affine transformation can be represented by six parameters.
  • an affine transformation can be represented by three control point motion vectors.
  • Constraining motion can enable simpler affine motion prediction. Constraining motion can mean limiting the shape by which the current block is transformed relative to the reference block.
  • a video signal processing device can perform affine motion prediction using control point motion vectors of v0 and v1.
  • Using two vectors of v0 and v1 may be equivalent to using four parameters.
  • the two vectors of v0 and v1 or the four parameters can indicate from which shape of reference block the current block is predicted.
  • movements such as rotation and scaling (zoom in/out) can be expressed.
  • the current block indicated by a solid line can be predicted from a reference picture.
  • the location indicated by the dotted line in FIG. 68 can be used in the reference picture.
  • each point (pixel) of the current block can be mapped to another point.
  • Mathematical expression 7 is a mathematical expression for calculating a motion vector field.
  • the control point motion vector v0 of Fig. 68 is (v_0x, v_0y) and may be the motion vector of the upper-left corner control point.
  • the control point motion vector v1 may be (v_1x, v_1y) and may be the motion vector of the upper-right corner control point.
  • the motion vector (v_x, v_y) at the (x, y) position can be calculated using Mathematical expression 7. Therefore, the motion vector for each pixel position or for a certain position can be estimated based on Mathematical expression 7.
  • (x, y) in Equation 7 can be relative coordinates within a block.
  • (x, y) can be a position when the upper left position of the block is (0, 0). If v0 is a control point motion vector for the position (x0, y0) on the picture, and v1 is a control point motion vector for the position (x1, y1) on the picture, the position (x, y) within the block can be represented using the same coordinates as the positions of v0 and v1, and can be represented by changing x and y in Equation 7 to (x-x0) and (y-y0), respectively.
  • w (the width of the block) can be (x1-x0).
  • Affine motion can be represented using multiple control point motion vectors or multiple parameters.
  • a video signal processing device can perform affine motion prediction using three control point motion vectors v0, v1, and v2.
  • Using three control motion vectors v0, v1, and v2 may be equivalent to using six parameters.
  • the three control point motion vectors v0, v1, and v2 or the six parameters can indicate what shape of block the current block is predicted from.
  • the current block indicated by a solid line can be predicted from a reference picture.
  • a location indicated by a dotted line in FIG. 69 can be used in the reference picture.
  • each point (pixel) of the current block can be mapped to another point.
  • Mathematical expression 8 is a mathematical expression for calculating a motion vector field.
  • the control point motion vector v0 of FIG. 69 is (mv_0 ⁇ x, mv_0 ⁇ y) and may be the motion vector of the upper-left corner control point.
  • the control point motion vector v1 is (mv_1 ⁇ x, mv_1 ⁇ y) and may be the upper-right corner control point motion vector.
  • the control point motion vector v2 is (mv_2 ⁇ x, mv_2 ⁇ y) and may be the lower-left corner control point motion vector.
  • the motion vector (mv ⁇ x, mv ⁇ y) at the (x, y) position can be calculated using Mathematical expression 8. Therefore, the motion vector for the position of each pixel or for a certain position can be estimated using Mathematical expression 8.
  • (x, y) can be relative coordinates within the block.
  • (x, y) can be a position when the upper left position of the block is (0, 0).
  • v0 is a control point motion vector for the position (x0, y0) in the picture
  • v1 is a control point motion vector for the position (x1, y1) in the picture
  • v2 is a control motion vector for the position (x2, y2) in the picture
  • the position (x, y) within the block can be represented using the same coordinates as the positions of v0, v1, and v2, and can be represented by changing x and y in Equation 8 to (x-x0) and (y-y0), respectively.
  • w the width of the block
  • h the height of the block
  • a motion vector field exists, and a video signal processing device can calculate a motion vector for each pixel.
  • a sub-block-based affine transformation can be performed to further simplify the calculation of a motion vector.
  • the small square in (a) of FIG. 70 may be a sub-block.
  • the video signal processing device may obtain a representative motion vector of the sub-block. Then, the video signal processing device may use the representative motion vector for pixels of the sub-block.
  • the reference block described through FIGS. 67 to 69 may correspond to the sub-block of FIG. 70.
  • the motion vector may be expressed more simply by applying only translation motion to the sub-block.
  • v0, v1, and v2 of FIG. 70 (a) may be control point motion vectors.
  • the size of a sub-block can be M*N. M and N can be calculated based on mathematical expression 9. Meanwhile, the size of a sub-block can be fixed, for example, the fixed size can be 4x4.
  • MvPre in Equation 9 may be the motion vector fraction accuracy.
  • (v_0x, v_0y), (v_1x, v_1y), (v_2x, v_2y) may be the motion vectors of the top-left, top-right, and bottom-left control points of the current block, respectively.
  • (v_0x, v_0y), (v_1x, v_1y), (v_2x, v_2y) can be obtained through Equation 7.
  • a video signal processing device can obtain a representative motion vector of a sub-block using the central sample location of the sub-block. Furthermore, a motion vector of the sub-block can be created using a motion vector with higher accuracy than a normal motion vector. For this purpose, motion compensation interpolation filters can be applied.
  • Figures 71 and 72 illustrate modes of affine motion prediction according to one embodiment of the present specification.
  • An example of affine motion prediction may include affine inter mode or affine AMVP inter mode.
  • a flag may exist indicating whether affine inter mode is applied. In this case, the flag may be signaled by being included in the bitstream.
  • blocks at positions A, B, and C near v0, and blocks at positions D and E near v1 may exist.
  • the motion vectors corresponding to the blocks at positions A, B, C, D, and E may be vA, vB, vC, vD, and vE, respectively.
  • a candidate list for a motion vector or a motion vector predictor may be constructed using the motion vectors of each block. The candidate list may be constructed using the following formula.
  • the video signal processing device can create a (v0, v1) pair with v0 selected from vA, vB, and vC and v1 selected from vD and vE.
  • the video signal processing device can scale the motion vector based on the POC (picture order count) of the picture including the reference block of the neighboring block, the POC including the reference block of the current block (or CU), and the POC of the current block (or CU).
  • the candidate list is formed using the pair, information indicating which pair in the candidate list is used can be signaled and included in the bitstream.
  • the video signal processing device can include candidates of other inter prediction in the candidate list when the candidate list is not sufficiently filled.
  • the video signal processing device can include AMVP candidates in the candidate list.
  • the video signal processing device can use v0, v1 of the pair selected from the candidate list after correcting them based on the difference, rather than directly using them as the control point motion vectors of affine motion prediction.
  • information about the difference for compensation can be signaled and included in the bitstream. That is, the video signal processing device can obtain v0', v1' by adding the difference to v0, v1 of the pair selected from the candidate list, and use v0', v1' as control point motion vectors for affine motion prediction.
  • the affine inter mode can be used when the coding unit is larger than a certain size.
  • affine motion prediction may be affine merge mode. Whether affine merge mode is used may be indicated by a flag, and the flag may be signaled by being included in the bitstream. If affine merge mode is used, the video signal processing device may obtain (calculate) the control point motion vector of the current block from the motion vectors of the surrounding blocks if affine motion prediction is used in the surrounding blocks of the current block. For example, the surrounding blocks for which the video signal processing device determines whether affine motion prediction is used may be as shown in (a) of FIG. 72. The video signal processing device may determine whether affine motion prediction is used in the order of A, B, C, D, and E of (a) of FIG.
  • the video signal processing device may obtain the control point motion vector of the current block using the motion vector of the block (or surrounding block) for which affine motion prediction is used.
  • A, B, C, D, and E in (a) of Fig. 72 may be blocks located to the left, above, above right, left bottom, and above left of the current block.
  • the video signal processing device can calculate v0 and v1 using the motion vector of the block at position A (or a surrounding block) when the block at position A used affine motion prediction.
  • the motion vector of the block at position A (or a surrounding block) may be v2, v3, or v4.
  • the video signal processing device can improve accuracy by referring to blocks close to each control point motion vector.
  • the video signal processing device can refer to the left block (block A) when deriving v0, and can refer to the upper block (block B) when deriving v1.
  • the video signal processing device can refer to blocks at positions A, D, or E when deriving v0, and can refer to blocks at positions B or C when deriving v1.
  • Figures 73 and 74 illustrate the derivation of an affine motion predictor according to one embodiment of the present disclosure.
  • Control point motion vectors may be required for affine motion prediction.
  • a video signal processing device can calculate a motion vector field, i.e., a motion vector for a sub-block or a specific location, based on the control point motion vector.
  • the control point motion vector can be described as a seed vector.
  • a control point motion vector can be obtained based on a prediction.
  • the predictor can be a control point motion vector.
  • a control point motion vector can be obtained using a corrected predictor based on a difference.
  • the video signal processing device can obtain a control point motion vector by adding or subtracting a difference to the predictor.
  • the predictor of the control point motion vector can be derived from the control point motion vector or motion vector of the surrounding block that has been affine motion predicted (affine motion compensated). For example, if a block at a preset position has been affine motion predicted, the video signal processing device can derive a predictor for affine motion compensation of the current block from the control point motion vector or motion vector of the affine motion predicted block.
  • the preset positions may include positions adjacent to and non-adjacent to the current block. Referring to FIG. 73, the preset positions may be A0, A1, B0, B1, and B2.
  • the video signal processing device may refer to the control point motion vector or motion vector of the spatially or temporally preset positions.
  • the video signal processing device can obtain a candidate for affine motion compensation using the method described through FIG. 73.
  • the candidate may be described as an inherited candidate.
  • the order in which the video signal processing device refers to the preset positions may be a predetermined order.
  • Control point motion vectors may be required for affine motion compensation.
  • a video signal processing device can calculate a motion vector field, i.e., a motion vector for a sub-block or a specific location, based on the control point motion vectors.
  • the control point motion vectors can be described as seed vectors.
  • a control point motion vector can be obtained based on a prediction.
  • the predictor can be a control point motion vector.
  • a control point motion vector can be obtained using a corrected predictor based on a difference.
  • the video signal processing device can obtain a control point motion vector by adding or subtracting a difference to the predictor.
  • the predictor of the control point motion vector can be derived from the motion vector of the surrounding block.
  • the video signal processing device can use the motion vector of the surrounding block to derive the predictor of the motion vector even if the motion vector is an affine motion compensated motion vector or not an affine motion compensated motion vector.
  • the video signal processing device can use the motion vector of a preset position for the control point motion vector as the predictor of the control point motion vector.
  • the preset position may include a position adjacent to the current block.
  • a video signal processing device can determine control point motion vectors mv0, mv1, and mv2.
  • the preset positions may be A, B, C, D, E, F, and G.
  • the motion vectors corresponding to A, B, and C can be used as predictors for mv0.
  • the motion vectors corresponding to D and E can be used as predictors for mv1.
  • the motion vectors corresponding to F and G can be used as predictors for mv2.
  • control point positions may be predetermined.
  • a video signal processing device can obtain a candidate for affine motion compensation using the method described in FIG. 74.
  • the candidate for affine motion compensation can be described as a constructed candidate, an inter candidate, or a virtual candidate.
  • the video signal processing device can generate a candidate list for affine motion compensation or a candidate list for control point motion vectors for affine motion compensation using the method or a combination of methods described through FIGS. 71 to 74.
  • FIG. 75 illustrates a method for deriving TMVP motion candidates according to one embodiment of the present specification.
  • a video signal processing device can predict motion information for the current block by constructing a motion information candidate list for the AMVP mode when the AMVP mode is applied to the current block.
  • the motion information candidate list for the AMVP mode can be divided into an L0 motion information candidate list and an L1 motion information candidate list.
  • the maximum number of motion information candidate lists for the AMVP mode can be an integer greater than or equal to 1, and the maximum number can vary depending on whether a template-based motion compensation method is used. When the template-based motion compensation method is used, the maximum number of motion information candidate lists for the AMVP mode can be 5. When the template-based motion compensation method is not used, the maximum number of motion information candidate lists for the AMVP mode can be 2.
  • the video signal processing device can construct a motion information candidate list for the AMVP mode using at least one of motion information of a neighboring block adjacent to the current block, motion information of a temporal neighboring block (TMVP), motion information of a neighboring block not adjacent to the current block, and a motion candidate using a zero vector.
  • the video signal processing device can add motion information using the same reference picture as the reference picture of the current block among the motion information of the surrounding blocks adjacent to the current block (e.g., A0, A1, B0, B1, B2 in FIG. 73) to the motion information candidate list.
  • the video signal processing device can rearrange the motion information candidate list for the AMVP mode based on the template cost.
  • the video signal processing device can perform TM correction on the motion information candidate having the minimum template cost among the motion information candidates in the rearranged motion information candidate list to obtain a corrected motion information candidate, and use the corrected motion information candidate as a motion candidate for the current block.
  • a video signal processing device can add a TMVP motion candidate to a motion information candidate list.
  • a method for selecting a temporal neighboring block by the video signal processing device can be a block corresponding to a predefined coordinate of a current block in a corresponding picture, as shown in (a) of FIG. 75.
  • the predefined coordinate may be a BR position or a Ctr position of (a) of FIG. 75.
  • the video signal processing device can obtain a TMVP motion candidate using the POC of the corresponding picture, the POC of the reference picture for the temporal neighboring block, the POC of the current picture, and the POC of the reference picture for the current block.
  • the video signal processing device can obtain a TMVP motion candidate (a motion vector indicated by a solid line in (a) of FIG. 75) by scaling a motion vector of a temporal neighboring block based on a distance proportional to the POCs.
  • the video signal processing device can add the obtained TMVP motion candidate to the motion information candidate list.
  • a video signal processing device can use a reference block at a location corresponding to the current block in a reference picture. If an object within a picture moves, the reference block at a location corresponding to the current block in the reference picture may not be similar to the current block. Therefore, to derive a corresponding reference block with high similarity to the current block, a video signal processing device can derive a temporal neighboring block that reflects the motion of the object. At this time, in order to reflect the motion of the object, the video signal processing device can derive a temporal neighboring block that reflects the motion using motion information of adjacent blocks of the current block. This can be called a motion shift-based TMVP.
  • a video signal processing device can add a TMVP candidate based on motion shift to a motion candidate list.
  • the motion shift may also be described as a motion shift.
  • the video signal processing device can use a block indicated by a vector (PMV (Projected MV) of A1 of (b) of FIG. 75) obtained using a motion vector of an A1 block adjacent to the left side of a current block and the Ctr position coordinates of the current block.
  • the video signal processing device can use a neighboring block (Ctr block of a corresponding picture of (b) of FIG.
  • the motion vector of the temporal neighboring block can be scaled and included in the motion information candidate list.
  • FIG. 76 illustrates a method for deriving a TMVP based on a motion shift candidate list according to one embodiment of the present specification.
  • a video signal processing device can derive an optimal motion shift value by constructing a motion shift candidate list.
  • the optimal motion shift value can be derived based on a template cost.
  • the video signal processing device can add motion information of surrounding blocks that are not adjacent to the current block to the first motion candidate list.
  • the video signal processing device can rearrange the first motion candidate list using the template cost.
  • the video signal processing device can construct a motion shift candidate list using the first motion candidate list.
  • the video signal processing device can derive a TMVP candidate list using each motion shift in the motion shift candidate list.
  • the video signal processing device can select a final TMVP candidate from the derived TMVP candidate list.
  • the video signal processing device can add the motion information of the surrounding block to the motion candidate list only when the reference picture of the surrounding block is a corresponding picture.
  • the resolution of the motion vector of the surrounding block can be converted into a motion resolution in integer units and added to the list.
  • the video signal processing device can determine whether the motion information of the surrounding block to be newly added already exists in the first motion candidate list, and add it to the list only if it does not exist. At this time, if the motion information to be newly added and the motion vector in the first motion candidate list are the same, the video signal processing device can determine that the motion information to be newly added already exists in the first motion candidate list.
  • the video signal processing device can determine that the motion information to be newly added already exists in the first motion candidate list when the difference between the motion information to be newly added and the motion vector in the first motion candidate list is smaller than a predefined value.
  • the predefined value may be an integer greater than or equal to 1, and may be 2. This determination process may be referred to as pruning. In other words, pruning may be a process of checking the validity of determining whether motion information can be added to the motion candidate list.
  • the maximum number of first motion candidate lists derived using motion information of non-adjacent surrounding blocks may be a predefined value of an integer greater than or equal to 1, for example, 16.
  • FIG. 77 illustrates a method for reordering a motion candidate list using template cost according to one embodiment of the present specification.
  • FIG. 77 a method for the video signal processing device described in FIG. 76 to rearrange the first motion candidate list using the template cost is described.
  • the video signal processing device can first construct a reference template using already restored samples adjacent to the current block, as shown in (a) of FIG. 77. Next, the video signal processing device can project a motion candidate of the first motion candidate list to the upper left position of the current block. Then, the video signal processing device can construct a prediction template based on the position indicated by the motion candidate in the corresponding picture, as shown in (b) of FIG. 77. The video signal processing device can calculate a cost between the reference template and the prediction template. The video signal processing device can rearrange the first motion candidate list based on the template cost, and construct a second motion candidate list using only a predefined number of upper candidates.
  • a video signal processing device can construct a motion shift candidate list using at least one of motion information of adjacent neighboring blocks, a second motion candidate list, and a HMVP (History based motion vector prediction) motion candidate.
  • the maximum number of candidates that can be included in the motion shift candidate list may be 10, which is an integer greater than or equal to 1.
  • Motion information of adjacent neighboring blocks is preferentially added to the motion shift candidate list, and if the candidates in the list are not filled to the specified maximum number, motion candidates of the second motion candidate list may be added to the list, and if the list is not filled to the specified maximum number, HMVP motion candidates may be added.
  • a video signal processing device can derive a TMVP candidate using each motion shift in a motion shift candidate list.
  • the video signal processing device can use the method described through (b) of FIG. 75 to derive the TMVP candidate.
  • the video signal processing device can derive a TMVP candidate list using the motion shift candidate list.
  • the number of candidates in the TMVP candidate list may be a predetermined number of 8.
  • the number of TMVP candidates finally derived using the TMVP candidate list may be a predetermined number of 1. Therefore, the first TMVP candidate in the TMVP candidate list may become the final TMVP candidate. If the first TMVP candidate already exists in the motion information candidate list for the AMVP mode, the first TMVP candidate may not be added to the motion information candidate list for the AMVP mode.
  • a video signal processing device can select motion information of a block that uses a picture corresponding to a current picture as a reference picture as an optimal motion shift to obtain a motion shift-based TMVP candidate.
  • the video signal processing device can search neighboring blocks based on a predetermined order and select motion information of the first neighboring block that uses the corresponding picture as a reference picture as the optimal motion shift.
  • the predetermined order may be in the order of neighboring blocks A1, A0, B1, B0, and B2 (see (b) of FIG. 77), which are neighboring blocks adjacent to the current block, and neighboring blocks not adjacent to the current block.
  • the optimal motion shift may be motion information derived from an HMVP table.
  • FIG. 78 illustrates a method for deriving a TMVP candidate based on a motion shift candidate list according to one embodiment of the present specification.
  • the motion shift candidate list may include motion information of adjacent surrounding blocks, a second motion candidate list, and HMVP (History-based motion vector prediction) motion candidates.
  • the second motion candidate list may be a candidate reordered based on the template cost.
  • the video signal processing device may perform reordering on all candidates of the motion shift candidate list (see Fig. 76) based on the template cost, and may derive the TMVP candidate list using the reordered motion shift candidate list.
  • the template cost of the second motion candidate list may be a previously calculated template cost.
  • the video signal processing device may configure a motion shift candidate list by reducing the maximum number of the first motion candidate list from 16 to 10 and increasing the maximum number of the motion shift candidate list from 10 to 16, and may configure a TMVP candidate list using the motion shift candidate list.
  • the video signal processing device may not add the TMVP candidate to the list if the final TMVP candidate already exists in the motion information candidate list for the AMVP mode.
  • the video signal processing device may determine whether each TMVP candidate already exists in the motion information candidate list for the AMVP mode for all TMVP candidates in the TMVP candidate list until at least one valid final TMVP candidate is selected (see (b) of FIG. 78). If all TMVP candidates in the TMVP candidate list are invalid (i.e., they already exist in the motion information candidate list for the AMVP mode), the final TMVP candidate may not be added to the motion information candidate list for the AMVP mode. In this way, up to two final TMVP candidates can be added to the motion information candidate list for the AMVP mode.
  • the video signal processing device can increase the maximum number of TMVP candidate lists to 10, and configure the final number of TMVP candidates to be at most 1.
  • the video signal processing device may convert the motion resolution to an integer motion resolution and then add it to the list.
  • the video signal processing device may add the motion candidate to the first motion candidate list without converting the motion resolution or may add it to the motion candidate list after converting it to 1/4 pixel units.
  • the TMVP motion information of the corresponding picture may store only one piece of motion information per predefined block size.
  • the predefined block size may be 4x4, 8x8, etc.
  • the video signal processing device may convert the motion resolution into a unit in which the TMVP motion information is stored and then add it to the list. For example, when the unit in which the TMVP motion information is stored is 4x4, the video signal processing device may convert the motion resolution into a 4-pixel unit motion resolution and then add the motion candidate to the list when adding the motion candidate to the first motion candidate list.
  • the method of converting motion resolution can also be applied when constructing the first motion candidate list or the motion shift candidate list.
  • the video signal processing device can construct a TMVP candidate list based on a motion shift candidate list.
  • the video signal processing device can rearrange the TMVP candidate list based on template cost, output the rearranged TMVP candidate list, and select a final TMVP candidate based on the rearranged TMVP candidate list.
  • the video signal processing device can obtain TMVP candidates using motion information of surrounding blocks used to construct a motion shift candidate list without constructing a motion shift candidate list, and then directly derive a TMVP candidate list using the TMVP candidates, and select a final TMVP candidate using the derived TMVP candidate list.
  • FIGS. 79 and 80 illustrate a method for deriving affine candidates from a history parameter-based affine model according to one embodiment of the present disclosure.
  • a video signal processing device can derive a reconstructed affine candidate by using affine motion information previously encoded and decoded in affine mode in the encoding and decoding order, rather than motion information of a block adjacent to a current block.
  • the video signal processing device can obtain affine parameters (a, b, c, d) from the CPMV of a block encoded in affine mode, the width of the block, and the height of the block.
  • the video signal processing device can store the affine parameters in a history-parameter table (HPT).
  • Mathematical expression 10 represents a mathematical expression for calculating affine motion from the affine parameters.
  • the affine parameters can be obtained in the reverse order of Mathematical expression 10.
  • the HPT can be configured for each reference picture list and reference picture index. For example, if a block encoded in affine mode is an L0 prediction and reference picture index 1 is used, the video signal processing device can store the affine parameters in HPT_L0_1 or HPT(L0, 1). The HPT is updated in blocks encoded in affine mode, and the HPT can be initialized to a preset value based on the parameter values stored in the HPT before the first CTU in each CTU row of a picture/subpicture/slice/tile is encoded. The preset value can be '0'. Alternatively, the preset value can be a commonly used affine parameter.
  • a video signal processing device can obtain HAPC by using Equation 10 after loading a, b, c, d stored in a history-affine-parameter-based candidate (HPT) using one of the motion information of blocks A0, A1, A2, B0, B1, B2, and B3 of FIG. 79.
  • HPT history-affine-parameter-based candidate
  • (a0, b0, c0, d0) may be one of the affine parameters (a, b, c, d).
  • (mv h base , mv v base ) of Equation 10 may be one of the motion information of blocks A0, A1, A2, B0, B1, B2, and B3, and as an embodiment, may be motion information of block A0.
  • (x base , y base ) may be the center position coordinate of one of blocks A0, A1, A2, B0, B1, B2, and B3, and as an embodiment, may be the center position coordinate of block A0.
  • (x, y) may be sample position coordinates within the current block.
  • Equation 10 by substituting the coordinates of the upper left, upper right, and lower left of the current block into (x, y), the MV of the upper left sample position, the MV of the upper right sample position, and the MV of the lower left sample position of the current block can be obtained. Therefore, HAPC can be calculated with up to three (in case of 6 parameters) CPMVs (corner-position MVs) depending on the affine type (4-parameter, 6-parameter).
  • the video signal processing device can calculate the MV of the sample coordinates (x, y) within the current block using the calculated CPMV, the sample coordinates (x, y) within the current block, the horizontal length of the current block, and the vertical length of the current block.
  • a video signal processing device can derive HAPC by using motion information of a neighboring block not adjacent to the current block as (mv h base , mv v base ), rather than using motion information of a neighboring block adjacent to the current block.
  • (x base , y base ) may be the center position coordinates of the neighboring block.
  • the video signal processing device can derive HAPC using TMVP derived from the BR, Ctr positions of Fig. 75 (a) or Fig. 66 as (mv h base , mv v base ).
  • (x base , y base ) can be one of BR, Ctr, which are positions from which TMVP is derived.
  • the encoder and decoder can derive HAPC using the motion shift-based TMVP presented in this specification as (mv h base , mv v base ), and (x base , y base ) can be one of the BR position of the current block, the Ctr position of the current block, and the position where the motion shift-based TMVP is derived.
  • the video signal processing device can store MV base information and Pos base information together with the affine parameters in the HPT.
  • the video signal processing device can obtain HAPC through the affine parameters, MV base information, and Pos base information stored in the HPT and mathematical expression 10.
  • the video signal processing device can set the motion information of a surrounding block that is not adjacent to the current block to (mv h base , mv v base ) for the block to be encoded/decoded next. Then, the video signal processing device can set (x base , y base ) as the central position coordinates of the surrounding block and then store it in the HPT.
  • the video signal processing device can set the TMVP derived from the BR, Ctr positions of Fig. 75 (a) or Fig. 66 to (mv h base , mv v base ) for the block to be encoded/decoded next. And the video signal processing device can set (x base , y base ) to one of the BR, Ctr positions where the TMVP is derived, and then store it in the HPT.
  • the encoder and decoder can set the motion shift-based TMVP to (mv h base , mv v base ) for the next block to be encoded or decoded.
  • the video signal processing device can set (x base , y base ) to one of the BR position of the current block, the Ctr position of the current block, and the position where the motion shift-based TMVP is derived and store it in the HPT.
  • a video signal processing device may complete encoding/decoding of a current block and store motion information of the current block for a block to be encoded/decoded next. At this time, if the motion information of the current block is motion information derived through a motion shift-based TMVP, the motion shift-based TMVP may be stored, and one or more motion shift-based TMVPs derived for each sub-block may be stored.
  • the video signal processing device can perform reordering by considering which surrounding block the motion candidate of the motion candidate list is derived from or the encoding mode of the surrounding block. Specifically, when adding a motion candidate to the motion candidate list, the video signal processing device can add at least one or more of encoding information, motion resolution information, information on whether LIC is applied, RRIBC type information, information on whether it is a GPM block, information on whether it is an Intra TMP or IBC encoding mode, information on MHP, and BCW information to the motion candidate list together with the motion candidate.
  • the encoding information may be encoding mode information of the surrounding block from which the motion candidate is derived, and may be, for example, information on whether it is a merge mode, AMVP mode, AMVP-merge mode, or MMVD mode.
  • the video signal processing device can reorder the motion candidate list using the encoding information. For example, the video signal processing device can reorder the motion candidate list in the order of encoding modes: AMVP, AMVP-merge, MMVD, and merge.
  • the video signal processing device can perform a template cost-based reordering process for each encoding mode.
  • the video signal processing device can reorder the motion candidates encoded with AMVP based on the template cost, and ultimately generate a motion candidate list reordered for each encoding mode/template cost.
  • a video signal processing device may add weight information for the motion candidate to the list along with the motion candidate.
  • the weight information for the motion candidate added to the list may be updated if identical or similar motion candidates exist during the pruning process.
  • the weight for the motion candidate may vary depending on the encoding mode of the surrounding block from which the motion candidate is derived. For example, the weight for the motion candidate may be set higher when the encoding mode of the surrounding block is AMVP than when it is AMVP-Merge mode. Furthermore, the weight for the motion candidate may be set higher when the encoding mode of the surrounding block is MMVD than when it is Merge mode. At this time, the weight for the motion candidate may be an integer greater than 1.
  • the video signal processing device may reorder the motion candidate list based on the motion candidates and the weights for the motion candidates.
  • the motion candidate list may be reordered from motion candidates with lower weights to motion candidates with higher weights.
  • the video signal processing device may reorder the motion candidate list from motion candidates with higher weights to motion candidates with lower weights.
  • the video signal processing device may obtain a modified template cost by recalculating the template cost of each motion candidate based on a weight value when rearranging the motion candidate list based on the template cost. Then, the video signal processing device may rearrange the motion candidate list based on the modified template cost.
  • the modified template cost may be obtained by adding, subtracting, multiplying, or dividing a weight from the template cost.
  • the modified template cost may be obtained by scaling the weight and adding, subtracting, multiplying, or dividing the scaled weight value from the template cost.
  • the weight may be scaled based on the size of the current block. For example, if the sum of the horizontal and vertical sizes of the current block is less than or equal to 16 (for example, if the size of the current block is less than or equal to 8x8) and the weight is N, the video signal processing device may obtain a scaled weight by calculating N ⁇ 1.
  • the video signal processing device can obtain a scaled weight by calculating N ⁇ 2.
  • FIG. 81 illustrates the locations of non-adjacent surrounding blocks according to one embodiment of the present specification.
  • a video signal processing device may add motion information of non-adjacent neighboring blocks to the motion candidate list.
  • the position of the non-adjacent neighboring block may be determined based on the width and size of the current block.
  • the video signal processing device may recursively change the spacing of the positions of the non-adjacent neighboring blocks based on the width and size of the current block, thereby deriving motion candidates from increasingly distant neighboring blocks.
  • the video signal processing device may set a first horizontal spacing and a first vertical spacing based on the width and height of the current block, and then derive motion candidates for the positions of the first predefined neighboring blocks based on the first spacing.
  • the neighboring blocks derived from the first spacing and the positions of the first predefined neighboring blocks may be A0, A1, A2, A3, and A4.
  • the video signal processing device may set a second horizontal spacing to twice the width of the current block, and a second vertical spacing based on twice the height of the current block, and then derive motion candidates for the positions of the first predefined neighboring blocks based on the set second spacing.
  • the neighboring blocks derived from the second interval and the positions of the predefined first neighboring blocks may be B0, B1, B2, B3, B4, B5, B6, B7, and B8.
  • the video signal processing device may use information on whether LIC is applied to the surrounding block as a block vector candidate and add it to the block vector candidate list. Otherwise (if the surrounding block is not an IBC block or if the surrounding block uses RRIBC), the video signal processing device can set the block vector candidate to be included in the block vector candidate list not to apply LIC, regardless of whether the surrounding block applies LIC.
  • Whether a video signal processing device adds a temporal neighboring block to a block vector candidate list may be determined based on the RRIBC type of the temporal neighboring block. For example, if the current block is in AMVP encoding mode and the neighboring block is encoded in RRIBC mode, the video signal processing device may not use the block vector of the neighboring block as a block vector candidate and may not add it to the block vector candidate list. In addition, if the current block is in AMVP encoding mode, the video signal processing device may use the block vector of the neighboring block as a block vector candidate and add it to the block vector candidate list only when the neighboring block is not in RRIBC mode.
  • the video signal processing device may add the block vector of the neighboring block to the block vector candidate list without changing it.
  • the video signal processing device may change the RRIBC block vector of the temporal neighboring block using at least one of the position, height, and width of the neighboring block and the position, height, and width of the current block, and then add the changed RRIBC block vector to the block vector candidate list.
  • the video signal processing device can determine whether to use the encoding information of the neighboring block for configuring a block vector candidate list by using at least one or more of information on the RRIBC type of the neighboring block, information on whether the neighboring block performs LIC, information on whether the neighboring block is a GPM block, information on whether the neighboring block is a CIIP block (or an IBC-CIIP block), information on whether the neighboring block is an Intra TMP block or an IBC block, information on the MHP of the neighboring block, BCW information of the neighboring block, information on whether TM is applied to the current block, information on whether the neighboring block is a spatially induced block or a temporally induced block, information on whether the current block is in an encoding mode that signals a BVD (Block Vector Difference), information on whether the current block is an Intra TMP block or an IBC block, and information on whether the current block uses at least one or more of the RRIBC, GPM, LIC, and CIIP
  • the video signal processing device may not store the block vector candidate of the surrounding block in the block vector candidate list of the current block.
  • the video signal processing device can know in advance which RRIBC mode the current block is, and therefore, depending on which RRIBC mode the surrounding block is, the video signal processing device may add the block vector candidate of the surrounding block to the block vector candidate list, or change (or reset) the block vector candidate of the surrounding block, and then add the changed block vector candidate to the block vector candidate list, or not use it as a block vector candidate and add it to the block vector candidate list. That is, the video signal processing device may add the changed block vector candidate to the block vector candidate list for the current block depending on which RRIBC mode the surrounding block is. It can be determined whether or not.
  • the composition of the block vector candidate list for the current block may vary depending on the RRIBC mode of the surrounding blocks.
  • the video signal processing device can change the block vectors of the surrounding blocks to match the RRIBC type and then use the changed block vectors as block vector candidates for the current block and add them to the block vector candidate list. If the surrounding blocks are encoded in the RRIBC mode, the video signal processing device can change the block vectors of the surrounding blocks based on the position of the current block and then use the changed block vectors as block vector candidates for the current block and add them to the block vector candidate list.
  • the video signal processing device may not use the block vector of the surrounding blocks as a block vector candidate and may not add it to the block vector candidate list. If the current block is in Merge mode, the video signal processing device may change the block vector of the surrounding blocks to fit the RRIBC type regardless of whether the RRIBC type of the current block and the RRIBC types of the surrounding blocks are the same, and then use the changed block vector as a block vector candidate for the current block and add it to the block vector candidate list.
  • the video signal processing device can maintain the RRIBC type information of the surrounding blocks as they are, and add the block vector of the surrounding blocks to the block vector candidate list for the current block.
  • the video signal processing device can change the block vector of the surrounding blocks based on the position of the current block, change the RRIBC type information of the surrounding blocks to a mode that does not use RRIBC, and then add the changed block vector to the block vector candidate list for the current block.
  • the video signal processing device may use a predefined RRIBC block vector candidate list for the AMVP mode when the AMVP mode is applied to the current block and the RRIBC mode is applied.
  • the video signal processing device may use a block vector candidate list for the predefined AMVP mode when the AMVP mode is applied to the current block and a mode (zeroComp) in which either the horizontal or vertical component of the block vector is configured as '0' is applied.
  • the RRIBC block vector candidate list for the predefined AMVP mode or the block vector candidate list for the zeroComp mode may include a predefined number of candidates and a predefined block vector candidate.
  • the number of predefined candidates may be an integer and may be '2'.
  • the predefined block vector candidate may be configured differently depending on the RRIBC type or the zeroComp type.
  • the predefined block vector candidate may be one of (-Width, 0) or (-PosX, 0).
  • Width is the width of the current block
  • PosX can be the value of the horizontal component from the upper left pixel position value of the current block within the picture.
  • the predefined block vector candidate can be one of (0, -Height) or (0, -PoxY).
  • the horizontal component is set to '0'.
  • Height is the height of the current block
  • PosY can be the value of the vertical component from the upper left pixel position value of the current block within the picture.
  • a temporal neighboring block can be a block corresponding to any coordinate of a current block in a reference picture, as shown in FIG. 7, wherein the arbitrary coordinate can be a BR position or a Ctr position in FIG. 7.
  • a block indicated by a vector generated using a block vector (or motion vector) of an A1 block adjacent to the left side of the current block and the Ctr position coordinate of the current block can be used.
  • a neighboring block corresponding to a position moved by the block vector (or motion vector) of an A1 block adjacent to the left side of the current block based on the Ctr (or BR) position coordinate of the current block in the reference picture can be used as a temporal neighboring block.
  • the video signal processing device can derive the block vector (or motion vector) from various predefined positions according to the horizontal and vertical sizes of the current block.
  • the video signal processing device can derive a predefined number of block vectors (or motion vectors) of temporal neighboring blocks, and as an example, the predefined number can be '4'.
  • the video signal processing device can derive block vectors from positions BR0, Ctr0, BR1, and Ctr1 based on the horizontal and vertical sizes of the current block.
  • the video signal processing device can derive block vectors from positions BR0, Ctr0, BR1, and Ctr1 based on twice the horizontal and vertical sizes of the current block.
  • the process of deriving block vectors can be repeated up to N times the width and height of the current block, where N can be 5, until a predefined number of block vectors (or motion vectors) are filled.
  • a video signal processing device can derive multiple block vectors from temporal surrounding blocks, and when adding each block vector to a block vector candidate list, can determine whether to add it to the block vector candidate list after judging the identity and similarity between the block vector candidates.
  • a video signal processing device may derive a block vector candidate for a current block from a block vector of a neighboring block (a non-adjacent block) that is located at an arbitrary position in the horizontal and vertical directions from the upper left position of the current block, as shown in FIG. 81.
  • a block vector candidate for the current block derived from a block vector of a non-adjacent block may be described as a non-adjacent block vector candidate.
  • the arbitrary position may vary depending on the horizontal and vertical sizes of the current block or may be set to an arbitrary integer value, such as 16 or 32. In this case, the arbitrary position may be set within a limit that does not exceed the IBC reference area memory.
  • Whether a non-adjacent block vector can be used as a block vector candidate or added to a block vector candidate list may vary depending on whether the non-adjacent block vector is an RRIBC block vector. For example, if the current block is in AMVP mode and not RRIBC mode, and the block vector derived from a non-adjacent neighboring block is an RRIBC block vector, the video signal processing device may not use the block vector as a block vector candidate and may not add it to the block vector candidate list.
  • the video signal processing device may use the block vector as a block vector candidate and add it to the block vector candidate list.
  • a video signal processing device can derive a block vector candidate for a current block from block vectors stored in a separate memory.
  • the block vectors stored in the separate memory can be referred to as a History-based Block Vector Predictor (HBVP), and the HBVP memory can be constructed from previously used block vectors.
  • HBVP History-based Block Vector Predictor
  • Whether the video signal processing device can use the HBVP candidate as a block vector candidate or add it to a block vector candidate list may depend on whether the HBVP candidate is an RRIBC block vector.
  • Whether the video signal processing device adds the HBVP candidate to the block vector candidate list may depend on the RRIBC type of a temporally neighboring block.
  • the video signal processing device may not use the block vector as a block vector candidate and may not add it to the block vector candidate list.
  • the video signal processing device may use the block vector as a block vector candidate and add it to the block vector candidate list.
  • the video signal processing device may not use the block vector as a block vector candidate and may not add it to the block vector candidate list.
  • the video signal processing device may not use the block vector as a block vector candidate and may not add it to the block vector candidate list.
  • a video signal processing device can configure a plurality of HBVP memories according to RRIBC types and use them to derive block vector candidates for a current block.
  • the video signal processing device can configure an HBVP memory configured only with block vectors in which an RRIBC mode is not used, an HBVP memory configured only with block vectors in which a horizontal type of RRIBC mode is used, and an HBVP memory configured only with block vectors in which a vertical type of RRIBC mode is used. If the current block is an AMVP mode and the RRIBC type of the current block is a horizontal direction, the video signal processing device can use an HBVP memory configured only with block vectors in which a horizontal type of RRIBC mode is used to derive block vector candidates.
  • Figure 82 illustrates a method for deriving automatic relocation motion candidates according to one embodiment of the present specification.
  • a video signal processing device can configure an auto-relocated motion candidate by adding it to a motion candidate list for the current block.
  • the auto-relocated motion candidate can be derived using a motion candidate derived from a block surrounding the current block or a motion candidate in the motion candidate list.
  • a motion vector relocated (recalculated) based on the motion vector (or block vector) used for predicting the reference block can be referred to as an auto-relocated motion vector.
  • a motion vector relocated (recalculated) based on the current block can be referred to as an auto-relocated motion vector.
  • a motion candidate using an auto-relocated motion vector can be referred to as an auto-relocated motion candidate or a CMVP (Chained Motion Vector Prediction) candidate.
  • MVL0 k(0) may be an initial motion vector used to derive an automatic rearrangement motion candidate.
  • the video signal processing device may derive a motion vector or a block vector from a reference block in a reference picture (RefPicL0 k(0) ) indicated by MVL0 k(0 ) of a current block of a current picture.
  • a block vector BV k(0) may be derived from the reference block in the reference picture indicated by MVL0 k(0)
  • another motion vector MVL0 k(1) may be derived from the reference block indicated by BV k(0) .
  • another motion vector or block vector may be derived from the reference block indicated by MVL0 k(1) , and the video signal processing device may finally derive a reference block (RefBlk) indicated by MVL0 k(m) by repeatedly performing this process m times.
  • a video signal processing device can set a motion vector (MVL0 k/m ) from a current block (CurBlk) to a reference block (RefBlk) within a reference picture (RefPicL0 k(m) ) as an automatic rearrangement motion vector.
  • the automatic rearrangement motion vector (MVL0 k/m ) can be calculated as MVL0 k(0) + BV k(0) + MVL0 k(1) + MVL0 k(2) + ... + MVL0 k(m) .
  • the reference picture of the automatic rearrangement motion vector can be RefPicL0 k(m) .
  • m can be a depth at which the automatic rearrangement motion vector is derived.
  • a video signal processing device can determine whether an automatic rearrangement motion vector exists in a motion candidate list, and add the automatic rearrangement motion vector to the motion candidate list only if it does not exist.
  • An automatic rearrangement motion vector is not derived by itself and may require a reference motion vector. Therefore, the video signal processing device can derive an automatic rearrangement motion vector if at least one motion candidate exists in the motion candidate list.
  • the video signal processing device can add a pre-designated candidate to the motion candidate list and add an automatic rearrangement motion vector candidate to the motion candidate list.
  • the pre-designated candidate may be any one of a motion candidate derived from a spatial neighboring block, a motion candidate derived from a spatially non-adjacent and distant neighboring block, a motion candidate derived from a temporal neighboring block, a history-based motion candidate, a motion candidate using an average value, a pre-designated motion candidate, and a zero (0,0) motion candidate.
  • the video signal processing device may add at least one of a motion candidate derived from a spatial neighboring block, a motion candidate derived from a spatially non-adjacent and distant neighboring block, a motion candidate derived from a temporal neighboring block, and a history-based motion candidate to a motion candidate list, and then derive an automatic rearrangement motion candidate and add the same to the motion candidate list.
  • the video signal processing device may not derive an automatic rearrangement motion candidate.
  • the video signal processing device may derive an automatic rearrangement motion candidate based on a predetermined motion vector or block vector and add the same to the motion candidate list.
  • the predetermined motion vector may be one of (-X, 0), (0, -Y), and (-X, -Y), and X and Y may be integers.
  • Figure 83 shows a reference position for deriving an automatic relocation movement candidate according to one embodiment of the present specification.
  • An automatic rearrangement motion vector can be derived from a position shifted by the motion vector based on the center position of the current block.
  • a video signal processing device can derive another motion vector (MVL0 k(1)) from a reference block at a position shifted by the motion vector (MVL0 k(0) ) based on the center position (C) of the current block ( CurBlk ).
  • the motion vector may not exist.
  • the video signal processing device can check whether a motion vector or a block vector exists in a reference block indicated by the motion vector at each position in a specific order for one or more positions of the current block.
  • the specific order may be an order of an upper left position (TR), an upper right position (TL), a lower left position (BR), and a lower right position (BL), or an order of a center position (C), an upper left position (TR), an upper right position (TL), a lower left position (BR), and a lower right position (BL).
  • the video signal processing device can derive the automatic rearrangement motion vector based on the first valid motion vector or block vector in the verification process.
  • the video signal processing device can derive the automatic rearrangement motion vector based on one or more valid motion vectors or block vectors in the reference block indicated by the motion vector at each position.
  • the video signal processing device can add one or more derived automatic rearrangement motion vectors to the motion candidate list.
  • the derivation of the automatic rearrangement motion vector can be performed repeatedly m times. m can be said to be the depth at which the automatic rearrangement motion vector is derived.
  • the video signal processing device derives the automatic rearrangement motion vector based on the order of the center position (C), the upper left position (TR), the upper right position (TL), the lower left position (BR), and the lower right position (BL) of the current block, the automatic rearrangement motion vector can be derived in order of the depth of the automatic rearrangement motion vector derived for each position from the lowest to the highest and added to the motion candidate list.
  • the video signal processing device can derive the automatic rearrangement motion vector in order of the depth of the automatic rearrangement motion vector derived for each position from the highest to the lowest and add it to the motion candidate list.
  • the video signal processing device can derive the automatic rearrangement motion vector based on the order of the depth of the automatic rearrangement motion vector derived for each position from the highest to the lowest.
  • the automatic rearrangement motion vector derived from a block having a depth of 1, from which the automatic rearrangement motion vector is derived can be added to the motion candidate list based on the order of position (C), upper left position (TR), upper right position (TL), lower left position (BR), and lower right position (BL).
  • the video signal processing device can add the automatic rearrangement motion vectors derived from a block having a depth of 2, from which the automatic rearrangement motion vector is derived, to the motion candidate list.
  • the video signal processing device can repeat the derivation of the automatic rearrangement motion vector until the depth from which the automatic rearrangement motion vector is derived becomes an allowed depth, and can also repeat the derivation until the motion candidate list is completely filled.
  • different automatic rearrangement motion vectors can be derived depending on the reference position used to derive the automatic rearrangement motion vector.
  • the video signal processing device can select the automatic rearrangement motion vector most suitable for the current block among the automatic rearrangement motion vectors derived from five reference positions (center position (C), upper left position (TR), upper right position (TL), lower left position (BR), lower right position (BL)), and can additionally derive automatic rearrangement motion vectors in order of depth from low to high based on the selected automatic rearrangement motion vector.
  • the video signal processing device may select the most appropriate automatic rearrangement motion vector by using at least one of AMVR information of the automatic rearrangement motion vector, information on whether the automatic rearrangement motion vector is AMVP or derived using merge, information on whether the automatic rearrangement motion vector uses an affine mode, information on whether the automatic rearrangement motion vector is constructed through MVD or MMVD, and similarity between automatic rearrangement motion vectors, and may add the selected automatic rearrangement motion vector to a motion candidate list. For example, the video signal processing device may add the automatic rearrangement motion vector to the motion candidate list if the derived automatic rearrangement motion vector is a motion vector in 1/4 pixel units or derived using the AMVP mode.
  • the video signal processing device may add the automatic rearrangement motion vector to the motion candidate list if the derived automatic rearrangement motion vector is a motion vector in 1/4 pixel units or derived using the AMVP mode. If the first automatic relocation motion vector derived from the center position (C) among the positions (C), the upper left position (TR), the upper right position (TL), the lower left position (BR), and the lower right position (BL) is the most suitable automatic relocation motion vector for the current block, the first automatic relocation motion vector derived from the center position (C) can be added to the motion candidate list.
  • the center of the block indicated by the first automatic relocation motion vector (e.g., a block with depth 1)
  • the automatic rearrangement motion vector most suitable for the current block can be selected according to the above conditions, and the selected second automatic rearrangement motion vector can be added to the motion candidate list.
  • the above method can be performed for the block indicated by the second automatic rearrangement motion vector (e.g., a block with a depth of 2), and this can be repeated in order from the lowest depth to the highest depth to select the automatic rearrangement motion vector, and then add it to the motion candidate list.
  • the video signal processing device can sort the derived automatic rearrangement motion vectors in order of size, and then select one automatic rearrangement motion vector using the median, and add the selected automatic rearrangement motion vector to the motion candidate list.
  • the video signal processing device can derive a motion candidate using one or more motion vectors from among the automatic rearrangement motion vectors derived in the final step and one or more automatic rearrangement motion vectors derived in the intermediate step, and can add the motion candidate to the motion candidate list.
  • the motion candidate may be a motion candidate composed of only L0 motion vectors or a unidirectional motion candidate composed of only L1 motion vectors.
  • the motion candidate may be a bidirectional motion candidate composed of L0 motion vectors and L1 motion vectors, or a bi-predictive motion candidate.
  • the motion candidate may be a motion candidate composed of three or more motion vectors, similar to the MHP encoding mode.
  • the video signal processing device can apply the same weight to the prediction block derived from each motion vector and generate a prediction block for the current block through a weighted average. Furthermore, if there are two or more motion vectors in the derived motion candidate, the video signal processing device can apply different weights to the prediction block derived from each motion vector and generate a prediction block for the current block through a weighted average.
  • the weight may be determined using at least one of the horizontal and vertical sizes of the current block or the reference block, information on whether the motion information of the reference block is AMVP or merge, whether the reference block used affine mode, whether the motion information of the reference block is configured through MVD or MMVD, the distance between the POC of the reference picture including the reference block and the POC of the current picture, whether the reference block is configured with unidirectional motion, whether the reference block is configured with bidirectional or bi-predictive motion, whether the reference block is a block generated by summing the residual block, quantization parameter information for the residual block of the reference block, quantization parameter information of the reference picture including the reference block, and temporal layer information of the reference picture including the reference block.
  • the weight when the motion information of the reference block uses the AMVP mode may be set to be greater than the weight when the motion information of the reference block uses the merge mode.
  • the weight when the motion information of the reference block uses the AMVP mode may be 3, and the weight when the motion information of the reference block uses the merge mode may be 1.
  • a video signal processing device can derive a new motion candidate by combining one or more motion vectors from among the automatic rearrangement motion vector derived in the final step and one or more automatic rearrangement motion vectors derived in the intermediate step.
  • the video signal processing device can select a motion vector to be combined by using at least one or more of the horizontal and vertical sizes of a current block or a reference block, information on whether the motion information of the reference block is AMVP or merge, whether the reference block uses an affine mode, whether the motion information of the reference block is configured through MVD or MMVD, the distance between the POC of the reference picture including the reference block and the POC of the current picture, whether the reference block is configured with unidirectional motion, whether the reference block is configured with bidirectional or bi-predictive motion, whether the reference block is a block generated by summing the residual block, quantization parameter information for the residual block of the reference block, quantization parameter information of the reference picture including the reference block, and temporal layer information of the reference picture including the reference block, and can construct
  • the video signal processing device may combine motion vectors having different temporal layers of reference pictures including a reference block indicated by the automatic rearrangement motion vector.
  • the video signal processing device may derive a new motion candidate by combining automatic rearrangement motion vectors having different reference pictures of the reference blocks indicated by the automatic rearrangement motion vectors.
  • the video signal processing device may derive a new motion candidate by combining automatic rearrangement motion vectors having different POCs of the reference pictures of the reference blocks indicated by the automatic rearrangement motion vectors.
  • the video signal processing device may not derive a combined motion candidate and may not add the combined motion candidate to a motion candidate list.
  • a video signal processing device can rearrange new motion candidates derived by combining automatic rearrangement motion vectors based on costs, and can add a pre-specified number of motion candidates in order of low cost to high cost from the rearranged motion candidates to a motion candidate list.
  • the pre-specified number is an integer, and may be 5.
  • the cost can be calculated based on TM or BM.
  • the video signal processing device can construct a reference template using reconstructed samples adjacent to the current block, construct a reference template using samples adjacent to a reference block predicted from the new motion candidate, and then calculate the cost using SAD, MR-SAD, etc. between the reference template and the reference template.
  • the video signal processing device can calculate the cost using SAD, MR-SAD, etc. between a block predicted using the initial motion vector used to derive the automatic rearrangement motion vector and a reference block predicted from the new motion candidate.
  • the video signal processing device may not apply motion compensation methods such as TM, BM, and DMVR to new motion candidates derived by combining automatically rearranged motion vectors.
  • motion compensation methods such as TM, BM, and DMVR
  • a new motion candidate derived by combining automatic rearrangement motion vectors can be added when constructing a motion candidate list for merge mode or AMVP mode.
  • AMVP has a fixed reference picture for the current block. Therefore, the derived automatic rearrangement motion vector for AMVP mode can be scaled, and a video signal processing device can construct a motion candidate using the scaled automatic rearrangement motion vector and add it to the motion candidate list.
  • the scaled automatic rearrangement motion vector can be calculated using the POC of the current picture, the POC for the reference picture of the current block, the POC for the reference picture including the reference block indicated by the automatic rearrangement motion vector, and the automatic rearrangement motion vector.
  • the video signal processing device can calculate a scaled automatic rearrangement motion vector by multiplying the automatic rearrangement motion vector by a ratio of the distance between the POC of the current picture and the POC for the reference picture of the current block and the distance between the POC of the current picture and the POC for the reference picture including the reference block indicated by the automatic rearrangement motion vector.
  • the video signal processing device can derive an automatic rearrangement motion vector based on the AMVR information of the current block.
  • the AMVR information of the current block is integer pixels
  • the video signal processing device can derive an automatic rearrangement motion vector only using reference blocks that use motion vectors of integer pixel units or more (integer pixel units or integer pixel units of 4).
  • the video signal processing device may not perform the derivation process for the automatic rearrangement motion vector and may not add the automatic rearrangement motion vector to the motion candidate list depending on the horizontal and vertical sizes of the current block and the encoding mode of the current block (GPM, MHP, CIIP, IBC, Intra TMP, AMVP, Merge, AMVP-merge, Affine, OBMC, LIC, BCW, etc.).
  • the video signal processing device may not perform the derivation process for the automatic rearrangement motion vector if the horizontal and vertical sizes of the current block are smaller (or larger) than a predetermined size.
  • the video signal processing device may not perform the derivation process for the automatic rearrangement motion vector if the encoding mode of the current block is GPM.
  • the video signal processing device may not perform the derivation process for the automatic rearrangement motion vector if the encoding mode of the current block is MHP.
  • the video signal processing device may not perform the derivation process for the automatic rearrangement motion vector if OBMC is applied to the current block.
  • a video signal processing device may not derive an automatic rearrangement motion vector from a reference block depending on the horizontal and vertical sizes of the reference block and the encoding mode of the reference block (GPM, MHP, CIIP, IBC, Intra TMP, AMVP, Merge, AMVP-merge, Affine, OBMC, LIC, BCW, etc.).
  • the video signal processing device may not derive an automatic rearrangement motion vector from the reference block.
  • the encoding mode of the reference block is GPM
  • the video signal processing device may not derive an automatic rearrangement motion vector from the reference block.
  • the video signal processing device can determine whether to generate a prediction block of the current block by applying at least one of OBMC, LIC, and BCW to a block predicted using the automatic rearrangement motion vector, depending on whether the OBMC, LIC, and BCW methods have been applied to the reference block indicated by the automatic rearrangement motion vector derived by the above-described method. For example, if LIC has been applied to the reference block indicated by the automatic rearrangement motion vector derived by the above-described method, the video signal processing device can generate a prediction block of the current block by applying LIC to the block predicted using the automatic rearrangement motion vector.
  • the video signal processing device can generate a prediction block of the current block by applying LIC to a block predicted using the automatic rearrangement motion vector even if LIC is not applied to the reference block indicated by the automatic rearrangement motion vector derived by the above-described method.
  • the video signal processing device may not signal or parse syntax information related to at least one of OBMC, MHP, LIC, and BCW when an automatic rearrangement motion vector is used to generate a prediction block of the current block, and OBMC, MHP, LIC, and BCW may be set not to be applied to the current block.
  • a video signal processing device can generate a prediction block of a current block based on affine parameters used in a reference block when an affine mode is applied to a reference block derived from an automatic rearrangement motion vector, and can apply the affine mode to the current block.
  • a video signal processing device may, when an affine mode is applied to a current block, construct an affine candidate list, and at this time, an affine motion candidate derived from an automatic rearrangement motion vector may be added to the affine candidate list.
  • the affine motion candidate derived from the automatic rearrangement motion vector may be an affine motion candidate generated based on an affine parameter used in a reference block derived from the automatic rearrangement motion vector.
  • a video signal processing device can divide a current block into multiple sub-blocks, derive an automatic rearrangement motion vector for one or more of the divided sub-blocks, and generate a predicted sub-block for the sub-block using the derived automatic rearrangement motion vector.
  • an automatic rearrangement motion vector can be derived for all of the divided sub-blocks, and the video signal processing device can generate predicted sub-blocks for the sub-blocks using the derived automatic rearrangement motion vector.
  • a video signal processing device can obtain a reference block indicated by an automatic rearrangement motion vector using only reference pictures in a reference picture list for a current block. In other words, if the reference block indicated by the automatic rearrangement motion vector is not a reference picture in the reference picture list for the current block, the video signal processing device may not use the automatic rearrangement motion vector as a motion vector for the current block. Alternatively, if the reference block indicated by the automatic rearrangement motion vector is not a reference picture in the reference picture list for the current block, the video signal processing device may apply the scaling method to the automatic rearrangement motion vector so that the automatic rearrangement motion vector indicates a reference block of a reference picture in the reference picture list for the current block. In addition, the video signal processing device may generate a scaled automatic rearrangement motion vector and add it to a motion candidate list.
  • FIG. 84 shows a video signal processing device according to an embodiment of the present invention deriving automatic rearrangement motion information from temporal surrounding blocks.
  • the video signal processing device may set the weight using at least one or more of the horizontal and vertical sizes of the current block or the reference block, whether the motion information of the reference block is AMVP or Merge, whether the reference block uses the Affine mode, whether the motion information of the reference block is configured through MVD or MMVD, the distance between the POC of the reference picture including the reference block and the POC of the current picture, whether the reference block is configured with unidirectional motion, whether the reference block is configured with bidirectional or bi-predictive motion, whether the reference block is a block generated by adding the residual block, quantization parameter information for the residual block of the reference block, quantization parameter information of the reference picture including the reference block, and temporal layer information of the reference picture including the reference block.
  • a video signal processing device can rearrange new motion candidates derived by combining automatic rearrangement motion vectors based on cost.
  • the video signal processing device can add a predetermined number of motion candidates from the rearranged motion candidates to a motion candidate list starting from motion candidates with a low cost.
  • the predetermined number can be an integer, for example, 5.
  • the cost can be calculated based on TM or BM.
  • a reference template can be constructed using reconstructed samples adjacent to the current block
  • a reference template can be constructed using samples adjacent to a reference block predicted from the new motion candidate
  • the cost can be calculated using SAD or MR-SAD between the reference template and the reference template.
  • the video signal processing device can calculate the cost using SAD or MR-SAD between a block predicted using the initial motion vector used to derive the automatic rearrangement motion vector and a reference block predicted from the new motion candidate.
  • a video signal processing device may not apply a motion compensation method to a new motion candidate derived by combining automatically rearranged motion vectors.
  • the motion compensation method may include at least one of TM, BM, and DMVR.
  • the video signal processing device can add a new motion candidate derived by combining the automatically rearranged motion vectors to a motion candidate list for the Merge mode or a motion candidate list for the AMVP mode.
  • the video signal processing device can scale the derived automatic rearrangement motion vector.
  • the video signal processing device can construct a motion candidate using the scaled automatic rearrangement motion vector.
  • the video signal processing device can add the scaled automatic rearrangement motion vector to a motion candidate list for the AMVP mode.
  • the video signal processing device can scale the automatic rearrangement motion vector using at least one of the POC of the current picture, the POC for the reference picture of the current block, the POC for the reference picture including the reference block indicated by the automatic rearrangement motion vector, and the automatic rearrangement motion vector.
  • the video signal processing device can scale the automatic rearrangement motion vector by multiplying the automatic rearrangement motion vector by a ratio of the distance between the POC of the current picture and the POC for the reference picture of the current block and the distance between the POC of the current picture and the POC for the reference picture including the reference block indicated by the automatic rearrangement motion vector.
  • the video signal processing device can derive an automatic rearrangement motion vector based on the AMVR information of the current block. If the AMVR information of the current block is an integer pixel, the video signal processing device can derive an automatic rearrangement motion vector only using reference blocks that use motion vectors of integer pixel units or more, for example, integer pixel units or integer pixel units of 4.
  • the video signal processing device may not perform a derivation process for an automatic rearrangement motion vector according to the horizontal and vertical sizes of the current block and the encoding mode of the current block. At this time, the video signal processing device may not add the automatic rearrangement motion vector to the motion candidate list.
  • the encoding mode of the current block may include at least one of GPM, MHP, CIIP, IBC, Intra TMP, AMVP, Merge, AMVP-merge, Affine, OBMC, LIC, and BCW.
  • the video signal processing device may not perform a derivation process for an automatic rearrangement motion vector according to a condition regarding the horizontal and vertical sizes of the current block.
  • the condition regarding the horizontal and vertical sizes of the current block may be that the horizontal and vertical sizes of the current block are smaller than a predetermined size. In another specific embodiment, the condition regarding the horizontal and vertical sizes of the current block may be that the horizontal and vertical sizes of the current block are larger than a predetermined size.
  • the video signal processing device may not perform a derivation process for an automatic rearrangement motion vector depending on a condition regarding the encoding mode of the current block.
  • the condition regarding the encoding mode of the current block may be that the encoding mode of the current block is GPM.
  • the condition regarding the encoding mode of the current block may be that the encoding mode of the current block is MHP.
  • the condition regarding the encoding mode of the current block may be that the encoding mode of the current block is OBMC.
  • a video signal processing device may not derive an automatic rearrangement motion vector of a reference block based on at least one of the horizontal and vertical sizes of the reference block and an encoding mode of the reference block.
  • the encoding mode of the current block may include at least one of GPM, MHP, CIIP, IBC, Intra TMP, AMVP, Merge, AMVP-merge, Affine, OBMC, LIC, and BCW.
  • the video signal processing device may not perform a derivation process for an automatic rearrangement motion vector of the reference block based on a condition regarding the horizontal and vertical sizes of the reference block. In this case, the condition regarding the horizontal and vertical sizes of the reference block may be that the horizontal and vertical sizes of the reference block are smaller than a predetermined size.
  • the condition regarding the horizontal and vertical sizes of the reference block may be that the horizontal and vertical sizes of the reference block are larger than a predetermined size.
  • the video signal processing device may not perform a derivation process for an automatic rearrangement motion vector of the reference block based on a condition regarding the encoding mode of the reference block.
  • the condition regarding the encoding mode of the reference block may be that the encoding mode of the reference block is GPM.
  • the condition regarding the encoding mode of the reference block may be that the encoding mode of the reference block is MHP.
  • the condition regarding the encoding mode of the current reference block may be that the encoding mode of the reference block is OBMC.
  • the video signal processing device may apply at least one of OBMC, LIC, and BCW to a block predicted using the automatic rearrangement motion vector, depending on whether at least one of OBMC, LIC, and BCW is applied to a reference block indicated by the automatic rearrangement motion vector.
  • the video signal processing device may apply the corresponding technique to the block predicted using the automatic rearrangement motion vector.
  • the video signal processing device may apply LIC to the block predicted using the automatic rearrangement motion vector.
  • the video signal processing device may not apply OBMC, LIC, and BCW to the block predicted using the automatic rearrangement motion vector, regardless of whether at least one of OBMC, LIC, and BCW is applied to the reference block indicated by the automatic rearrangement motion vector.
  • the video signal processing device can apply at least one of OBMC, LIC, and BCW to a block predicted using the automatic rearrangement motion vector, regardless of whether at least one of OBMC, LIC, or BCW is applied to a reference block indicated by the automatic rearrangement motion vector. For example, even if LIC is not applied to the reference block indicated by the automatic rearrangement motion vector, the video signal processing device can apply LIC to a block predicted using the automatic rearrangement motion vector.
  • the encoder can include syntax information related to at least one of OBMC, MHP, LIC, or BCW for a block in which automatic rearrangement motion vectors are used in the bitstream. If automatic rearrangement motion vectors are used for the current block, the decoder can parse syntax information related to at least one of OBMC, MHP, LIC, or BCW.
  • a video signal processing device can generate a prediction block for a current block based on affine parameters used in the reference block. At this time, the affine mode can be applied to the current block. When the affine mode is applied to the current block, the video signal processing device can construct an affine candidate list. At this time, the video signal processing device can add an affine motion candidate derived from the automatic rearrangement motion vector to the affine candidate list. The affine motion candidate derived from the automatic rearrangement motion vector can be generated based on affine parameters used in the reference block derived from the automatic rearrangement motion vector.
  • a video signal processing device can divide a current block into multiple sub-blocks and then derive an automatic rearrangement motion vector for one or more of the divided sub-blocks. At this time, the video signal processing device can generate a predicted sub-block for the corresponding sub-block using the derived automatic rearrangement motion vector. In addition, the video signal processing device can derive an automatic rearrangement motion vector for all of the divided sub-blocks. In addition, the video signal processing device can generate predicted sub-blocks for the sub-block using the derived automatic rearrangement motion vector.
  • a video signal processing device can obtain a reference block indicated by an automatic rearrangement motion vector using only reference pictures in a reference picture list for a current block. At this time, if the reference block indicated by the automatic rearrangement motion vector is not a reference picture in the reference picture list for the current block, the video signal processing device may not use the automatic rearrangement motion vector as a motion vector for the current block. In another specific embodiment, if the reference block indicated by the automatic rearrangement motion vector is not a reference picture in the reference picture list for the current block, the video signal processing device may apply the scaling described above to the automatic rearrangement motion vector so that the automatic rearrangement motion vector indicates a reference block of a reference picture in the reference picture list for the current block. Through this, the video signal processing device can generate a scaled automatic rearrangement motion vector and add the generated automatic rearrangement motion vector to a motion candidate list.
  • An automatic rearrangement motion vector is derived from a reference picture. Motion information must be stored for each reference picture in a reference picture list for the current block.
  • the encoder can signal which reference picture is to store motion information in at least one of an SPS, a PPS, a slice, and a tile.
  • the decoder can parse information indicating which reference picture is to store motion information in at least one of an SPS, a PPS, a slice, and a tile.
  • the video signal processing device can determine a reference picture storing motion information based on the parsed information.
  • a reference picture for storing motion information among reference pictures in a reference picture list can be pre-designated.
  • the pre-designated reference picture can be a reference picture smaller than a pre-designated reference picture index in the reference picture list.
  • the pre-designated reference picture index can be an integer.
  • the pre-designated reference picture index can be 2 or 3.
  • the video signal processing device can determine that motion information is stored in a reference picture having a reference picture index of 0, 1, or 2 in the reference picture list.
  • the video signal processing device can derive an automatic rearrangement motion vector using the reference picture having a reference picture index of 0, 1, or 2.
  • the video signal processing device can use the reference picture having the reference picture index of 3 to derive a reference block using the automatic rearrangement motion vector.
  • the video signal processing device may not use the reference picture having the reference picture index of 3 for the purpose of deriving a new automatic rearrangement motion vector.
  • Figure 85 shows a video signal processing device according to an embodiment of the present invention deriving a block vector.
  • a video signal processing device When deriving a block vector of a current block, a video signal processing device can derive a block vector (BV) from a reference block (Reference block A) of a reference picture indicated by motion information (MV) of a surrounding block. At this time, the video signal processing device can derive the block vector of the current block using the block vector of the reference block. In addition, the video signal processing device can add the derived block vector (BV) for the current block to a block vector candidate list of the current block. At this time, the video signal processing device can determine an optimal block vector for the current block using the block vector candidate list.
  • BV block vector
  • the video signal processing device can predict the current block using at least one of a first reference block (Reference block A) indicated by motion information of a surrounding block, a second reference block (Reference block B) indicated by the block vector of the reference block in the reference picture, and a third reference block (Reference block C) indicated by the derived block vector.
  • the video signal processing device can generate a prediction block for the current block by weighting and averaging at least two reference blocks among a first reference block (Reference block A), a second reference block (Reference block B), and a third reference block (Reference block C).
  • FIG. 86 shows a video signal processing device according to an embodiment of the present invention predicting a current block using a mixed vector.
  • a video signal processing device can predict a current block using a mixed vector.
  • the video signal processing device can obtain a mixed vector by combining block vector information for the current block and motion information for the current block.
  • the mixed vector can include one or more pieces of block vector information and one or more pieces of motion information.
  • the motion information can be motion information configured as unidirectional, bidirectional, or bidirectional prediction.
  • the block vector can be derived through the embodiments described with reference to FIG. 85.
  • the block vector can be a block vector candidate of a block vector candidate list derived for the current block.
  • the block vector can be a block vector derived from a reference block of a reference picture indicated by motion information of a neighboring block of the current block.
  • the motion information can be motion information indicating a second reference block.
  • the second reference block can be a reference block indicated by a block vector of a first reference block indicated by motion information of a neighboring block of the current block.
  • the motion information can be motion information of a reference block indicated by a block vector of a temporal neighboring block of the current block.
  • a video signal processing device can obtain a mixed vector by performing a weighted average of a block vector indicated by block vector information and a motion vector indicated by motion information. Specifically, the video signal processing device can generate a prediction block for a current block by performing a weighted average of a first prediction block (Reference block A) using a first motion vector, a second prediction block (Reference block A) using a second motion vector, and a third prediction block (Reference block C) using a block vector.
  • the video signal processing device can generate a prediction block for the current block by performing a weighted average of two prediction blocks using two block vectors and a prediction block using one motion vector.
  • the video signal processing device can determine an optimal mixed vector by using a mixed vector candidate list.
  • the mixed vector candidate list can include candidate motion information and candidate block vectors.
  • the candidates of the mixed vector candidate list can be a combination of motion information and block vectors.
  • the candidates of the mixed vector candidate list can be distinguished into motion information candidates and block vector candidates.
  • a video signal processing device may configure a mixed vector candidate using one of block vector information, motion information, and combination information of block vector information and motion information.

Landscapes

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

Abstract

비디오 신호 디코딩 장치가 개시된다. 상기 비디오 신호 디코딩 장치는 프로세서를 포함한다. 상기 프로세서는 현재 블록을 위한 블록 벡터와 현재 블록을 위한 움직임 정보를 기초로 혼합 벡터를 생성하고, 상기 혼합 벡터를 사용하여 현재 블록에 대한 예측 블록을 생성한다.

Description

비디오 신호 처리 방법 및 이를 위한 장치
본 발명은 비디오 신호의 처리 방법 및 장치에 관한 것으로, 보다 상세하게는 비디오 신호를 인코딩하거나 디코딩하는 비디오 신호 처리 방법 및 장치에 관한 것이다.
압축 부호화란 디지털화한 정보를 통신 회선을 통해 전송하거나, 저장 매체에 적합한 형태로 저장하기 위한 일련의 신호 처리 기술을 의미한다. 압축 부호화의 대상에는 음성, 영상, 문자 등의 대상이 존재하며, 특히 영상을 대상으로 압축 부호화를 수행하는 기술을 비디오 영상 압축이라고 일컫는다. 비디오 신호에 대한 압축 부호화는 공간적인 상관관계, 시간적인 상관관계, 확률적인 상관관계 등을 고려하여 잉여 정보를 제거함으로써 이루어진다. 그러나 최근의 다양한 미디어 및 데이터 전송 매체의 발전으로 인해, 더욱 고효율의 비디오 신호 처리 방법 및 장치가 요구되고 있다.
본 명세서는 비디오 신호 처리 방법 및 이를 위한 장치를 제공하여 비디오 신호의 코딩 효율을 높이기 위한 목적이 있다.
본 명세서는 비디오 신호 처리 방법 및 이를 위한 장치를 제공한다. 본 발명의 실시 예에 따른 비디오 신호 디코딩 장치는 프로세서를 포함한다. 상기 프로세서는 현재 블록을 위한 블록 벡터와 현재 블록을 위한 움직임 정보를 기초로 혼합 벡터를 생성하고, 상기 혼합 벡터를 사용하여 현재 블록에 대한 예측 블록을 생성한다.
상기 혼합 벡터는 상기 현재 블록을 위한 블록 벡터 정보가 지시하는 블록 벡터와 상기 현재 블록을 위한 움직임 정보가 지시하는 움직임 벡터를 포함할 수 있다. 상기 프로세서는 상기 블록 벡터를 기초로 제1 예측 블록을 획득하고 상기 움직임 벡터를 기초로 제2 예측 블록을 획득한 후, 제1 예측 블록과 제2 예측 블록을 가중 평균하여 상기 현재 블록에 대한 예측 블록을 생성할 수 있다.
상기 프로세서는 상기 현재 블록의 제1 주변 블록으로부터 유도된 블록 벡터 정보와 상기 현 재 블록의 제2 주변 블록으로부터 유도된 움직임 정보로 혼합 벡터 리스트를 구성하고, 상기 혼합 벡터 리스트로부터 상기 현재 블록을 위한 블록 벡터와 상기 현재 블록을 위한 움직임 정보를 획득할 수 있다.
상기 프로세서는 상기 현재 블록의 주변 블록의 움직임 정보가 지시하는 참조 픽쳐의 참조 블록으로부터 블록 벡터를 유도할 수 있다.
상기 프로세서는 상기 현재 블록의 주변 블록의 부호화 모드에 따라 상기 현재 블록의 주변 블록의 정보를 상기 혼합 벡터 후보 리스트의 후보로 사용할 지 결정할 수 있다.
본 발명의 실시 예에 따른 비디오 신호 디코딩 장치는 프로세서를 포함한다.
상기 프로세서는 현재 블록의 제1 움직임 정보를 사용하여 제1 예측 블록을 생성하고, 상기 현재 블록의 주변 블록과 상기 주변 블록으로부터 유도된 인트라 예측 모드를 사용하여 제2 예측 블록을 생성하고, 상기 제1 예측 블록과 상기 제2 예측 블록을 가중 평균하여 최종 예측 블록을 생성한다.
상기 프로세서는 상기 주변 블록의 복원된 샘플을 이용하여 유도된 DIMD(decoder side intra mode derivation) 모드를 사용하여 상기 제2 예측 블록을 생성하할 수 있다.
상기 프로세서는 상기 제2 예측 블록을 생성할 때, 인트라 퓨젼을 사용하지 않을 수 있다.
상기 프로세서는 상기 제2 예측 블록을 생성할 때, PDPC(position dependent intra prediction combination)를 사용하지 않을 수 있다.
상기 프로세서는 상기 최종 예측 블록에 필터링을 수행할 수 있다.
본 발명의 실시 예에 따른 비디오 신호 인코딩 장치는 프로세서를 포함한다. 상기 프로세서는 현재 블록을 위한 블록 벡터와 현재 블록을 위한 움직임 정보를 기초로 혼합 벡터를 생성하고, 상기 혼합 벡터를 사용하여 현재 블록에 대한 예측 블록을 생성한다.
상기 혼합 벡터는 상기 현재 블록을 위한 블록 벡터 정보가 지시하는 블록 벡터와 상기 현재 블록을 위한 움직임 정보가 지시하는 움직임 벡터를 포함할 수 있다. 상기 프로세서는 상기 블록 벡터를 기초로 제1 예측 블록을 획득하고 상기 움직임 벡터를 기초로 제2 예측 블록을 획득한 후, 제1 예측 블록과 제2 예측 블록을 가중 평균하여 상기 현재 블록에 대한 예측 블록을 생성할 수 있다.
상기 프로세서는 상기 현재 블록의 제1 주변 블록으로부터 유도된 블록 벡터 정보와 상기 현 재 블록의 제2 주변 블록으로부터 유도된 움직임 정보로 혼합 벡터 리스트를 구성하고, 상기 혼합 벡터 리스트로부터 상기 현재 블록을 위한 블록 벡터와 상기 현재 블록을 위한 움직임 정보를 획득할 수 있다.
상기 프로세서는 상기 현재 블록의 주변 블록의 움직임 정보가 지시하는 참조 픽쳐의 참조 블록으로부터 블록 벡터를 유도할 수 있다.
상기 프로세서는 상기 현재 블록의 주변 블록의 부호화 모드에 따라 상기 현재 블록의 주변 블록의 정보를 상기 혼합 벡터 후보 리스트의 후보로 사용할 지 결정할 수 있다.
본 발명의 실시 예에 따른 비디오 신호 인코딩 장치는 프로세서를 포함하며, 상기 프로세서는 현재 블록의 제1 움직임 정보를 사용하여 제1 예측 블록을 생성하고, 상기 현재 블록의 주변 블록과 상기 주변 블록으로부터 유도된 인트라 예측 모드를 사용하여 제2 예측 블록을 생성하고, 상기 제1 예측 블록과 상기 제2 예측 블록을 가중 평균하여 최종 예측 블록을 생성할 수 있다.
상기 프로세서는 상기 주변 블록의 복원된 샘플을 이용하여 유도된 DIMD(decoder side intra mode derivation) 모드를 사용하여 상기 제2 예측 블록을 생성할 수 있다.
상기 프로세서는 상기 제2 예측 블록을 생성할 때, 인트라 퓨젼을 사용하지 않을 수 있다.
상기 프로세서는 상기 제2 예측 블록을 생성할 때, PDPC(position dependent intra prediction combination)를 사용하지 않을 수 있다.
상기 프로세서는 상기 최종 예측 블록에 필터링을 수행할 수 있다.
본 발명의 실시 예에 따른 비디오 신호 디코딩 장치의 동작 방법은 현재 블록을 위한 블록 벡터와 현재 블록을 위한 움직임 정보를 기초로 혼합 벡터를 생성하는 단계; 및 상기 혼합 벡터를 사용하여 현재 블록에 대한 예측 블록을 생성하는 단계를 포함한다.
본 발명의 실시 예에 따른 비디오 신호 디코딩 장치의 동작 방법은 현재 블록의 제1 움직임 정보를 사용하여 제1 예측 블록을 생성하는 단계; 상기 현재 블록의 주변 블록과 상기 주변 블록으로부터 유도된 인트라 예측 모드를 사용하여 제2 예측 블록을 생성하는 단계; 및 상기 제1 예측 블록과 상기 제2 예측 블록을 가중 평균하여 최종 예측 블록을 생성하는 단계를 포함한다.
본 발명의 실시 예에 따라 저장 매체에 포함되고, 비디오 신호를 포함하는 비트 스트림이 개시된다. 비트 스트림을 생성하는 방법은 현재 블록을 위한 블록 벡터와 현재 블록을 위한 움직임 정보를 기초로 혼합 벡터를 생성하는 단계; 및 상기 혼합 벡터를 사용하여 현재 블록에 대한 예측 블록을 생성하는 단계를 포함한다.
본 발명의 실시 예에 따라 저장 매체에 포함되고, 비디오 신호를 포함하는 비트 스트림이 개시된다. 비트 스트림을 생성하는 방법은 현재 블록의 제1 움직임 정보를 사용하여 제1 예측 블록을 생성하는 단계; 상기 현재 블록의 주변 블록과 상기 주변 블록으로부터 유도된 인트라 예측 모드를 사용하여 제2 예측 블록을 생성하는 단계; 및 상기 제1 예측 블록과 상기 제2 예측 블록을 가중 평균하여 최종 예측 블록을 생성하는 단계를 포함한다.
본 명세서는 효율적으로 비디오 신호를 처리하기 위한 방법을 제공한다.
본 명세서에서 얻을 수 있는 효과는 이상에서 언급한 효과들로 제한되지 않으며, 언급하지 않은 또 다른 효과들은 아래의 기재로부터 본 발명이 속하는 기술분야에서 통상의 지식을 가진 자에게 명확하게 이해될 수 있을 것이다.
도 1은 본 명세서의 일 실시예에 따른 비디오 신호 인코딩 장치의 개략적인 블록도이다.
도 2는 본 명세서의 일 실시예에 따른 비디오 신호 디코딩 장치의 개략적인 블록도이다.
도 3은 픽쳐 내에서 코딩 트리 유닛이 코딩 유닛들로 분할되는 실시예를 도시한다.
도 4는 쿼드 트리 및 멀티-타입 트리의 분할을 시그널링하는 방법의 일 실시예를 도시한다.
도 5 및 도 6은 본 발명의 실시예에 따른 인트라 예측 방법을 더욱 구체적으로 도시한다.
도 7은 인터 예측에서 움직임 후보 리스트를 구성하기 위해 사용되는 주변 블록들의 위치를 나타낸 도면이다.
도 8은 본 명세서의 일 실시예에 따른 템플릿에 기초하여 참조 픽셀 라인을 결정하는 방법을 나타낸다.
도 9는 본 명세서의 일 실시예에 따른 IBC 부호화 방법과 관련된 블록 벡터를 나타낸 도면이다.
도 10은 수평 방향으로의 RRIBC를 사용하여 현재 블록을 예측하는 방법을 나타낸다.
도 11는 수직 방향으로의 RRIBC를 사용하여 현재 블록을 예측하는 방법을 나타낸다.
도 12는 본 명세서의 일 실시예에 따른 Intra TMP 모드로 부호화된 블록의 블록 벡터를 나타낸다.
도 13은 본 명세서의 일 실시예에 따른 GPM 모드에 의해 현재 블록이 분할된 경우, 분할된 영역이 IBC 모드로 부호화되는 경우를 나타낸다.
도 14는 본 명세서의 일 실시예에 따른 현재 블록이 IBC-CIIP 모드로 부호화되는 방법을 나타낸다.
도 15는 본 명세서의 일 실시예에 따른 CCCM 파라미터를 유도하기 위해 사용되는 참조 영역 및 필터 형태의 일 예를 나타낸다.
도 16은 본 명세서의 일 실시예에 따른 비디오 코딩에 사용될 수 있는 변환 커널 종류를 나타낸다.
도 17은 본 명세서의 일 실시예에 따른 LFNST 및 NSPT 변환에 대한 변환 세트 테이블을 나타낸다.
도 18은 LFNST 변환 후 ROI의 실시 예를 나타낸다.
도 19는 본 명세서의 일 실시예에 따른 다중 변환 세트 및 LFNST/NSPT 세트를 유도하는 방법을 나타낸다.
도 20은 본 명세서의 일 실시예에 따른 매핑 테이블을 나타낸다.
도 21은 본 명세서의 일 실시예에 따른 변환 타입 세트 테이블을 나타낸다.
도 22는 본 명세서의 일 실시예에 따른 변환 타입 조합 테이블을 나타낸다.
도 23은 본 명세서의 일 실시예에 따른 IDT 변환 타입에 대한 임계 값 테이블을 나타낸다.
도 24는 본 명세서의 일 실시예에 따른 디블록킹 필터링 과정에서의 블록 경계 및 경계 주변의 샘플들을 나타낸다.
도 25는 본 발명의 일 실시예에 따른 DIMD(Decoder side intra mode derivation)를 이용하여 예측 블록을 생성하는 과정을 나타낸 도면이다.
도 26은 본 발명의 일 실시예에 따른 방향성 정보를 유도하기 위해 사용되는 주변 픽셀의 위치를 나타낸 도면이다.
도 27은 본 발명의 일 실시예에 따른 방향성 모드를 매핑하는 방법을 나타낸 도면이다.
도 28은 본 발명의 일 실시예에 따른 인트라 예측 방향성 모드를 유도하기 위한 히스토그램을 나타낸 도면이다.
도 29는 본 발명의 일 실시예에 따른 인트라 예측 방향성 모드 정보와 가중치를 이용하여 예측 샘플을 생성하는 방법을 나타낸 도면이다.
도 30 및 도 31은 본 발명의 일 실시예에 따른 현재 블록의 인트라 예측 모드를 유도하기 위해 사용되는 템플릿(template)을 나타낸 도면이다.
도 32는 본 발명의 일 실시예에 따른 복수의 참조 픽셀 라인에 기초하여 예측 샘플(픽셀)을 생성하는 방법을 나타내는 도면이다.
도 33은 본 발명의 일 실시예에 따른 복수의 참조 픽셀 라인을 사용하여 샘플을 예측하는 방법을 나타낸다.
도 34는 본 발명의 일 실시예에 따른 템플릿에 기초한 복수의 참조 픽셀 라인을 사용하여 최적의 참조 픽셀 라인을 결정하는 방법을 나타낸 구조도이다.
도 35는 본 발명의 일 실시예에 따른 평면 모드를 사용하여 예측 샘플을 생성하는 방법을 나타낸다.
도 36은 본 발명의 일 실시예에 따른 외삽 필터(extrapolation filter)에 기초한 인트라 예측 모드를 나타낸다.
도 37은 본 발명의 일 실시예에 따른 최적의 인트라 예측 모드 조합을 선정하는 방법을 나타낸다.
도 38 및 도 39은 본 발명의 일 실시예에 따른 현재 블록의 주변 블록을 나타낸다.
도 40은 본 발명의 일 실시예에 따른 예측 모드 기반의 후보 리스트를 사용하는 방법을 나타낸다.
도 41은 본 발명의 실시 예에 따른 참조 샘플 필터링을 보여준다.
도 42는 본 발명의 실시 예에 따른 PDPC 필터링을 보여준다.
도 43은 본 발명의 실시 예에 따른 그래디언트(gradient) PDPC를 보여준다.
도 44는 본 명세서의 일 실시예에 따른 OBMC를 수행하는 과정을 나타내는 도면이다.
도 45는 본 명세서의 일 실시예에 따른 CU 단위의 OMBC를 수행하는 방법을 나타내는 도면이다.
도 46은 본 발명의 일 실시예에 따른 서브 블록 단위의 OBMC를 수행하는 방법을 나타내는 도면이다.
도 47은 본 명세서의 일 실시예에 따른 가중치가 정의된 테이블을 나타내는 도면이다.
도 48은 본 명세서의 일 실시예에 따른, OBMC 수행을 위한 템플릿을 구성하는 방법을 나타내는 도면이다.
도 49는 본 명세서의 일 실시예에 따른 각 OBMC 모드에 따라 예측 블록을 생성하는 방법을 나타내는 도면이다.
도 50은 본 발명의 실시 예에 따른 비디오 신호 처리 장치가 OBMC Intra 를 수행하는 방법을 보여준다.
도 51은 본 발명의 실시 예에 따른 비디오 신호 처리 장치가 OBMC 적용된 블록에 대한 디블록킹 필터링의 세기를 결정하는 방법을 보여준다.
도 52는 본 발명의 실시 예에 따른 매트릭스 기반 인트라 예측 방법을 보여준다.
도 53 및 도 54는 본 명세서의 일 실시예에 따른 DMVR을 사용하여 움직임 정보를 보정하는 방법을 나타낸다.
도 55은 본 명세서의 일 실시예에 따른 다중 DMVR이 수행되는 과정을 나타낸다.
도 56은 본 명세서의 일 실시예에 따른 코딩 블록의 보정된 움직임 정보와 관련된 코스트 값을 획득하기 위한 탐색 방법을 나타낸다.
도 57은 본 명세서의 일 실시예에 따른 3x3 Square 탐색 방법을 나타낸다.
도 58은 본 명세서의 일 실시예에 따른 정수 단위 전역 탐색 과정을 위해 구역별로 나누어진 탐색 영역을 나타낸다.
도 59 및 도 60은 본 명세서의 일 실시예에 따른 정수 단위의 전역 탐색 과정을 나타낸다.
도 61 및 도 62는 본 명세서의 일 실시예에 따른 BDOF에 기반한 움직임 정보의 보정을 수행하는 방법을 나타낸다.
도 63 및 도 64는 본 명세서의 일 실시예에 따른 BDOF에 기반한 현재 블록에 대한 예측 블록을 생성하는 방법을 나타낸다.
도 65는 본 명세서의 일 실시예에 따른 색차 블록과 색차 블록에 대응되는 휘도 블록을 나타낸다.
도 66은 본 명세서의 일 실시예에 따른 주변 블록을 유도하기 위한 위치를 나타낸다.
도 67 내지 도 70은 본 명세서의 일 실시예에 따른 어파인 모션 예측을 나타낸다.
도 71 및 도 72는 본 명세서의 일 실시예에 따른 어파인 모션 예측의 모드를 나타낸다.
도 73 및 도 74는 본 명세서의 일 실시예에 따른 어파인 모션 예측자의 유도를 나타낸다.
도 75는 본 명세서의 일 실시예에 따른 TMVP 움직임 후보를 유도하는 방법을 나타낸다.
도 76은 본 명세서의 일 실시예에 따른 모션 시프트 후보 리스트 기반의 TMVP를 유도하는 방법을 나타낸다.
도 77은 본 명세서의 일 실시예에 따른 템플릿 코스트를 사용하여 움직임 후보 리스트를 재정렬하는 방법을 나타낸다.
도 78은 본 명세서의 일 실시예에 따른 모션 시프트 후보 리스트 기반의 TMVP 후보를 유도하는 방법을 나타낸다.
도 79 및 도 80은 본 명세서의 일 실시예에 따른 히스토리 파라미터 기반 어파인 모델로부터 어파인 후보를 유도하는 방법을 나타낸다.
도 81은 본 명세서의 일 실시예에 따른 인접하지 않은 주변 블록의 위치들을 나타낸다.
도 82는 본 명세서의 일 실시예에 따른 자동 재배치 움직임 후보를 유도하는 방법을 나타낸다
도 83은 본 명세서의 일 실시예에 따른 자동 재배치 움직임 후보를 유도하기 위한 기준 위치를 나타낸다.
도 84는 본 발명의 실시 예에 따른 비디오 신호 처리 장치가 시간적인 주변 블록으로부터 자동 재배치 움직임 정보를 유도하는 것을 보여준다.
도 85는 본 발명의 실시 예에 따른 비디오 신호 처리 장치가 블록 벡터를 유도하는 것을 보여준다.
도 86은 본 발명의 실시 예에 따른 비디오 신호 처리 장치가 혼합 벡터를 이용하여 현재 블록을 예측하는 것을 보여준다.
도 87은 본 명세서의 일 실시예에 따른 자동 재배치 움직임 벡터의 활성화 여부를 시그널링하는 방법을 나타낸다.
도 88은 본 명세서의 일 실시예에 따른 GCI 신택스 구조를 나타낸다.
본 명세서에서 사용되는 용어는 본 발명에서의 기능을 고려하면서 가능한 현재 널리 사용되는 일반적인 용어를 선택하였으나, 이는 당 분야에 종사하는 기술자의 의도, 관례 또는 새로운 기술의 출현 등에 따라 달라질 수 있다. 또한 특정 경우는 출원인이 임의로 선정한 용어도 있으며, 이 경우 해당되는 발명의 설명 부분에서 그 의미를 기재할 것이다. 따라서 본 명세서에서 사용되는 용어는, 단순한 용어의 명칭이 아닌 그 용어가 가진 실질적인 의미와 본 명세서의 전반에 걸친 내용을 토대로 해석되어야 함을 밝혀두고자 한다.
본 명세서에서 'A 및/또는 B'는 'A 또는 B 중 적어도 하나를 포함하는'과 같은 의미로 해석될 수 있다.
본 명세서에서 일부 용어들은 다음과 같이 해석될 수 있다. 코딩은 경우에 따라 인코딩 또는 디코딩으로 해석될 수 있다. 본 명세서에서 비디오 신호의 인코딩(부호화)을 수행하여 비디오 신호 비트스트림을 생성하는 장치는 인코딩 장치 또는 인코더로 지칭되며, 비디오 신호 비트스트림의 디코딩(복호화)을 수행하여 비디오 신호를 복원하는 장치는 디코딩 장치 또는 디코더로 지칭된다. 또한, 본 명세서에서 비디오 신호 처리 장치는 인코더 및 디코더를 모두 포함하는 개념의 용어로 사용된다. 정보(information)는 값(values), 파라미터(parameter), 계수(coefficients), 성분(elements) 등을 모두 포함하는 용어로서, 경우에 따라 의미는 달리 해석될 수 있으므로 본 발명은 이에 한정되지 아니한다. '유닛'은 영상 처리의 기본 단위 또는 픽쳐의 특정 위치를 지칭하는 의미로 사용되며, 휘도(luma) 성분 및 색차(chroma) 성분 중 적어도 하나를 포함하는 이미지 영역을 가리킨다. 또한, '블록'은 휘도 성분 및 색차 성분들(즉, Cb 및 Cr) 중 특정 성분을 포함하는 이미지 영역을 가리킨다. 다만, 실시예에 따라서 '유닛', '블록', '파티션', '신호' 및 '영역' 등의 용어는 서로 혼용하여 사용될 수 있다. 또한, 본 명세서에서 '현재 블록'은 현재 부호화를 진행할 예정인 블록을 의미하며, '참조 블록'은 이미 부호화 또는 복호화가 완료된 블록으로 현재 블록에서 참조로 사용되는 블록을 의미한다. 또한, 본 명세서에서 '루마', 'luma', '휘도', 'Y' 등의 용어는 서로 혼용하여 사용될 수 있다. 또한, 본 명세서에서 '크로마', 'chroma' '색차', 'Cb 또는 Cr' 등의 용어는 서로 혼용하여 사용될 수 있으며, 색차 성분은 Cb와 Cr 2가지로 나누어지므로 각 색차 성분은 구분되어 사용될 수 있다. 또한, 본 명세서에서 유닛은 코딩 유닛, 예측 유닛, 변환 유닛을 모두 포함하는 개념으로 사용될 수 있다. 픽쳐는 필드 또는 프레임을 가리키며, 실시예에 따라 상기 용어들은 서로 혼용하여 사용될 수 있다. 구체적으로 촬영된 영상이 비월주사식(interlace) 영상일 경우, 하나의 프레임은 홀수(또는 기수, top) 필드와 짝수(또는 우수, bottom) 필드로 분리되어, 각 필드는 하나의 픽쳐 단위로 구성되어 부호화 또는 복호화 될 수 있다. 만일 촬영된 영상이 순차주사(progressive) 영상일 경우, 하나의 프레임이 픽쳐로서 구성되어 부호화 또는 복호화 될 수 있다. 또한, 본 명세서에서 '오차 신호', '레지듀얼 신호', '잔차 신호', '잔여 신호' 및 '차분 신호' 등의 용어는 서로 혼용하여 사용될 수 있다. 또한, 본 명세서에서 '인트라 예측 모드', '인트라 예측 방향성 모드', '화면 내 예측 모드' 및 '화면 내 예측 방향성 모드' 등의 용어는 서로 혼용하여 사용될 수 있다. 또한, 본 명세서에서 '모션', '움직임' 등의 용어는 서로 혼용하여 사용될 수 있다. 또한, 본 명세서에서 '좌측', '좌상측', '상측', '우상측', '우측', '우하측', '하측', '좌하측'은 '좌단', '좌상단', '상단', '우상단', '우단', '우하단', '하단', '좌하단'와 서로 혼용하여 사용될 수 있다. 또한, 원소(element), 멤버(member)는 서로 혼용하여 사용될 수 있다. POC(Picture Order Count)는 픽쳐(또는 프레임)의 시간적 위치 정보를 나타내며, 화면에 출력되는 재생 순서가 될 수 있으며, 픽쳐마다 고유의 POC를 가질 수 있다. 또한, 본 명세서에서 블록의 크기는 블록의 가로의 길이와 세로의 길이의 합 또는 곱일 수 있다. 또는 블록의 크기는 블록 내 샘플의 개수를 나타낼 수 있다. 비트 깊이(심도)는 샘플 값의 범위를 비트 단위로 표현한 것일 수 있다. 구체적으로 비트 깊이가 8비트인 경우 샘플 값의 범위는 0에서 255일 수 있다. 내부 비트 깊이는 비디오 신호 처리 장치에서 영상을 효과적으로 부호화 하기 위해 비트 깊이를 확장하였을 때의 비트 깊이를 나타낼 수 있다. 비디오 신호 처리 장치는 영상을 부호화 하기 전에 비트 깊이를 확장하고 복호화 후 출력할 때 비트 깊이를 입력된 원본 영상의 비트 깊이로 축소할 수 있다 예를 들어, 비디오 신호 처리 장치는 8비트 깊이를 가진 영상을 10비트 깊이를 가진 영상으로 확장하여 부호화 및 복호화를 수행한다.
도 1은 본 명세서의 일 실시예에 따른 비디오 신호 인코딩 장치(100)의 개략적인 블록도이다. 도 1을 참조하면, 본 발명의 인코딩 장치(100)는 변환부(110), 양자화부(115), 역양자화부(120), 역변환부(125), 필터링부(130), 예측부(150) 및 엔트로피 코딩부(160)를 포함한다.
변환부(110)는 입력 받은 비디오 신호와 예측부(150)에서 생성된 예측 신호의 차이인 레지듀얼 신호를 변환하여 변환 계수 값을 획득한다. 예를 들어, 이산 코사인 변환(Discrete Cosine Transform, DCT), 이산 사인 변환(Discrete Sine Transform, DST) 또는 웨이블릿 변환(Wavelet Transform) 등이 사용될 수 있다. 이산 코사인 변환 및 이산 사인 변환은 입력된 픽쳐 신호를 블록 형태로 나누어 변환을 수행하게 된다. 변환에 있어서 변환 영역 내의 값들의 분포와 특성에 따라서 코딩 효율이 달라질 수 있다. 레지듀얼 블록에 대한 변환에 사용되는 변환 커널은 수직 변환 및 수평 변환의 분리 가능한 특성을 가지는 변환 커널일 수 있다. 이 경우, 레지듀얼 블록에 대한 변환은 수직 변환 및 수평 변환으로 분리되어 수행될 수 있다. 예를 들어, 인코더는 레지듀얼 블록의 수직 방향으로 변환 커널을 적용하여 수직 변환을 수행할 수 있다. 또한, 인코더는 레지듀얼 블록의 수평 방향으로 변환 커널을 적용하여 수평 변환을 수행할 수 있다. 본 개시에서, 변환 커널은 변환 매트릭스, 변환 어레이, 변환 함수, 변환과 같이 레지듀얼 신호의 변환에 사용되는 파라미터 세트를 지칭하는 용어로 사용될 수 있다. 예를 들어, 변환 커널은 복수의 사용 가능한 커널들 중 어느 하나일 수 있다. 또한, 수직 변환 및 수평 변환 각각에 대해 서로 다른 변환 타입에 기반한 변환 커널이 사용될 수도 있다.
변환계수는 블록의 좌상단으로 갈수록 높은 계수가 분포하고, 블록의 우하단으로 갈수록 '0'에 가까운 계수가 분포한다. 현재 블록의 크기가 커질수록 우하단 영역에서 계수 '0'이 많이 존재할 가능성이 있다. 크기가 큰 블록의 변환 복잡도를 감소시키기 위해서, 임의의 좌상단 영역만을 남기고 나머지 영역은 '0'으로 재설정될 수 있다.
또한, 코딩 블록에서 일부 영역에만 오차 신호가 존재할 수 있다. 이 경우, 임의의 일부 영역에 대해서만 변환 과정이 수행될 수 있다. 실시 일 예로, 2Nx2N 크기의 블록에서 첫번째 2NxN 블록에만 오차 신호가 존재할 수 있으며, 첫번째 2NxN블록에만 변환과정이 수행되지만 두번째 2NxN 블록은 변환과정이 수행되지 않고 인코딩 또는 디코딩되지 않을 수 있다. 여기서 N은 임의의 양의 정수가 될 수 있다.
인코더는 변환 계수가 양자화되기 전에 추가적인 변환을 수행할 수 있다. 전술한 변환 방법은 1차 변환(primary transform)으로 지칭되고, 추가적인 변환은 2차 변환(secondary transform)으로 지칭될 수 있다. 2차 변환은 레지듀얼 블록 별로 선택적일 수 있다. 일 실시예에 따라, 인코더는 1차 변환만으로 저주파 영역에 에너지를 집중시키기 어려운 영역에 대해 2차 변환을 수행하여 코딩 효율을 향상시킬 수 있다. 예를 들어, 레지듀얼 값들이 레지듀얼 블록의 수평 또는 수직 방향 이외의 방향에서 크게 나타나는 블록에 대해 2차 변환이 추가로 수행될 수 있다. 2차 변환은 1차 변환과 달리 수직 변환 및 수평 변환으로 분리되어 수행되지 않을 수 있다. 이러한 2차 변환은 저대역 비-분리 변환(Low Frequency Non-Separable Transform, LFNST)으로 지칭될 수 있다.
양자화부(115)는 변환부(110)에서 출력된 변환 계수 값을 양자화한다.
코딩 효율을 높이기 위하여 픽쳐 신호를 그대로 코딩하는 것이 아니라, 예측부(150)를 통해 이미 코딩된 영역을 이용하여 픽쳐를 예측하고, 예측된 픽쳐에 원본 픽쳐와 예측 픽쳐 간의 레지듀얼 값을 더하여 복원 픽쳐를 획득하는 방법이 사용된다. 인코더와 디코더에서 미스매치가 발생되지 않도록 하기 위해, 인코더에서 예측을 수행할 때에는 디코더에서도 사용 가능한 정보를 사용해야 한다. 이를 위해, 인코더에서는 부호화한 현재 블록을 다시 복원하는 과정을 수행한다. 역양자화부(120)에서는 변환 계수 값을 역양자화하고, 역변환부(125)에서는 역양자화된 변환 계수값을 이용하여 레지듀얼 값을 복원한다. 한편, 필터링부(130)는 복원된 픽쳐의 품질 개선 및 부호화 효율 향상을 위한 필터링 연산을 수행한다. 예를 들어, 디블록킹 필터, 샘플 적응적 오프셋(Sample Adaptive Offset, SAO) 및 적응적 루프 필터 등이 포함될 수 있다. 필터링을 거친 픽쳐는 출력되거나 참조 픽쳐로 이용하기 위하여 복호 픽쳐 버퍼(Decoded Picture Buffer, DPB, 156)에 저장된다.
디블록킹 필터(deblocking filter)는 복원된 픽쳐에서 블록 간의 경계에 생성된 블록 내의 왜곡을 제거하기 위한 필터이다. 인코더는 블록 내의 임의 경계(edge)를 기준으로 몇 개의 열 또는 행에 포함된 픽셀들의 분포를 통해, 해당 경계에 디블록킹 필터를 적용할지 여부를 판단할 수 있다. 블록에 디블록킹 필터를 적용되는 경우, 인코더는 디블록킹 필터링 강도에 따라 긴 필터(Long Filter), 강한 필터(Strong Filter) 또는 약한 필터(Weak Filter)를 적용할 수 있다. 또한, 수평 방향 필터링 및 수직 방향 필터링이 병렬적으로 처리될 수 있다. 샘플 적응적 오프셋(SAO)은 디블록킹 필터가 적용된 레지듀얼 블록에 대하여, 픽셀 단위로 원본 영상과의 오프셋을 보정하는데 사용될 수 있다. 인코더는 특정 픽쳐에 대한 오프셋을 보정하기 위하여 영상에 포함된 픽셀을 일정한 수의 영역으로 구분한 후, 오프셋 보정을 수행할 영역을 결정하고, 해당 영역에 오프셋을 적용하는 방법(Band Offset)을 사용할 수 있다. 또는 인코더는 각 픽셀의 에지 정보를 고려하여 오프셋을 적용하는 방법(Edge Offset)을 사용할 수 있다. CC-SAO(cross component SAO)는 샘플을 보상해주기 위한 방법이다. CC-SAO에서 비디오 신호 처리 장치는 기존 SAO와 유사하게, 복원된 샘플을 카테고리로 분류하고, 각 카테고리별로 오프셋을 유도하여 복원 샘플에 더할 수 있다. 기존 SAO에서 비디오 신호 처리 장치는 각각의 휘도 및 색차 성분만을 사용하나, CC-SAO에서 비디오 신호 처리 장치는 휘도 및 2개의 색차 총 3개 성분을 모두 사용하여 카테고리를 분류한다. 적응적 루프 필터(Adaptive Loop Filter, ALF)는 영상에 포함된 픽셀을 소정의 그룹으로 나눈 후, 해당 그룹에 적용될 하나의 필터를 결정하여 그룹마다 차별적으로 필터링을 수행하는 방법이다. ALF를 적용할지 여부에 관련된 정보는 코딩 유닛 단위로 시그널링될 수 있고, 각각의 블록에 따라 적용될 ALF 필터의 모양 및 필터 계수가 달라질 수 있다. 또한, 적용할 대상 블록의 특성에 관계없이 동일한 형태(고정된 형태)의 ALF 필터가 적용될 수도 있다. BF(Bilateral Filter) 필터링은 주변 샘플 간의 변화 차이를 통해 유도된 샘플 단위의 오프셋을 샘플 단위로 적용하는 방안이다.
예측부(150)는 인트라 예측부(152)와 인터 예측부(154)를 포함한다. 인트라 예측부(152)에서는 현재 픽쳐 내에서 인트라(intra) 예측을 수행하며, 인터 예측부(154)에서는 복호 픽쳐 버퍼(156)에 저장된 참조 픽쳐를 이용하여 현재 픽쳐를 예측하는 인터(inter) 예측을 수행한다. 인트라 예측부(152)는 현재 픽쳐 내의 복원된 영역들로부터 인트라 예측을 수행하여, 인트라 부호화 정보를 엔트로피 코딩부(160)에 전달한다. 인트라 부호화 정보는 인트라 예측 모드, MPM(Most Probable Mode) 플래그, MPM 인덱스, 참조 샘플에 관한 정보 중 적어도 하나를 포함할 수 있다. 인터 예측부(154)는 다시 모션 추정부(154a) 및 모션 보상부(154b)를 포함하여 구성될 수 있다. 모션 추정부(154a)에서는 복원된 참조 픽쳐의 특정 영역을 참조하여 현재 영역과 가장 유사한 부분을 찾고 영역 간의 거리인 모션 벡터 값을 획득한다. 모션 추정부(154a)에서 획득한 참조 영역에 대한 모션 정보(참조 방향 지시 정보(L0 예측, L1 예측, 양방향 예측), 참조 픽쳐 인덱스, 모션 벡터 정보 등) 등을 엔트로피 코딩부(160)로 전달하여 비트스트림에 포함될 수 있도록 한다. 모션 추정부(154a)에서 전달된 모션 정보를 이용하여 모션 보상부(154b)에서는 인터 모션 보상을 수행하여 현재 블록을 위한 예측 블록을 생성한다. 인터 예측부(154)는 참조 영역에 대한 모션 정보를 포함하는 인터 부호화 정보를 엔트로피 코딩부(160)에 전달한다.
추가적인 실시예에 따라, 예측부(150)는 인트라 블록 카피(Intra block copy, IBC) 예측부(미도시)를 포함할 수 있다. IBC 예측부는 현재 픽쳐 내의 복원된 샘플들로부터 IBC 예측을 수행하여, IBC 부호화 정보를 엔트로피 코딩부(160)에 전달한다. IBC 예측부는 현재 픽쳐 내의 특정 영역을 참조하여 현재 영역의 예측에 이용되는 참조 영역을 지시하는 블록 벡터값을 획득한다. IBC 예측부는 획득된 블록 벡터값을 이용하여 IBC 예측을 수행할 수 있다. IBC 예측부는 IBC 부호화 정보를 엔트로피 코딩부(160)로 전달한다. IBC 부호화 정보는 참조 영역의 크기 정보, 블록 벡터 정보(움직임 후보 리스트 내에서 현재 블록의 블록 벡터 예측을 위한 인덱스 정보, 블록 벡터 차분 정보) 중에서 적어도 하나를 포함할 수 있다.
위와 같은 픽쳐 예측이 수행될 경우, 변환부(110)는 원본 픽쳐와 예측 픽쳐 간의 레지듀얼 값을 변환하여 변환 계수 값을 획득한다. 이때, 변환은 픽쳐 내에서 특정 블록 단위로 수행될 수 있으며, 특정 블록의 크기는 기 설정된 범위 내에서 가변할 수 있다. 양자화부(115)는 변환부(110)에서 생성된 변환 계수 값을 양자화하여 양자화된 변환 계수를 엔트로피 코딩부(160)로 전달한다.
상기 2차원 배열 형태의 양자화된 변환 계수는 엔트로피 코딩을 위해 1차원의 배열 형태로 재정렬될 수 있다. 양자화된 변환 계수를 스캐닝하는 방법은 변환 블록의 크기 및 화면 내 예측 모드에 따라 어떠한 스캔 방법이 사용될지 여부가 결정될 수 있다. 실시 일 예로, 대각(Diagonal), 수직(vertical), 수평(horizontal) 스캔이 적용될 수 있다. 이러한 스캔 정보는 블록 단위로 시그널링될 수 있으며, 이미 정해진 규칙에 따라 유도될 수 있다.
엔트로피 코딩부(160)는 양자화된 변환 계수를 나타내는 정보, 인트라 부호화 정보, 및 인터 부호화 정보 등을 엔트로피 코딩하여 비디오 신호 비트스트림을 생성한다. 엔트로피 코딩부(160)에서는 가변 길이 코딩(Variable Length Coding, VLC) 방식과 산술 코딩(arithmetic coding) 방식 등이 사용될 수 있다. 가변 길이 코딩(VLC) 방식은 입력되는 심볼들을 연속적인 코드워드로 변환하는데, 코드워드의 길이는 가변적일 수 있다. 예를 들어, 자주 발생하는 심볼들을 짧은 코드워드로, 자주 발생하지 않은 심볼들은 긴 코드워드로 표현하는 것이다. 가변 길이 코딩 방식으로서 컨텍스트 기반 적응형 가변 길이 코딩(Context-based Adaptive Variable Length Coding, CAVLC) 방식이 사용될 수 있다. 산술 코딩은 각 데이터 심볼들의 확률 분포를 이용하여 연속적인 데이터 심볼들을 하나의 소수로 변환하는데, 산술 코딩은 각 심볼을 표현하기 위하여 필요한 최적의 소수 비트를 얻을 수 있다. 산술 코딩으로서 컨텍스트 기반 적응형 산술 부호화(Context-based Adaptive Binary Arithmetic Coding, CABAC)가 이용될 수 있다.
CABAC은 실험을 통해 얻은 확률을 기반으로 생성된 여러 개의 문맥 모델(context model)을 통해 이진 산술 부호화하는 방법이다. 문맥 모델은 컨텍스트 모델이라고 할 수도 있다. 먼저, 심볼이 이진 형태가 아닐 경우, 인코더는 exp-Golomb 등을 사용하여 각 심볼을 이진화한다. 이진화된 0 또는 1은 빈(bin)으로 기술될 수 있다. CABAC 초기화 과정은 문맥 초기화와 산술 코딩 초기화로 구분된다. 문맥 초기화는 각 심볼의 발생 확률을 초기화하는 과정으로, 심볼의 종류, 양자화 파라미터(QP), 슬라이스 타입(I, P, B 인지)에 따라 결정된다. 이러한 초기화 정보를 가지는 문맥 모델은 실험을 통해 얻은 확률 기반 값을 사용할 수 있다. 문맥 모델은 현재 코딩하려는 심볼에 대한 LPS(Least Probable Symbol) 또는 MPS(Most Probable Symbol)의 발생 확률과 0과 1중에서 어떤 빈 값이 MPS에 해당되는지에 대한 정보(valMPS)를 제공한다. 문맥 인덱스(Context index, ctxIdx)를 통해 여러 개의 문맥 모델 중에서 하나가 선택되며, 문맥 인덱스는 현재 부호화할 블록의 정보 또는 주변 블록의 정보를 통해 유도될 수 있다. 문맥 모델에서 선택된 확률 모델을 기반으로 이진 산술 코딩을 위한 초기화가 수행된다. 이진 산술 부호화는 0과 1의 발생 확률을 통해 확률 구간으로 분할한 후, 처리할 빈에 해당하는 확률 구간이 다음에 처리될 빈에 대한 전체 확률 구간이 되는 과정을 통해 부호화가 진행된다. 마지막 빈이 처리된 확률 구간 안의 위치 정보가 출력된다. 단, 확률 구간이 무한정 분할될 수 없으므로, 일정 크기 이내로 줄어들 경우에는 재규격화(renormalization)과정이 수행되어 확률 구간이 넓어지고 해당 위치 정보가 출력된다. 또한, 각 빈이 처리된 후, 처리된 빈의 정보를 통해 다음 처리될 빈에 대한 확률이 새롭게 설정되는 확률 업데이트 과정이 수행될 수 있다.
비트스트림은 하나 또는 그 이상의 CVS(coded video sequences)로 구성될 수 있고, 하나의 CVS는 다른 CVS들과는 독립적으로 부호화될 수 있다. 각 CVS는 하나 또는 그 이상의 레이어(layer)로 구성될 수 있고, 각 레이어는 특정 화질, 특정 해상도를 나타낼 수 있으며, 또는 일반 영상, 깊이정보맵, 투명도(transparency) 맵을 나타낼 수 있다. 또한, CLVS는 동일 레이어 내의 연속된(디코딩 순서상) PU들로 구성된 레이어-와이즈(layer-wise) CVS를 의미할 수 있다. 예를 들어, 특정 화질 레이어에 대한 CLVS가 존재하며, 깊이정보맵에 대한 CLVS가 존재할 수 있다.
상기 생성된 비트스트림은 NAL(Network Abstraction Layer) 유닛을 기본 단위로 캡슐화 된다. NAL 유닛은 영상 데이터를 포함하는 VCL(Video Coding Layer) NAL 유닛과 영상 데이터를 디코딩하기 위한 파라미터 정보를 포함하는 non-VCL NAL 유닛으로 구분되며, 다양한 종류의 VCL 또는 non-VCL NAL 유닛이 존재한다. NAL 유닛은 NAL 헤더 정보와 데이터인 RBSP(Raw Byte Sequence Payload)로 구성되며, NAL 헤더 정보에는 RBSP에 대한 요약 정보가 포함된다. VCL NAL 유닛의 RBSP에는 부호화된 정수 개의 코딩 트리 유닛(coding tree unit)을 포함한다. 비디오 디코더에서 비트스트림을 복호화하기 위해서는 먼저 비트스트림을 NAL 유닛 단위로 분리한 후, 분리된 각각의 NAL 유닛을 복호화해야 한다. 한편, 비디오 신호 비트스트림의 복호화를 위해 필요한 정보들은비디오 파라미터 세트(Video Parameter Set, VPS), 시퀀스 파라미터 세트(Sequence Parameter Set, SPS), 픽쳐 파라미터 세트(Picture Parameter Set, PPS), 적응 파라미터 세트(Adaptation Parameter Set, APS) 등에 포함되어 전송될 수 있다. VCL NAL 유닛의 RBSP에는 정수 개의 코딩 트리 유닛(coding tree unit)이 포함될 수 있다. VPS는 화질, 해상도, 프레임 율 스케일러빌러티를 지원하는 비트스트림 또는 멀티뷰를 지원하는 비트스트림에서 각 레이어마다 시그널링되는 SPS 파라미터 세트에서 중복된 파라미터를 추출하여 공통의 신택스로 구성한 파라미터 세트이다. SPS는 허용가능한 코딩 툴(혹은 알고리즘) 및 영상 포맷에 대한 정보를 포함하고 있는 프로파일(Profile), 처리 가능한 영상의 해상도와 프레임율 그리고 허용가능한 메모리 크기 등에 대한 디코더의 처리 능력에 대한 정보를 포함하고 있는 레벨(Level), 처리 가능한 최대 비트율에 대한 정보를 포함하고 있는 티어(Tier), 영상의 해상도, 비트 깊이(bit depth), 기능에 대한 활성화 여부 정보 중에서 적어도 하나 이상을 포함하는 파라미터 세트이다. PPS는 영상의 해상도, 타일 분할 정보, 가중치 예측에 대한 활성화 여부 정보, 양자화 파라미터, 필터링 관련 정보 중에서 적어도 하나 이상을 포함하는 파라미터 세트이다. APS는 APS 타입에 따라 ALF 필터 계수 정보, LMCS 관련 파라미터, 양자화 스케일 파라미터 중에서 하나의 정보를 포함하는 파라미터 세트이다. APS는 VCL NAL 유닛보다 먼저 시그널링되는 프리픽스(prefix) APS와 VCL NAL 유닛 이후에 시그널링되는 서픽스(suffix) APS로 구분되며, ALF APS의 경우에는 이전 픽쳐에서 유도된 ALF 필터 계수를 다음 픽쳐에 적용하는 것이 효율적이므로, suffix APS로 시그널링될 수 있다.
한편, 도 1의 블록도는 본 명세서의 일 실시예에 따른 인코딩 장치(100)를 나타낸 것으로서, 분리하여 표시된 블록들은 인코딩 장치(100)의 엘리먼트들을 논리적으로 구별하여 도시한 것이다. 따라서 전술한 인코딩 장치(100)의 엘리먼트들은 디바이스의 설계에 따라 하나의 칩으로 또는 복수의 칩으로 장착될 수 있다. 일 실시예에 따르면, 전술한 인코딩 장치(100)의 각 엘리먼트의 동작은 프로세서(미도시)에 의해 수행될 수 있다.
도 2는 본 명세서의 일 실시예에 따른 비디오 신호 디코딩 장치(200)의 개략적인 블록도이다. 도 2를 참조하면 본 발명의 디코딩 장치(200)는 엔트로피 디코딩부(210), 역양자화부(220), 역변환부(225), 필터링부(230) 및 예측부(250)를 포함한다.
엔트로피 디코딩부(210)는 비디오 신호 비트스트림을 엔트로피 디코딩하여, 각 영역에 대한 변환 계수 정보, 인트라 부호화 정보, 인터 부호화 정보 등을 추출한다. 예를 들어, 엔트로피 디코딩부(210)는 비디오 신호 비트스트림으로부터 특정 영역의 변환 계수 정보에 대한 이진화 코드를 획득할 수 있다. 또한, 엔트로피 디코딩부(210)는 이진화 코드를 역 이진화하여 양자화된 변환 계수를 획득한다. 역양자화부(220)는 양자화된 변환 계수를 역양자화하고, 역변환부(225)는 역양자화된 변환 계수를 이용하여 레지듀얼 값을 복원한다. 비디오 신호 처리 장치(200)는 역변환부(225)에서 획득된 레지듀얼 값을 예측부(250)에서 획득된 예측 값과 합산하여 원래의 화소값을 복원한다.
한편, 필터링부(230)는 픽쳐에 대한 필터링을 수행하여 화질을 향상시킨다. 여기에는 블록 왜곡 현상을 감소시키기 위한 디블록킹 필터 및/또는 픽쳐 전체의 왜곡 제거를 위한 적응적 루프 필터 등이 포함될 수 있다. 필터링을 거친 픽쳐는 출력되거나 다음 픽쳐에 대한 참조 픽쳐로 이용하기 위하여 복호 픽쳐 버퍼(DPB, 256)에 저장된다.
예측부(250)는 인트라 예측부(252) 및 인터 예측부(254)를 포함한다. 예측부(250)는 전술한 엔트로피 디코딩부(210)를 통해 복호화된 부호화 타입, 각 영역에 대한 변환 계수, 인트라/인터 부호화 정보 등을 활용하여 예측 픽쳐를 생성한다. 복호화가 수행되는 현재 블록을 복원하기 위해서, 현재 블록이 포함된 현재 픽쳐 또는 다른 픽쳐들의 복호화된 영역이 이용될 수 있다. 복원에 현재 픽쳐만을 이용하는, 즉 인트라 예측 또는 인트라 BC 예측을 수행하는 픽쳐(또는, 타일/슬라이스)를 인트라 픽쳐 또는 I 픽쳐(또는, 타일/슬라이스), 인트라 예측, 인터 예측 및 인트라 BC 예측을 모두 수행할 수 있는 픽쳐(또는, 타일/슬라이스)를 인터 픽쳐(또는, 타일/슬라이스)라고 한다. 인터 픽쳐(또는, 타일/슬라이스) 중 각 블록의 샘플값들을 예측하기 위하여 최대 하나의 모션 벡터 및 참조 픽쳐 인덱스를 이용하는 픽쳐(또는, 타일/슬라이스)를 예측 픽쳐(predictive picture) 또는 P 픽쳐(또는, 타일/슬라이스)라고 하며, 최대 두 개의 모션 벡터 및 참조 픽쳐 인덱스를 이용하는 픽쳐(또는, 타일/슬라이스)를 쌍예측 픽쳐(Bi-predictive picture) 또는 B 픽쳐(또는, 타일/슬라이스) 라고 한다. 다시 말해서, P 픽쳐(또는, 타일/슬라이스)는 각 블록을 예측하기 위해 최대 하나의 모션 정보 세트를 이용하고, B 픽쳐(또는, 타일/슬라이스)는 각 블록을 예측하기 위해 최대 두 개의 모션 정보 세트를 이용한다. 여기서, 모션 정보 세트는 하나 이상의 모션 벡터와 하나의 참조 픽쳐 인덱스를 포함한다.
인트라 예측부(252)는 인트라 부호화 정보 및 현재 픽쳐 내의 복원된 샘플들을 이용하여 예측 블록을 생성한다. 구체적으로 현재 블록 내 샘플은 현재 블록 내 샘플 위치와 인트라 예측 모드의 방향성을 사용하여 유도된 참조 샘플을 사용하여 예측될 수 있다. 참조 샘플의 위치가 정수 단위 샘플이 아닌 경우, 비디오 신호 처리 장치는 인접한 참조 샘플을 이용한 보간 방법을 통해 보간 참조 샘플을 사용하여 현재 블록 샘플을 예측할 수 있다. 이를 선형 기반 인트라 예측이라 지칭할 수 있다. 전술한 바와 같이, 인트라 부호화 정보는 인트라 예측 모드, MPM(Most Probable Mode) 플래그, MPM 인덱스 중 적어도 하나를 포함할 수 있다. 인트라 예측부(252)는 현재 블록의 좌측 및/또는 상측에 위치한 복원된 샘플들을 참조 샘플들로 이용하여 현재 블록의 샘플 값들을 예측한다. 본 개시에서, 복원된 샘플들, 참조 샘플들 및 현재 블록의 샘플들은 픽셀들을 나타낼 수 있다. 또한, 샘플 값(sample value)들은 픽셀 값들을 나타낼 수 있다.
일 실시예에 따르면, 참조 샘플들은 현재 블록의 주변 블록에 포함된 샘플들일 수 있다. 예를 들어, 참조 샘플들은 현재 블록의 좌측 경계에 인접한 샘플들 및/또는 상측 경계에 인접한 샘플들일 수 있다. 또한, 참조 샘플들은 현재 블록의 주변 블록의 샘플들 중 현재 블록의 좌측 경계로부터 기 설정된 거리 이내의 라인 상에 위치하는 샘플들 및/또는 현재 블록의 상측 경계로부터 기 설정된 거리 이내의 라인 상에 위치하는 샘플들일 수 있다. 이때, 현재 블록의 주변 블록은 현재 블록에 인접한 좌측(L) 블록, 상측(A) 블록, 하좌측(Below Left, BL) 블록, 상우측(Above Right, AR) 블록 또는 상좌측(Above Left, AL) 블록 중 적어도 하나를 포함할 수 있다. 현재 블록의 주변 블록은 현재 블록을 예측하기 위한 참조 블록일 수 있다.
인터 예측부(254)는 복호 픽쳐 버퍼(256)에 저장된 참조 픽쳐 및 인터 부호화 정보를 이용하여 예측 블록을 생성한다. 인터 부호화 정보는 참조 블록에 대한 현재 블록의 모션 정보 세트(참조 픽쳐 인덱스, 모션 벡터 정보 등)를 포함할 수 있다. 인터 예측에는 L0 예측, L1 예측 및 쌍예측(Bi-prediction)이 있을 수 있다. L0 예측은 L0 픽쳐 리스트에 포함된 1개의 참조 픽쳐를 이용한 예측이고, L1 예측은 L1 픽쳐 리스트에 포함된 1개의 참조 픽쳐를 이용한 예측을 의미한다. 이를 위해서는 1세트의 모션 정보(예를 들어, 모션 벡터 및 참조 픽쳐 인덱스)가 필요할 수 있다. 쌍예측 방식에서는 최대 2개의 참조 영역을 이용할 수 있는데, 이 2개의 참조 영역은 동일한 참조 픽쳐에 존재할 수도 있고, 서로 다른 픽쳐에 각각 존재할 수도 있다. 즉, 쌍예측 방식에서는 최대 2세트의 모션 정보(예를 들어, 모션 벡터 및 참조 픽쳐 인덱스)가 이용될 수 있는데, 2개의 모션 벡터가 동일한 참조 픽쳐 인덱스에 대응될 수도 있고 서로 다른 참조 픽쳐 인덱스에 대응될 수도 있다. 이때, 참조 픽쳐들은 현재 픽쳐를 기준으로 시간적으로 이전 또는 이후에 위치하는 픽쳐로서, 이미 복원된 완료된 픽쳐가 될 수 있다. 일 실시예에 따라, 쌍예측 방식에서는 사용되는 2개의 참조 영역은 L0 픽쳐 리스트 및 L1 픽쳐 리스트 각각에서 선택된 영역일 수 있다. 또한, 현재 픽쳐의 표시 순서를 나타내는 POC(picture order count)를 기준으로 현재 픽쳐의 POC 보다 POC가 작은 참조 픽쳐만을 사용하거나 현재 픽쳐의 POC 보다 POC가 큰 참조 픽쳐만을 사용하는 예측 방법을 단방향 (uni-directional prediction) 예측이라고 할 수 있다. 또한, 현재 픽쳐의 표시 순서를 나타내는 POC(picture order count)를 기준으로 현재 픽쳐의 POC 보다 POC가 작은 참조 픽쳐와 현재 픽쳐의 POC 보다 POC가 큰 참조 픽쳐를 모두 사용하는 예측 방법을 양방향 (bi-directional prediction) 예측이라고 할 수 있다. 단방향 예측에서 하나의 참조 픽쳐만을 사용하는 예측 방법을 단예측(uni-prediction)이라고 할 수 있으며, 단 방향 예측에서 2개의 참조 픽쳐를 사용하는 예측 방법을 양예측(Bi-prediction) 또는 쌍예측이라고 할 수 있다.
인터 예측부(254)는 모션 벡터 및 참조 픽쳐 인덱스를 이용하여 현재 블록의 참조 블록을 획득할 수 있다. 상기 참조 블록은 참조 픽쳐 인덱스에 대응하는 참조 픽쳐 내에 존재한다. 또한, 모션 벡터에 의해서 특정된 블록의 샘플 값 또는 이의 보간(interpolation)된 값이 현재 블록의 예측자(predictor)로 이용될 수 있다. 서브펠(sub-pel) 단위의 픽셀 정확도를 갖는 모션 예측을 위하여 이를 테면, 휘도 신호에 대하여 8-탭 보간 필터가, 색차 신호에 대하여 4-탭 보간 필터가 사용될 수 있다. 다만, 서브펠 단위의 모션 예측을 위한 보간 필터는 이에 한정되지 않는다. 이와 같이 인터 예측부(254)는 이전에 복원된 픽쳐로부터 현재 유닛의 텍스쳐를 예측하는 모션 보상(motion compensation)을 수행한다. 이때, 인터 예측부는 모션 정보 세트를 이용할 수 있다.
추가적인 실시예에 따라, 예측부(250)는 IBC 예측부(미도시)를 포함할 수 있다. IBC 예측부는 현재 픽쳐 내의 복원된 샘플들을 포함하는 특정 영역을 참조하여 현재 영역을 복원할 수 있다. IBC 예측부는 엔트로피 디코딩부(210)로부터 획득된 IBC 부호화 정보를 이용하여 IBC 예측을 수행할 수 있다. IBC 부호화 정보는 블록 벡터 정보를 포함할 수 있다.
상기 인트라 예측부(252) 또는 인터 예측부(254)로부터 출력된 예측값, 및 역변환부(225)로부터 출력된 레지듀얼 값이 더해져서 복원된 비디오 픽쳐가 생성된다. 즉, 비디오 신호 디코딩 장치(200)는 예측부(250)에서 생성된 예측 블록과 역변환부(225)로부터 획득된 레지듀얼을 이용하여 현재 블록을 복원한다.
한편, 도 2의 블록도는 본 명세서의 일 실시예에 따른 디코딩 장치(200)를 나타낸 것으로서, 분리하여 표시된 블록들은 디코딩 장치(200)의 엘리먼트들을 논리적으로 구별하여 도시한 것이다. 따라서 전술한 디코딩 장치(200)의 엘리먼트들은 디바이스의 설계에 따라 하나의 칩으로 또는 복수의 칩으로 장착될 수 있다. 일 실시예에 따르면, 전술한 디코딩 장치(200)의 각 엘리먼트의 동작은 프로세서(미도시)에 의해 수행될 수 있다.
한편, 본 명세서에서 제안된 기술은 인코더와 디코더의 방법 및 장치에 모두 적용 가능한 기술이며, 시그널링과 파싱으로 기술된 부분은 설명의 편의를 위해 기술한 것일 수 있다. 일반적으로 시그널링은 인코더 관점에서 각 신택스(syntax)를 부호화하기 위한 것이고, 파싱은 디코더 관점에서 각 신택스의 해석을 위한 것으로 설명될 수 있다. 즉, 각 신택스는 인코더로부터 비트스트림에 포함되어 시그널링될 수 있으며, 디코더에서는 신택스를 파싱하여 복원과정에서 사용할 수 있다. 이때, 규정된 계층적 구성대로 나열한 각 신택스에 대한 비트의 시퀀스를 비트스트림이라고 할 수 있다.
하나의 픽쳐는 서브 픽쳐(sub-picture), 슬라이스(slice), 타일(tile) 등으로 분할되어 부호화될 수 있다. 서브 픽쳐는 하나 이상의 슬라이스 또는 타일을 포함할 수 있다. 하나의 픽쳐가 여러 개의 슬라이스 또는 타일로 분할되어 부호화되었을 경우, 픽쳐 내의 모든 슬라이스 또는 타일이 디코딩이 완료되어야만 화면에 출력이 가능하다. 반면에, 하나의 픽쳐가 여러 개의 서브 픽쳐로 부호화되었을 경우, 임의의 서브 픽쳐만 디코딩되어 화면에 출력될 수 있다. 슬라이스는 여러 개의 타일 또는 서브 픽쳐를 포함할 수 있다. 또는 타일은 여러 개의 서브 픽쳐 또는 슬라이스를 포함할 수 있다. 서브 픽쳐, 슬라이스, 타일은 서로 독립적으로 인코딩 또는 디코딩이 가능하므로 병렬처리 및 처리 속도 향상에 효과적이다. 하지만, 인접한 다른 서브 픽쳐, 다른 슬라이스, 다른 타일의 부호화된 정보를 이용할 수 없으므로 비트량이 증가되는 단점이 있다. 서브 픽쳐, 슬라이스, 타일은 여러 개의 코딩 트리 유닛(Coding Tree Unit, CTU)으로 분할되어 부호화될 수 있다.
도 3은 픽쳐 내에서 코딩 트리 유닛(Coding Tree Unit, CTU)이 코딩 유닛들(Coding Units, CUs)로 분할되는 실시예를 도시한다. 비디오 신호의 코딩 과정에서, 픽쳐는 코딩 트리 유닛(CTU)들의 시퀀스로 분할될 수 있다. 코딩 트리 유닛은 휘도(luma) 코딩 트리 블록(Coding Tree Block, CTB)와 2개의 색차(chroma) 코딩 트리 블록들, 그리고 그것의 부호화된 신택스(syntax) 정보로 구성될 수 있다. 하나의 코딩 트리 유닛은 하나의 코딩 유닛으로 구성될 수 있으며, 또는 하나의 코딩 트리 유닛은 여러 개의 코딩 유닛으로 분할될 수 있다. 하나의 코딩 유닛은 휘도 코딩 블록(Coding Block, CB)과 2개의 색차 코딩 블록들, 그리고 그것의 부호화된 신택스 정보로 구성될 수 있다. 하나의 코딩 블록은 여러 개의 서브 코딩 블록으로 분할될 수 있다. 하나의 코딩 유닛은 하나의 변환 유닛(Transform Unit, TU)으로 구성될 수 있으며, 또는 하나의 코딩 유닛은 여러 개의 변환 유닛으로 분할될 수 있다. 하나의 변환 유닛은 휘도 변환 블록(Transform Block, TB)과 2개의 색차 변환 블록들, 그리고 그것의 부호화된 신택스 정보로 구성될 수 있다. 코딩 트리 유닛은 복수의 코딩 유닛들로 분할될 수 있다. 코딩 트리 유닛은 분할되지 않고 리프 노드가 될 수도 있다. 이 경우, 코딩 트리 유닛 자체가 코딩 유닛이 될 수 있다.
코딩 유닛은 상기에서 설명한 비디오 신호의 처리 과정, 즉 인트라/인터 예측, 변환, 양자화 및/또는 엔트로피 코딩 등의 과정에서 픽쳐를 처리하기 위한 기본 단위를 가리킨다. 하나의 픽쳐 내에서 코딩 유닛의 크기 및 모양은 일정하지 않을 수 있다. 코딩 유닛은 정사각형 또는 직사각형의 모양을 가질 수 있다. 직사각형 코딩 유닛(또는, 직사각형 블록)은 수직 코딩 유닛(또는, 수직 블록)과 수평 코딩 유닛(또는, 수평 블록)을 포함한다. 본 명세서에서, 수직 블록은 높이가 너비보다 큰 블록이며, 수평 블록은 너비가 높이보다 큰 블록이다. 또한, 본 명세서에서 정사각형이 아닌(non-square) 블록은 직사각형 블록을 가리킬 수 있지만, 본 발명은 이에 한정되지 않는다.
도 3을 참조하면, 코딩 트리 유닛은 먼저 쿼드 트리(Quad Tree, QT) 구조로 분할된다. 즉, 쿼드 트리 구조에서 2NX2N 크기를 가지는 하나의 노드는 NXN 크기를 가지는 네 개의 노드들로 분할될 수 있다. 본 명세서에서 쿼드 트리는 4진(quaternary) 트리로도 지칭될 수 있다. 쿼드 트리 분할은 재귀적으로 수행될 수 있으며, 모든 노드들이 동일한 깊이로 분할될 필요는 없다.
한편, 전술한 쿼드 트리의 리프 노드(leaf node)는 멀티-타입 트리(Multi-Type Tree, MTT) 구조로 더욱 분할될 수 있다. 본 발명의 실시예에 따르면, 멀티 타입 트리 구조에서는 하나의 노드가 수평 또는 수직 분할의 2진(binary, 바이너리) 또는 3진(ternary, 터너리) 트리 구조로 분할될 수 있다. 즉, 멀티-타입 트리 구조에는 수직 바이너리 분할, 수평 바이너리 분할, 수직 터너리 분할 및 수평 터너리 분할의 4가지 분할 구조가 존재한다. 본 발명의 실시예에 따르면, 상기 각 트리 구조에서 노드의 너비 및 높이는 모두 2의 거듭제곱 값을 가질 수 있다. 예를 들어, 바이너리 트리(Binary Tree, BT) 구조에서, 2NX2N 크기의 노드는 수직 바이너리 분할에 의해 2개의 NX2N 노드들로 분할되고, 수평 바이너리 분할에 의해 2개의 2NXN 노드들로 분할될 수 있다. 또한, 터너리 트리(Ternary Tree, TT) 구조에서, 2NX2N 크기의 노드는 수직 터너리 분할에 의해 (N/2)X2N, NX2N 및 (N/2)X2N의 노드들로 분할되고, 수평 터너리 분할에 의해 2NX(N/2), 2NXN 및 2NX(N/2)의 노드들로 분할될 수 있다. 이러한 멀티-타입 트리 분할은 재귀적으로 수행될 수 있다.
멀티-타입 트리의 리프 노드는 코딩 유닛이 될 수 있다. 코딩 유닛이 최대 변환 길이에 비해 크지 않은 경우, 해당 코딩 유닛은 더 이상의 분할 없이 예측 및/또는 변환의 단위로 사용될 수 있다. 일 실시예로서, 현재 코딩 유닛의 너비 또는 높이가 최대 변환 길이보다 큰 경우, 현재 코딩 유닛은 분할에 관한 명시적 시그널링 없이 복수의 변환 유닛으로 분할될 수 있다. 한편, 전술한 쿼드 트리 및 멀티-타입 트리에서 다음의 파라메터들 중 적어도 하나가 사전에 정의되거나 PPS, SPS, VPS 등과 같은 상위 레벨 세트의 RBSP를 통해 전송될 수 있다. 1) CTU 크기: 쿼드 트리의 루트 노드(root node) 크기, 2) 최소 QT 크기(MinQtSize): 허용된 최소 QT 리프 노드 크기, 3) 최대 BT 크기(MaxBtSize): 허용된 최대 BT 루트 노드 크기, 4) 최대 TT 크기(MaxTtSize): 허용된 최대 TT 루트 노드 크기, 5) 최대 MTT 깊이(MaxMttDepth): QT의 리프 노드로부터의 MTT 분할의 최대 허용 깊이, 6) 최소 BT 크기(MinBtSize): 허용된 최소 BT 리프 노드 크기, 7) 최소 TT 크기(MinTtSize): 허용된 최소 TT 리프 노드 크기.
도 4는 쿼드 트리 및 멀티-타입 트리의 분할을 시그널링하는 방법의 일 실시예를 도시한다. 전술한 쿼드 트리 및 멀티-타입 트리의 분할을 시그널링하기 위해 기 설정된 플래그들이 사용될 수 있다. 도 4를 참조하면, 노드의 분할 여부를 지시하는 플래그 'split_cu_flag', 쿼드 트리 노드의 분할 여부를 지시하는 플래그 'split_qt_flag', 멀티-타입 트리 노드의 분할 방향을 지시하는 플래그 'mtt_split_cu_vertical_flag' 또는 멀티-타입 트리 노드의 분할 모양을 지시하는 플래그 'mtt_split_cu_binary_flag' 중 적어도 하나가 사용될 수 있다.
본 발명의 실시예에 따르면, 현재 노드의 분할 여부를 지시하는 플래그인 'split_cu_flag'가 먼저 시그널링될 수 있다. 'split_cu_flag'의 값이 0인 경우, 현재 노드가 분할되지 않는 것을 나타내며, 현재 노드는 코딩 유닛이 된다. 현재 노드가 코팅 트리 유닛인 경우, 코딩 트리 유닛은 분할되지 않은 하나의 코딩 유닛을 포함한다. 현재 노드가 쿼드 트리 노드 'QT node'인 경우, 현재 노드는 쿼드 트리의 리프 노드 'QT leaf node'이며 코딩 유닛이 된다. 현재 노드가 멀티-타입 트리 노드 'MTT node'인 경우, 현재 노드는 멀티-타입 트리의 리프 노드 'MTT leaf node'이며 코딩 유닛이 된다.
'split_cu_flag'의 값이 1인 경우, 현재 노드는 'split_qt_flag'의 값에 따라 쿼드 트리 또는 멀티-타입 트리의 노드들로 분할될 수 있다. 코딩 트리 유닛은 쿼드 트리의 루트 노드이며, 쿼드 트리 구조로 우선 분할될 수 있다. 쿼드 트리 구조에서는 각각의 노드 'QT node' 별로 'split_qt_flag'가 시그널링된다. 'split_qt_flag'의 값이 1인 경우 해당 노드는 4개의 정사각형 노드들로 분할되며, 'split_qt_flag'의 값이 0인 경우 해당 노드는 쿼드 트리의 리프 노드 'QT leaf node'가 되며, 해당 노드는 멀티-타입 노드들로 분할된다. 본 발명의 실시예에 따르면, 현재 노드의 종류에 따라서 쿼드 트리 분할은 제한될 수 있다. 현재 노드가 코딩 트리 유닛(쿼트 트리의 루트 노드) 또는 쿼트 트리 노드인 경우에 쿼드 트리 분할이 허용될 수 있으며, 현재 노드가 멀티-타입 트리 노드인 경우 쿼트 트리 분할은 허용되지 않을 수 있다. 각각의 쿼드 트리 리프 노드 'QT leaf node'는 멀티-타입 트리 구조로 더 분할될 수 있다. 상술한 바와 같이, 'split_qt_flag'가 0인 경우 현재 노드는 멀티-타입 노드들로 분할될 수 있다. 분할 방향 및 분할 모양을 지시하기 위하여, 'mtt_split_cu_vertical_flag' 및 'mtt_split_cu_binary_flag'가 시그널링될 수 있다. 'mtt_split_cu_vertical_flag'의 값이 1인 경우 노드 'MTT node'의 수직 분할이 지시되며, 'mtt_split_cu_vertical_flag'의 값이 0인 경우 노드 'MTT node'의 수평 분할이 지시된다. 또한, 'mtt_split_cu_binary_flag'의 값이 1인 경우 노드 'MTT node'는 2개의 직사각형 노드들로 분할되며, 'mtt_split_cu_binary_flag'의 값이 0인 경우 노드 'MTT node'는 3개의 직사각형 노드들로 분할된다.
트리 분할 구조는 휘도 블록과 색차 블록이 동일한 형태로 분할될 수 있다. 즉, 색차 블록은 휘도 블록의 분할 형태를 참조하여 색차 블록을 분할할 수 있다. 현재 색차 블록이 임의의 정해진 크기보다 적다면, 휘도 블록이 분할되었더라도 색차 블록은 분할되지 않을 수 있다.
휘도 블록과 색차 블록은 서로 동일한 트리 분할 구조를 가질 수 있으며, 이를 싱글 트리(Single Tree)라고 할 수 있다. 현재 블록이 싱글 트리로 부호화된 경우, 휘도 블록과 색차 블록의 분할 구조, 부호화 모드 정보, 움직임 정보 등이 동일할 수 있으며, 이외 오차 신호와 관련된 정보는 휘도 블록과 색차 블록이 다를 수 있다. 또한, 휘도 블록과 색차 블록은 서로 다른 트리 분할 구조를 가질 수 있으며, 이를 듀얼 트리(Dual Tree)라고 할 수 있다. 현재 블록이 듀얼 트리로 부호화된 경우, 휘도 블록과 색차 블록의 분할 구조, 부호화 모드 정보, 움직임 정보 등은 적어도 하나 이상이 다를 수 있다.
휘도 블록과 휘도 블록에 대응하는 색차 블록 간에는 밀접한 상관관계가 있을 수 있다. 따라서, 인코더 및 디코더에서는 현재 블록이 듀얼 트리로 부호화 및 복호화될 경우, 휘도 블록의 분할 정보, 부호화 모드 정보, 움직임 정보 등을 사용하여 색차 블록을 부호화할 수 있다.
가장 작은 단위로 분할될 노드는 하나의 코딩 블록으로 처리될 수 있다. 현재 블록이 코딩 블록일 경우, 코딩 블록은 여러 개의 서브 블록(서브 코딩 블록)으로 분할될 수 있으며, 각 서브 블록의 예측 정보는 서로 같거나 또는 다를 수 있다. 실시 일 예로, 코딩 유닛이 인트라 모드일 경우, 각 서브 블록의 인트라 예측 모드는 서로 같거나 또는 다를 수 있다. 또한, 코딩 유닛이 인터 모드일 경우, 각 서브 블록의 움직임 정보는 서로 같거나 또는 다를 수 있다. 또한, 각 서브 블록은 서로 독립적으로 인코딩 또는 디코딩이 가능할 수 있다. 각각의 서브 블록은 서브 블록 인덱스(sub-block index, sbIdx)를 통해 구분될 수 있다. 또한 코딩 유닛이 서브 블록으로 분할될 때, 수평 또는 수직 방향으로 분할되거나 사선으로 분할될 수 있다. 인트라 모드에서 현재 코딩 유닛을 수평 또는 수직 방향으로 2개 또는 4개의 서브 블록으로 분할하는 모드를 ISP(Intra Sub Partitions)이라 한다. 인터 모드에서 현재 코딩 블록을 사선으로 분할하는 모드를 GPM(Geometric partitioning mode)이라 한다. GPM모드에서 사선의 위치와 방향은 미리 정해진 각도 테이블을 사용하여 유도하고, 각도 테이블의 인덱스 정보가 시그널링된다.
움직임 정보는 참조 방향 지시 정보, 참조 픽쳐 정보, 움직임 벡터, 움직임 해상도, affine 모델, CPMV(control point motion vector), 블록 벡터, 블록 벡터 해상도, MHP 정보, LIC 정보, 필터링 정보, BCW 정보, RRIBC 정보 중에서 하나 이상을 포함할 수 있다.
참조 방향 지시 정보는 L0 예측, L1 예측, L0 및 L1 예측으로 구성되며, L0 예측과 L1 예측은 단예측 및 단방향 예측이며, L0 및 L1 예측은 양예측이다. 그리고 L0 및 L1 예측은 단방향 예측 혹은 양방향 예측이 될 수 있다. 여기서 L0 예측은 L0 참조 픽쳐 리스트 내의 참조 픽쳐를 사용하여 예측하며, L1 예측은 L1 참조 픽쳐 리스트 내의 참조 픽쳐를 사용하여 예측할 수 있다. L0 참조 픽쳐 리스트에는 현재 픽쳐의 POC를 기준으로 현재 픽쳐의 POC 보다 POC가 작은 참조 픽쳐가 참조 픽쳐 리스트에 추가될 수 있다. 또한, L0 참조 픽쳐 리스트는 현재 픽쳐의 POC보다 POC가 가까운 참조 픽쳐부터 POC가 먼 참조 픽쳐 순으로 구성될 수 있다. L1 참조 픽쳐 리스트는 현재 픽쳐의 POC를 기준으로 현재 픽쳐의 POC 보다 POC가 큰 참조 픽쳐가 참조 픽쳐 리스트에 추가될 수 있다. 또한, L1 참조 픽쳐 리스트는 현재 픽쳐의 POC보다 POC가 가까운 참조 픽쳐부터 POC가 먼 참조 픽쳐 순으로 구성될 수 있다. L0 및 L1 참조 픽쳐 리스트는 슬라이스, 서브 픽쳐, 픽쳐마다 달라질 수 있다. 또한, L0 참조 픽쳐 리스트에는 L1 참조 픽쳐 리스트의 참조 픽쳐가 포함될 수 있다. 그리고 L1 참조 픽쳐 리스트에는 L0 참조 픽쳐 리스트의 참조 픽쳐가 포함될 수 있다.
참조 픽쳐 정보는 블록마다 달라질 수 있으며, 현재 블록이 L0 참조 픽쳐 리스트 및/또는 L1 참조 픽쳐 리스트에서 어떤 참조 픽쳐를 사용하여 예측되는지를 지시하는 인덱스 정보일 수 있다. 참조 픽쳐 정보는 L0 참조 픽쳐 정보, L1 참조 픽쳐 정보 중에서 하나 이상 포함할 수 있다.
움직임 벡터는 참조 픽쳐에서 현재 블록과 가장 매칭이 잘 되는 블록을 지시하는 정보로써, 픽쳐 내에서 현재 블록의 좌상단 위치를 기준으로 참조 블록까지의 거리를 수평 및 수직 좌표로 나타낸 값이다.
움직임 해상도는 움직임 벡터의 해상도를 나타내며, 움직임 해상도는 4 화소 단위, 1 화소(정수 화소) 단위, 1/2 화소 단위, 1/4 화소 단위, 1/8 화소 단위, 1/16 화소 단위 등으로 나타낼 수 있다.
블록 벡터는 현재 픽쳐 내 이미 복원된 영역에서 현재 블록과 가장 매칭이 잘 되는 블록을 지시하는 정보로써, 픽쳐 내에서 현재 블록의 좌상단 위치를 기준으로 참조 블록까지의 거리를 수평 및 수직 좌표로 나타낸 값이다.
블록 벡터 해상도는 4 화소 단위, 1 화소(정수 화소) 단위, 1/2 화소 단위, 1/4 화소 단위, 1/8 화소 단위, 1/16 화소 단위 등으로 나타낼 수 있다.
MHP 정보에는 추가적인 움직임 정보의 적용 여부 및 추가적인 움직임 정보를 포함할 수 있다.
LIC 정보는 현재 블록에 대한 LIC 적용 여부를 포함할 수 있다.
필터링 정보는 현재 블록의 움직임 해상도에 따라 적용되는 필터링 타입 및 계수 정보를 포함할 수 있다.
BCW 정보는 현재 블록에 대한 BCW 적용 여부를 포함할 수 있다.
RRIBC 정보는 현재 블록이 IBC 모드로 부호화된 경우, RRIBC 적용 여부 및 RRIBC 타입에 대한 정보를 포함할 수 있다.
코딩을 위한 픽쳐 예측(모션 보상)은 더 이상 나누어지지 않는 코딩 유닛(즉 코딩 트리 유닛의 리프 노드)을 대상으로 이루어진다. 이러한 예측을 수행하는 기본 단위를 이하에서는 예측 유닛(prediction unit) 또는 예측 블록(prediction block)이라고 한다.
이하, 본 명세서에서 사용되는 유닛이라는 용어는 예측을 수행하는 기본 단위인 상기 예측 유닛을 대체하는 용어로 사용될 수 있다. 다만, 본 발명이 이에 한정되는 것은 아니며, 더욱 광의적으로는 상기 코딩 유닛을 포함하는 개념으로 이해될 수 있다.
도 5 및 도 6은 본 발명의 실시예에 따른 인트라 예측 방법을 더욱 구체적으로 도시한다. 전술한 바와 같이, 인트라 예측부는 현재 블록의 좌측 및/또는 상측에 위치한 복원된 샘플들을 참조 샘플들로 이용하여 현재 블록의 샘플 값들을 예측한다.
먼저, 도 5는 인트라 예측 모드에서 현재 블록의 예측을 위해 사용되는 참조 샘플들의 일 실시예를 도시한다. 일 실시예에 따르면, 참조 샘플들은 현재 블록의 좌측 경계에 인접한 샘플들 및/또는 상측 경계에 인접한 샘플들일 수 있다. 도 5에 도시된 바와 같이, 현재 블록의 크기가 WXH이고 현재 블록에 인접한 단일 참조 라인(line)의 샘플들이 인트라 예측에 사용될 경우, 현재 블록의 좌측 및/또는 상측에 위치한 최대 2W+2H+1개의 주변 샘플들을 사용하여 참조 샘플들이 설정될 수 있다.
한편, 현재 블록의 인트라 예측을 위해 다중 참조 라인의 픽셀들이 사용될 수 있다. 다중 참조 라인은 현재 블록으로부터 기 설정된 범위 이내에 위치한 n개의 라인들로 구성될 수 있다. 일 실시예에 따르면, 인트라 예측을 위해 다중 참조 라인의 픽셀들이 사용될 경우, 참조 픽셀들로 설정될 라인들을 지시하는 별도의 인덱스 정보가 시그널링될 수 있으며, 이를 참조 라인 인덱스라고 명명할 수 있다.
또한, 참조 샘플로 사용될 적어도 일부의 샘플이 아직 복원되지 않은 경우, 인트라 예측부는 참조 샘플 패딩 과정을 수행하여 참조 샘플을 획득할 수 있다. 또한, 인트라 예측부는 인트라 예측의 오차를 줄이기 위해 참조 샘플 필터링 과정을 수행할 수 있다. 즉, 주변 샘플들 및/또는 참조 샘플 패딩 과정에 의해 획득된 참조 샘플들에 필터링을 수행하여 필터링된 참조 샘플들을 획득할 수 있다. 인트라 예측부는 이와 같이 획득된 참조 샘플들을 이용하여 현재 블록의 샘플들을 예측한다. 인트라 예측부는 필터링되지 않은 참조 샘플들 또는 필터링된 참조 샘플들을 이용하여 현재 블록의 샘플들을 예측한다. 본 개시에서, 주변 샘플들은 적어도 하나의 참조 라인 상의 샘플들을 포함할 수 있다. 예를 들어, 주변 샘플들은 현재 블록의 경계에 인접한 라인 상의 인접 샘플들을 포함할 수 있다.
다음으로, 도 6은 인트라 예측에 사용되는 예측 모드들의 일 실시예를 도시한다. 인트라 예측을 위해, 인트라 예측 방향을 지시하는 인트라 예측 모드 정보가 시그널링될 수 있다. 인트라 예측 모드 정보는 인트라 예측 모드 세트를 구성하는 복수의 인트라 예측 모드들 중 어느 하나를 지시한다. 현재 블록이 인트라 예측 블록일 경우, 디코더는 비트스트림으로부터 현재 블록의 인트라 예측 모드 정보를 수신한다. 디코더의 인트라 예측부는 추출된 인트라 예측 모드 정보에 기초하여 현재 블록에 대한 인트라 예측을 수행한다.
본 발명의 실시예에 따르면, 인트라 예측 모드 세트는 인트라 예측에 사용되는 모든 인트라 예측 모드들(예, 총 67개의 인트라 예측 모드들)을 포함할 수 있다. 더욱 구체적으로, 인트라 예측 모드 세트는 평면 모드, DC 모드 및 복수의(예, 65개의) 각도 모드들(즉, 방향 모드들)을 포함할 수 있다. 각각의 인트라 예측 모드는 기 설정된 인덱스(즉, 인트라 예측 모드 인덱스)를 통해 지시될 수 있다. 예를 들어, 도 6에 도시된 바와 같이 인트라 예측 모드 인덱스 0은 평면(planar) 모드를 지시하고, 인트라 예측 모드 인덱스 1은 DC 모드를 지시한다. 또한, 인트라 예측 모드 인덱스 2 내지 66은 서로 다른 각도 모드들을 각각 지시할 수 있다. 각도 모드들은 기 설정된 각도 범위 이내의 서로 다른 각도들을 각각 지시한다. 예를 들어, 각도 모드는 시계 방향으로 45도에서 -135도 사이의 각도 범위(즉, 제1 각도 범위) 이내의 각도를 지시할 수 있다. 상기 각도 모드는 12시 방향을 기준으로 정의될 수 있다. 이때, 인트라 예측 모드 인덱스 2는 수평 대각(Horizontal Diagonal, HDIA) 모드를 지시하고, 인트라 예측 모드 인덱스 18은 수평(Horizontal, HOR) 모드를 지시하고, 인트라 예측 모드 인덱스 34는 대각(Diagonal, DIA) 모드를 지시하고, 인트라 예측 모드 인덱스 50은 수직(Vertical, VER) 모드를 지시하며, 인트라 예측 모드 인덱스 66은 수직 대각(Vertical Diagonal, VDIA) 모드를 지시한다.
한편, 기 설정된 각도 범위는 현재 블록의 모양에 따라 서로 다르게 설정될 수 있다. 예를 들어, 현재 블록이 직사각형 블록일 경우 시계 방향으로 45도를 초과하거나 -135도 미만 각도를 지시하는 광각 모드가 추가적으로 사용될 수 있다. 현재 블록이 수평 블록일 경우, 각도 모드는 시계 방향으로 (45+offset1)도에서 (-135+offset1)도 사이의 각도 범위(즉, 제2 각도 범위) 이내의 각도를 지시할 수 있다. 이때, 제1 각도 범위를 벗어나는 각도 모드 67 내지 76이 추가적으로 사용될 수 있다. 또한, 현재 블록이 수직 블록일 경우, 각도 모드는 시계 방향으로 (45-offset2)도에서 (-135-offset2)도 사이의 각도 범위(즉, 제3 각도 범위) 이내의 각도를 지시할 수 있다. 이때, 제1 각도 범위를 벗어나는 각도 모드 -10 내지 -1이 추가적으로 사용될 수 있다. 본 발명의 실시예에 따르면, offset1 및 offset2의 값은 직사각형 블록의 너비와 높이 간의 비율에 따라 서로 다르게 결정될 수 있다. 또한, offset1 및 offset2는 양수일 수 있다.
본 발명의 추가적인 실시예에 따르면, 인트라 예측 모드 세트를 구성하는 복수의 각도 모드들은 기본 각도 모드와 확장 각도 모드를 포함할 수 있다. 이때, 확장 각도 모드는 기본 각도 모드에 기초하여 결정될 수 있다.
일 실시예에 따르면, 기본 각도 모드는 기존 HEVC(High Efficiency Video Coding) 표준의 인트라 예측에서 사용되는 각도에 대응하는 모드이고, 확장 각도 모드는 차세대 비디오 코덱 표준의 인트라 예측에서 새롭게 추가되는 각도에 대응하는 모드일 수 있다. 더욱 구체적으로, 기본 각도 모드는 인트라 예측 모드 {2, 4, 6, …, 66} 중 어느 하나에 대응하는 각도 모드이고, 확장 각도 모드는 인트라 예측 모드 {3, 5, 7, …, 65} 중 어느 하나에 대응하는 각도 모드일 수 있다. 즉, 확장 각도 모드는 제1 각도 범위 내에서 기본 각도 모드들 사이의 각도 모드일 수 있다. 따라서, 확장 각도 모드가 지시하는 각도는 기본 각도 모드가 지시하는 각도에 기초하여 결정될 수 있다.
다른 실시예에 따르면, 기본 각도 모드는 기 설정된 제1 각도 범위 이내의 각도에 대응하는 모드이고, 확장 각도 모드는 상기 제1 각도 범위를 벗어나는 광각 모드일 수 있다. 즉, 기본 각도 모드는 인트라 예측 모드 {2, 3, 4, …, 66} 중 어느 하나에 대응하는 각도 모드이고, 확장 각도 모드는 인트라 예측 모드 {-14, -13, -12, …, -1} 및 {67, 68, …, 80} 중 어느 하나에 대응하는 각도 모드일 수 있다. 확장 각도 모드가 지시하는 각도는 대응하는 기본 각도 모드가 지시하는 각도의 반대편 각도로 결정될 수 있다. 따라서, 확장 각도 모드가 지시하는 각도는 기본 각도 모드가 지시하는 각도에 기초하여 결정될 수 있다. 한편, 확장 각도 모드들의 개수는 이에 한정되지 않으며, 현재 블록의 크기 및/또는 모양에 따라 추가적인 확장 각도들이 정의될 수 있다. 한편, 인트라 예측 모드 세트에 포함되는 인트라 예측 모드들의 총 개수는 전술한 기본 각도 모드와 확장 각도 모드의 구성에 따라 가변할 수 있다.
상기 실시예에서, 확장 각도 모드들 간의 간격은 대응하는 기본 각도 모드들 간의 간격에 기초하여 설정될 수 있다. 예를 들어, 확장 각도 모드들 {3, 5, 7, …, 65} 간의 간격은 대응하는 기본 각도 모드들 {2, 4, 6, …, 66} 간의 간격에 기초하여 결정될 수 있다. 또한, 확장 각도 모드들 {-14, -13, …, -1} 간의 간격은 대응하는 반대편의 기본 각도 모드들 {53, 53, …, 66} 간의 간격에 기초하여 결정되고, 확장 각도 모드들 {67, 68, …, 80} 간의 간격은 대응하는 반대편의 기본 각도 모드들 {2, 3, 4, …, 15} 간의 간격에 기초하여 결정될 수 있다. 확장 각도 모드들 간의 각도 간격은 대응하는 기본 각도 모드들 간의 각도 간격과 동일하도록 설정될 수 있다. 또한, 인트라 예측 모드 세트에서 확장 각도 모드들의 개수는 기본 각도 모드들의 개수 이하로 설정될 수 있다.
본 발명의 실시예에 따르면, 확장 각도 모드는 기본 각도 모드를 기초로 시그널링될 수 있다. 예를 들어, 광각 모드(즉, 확장 각도 모드)는 제1 각도 범위 이내의 적어도 하나의 각도 모드(즉, 기본 각도 모드)를 대체할 수 있다. 대체되는 기본 각도 모드는 광각 모드의 반대편에 대응하는 각도 모드일 수 있다. 즉, 대체되는 기본 각도 모드는 광각 모드가 지시하는 각도의 반대 방향의 각도에 대응하거나 또는 상기 반대 방향의 각도로부터 기 설정된 오프셋 인덱스만큼 차이 나는 각도에 대응하는 각도 모드이다. 본 발명의 실시예에 따르면, 기 설정된 오프셋 인덱스는 1이다. 대체되는 기본 각도 모드에 대응하는 인트라 예측 모드 인덱스는 광각 모드에 다시 매핑되어 해당 광각 모드를 시그널링할 수 있다. 예를 들어, 광각 모드 {-14, -13, …, -1}은 인트라 예측 모드 인덱스 {52, 53, …, 66}에 의해 각각 시그널링될 수 있고, 광각 모드 {67, 68, …, 80}은 인트라 예측 모드 인덱스 {2, 3, …, 15}에 의해 각각 시그널링될 수 있다. 이와 같이 기본 각도 모드를 위한 인트라 예측 모드 인덱스가 확장 각도 모드를 시그널링하도록 함으로, 각 블록의 인트라 예측에 사용되는 각도 모드들의 구성이 서로 다르더라도 동일한 세트의 인트라 예측 모드 인덱스들이 인트라 예측 모드의 시그널링에 사용될 수 있다. 따라서, 인트라 예측 모드 구성의 변화에 따른 시그널링 오버헤드가 최소화될 수 있다.
한편, 확장 각도 모드의 사용 여부는 현재 블록의 모양 및 크기 중 적어도 하나에 기초하여 결정될 수 있다. 일 실시예에 따르면, 현재 블록의 크기가 기 설정된 크기보다 클 경우 확장 각도 모드가 현재 블록의 인트라 예측을 위해 사용되고, 그렇지 않을 경우 기본 각도 모드만 현재 블록의 인트라 예측을 위해 사용될 수 있다. 다른 실시예에 따르면, 현재 블록이 정사각형이 아닌 블록인 경우 확장 각도 모드가 현재 블록의 인트라 예측을 위해 사용되고, 현재 블록이 정사각형 블록인 경우 기본 각도 모드만 현재 블록의 인트라 예측을 위해 사용될 수 있다.
인트라 예측부는 현재 블록의 인트라 예측 모드 정보에 기초하여, 현재 블록의 인트라 예측에 사용될 참조 샘플들 및/또는 보간된 참조 샘플들을 결정한다. 인트라 예측 모드 인덱스가 특정 각도 모드를 지시할 경우, 현재 블록의 현재 샘플로부터 상기 특정 각도에 대응하는 참조 샘플 또는 보간된 참조 샘플이 현재 픽셀의 예측에 사용된다. 따라서, 인트라 예측 모드에 따라 서로 다른 세트의 참조 샘플들 및/또는 보간된 참조 샘플들이 인트라 예측에 사용될 수 있다. 참조 샘플들 및 인트라 예측 모드 정보를 이용하여 현재 블록의 인트라 예측이 수행되고 나면, 디코더는 역변환부로부터 획득된 현재 블록의 잔차 신호를 현재 블록의 인트라 예측 값과 더하여 현재 블록의 샘플 값들을 복원한다.
인터 예측에 사용되는 움직임(모션) 정보에는 참조 방향 지시 정보(inter_pred_idc), 참조 픽쳐 인덱스(ref_idx_l0, ref_idx_l1), 움직임(모션) 벡터(mvL0, mvL1)이 포함될 수 있다. 참조 방향 지시 정보에 따라 참조 픽쳐 리스트 활용 정보(predFlagL0, predFlagL1)가 설정될 수 있다. 실시 일 예로, L0 참조 픽쳐를 사용하는 단방향 예측인 경우, predFlagL0=1, predFlagL1=0로 설정될 수 있다. L1 참조 픽쳐를 사용하는 단방향 예측인 경우, predFlagL0=0, predFlagL1=1로 설정될 수 있다. L0와 L1 참조 픽쳐를 모두 사용하는 양방향 예측인 경우, predFlagL0=1, predFlagL1=1로 설정될 수 있다.
현재 블록이 코딩 유닛일 경우, 코딩 유닛은 여러 개의 서브 블록으로 분할될 수 있으며, 각 서브 블록의 예측 정보는 서로 같거나 또는 다를 수 있다. 실시 일 예로, 코딩 유닛이 인트라 모드일 경우, 각 서브 블록의 인트라 예측 모드는 서로 같거나 또는 다를 수 있다. 또한, 코딩 유닛이 인터 모드일 경우, 각 서브 블록의 움직임 정보는 서로 같거나 또는 다를 수 있다. 또한, 각 서브 블록은 서로 독립적으로 인코딩 또는 디코딩이 가능할 수 있다. 각각의 서브 블록은 서브 블록 인덱스(sub-block index, sbIdx)를 통해 구분될 수 있다.
현재 블록의 움직임 벡터는 주변 블록의 움직임 벡터와 유사할 가능성이 높다. 따라서, 주변 블록의 움직임 벡터는 움직임 예측 값(motion vector predictor, mvp)으로 사용될 수 있고, 현재 블록의 움직임 벡터는 주변 블록의 움직임 벡터를 이용하여 유도될 수 있다. 또한, 움직임 벡터의 정확성을 높이기 위해서, 인코더에서 원본 영상으로 찾은 현재 블록의 최적의 움직임 벡터와 움직임 예측 값 간의 움직임 벡터의 차이(motion vector difference, mvd)가 시그널링될 수 있다.
움직임 벡터는 다양한 해상도를 가질 수 있으며, 블록 단위로 움직임 벡터의 해상도가 달라질 수 있다. 움직임 벡터 해상도는 정수 단위, 반화소 단위, 1/4 화소 단위, 1/16 화소 단위, 4의 정수 화소 단위 등으로 표현될 수 있다. 스크린 콘텐츠와 같은 영상은 문자와 같은 단순한 그래픽 형태이므로 보간(interpolation) 필터를 적용하지 않아도 되므로, 정수 단위와 4의 정수 화소 단위가 블록 단위 선택적으로 적용될 수 있다. 회전 및 스케일을 표현할 수 있는 어파인(Affine) 모드로 부호화된 블록은 형태의 변화가 심하므로, 정수 단위, 1/4 화소 단위, 1/16 화소 단위가 블록 기반 선택적으로 적용될 수 있다. 블록 단위로 움직임 벡터 해상도를 선택적으로 적용할 지에 대한 여부 정보는 amvr_flag으로 시그널링된다. 만일 적용되는 경우, 어떠한 움직임 벡터 해상도를 현재 블록에 적용할지는 amvr_precision_idx으로 시그널링된다.
양방향 예측이 적용되는 블록의 경우, 가중치 평균을 적용할 때 2개의 예측 블록 간의 가중치를 같거나 또는 다르게 적용할 수 있으며, 가중치에 대한 정보는 bcw_idx를 통해 시그널링된다.
움직임 예측 값의 정확도를 높이기 위해서, 머지(Merge) 또는 AMVP(dvanced motion vector prediction) 방법이 블록 단위 선택적으로 사용될 수 있다. Merge 방법은 현재 블록의 움직임 정보를 현재 블록에 인접한 주변 블록의 움직임 정보와 동일하게 구성하는 방법으로, 동질성을 갖는 움직임 영역에서 움직임 정보가 변화없이 공간적으로 전파됨으로써 움직임 정보의 부호화 효율을 증가시키는 장점이 있다. 반면에 AMVP 방법은 정확한 움직임 정보를 표현하기 위해 L0 및 L1 예측 방향으로 각각 움직임 정보를 예측하고 가장 최적의 움직임 정보를 시그널링하는 방법이다. 디코더는 AMVP 또는 Merge 방법을 통해 현재 블록에 대한 움직임 정보를 유도한 후, 참조 픽쳐(reference picture)에서 유도한 움직임 정보에 위치한 참조 블록을 현재 블록을 위한 예측 블록으로 사용한다.
Merge 또는 AMVP에서 움직임 정보를 유도하는 방법은 현재 블록의 주변 블록으로부터 유도된 움직임 예측 값을 사용하여 움직임 후보 리스트를 구성한 후, 최적의 움직임 후보에 대한 인덱스 정보가 시그널링되는 방법일 수 있다. AMVP의 경우, L0와 L1 각각 움직임 후보 리스트가 유도되므로, L0와 L1 각각에 대한 최적의 움직임 후보 인덱스(mvp_l0_flag, mvp_l1_flag)가 시그널링된다. Merge의 경우, 하나의 움직임 후보 리스트가 유도되므로, 하나의 머지 인덱스(merge_idx)가 시그널링된다. 하나의 코딩 유닛에서 유도되는 움직임 후보 리스트는 다양할 수 있으며, 각 움직임 후보 리스트마다 움직임 후보 인덱스 또는 머지 인덱스가 시그널링될 수 있다. 이때, Merge 모드로 부호화된 블록에서 잔여 블록에 대한 정보가 없는 모드를 머지 스킵(MergeSkip) 모드라고 할 수 있다.
현재 블록에 대한 양방향 움직임 정보는 AMVP와 Merge 모드가 혼용되어 유도될 수 있다. 예를 들어, L0 방향의 움직임 정보는 AMVP 방법을 사용하여 유도하고, L1 방향의 움직임 정보는 Merge 방법을 사용하여 유도될 수 있다. 반대로, L0는 Merge, L1은 AMVP를 적용할 수 있다. 이러한 부호화 모드를 AMVP-merge 모드라고 할 수 있다.
본 명세서의 움직임 후보와 움직임 정보 후보는 서로 동일한 의미일 수 있다. 또한, 본 명세서의 움직임 후보 리스트와 움직임 정보 후보 리스트는 서로 동일한 의미일 수 있다.
SMVD(Symmetric MVD)는 양방향 예측(bi-directional prediction)의 경우에, L0 방향과 L1 방향의 MVD(Motion Vector Difference) 값이 대칭을 이루도록 하여 전송되는 움직임 정보의 비트량을 줄이는 방법이다. L0 방향과 대칭을 이루는 L1 방향의 MVD 정보는 전송되지 않으며, L0 및 L1 방향의 참조 픽쳐 정보도 전송되지 않고 복호화 과정에서 유도될 수 있다.
OBMC(Overlapped Block Motion Compensation)는 블록 간의 움직임 정보가 서로 다른 경우, 주변 블록들의 움직임 정보를 사용하여 현재 블록에 대한 예측 블록들을 생성한 후, 예측 블록들을 가중치 평균하여 현재 블록에 대한 최종 예측 블록을 생성하는 방법이다. 이는 움직임 보상된 영상의 블록 경계에서 발생되는 블록킹 현상을 줄여주는 효과가 있다.
일반적으로 머지 움직임 후보는 움직임의 정확도가 낮다. 이러한 머지 움직임 후보의 정확도를 높이기 위해서, MMVD(Merge mode with MVD) 방법이 사용될 수 있다. MMVD 방법은 몇 개의 움직임 차분 값 후보들 중에서 선택된 하나의 후보를 이용하여 움직임 정보를 보정하는 방법이다. MMVD 방법을 통해 획득되는 움직임 정보의 보정 값에 대한 정보(예를 들어, 움직임 차분 값 후보들 중에서 선택된 하나의 후보를 지시하는 인덱스 등)은 비트스트림에 포함되어 디코더로 전송될 수 있다. 기존의 움직임 정보 차분 값이 비트스트림에 포함되는 것에 비해 움직임 정보의 보정 값에 대한 정보가 비트스트림에 포함됨으로써 비트량은 절약될 수 있다.
MBVD(merge mode with block vector differences) 모드는 머지 모드에서 움직임 벡터에 대한 차분 값을 부호화하는 모드인 MMVD와 유사한 방법으로, 블록 벡터에 대한 차분값을 부호화하는 모드이다. MBVD 방법은 몇 개의 블록 벡터 차분 값 후보들 중에서 선택된 하나의 후보를 이용하여 블록 벡터를 결정하는 방법이다. MBVD 방법을 통해 획득되는 블록 벡터의 차분 값에 대한 정보(예를 들어, 블록 벡터 차분 값 후보들 중에서 선택된 하나의 후보를 지시하는 인덱스 등)은 비트스트림에 포함되어 디코더로 전송될 수 있다. 기존의 블록 벡터 차분 값을 비트스트림에 포함하는 것에 비해 블록 벡터의 차분 값에 대한 일부의 정보만을 비트스트림에 포함함으로써 비트량을 절약할 수 있다.
TM(Template Matching) 방법은 현재 블록의 주변 화소를 통해 템플릿을 구성하여 템플릿과 가장 유사도가 높은 매칭 영역을 찾아서 움직임 정보를 보정하는 방법이다. TM(Template matching)은 부호화되는 비트스트림의 크기를 줄이기 위해서, 움직임 정보를 비트스트림에 포함하지 않고 디코더에서 움직임 예측을 수행하는 방법이다. 이때, 디코더는 원본 영상이 없으므로 이미 복원된 주변 블록을 사용하여 현재 블록에 대한 움직임 정보를 개략적으로 유도할 수 있다.
BM(Bilateral Matching)은 비디오 신호 처리 장치가 현재 블록의 움직임 정보를 기반으로 유도된 L0 픽쳐 리스트에 포함된 픽쳐 내의 참조 블록과 L1 픽쳐 리스트에 포함된 픽쳐 내의 참조 블록 간의 유사도를 기초로 움직임 정보를 보정하는 방법일 수 있다.
DMVR(Decoder-side Motion Vector Refinement) 방법은 조금 더 정확한 움직임 정보를 찾기 위해 이미 복원된 참조 영상들의 상관성을 통해 움직임 정보를 보정하는 방법으로써, 현재 블록의 양방향 움직임 정보를 사용하여 2개의 참조 픽쳐의 임의의 정해진 영역 내에서 참조 픽쳐 내의 참조 블록 간의 가장 매칭이 잘되는 지점을 새로운 양방향 움직임으로 사용하는 방법이다. 이러한 DMVR이 수행될 때, 인코더는 하나의 블록 단위에서 DMVR을 수행하여 움직임 정보를 보정한 후, 다시 블록을 서브 블록으로 분할하여 각 서브 블록 단위에서 DMVR을 수행하여 서브 블록의 움직임 정보를 다시 보정할 수 있으며, 이를 MP-DMVR(Multi-pass DMVR)이라 할 수 있다.
LIC(Local Illumination Compensation) 방법은 블록 간의 휘도 변화를 보상하는 방법으로, 현재 블록에 인접한 주변 화소들을 사용하여 선형 모델을 유도한 후, 선형 모델을 통해 현재 블록의 휘도 정보를 보상하는 방법이다.
기존 비디오 부호화 방법들은 상하좌우의 평행 이동만을 고려한 움직임 보상을 수행하기 때문에, 현실에서 일반적으로 접하는 확대, 축소, 회전 등과 같은 움직임 포함하고 있는 비디오들의 부호화 시 부호화 효율이 저하된다. 이러한 확대, 축소, 회전에 대한 움직임을 표현하기 위하여, 4개(회전) 또는 6개(확대, 축소, 회전) 파라미터 모델을 이용하는 Affine 모델 기반 움직임 예측 기술이 적용될 수 있다.
BDOF(Bi-Directional Optical Flow)는 양방향 움직임으로 구성된 블록의 참조 블록으로부터 광-흐름(optical-flow) 기반으로 화소의 변화량을 추정하여 예측 블록을 보정하는데 사용된다. 이러한 VVC의 BDOF에서 유도된 움직임 정보를 이용하여 현재 블록의 움직임을 보정할 수 있다.
PROF(Prediction refinement with optical flow)는 서브 블록 단위 Affine 움직임 예측의 정확도를 픽셀 단위 움직임 예측의 정확도와 유사하도록 개선하기 위한 기술이다. PROF는 BDOF와 유사하게 광-흐름(optical-flow)에 기반하여 서브 블록 단위로 Affine 움직임 보상된 픽셀 값들에 대해 픽셀 단위로 보정 값을 계산하여 최종 예측 신호를 획득하는 기술이다.
CIIP(Combined Inter-/Intra-picture Prediction)방법은 현재 블록에 대한 예측 블록을 생성할 때, 화면 내 예측 방법으로 생성한 예측 블록과 화면 간 예측 방법으로 생성한 예측 블록들을 가중치 평균하여 최종 예측 블록을 생성하는 방법이다.
IBC(Intra Block Copy) 방법은 현재 블록과 가장 유사한 부분을 현재 픽쳐 내의 이미 복원된 영역에서 찾아서, 해당 참조 블록을 현재 블록에 대한 예측 블록으로 사용하는 방법이다. 이때, 현재 블록과 참조 블록 간의 거리인 블록 벡터(Block Vector)와 관련된 정보는 비트스트림에 포함될 수 있다. 디코더는 비스트스림에 포함된 블록 벡터와 관련된 정보를 파싱하여 현재 블록을 위한 블록 벡터를 계산하거나 설정할 수 있다.
BCW(Bi-prediction with CU-level Weights) 방법은 서로 다른 참조 픽쳐로 부터 움직임 보상된 두 개의 예측 블록에 대하여, 평균으로 예측 블록을 생성하지 않고, 블록 단위로 적응적으로 가중치를 적용하여 움직임 보상된 두 개의 예측 블록에 가중치 평균을 수행하는 방법이다.
Intra TMP(Template Matching Prediction) 방법은, 비디오 신호 처리 장치가 현재 블록에 인접한 주변 블록의 화소 값들을 사용하여 기준 템플릿이 구성하고, 구성된 기준 템플릿과 가장 유사한 부분을 현재 픽쳐 내의 이미 복원된 영역에서 찾은 후, 해당 참조 블록(이미 복원된 영역에서 찾은 부분)을 현재 블록에 대한 예측 블록으로 사용하는 방법이다
MHP(Multi-hypothesis prediction) 방법은 화면 간 예측 시 단방향 및 양방향 움직임 정보에 추가적인 움직임 정보를 전송함으로써, 다양한 예측 신호를 통한 가중치 예측을 수행하는 방법이다.
CCLM(Cross-component linear model)은 휘도 신호와 해당 휘도 신호와 동일한 위치에 있는 색차 신호 간의 높은 상관성을 이용하여 선형 모델을 구성한 후, 해당 선형 모델을 통해 색차 신호를 예측하는 방법이다. 현재 블록에 인접한 주변 블록 중에서 복원이 완료된 블록을 사용하여 템플릿을 구성한 후, 템플릿을 통해 선형 모델에 대한 파라미터가 유도된다. 다음으로, 영상 포맷에 따라 선택적으로 색차 블록의 크기에 맞게 복원된 현재 휘도 블록이 다운 샘플링된다. 마지막으로, 다운 샘플링된 휘도 블록과 해당 선형 모델을 이용하여 현재 블록의 색차 블록을 예측한다. 이때, 2개 이상의 선형 모델을 사용하는 방법을 MMLM(Multi-model Linear mode)이라고 한다. 또한, CCLM과 MMLM과 같이, 다른 신호 사이의 상관성을 이용한 예측 방법을 CCP(Cross-Component Prediction)이라고 지칭할 수 있다.
GLM(Gradient Linear Model)은 CCLM과 같은 선형 모델에서 색차 샘플에 대응되는 휘도 샘플과 그 휘도 샘플에 인접한 주변의 휘도 샘플들 간의 기울기를 추가로 반영하여 모델을 구성한 후, 해당 모델을 통해 색차 신호를 예측하는 방법이다.
CCLM, MMLM, CCCM, GLM 등과 같이, 다른 신호들 간의 상관성을 이용한 예측 방법은 CCP(Cross-Component Prediction)이라고 할 수 있다. 다시 말하면, 하나의 신호(예를 들어, 휘도 신호)로부터 다른 신호(색차 신호로써, Cb, Cr이 될 수 있다.)를 예측하는 방법은 CCP(Cross-Component Prediction)라고 할 수 있다.
CCP 머지(merge) 방법은 주변 블록에서 사용된 CCP 모델(CCLM, MMLM, CCCM 등의 모델)을 사용하여 현재 블록의 색차 블록을 예측하는 방법이다.
본 명세서에서 기술하는 부호화 모드(예측 모드)는 모드라는 용어를 생략하여 기술될 수도 있고, 모드 대신 방법이라는 용어로 기술될 수도 있다. 예를 들어, CCLM 모드는 CCLM 방법 또는 CCLM이라 기술될 수 있다.
인트라 예측 부호화 기술 중에서 MIP(Matrix Intra Prediction) 방법은 행렬 기반 인트라 예측 방법으로 현재 블록에 인접한 주변 블록의 픽셀로부터 방향성을 가지는 예측 방법과 달리, 주변 블록의 좌측 및 상단의 픽셀들을 미리 정의된 행렬 매트릭스와 오프셋 값을 이용하여 예측 신호를 구하는 방법이다.
현재 블록의 인트라 예측 모드를 유도하기 위해서, 현재 블록에 인접하면서 복원된 임의의 영역인 템플릿(template)을 기반으로, 해당 템플릿의 주변 픽셀을 통해 유도된 템플릿에 대한 인트라 예측 모드가 현재 블록의 복원을 위해 이용할 수 있다. 우선, 디코더는 템플릿에 인접한 주변 픽셀(reference)을 이용하여 템플릿에 대한 예측 템플릿을 생성하고, 이미 복원된 템플릿과 가장 유사한 예측 템플릿을 생성한 인트라 예측 모드를 현재 블록의 복원을 위해 사용할 수 있다. 이러한 방법을 TIMD(Template intra mode derivation)이라고 할 수 있다.
TIMD merge 모드는 TIMD 혹은 TIMD merge 모드로 부호화된 주변 블록에서 인트라 예측 방향성 모드, 가중 평균을 적용할지 정보, 각 인트라 예측 모드에 대한 가중 정보, 변환 타입 정보를 상속받아서 현재 블록에서 사용하는 모드이다. 비디오 신호 처리 장치는 주변 블록에서 사용된 TIMD 정보들을 이용하여 TIMD merge 리스트를 구성할 수 있다. 비디오 신호 처리 장치는 거리가 가까운 순으로 미리 정해진 최대 개수만큼 주변 블록으로부터 유도된 TIMD 정보를 TIMD merge 리스트에 추가할 수 있다. 미리 정해진 최대 개수는 1이상의 양의 정수일 수 있다. 예컨대, 미리 정해진 최대 개수는 5일 수 있다. 비디오 신호 처리 장치는 템플릿 코스트를 기반으로 TIMD merge 리스트를 재정렬하고, 최소 코스트를 갖는 후보를 현재 블록의 TIMD 모드로 사용할 수 있다. 현재 블록이 TIMD merge 모드로 부호화된 경우, 비디오 신호 처리 장치는 잔여 신호에 대해 현재 블록의 크기가 4이상 16 이하인 경우 묵시적인 DST7 변환을 사용할 수 있다. 그 외의 경우, 비디오 신호 처리 장치는 주변 블록으로부터 유도된 변환 타입을 사용할 수 있다. 주변 블록으로부터 유도된 변환 타입은 TIMD merge 리스트로부터 결정된 현재 블록에 대한 TIMD 후보 내의 변환 타입 정보일 수 있다. TIMD 모드에서 템플릿 코스트는 SATD를 통해 계산될 수 있다. 템플릿 코스트의 계산 방식이 달라지면 유도되는 인트라 예측 모드도 달라질 수 있다. TIMD SAD 모드는 TIMD 모드와 유사하지만, 템플릿 코스트를 계산하는 방식이 SATD가 아닌 MR-SAD 방식을 사용한다.
일반적으로 인코더는 예측 블록을 생성하기 위한 예측 모드를 결정하여 결정된 예측 모드에 대한 정보가 포함된 비트스트림을 생성할 수 있다. 디코더는 수신한 비트스트림을 파싱하여 인트라 예측 모드를 설정할 수 있다. 이때, 예측 모드에 대한 정보의 비트량은 전체 비트스트림 크기의 10% 정도일 수 있다. 예측 모드에 대한 정보의 비트량을 감소시키기 위해 인코더는 비트스트림에 인트라 예측 모드에 대한 정보를 포함하지 않을 수 있다. 이에, 디코더는 주변 블록의 특성을 이용하여 현재 블록의 복원을 위한 인트라 예측 모드를 유도(결정)할 수 있고, 유도된 인트라 예측 모드를 이용하여 현재 블록을 복원할 수 있다. 이때, 디코더는 인트라 예측 모드를 유도하기 위해 현재 블록에 인접한 주변 화소(픽셀)들마다 소벨(Sobel) 필터를 가로 및 세로 방향으로 적용하여 방향성 정보를 유추한 후, 해당 방향성 정보를 인트라 예측 모드로 매핑하는 방법을 이용할 수 있다. 디코더가 주변 블록을 이용하여 인트라 예측 모드를 유도하는 방법은 DIMD(Decoder side intra mode derivation)로 기술될 수 있다.
현재 블록이 휘도 블록인 경우, 비디오 신호 처리 장치는 DIMD 및 TIMD 방법을 통해 인트라 예측 모드를 유도할 수 있다. 현재 블록이 색차 블록인 경우, 색차 블록에 대응되는 이미 복원된 휘도 블록이 존재하므로, 비디오 신호 처리 장치는 복원된 휘도 블록을 사용하여 DIMD 및 TIMD 방법 적용하여 인트라 예측 모드를 유도한 후, 유도된 인트라 예측 모드를 색차 블록의 인트라 예측 모드로 사용할 수 있다. 즉, 비디오 신호 처리 장치는 현재 블록이 휘도 블록인 경우에는 방향성 정보를 유도하고, 현재 블록이 색차 블록일 경우에는 방향성 정보를 유도하지 않을 수 있으며, 휘도 블록에서 찾은 방향성 정보를 색차 블록에 적용할 수 있다. 이러한 모드를 'DIMD Chroma' 모드 혹은 'TIMD Chroma' 모드라고 할 수 있다.
도 7은 인터 예측에서 움직임 후보 리스트를 구성하기 위해 사용되는 주변 블록들의 위치를 나타낸 도면이다.
주변 블록들은 공간적인 위치의 블록이거나 시간적인 위치의 블록일 수 있다. 현재 블록에 공간적으로 인접한 주변 블록은 좌측(Left, A1) 블록, 좌하측(Left Below, A0) 블록, 상측(Above, B1) 블록, 상우측(Above Right, B0) 블록 또는 상좌측(Above Left, B2) 블록 중 적어도 하나가 될 수 있다. 현재 블록에 시간적으로 인접한 주변 블록은 대응되는 픽쳐(Collocated picture)에서 현재 블록의 하우측(bottom Right, BR) 블록의 좌상단 픽셀 위치를 포함하는 블록이 될 수 있다. 상기 현재 블록에 시간적으로 인접한 주변 블록이 인트라 모드로 부호화되거나 상기 현재 블록에 시간적으로 인접한 주변 블록이 사용할 수 없는 위치에 존재하면, 현재 픽쳐에 대응되는 픽쳐(Collocated picture)에서 현재 블록의 가로 및 세로의 중앙(Center, Ctr) 픽셀 위치를 포함하는 블록이 시간적 주변 블록으로 사용될 수 있다. 대응되는 픽쳐에서 유도된 움직임 후보 정보는 TMVP(Temporal Motion Vector Predictor)라 지칭될 수 있다. TMVP는 하나의 블록에서 하나만 유도될 수 있고, 하나의 블록을 여러 개의 서브 블록으로 분할한 후, 각 서브 블록마다 각각의 TMVP 후보가 유도될 수 있다. 서브 블록 단위의 TMVP 유도 방법은 sbTMVP(sub-block Temporal Motion Vector Predictor)로 지칭될 수 있다.
본 명세서에서 설명하는 방법들이 적용될 것인지 여부는 슬라이스 타입 정보 (예, I 슬라이스, P 슬라이스, B 슬라이스 인지 여부), 타일인지 여부, 서브 픽쳐인지 여부, 현재 블록의 샘플 개수, 현재 블록의 가로의 크기, 현재 블록의 세로의 크기, 코딩 유닛의 깊이, 현재 블록이 휘도 블록인지 색차 블록인지 여부, 참조 프레임인지 비참조 프레임인지 여부, 참조 순서 및 계층에 따른 시간 계층 등에 대한 정보들 중 적어도 어느 하나에 기초하여 결정될 수 있다. 본 명세서에서 설명하는 방법들이 적용될 것인지 여부를 결정하기 위해 사용되는 정보들은 디코더 및 인코더 간 미리 약속된 정보일 수 있다. 또한, 이러한 정보들은 프로파일 및 레벨에 따라 결정되어 있을 수 있다. 이러한 정보들은 변수 값으로 표현될 수 있고, 비트스트림에는 변수 값에 대한 정보가 포함될 수 있다. 즉, 디코더는 비트스트림에 포함된 변수 값에 대한 정보를 파싱하여 상술한 방법들이 적용되는지 여부를 결정할 수 있다. 본 명세서에서 설명하는 방법들은 휘도 블록과 색차 블록에서 수행될 수 있다. 본 명세서에서 설명하는 방법들은 휘도 블록에 대해서만 수행되고, 색차 블록에서는 수행되지 않을 수 있다. 본 명세서에서 설명하는 방법들은 휘도 블록에서는 수행되지 않고, 색차 블록에서만 수행될 수 있다. 본 명세서에서 설명하는 방법들은 현재 픽쳐가 참조 픽쳐로 사용되는지 혹은 참조 픽쳐로 사용되지 않는지에 대한 정보에 따라 수행 여부가 결정될 수 있다. 예를 들어, 코딩 유닛의 가로의 길이 또는 세로의 길이에 기초하여 상술한 방법들이 적용될 것인지 여부가 결정될 수 있다. 가로의 길이 또는 세로의 길이가 32 이상(예, 32, 64, 128 등)이면 상술한 방법들은 적용될 수 있다. 또한 가로의 길이 또는 세로의 길이가 32 보다 작은 경우(예, 2, 4, 8, 16)에 상술한 방법들은 적용될 수 있다. 또한 가로의 길이 또는 세로의 길이가 4 또는 8인 경우 상술한 방법들은 적용될 수 있다.
도 8은 본 명세서의 일 실시예에 따른 템플릿에 기초하여 참조 픽셀 라인을 결정하는 방법을 나타낸다.
이하 템플릿에 기초하여 현재 블록을 위한(현재 블록의 복원을 위한) 최적의 참조 픽셀 라인을 결정하는 방법에 대해 설명한다. 여기서 참조 픽셀 라인은 참조 샘플 라인과 동일한 의미일 수 있다.
도 8을 참조하면 비디오 신호 처리 장치는 현재 블록에 인접한 참조 픽셀 라인을 사용하여 기준 템플릿을 구성할 수 있다. 비디오 신호 처리 장치는 참조 픽셀 라인 1, 2, 3...(Reference line 1, 2, 3 ...) 등을 사용하여 기준 템플릿의 위치에 대한 예측 샘플을 생성할 수 있다. 비디오 신호 처리 장치는 생성된 예측 샘플과 기준 템플릿의 샘플들 간 코스트를 계산할 수 있다. 이때 코스트는 SAD(Sum of Absolute Differences) 또는 MRSAD(Mean-Removed SAD) 등의 방법을 통해 계산될 수 있다. 최소 코스트에 대응되는 참조 픽셀이 최적의 참조 픽셀일 수 있다. 또한, 인코더는 계산된 코스트를 오름차순으로 재정렬하고, 참조 픽셀 라인에 대한 리스트를 구성한 후, 최적의 참조 픽셀 라인에 대한 인덱스에 대한 정보를 포함하는 비트스트림을 생성하고 시그널링할 수 있다. 디코더는 상술한 방법을 통해 참조 픽셀 라인에 대한 리스트를 구성하고, 비트스트림에 포함된 최적의 참조 픽셀 라인에 대한 인덱스를 파싱하여 인덱스가 지시하는 참조 픽셀 라인을 이용하여 예측 샘플을 생성할 수 있다. 본 명세서에서 설명하는 바와 같이, 비디오 신호 처리 장치가 템플릿에 기초하여 참조 픽셀 라인을 결정하는 방법은 TMRL(Template-based Multiple Reference Line) 방법 또는 TMRL 인트라 예측 방법으로 기술될 수 있다.
도 9는 본 명세서의 일 실시예에 따른 IBC 부호화 방법과 관련된 블록 벡터를 나타낸 도면이다.
IBC 부호화 방법(IBC 모드)은 현재 블록과 가장 유사한 부분(참조 블록)을 현재 픽쳐 내의 이미 복원된 영역에서 찾아서, 참조 블록을 현재 블록에 대한 예측 블록으로 사용하는 방법이다. 이때, 인코더는 현재 블록과 참조 블록 간의 거리인 블록 벡터(Block Vector)와 관련된 정보를 포함하는 비트스트림을 생성할 수 있다. 디코더는 비스트스림에 포함된 블록 벡터와 관련된 정보를 파싱하여 현재 블록을 위한 블록 벡터를 계산하거나 설정할 수 있다. 색차 블록에서 IBC 부호화 방법이 적용될 수 있다. 색차 블록에서는 블록 벡터를 새롭게 찾지 않고, 색차 블록에 대응되는 휘도 블록의 블록 벡터를 색차 블록의 블록 벡터로 사용할 수 있으며, 이러한 부호화 방법을 DBV(Direct Block Vector) 모드라고 할 수 있다.
RRIBC(Reconstruction-Reordered IBC) 부호화 모드는 IBC 블록(IBC 부호화 방법이 적용된 블록)에서 사용할 수 있다. RRIBC는 수직 방향 플립(flip)과 수평 방향 플립으로 구성될 수 있다. RRIBC가 적용된 블록은 현재 블록의 RRIBC 타입에 따라 복원된 블록이 뒤집히게 된다. 인코더는 현재 블록과 가장 유사한 부분을 참조 픽쳐로부터 찾기 전에 현재 부호화할 원본 블록을 플립할 수 있다. 즉, 플립된 원본 블록을 이용하여 참조 픽쳐로부터 가장 유사한 부분을 찾는다. 따라서, 예측 블록은 플립 되지 않은 블록이 사용되며, 잔차 블록도 플립되지 않은 블록일 수 있다. 디코더는 최종 복원된 블록을 현재 블록의 RRIBC 타입에 따라 플립할 수 있다.
도 10은 수평 방향으로의 RRIBC를 사용하여 현재 블록을 예측하는 방법을 나타낸다.
도 11는 수직 방향으로의 RRIBC를 사용하여 현재 블록을 예측하는 방법을 나타낸다.
도 10과 도 11의 (Xn, Yn)은 주변 블록의 중앙 위치를 나타내며, (Xc, Yc)은 현재 블록의 중앙 위치를 나타낸다. BVn h, BVn v 는 각각 주변 블록의 수평 방향 블록 벡터, 수직 방향 블록 벡터를 나타내고, BVC h, BVC v는 각각 현재 블록의 수평 방향 블록 벡터, 수직 방향 블록 벡터를 나타낸다. 도 10과 같이, 현재 블록의 RRIBC 타입이 수평 방향인 경우, BVC h는 2 * (Xn - Xc) + BVn h으로 계산될 수 있고, 도 53과 같이, 현재 블록의 RRIBC 타입이 수직 방향인 경우, BVC v는 2 * (yn - yc) + BVn v로 계산될 수 있다. 이때, BVn h, BVn v는 복원된 블록을 사용하므로, BVn h, BVn v의 부호는 음수일 수 있다.
현재 블록이 RRIBC로 부호화되는 경우, 비디오 신호 처리 장치는 블록 벡터 후보 리스트를 구성하여 최적의 블록 벡터를 결정할 수 있다. 이때, 비디오 신호 처리 장치는 현재 블록의 RRIBC 타입에 따라 블록 벡터 후보 리스트를 구성할 수 있다. 예를 들어, 현재 블록의 RRIBC 타입이 수평 방향인 경우, 비디오 신호 처리 장치는 수평 방향의 RRIBC로 부호화된 현재 블록의 주변 블록만을 사용하여 블록 벡터 후보 리스트를 구성할 수 있다. 또한, 비디오 신호 처리 장치는 현재 블록의 RRIBC 타입에 상관없이 블록 벡터 후보 리스트를 구성할 수 있다. 예를 들어, 현재 블록의 RRIBC 타입이 수평 방향인 경우, 수평 방향의 RRIBC로 부호화된 현재 블록의 주변 블록뿐만 아니라 수직 방향의 RRIBC로 부호화된 현재 블록의 주변 블록 및/또는 일반적인 움직임으로 부호화된 블록 및/또는 블록 벡터로 부호화된 블록을 모두 사용하여 블록 벡터 후보 리스트를 구성할 수 있다.
비디오 신호 처리 장치가 현재 블록을 일반적인 움직임을 사용하여 예측하는 경우, 비디오 신호 처리 장치는 현재 블록의 주변 블록이 IBC 모드로 부호화되었는지, RRIBC 모드로 부호화되었는지에 따라 움직임 후보 리스트를 구성할 수 있다. 이때, 비디오 신호 처리 장치는 현재 블록의 주변 블록이 RRIBC 모드로 부호화된 경우, RRIBC 타입을 추가적으로 고려하여 움직임 후보 리스트를 구성할 수 있다. 예를 들어, 비디오 신호 처리 장치가 현재 블록에 대한 움직임 후보 리스트를 구성할 때, 현재 블록의 주변 블록의 부호화 모드가 RRIBC 모드이고 RRIBC 타입이 수직 방향 또는 수평 방향인 경우, 주변 블록의 블록 벡터는 움직임 후보 리스트에 포함되지 않을 수 있다. 또는 비디오 신호 처리 장치가 현재 블록을 일반적인 움직임을 사용하여 예측하는 경우, 비디오 신호 처리 장치는 현재 블록의 주변 블록의 부호화 모드와 무관하게 움직임 후보 리스트를 구성할 수 있다. 즉, 비디오 신호 처리 장치는 현재 블록의 주변 블록이 IBC 모드로 부호화되었는지, RRIBC 모드로 부호화되었는지와 상관없이 움직임 후보 리스트를 구성할 수 있다. 예를 들어, 비디오 신호 처리 장치는 현재 블록에 대한 움직임 후보 리스트를 구성할 때, 현재 블록의 주변 블록의 부호화 모드가 IBC 모드이고 RRIBC 타입이 수직 방향 또는 수평 방향인 경우에도 주변 블록의 블록 벡터를 움직임 후보 리스트에 포함시킬 수 있다.
RRIBC 부호화 방법은 대칭적인 특성을 지니는 영상에 효과적이다. 대칭적인 특성은 현재 블록과 참조 블록 사이의 하나의 중심축을 기준으로 동일한 거리만큼 떨어진 완전한 수평(또는 수직) 방향의 대칭을 의미할 수 있다. 현재 블록의 수직(또는 수평) 방향(대칭축)은 참조 블록의 수직(또는 수평) 방향(대칭축)과 동일한 선 상에 위치할 수 있다. 이 경우, 수직(또는 수평) 방향의 블록 벡터는 '0'으로 설정될 수 있으며, 수평 방향의 블록 벡터에는 '0'이 아닌 임의의 음수 값이 설정될 수 있다. 현재 블록과 참조 블록은 현재 블록과 참조 블록 사이의 하나의 중심축을 기준으로 서로 다른 거리만큼의 차이를 갖는 대칭으로 구성될 수 있으며, 현재 블록과 참조 블록은 서로 다른 수직선 상에 위치할 수 있다. 이 경우, 수직 방향의 블록 벡터는 '0'이 아닌 임의의 음수 값으로 설정될 수 있다. 즉, 비디오 신호 처리 장치는 수평 및 수직 방향이 모두 '0'이 아닌 임의의 음수 값의 블록 벡터 값을 가지는 대칭 블록을 사용하여 현재 블록을 부호화 또는 복호화 할 수 있다.
도 12는 본 명세서의 일 실시예에 따른 Intra TMP 모드로 부호화된 블록의 블록 벡터를 나타낸다.
도 12를 참조하면 Intra TMP 방법(Intra TMP 부호화 모드)은 비디오 신호 처리 장치가 현재 블록에 인접한 주변 블록의 화소 값들을 사용하여 기준 템플릿을 구성한 후, 기준 템플릿과 가장 유사한 부분을 현재 픽쳐 내의 이미 복원된 영역(참조 블록)에서 찾은 후, 참조 블록(도 12의 Ref. luma block)을 현재 블록에 대한 예측 블록으로 사용하는 방법이다. 이때, 현재 휘도 블록에 대한 예측 블록을 생성하는 데 사용되는 블록 벡터는 하나 이상일 수 있으며, 도 12은 블록 벡터가 2개인 경우를 보여준다. 비디오 신호 처리 장치는 현재 휘도 블록의 2개의 블록 벡터로부터 예측된 참조 블록들을 가중치 평균하여 휘도 블록에 대한 예측 블록을 생성할 수 있다. 이를 fusion 모드라 지칭할 수 있다. 색차 블록의 경우, 비디오 신호 처리 장치는 색차 블록에 대응되는 휘도 블록으로부터 블록 벡터를 유도한 후, 블록 백터를 사용하여 색차 예측 블록을 생성할 수 있다. 현재 색차 블록에 대한 예측 블록을 생성하는 데 사용되는 블록 벡터는 하나 이상일 수 있으며, 도 12은 색차 블록을 위한 블록 벡터가 2개인 경우를 보여준다. 이때 색차 블록의 블록 벡터는 휘도 블록으로부터 유도된 블록 벡터와 같거나 다를 수 있다. Intra TMP 모드에서 비디오 신호 처리 장치는 블록 벡터가 지시하는 참조 블록 주변의 샘플과 현재 블록 주변의 샘플 간의 상관성을 이용하여 필터 계수를 유도하고, 유도된 필터 계수를 사용하여 블록 벡터가 지시하는 참조 블록에 필터링을 적용할 수 있다. 비디오 신호 처리 장치는 필터링된 참조 블록을 현재 블록의 예측 블록으로 사용할 수 있다. 이를 Intra TMP 필터링 모드라 지칭할 수 있다. Intra TMP 모드에서 비디오 신호 처리 장치는 움직임 정보를 이용한 LIC 방법과 유사하게 블록 벡터를 통해 현재 예측 블록에 대한 보상을 적용할 수 있다.
도 13은 본 명세서의 일 실시예에 따른 GPM 모드에 의해 현재 블록이 분할된 경우, 분할된 영역이 IBC 모드로 부호화되는 경우를 나타낸다.
현재 블록은 IBC-GPM 모드로 부호화 혹은 복호화 될 수 있다. IBC-GPM 모드는 현재 블록이 GPM 모드를 사용하여 분할되고, 분할된 영역이 인트라 예측 모드 혹은 IBC 예측 모드로 부호화되는 모드를 의미할 수 있다. 도 13을 참조하면 현재 블록은 점선을 기준으로 2개 영역으로 분할될 수 있다. 이때, 분할된 영역 중 어느 하나는 인트라 예측 모드로 부호화될 수 있고, 나머지 하나는 IBC 예측 모드로 부호화될 수 있다. 예를 들어, 분할된 영역 중 왼쪽 영역은 인트라 예측 모드로 부호화되고, 오른쪽 영역은 IBC 예측 모드로 부호화될 수 있다. 이때, IBC 예측 모드로 부호화된 영역은 Intra TMP 예측 모드로 부호화될 수 있고, 이를 IntraTMP-GPM 모드라 기술할 수 있다.
도 14는 본 명세서의 일 실시예에 따른 현재 블록이 IBC-CIIP 모드로 부호화되는 방법을 나타낸다.
비디오 신호 처리 장치는 인트라 모드로 예측된 블록과 IBC 모드로 예측된 블록 간의 가중치 평균을 이용하여 현재 블록을 예측할 수 있고, 이를 IBC-CIIP 모드라고 할 수 있다. 이때, IBC 모드로 예측된 블록 대신 Intra TMP 모드로 예측된 블록이 사용될 수 있고, 이를 IntraTMP-CIIP 모드라고 할 수 있다.
비디오 신호 처리 장치는 현재 블록의 휘도 예측 블록과 휘도 블록에 대한 잔차 신호를 더하여 복원되는 휘도 블록을 획득하고, 복원된 휘도 블록과 휘도 예측 블록 간의 상관성을 이용하여 CCP 모델을 구성할 수 있다. 이때 CCP 모델은 CCLM, MMLM, GLM, CCCM, MM-CCCM, GL-CCCM, CCCM-ND, CCCM-MDF 중에 하나가 될 수 있다. 휘도 블록으로부터 유도된 CCP 모델을 색차 예측 블록에 적용하여 CCP 모델이 적용된 제1 색차 예측 블록을 생성할 수 있다. 제1 색차 예측 블록과 색차 블록에 대한 오차 신호를 더하여 최종 색차 블록을 생성할 수 있다.
현재 휘도 블록이 Intra TMP 또는 IBC 모드로 부호화된 경우, 비디오 신호 처리 장치는 현재 휘도 블록의 블록 벡터가 지시하는 참조 블록의 휘도 블록과 색차 블록 간 상관 관계를 통해 CCP 모델을 유도할 수 있다. 유도된 CCP 모델과 현재 복원된 휘도 블록을 사용하여 현재 블록에 대한 색차 예측 블록인 Cb, Cr 예측 블록을 생성할 수 있다. 이를 BVG CCP(block vector guided cross component prediction)라고 지칭한다. CCP 모델은 CCLM, MMLM, GLM, MM-GLM, CCCM, MM-CCCM, GL-CCCM, GL-MM-CCCM, CCCM-ND, MM-CCCM-ND, CCCM-MDF, MM-CCCM-MDF, 및 Chroma Fusion 중 적어도 하나를 포함할 수 있다. 휘도 블록의 BV를 이용하여 CCP 모델을 유도하고, CCP 모델 중 CCCM 모델이 적용되는 경우, BVG CCCM이라 지칭할 수 있다. 현재 색차 블록이 휘도 블록의 BV를 이용하여 CCP 모델을 유도하고, CCP 모델 중 GL-CCCM 모델이 적용되는 경우, BVG GL-CCCM이라 지칭할 수 있다. 또한, BVG CCP에 다양한 CCP 모델이 적용될 수 있다.
CCP 모델의 타입은 CCLM, MMLM, GLM, MM-GLM, CCCM, MM-CCCM, GL-CCCM, MM-GL-CCCM, CCCM-ND, MM-CCCM-ND, CCCM-MDF, MM-CCCM-MDF, 크로마 퓨전, BVG-CCCM, 및 CCP 머지 중 적어도 하나를 를 포함할 수 있다. MMLM은 2개의 CCLM으로 구성될 수 있다. CCP 모델 사이의 CCP 모델의 타입이 다를 경우, 서로 다른 CCP 모델이라 할 수 있다. CCP 모델 사이의 CCP 모델의 타입이 동일하지만 CCP 모델 사이의 파라미터가 다를 경우, 서로 다른 CCP 모델이라 할 수 있다. CCP 모델 사이의 CCP 모델의 개수가 다를 경우, 예컨대, 제1 CCP 모델은 하나의 CCLM으로 구성되고, 제2 CCP 모델은 2개의 CCLM으로 구성된 경우, 서로 다른 CCP 모델이라 할 수 있다. CCP 모델의 타입을 CCP 모드라 지칭할 수 있다.
크로마 퓨전(chroma fusion, CF)에서 비디오 신호 처리 장치는 LM(linear model) 모드를 사용하지 않고 인트라 예측 모드를 통해 예측한 색차 블록과 현재 휘도 블록 사이의 가중 평균을 통해 색차 신호를 예측할 수 있다. 이때, 가중치 파라미터는 CCCM 방식을 사용하여 유도될 수 있다.
GLM(gradient linear model)에서 비디오 처리 장치는 선형 모델에서 색차 샘플에 대응되는 휘도 샘플과 해당 휘도 샘플에 인접한 주변의 휘도 샘플들 사이의 기울기를 추가로 반영하여 모델을 구성하고, 해당 모델을 통해 색차 신호를 예측할 수 있다.
색차 블록을 예측하기 위해 사용되는 CCP 모델은 현재 블록의 주변 블록에서 사용한 CCP 모델을 통해 CCP 후보 리스트를 구성하고, CCP 후보 리스트에서 최적의 CCP 후보를 유도할 수 있다. 이를 CCP 머지 모드라 할 수 있다.
도 15는 본 명세서의 일 실시예에 따른 CCCM 파라미터를 유도하기 위해 사용되는 참조 영역 및 필터 형태의 일 예를 나타낸다.
CCCM(Convolutional cross-component intra prediction model)은 휘도 신호와 휘도 신호와 동일한 위치에 있는 색차 신호 간의 높은 상관성을 이용하여 구성되는 비선형 모델을 모델을 통해 색차 신호를 예측하는 방법이다. 도 15(a)는 현재 예측 블록(사선 빗금, 1510)에 CCCM이 적용되기 위한 참조 샘플들(수직 빗금, 1520)과 십자 모양의 필터를 적용할 때 필요한 사이드(side) 샘플(수평 빗금)의 위치 관계를 나타내고 있다. 현재 예측 블록(MxN)은 크로마 대 루마의 샘플 개수 비율은 1:1 관계에서 상측 6줄의 참조 샘플(2Mx6), 좌측 6줄의 참조 샘플(6x2N) 및 좌-상단의 6x6 참조 샘플들로 구성될 수 있다. 비디오 신호 처리 장치가 CCCM을 위해 십자형 샘플(도 15(b)) 필터를 크로마 샘플 예측 관계식에(도 15(c)) 적용할 때 참조 샘플 영역을 벗어나는 경우가 발생한다. 이때, 추가로 필요한 샘플들이 사이드 샘플일 수 있다. 도 15(c)의 크로마 샘플 예측 관계식은 크로마 성분 각각(즉, Cb, Cr)에 대해 적용될 수 있다. 도 15(b)의 C (Center) 위치의 샘플은 Cb, Cr 크로마 샘플들에 대응되는 루마 샘플 일수 있고, N (North), E (East), S (South), W (West)는 C위치의 루마 샘플과 인접한 루마 샘플들일 수 있다. 사이드 샘플은 C 샘플의 위치에 따라 참조 샘플 이외의 영역에 대해 한 샘플씩 추가로 필요할 수 있다. 사이드 샘플의 위치에 존재하는 샘플 값이 이용가능하지 않은 경우, 이용가능하지 않은 위치의 샘플 값은 C 샘플 값으로 패딩될 수 있다. 도 15(c)의 P 값은 비선형적 항(nonlinear term)일 수 있다. P 값은 P = ( C*C + midVal ) >> bitDepth 으로 계산될 수 있으며, 10 비트 컨텐츠인 경우 P = ( C*C + 512 ) >> 10 일 수 있다. 도 15(c)에서 B 값은 바이어스 값으로 정수 오프셋 값일 수 있다. B 값은 bitDepth(비트 심도)의 중간 값일 수 있다. 10 비트 컨텐츠일 경우, B 값은 512일 수 있다.
MM-CCCM(multi-model CCCM)은 참조 영역(또는 복원된 현재 휘도 블록)의 평균값에 기초하여 2개의 CCCM 파라미터를 유도하는 방법이다.
GL-CCCM(Gradient and location based convolutional cross-component model)은 그래디언트(Gradient) 와 위치(location) 정보를 이용한 추가적인 CCCM 모드이다. 기존의 CCCM 모드의 경우, 비디오 신호 처리 장치는 예측할 색차 샘플 위치에서 대응되는 위치에 있는 휘도 샘플과 그 휘도 샘플 주변의 4개 샘플 그리고 계수 정보를 사용하여 현재 블록에 대한 색차 샘플을 유도할 수 있다. 이때, GL-CCCM 모드의 경우, 비디오 신호 처리 장치는 예측할 색차 샘플 위치에서 대응되는 위치에 있는 휘도 샘플과 그 휘도 샘플 주변의 8개 샘플들에 대한 수직, 수평 차이를 반영하고, 또한 현재 휘도 샘플의 위치 값과 그것의 계수 정보를 사용하여 현재 블록에 대한 색차 샘플을 유도할 수 있다.
CCCM 모드가 적용될 때, 비디오 신호 처리 장치는 휘도 블록과 색차 블록 간의 해상도 차이를 맞추기 위해서 다운 샘플링 필터를 적용할 수 있다. 휘도 블록을 색차 블록의 해상도로 낮추기 위함이다. 다운 샘플링 필터를 적용하는 모드는 CCCM-MDF(CCCM with multiple downsampling filters)라 기술될 수 있다.
현재 블록에 인터 부호화 모드가 적용된 경우, 비디오 신호 처리 장치는 현재 블록의 움직임 정보를 사용하여 유도된 휘도 예측 블록(Y')과 현재 블록의 움직임 정보를 사용하여 유도된 제1 색차 예측 블록(Cb', Cr') 간의 선형 및 비선형 모델을 유도한 후(Derive filter), 현재 블록의 휘도 잔차 블록을 이용하여 현재 블록의 복원된 휘도 블록을 생성하고, 상기 유도된 선형 및 비선형 모델을 현재 블록의 복원된 휘도 블록에 적용(Apply filter)하여 현재 블록의 제2 색차 예측 블록을 생성할 수 있다. 이후, 비디오 신호 처리 장치는 선형 및 비선형 모델을 이용하여 예측된 현재 블록의 제2 색차 예측 블록에 색차 잔차 블록을 더하여 최종적으로 현재 블록의 색차 블록(Cb, Cr)을 생성할 수 있다. 이러한 방법은 CCRM(cross-component residual model)이라 기술될 수 있다. CCRM, Inter CCCM, Inter CCP 는 동일한 의미일 수 있다.
코딩 효율을 높이기 위하여 전술한 잔여 신호를 그대로 코딩하는 것이 아니라, 잔여 신호를 변환하여 획득된 변환 계수 값을 양자화하고, 양자화된 변환 계수를 코딩하는 방법이 사용될 수 있다. 전술한 바와 같이, 변환부는 잔여 신호를 변환하여 변환 계수 값을 획득할 수 있다. 이때, 특정 블록의 잔여 신호는 현재 블록의 전 영역에 분산되어 있을 수 있다. 이에 따라, 잔여 신호에 대한 주파수 영역 변환을 통해 저주파 영역에 에너지를 집중시켜 코딩 효율을 향상시킬 수 있다.
인코더는 현재 블록에 대한 잔여 신호를 포함하는 적어도 하나의 잔여 블록을 획득할 수 있다. 잔여 블록은 현재 블록 또는 현재 블록으로부터 분할된 블록들 중 어느 하나일 수 있다. 본 명세서에서, 잔여 블록은 현재 블록의 잔여 샘플들을 포함하는 잔여 어레이(array) 또는 잔여 매트릭스(matrix)로 기술될 수 있다. 또한 본 명세서에서 잔여 블록은 변환 유닛 또는 변환 블록의 크기와 동일한 크기의 블록을 나타낼 수 있다.
인코더는 변환 커널을 사용하여 잔여 블록을 변환할 수 있다. 잔여 블록에 대한 변환에 사용되는 변환 커널은 수직 변환 및 수평 변환의 분리 가능한 특성을 가지는 변환 커널일 수 있다. 이 경우, 잔여 블록에 대한 변환은 수직 변환 및 수평 변환으로 분리되어 수행될 수 있다. 예를 들어, 인코더는 잔여 블록의 수직 방향으로 변환 커널을 적용하여 수직 변환을 수행할 수 있다. 또한, 인코더는 잔여 블록의 수평 방향으로 변환 커널을 적용하여 수평 변환을 수행할 수 있다. 본 명세서에서, 변환 커널은 변환 매트릭스, 변환 어레이, 변환 함수, 변환과 같이 잔여 신호의 변환에 사용되는 파라미터 세트를 지칭하는 용어로 사용될 수 있다. 일 실시예에 따라, 변환 커널은 복수의 사용 가능한 커널들 중 어느 하나일 수 있다. 또한, 수직 변환 및 수평 변환 각각에 대해 서로 다른 변환 타입에 기반한 변환 커널이 사용될 수도 있다. 즉, 1차 변환을 수행하기 전에, 현재 블록의 인트라 예측 모드, 부호화 모드, 비트스트림으로부터 파싱된 변환 방법, 현재 블록의 크기 정보 중에서 적어도 하나 이상을 사용하여 수직 및 수평 방향에 대한 변환 방법이 유도될 수 있다. 또한, 크기가 큰 블록에 대하여 변환 과정에서의 계산 복잡도를 감소시키기 위하여 저주파 영역만을 남기고 고주파 영역은 '0'로 처리하는 과정이 수행될 수 있다. 이러한 과정을 고주파 제로화(zeroing)라고 하며, 이러한 제로화를 위해서 실제 1차 변환 시의 변환 크기가 설정될 수 있다. 고주파 제로화 과정에서 저주파 영역은 임의의 정해진 크기로 설정될 수 있으며, 예를 들어, 가로 또는 세로의 크기는 4, 8, 16, 32 등의 조합이 될 수 있다.
인코더는 잔여 블록으로부터 변환된 변환 블록을 양자화부로 전달하여 양자화할 수 있다. 이때, 변환 블록은 복수의 변환 계수들을 포함할 수 있다. 구체적으로, 변환 블록은 2차원 배열된 복수의 변환 계수들로 구성될 수 있다. 변환 블록의 크기는 잔여 블록과 마찬가지로 현재 블록 또는 현재 블록으로부터 분할된 블록 중 어느 하나와 동일할 수 있다. 양자화부로 전달된 변환 계수들은 양자화된 값으로 표현될 수 있다.
또한, 인코더는 변환 계수가 양자화되기 전에 추가적인 변환을 수행할 수 있다. 전술한 변환 방법은 1차 변환(primary transform)으로 지칭되고, 추가적인 변환은 2차 변환(secondary transform)으로 지칭될 수 있다. 2차 변환은 잔여 블록 별로 선택적일 수 있다. 일 실시예에 따라, 인코더는 1차 변환만으로 저주파 영역에 에너지를 집중시키기 어려운 영역에 대해 2차 변환을 수행하여 코딩 효율을 향상시킬 수 있다. 예를 들어, 잔여 값들이 잔여 블록의 수평 또는 수직 방향 이외의 방향에서 크게 나타나는 블록에 대해 2차 변환이 추가될 수 있다. 인트라 예측된 블록의 잔여 값들은 인터 예측된 블록의 잔여 값들에 비해 수평 또는 수직 방향 이외의 방향으로 변화할 확률이 높을 수 있다. 이에 따라, 인코더는 인트라 예측된 블록의 잔여 신호에 대해 2차 변환을 추가적으로 수행할 수 있다. 또한, 인코더는 인터 예측된 블록의 잔여 신호에 대해 2차 변환을 생략할 수 있다. 2차 변환 과정에서도 1차 변환에서의 고주파 제로화가 수행될 수 있다.
다른 예로, 현재 블록 또는 잔여 블록의 크기에 따라, 2차 변환 수행 여부가 결정될 수 있다. 또한, 현재 블록 또는 잔여 블록의 크기에 따라 크기가 서로 다른 변환 커널이 사용될 수 있다. 예를 들어, 너비 또는 높이 중 짧은 변의 길이가 제1 기 설정된 길이 보다 크거나 같은 블록에 대해서는 8X8 2차 변환이 적용될 수 있다. 또한, 너비 또는 높이 중 짧은 변의 길이가 제2 기 설정된 길이 보다 크거나 같고, 제1 기 설정된 길이 보다 작은 블록에 대해서는 4X4 2차 변환이 적용될 수 있다. 이때, 제1 기 설정된 길이는 제2 기 설정된 길이 보다 큰 값일 수 있으나, 본 개시가 이에 제한되는 것은 아니다. 또한, 2차 변환은 1차 변환과 달리 수직 변환 및 수평 변환으로 분리되어 수행되지 않을 수 있다. 이러한 2차 변환은 저대역 비-분리 변환(Low Frequency Non-Separable Transform, LFNST)으로 지칭될 수 있다.
또한, 특정 영역의 비디오 신호의 경우, 급격한 밝기 변화로 인해 주파수 변환을 수행하여도 고주파 대역 에너지가 줄어들지 않을 수 있다. 이에 따라, 양자화에 의한 압축 성능이 저하될 수 있다. 또한, 잔여 값이 드물게 존재하는 영역에 대해 변환을 수행하는 경우, 인코딩 시간 및 디코딩 시간이 불필요하게 증가할 수 있다. 이에 따라, 특정 영역의 잔여 신호에 대한 변환은 생략될 수 있다. 특정 영역의 잔여 신호에 대한 변환 수행 여부는 특정 영역의 변환과 관련된 신택스 요소에 의해 결정될 수 있다. 예를 들어, 상기 신택스 요소는 변환 스킵 정보(transform skip information)를 포함할 수 있다. 변환 스킵 정보는 변환 스킵 플래그(transform skip flag)일 수 있다. 잔여 블록에 대한 변환 스킵 정보가 변환 스킵을 나타내는 경우, 해당 잔여 블록에 대한 변환이 수행되지 않는다. 이 경우, 인코더는 해당 영역의 변환이 수행되지 않은 잔여 신호를 곧바로 양자화할 수 있다.
전술한 변환 관련 신택스 요소들은 비디오 신호 비트스트림으로부터 파싱된 정보일 수 있다. 디코더는 비디오 신호 비트스트림을 엔트로피 디코딩하여 변환 관련 신택스 요소들을 획득할 수 있다. 또한, 인코더는 변환 관련 신택스 요소들을 엔트로피 코딩하여 비디오 신호 비트스트림을 생성할 수 있다.
디코더에서는 전송된 비트스트림을 파싱하여 디코딩하는데 필요한 부호화 정보들을 획득할 수 있다. 이 때 변환 과정과 관련된 정보에는 1차 및 2차 변환 타입에 대한 인덱스 정보 및 양자화된 변환 계수 등이 있다. 역변환부는 역양자화된 변환 계수를 역변환하여 잔여 신호를 획득할 수 있다. 먼저, 역변환부는 특정 영역의 변환 관련 신택스 요소로부터 해당 영역에 대한 역변환이 수행되는지 검출할 수 있다. 일 실시예에 따라, 특정 변환 블록에 대한 변환 관련 신택스 요소가 변환 스킵을 나타내는 경우, 해당 변환 블록에 대한 변환이 생략될 수 있다. 이 경우, 변환 블록에 대해 1차 역변환 및 2차 역변환이 모두 생략될 수 있다. 또한, 역양자화된 변환 계수는 잔여 신호로 사용될 수 있다. 예를 들어, 디코더는 역양자화된 변환 계수를 잔여 신호로 사용하여 현재 블록을 복원할 수 있다. 혹은 2차 역변환은 수행되고 1차 역변환은 생략될 수 있으며, 2차 역변환된 값이 잔여 신호로 사용될 수 있다. 전술한 1차 역변환은 1차 변환에 대한 역변환을 나타내며, 역 1차 변환(inverse primary transform)으로 지칭될 수 있다. 2차 역변환은 2차 변환에 대한 역변환을 나타내며, 역 2차 변환(inverse secondary transform) 또는 inverse LFNST로 지칭될 수 있다. 본 발명에서 1차 (역)변환은 제1 (역)변환으로 지칭될 수 있으며, 2차 (역)변환은 제2 (역)변환으로 지칭될 수 있다.
도 16은 본 명세서의 일 실시예에 따른 비디오 코딩에 사용될 수 있는 변환 커널 종류를 나타낸다.
도 16은 MTS에 적용되는 DCT-II, DCT-V (discrete cosine transform type-V), DCT-VIII (discrete cosine transform type-VIII), DST-I (discrete sine transform type-I), DST-VII 커널의 수식을 나타낸 것이다. DCT와 DST는 각각 cosine, sine의 함수로 표현이 가능하며, 샘플 수 N에 대한 변환 커널의 기저 함수를 Ti(j)로 표현할 경우, 인덱스 i는 주파수 도메인에서의 인덱스를 나타내며, 인덱스 j는 기저 함수 내의 인덱스를 나타낸다. 즉, i가 작아질수록 저주파 기저 함수를 나타내며, i가 커질수록 고주파 기저 함수를 나타낸다. 기저 함수 Ti(j)는 2차원 행렬로 표현했을 때, i 번째 행의 j 번째 요소를 나타낼 수 있으며, 도 16에 도시한 변환 커널은 모두 분리 가능한 특성을 가지고 있으므로, 잔차 신호 X에 대하여 가로 방향과 세로 방향에 각각 변환을 수행할 수 있다. 즉, 잔차 신호 블록을 X라 하고, 변환 커널 행렬을 T라 했을 때, 잔차 신호 X에 대한 변환은 TXT'으로 나타낼 수 있다. 이때, T'는 변환 커널 행렬 T의 전치행렬 (transpose)를 의미한다. DCT와 DST는 정수가 아닌 소수 형태이므로, 이를 그대로 하드웨어 부호화기, 복호화기에 구현하기에는 부담이 따른다. 따라서 소수 형태의 변환 커널에 scaling과 rounding을 통해 정수 형태의 변환 커널로 근사화시켜야 한다. 변환 커널의 정수 정밀도는 8-bit 또는 10-bit로 결정될 수 있으나, 정밀도가 떨어질 경우, 부호화 효율이 감소할 수 있다. 근사화에 따라 DCT와 DST의 정규 직교 (orthonormal) 성질은 유지되지 않을 수 있으나, 이에 따른 부호화 효율 손실이 크지 않으므로, 변환 커널을 정수 형태로 근사화 시키는 것이 하드웨어 부호화기, 복호화기 구현 측면에서 유리하다. IDTR(Identity Transform)은 변환의 결과가 변환 전의 자기 자신이 나오는 변환으로, 항등변환이라고 한다. 일반적으로 항등변환은 행과 열이 동일한 값을 가지는 위치에 '1'을 설정하여 변환 매트릭스를 구성한다. 하지만, 여기서 항등변환은 '1'값이 아닌 임의의 고정된 값을 사용하여, 입력된 잔차 신호의 값을 동일하게 높이거나 줄이는데 사용한다.
상술한 1차 변환인 MTS 변환에서 변환은 오차 블록의 수직 방향과 수평 방향에 대해 각각 변환 커널이 적용되어 계산되므로, 분리가능한 변환(separable transform) 방식이라고 할 수 있다. 반면에 상술한 2차 변환인 LFNST 변환에서 변환은 수직 방향과 수평 방향에 대해 각각 변환 커널을 적용되지 않고 변환 커널은 한번만 적용되어 계산되므로, 비분리 변환(non-separable transform) 방식이라고 할 수 있다. 또한, 상술한 2차 변환은 DCT-2 변환이 적용된 블록의 1차 변환된 변환 계수에 대해 추가로 적용되는 것이므로, 2단계 변환 기법이라고 할 수 있다. 상술한 2차 변환은 부호화 효율은 높지만 총 3번의 변환 커널이 적용되므로, 복잡하다는 단점이 있다. 이러한 복잡도를 줄이기 위해서, 2차 변환 방식만으로 변환을 적용하는 방식인 NSPT(Non-separable primary transform) 방식이 적용될 수 있다. NSPT 변환 방식은 비분리 변환 방식으로, 오차 블록의 수직 방향과 수평 방향에 대해 각각 변환 커널을 적용하지 않고 변환 커널을 한번만 적용하여 계산된다. 비디오 신호 처리 장치에서 현재 블록의 오차 블록은 MTS, DCT2 + LFNST, NSPT 변환 방식 중에서 하나의 변환 방식을 사용하여 변환 또는 역변환이 수행될 수 있다.
NSPT 변환은 기존의 DCT2 + LFNST 변환 방법을 대체하는 변환 방식일 수 있다. 변환 블록의 크기가 16x16보다 같거나 작은 블록에 대하여, 변환 블록의 크기에 따라 NSPT4x4(16x16 kernel), NSPT4x8(32x20 kernel), NSPT8x4(32x20 kernel), NSPT8x8(64x32 kernel), NSPT4x16(64x24 kernel), NSPT16x4(64x24 kernel), NSPT8x16(128x40 kernel), NSPT16x8(128x40 kernel), NSPT4x32(128x20 kernel), NSPT32x4(128x20 kernel), NSPT8x32(256x24 kernel), NSPT32x8(256x24 kernel) 중 어느 하나의 커널이 적용될 수 있다. NSPT는 LFNST와 유사하게 35 개의 변환 커널 세트로 구성되고, 각 세트당 3개의 후보로 구성될 수 있다. 인코더는 인트라 예측 모드에 따라 변환 커널 세트를 유도한 후, 3개의 후보 중에서 최적의 후보에 대한 인덱스에 대한 정보를 포함하는 비트스트림을 생성하고 시그널링할 수 있다. 디코더는 시그널링된 인덱스에 대한 정보를 파싱한 후, 인트라 예측 모드를 사용하여 유도된 변환 커널 세트 중에서 인덱스 정보가 지시하는 변환 커널 후보를 사용하여 현재 변환 계수를 역변환하고, 잔차 블록을 획득할 수 있다. NSPT가 적용된 4x4 블록에는 제로-아웃이 수행되지 않을 수 있다. 또한, NSPT의 커널의 크기에 따라 제로-아웃되는 계수의 개수가 달라질 수 있다. 예를 들어, 4x8 블록 또는 8x4 블록에는 32x20 크기의 NSPT가 적용될 수 있다. 따라서, 32개 변환 계수 중 20개 변환 계수만를 제외한 나머지 12개 변환 계수는 제로-아웃될 수 있다.
도 17은 본 명세서의 일 실시예에 따른 LFNST 및 NSPT 변환에 대한 변환 세트 테이블을 나타낸다.
LFNST 및 NSPT 변환에서 사용되는 변환 세트는 35가지가 존재할 수 있으며, 인트라 예측 모드(도 6 참고)에 따라 달라질 수 있다. 즉, 비디오 신호 처리 장치는 도 17의 변환 세트 테이블을 참고하여, 인트라 예측 모드(도 6 참고)에 대응되는 LFNST 및 NSPT 변환의 변환 세트 인덱스를 유도할 수 있다. 또한, LFNST 및 NSPT 변환 세트는 인트라 예측 모드, 현재 블록이 휘도 블록인지 혹은 색차 블록인지 여부 정보, 현재 블록의 가로 및 세로의 크기, 현재 블록의 인트라 예측 방향성 모드가 확장 각도 모드인지 여부에 따라 달라질 수 있다. 하나의 변환 세트마다 임의의 개수만큼의 변환 매트릭스가 존재할 수 있다. 여기서, 임의의 개수는 1이상의 정수일 수 있으며, 3일 수 있다. 인코더에서는 변환 세트 내의 여러 개의 변환 매트릭스 중에서 최적의 변환 매트릭스에 대한 인덱스 정보를 비트스트림에 포함시켜서 시그널링할 수 있다. 디코더에서는 최적의 변환 매트릭스에 대한 인덱스를 파싱한 후, 변환 세트에서 인덱스에 대응되는 변환 매트릭스를 사용하여 역변환을 적용할 수 있다.
인코더 및 디코더는 변환 블록의 크기에 따라 LFNST4, LFNST8, LFNST16까지 총 3가지 종류의 변환 커널을 적용할 수 있다. 만일, 현재 변환 블록의 가로 및 세로의 크기가 16보다 크거나 같다면, 인코더 및 디코더는 LFNST16 변환 커널을 적용할 수 있다. 현재 변환 블록의 가로 및 세로의 크기가 8보다 크거나 같다면, 인코더 및 디코더는 LFNST8 변환 커널을 적용할 수 있다. 현재 변환 블록의 가로 및 세로의 크기가 8보다 작다면, 인코더 및 디코더는 LFNST4 변환 커널을 적용할 수 있다.
도 18은 LFNST 변환 후 ROI의 실시 예를 나타낸다.
인코더와 디코더가 잔차 블록을 LFNST 변환한 후 출력된 저주파 부분인 도 18의 회색 블록 영역을 ROI(Region of Interest)라 지칭한다. 미리 지정된 ROI 이외의 영역은 0으로 설정되는 제로-아웃(zero-out) 처리될 수 있다. LFNST16의 경우, 96개 샘플만 필요하다. 따라서 도 18의 (a)와 같이 6개의 NxN 서브 블록을 제외한 나머지 흰색 서브 블록은 제로-아웃 처리될 수 있다. LFNST8의 경우, 64개 샘플만 필요하다. 따라서 도 18의 (b)와 같이 4개의 NxN 서브 블록을 제외하고 나머지 흰색 서브 블록은 제로-아웃 처리될 수 있다. LFNST4의 경우, 제로-아웃되는 영역이 존재하지 않을 수 있다. 이때, N은 양의 정수이며, 4일 수 있다.
도 19는 본 명세서의 일 실시예에 따른 다중 변환 세트 및 LFNST/NSPT 세트를 유도하는 방법을 나타낸다.
도 19(a)를 참조하면 인코더는 잔차 블록(residual block)에 대하여 MTS, DCT2 + LFNST, NSPT 중에서 어느 하나를 적용할지 선택할 수 있으며, 선택된 변환 방법에 기초하여 잔차 블록을 변환하고 변환 계수를 획득할 수 있다. 이때, 인코더는 어떠한 변환 방법을 적용하였는지에 대한 정보를 비트스트림에 포함하여 시그널링할 수 있다. 잔차 블록에 MTS 변환이 적용된 경우, MTS 변환이 적용되어 잔차 블록의 변환 계수가 획득될 수 있고, LFNST와 NSPT 변환은 적용되지 않을 수 있다. 잔차 블록에 DCT2 + LFNST 변환이 적용된 경우, 인코더는 잔차 블록에 대하여 DCT2 변환을 적용하여 1차 변환 계수를 획득할 수 있으며, 1차 변환 계수에 대하여 LFNST 변환을 적용하여 2차 변환 계수를 획득할 수 있다. 이때, MTS와 NSPT 변환은 적용되지 않을 수 있다. 잔차 블록에 NSPT 변환이 적용된 경우, 비디오 인코더는 잔차 블록에 대하여 NSPT 변환을 적용하여 변환 계수를 출력할 수 있고, 이때, 잔차 블록에 대해 MTS와 DCT2 + LFNST 변환은 적용되지 않을 수 있다.
도 19(b)를 참조하면 디코더는 비트스트림으로부터 어떠한 변환 방법이 적용되었는지에 대한 정보를 파싱하고, 파싱된 정보에 기초하여 현재 변환 계수에 대하여 MTS, DCT2 + LFNST, NSPT 중에서 어느 하나의 역변환 방법을 적용되는지 여부를 결정할 수 있다. 그리고, 디코더는 결정된 변환 방법에 기초하여 변환 계수에 대해 역변환을 수행하고, 잔차 블록을 획득할 수 있다. 현재 변환 계수에 MTS 변환이 적용된 경우, 디코더는 변환 계수에 대하여 MTS 역변환을 수행하여 잔차 블록을 획득할 수 있고, 이때, LFNST와 NSPT 역변환은 적용되지 않을 수 있다. 2차 변환 계수에 DCT2 + LFNST 변환이 적용된 경우, 디코더는 2차 변환 계수에 대하여 LFNST 역변환을 수행하여 1차 변환 계수를 출력할 수 있으며, 1차 변환 계수에 대하여 DCT2 역변환을 수행하여 잔차 블록을 획득할 수 있고, 이때, MTS와 NSPT 변환은 적용되지 않을 수 있다. 현재 변환 계수에 NSPT 변환이 적용된 경우, 디코더는 현재 변환 계수에 대하여 NSPT 역변환을 수행하여 잔차 블록을 획득할수 있고, 이때 MTS와 DCT2 + LFNST 변환은 적용되지 않을 수 있다.
비디오 신호 처리 장치는 인트라 예측 모드를 이용하여 MTS, LFNST, NSPT 변환(또는 역변환) 각각에 대한 변환 커널을 유도할 수 있다. 또한, 비디오 신호 처리 장치는 MTS, DCT2 + LFNST, NSPT 중에서 어떤 변환(또는 역변환)이 적용되는지 여부를 결정할 수 있대, 이때, 변환을 결정하기 위해 현재 블록의 가로 및 세로 크기, 현재 블록의 성분이 휘도 성분인지 혹은 색차 성분인지, 현재 블록이 싱글 트리인지 듀얼 트리인지 여부, 현재 블록이 인트라 모드인지 인터 모드로 부호화되었는지 정보, 현재 블록의 부호화 모드(예, IBC, Intra TMP, Merge, AMVP, GPM, SGPM, CCLM, CCCM) 정보, 현재 블록의 양자화 파라미터 정보 중에서 적어도 하나 이상이 사용될 수 있다.
도 20은 본 명세서의 일 실시예에 따른 매핑 테이블을 나타낸다.
도 21은 본 명세서의 일 실시예에 따른 변환 타입 세트 테이블을 나타낸다.
도 22는 본 명세서의 일 실시예에 따른 변환 타입 조합 테이블을 나타낸다.
도 23은 본 명세서의 일 실시예에 따른 IDT 변환 타입에 대한 임계 값 테이블을 나타낸다.
비디오 신호 처리 장치에서 현재 블록에 사용 가능한 다중 변환 세트를 선택하는 방법에 대해 설명한다.
1) 먼저, 비디오 신호 처리 장치는 현재 블록의 가로 및 세로 크기를 하나의 변수로 매핑하기 위해, 현재 블록의 크기를 기반으로 nSzIdxW와 nSzIdxH 값을 유도할 수 있다. nSzIdxW은 현재 블록의 너비에 2의 로그(Log) 값을 계산한 후, 소수점 자리를 버리고 2를 차분한 값과 3 중 최소 값일 수 있다. nSzIdxH는 현재 블록의 높이에 2의 로그(Log) 값을 계산한 후, 소수점 자리를 버리고 2를 차분한 값과 3 중 최소 값일 수 있다.
2) 다음으로, 비디오 신호 처리 장치는 현재 블록의 인트라 방향성 모드(predMode)를 유도할 수 있다. TIMD 모드인 경우에는 기존 67개에서 131개로 확장된 인트라 예측 모드가 사용될 수 있어, 기존 67개 모드로 정밀도(precision)를 감소시킨다.
3) 다음으로, 비디오 신호 처리 장치는 ucMode, nMdIdx, isTrTransposed 값을 유도할 수 있다.
A. 현재 블록이 MIP 모드로 부호화되었을 경우, ucMode는 '0', nMdIdx은 '35', isTrTransposed는 MIP에서 유도된 값으로 설정될 수 있다.
B. 현재 블록이 MIP 모드로 부호화되지 않았다면, ucMode는 현재 블록의 인트라 방향성 모드(predMode)로 설정될 수 있다. predMode는 인트라 방향성 모드의 인덱스 값을 의미할 수 있다. 현재 블록의 가로 세로 크기 비율에 따라 확장 각도 모드를 통해 predMode는 결정될 수 있다. 비디오 신호 처리 장치는 predMode를 2에서 66사이의 값으로 클리핑(clipping)할 수 있다. predMode가 대각 모드인 34번 각도 모드 보다 큰 경우, isTrTransposed 값은 1로 설정될 수 있고, predMode가 34보다 같거나 작은 경우 isTrTransposed 값은 0으로 설정될 수 있다. predMode가 34보다 큰 경우, 비디오 신호 처리 장치는 67(인트라 방향성 모드 인덱스의 최대 값)에서 1을 더한 값에서 predMode의 값을 차분한 값으로 predMode의 값을 재설정한다. 예를 들어, predMode가 35라면, 비디오 신호 처리 장치는 35번 각도 모드를 33(67+1-35(predMode))번 각도 모드로 재설정할 수 있다. predMode가 66이라면, 비디오 신호 처리 장치는 66번 각도 모드를 2(67+1-66(predMode))번 각도 모드로 재설정할 수 있다 즉, 대각 모드인 34번 각도 모드를 기준으로 대칭이 되도록 함으로써, 도 35의 변환 매핑 테이블의 크기를 절반 정도로 줄이는 효과가 있다.
4) 비디오 신호 처리 장치는 nSzIdxW와 nSzIdxH, isTrTransposed 값을 통해, nSzIdx값을 유도할 수 있다. isTrTransposed 값이 '1'이면, nSzIdxH에 4를 곱한 후, nSzIdxW를 더한 값이 nSzIdx로 설정될 수 있다. isTrTransposed 값이 '0'이면, nSzIdxW에 4를 곱한 후, nSzIdxH를 더한 값이 nSzIdx로 설정될 수 있다.
5) 비디오 신호 처리 장치는 현재 블록의 크기 정보인 nSzIdx와 현재 블록의 인트라 방향성 모드 정보인 nMdIdx를 이용하여 도 20의 미리 정의된 테이블에 따라 사용 가능한 변환 타입 세트의 인덱스인 nTrSet을 유도할 수 있다. 도 20은 현재 블록의 화면 내 방향성 모드(0 내지 34 및 MIP)와 현재 블록의 크기 인덱스(0 내지 15)에 따른 변환 타입 세트의 인덱스를 정의한다. 도 20을 참조하면 nTrSet은 80가지가 될 수 있으며, 현재 블록의 크기가 4x8이고, 현재 블록의 화면 내 방향성 모드가 13이라면, nTrSet은 '7'이 될 수 있다.
6) 비디오 신호 처리 장치는 비트스트림에 포함된 mts_idx를 파싱하여 nTrSet에 대응되는 변환 타입 세트를 도 21의 테이블로부터 유도할 수 있다. 수직 및 수평 방향의 변환 타입은 predMode 가 대각 모드인 34번 각도 모드보다 큰 값인지 여부에 따라 다르게 설정된다. 도 21의 세로 열의 0 내지 79는 nTrSet에 대응되고, 가로 열의 0 내지 3은 mts_idx에 대응될 수 있다. 도 21을 참조하면 nTrSet가 7이고, mts_idx의 값이 3이라면, (2, 17, 18, 22) 중에서 22가 선택될 수 있다. 그리고, 도 22의 변환 타입 조합 테이블의 인덱스 22에 대응되는 DST1, DCT5가 선택되며, 현재 블록의 수직 방향 변환 타입은 DST1로 수평 방향 변환 타입은 DCT5로 설정될 수 있다. 도 22의 가로 열의 0 내지 24는 도 21을 통해 선택되는 인덱스이고, 세로 열의 0 내지 1은 각각 수직 방향 변환 타입과 수평 방향 변환 타입을 의미할 수 있다. 현재 블록의 화면 내 예측 방향성 모드가 대각 모드인 34보다 클 경우, 수직 및 수평 방향의 변환 타입이 서로 교체될 수 있다.
mts_idx 값이 '3'이고, 현재 블록의 가로 및 세로의 크기가 모두 16 이하이면, 후술하는 과정을 통해 수직 또는 수평 방향의 변환 타입이 IDT 변환 타입으로 재설정될 수 있다.
현재 블록의 화면 내 예측 방향성 모드의 인덱스와 수평 방향 모드의 인덱스인 18 간의 절대값 차이가 임의의 정해진 값보다 적다면, 수직 방향의 변환 타입은 IDT 변환 타입으로 재설정될 수 있다. 현재 블록의 화면 내 예측 방향성 모드의 인덱스와 수평 방향 모드의 인덱스인 50 간의 절대값 차이가 임의의 정해진 값보다 적다면, 수평 방향의 변환 타입은 IDT 변환 타입으로 재설정될 수 있다. 이때, 임의의 정해진 값은 정수로, 현재 블록의 가로 또는 세로의 크기에 기초하여 결정될 수 있다. 예를 들어, 임의의 정해진 값은 도 20의 테이블을 통해 결정될 수 있다. 도 23의 (a)의 테이블은 가로 또는 세로의 크기가 4씩 차이가 날때마다 임계 값이 다르게 설정된 경우를 나타내고, 도 23의 (b)의 테이블은 가로 또는 세로의 크기가 2배씩 차이가 날 때마다 임계 값이 다르게 설정된 경우를 나타낸다. 현재 블록의 크기가 16x16 크기인 경우, 비디오 신호 처리 장치는 수직 방향의 변환 타입은 IDT 변환 타입으로 재설정하지 않고, 기존의 변환 타입을 그대로 유지할 수 있다.
인코더 및 디코더는 변환 타입 세트의 개수를 블록마다 적응적으로 변경함으로써, mts_idx를 부호화하기 위한 비트량을 감소시킬 수 있다. 인코더 및 디코더는 변환 타입 세트의 개수를 현재 변환 블록의 변환 계수들의 절대값의 합에 따라 1개, 4개, 및 6개 중 어느 하나로 결정할 수 있다. 변환 타입 세트의 개수가 달라지게 되면, mts_idx를 시그널링하기 위한 최대 bin의 개수가 달라질 수 있다. 변환 계수의 절대 값의 합이 6보다 작거나 같으면, 변환 타입 세트의 개수가 하나이다. 따라서 인코더는 mts_idx를 시그널링하지 않을 수 있다. 이때, 디코더는 mts_idx를 파싱하지 않을 수 있다. 변환 계수들의 절대 값의 합이 6보다 크고 32보다 작거나 같으면, 변환 타입 세트의 개수는 4개일 수 있다. 변환 계수들의 절대값의 합이 32보다 크면 변환 커널 후보의 개수는 6개일 수 있다. 이때, 인코더는 변환 타입 세트의 최대 개수를 기초하여 mts_idx를 시그널링할 수 있다. 또한, 디코더는 변환 타입 세트의 최대 개수를 기초로 mts_idx를 파싱할 수 있다.
현재 블록이 인터 부호화 모드로 예측되는 경우, 인코더 및 디코더는 {(DST7, DST7), (DST7, DCT8), (DCT8, DST7), (DCT8, DCT8)}와 같이 4가지 조합 중에서 하나의 변환 커널 세트를 사용할 수 있다. 인코더는 어떠한 변환 커널 세트를 사용했는지에 대한 인덱스를 시그널링할 수 있다. 디코더는 해당 인덱스를 파싱하여 현재 변환 블록에 사용할 변환 커널 세트를 결정할 수 있다. 설정된 변환 커널 세트가 (DST7, DCT8)인 경우, 인코더 및 디코더는 수평 방향으로는 DST7을 사용하여 현재 블록을 변환 혹은 역변환하고, 수직 방향으로는 DCT8을 사용하여 현재 블록을 변환 혹은 역변환한다. 복잡도 최적화를 위해, 인코더 및 디코더는 1920x1080 해상도보다 큰 영상에 대해 Inter MTS가 적용될 수 있는 최대 CU 크기를 32x32로 설정할 수 있다. 인코더 및 디코더는 1920x1080 이외의 해상보다 작은 영상에 대해 Inter MTS가 적용될 수 있는 최대 CU 크기를 16x16으로 설정한다. 따라서 인코더 및 디코더는 16x16 보다 큰 변환 블록, 예컨대 32x32 크기의 변환 블록에 Inter MTS를 적용하지 않고 수평 및 수직 방향으로 DCT2 변환을 적용할 수 있다 또한, 인코더 및 디코더는 16x16 크기보다 같거나 작은 변환 블록의 변환 및 역변환에서 DST7과 DCT8 대신 separable KLT를 사용할 수 있다.
도 24는 본 명세서의 일 실시예에 따른 디블록킹 필터링 과정에서의 블록 경계 및 경계 주변의 샘플들을 나타낸다.
도 24의 (a)를 참조하면 P 블록과 Q 블록 중간의 점선으로 표시된 부분이 블록 경계를 의미할 수 있다. 블록 경계는 임의의 정해진 크기마다 존재할 수 있으며, 4의 크기마다 블록 경계가 존재할 수 있다.
도 24의 (b)는 블록 경계를 기준으로 필터링이 수행되는 샘플들을 나타낸다. 비디오 신호 처리 장치는 현재 복원된 블록에 대하여 디블록킹 필터링을 수행하여 블록 경계에서 발생하는 블록킹 현상을 완화시키는 과정을 수행할 수 있다. 디블록킹 필터링 과정은 변환 블록 경계에 대한 결정, 서브 블록 경계에 대한 결정, 필터링을 수행할 필터의 길이에 대한 결정, 필터링의 세기(bS)에 대한 결정, 필터링 파라미터에 대한 결정, 필터링 수행 여부 결정, 필터링의 종류에 대한 결정 과정을 포함할 수 있다.
독립 스칼라 양자화(independent scalar quantization)에서, 입력된 계수 tk에 대한 복원된 계수 t'k는 관련된 양자화 인덱스(quantization index) qk에만 의존적이다. 즉, 임의의 복원된 계수에 대한 양자화 인덱스(quantization index)는 다른 복원된 계수들에 대한 양자화 인덱스들과는 다른 값을 가진다. 이때 t'k는 tk에서 양자화 오차가 포함된 값일 수 있으며, 양자화 파라미터에 따라 서로 다르거나 또는 같을 수 있다. 여기서, t'k는 복원된 변환 계수 또는 역양자화된 변환계수라고 명명할 수 있으며, 양자화 인덱스를 양자화된 변환 계수라고 명명할 수도 있다.
균일 복원 양자화(URQ; Uniform Reconstruction Quantizers)에서, 복원된 계수들은 동일한 간격으로 배치되는 특성을 지닌다. 이때 인접하는 두 복원 값들 사이의 거리를 양자화 단계 크기(quantization step size)라고 할 수 있다. 복원된 값 중에는 0을 포함할 수 있으며, 사용 가능한 복원 값들의 전체 집합(set)은 양자화 단계 크기에 따라 고유하게 정의될 수 있다. 양자화 단계 크기는 양자화 파라미터에 따라 달라질 수 있다.
기존 방법에서는 양자화로 인해 허용 가능한 복원된 변환 계수들의 집합(세트)이 감소하며, 이러한 집합의 원소(element)는 유한 개일 수 있다. 이로 인해, 원본 영상과 복원된 영상 간의 평균적인 오차를 최소화하는데 한계가 존재한다. 이러한 평균적인 오차를 최소화하기 위한 방법으로 벡터 양자화(Vector Quantization)를 사용할 수 있다.
비디오 부호화에서 사용되는 간단한 형태의 벡터 양자화 방법에는 부호 데이터 은닉(sign data hiding)이 있다. 이는 인코더에서 0이 아닌 하나의 계수에 대한 부호를 부호화하지 않고, 디코더에서는 해당 계수에 대한 부호를 모든 계수들에 대한 절대값의 합이 짝수인지 또는 홀수인지에 따라 결정하는 방법이다. 이를 위해 인코더에서는 적어도 하나의 계수가 '1'이 증가되거나 또는 감소될 수 있으며, 이는 율-왜곡(rate-distortion)에 대한 비용(Cost) 관점에서 최적이 되도록 적어도 하나의 계수가 선택되어 값이 조정될 수 있다. 실시 일 예로, 양자화 간격의 경계에 가까운 값을 가지는 계수가 선택될 수 있다.
또 다른 벡터 양자화 방법에는 트렐리스 부호화된 양자화(Trellis-Coded Quantization)가 있으며, 비디오 부호화에서는 종속 양자화(dependent quantization)에서 최적화된 양자화 값을 얻기 위한 최적의 경로 탐색 기법으로 활용된다. 블록 단위로, 블록 내 모든 계수들에 대한 양자화 후보들을 트렐리스 그래프에 배치하고, 최적화된 양자화 후보들 간의 최적의 트렐리스 경로를 율-왜곡(rate---ortion)에 대한 비용(Cost)을 고려하여 탐색한다. 구체적으로, 비디오 부호화에 적용된 종속 양자화는 변환 계수에 대한 허용 가능한 복원된 변환 계수들의 집합이 복원 순서에서 현재 변환 계수에 선행하는 변환 계수의 값에 의존하도록 설계될 수 있다. 이때, 여러 개의 양자화기를 변환 계수에 따라 선택적으로 사용하게 함으로써, 원본 영상과 복원된 영상 간의 평균적인 오차를 최소화하여 부호화 효율을 높이는 효과가 있다.
도 25는 본 발명의 일 실시예에 따른 DIMD를 이용하여 예측 블록을 생성하는 과정을 나타낸 도면이다.
도 25를 참조하면 디코더는 주변 샘플(블록, 픽셀)을 이용하여 예측 블록을 유도할 수 있다. 이때, 주변 샘플은 현재 블록의 주변 블록(픽셀)일 수 있다. 구체적으로, 디코더는 주변 샘플을 입력으로 하여 방향성 정보(각도 정보)에 대한 히스토그램을 통해 현재 블록의 복원을 위한 인트라 예측 모드들 및 가중치 정보를 결정할 수 있다.
도 26은 본 발명의 일 실시예에 따른 방향성 정보를 유도하기 위해 사용되는 주변 픽셀의 위치를 나타낸 도면이다.
도 26의 (a)는 방향성 정보를 유도하기 위해 현재 블록의 주변 블록이 모두 사용 가능할 때를 나타내고, 도 26의 (b)는 현재 블록의 상측 경계가 서브 픽쳐(Sub-picture), 슬라이스(Slice), 타일(tile), CTU 경계일 때를 나타내고, 도 26의 (c)는 현재 블록의 좌측 경계가 서브 픽쳐(Sub-picture), 슬라이스(Slice), 타일(tile), CTU 경계일 때를 나타낸다. 한편 주변 블록과 현재 블록이 동일한 서브 픽쳐(Sub-picture), 슬라이스(Slice), 타일(tile), CTU에 속해 있지 않다면, 주변 블록은 방향성 정보를 유도하는데 사용되지 않을 수 있다. 도 26의 회색 점은 실제 방향성 정보를 유도하기 위해 사용되는 픽셀의 위치를 나타내고, 점선은 서브 픽쳐(Sub-picture), 슬라이스(Slice), 타일(tile), CTU 경계를 나타낸다. 또한, 도 26의 (d) 내지 (f)를 참조하면 방향성 정보를 유도하기 위해서, 경계에 위치한 픽셀은 경계 밖으로 한 픽셀씩 패딩(padding)될 수 있다. 이러한 패딩을 통해 보다 더 정확한 방향성 정보의 유도가 가능할 수 있다.
특정 위치의 픽셀에 대한 방향성 정보를 유도하기 위해, 수학식 1의 3x3 크기의 소벨(Sobel) 필터가 가로 및 세로 방향으로 각각 적용될 수 있다. 수학식 1의 A는 3x3 크기의 현재 블록의 복원된 주변 블록들의 픽셀 정보(값)을 의미할 수 있다. 그리고 방향성 정보(θ)는 수학식 2를 이용하여 결정될 수 있다. 방향성 정보 유도를 위한 계산 복잡도를 감소시키기 위해, 디코더는 수학식 2의 atan 함수를 계산하지 않고 수학식 1의 Gy/Gx에 대한 계산만으로 방향성 정보(θ)를 유도할 수 있다.
도 26을 참조하면 방향성 정보는 도 26에 표시된 모든 회색 점마다 계산될 수 있고, 방향성 정보는 인트라 예측 모드의 각도에 매핑될 수 있다. 인트라 예측 모드 세트는 평면(Planar) 모드, DC 모드 및 복수의(예, 65개의) 각도 모드들(즉, 방향성 모드들)을 포함할 수 있다. 인트라 예측 모드는 67가지의 모드들일 수 있는데, 수학식 2를 통해 계산된 방향성 정보(각도, θ)는 실수 단위의 값일 수 있다. 따라서, 방향성 정보를 특정 인트라 예측 방향성 모드에 매핑하는 과정이 필요하다. 본 명세서에서 기술하는 방향성 모드는 각도 모드와 동일할 수 있다.
도 27은 본 발명의 일 실시예에 따른 방향성 모드를 매핑하는 방법을 나타낸 도면이다.
도 27을 참조하면 인트라 예측 방향성 모드는 0도(인덱스 18), 45도(인덱스 34), 90도(인덱스 50), 135도(인덱스 66)를 기준으로 4개의 구간으로 나누어질 수 있다(도 6 참조). 도 10을 참조하면 인트라 예측 방향성 모드를 결정하기 위한 구간은 0번 구간부터 3번 구간까지 4개의 구간으로 나누어질 수 있다. 0번 구간은 -45도에서 0도까지이고, 1번 구간은 0도에서 45도까지이고, 2번 구간은 45도에서 90도까지이고, 3번 구간은 90도에서 135도까지일 수 있다. 이때, 각 구간은 16개의 인트라 예측 방향성 모드를 포함할 수 있다. 방향성 모드는 수학식 1을 통해 계산된 Gx, Gy의 부호 및 크기를 비교하여 4개 구간 중 어느 하나의 구간이 결정될 수 있다. 예를 들어, Gx 및 Gy가 양수이고, Gx의 절대값이 Gy의 절대값보다 크다면 1번 구간이 선택될 수 있다. 각 구간에 매핑되는 인트라 예측 방향성 모드는 수학식 2로부터 계산된 방향성 정보(θ)를 통해 결정될 수 있다. 구체적으로, 디코더는 방향성 정보(θ)에 2^16을 곱하여 값을 확장한다. 그리고 디코더는 확장된 값을 미리 정의된 테이블의 수치와 비교하여 확장된 값과 가장 가까운 값을 찾고 가장 가까운 값에 기초하여 인트라 예측 방향성 모드를 결정할 수 있다. 이때 미리 정의된 테이블의 값은 17개 일 수 있다. 구체적으로, 미리 정의된 테이블의 값은 {0, 2048, 4096, 6144, 8192, 12288, 16384, 20480, 24576, 28672, 32768, 36864, 40960, 47104, 53248, 59392, 65536}일 수 있다. 이때, 미리 정의된 테이블 값들 간 차이는 인트라 예측 방향성 모드의 각도 간의 차이에 따라 다르게 설정될 수 있다.
한편, 계산 복잡도를 감소시키기 위해 atan 계산이 수행되지 않고 Gy/Gx만을 사용하여 방향성 각도를 구하는 경우, 미리 정의된 테이블 값들 간 차이는 인트라 예측 방향성 모드의 각도간 거리와 서로 불일치할 수 있다. atan는 입력 값이 증가할수록 기울기가 점점 낮아지는 특성이 있다. 따라서, 상기 정의된 테이블도 인트라 예측 방향성 모드의 각도 간의 차이뿐만 아니라 atan의 비선형 특성을 모두 고려하여 수치가 설정되어야 한다. 예를 들어, 상기 정의된 테이블 값들 간 차이는 점점 낮아지도록 설정될 수 있다. 반대로, 상기 정의된 테이블 값들 간 차이는 점점 높아지도록 설정될 수 있다.
현재 블록의 가로와 세로의 길이가 다르다면, 사용할 수 있는 인트라 예측 방향성 모드가 달라질 수 있다. 즉, 현재 블록의 가로와 세로의 길이가 다르다면, 인트라 예측 방향성 모드를 유도하기 위한 구간이 달라질 수 있다. 다시 말하면 인트라 예측 방향성 모드를 유도하기 위한 구간은 현재 블록의 가로와 세로의 길이에 기초(예를 들어, 가로의 길이와 세로의 길이의 비율 등)하여 변경될 수 있다. 예를 들어, 현재 블록의 가로가 세로보다 긴 경우, 인트라 예측 모드는 67~80까지 재매핑될 수 있으며, 반대 방향의 인트라 예측 모드는 2~15까지 제외될 수 있다. 예를 들어, 현재 블록의 가로의 길이가 세로의 길이보다 n(정수)배 만큼 길다면(예를 들어 2배), 인트라 예측 모드 {3, 4, 5, 6, 7, 8}은 {67, 68, 69, 70, 71, 72}으로 각각 재설정(매핑)될 수 있다. 또한, 현재 블록의 가로의 길이가 세로의 길이보다 길다면, 인트라 예측 모드에 '65'를 더한 값으로 인트라 예측 모드가 재설정될 수 있다. 한편, 현재 블록의 가로의 길이가 세로의 길이보다 짧다면, 인트라 예측 모드에 '67'을 뺀 값으로 인트라 예측 모드가 재설정될 수 있다.
현재 블록의 복원을 위한 인트라 예측 방향성 모드를 유도하기 위해 히스토그램이 사용될 수 있다. 주변 블록들에 대한 방향성 정보를 획득한 결과, 방향성이 존재하는 블록보다 방향성이 존재하지 않는 블록이 많은 경우, 방향성이 존재하지 않는 블록에 대한 예측 모드가 히스토그램상 누적 값이 가장 높을 수 있다. 그러나, 현재 블록의 복원을 위해서는 방향성 모드를 유도하여야 하므로, 히스토그램상 누적 값이 가장 높더라도 방향성이 존재하지 않는 블록에 대한 예측 모드는 제외될 수 있다. 즉, 주변 픽셀 간 변화도가 없거나 방향성이 없는 완만한 영역은 인트라 예측 방향성 모드를 유도하기 위해 사용되지 않을 수 있다. 예를 들어 방향성이 존재하지 않는 블록에 대한 예측 모드는 평면 모드, DC 모드 일 수 있다. 만일 좌측 주변 블록이 평면 모드 또는 DC 모드인 경우, 좌측 주변 블록은 방향성 정보를 유도하는데 사용되지 않을 수 있으며, 상측 주변 블록만을 사용하여 방향성 정보는 유도될 수 있다. 현재 블록의 주변 블록들에 완만한 영역과 방향성이 존재하는 영역이 혼재하는 경우, 디코더는 방향성을 강조하기 위해 수학식 3과 같이 계산된 G 값을 이용하여 히스토그램을 생성할 수 있다. 이때 히스토그램은 발생된 인트라 예측 방향성 모드마다 '1'만큼 더해지는 빈도수 기반이 아닌, 발생된 인트라 예측 방향성 모드마다 상기 계산된 G 값이 더해지는 누적 값일 수 있다.
도 28은 본 발명의 일 실시예에 따른 인트라 예측 방향성 모드를 유도하기 위한 히스토그램을 나타낸 도면이다.
도 28의 X축은 인트라 예측 방향성 모드를 나타내고, Y축은 G 값들의 누적 값을 나타낸다. 디코더는 인트라 예측 방향성 모드들 중에서 G 값들의 누적 값이 가장 큰 인트라 예측 방향성 모드를 선택할 수 있다. 다시 말하면, 디코더는 누적 값에 기초하여 현재 블록에 대한 인트라 예측 방향성 모드를 선택할 수 있다. 도 35를 참조하면 누적 값이 가장 큰 modeA와 두 번째로 큰 modeB가 인트라 예측 방향성 모드로 선택될 수 있다. 디코더는 현재 블록에 대한 예측 블록을 생성하기 위해, modeA로 생성한 예측 블록과 modeB로 생성한 예측 블록, 마지막으로 평면 모드로 생성한 예측 블록들을 가중치 평균하여 최종 예측 블록을 생성할 수 있다. 이때, 각 예측 블록의 가중치는 modeA와 modeB의 누적 값을 이용하여 결정될 수 있다. 예를 들어, 평면 모드로 생성한 예측 블록에 대한 가중치는 전체 가중치의 1/3로 설정될 수 있다. modeA로 생성한 예측 블록에 대한 가중치는 modeA와 modeB의 누적 값을 더한 것에서 modeA 누적 값을 나눈 값에 해당하는 가중치로 설정될 수 있다. modeB로 생성한 예측 블록에 대한 가중치는 전체 가중치에서 modeA 가중치와 전체 가중치의 1/3값을 차분한 값으로 결정될 수 있다. 가중치에 대한 계산을 보다 정확하게 하기 위해 디코더는 modeA로 생성한 예측 블록에 대한 가중치에 임의의 값을 곱하여 가중치의 범위를 확장할 수 있다. modeB로 생성한 예측 블록에 대한 가중치 및 평면 모드로 생성한 예측 블록에 대한 가중치도 동일하게 확장될 수 있다.
도 29는 본 발명의 일 실시예에 따른 인트라 예측 방향성 모드 정보와 가중치를 이용하여 예측 샘플을 생성하는 방법을 나타낸 도면이다.
구체적으로, 도 29는 앞서 설명한 'Intra prediction'과 'weighted prediction' 과정을 나타낸다. 도 29를 참조하면 디코더가 유도한 인트라 예측 방향성 모드가 복수 개인 경우, 디코더는 복수 개의 인트라 예측 방향성 모드 각각의 가중치 정보를 이용하여 그것들의 가중치 정보를 이용한 가중치 예측(weighted prediction)을 수행하여 예측 샘플을 획득할 수 있다. 가중치 정보는 현재 블록의 가로의 길이, 세로의 길이, 양자화 파라미터 정보, 현재 블록이 휘도인지 색차인지 여부에 대한 정보 중 적어도 하나 이상에 기초하여 재설정될 수 있다(Additional information).
현재 블록에 DIMD가 적용되는 경우, 비디오 신호 처리 장치는 다음의 과정을 수행할 수 있다.
1) 비디오 신호 처리 장치는 현재 블록에 인접한 좌측, 상단, 좌상단 위치의 복원된 샘플들에서 각각 방향성을 유도하여 좌측, 상단, 좌상단 히스토그램을 생성할 수 있다. 비디오 신호 처리 장치는 좌측, 상단, 좌상단의 복원된 샘플들 전체의 방향성을 유도하여 전체 히스토그램을 생성할 수 있다. 이때, 비디오 신호 처리 장치는 전체 히스토그램을 사용하여 도수값이 높은 상위 5 개의 방향성를 선정할 수 있다.
2) 비디오 신호 처리 장치는 상위 5 개의 방향성 모드들 각각에 대하여 좌측 샘플에서 빈번하게 유도된 방향성 모드인지 상단 샘플에서 빈번하게 유도된 것인지를 수직, 수평, 대각 특성으로 분류할 수 있다. 비디오 신호 처리 장치는 각 방향성 모드의 전체 히스토그램에서의 도수값, 각 방향성 모드의 좌측, 상단, 좌상단 히스토그램의 도수값 사이의 비교를 통해, 각 방향성 모드를 수직, 수평, 대각 특성으로 분류할 수 있다. 이를 위치별 특성 가중치라 지칭할 수 있다.
3) 비디오 신호 처리 장치는 각 방향성 모드, 방향성 모드에 대한 도수값, 방향성 모드가 어떠한 특성(수직, 수평, 대각)인지 여부 중 적어도 하나 이상을 사용하여 현재 블록에 가중 평균을 적용할지 결정할 수 있다. 상위 2번째의 방향성 모드의 도수값이 0보다 크고, 상위 첫번째와 두번째의 방향성 모드가 각도 모드인 경우(평면 모드 및 DC 모드가 아닌 경우), 비디오 신호 처리 장치는 현재 블록에 가중 평균을 적용할 수 있다. 그렇지 않은 경우, 비디오 신호 처리 장치는 현재 블록에 가중치 평균을 적용하지 않을 수 있다. 상위 첫 번째 모드가 대각 특성이 아니고, 상위 2번째 방향성 모드의 도수값이 '0'이고, 상위 첫 번째 방향성 모드가 각도 모드인 경우, 비디오 신호 처리 장치는 상위 2번째 방향성 모드를 평면 모드로 설정하고 첫 번째 방향성 모드와 2번째 평면 모드로 예측된 블록 사이의 3:1의 가중치를 사용하여 가중 평균을 적용할 수 있다. 비디오 신호 처리 장치는 각 방향성 모드에 대한 가중치는 방향성 모드에 대한 도수값과 도수값의 합을 기초로 설정할 수 있다.
4) 비디오 신호 처리 장치가 각 방향성 모드를 이용하여 예측 블록을 생성한 후, 비디오 신호 처리 장치는 앞서 계산된 가중치를 이용하여 동일한 특성으로 분류된 방향성 모드의 예측 블록 간의 1차 블록 단위 가중치 평균을 수행할 수 있다. 이를 통해 비디오 신호 처리 장치는 수직 특성 예측 블록, 수평 특성 예측 블록, 및 대각 특성 예측 블록을 생성할 수 있다.
5) 비디오 신호 처리 장치는 동일한 특성으로 분류된 방향성 모드에 대한 가중치 사이의 가중치 합을 계산하여, 수직 특성 가중치, 수평 특성 가중치, 및 대각 특성 가중치를 계산할 수 있다. 비디오 신호 처리 장치는 1차 가중 평균된 블록 사이의 2차 샘플 단위 가중 평균을 수행할 수 있다. 이때, 비디오 신호 처리 장치는 2차 샘플 단위 가중 평균의 모드는 현재 블록의 가로 및 세로의 크기 차이, 현재 블록의 크기, 수직 특성 가중치, 수평 특성 가중치, 및 대각 특성 가중치 사이의 비교 중 적어도 하나를 사용하여 결정할 수 있다. 수직 특성 가중치와 수평 특성 가중치가 모두 '0'보다 큰 경우, 2차 샘플 단위 가중치 평균의 모드는 대각 모드로 결정될 수 있다. 수직 특성 가중치가 '0'보다 큰 경우, 비디오 신호 처리 장치는 2차 샘플 단위 가중 평균의 모드를 수직 모드로 결정할 수 있다. 수직 특성 가중치가 '0'보다 크지 않은 경우, 비디오 신호 처리 장치는 2차 샘플 단위 가중치 평균의 모드를 수평 모드로 결정할 수 있다. 2차 샘플 단위 가중치 평균의 모드가 수직 모드인 경우, 비디오 신호 처리 장치는 수직 특성 예측 블록, 대각 특성 예측 블록과 수직 특성 가중치, 및 대각 특성 가중치를 사용하여 샘플 단위 가중 평균을 적용할 수 있다. 이때, 현재 블록의 상단 경계에서 멀어질수록 수직 특성 가중치는 낮아지고, 대각 특성 가중치는 높아질 수 있다. 또는 2차 샘플 단위 가중 평균의 모드가 수평 모드인 경우, 비디오 신호 처리 장치는 수평 특성 예측 블록, 대각 특성 예측 블록과 수평 특성 가중치, 및 대각 특성 가중치를 사용하여 샘플 단위 가중 평균을 적용할 수 있다. 이때, 현재 블록의 좌측 경계에서 멀어질수록 수평 특성 가중치는 낮아지고, 대각 특성 가중치는 높아질 수 있다. 또는 2차 샘플 단위 가중 평균의 모드가 대각 모드인 경우, 비디오 신호 처리 장치는 수평 특성 예측 블록, 수직 특성 예측 블록, 대각 특성 예측 블록과 수평 특성 가중치, 수직 특성 가중치, 및 대각 특성 가중치를 사용하여 샘플 단위 가중 평균을 적용할 수 있다. 이때, 현재 블록의 좌측 경계와 상단 경계에서 멀어질수록 수평 특성 가중치와 수직 특성 가중치는 낮아지고, 대각 특성 가중치는 높아질 수 있다.
도 30 및 도 31은 본 발명의 일 실시예에 따른 현재 블록의 인트라 예측 모드를 유도하기 위해 사용되는 템플릿(template)을 나타낸 도면이다.
도 30을 참조하면, 디코더는 현재 블록의 인트라 예측 모드를 유도하기 위해 현재 블록에 인접한 복원된 임의의 영역(픽셀(들))인 템플릿을 사용할 수 있다. 먼저, 디코더는 템플릿에 인접한 주변 픽셀(reference)을 이용하여 템플릿에 대한 예측 템플릿을 생성할 수 있다. 그리고, 디코더는 이미 복원된 템플릿과 가장 유사한 예측 템플릿에 대한 인트라 예측 모드를 현재 블록의 복원을 위해 사용할 수 있다. 상술한 템플릿을 사용하여 현재 블록의 인트라 예측 모드를 유도하는 방법은 TIMD(Template intra mode derivation)라고 기술될 수 있다. 이때, 인트라 예측 모드는 인덱스 0 내지 67의 모드일 수 있고, 현재 블록의 주변 블록으로부터 유도된 MPM 리스트 내에 있는 인트라 예측 모드만 해당될 수도 있다. 이때, 인트라 예측 모드는 현재 블록의 주변 블록으로부터 유도된 MPM 리스트 내에 있는 인트라 예측 모드와 해당 인트라 예측 모드와 임의의 수만큼 차이가 나는 모드들일 수 있다. 임의의 수는 1, 2, 3, ... 일 수 있다. 또는 템플릿에 대한 인트라 예측 모드에는 방향성 모드만 해당할 수 있고, 비방향성 모드(평면 모드, DC 모드)는 해당하지 않을 수 있다.
이하 TIMD 모드를 이용하여 인트라 예측 방향성 모드를 유도하는 방법에 대해 설명한다.
i) 디코더는 템플릿의 크기를 설정할 수 있다. 템플릿의 가로 또는 세로의 크기(길이)는 4일 수 있고, 현재 블록의 가로 또는 세로의 크기(길이)가 8 이하인 경우, 템플릿의 가로 또는 세로의 크기는 2로 설정될 수 있다. ii) 디코더는 템플릿의 타입을 설정할 수 있다. 템플릿의 타입은 좌측 샘플만 사용하는 타입, 상측 샘플만 사용하는 타입, 좌측, 상측 및 좌상측 샘플을 모두 사용하는 타입으로 구분될 수 있다. 디코더는 주변 블록이 유효한지 또는 주변 블록이 인트라 예측 방향성 모드를 유도하는데 사용될 수 있는지 여부에 따라 템플릿의 타입을 결정할 수 있다. 한편, 주변 블록이 인트라 예측 방향성 모드를 유도하는데 사용될 수 없는 경우, TIMD 모드는 평면 모드로 설정될 수 있고, 가중치 평균은 수행되지 않을 수 있다. iii) 디코더는 현재 블록에 대한 템플릿을 구성할 수 있다. iv) 디코더는, 현재 블록이 방향성을 가지는지 판단하기 위해 현재 블록의 좌측, 상측, 좌상측, 우상측, 좌하측에 위치한 주변 블록들에 대한 인트라 예측 방향성 모드를 유도할 수 있다. v) 현재 블록의 주변 블록들이 모두 방향성을 가지지 않는 경우(예를 들어, 비방향성 모드(DC 모드, 평면 모드, MIP 모드 등)), 디코더는 최소 코스트(Cost)를 가지는 하나의 인트라 예측 방향성 모드를 선택하고, TIMD 모드를 수행하지 않을 수 있다. 이때, 여러 개의 예측 블록을 이용하는 가중치 평균은 수행되지 않을 수 있다. vi) 현재 블록의 주변 블록들 중 방향성을 가지는 블록이 하나 이상 존재한다면, 후술하는 과정이 수행될 수 있다. 후술하는 과정은 MPM 리스트 내에 존재하는 인트라 예측 방향성 모드에 기초하여 수행될 수 있다. 67가지의 인트라 예측 방향성 모드를 모두 확인하는 경우 복잡도가 증가할 수 있기 때문이다. a. 디코더는 MPM 리스트를 구성할 수 있다. b. 다음으로, 디코더는 MPM 리스트 내에 DC 모드, 수평 모드, 수직 모드가 존재하지 않으면 MPM 리스트 내에 추가하여 MPM 리스트를 수정할 수 있다. c. 디코더는 수정된 리스트 내의 모든 인트라 예측 방향성 모드들에 대한 평가를 수행하여 코스트를 비교할 수 있다. 디코더는 가장 작은 코스트를 가지는 제1 모드와 두번째로 작은 코스트를 가지는 제2 모드를 선택할 수 있다. d. 디코더는, 정확도를 높이기 위해 제1 모드의 인트라 예측 방향성 모드 인덱스와 제2 모드의 인트라 예측 방향성 모드의 인덱스보다 1만큼 적거나 큰 인덱스에 대응되는 인트라 예측 방향성 모드에 대한 평가를 추가적으로 수행할 수 있다. 디코더는 추가적인 평가를 수행하고 가장 작은 코스트를 가지는 제3모드와 2번째로 작은 코스트를 가지는 제4 모드를 다시 선택할 수 있다. 한편, 제1 모드와 제3 모드는 서로 동일할 수 있고, 제2 모드와 제4 모드는 동일할 수 있다. e. 디코더는 제3 모드와 제4 모드의 코스트에 기초하여 가중치 평균을 수행할지 여부를 결정할 수 있다. 제3 모드의 코스트와 제4 모드의 코스트 간 차이가 특정 값보다 작다면 디코더는 가중치 평균을 수행할 수 있고, 제3 모드와 제4 모드의 가중치는 제3 모드와 제4 모드의 코스트를 기반으로 결정될 수 있다. 제3 모드의 코스트와 제4 모드의 코스트 간 차이가 특정 값보다 크다면 디코더는 가중치 평균을 수행하지 않고 제3 모드만을 사용하여 예측 블록을 생성할 수 있다. 이때 특정 값은 미리 약속된 값일 수 있다.
템플릿의 크기는 현재 블록의 가로의 길이 또는 세로의 길이에 따라 달라질 수 있다. 예를 들어, 도 30의 (a)와 같이 현재 블록의 가로의 길이보다 긴 상측 템플릿(Above template)이 구성될 수 있다. 이때, 상측 템플릿의 세로 길이는 미리 약속된 길이일 수 있다. 마찬가지로, 현재 블록의 세로의 길이보다 긴 좌측 템플릿(Left template)이 구성될 수 있다. 이때, 좌측 템플릿의 가로 길이는 미리 약속된 길이일 수 있다. 미리 약속된 길이는 1, 2, 3, ... 일 수 있다.
현재 블록이 CTU 경계에 위치해 있는 경우(현재 블록의 상하좌우 중 어느 경계가 CTU의 경계에 포함되는 경우), TIMD 모드를 위해 사용되는 템플릿을 유도/예측하기 위한 참조 픽셀은 변경될 수 있다. 도 31을 참조하면 현재 블록의 상측 경계가 CTU의 경계에 포함되는 경우, 템플릿 구성을 위해 사용되는 현재 블록의 상측에 위치한 참조 라인은 1개일 수 있다. 이는 라인 버퍼(line buffer) 메모리 사용량을 최소화하기 위함이다. 따라서, 디코더는 현재 블록의 상측 템플릿을 구성하지 않고, 현재 블록의 좌측 템플릿만 구성하여 TIMD 모드를 수행할 수 있다. 이때, 좌측 템플릿을 예측하기 위한 참조 픽셀은 현재 블록의 상측 참조 픽셀(above reference)와 좌측 참조 픽셀(left reference)이 사용될 수 있다. 이때, 좌측 템플릿의 높이는 도 31의 (a)와 같이 현재 블록의 높이와 동일할 수 있다. 또한, 도 31의 (b)와 같이 디코더는 현재 블록의 좌측에 이웃하는 블록이 이미 복원이 완료된 블록인지를 확인한 후, 만일 복원이 완료된 블록일 경우, 좌측 템플릿의 높이를 현재 블록의 높이보다 크게 구성할 수 있다.
일반적으로 현재 블록에 대한 예측 샘플의 정확도는 디코더가 현재 블록의 인접한 주변 픽셀을 많이 참조할수록 높아질 수 있다. 반면에, 주변 픽셀을 많이 참조하게 되면 요구되는 메모리가 증가하게 된다. 또한, 현재 블록에 인접한 주변 블록 중 아직 복원되지 않은 블록이 존재할 경우, 해당 영역은 템플릿으로 사용할 수 없다. 이러한 메모리 증가 및 복원되지 않은 영역에 대한 효과적인 처리를 위해, 도 30의 (b)와 같이 상측 템플릿의 길이는 현재 블록의 가로의 길이와 동일하게 좌측 템플릿의 길이는 현재 블록의 세로의 길이와 동일하게 설정될 수 있다.
디코더는 현재 블록에 대한 예측 샘플을 획득하는데 템플릿을 이용하여 유도되는 인트라 예측 모드를 사용할 수 있다. 디코더는 현재 블록에 인접한 주변 픽셀을 이용하여 예측 샘플을 생성할 수 있고, 예측 샘플을 생성하기 위해 어떠한 주변 픽셀을 사용할 것인지 적응적으로 선택할 수 있다. 또한, 디코더는 예측 샘플을 생성하기 위해 다중 참조 라인을 사용할 수 있는데, 이때 다중 참조 라인의 인덱스 정보는 비트스트림에 포함될 수 있다.
엔트로피 코딩을 위해서, TIMD 모드를 위한 다중 참조 라인의 인덱스에 대한 컨텍스트(context)가 새롭게 정의될 수 있다. 컨텍스트 종류의 증가는 메모리 및 컨텍스트 스위칭 복잡도와 관련될 수 있다. 따라서, TIMD 모드에서 사용되는 다중 참조 라인의 인덱스를 코딩 및 디코딩하기 위해 사용되는 컨텍스트는 기존의 다중 참조 라인의 인덱스에 대한 컨텍스트를 재사용한 것일 수 있다.
현재 블록의 잔차 신호에 대한 변환은 2단계로 진행될 수 있다. 1차 변환은 DCT-II, DST-VII, DCT-VIII, DCT5, DST4, DST1, identity transformation (IDT) 등의 변환을 수평 그리고 수직에 각각 적응적으로 적용되는 것일 수 있다. 1차 변환이 완료된 변환 계수에 2차 변환이 추가적으로 적용될 수 있고, 2차 변환은 1차 변환된 변환 계수와 미리 정의된 매트릭스(matrix) 간의 행렬 곱으로 계산될 수 있다. 2차 변환은 저대역 비분리 변환(Low Frequency Non-Separable Transform, LFNST)로 기술될 수 있다. 2차 변환을 위한 매트릭스 변환 세트는 현재 블록의 인트라 예측 모드에 따라 달라질 수 있다. 2차 변환에 사용되는 변환 매트릭스의 계수 정보는 비트스트림에 포함될 수 있다.
DIMD 모드 또는 TIMD 모드가 적용되는 현재 블록에 2차 변환이 적용되는 경우, 2차 변환에 대한 변환 세트는 DIMD 모드 또는 TIMD 모드로 유도된 인트라 예측 모드에 기초하여 결정될 수 있다. 2차 변환에 사용되는 변환 매트릭스의 계수 정보는 비트스트림에 포함될 수 있다. 디코더는 비트스트림에 포함된 계수 정보를 파싱하여 DIMD 모드 또는 TIMD 모드를 위한 2차 변환의 매트릭스 계수 정보를 설정할 수 있다. 이때, TIMD 모드로부터 유도된 2개의 인트라 예측 모드들 중에서 하나가 1차 변환 또는 2차 변환 세트를 선택하는데 사용될 수 있다. 2개의 인트라 예측 방향성 모드 각각의 코스트를 비교하여 가장 작은 코스트를 가지는 인트라 예측 방향성 모드가 1차 변환 또는 2차 변환 세트를 선택하는데 사용될 수 있다. 또한, DIMD로부터 유도된 2개의 인트라 예측 방향성 모드들 중에서 하나가 1차 변환 또는 2차 변환 세트를 선택하는데 사용될 수 있다. 2개의 인트라 예측 모드 각각의 가중치를 비교하여 가장 높은 가중치를 가지는 인트라 예측 방향성 모드가 1차 변환 또는 2차 변환 세트를 선택하는데 사용될 수 있다.
TIMD 모드는 현재 블록의 템플릿을 예측하고, 템플릿으로부터 유도된 인트라 예측 모드를 현재 블록의 예측 블록을 생성하는데 사용하는 모드이므로 복잡도가 높다. 따라서, 디코더가 템플릿 영역에 대한 예측 템플릿을 생성할 때, 기존의 참조 샘플 필터링 과정을 수행하지 않을 수 있다. 또한, 현재 블록에 ISP 모드가 적용되는 경우 또는 현재 블록이 CIIP 모드로 적용되는 경우, TIMD 모드가 적용되지 않을 수 있다. TIMD 모드가 적용된 현재 블록에는 ISP 모드 또는 CIIP 모드가 적용되지 않을 수 있거나 ISP 또는 CIIP와 관련된 신택스가 파싱되지 않을 수 있다. 이때 파싱되지 않는 ISP 또는 CIIP와 관련된 신택스의 값은 미리 지정된 값으로 추론(infer)될 수 있다.
템플릿 예측은 현재 블록에 인접한 좌측 템플릿 영역과 상측 템플릿 영역으로 나누어져 수행될 수 있고, 각 템플릿마다 인트라 예측 모드가 유도될 수 있다. 또한 각 템플릿마다 인트라 예측 모드가 2개 이상 유도될 수 있고, 현재 블록에 대한 인트라 예측 모드는 4개 이상이 될 수 있다. 인트라 예측 모드가 2개 이상인 경우, 현재 블록에 대한 예측 샘플은 유도된 인트라 예측 모드들을 모두 사용하여 생성될 수 있고, 디코더는 생성된 예측 샘플들을 가중치 평균하여 현재 블록에 대한 최종 예측 블록을 생성할 수 있다. 이때, 예측 샘플을 생성하기 위해 템플릿 예측으로부터 유도된 2개 이상의 인트라 예측 모드들, 평면 모드, DC 모드, MIP 모드 중에서 적어도 3개 이상이 사용될 수 있다. 예를 들어, 디코더가 현재 블록에 대한 예측 샘플을 생성(획득)할 때, 디코더는 템플릿 예측으로 유도된 인트라 예측 모드들과 평면 모드를 사용하여 생성한 예측 샘플들을 가중치 평균하여 최종 예측 샘플을 생성할 수 있다.
CIIP 모드가 적용되는 경우에도 상술한 방법들을 이용하여 예측 샘플은 생성될 수 있다. CIIP 모드는 현재 블록에 대한 예측 샘플(블록)을 생성할 때, 인트라 예측과 인터 예측을 모두 사용하는 방법이다. 현재 블록에 대한 예측 샘플은 인트라 예측 샘플과 인터 예측 샘플 간의 가중치 평균으로 생성될 수 있다.
CIIP 모드를 적용하여 인트라 예측 샘플이 생성되는 경우, DIMD 모드 또는 TIMD 모드가 사용될 수 있다. 이때 DIMD 모드가 사용되는 경우, 인트라 예측 샘플은 DIMD 조합 정보에 기초하여 생성될 수 있다. 예를 들어, 디코더는 가중치가 가장 높은 인트라 예측 모드를 사용하여 제1 예측 샘플을 생성하고 2번째로 가중치가 높은 인트라 예측 모드를 사용하여 제2 예측 샘플을 생성할 수 있다. 그리고, 디코더는 제1 예측 샘플과 제2 예측 샘플을 가중치 평균하여 최종 인트라 예측 블록을 생성할 수 있다. 이때, 디코더는 현재 블록의 주변 블록들 중 평면 모드로 예측된 샘플과 제1 예측 샘플, 제2 예측 샘플 총 3개의 예측 샘플들을 가중치 평균하여 최종 인트라 예측 블록을 생성할 수 있다. TIMD 모드가 사용되는 경우, 인트라 예측 샘플은 TIMD 조합 정보에 기초하여 생성될 수 있다. 예를 들어, 디코더는 2개의 인트라 예측 모드 각각을 사용하여 2개의 예측 샘플을 생성할 수 있다. 그리고, 디코더는 2개의 예측 샘플을 가중치 평균하여 최종 인트라 예측 샘플을 생성할 수 있다. 이때, 디코더는 2개의 예측 샘플과 평면 모드로 예측된 샘플을 가중치 평균하여 최종 인트라 예측 샘플을 생성할 있다.
인트라 예측 샘플은 위치에 따라 정확도가 달라질 수 있다. 즉, 예측 샘플 내 예측에 사용된 주변 픽셀과 거리가 먼 위치의 픽셀은 거리가 가까운 위치의 픽셀보다 더 많은 잔차 신호를 포함할 수 있다. 따라서, 디코더는 인트라 예측 모드의 방향에 따라 예측 샘플을 수직, 수평, 대각선 방향으로 분할하고, 예측에 사용된 주변 픽셀과의 거리에 따라 가중치를 다르게 설정할 수 있다. 이는 CIIP 모드를 사용하여 생성한 인트라 예측 블록 또는 2개 이상의 인트라 예측 모드를 사용하여 생성한 인트라 예측 블록에 적용될 수 있으며, 참조 픽셀의 위치와 예측 블록 내 픽셀 위치 간의 거리에 따라 예측 블록 내 픽셀마다 가중치를 다르게 설정할 수 있다. 실시 일 예로, 현재 블록의 인트라 예측 모드가 수직 방향 또는 수직과 유사한 방향을 가지는 모드일 경우, 예측 블록의 픽셀 위치가 상단 픽셀과 거리가 가까울수록 높은 가중치가 설정되고 상단 픽셀과 거리가 먼 픽셀 위치일수록 낮은 가중치가 각 픽셀 위치마다 설정될 수 있다.
현재 블록이 CIIP 모드로 부호화되는 경우, 디코더는 인트라 예측 샘플과 인터 예측 샘플을 가중치 평균하여 최종 예측 블록을 생성할 수 있다. 인터 예측 샘플에서의 픽셀 단위 가중치는 인트라 예측 샘플의 픽셀 단위 가중치를 고려하여 설정될 수 있다. 예를 들어, 인터 예측 샘플의 픽셀 단위 가중치는 전체 가중치의 합에서 인트라 예측 샘플의 픽셀 단위 가중치를 뺀 값이 될 수 있다. 이때, 전체 가중치의 합은 픽셀 단위에서 인트라 예측 샘플의 가중치와 인터 예측 샘플의 가중치가 더해진 값일 수 있다.
예측 샘플 생성을 위해 2개 이상의 인트라 예측 모드가 사용되는 경우, 디코더는 각 인트라 예측 모드에 기초하여 예측 샘플을 각각 생성하고, 생성된 예측 샘플들을 가중치 평균하여 최종 예측 샘플을 생성할 수 있다. 각 인트라 예측 모드에 대한 예측 샘플을 생성할 때, 인트라 예측 모드에 따른 픽셀 단위 가중치가 적용될 수 있다.
픽셀 단위 가중치는 인트라 예측 모드, 현재 블록의 가로의 길이, 세로의 길이, 양자화 파라미터, 현재 블록이 휘도 인지 또는 색차 인지에 대한 정보, 주변 블록의 인트라 코딩 여부, 주변 블록의 잔여 변환 계수에 대한 존재 유무 정보 등 적어도 어느 하나에 기초하여 설정될 수 있다.
도 32는 본 발명의 일 실시예에 따른 복수의 참조 픽셀 라인에 기초하여 예측 샘플(픽셀)을 생성하는 방법을 나타내는 도면이다.
도 32의 (a)를 참조하면, 비디오 신호 처리 장치는 현재 블록(4101)에 인접한 제1 참조 픽셀 라인 (reference line 1)과 제1 참조 픽셀 라인에 상측으로 인접한 제2 참조 픽셀 라인(reference line 2)에 기초하여 현재 블록 내 예측 샘플(4102)을 생성할 수 있다. 도 32의 (a)의 예측 샘플 샘플 (4102)은 본 발명의 일 실시예에 따른 위치에 대응되는 샘플일 뿐, 픽셀의 위치는 이에 한정되지 않는다. 본 명세서에서 비디오 신호 처리 장치가 생성한다는 의미는 비디오 신호 처리 장치가 획득한다는 의미와 동일할 수 있다. 도 32의 (b)는 도 32의 (a)를 보다 자세하게 나타낸 도면이다. 예를 들어, 비디오 신호 처리 장치는 제1 참조 픽셀 라인의 6개의 참조 픽셀들을 통해, 인트라 예측 모드에 따라 스무딩(smoothing) 필터, 큐빅(cubic) 또는 가우시안(gaussian) 필터를 사용하여 제1 예측 픽셀(4103)을 생성할 수 있다. 그리고, 비디오 신호 처리 장치는 제2 참조 픽셀 라인의 6개의 참조 픽셀들을 통해, 인트라 예측 모드에 따라 스무딩(smoothing) 필터, 큐빅(cubic) 또는 가우시안(gaussian) 필터를 사용하여 제2 예측 픽셀(4104)을 생성할 수 있다. 비디오 신호 처리 장치는 생성한 제1 예측 픽셀(4103)과 제2 예측 픽셀(4104)에 대해 임의의 정해진 가중치를 통해 가중치 평균을 수행하여 제3 예측 픽셀(4105)을 생성할 수 있다. 이때, 제2 참조 픽셀 라인의 6개의 참조 픽셀들은, 현재 블록의 인트라 예측 모드, 생성할 픽셀 위치, 참조 픽셀 라인의 위치 등을 고려하여 제1 참조 픽셀 라인의 각 픽셀들보다 오른쪽으로 한 픽셀만큼 이동한 위치의 참조 픽셀들일 수 있다. 비디오 신호 처리 장치는 제3 예측 픽셀(4105)에 기초하여 현재 블록 내 예측 샘플(4102)을 생성할 수 있다. 또는 비디오 신호 처리 장치는 제3 예측 픽셀(4105) 및, 제3 예측 픽셀(4105)과 현재 블록 내 예측 샘플(4102)간의 거리에 기초하여 현재 블록 내 예측 샘플(4102)을 생성할 수 있다. 비디오 신호 처리 장치가 제3 예측 픽셀(4105)을 생성하기 위해 사용하는 가중치는 0이상의 정수 일 수 있다. 예를 들어, 제1 예측 픽셀(4103)의 가중치는 3일 수 있고, 제2 예측 픽셀(4104)의 가중치는 1일 수 있다. 이때, 현재 블록의 인트라 예측 모드, 생성되는 픽셀의 위치(예를 들어, 도 41의 제1 예측 픽셀(4103)의 위치, 제2 예측 픽셀(4104)의 위치 제3 예측 픽셀(4105)의 위치), 참조 픽셀 라인의 위치(예를 들어, 도 41의 제1 참조 픽셀 라인, 제2 참조 픽셀 라인의 위치) 등 적어도 하나 이상에 기초하여 예측 샘플을 생성하기 위해 사용되는 참조 픽셀의 위치(도 41의 제1 참조 픽셀 라인의 6개의 참조 픽셀의 위치, 제2 참조 픽셀 라인의 6개의 참조 픽셀의 위치)는 달라질 수 있다.
비디오 신호 처리 장치는 미리 지정되거나 또는 시그널링된 참조 샘플 라인의 샘플을 이용하여 인트라 예측 모드의 방향성에 따라 현재 블록 내 예측 샘플을 획득할 수 있다. 여기서 미리 지정된 참조 샘플 라인은 현재 블록에 인접한 참조 샘플일 수 있다. 또한, 시그널링된 참조 샘플 라인은 현재 블록의 경계로부터 -X 샘플 위치의 샘플일 수 있으며, X는 시그널링된 값일 수 있다. X는 1, 2, 3 등이 될 수 있다. 비디오 신호 처리 장치는 복수의 참조 샘플 라인을 사용하여 예측 블록을 생성할 수 있다. 본 명세서에서 미리 지정된 참조 샘플 라인 또는 시그널링된 참조 샘플 라인은 메인 참조 샘플 라인이라고 할 수 있다. 비디오 신호 처리 장치는 서브 참조 샘플 라인을 메인 참조 샘플 라인에 기초하여 설정할 수 있다. 본 명세서에서 서브 참조 샘플 라인은 메인 참조 샘플 라인보다 Y 샘플만큼 떨어진 위치의 참조 샘플 라인일 수 있다. 이때, Y는 정수 일 수 있으며, -3, -2, -1, 1, 2, 3 등일 수 있다. 인코더는 서브 참조 샘플 라인에 대한 정보를 시그널링하여 비트스트림에 포함시킬 수 있으며, 디코더는 해당 정보를 파싱하여 서브 참조 샘플 라인을 설정할 수 있다. 비디오 신호 처리 장치에서는 하나의 인트라 예측 모드를 이용하여 메인 참조 픽셀 라인과 서브 참조 샘플 라인으로부터 예측 블록을 각각 생성한 후, 각 예측 블록을 가중치 평균하여 최종 예측 블록을 생성할 수 있으며, 이러한 방법을 인트라 퓨젼(intra fusion)이라고 할 수 있다.
도 33은 본 발명의 일 실시예에 따른 복수의 참조 픽셀 라인을 사용하여 샘플을 예측하는 방법을 나타낸다.
도 33을 참조하면 비디오 신호 처리 장치는 복수의 참조 픽셀 라인을 입력 받아 인트라 예측을 수행하여 현재 블록 내 예측 블록을 생성할 수 있다. 어떠한 참조 픽셀 라인이 사용되는지에 따라 다른 예측 블록이 생성될 수 있고, 비디오 신호 처리 장치는 각 예측 블록에 대해 입력된 가중치에 따라 가중치 평균하여 최종 예측 블록을 생성할 수 있다. 이때 가중치는 기 설정된 값일 수 있다. 예를 들어, 메인 참조 픽셀 라인으로 예측된 샘플의 가중치는 3이고, 서브 참조 픽셀 라인으로 예측된 샘플의 가중치는 1일 수 있다. 이때, 가중치는 현재 블록의 크기, 현재 블록의 가로 또는 세로의 크기, 현재 블록의 인트라 예측 모드, 양자화 파라미터 정보, 메인 참조 픽셀 라인과 서브 참조 픽셀 라인 간의 거리(또는 차이) 등 적어도 하나 이상에 기초하여 결정될 수 있다. 또한, 참조 픽셀 라인은 현재 블록의 크기, 현재 블록의 가로 또는 세로의 크기, 현재 블록의 인트라 예측 모드, 양자화 파라미터 정보, MRL 정보 등 적어도 하나 이상에 기초하여 결정될 수 있다. 예를 들어, 메인 참조 픽셀 라인은 현재 블록에 인접한 참조 픽셀 라인일 수 있고, 서브 참조 픽셀 라인은 MRL이 지시하는 참조 픽셀 라인일 수 있다. 또 다른 예로, 메인 참조 픽셀 라인은 MRL이 지시하는 참조 픽셀 라인일 수 있고, 서브 참조 픽셀 라인은 MRL이 지시하는 참조 픽셀 라인보다 임의의 정해진 위치만큼 떨어진 참조 픽셀 라인일 수 있으며, 임의의 정해진 위치는 -N ~ +N까지의 정수일 수 있으며, N은 0보다 큰 정수일 수 있다.
상술한 현재 블록 내 예측 샘플을 생성하는 방법에서 사용되는 인트라 예측 모드는 참조 픽셀 라인마다 동일할 수 있다. 또는, 반대로 상술한 현재 블록 내 예측 샘플을 생성하는 방법에서 사용되는 인트라 예측 모드는 참조 픽셀 라인마다 상이할 수 있다. 즉, 메인 참조 픽셀 라인에서는 시그널링된 인트라 예측 모드가 사용될 수 있고, 서브 참조 픽셀 라인에서는 메인 참조 픽셀 라인에서 사용된 인트라 예측 모드(의 인덱스)에서 임의의 값만큼 더해지거나 빼진 (인덱스에 대응되는)예측 모드가 사용될 수 있다. 이때, 임의의 값은 1이상의 정수 일 수 있다. 또한, 비디오 신호 처리 장치는 메인 참조 픽셀 라인에서 사용된 인트라 예측 모드의 값에 따라 임의의 값을 증가시킬 지 혹은 감소시킬 지를 결정할 수 있다. 예를 들어, 비디오 신호 처리 장치는 인트라 예측 모드의 각도가 음수일 경우에는 임의의 값만큼 증가시키고, 양수일 경우에는 임의의 값만큼 감소시킬 수 있다.
도 34는 본 발명의 일 실시예에 따른 템플릿에 기초한 복수의 참조 픽셀 라인을 사용하여 최적의 참조 픽셀 라인을 결정하는 방법을 나타낸 구조도이다.
도 34를 참조하면 인코더는 복수의 참조 픽셀 라인을 입력 받아 인트라 예측을 수행하여 템플릿에 대한 예측 블록들을 생성할 수 있다. 어떠한 참조 픽셀 라인이 사용되었는지에 따라 다른 예측 블록이 생성될 수 있다. 인코더는 예측 블록들 각각에 입력된 다양한 가중치 정보에 따라 가중치 평균을 수행하여 최종적으로 템플릿에 대한 예측 블록을 생성할 수 있다. 어떠한 참조 픽셀 라인들이 사용되었는지, 어떠한 가중치가 사용되었는지에 따라 복수의 예측 블록이 생성될 수 있다. 인코더는 각 예측 블록과 기준 템플릿 간의 코스트를 계산한 후, 각 예측 블록에 대응되는 코스트를 기반으로 오름차순으로 재정렬하고, 미리 정해진 개수의 상위 몇 개의 후보만을 사용하여 별도의 리스트를 구성할 수 있다. 이때, 미리 정해진 개수는 2이상의 정수일 수 있으며, 10일 수 있다. 인코더는 별도의 리스트 내 예측 블록을 생성하는데 사용된 조합 정보를 통해 현재 블록에 대한 예측 블록을 생성할 수 있다. 그리고 인코더는 화질 및 비트량 관점에서 최적의 후보를 리스트에서 선택한 후 최적의 후보의 인덱스에 대한 정보를 포함하는 비트스트림을 생성하고 시그널링할 수 있다. 디코더는 상술한 방법을 통해 동일한 별도의 리스트를 구성하고, 비트스트림에 포함된 최적의 후보의 인덱스에 대한 정보를 파싱하여 결정되는 최적의 후보의 인덱스가 지시하는 최적의 조합 정보를 사용하여 예측 샘플을 생성할 수 있다.
현재 블록이 인트라 예측 모드로 부호화되는 경우, 부호화되는 인트라 예측 모드는 각도 모드, 평면(Planar) 모드, DC 모드, MIP 모드 중 어느 하나의 모드일 수 있다. 각도 모드에 따른 예측은 65가지의 각도에 따라 수행되는 예측일 수 있고, MIP 모드에 따른 예측은 미리 정의된 매트릭스를 기반으로 수행되는 예측일 수 있다. 각도 모드는 현재 블록 내에 에지와 같은 특성이 존재하는 블록에서 효과적일 수 있다. 하지만, 현재 블록이 완만한 특성을 가질 경우, 각도 모드를 사용하여 예측된 블록에는 블록 간 경계 부분의 불연속적인 에지가 생성되거나 블록 내부에 가시적인 윤곽선이 생성될 수 있다. 이는 부호화 효율을 감소시키는 요인이 될 수 있다. 또한, DC 모드는 낮은 비트율에서 블록 간 경계 부분에서 가시적인 에지를 생성하는 단점이 있을 수 있다. 평면 모드는 각도 모드와 DC 모드로 발생되는 에지 문제를 개선하여 불연속성이 없는 예측 블록을 생성할 수 있다.
도 35는 본 발명의 일 실시예에 따른 평면 모드를 사용하여 예측 샘플을 생성하는 방법을 나타낸다.
도 35를 참조하면 평면(planar) 모드에 따르면 비디오 신호 처리 장치는 현재 블록 내 예측 샘플을 생성하기 위해 수직 방향으로 선형 예측된 값을 생성하고, 수평 방향으로 선형 예측된 값을 생성할 수 있다. 비디오 신호 처리 장치는 수직 방향으로 선형 예측된 값과 수평 방향으로 선형 예측된 값을 가중치 평균하여 현재 블록 내 예측 샘플(값)을 생성할 수 있다.
수직 방향으로 선형 예측된 값(predV (x, y)은 수학식 4에 기초하여 생성될 수 있고, 수평 방향으로 선형 예측된 값(predH (x, y)은 수학식 5에 기초하여 생성될 수 있다. 그리고, 새로운 예측 값(pred (x, y)은 수학식 6에 기초하여 생성될 수 있다. 수학식 4 내지 6에서 W는 현재 블록의 가로의 크기(너비)이고, H는 현재 블록의 세로의 크기(높이)일 수 있다. rec(x, y)는 (x, y)좌표에서의 픽셀 값을 의미할 수 있다. 예측 값(predV(x, y), predH(x, y), pred(x, y))는 (x, y)좌표에서의 예측된 픽셀 값을 의미할 수 있다.
비디오 신호 처리 장치는 평면 모드에 따라 현재 블록과 관련된 예측을 수행할 때 수직 방향으로의 선형 예측만을 사용할 수 있다. 또는 비디오 신호 처리 장치는 평면 모드에 따라 현재 블록과 관련된 예측을 수행할 때 수평 방향으로의 선형 예측만을 사용할 수 있다. 따라서, 평면 모드는 3가지 모드로 구분될 수 있다. 즉, 종래의 수직 방향 및 수평 방향으로의 선형 예측을 이용하여 생성되는 예측 블록을 가중치 평균하는 방법에 더하여, 수직 방향으로의 선형 예측만을 사용하는 수직 방향 평면 모드, 수평 방향으로의 선형 예측만을 사용하는 수평 방향 평면 모드로 구분될 수 있다. 인코더는 현재 블록이 3가지 평면 모드 중 어떠한 예측 모드를 사용했는지에 대한 정보를 포함하는 비트스트림을 생성하고, 시그널링할 수 있다. 디코더는 비트스트림에 포함된 어떠한 예측 모드를 사용했는지에 대한 정보를 파싱하여 결정되는 평면 모드에 기초하여 현재 블록에 대한 예측 블록을 생성할 수 있다.
도 36은 본 발명의 일 실시예에 따른 외삽 필터(extrapolation filter)에 기초한 인트라 예측 모드를 나타낸다.
구체적으로 도 36은 본 발명의 일 실시예에 따른 외삽 필터에 기초한 인트라 예측 모드인 EIP(Extrapolation filter-based Intra Prediction) 모드를 나타낸다.
도 36을 통해 본 발명의 실시 예에 따른 비디오 신호 처리 장치가 EIP 모드를 수행하는 방법에 대해 설명한다.
도 36의 (a)를 참조하면, 비디오 신호 처리 장치는 현재 블록에 인접한 주변 샘플들을 사용하여 구성되는 템플릿을 사용하여 비-선형(non-linear) 모델 파라미터를 유도할 수 있다. 이때, 템플릿은 3가지 타입이 존재할 수 있고, 비디오 신호 처리 장치는 3가지 타입 중 1가지 타입을 이용하여 비-선형 모델 파라미터를 유도할 수 있다. 템플릿은 현재 블록의 좌측 주변 샘플 및 상측 주변 샘플들로 구성(L-shape)될 수 있고, 템플릿은 현재 블록의 좌측 샘플들로 구성(left-only)로 구성될 수 있고, 템플릿은 현재 블록의 상측 샘플들로 구성(above-only)될 수 있다. 비-선형 모델은 CCCM 일 수 있다. 도 36의 (b)를 참조하면, 비-선형 모델 파라미터를 유도하기 위해 사용되는 필터 모양은 정사각형 모양, 가로로 길쭉한(가로가 세로보다 긴) 직사각형 모양, 세로로 길쭉한(세로가 가로보다 긴) 직사각형 모양 중 하나일 수 있다. 인코더는 템플릿 타입과 필터 모양을 지시하는 제1 정보를 포함하여 비트스트림을 획득할 수 있고, 디코더는 비트스트림의 제1 정보를 통해 템플릿 타입과 필터 모양을 결정할 수 있다. 도 36의 (c)를 참조하면, 비디오 신호 처리 장치는 템플릿 타입과 필터 모양에 기초하여 비-선형 모델 파라미터를 유도할 수 있고, 유도된 비-선형 모델 파라미터를 이용하여 현재 블록을 샘플 단위로 예측할 수 있다. 현재 블록을 샘플 단위로 예측할 때, 비디오 신호 처리 장치는 대각방향으로 예측할 수 있다. 현재 샘플을 예측함에 있어, 현재 샘플 이전에 예측된 샘플이 사용될 수 있다. 비디오 신호 처리 장치는 EIP 모드를 사용하여 예측된 예측 블록에 필터링을 수행할 수 있다. 인코더는 EIP 모드로 예측된 블록에 필터링을 적용할지 여부를 나타내는 정보를 포함하는 비트스트림을 생성하여 시그널링할 수 있다. 디코더에서는 현재 블록이 EIP 모드인 경우, 예측 블록에 대한 필터링이 적용되는지 여부를 나타내는 정보를 파싱하여 예측된 블록에 필터링 적용 여부를 설정할 수 있다. 이때 필터링은 아래 표 1과 같을 수 있다. 표 1은 본 발명의 일 실시예에 따른 필터링으로 3x3 커널, 5x5 커널과 관련된 필터링을 나타낸다.
비디오 신호 처리 장치는 EIP 모드로 부호화된 블록의 잔차 신호에 대해, EIP 모드로 예측된 블록을 이용하여 인트라 예측 모드를 유도한 후, 유도된 인트라 예측 모드를 이용하여 MTS, NSPT, LFNST 등을 위한 변환 커널을 유도할 수 있다. 이때, 인트라 예측 모드를 유도하기 위해, 비디오 신호 처리 장치는 DIMD 방식 또는 DIMD와 유사한 방식을 사용할 수 있다.
EIP 머지(merge) 모드는 비디오 신호 처리 장치가 이전에 EIP 모드로 부호화된 주변 블록의 필터 모양과 필터 계수를 이용하여 EIP 머지 리스트를 구성한 후, 현재 블록을 위한 최적의 필터 모양과 필터 계수를 갖는 EIP 머지 후보를 결정하는 모드일 수 있다. 이때, EIP 머지 후보(최적의 필터 모양과 필터 계수)는 비트스트림에 포함되는 인덱스를 통해 결정될 수 있다. 이때, EIP 머지 리스트는 현재 블록의 인접한 공간 후보(adjacent spatial candidate), 비-인접한 공간 후보(non-adjacent spatial candidates), 시간적 후보(temporal candidates), 쉬프트된 시간적 후보(shifted temporal candidates), 히스토리 기반 후보(history-based candidates)를 사용하여 구성될 수 있다. 또한, EIP 머지 리스트는 템플릿 코스트에 기초하여 재정렬될 수 있다.
현재 블록이 인트라 TMP, MIP, EIP 모드 중에 어느 하나의 모드로 부호화된 경우, 비디오 신호 처리 장치는 현재 블록의 인트라 예측 모드를 위해 평면(planar) 모드, DC 모드, 유도된 DIMD 모드, 블록 벡터(block vector, BV)가 지시하는 위치의 인트라 예측 모드 중 어느 하나를 저장할 수 있다. 유도된 DIMD 모드는 현재 블록에 인접한 미리 복원된 샘플들을 사용하여 DIMD 방식으로 유도된 인트라 예측 모드일 수 있다. 또는 유도된 DIMD 모드는 현재 예측 블록을 사용하여 DIMD 방식으로 유도된 인트라 예측 모드일 수 있다. 또는 유도된 DIMD 모드는 현재 블록의 복원이 완료된 후, 복원된 현재 블록의 샘플들을 사용하여 DIMD 방식으로 유도된 인트라 예측 모드일 수 있다. BV가 지시하는 인트라 예측 모드는 인트라 TMP 예측에 사용된 BV가 지시하는 참조 블록의 인트라 예측 모드일 수 있다. 저장된 인트라 예측 모드는 다음 블록의 인트라 예측을 위한 MPM 리스트를 유도하는데 사용될 수 있다. 또한, 비디오 신호 처리 장치는 IBC 또는 인트라 TMP 모드로 부호화된 블록을 위해 저장할 인트라 예측 모드를 유도하기 위해 BV가 지시하는 참조 블록의 인트라 예측 모드를 사용할 수 있다.
비디오 신호 처리 장치가 현재 블록에 대한 MPM 리스트를 유도할 때, 현재 블록의 주변 블록의 부호화 모드가 인트라 TMP, MIP, EIP 모드 중 어느 하나인 경우, 주변 블록의 인트라 예측 모드는 평면 모드, DC 모드, 유도된 DIMD 모드, BV가 지시하는 위치의 인트라 예측 모드 중에 어느 하나로 유도될 수 있다.
비디오 신호 처리 장치는 현재 블록이 SGPM(Spatial Geometry Partitioning Mode) 또는 GPM(Geometry Partitioning Mode) 중 어느 하나의 모드로 부호화된 경우, 현재 블록을 분할하는 사선의 각도를 인트라 예측 모드로 변환한 값을 현재 블록의 인트라 예측 모드로 설정할 수 있다. 현재 블록이 SGPM 또는 GPM 중에 어느 하나의 모드로 부호화되고, 현재 블록의 분할된 2개의 영역 중에 하나가 인트라 예측 모드로 부호화되었다면, 현재 블록을 대표하는 인트라 예측 모드는 2개의 영역 중 인트라 예측 모드로 부호화된 영역에 적용된 인트라 예측 모드일 수 있다. 이때, 인트라 예측 모드가 방향성 모드(2~66번 모드 중 어느 하나)인 경우에는 현재 블록을 대표하는 인트라 예측 모드는 방향성 모드(2~66번 모드 중 어느 하나)에 대응되는 인트라 예측 모드일 수 있다. 인트라 예측 모드가 방향성 모드(2~66번 모드 중 어느 하나)가 아닌 경우, 현재 블록을 대표하는 인트라 예측 모드는 현재 블록의 분할 과정에서 사용된 사선의 각도를 인트라 예측 모드로 변환한 값이 될 수 있다.
현재 블록의 주변 블록의 부호화 모드가 SGPM, GPM 중에 하나이고, 현재 블록의 분할된 2개의 영역 중에 하나가 인트라 예측 모드로 부호화될 수 있다. 이때, 비디오 신호 처리 장치는 현재 블록에 대한 MPM 리스트를 유도할 때, 현재 블록의 주변 블록의 분할된 2개의 영역 중 인트라 예측 모드로 부호화된 영역의 인트라 예측 모드를 주변 블록의 인트라 예측 모드로 설정할 수 있다. 이때, 인트라 예측 모드가 방향성 모드(2~66번 모드 중 어느 하나)인 경우, 주변 블록의 인트라 예측 모드는 방향성 모드(2~66번 모드 중 어느 하나)의 인트라 예측 모드일 수 있다. 인트라 예측 모드가 방향성 모드(2~66번 모드 중 하나)가 아닌 경우에는 현재 블록의 분할 과정에서 사용된 사선의 각도를 인트라 예측 모드로 변환한 값이 될 수 있다. 유도된 주변 블록의 인트라 예측 모드는 MPM 리스트에 추가될 수 있다.
현재 블록이 IBC 모드로 부호화된 경우, 현재 블록의 인트라 예측 모드는 유도된 DIMD 모드, BV가 지시하는 위치의 인트라 예측 모드 중에 하나가 될 수 있다. 유도된 DIMD 모드는 현재 블록에 인접한 이미 복원된 샘플들을 사용하여 DIMD 방식으로 유도된 인트라 예측 모드일 수 있다. 또는 유도된 DIMD 모드는 현재 예측 블록을 사용하여 DIMD 방식으로 유도된 인트라 예측 모드일 수 있다. 유도된 DIMD 모드는 현재 블록이 복원이 완료된 후, 복원된 현재 블록의 샘플들을 사용하여 DIMD 방식으로 유도된 인트라 예측 모드일 수 있다. BV가 지시하는 인트라 예측 모드는 IBC 예측에 사용된 BV가 지시하는 참조 블록의 인트라 예측 모드일 수 있다. 현재 블록의 부호화 모드가 RRIBC 부호화 모드인 경우, BV가 지시하는 참조 블록의 인트라 예측 모드는 현재 블록의 플립(flip) 방향에 따라 변환될 수 있으며, 현재 블록의 인트라 예측 모드는 변환된 인트라 예측 모드일 수 있다.
도 37은 본 발명의 일 실시예에 따른 최적의 인트라 예측 모드 조합을 선정하는 방법을 나타낸다.
도 38 및 도 39은 본 발명의 일 실시예에 따른 현재 블록의 주변 블록을 나타낸다.
최적의 인트라 예측 모드 조합은 인트라 예측 모드의 발생 빈도에 기초하여 결정될 수 있다. 인트라 예측 모드의 발생 빈도에 기초하는 인트라 부호화 모드인 OBIC(Occurrenece-based intra coding)모드는 다음과 같은 순서로 수행될 수 있다.
먼저 비디오 신호 처리 장치는 비디오 신호 처리 장치는 현재 블록에 OBIC 모드가 적용 가능한지 여부를 결정할 수 있다. OBIC 모드가 적용 가능한지 여부는 현재 블록의 위치, 현재 블록이 휘도 블록인지 색차 블록인지 여부, 현재 블록이 인트라 예측 모드로 부호화되는지 여부, DIMD가 적용 가능한지 여부, 현재 블록의 가로 및 세로의 크기, 현재 블록의 주변 블록 중에서 OBIC 모드를 유도하는데 사용되는 블록의 개수 중에서 적어도 하나 이상을 사용하여 결정될 수 있다. 현재 블록의 주변 블록 중에서 OBIC 모드를 유도하는데 사용되는 블록의 개수가 미리 지정된 개수보다 작다면, 현재 블록은 OBIC 모드가 적용되지 않을 수 있으며, OBIC와 관련된 신택스 요소는 시그널링되지 않거나 파싱되지 않을 수 있다.
현재 블록에 OBIC 모드가 적용 가능한 경우, 비디오 신호 처리 장치는 현재 블록의 주변 블록으로부터 인트라 예측 모드를 유도할 수 있다. 이때, 주변 블록은 현재 블록에 인접한 블록일 수 있다. 예를 들어, 도 38의 A0, A1, B0, B1, B2 위치의 블록이 주변 블록일 수 있다. 또는, 주변 블록은 현재 블록에 인접하지 않은 블록일 수 있다. 예를 들어, 도 39의 Ax, Bx, Cx, ax, bx, cx의 위치의 블록이 주변 블록일 수 있다. 현재 블록의 주변 블록이 IBC 또는 Intra TMP 모드로 부호화된 경우에는 현재 블록의 BV가 지시하는 참조 블록이 OBIC 모드를 위한 주변 블록으로 사용될 수 있다. 또한, 현재 픽쳐가 I 픽쳐가 아닌 P 픽쳐 또는 B 픽쳐인 경우에는 현재 픽쳐의 POC(picture order count)와 동일하지 않은 다른 참조 픽쳐로부터 현재 블록에 대응되는 시간적인 주변 블록도 OBIC 모드를 위한 주변 블록으로 사용될 수 있다. 시간적인 주변 블록은 현재 블록에 인접한 블록의 움직임 정보를 사용하여 위치가 이동된 블록일 수 있다.
주변 블록들이 OBIC 모드를 위한 인트라 예측 모드를 유도하기 위한 주변 블록으로 사용될 수 있는지 여부는 주변 블록의 부호화 모드, 주변 블록과 현재 블록 간의 거리 중에서 하나 이상에 기초하여 결정될 수 있다. 주변 블록이 인트라 모드로 부호화되지 않은 경우, 주변 블록은 OBIC 모드를 위한 주변 블록으로 사용될 수 없다. 주변 블록이 인트라 모드로 부호화되더라도, 부호화 모드가 EIP, Intra TMP, MIP 모드 중에 하나인 경우, 주변 블록은 OBIC 모드를 위한 주변 블록으로 사용될 수 없다. 또는, 주변 블록이 인트라 모드로 부호화되고, 부호화 모드가 EIP, Intra TMP, MIP 모드 중에 하나인 경우, 주변 블록은 OBIC 모드를 위한 주변 블록으로 사용될 수 있다. 또는 주변 블록이 IBC, 인터 부호화 모드로 부호화된 경우, 주변 블록은 OBIC 모드를 위한 주변 블록으로 사용할 수 있다.
OBIC 모드를 위한 주변 블록으로 사용 가능한 주변 블록은, 현재 블록과의 거리에 기초하여 정렬될 수 있다. 정렬된 순서상 미리 지정된 개수의 주변 블록만 OBIC 모드를 위한 주변 블록으로 사용될 수 있다. 이때 미리 지정된 개수는 1 이상의 정수로, 20일 수 있다.
다음으로, 비디오 신호 처리 장치는 선정된 주변 블록으로부터 인트라 예측 모드를 유도할 수 있다. 그리고, 비디오 신호 처리 장치는 유도된 인트라 예측 모드의 값과 주변 블록의 가로의 길이와 세로의 길이의 곱(또는 주변 블록의 가로 세로의 길이의 합)에 기초하여 인트라 예측 모드에 대한 히스토그램을 생성할 수 있다. 이때, 유도된 인트라 예측 모드의 값은 히스토그램의 X축 성분 (본 명세서에서 계급으로 기술될 수 있음) 값이 될 수 있고, 주변 블록의 가로의 길이와 세로의 길이의 곱(또는 주변 블록의 가로 세로의 길이의 합)은 히스토그램의 Y축 성분 (본 명세서에서 도수로 기술될 수 있음) 값이 될 수 있다.
주변 블록의 인트라 예측 모드가 DIMD, TIMD 모드인 경우에는 조합(블랜딩)에 사용되는 인트라 예측 모드도 히스토그램에 추가될 수 있다. 또는, 주변 블록의 인트라 예측 모드가 OBIC 모드인 경우에는 미리 지정된 개수의 인트라 예측 모드가 히스토그램에 추가될 수 있고, 추가되는 인트라 예측 모드는 첫번째 인트라 예측 모드(히스토그램에서 도수가 가장 높은 모드)가 아닌 인트라 예측 모드일 수 있다. 이때, 인트라 예측 모드가 히스토그램에 추가될 때, 도수 값은 주변 블록의 가로의 길이와 세로의 길이의 곱(또는 주변 블록의 가로 세로의 길이의 합)일 수 있다. 또는 도수는 주변 블록의 가로의 길이와 세로의 길이의 곱(또는 주변 블록의 가로 세로의 길이의 합)보다 작은 값(또는 큰 값)일 수 있다. 예를 들어, 작은 값(또는 큰 값)은 주변 블록의 가로의 길이와 세로의 길이의 곱(또는 주변 블록의 가로 세로의 길이의 합)의 절반(또는 2배)일 수 있다.
주변 블록의 인트라 예측 모드가 SGPM 모드인 경우, 각 영역의 인트라 예측 모드가 히스토그램에 추가될 수 있으며, 추가적으로 분할 각도를 인트라 예측 모드로 변환한 값이 히스토그램에 추가될 수 있다.
주변 블록의 부호화 모드가 인터 예측 모드, IBC 모드인 경우, 주변 블록에 저장된 인트라 예측 모드가 히스토그램에 추가될 수 있다. 주변 블록의 인트라 예측 모드가 GPM 모드인 경우, 각 영역의 인트라 예측 모드가 히스토그램에 추가될 수 있으며, 추가적으로 분할 각도를 인트라 예측 모드로 변환한 값이 히스토그램에 추가될 수 있다.
비디오 신호 처리 장치가 히스토그램을 생성할 때, 주변 블록의 부호화 모드에 따라 주변 블록으로부터 유도된 인트라 예측 모드에 대한 히스토그램 도수 값이 달라질 수 있다. 부호화 모드와 도수 값은 미리 약속될 수 있다. 여기서 미리 약속된 부호화 모드는 DIMD, TIMD, TMRL, SGPM, MPM 기반의 인트라 예측 모드 중에 하나일 수 있다. 또한, 미리 약속된 도수 값은 주변 블록의 가로의 길이와 세로의 길이의 곱(또는 주변 블록의 가로 세로의 길이의 합)일 수 있다. 또는 도수는 주변 블록의 가로의 길이와 세로의 길이의 곱(또는 주변 블록의 가로 세로의 길이의 합)보다 작은 값(또는 큰 값)일 수 있다. 예를 들어, 작은 값(또는 큰 값)은 주변 블록의 가로의 길이와 세로의 길이의 곱(또는 주변 블록의 가로 세로의 길이의 합)의 절반(또는 2배)일 수 있다. 현재 블록의 부호화 모드가 EIP, Intra TMP, MIP 모드인 경우, 도수 값은 주변 블록의 가로의 길이와 세로의 길이의 곱(또는 주변 블록의 가로 세로의 길이의 합)일 수 있다. 또는 도수는 주변 블록의 가로의 길이와 세로의 길이의 곱(또는 주변 블록의 가로 세로의 길이의 합)보다 작은 값(또는 큰 값)일 수 있다. 예를 들어, 작은 값(또는 큰 값)은 주변 블록의 가로의 길이와 세로의 길이의 곱(또는 주변 블록의 가로 세로의 길이의 합)의 절반(또는 2배)일 수 있다. 주변 블록으로부터 유도된 인트라 예측 모드 이외에 히스토리 기반으로 유도된 인트라 예측 모드도 히스토그램에 추가될 수 있다.
비디오 신호 처리 장치가 히스토그램을 구성할 때, 주변 블록과 현재 블록 간의 거리에 따라 주변 블록에서 유도된 인트라 예측 모드에 대한 히스토그램 도수 값은 달라질 수 있다. 주변 블록과 현재 블록 간의 거리가 가까울수록 히스토그램 도수 값이 높아지고, 주변 블록과 현재 블록 간의 거리가 멀어질수록 히스토그램 도수 값이 작아질 수 있다. 예를 들어, 주변 블록으로부터 유도된 인트라 예측 모드에 대한 히스토그램 도수 값(주변 블록의 가로의 길이와 세로의 길이의 곱(또는 주변 블록의 가로 세로의 길이의 합))에서 주변 블록과 현재 블록 간의 거리를 뺀 값이 도수 값으로 사용될 수 있다.
인트라 예측 모드의 발생 빈도에 기초한 방법은, 비디오 신호 처리 장치가 움직임 후보 리스트를 구성하거나 블록 벡터 후보 리스트를 구성하거나 CCP 후보 리스트를 구성하는데 사용될 수 있다. 비디오 신호 처리 장치는 후보 리스트(움직임 후보 리스트, 블록 벡터 후보 리스트, CCP 후보 리스트)를 구성하는 과정에서 주변 블록의 발생 빈도를 기반으로 후보 리스트를 구성하거나 후보들을 발생 빈도 순으로 재정렬할 수 있다.
또한, 발생 빈도에 기초한 방법은, 비디오 신호 처리 장치가 BV를 유도하는데 사용할 수 있다. 예를 들어, 비디오 신호 처리 장치는 주변 블록에서 사용된 BV의 발생 빈도를 기반으로 BV 히스토그램을 구성한 후, BV 히스토그램에 기초하여 가장 빈번하게 발생된 상위 N 개의 BV를 현재 블록에 대한 BV로 사용할 수 있으며, 이를 OBVC(Occurrence-based BV coding) 모드라고 할 수 있다. 여기서 N은 1이상의 정수일 수 있으며, 1, 2, 3 등이 될 수 있다.
또한, 발생 빈도에 기초한 방법은, 비디오 신호 처리 장치가 LIC 정보를 유도하는데 사용할 수 있다. 예를 들어, 비디오 신호 처리 장치는 주변 블록에서 사용된 LIC 정보의 발생 빈도를 기반으로 LIC 히스토그램을 구성한 후, LIC 히스토그램에 기초하여 가장 빈번하게 발생된 LIC를 현재 블록에 대한 LIC 정보로 사용할 수 있다. 상기 발생 빈도 기반 방법을 CCP 모델, MV, EIP 모델, 변환 방식(MTS, LFNST, NSPT) 중에 하나를 결정하는데 사용할 수 있다.
비디오 신호 처리 장치는 현재 블록에 AIDR 모드가 적용되었는지 여부에 따라 도 32에 기초하여 설명한 복수의 참조 픽셀 라인을 통한 예측 방법의 적용 여부를 결정할 수 있다. 예를 들어, 현재 블록에 AIDR 모드가 적용되었고, AIDR 모드가 제3 범위 모드인 경우, 복수의 참조 픽셀 라인을 통한 예측 방법이 적용되지 않을 수 있다.
현재 블록의 인트라 예측 모드를 부호화하기 위해, MPM 리스트가 사용될 수 있다. MPM 리스트 내 후보들은 템플릿 코스트에 기초하여 재정렬될 수 있다. MPM 리스트 내 후보들을 재정렬함에 있어, 비디오 신호 처리 장치는 현재 블록의 AIDR 모드가 적용되는지 여부에 따라 MPM 리스트 내의 각 후보들에 대한 인트라 예측 모드에 대한 스케일링 및 역 스케일링 과정을 수행할 수 있다. 예를 들어, 현재 블록의 AIDR 모드가 제1 범위 모드인 경우, MPM 리스트 내의 각 후보들에 대한 인트라 예측 모드도 제1 범위 모드일 수 있다. 비디오 신호 처리 장치는 MPM 리스트를 재정렬함에 있어, MPM 리스트 내의 각 후보들에 대한 인트라 예측 모드를 제3 범위 모드로 스케일링한 후, 예측 템플릿을 생성하여 예측 템플릿에 대한 템플릿 코스트를 계산할 수 있다. 현재 블록의 AIDR 모드가 제3 범위 모드인 경우, MPM 리스트 내의 각 후보들에 대한 인트라 예측 모드도 제3 범위 모드일 수 있다. 비디오 신호 처리 장치는 MPM 리스트를 재정렬함에 있어, MPM 리스트 내의 각 후보들에 대한 인트라 예측 모드를 스케일링 과정 없이 그대로 사용하여 예측 템플릿을 생성할 수 있으며 예측 템플릿에 대한 템플릿 코스트를 계산할 수 있다.
비디오 신호 처리 장치는 현재 블록의 부호화 모드(DIMD, TIMD, Intra TMP, MIP, EIP, SGPM, TMRL, BDPCM, ISP), 참조 샘플 라인 정보, 현재 블록의 가로 및 세로의 크기 정보, 현재 블록이 휘도 인지 색차 인지 정보 중에서 적어도 하나 이상을 이용하여 AIDR 모드의 허용 여부를 결정할 수 있다. 예를 들어, 현재 블록의 부호화 모드가 DIMD, TIMD, Intra TMP, MIP, EIP, SGPM, TMRL, BDPCM, ISP 모드가 아니고, 참조 샘플 라인이 0이고, 현재 블록이 휘도 성분 블록인 경우, 현재 블록에 AIDR 모드가 허용될 수 있다. AIDR 모드가 허용된 경우, 인코더는 AIDR과 관련된 정보를 포함하는 비트스트림을 생성하고 시그널링할 수 있고, 디코더는, AIDR과 관련된 정보를 파싱하여 현재 블록에 AIDR 모드가 적용되는지 여부를 결정할 수 있다.
도 40은 본 발명의 일 실시예에 따른 예측 모드 기반의 후보 리스트를 사용하는 방법을 나타낸다.
도 40을 참조하면 비디오 신호 처리 장치는 예측 모드 기반의 후보 리스트를 이용하여 현재 블록의 예측 블록을 생성할 수 있다. 비디오 신호 처리 장치는 현재 블록을 위한 예측 모드 후보 리스트를 구성할 수 있다. 이때, 비디오 신호 처리 장치는 주변 블록 정보, 현재 블록의 DIMD 정보, 현재 블록의 TIMD 정보, 현재 블록의 MPM 리스트, 현재 블록의 Non-MPM 리스트 중에서 적어도 하나 이상을 사용하여 예측 모드 후보 리스트를 구성할 수 있다. 주변 블록 정보는 현재 블록에 인접한 블록, 현재 블록에 인접하지 않고 미리 지정된 거리만큼 떨어진 블록, 별도의 메모리에 저장된 주변 블록 등이 될 수 있다. 주변 블록 정보는 주변 블록의 인트라 예측 방향성 모드 정보 및 각 모드에 대한 가중치 값일 수 있다. 미리 지정된 거리는 현재 블록의 좌상단 샘플 위치, 현재 블록의 가로 및 세로의 크기, 미리 지정된 가로 및 세로의 크기 중에 적어도 하나 이상에 기초하여 결정될 수 있다. 예를 들어, 비디오 신호 처리 장치는 현재 블록의 좌상단 샘플 위치를 기반으로 현재 블록의 가로의 크기만큼 수평 방향으로 왼쪽으로 이동된 위치와 현재 블록의 좌상단 샘플 위치를 기반으로 수직 방향으로 위쪽으로 이동된 위치를 기반으로 주변 블록을 유도할 수 있다.
비디오 신호 처리 장치가 예측 모드 기반의 후보 리스트를 구성하는 방법에 대해 설명한다. 비디오 신호 처리 장치는 주변 블록 정보, 현재 블록의 DIMD 정보, 현재 블록의 TIMD 정보, 현재 블록의 MPM 리스트, 현재 블록의 Non-MPM 리스트, 주변 블록에서 DIMD를 유도하기 위해 사용한 여러 개의 히스토그램들의 누적 히스토그램으로부터 유도된 DIMD 정보, 주변 블록에서 사용된 인트라 예측 모드들 중에서 발생 빈도가 높은 상위 N(미리 정해진 개수)개의 인트라 예측 모드들 중에서 적어도 하나를 사용하여 예측 모드 후보를 생성할 수 있다. 미리 정해진 개수는 정수로 5일 수 있다. 예를 들어, 발생 빈도에 기초한 예측 모드 후보에는 5개의 인트라 예측 모드가 포함될 수 있다. 이때, 예측 모드는 2개 이상의 인트라 예측 방향성 모드로 구성될 수 있으며, 하나의 예측 모드 후보의 인트라 예측 방향성 모드는 서로 다를 수 있다. 또한, 예측 모드에는 방향성을 가진 인트라 예측 방향성 모드만 포함될 수 있다. 또한, 예측 모드에는 비방향성 모드인 평면 모드가 포함되지 않을 수 있다. 주변 블록으로부터 유도된 인트라 예측 방향성 모드가 평면 모드인 경우에는 주변 블록으로부터 유도된 인트라 예측 방향성 모드는 예측 모드에서 제외될 수 있다. 또한, 예측 모드에는 비방향성 모드인 DC 모드가 포함되지 않을 수 있다. 주변 블록으로부터 유도된 인트라 예측 방향성 모드가 DC 모드인 경우에는 주변 블록으로부터 유도된 인트라 예측 방향성 모드는 예측 모드에서 제외될 수 있다. 상술한 방법으로 생성된 예측 모드 후보는 예측 모드 후보 리스트에 추가될 수 있다. 비디오 신호 처리 장치는 예측 모드 후보 리스트에 동일한 예측 모드 후보가 존재하는지 판단한 후, 존재하지 않는 경우에만 생성된 예측 모드 후보를 예측 모드 후보 리스트에 추가할 수 있다. 예측 모드 후보 리스트의 최대 크기는 미리 지정된 개수일 수 있으며, 미리 지정된 개수는 정수로, 25일 수 있다. 예측 모드 후보 리스트의 최대 크기가 미리 지정된 개수인 경우, 비디오 신호 처리 장치는 더 이상 예측 모드 후보를 추가하지 않을 수 있다.
비디오 신호 처리 장치는 예측 모드 후보 리스트를 템플릿 코스트에 기반한 재정렬을 수행하여 재정렬된 예측 모드 후보 리스트를 생성할 수 있다. 한편, 재정렬 과정은 수행되지 않을 수 있다. 템플릿 코스트에 기반한 재정렬은 도 30 또는 도 31의 템플릿을 통해 상술한 방법으로 수행될 수 있다. 비디오 신호 처리 장치는 현재 블록에 인접한 복원된 주변 샘플을 사용하여 기준 템플릿을 구성할 수 있다. 비디오 신호 처리 장치는 예측 모드 후보 리스트 내의 예측 모드 후보와 미리 지정된 참조 샘플 라인(예를 들어, 도 8의 Reference line 1, 2, 3, …)을 사용하여 기준 템플릿에 대한 예측 템플릿을 생성할 수 있다. 미리 지정된 참조 샘플 라인은 Reference line 1(예, 현재 블록 템플릿과 인접한 라인)일 수 있다. 비디오 신호 처리 장치는 기준 템플릿과 예측 템플릿 간의 코스트를 계산할 수 있다. 여기서 코스트는 샘플 간의 차이의 절대값(SAD)의 합일 수 있다. 또한, 코스트는 각 샘플 값에서 각 템플릿의 평균을 뺀 평균 차이 샘플 값 간의 차이의 절대값(MR-SAD)의 합일 수 있다. 예측 템플릿을 생성하는데 사용되는 예측 모드 후보의 인트라 예측 방향성 모드는 기존 인트라 예측 모드의 범위보다 확장된 인트라 예측 모드의 범위로 변환된 후, 예측 템플릿을 생성하는데 사용될 수 있다. 예를 들어, 예측 모드 후보의 인트라 예측 방향성 모드가 N이라면, 확장된 인트라 예측 방향성 모드 M = (N *2) -2 일 수 있다. 또한, 예측 모드 후보는 2개 이상의 인트라 예측 방향성 모드로 구성되어 있으므로, 각 인트라 예측 방향성 모드를 사용하여 생성된 예측 템플릿들은 미리 지정된 가중치를 적용하여 가중치 평균될 수 있으며, 비디오 신호 처리 장치는 가중치 평균된 예측 템플릿을 생성할 수 있다. 이때, 가중치는 미리 지정된 값일 수 있으며, 각 인트라 예측 방향성 모드에 대한 가중치는 서로 동일하거나 혹은 서로 다를 수 있다. 상기 계산된 코스트를 기반으로 예측 모드 후보 리스트가 재정렬 될 수 있으며, 오름차순으로 재정렬될 수 있다.
비디오 신호 처리 장치는 MPM 리스트와 재정렬된 예측 모드 후보 리스트를 사용하여 예측 모드 후보 리스트를 재구성할 수 있다. 이때, 비디오 신호 처리 장치는 MPM 리스트의 일부와 재정렬된 예측 모드 후보 리스트의 일부를 사용하여 예측 모드 후보 리스트를 구성할 수 있다. MPM 리스트의 첫번째 후보부터 미리 지정된 개수의 후보까지 예측 모드 후보 리스트에 추가될 수 있으며, 미리 지정된 개수는 5일 수 있다. 재정렬된 예측 모드 후보 리스트의 예측 모드 후보 중에서 코스트가 낮은 순부터 높은 순으로 미리 지정된 개수만큼 예측 모드 후보 리스트에 추가될 수 있으며, 미리 지정된 개수는 정수 일 수 있으며, 16일 수 있다.
인코더는 유도된 예측 모드 후보 리스트(또는 예측 모드 후보 리스트 재구성 과정이 수행되지 않은 경우에는 예측 모드 후보 리스트)에서 현재 블록을 위한 최적의 예측 모드 후보를 결정한 후, 최적의 예측 모드 후보에 대한 인덱스 정보를 포함하는 비트스트림을 생성하여 시그널링할 수 있다. 디코더는 최적의 예측 모드 후보에 대한 인덱스 정보를 비트스트림으로부터 파싱하여, 결정된 최적의 예측 모드 후보를 사용하여 현재 블록에 대한 예측 블록을 획득할 수 있다. 비디오 신호 처리 장치는 평면 모드(또는 DC 모드)에 기초하여 획득되는 예측 블록과 상기 최적의 예측 모드 후보로 획득되는 예측 블록 간 가중치 평균을 통해 현재 블록의 최종 예측 블록을 획득할 수 있다.
예측 모드 기반의 후보 리스트를 사용하여 예측 블록을 생성하는 방법이 활성화되는지 여부는 현재 블록이 휘도 블록인지 색차 블록인지, 현재 블록에 인트라 예측 모드가 적용되었는지, 현재 블록에 DIMD, TIMD, SGPM, ISP, MIP, Intra TMP, TMRL 모드 중에 하나가 적용되었는지, 현재 블록의 참조 픽셀 라인 정보, 현재 블록의 가로 및 세로의 크기, 현재 블록이 현재 블록을 포함하는 CTU 상단 경계에서 위치해 있는지 중에서 적어도 하나 이상에 기초하여 결정될 수 있다. 예를 들어, 현재 블록에 DIMD, TIMD, SGPM, ISP, MIP, Intra TMP, TMRL 모드 중 어느 하나가 적용된 경우, 예측 모드 기반의 후보 리스트를 사용하여 예측 블록을 생성하는 방법은 활성화되지 않을 수 있고, 비디오 신호 처리 장치는 예측 모드 기반의 후보 리스트를 사용하여 예측 블록을 생성하는 방법과 관련된 신택스를 시그널링하거나 파싱하지 않을 수 있다.
유도된 예측 모드 기반의 후보 리스트는 현재 블록의 부호화 모드가 DIMD, TIMD, SGPM, MIP, Intra TMP, TMRL 중에 어느 하나의 모드인 경우, 사용될 수 있다.
현재 블록에 DIMD가 적용된 경우, 비디오 신호 처리 장치는 DIMD를 사용하여 유도된 예측 모드를 유도된 예측 모드 기반의 후보 리스트에 추가할 수 있다. 이때, 유도된 예측 모드 기반의 후보 리스트는 템플릿 코스트에 기반하여 재정렬될 수 있다. 인코더는 유도된 예측 모드 기반의 후보 리스트 내 최적의 예측 모드에 대한 인덱스 정보를 포함하는 비트스트림을 생성하여 시그널링할 수 있고, 디코더는 인덱스 정보를 파싱하여 유도된 예측 모드 기반의 후보 리스트 내에서 현재 블록을 위한 예측 모드를 결정할 수 있다.
현재 블록에 TIMD가 적용된 경우, 비디오 신호 처리 장치는 TIMD를 사용하여 유도된 예측 모드를 유도된 예측 모드 기반의 후보 리스트에 추가할 수 있고, 유도된 예측 모드 기반의 후보 리스트는 템플릿 코스트에 기반하여 재정렬될 수 있다. 인코더는 유도된 예측 모드 기반의 후보 리스트 내 최적의 예측 모드에 대한 인덱스 정보를 포함하는 비트스트림을 생성하여 시그널링할 수 있고, 디코더는 최적의 예측 모드에 대한 인덱스 정보를 파싱하여 유도된 예측 모드 기반의 후보 리스트 내 최적의 예측 모드를 결정할 수 있다.
현재 블록에 SGPM이 적용된 경우, 비디오 신호 처리 장치는 분할된 2개 영역의 인트라 예측 모드를 유도하는데 유도된 예측 모드 기반의 후보 리스트를 사용할 수 있고, 인코더는 분할된 2개 영역 중에서 하나 이상의 영역에 대한 최적의 예측 모드에 대한 인덱스 정보를 포함하는 비트스트림을 생성하여 시그널링할 수 있고, 디코더는 인덱스 정보를 파싱하여 분할된 2개 영역 중에서 하나 이상의 영역에 대한 예측 모드를 상기 리스트로부터 결정할 수 있다.
현재 블록에 DIMD가 적용된 경우, 비디오 신호 처리 장치는 인트라 TMP를 사용하여 유도된 블록 벡터 후보들을 유도된 예측 모드 기반의 후보 리스트에 추가할 수 있고, 유도된 예측 모드 기반의 후보 리스트는 템플릿 코스트에 기반하여 재정렬될 수 있다. 인코더는 유도된 예측 모드 기반의 후보 리스트 내 최적의 예측 모드에 대한 인덱스 정보를 포함하는 비트스트림을 생성하여 시그널링할 수 있고, 디코더는 해당 인덱스 정보를 파싱하여 유도된 예측 모드 기반의 후보 리스트 내 최적의 예측 모드를 결정할 수 있다.
현재 블록에 TMRL이 적용된 경우, 비디오 신호 처리 장치는 유도된 예측 모드 기반의 후보 리스트와 참조 샘플 라인을 사용하여 통합 후보 리스트를 구성할 수 있다. 통합 리스트는 템플릿 코스트를 기반으로 재정렬될 수 있다. 인코더는 유도된 예측 모드 기반의 후보 리스트 내 최적의 예측 모드와 참조 샘플 라인에 대한 인덱스 정보를 포함하는 비트스트림을 생성하여 시그널링할 수 있고, 디코더는 해당 인덱스에 대한 정보를 파싱하여 유도된 예측 모드 기반의 후보 리스트 내 최적의 예측 모드 참조 샘플 라인을 통합 리스트로부터 결정할 수 있다.
Non-MPM 리스트는 템플릿을 이용하여 템플릿 코스트에 기초하여 재정렬될 수 있고, Non-MPM 리스트는 최적의 인트라 예측 모드를 시그널링하거나 파싱하는데 사용될 수 있다.
현재 블록을 위한 MPM 리스트(예, 프라미어리(Primary) MPM 리스트, 세컨더리(Secondary) MPM 리스트) 또는 Non-MPM 리스트는 주변 블록에서 사용된 인트라 예측 모드들의 발생 빈도에 따라 구성되거나 재정렬될 수 있다. 주변 블록에 사용된 인트라 예측 모드는 주변 블록이 DIMD인 경우에는 최대 J개의 인트라 예측 모드일 수 있으며, 주변 블록이 TIMD 모드인 경우에는 최대 K개의 인트라 예측 모드일 수 있으며, 주변 블록이 SGPM 모드인 경우에는 최대 L개의 인트라 예측 모드일 수 있으며, 주변 블록이 인트라 TMP 또는 IBC 모드인 경우에는 인트라 TMP 또는 IBC 모드가 적용된 블록에 저장된 인트라 예측 모드(또는 인트라 TMP 또는 IBC 모드가 적용된 블록의 블록 벡터가 지시하는 블록의 인트라 예측 모드)일 수 있다. 주변 블록에 대한 정보는 현재 블록에 인접한 블록, 현재 블록에 인접하지 않고 미리 지정된 거리만큼 떨어진 블록, 별도의 메모리에 저장된 주변 블록 등을 포함할 수 있다. 또한, 주변 블록에 대한 정보는 주변 블록의 인트라 예측 방향성 모드 정보 및 각 모드에 대한 가중치 값을 포함할 수 있다. 비디오 신호 처리 장치는 주변 블록으로부터 유도된 인트라 예측 모드를 이용하여 인트라 예측 모드에 대한 히스토그램을 생성할 수 있다. 이때, J, K, L은 정수 일 수 있으며, 각각 5, 2, 2, 일 수 있다. 비디오 신호 처리 장치는 인트라 예측 모드에 대한 히스토그램을 이용하여 현재 블록에 대한 MPM 리스트를 구성할 수 있다. 발생 빈도가 높은 순부터 낮은 순으로 프라이머리 MPM 리스트에 추가될 수 있으며, 프라이머리 MPM 리스트가 미리 지정된 최대 개수만큼 채워졌다면, 다음 발생 빈도 순으로 세컨더리 MPM 리스트에 추가될 수 있다. 세컨더리 MPM 리스트가 미리 지정된 최대 개수만큼 채워졌다면, 다음 발생 빈도 순으로 Non-MPM 리스트에 추가될 수 있다. 인트라 예측 모드에 대한 히스토그램은 블록마다 갱신되어 블록의 MPM 리스트 혹은 Non-MPM 리스트를 구성하는데 사용될 수 있다.
또한, 비디오 신호 처리 장치는 현재 블록의 MPM 리스트를 먼저 구성한 후, 인트라 예측 모드에 대한 히스토그램을 이용하여 MPM 리스트 또는 Non-MPM 리스트에 대한 재정렬을 수행할 수 있다. 구체적으로, 비디오 신호 처리 장치는 인트라 예측 모드에 대한 히스토그램에서 발생 빈도가 높은 순서부터 낮은 순서대로 기준 인트라 예측 모드를 차례로 설정한 후, 기준 인트라 예측 모드에 기초하여 MPM 리스트 또는 Non-MPM 리스트를 재정렬할 수 있다. 그리고, 비디오 신호 처리 장치는 MPM 리스트 또는 Non-MPM 리스트에서 기준 인트라 예측 모드와 동일하거나 미리 지정된 값만큼의 차이를 가진 인트라 예측 모드를 MPM 리스트 또는 Non-MPM 리스트의 상위 순서로 순서를 변경할 수 있다. 미리 지정된 값은 정수로 3일 수 있다.
비디오 신호 처리 장치가 Non-MPM 리스트에 인트라 예측 모드를 추가하는 순서는 현재 블록의 가로 및 세로 크기에 기초하여 달라질 수 있다. 예를 들어, 현재 블록의 가로의 크기가 세로의 크기보다 크다면, 인트라 예측 모드(예, 도 6의 예측 모드) 중에서 미리 지정된 제1 인트라 예측 모드부터 미리 지정된 제2 인트라 예측 모드 순으로 추가될 수 있다. 제1 인트라 예측 모드는 66번 인덱스의 예측 모드일 수 있고, 제2 인트라 2번 인덱스의 예측 모드일 수 있다.
또한, 현재 블록의 가로의 크기가 세로의 크기보다 크다면, 인트라 예측 모드 중에서 미리 지정된 제1 인트라 예측 모드부터 미리 지정된 제2 인트라 예측 모드 순으로 추가된 후, 미리 지정된 제3 인트라 예측 모드부터 미리 지정된 제4 인트라 예측 모드 순으로 추가될 수 있다. 제1 인트라 예측 모드는 34번 인덱스의 예측 모드일 수 있고, 제2 인트라 예측 모드는 66번 인덱스의 예측 모드일 수 있고, 제3 인트라 예측 모드는 33번 인덱스의 예측 모드일 수 있고, 제4 인트라 예측 모드는 2번 인덱스의 예측 모드일 수 있다.
비디오 신호 처리 장치는 하나의 인트라 예측 모드를 기준 인트라 예측 모드로 사용하여 미리 정의된 규칙을 통해 하나 이상의 인트라 예측 모드를 추가로 유도할 수 있다. 비디오 신호 처리 장치는 기준 인트라 예측 모드 및 유도된 인트라 예측 모드를 사용하여 하나 이상의 예측 블록을 생성할 수 있다. 그리고, 비디오 신호 처리 장치는 복수의 예측 블록을 생성한 경우, 복수의 예측 블록들을 가중치 평균(fusion)하여 최종 예측 블록을 생성할 수 있다. 미리 정의된 규칙은 기준 인트라 예측 모드를 기반으로 미리 지정된 값을 더하거나 빼서 추가적인 인트라 예측 모드를 구성하는 것일 수 있다. 미리 지정된 값은 1이상의 정수일 수 있다. 예를 들어, 기준 인트라 예측 모드가 18번 모드인 경우, 추가적으로 유도되는 인트라 예측 모드는 17(18-1)번 모드, 19(18+1)번 모드일 수 있다. 비디오 신호 처리 장치는 하나 이상의 참조 픽셀 라인을 사용하여 복수의 예측 블록을 생성한 후, 예측 블록들을 가중치 평균(fusion)하여 최종 예측 블록을 생성할 수 있다. 복수의 예측 블록들을 가중치 평균하여 최종 예측 블록을 생성하는 방법은 기준 인트라 예측 모드 기반의 퓨전 방법이라 기술될 수 있다.
기준 인트라 예측 모드 기반의 퓨전 방법은 다양한 방법으로 적용될 수 있다. 예를 들어, 기준 인트라 예측 모드에 대한 후보 리스트를 기반으로 적용될 수 있다. 비디오 신호 처리 장치는 현재 블록의 위치, 현재 블록의 가로 및 세로의 크기, 현재 블록이 휘도 블록인지 색차 블록인지 여부, 현재 블록의 부호화 모드가 인트라 모드인지 여부, 현재 블록의 부호화 모드가 BDPCM, DIMD, TIMD, Intra TMP, MIP, SGPM, TMRL, EIP, IBC 모드 중에 어느 하나인지 여부 중에서 하나 이상을 사용하여 현재 블록에 기준 인트라 예측 모드 기반의 퓨전 방법이 적용되는지를 판단할 수 있다. 현재 블록에 기준 인트라 예측 모드 기반의 퓨전 방법이 적용되는 경우, 비디오 신호 처리 장치는 기준 인트라 예측 모드에 대한 후보 리스트를 구성할 수 있다. 후보 리스트에는 모든 인트라 예측 모드가 포함될 수 있다. 또는, 후보 리스트는 미리 지정된 인트라 예측 모드만 포함될 수 있다. 예를 들어, 후보 리스트는 평면 모드와 DC 모드를 제외한 방향성을 가진 인트라 예측 모드만 포함될 수 있다. 또는, 후보 리스트는 평면 모드, DC 모드, 2번 모드(도 6 참고), 66번 모드(도 6 참고)를 제외한 방향성을 가진 인트라 예측 모드만 포함될 수 있다. 비디오 신호 처리 장치는 후보 리스트의 모든 인트라 예측 모드에 각각에 대하여 템플릿 코스트에 기반한 코스트를 계산한 후, 코스트에 기초하여 후보 리스트를 재정렬할 수 있다. 비디오 신호 처리 장치는 후보 리스트에서 템플릿 코스트가 낮은 미리 지정된 개수의 후보만을 사용하여 최종 후보 리스트를 구성할 수 있다. 미리 지정된 개수는 2이상의 정수일 수 있다. 인코더는 현재 블록에 기준 인트라 예측 모드 기반의 퓨전 모드가 적용되었는지 여부를 나타내는 정보를 포함하여 비트스트림을 생성하고, 시그널링할 수 있다. 또한, 인코더는 기준 인트라 예측 모드 기반의 퓨전 모드가 적용된 경우, 후보 리스트 내의 최적의 후보를 나타내는 인덱스를 포함하는 비트스트림을 생성하고, 시그널링할 수 있다. 디코더는 현재 블록에 기준 인트라 예측 모드 기반의 퓨전 모드가 적용되었는지 여부를 나타내는 정보를 파싱하고, 파싱 결과에 기초하여 현재 블록에 기준 인트라 예측 모드 기반의 퓨전 모드가 적용되었는지 결정할 수 있다. 또한, 기준 인트라 예측 모드 기반의 퓨전 모드가 적용된 경우, 디코더는 최적의 후보를 나타내는 인덱스를 파싱하고, 파싱 결과에 기초하여 후보 리스트 내에서 최적의 후보를 결정할 수 있다. 비디오 신호 처리 장치는 현재 블록을 위한 최적의 기준 인트라 예측 모드를 사용하여 미리 정의된 규칙을 통해 하나 이상의 인트라 예측 모드를 추가로 유도할 수 있다. 그리고 비디오 신호 처리 장치는 최적의 기준 인트라 예측 모드 및 유도된 인트라 예측 모드를 사용하여 복수의 예측 블록을 생성한 후, 복수의 예측 블록들을 가중치 평균(fusion)하여 최종 예측 블록을 생성할 수 있다. 또는, 비디오 신호 처리 장치는 후보 리스트 중에서 템플릿 코스트가 최소인 후보를 최적의 기준 인트라 예측 모드로 결정할 수 있다. 이때, 인코더는 최적의 후보를 나타내는 인덱스를 비트스트림에 포함하지 않을 수 있고, 디코더는 최적의 후보를 나타내는 인덱스를 파싱하지 않을 수 있다. 비디오 신호 처리 장치가 복수의 예측 블록들을 가중치 평균(fusion)할 때, 사용되는 가중치는 미리 정의될 수 있다. 기준 인트라 예측 모드에 대한 가중치가 유도된 인트라 예측 모드에 대한 가중치보다 클 수 있다. 예를 들어, 기준 인트라 예측 모드에 대한 가중치는 32일 수 있으며, 유도된 인트라 예측 모드에 대한 가중치는 16일 수 있다. 가중치가 각 예측 블록에 곱해지면서 샘플의 범위가 넓어지므로, 비디오 신호 처리 장치는 다시 원래 샘플의 범위로 맞추는 과정을 수행할 수 있다. 이를 위해, 비디오 신호 처리 장치는 각 샘플마다 (X >> 6)을 적용하여 범위를 맞출 수 있다. X는 샘플의 값을 의미할 수 있다. 또는, 비디오 신호 처리 장치는 복수의 예측 블록들을 가중치 평균(fusion)할 때, 미리 정의된 가중치 유도 방법을 적용하여 가중치 평균을 수행할 수 있다. 미리 정의된 가중치 유도 방법은, 템플릿 코스트에 기초하여 각 예측 블록에 대한 가중치를 결정하는 방법일 수 있다. 템플릿 코스트가 작을수록 높은 가중치가 설정되도록 하기 위해, 비디오 신호 처리 장치는 각 인트라 예측 모드에 대한 템플릿 코스트를 모두 더한 값(A)에서 각 템플릿 코스트를 뺀 값을 A로 나눈 후 전체 가중치 값을 곱함으로써 각 인트라 예측 모드에 대한 정수 단위 가중치를 계산할 수 있다. 전체 가중치는 64일 수 있다.
비디오 신호 처리 장치는 현재 블록에 기준 인트라 예측 모드 기반의 퓨전 모드가 적용되었는지 여부를 나타내는 정보를 부호화 및/또는 복호화할 때, 미리 정의된 확률 모델을 사용할 수 있다. 미리 정의된 확률 모델은 다양할 수 있으며, 비디오 신호 처리 장치는 현재 블록에 인접한 주변 블록들의 정보 및 현재 블록의 부호화 정보에 기초하여 다양한 확률 모델 중에서 하나를 선택할 수 있다. 예를 들어, 현재 블록에 인접한 좌측 주변 블록과 상측 주변 블록이 모두 기준 인트라 예측 모드 기반의 퓨전 모드가 적용된 경우, 비디오 신호 처리 장치는 미리 정의된 제1 확률 모델을 사용할 수 있다. 현재 블록에 인접한 좌측 주변 블록과 상측 주변 블록 중에서 어느 하나만 기준 인트라 예측 모드 기반의 퓨전 모드가 적용된 경우, 비디오 신호 처리 장치는 미리 정의된 제2 확률 모델을 사용할 수 있다. 현재 블록에 인접한 좌측 주변 블록과 상측 주변 블록이 모두 기준 인트라 예측 모드 기반의 퓨전 모드가 적용되지 않은 경우, 비디오 신호 처리 장치는 미리 정의된 제3 확률 모델을 사용할 수 있다. 이때, 제1 확률 모델, 제2 확률 모델, 제3 확률 모델은 서로 다를 수 있다. 이때, 제1 확률 모델, 제2 확률 모델, 제3 확률 모델의 초기 값은 동일할 수 있다.
현재 블록에 기준 인트라 예측 모드 기반의 퓨전 모드가 적용되었는지 여부를 나타내는 정보는 미리 지정된 부호화 모드의 하위 모드로 시그널링될 수 있다. 미리 지정된 부호화 모드는 DIMD, TIMD, Intra TMP, MIP, EIP, TMRL, SGPM, ISP 중에서 하나일 수 있다. 예를 들어, 미리 지정된 부호화 모드가 DIMD 모드인 경우, 비디오 신호 처리 장치는 현재 블록에 DIMD 모드가 적용된 경우에만 현재 블록에 기준 인트라 예측 모드 기반의 퓨전 모드가 적용되었는지 여부를 나타내는 정보를 시그널링하거나 파싱할 수 있다. 현재 블록에 DIMD 모드가 적용되었고, 기준 인트라 예측 모드 기반의 퓨전 모드가 적용된 경우, 비디오 신호 처리 장치는 DIMD 방식으로 유도된 인트라 예측 모드에 기준 인트라 예측 모드 기반의 퓨전 모드를 적용하여 예측 블록을 생성할 수 있다.
또는, 비디오 신호 처리 장치는 기준 인트라 예측 모드 기반의 퓨전 방식이 현재 블록에 적용되는지 여부를 나타내는 정보를 시그널링하거나 파싱하지 않고, 인트라 예측 모드 기반으로 예측 블록이 생성되는 모든 부호화 모드에 기준 인트라 예측 모드 기반의 퓨전 방식을 적용할 수 있다. 예를 들어, DIMD, TIMD, Intra TMP, MIP, EIP, TMRL, SGPM, ISP, MPM 기반의 인트라 예측 모드 중에서 인트라 예측 모드를 기반으로 예측 블록이 생성되는 모든 모드에 기준 인트라 예측 모드 기반의 퓨전 방식을 적용할 수 있다.
현재 블록에 기준 인트라 예측 모드 기반의 퓨전 모드가 적용되는 경우, 비디오 신호 처리 장치는 인트라 예측 모드를 더 넓은 범위의 인트라 예측 모드로 변환하여 예측 블록을 생성하는데 사용할 수 있다. 더 넓은 범위로 변환은 "(MODE<<1) - 2"으로 계산될 수 있으며, 평면 모드와 DC모드는 변환되지 않을 수 있다. 원래 범위로 변환은 "(MODE>>1) + 1"으로 계산될 수 있다. 여기서, MODE는 도 6의 인트라 예측 모드의 인덱스일 수 있다. 더 넓은 범위의 인트라 예측 모드는 템플릿 코스트를 계산할 때에도 사용될 수 있다. 기준 인트라 예측 모드 기반의 퓨전 방식은 DIMD, TIMD, 인트라 TMP, MIP, EIP, TMRL, SGPM, ISP 에서 인트라 예측 모드가 사용되는 경우에 각 인트라 예측 모드에 대해 적용될 수 있다. 기준 인트라 예측 모드 기반의 퓨전 방식은 미리 지정된 참조 샘플 라인에서만 적용될 수 있다. 예를 들어, 기준 인트라 예측 모드 기반의 퓨전 방식이 적용되는 경우, 참조 샘플 라인은 현재 블록에 인접한 참조 샘플일 수 있다. 기준 인트라 예측 모드 기반의 퓨전 방식으로 예측된 블록마다 인트라 예측 모드에 기초한 PDPC가 적용될 수 있다.
현재 블록에 기준 인트라 예측 모드 기반의 퓨전 방식이 적용되는 경우, 기준 인트라 예측 모드 및 유도된 인트라 예측 모드를 사용하여 생성된 예측 블록은 하나 이상의 참조 샘플 라인을 이용하여 획득(생성)될 수 있다. 다시 말해서, 비디오 신호 처리 장치는 하나 이상의 참조 샘플 라인과 기준 인트라 예측 모드를 이용하여 여러 개의 예측 블록을 획득할 수 있고, 비디오 신호 처리 장치는 획득된 각 예측 블록을 가중치 평균하여 퓨전된 제1 예측 블록을 획득할 수 있다. 또한, 비디오 신호 처리 장치는 하나 이상의 참조 샘플 라인과 유도된 인트라 예측 모드 A를 이용하여 복수의 예측 블록을 생성한 후, 각 예측 블록을 가중치 평균하여 퓨전된 제2 예측 블록을 생성할 수 있다. 또는, 비디오 신호 처리 장치는 하나 이상의 참조 샘플 라인과 유도된 인트라 예측 모드 B를 이용하여 복수의 예측 블록을 생성한 후, 각 예측 블록을 가중치 평균하여 퓨전된 제3 예측 블록을 생성할 수 있다. 제1, 제2, 제3 예측 블록을 생성할 때 사용되는 가중치는 미리 정의될 수 있다. 메인 참조 샘플 라인을 이용하여 예측되는 블록에 대한 가중치는 서브 참조 샘플 라인을 이용하여 예측되는 블록에 대한 가중치보다 클 수 있다(또는 같거나 작을 수 있다). 예를 들어, 메인 참조 샘플 라인을 이용하여 예측되는 블록에 대한 가중치는 3일 수 있으며, 서브 참조 샘플 라인을 이용하여 예측되는 블록에 대한 가중치는 1일 수 있다.
비디오 신호 처리 장치가 획득하는 현재 블록에 대한 예측 블록은, MPM 리스트 내의 하나 이상의 인트라 예측 모드를 사용하여 퓨전된 예측 블록일 수 있다. 이때, 비디오 신호 처리 장치는 Primary MPM 리스트, Secondary MPM 리스트, Non-MPM 리스트 중에서 하나 이상의 인트라 예측 모드를 사용하여 퓨전된 예측 블록을 획득할 수 있다. 또는, 비디오 신호 처리 장치는 Primary MPM 리스트 내의 모든 후보들만을 사용하여 퓨전된 예측 블록을 획득할 수 있다. 또는 비디오 신호 처리 장치는 Primary MPM 리스트, Secondary MPM 리스트, Non-MPM 리스트 중에서 하나 이상의 인트라 예측 모드를 사용하여 인트라 예측 모드 조합 후보를 구성한 후, 조합 후보를 사용하여 조합 후보 리스트를 구성할 수 있다. 인코더는 퓨전 기반의 인트라 예측 모드가 적용되는지 여부를 나타내는 정보와 조합 후보 리스트 내 최적의 조합 후보를 나타내는 인덱스를 포함하는 비트스트림을 획득하고 시그널링할 수 있다. 디코더는 퓨전 기반의 인트라 예측 모드가 적용되는지 여부를 나타내는 정보와 조합 후보 리스트 내 최적의 조합 후보를 나타내는 인덱스를 파싱하고, 파싱 결과에 기초하여 조합 후보를 구성한 후 조합 후보에 기초하여 현재 블록을 위한 예측 블록을 획득할 수 있다. 인트라 예측 모드 또는 조합 후보 내의 인트라 예측 모드에 대한 가중치는 기 설정된 가중치 또는 상술한 가중치 유도 방법을 이용하여 유도된 가중치가 적용될 수 있다. 조합 후보 내의 인트라 예측 모드의 개수는 2개 이상일 수 있다. 예를 들어, 2개의 인트라 예측 모드로 구성된 조합 후보가 존재할 수 있으며, 또는 3, 4, 5, … N개의 인트라 예측 모드로 구성된 조합 후보가 존재할 수 있다.
인트라 예측 모드의 범위는 평면 모드(도 6에서 0번 모드), DC 모드(도 6에서 1번 모드)를 제외하면, 2번 ~ 66 번 모드까지의 방향성 모드가 사용될 수 있다. TIMD, TMRL 등과 같이 인트라 예측 모드를 유도하여 인트라 예측에 사용하는 모드의 경우, 각 모드 간의 각도를 좁혀서 인트라 예측 모드의 범위를 2번 ~ 130번 모드까지 2배로 확장하여 예측에 사용할 수 있다. DIMD 모드는 복원된 주변 샘플들로부터 2번 ~ 66 번 모드까지의 방향성 모드를 계산하여 인트라 예측 모드로 사용하는 방법이다. DIMD 모드에서 복원된 주변 샘플들로부터 계산되는 방향성 모드의 범위를 2번 ~ 130 번 모드까지의 방향성 모드로 계산하여 현재 블록을 위한 인트라 예측 모드로 사용할 수 있다. 비디오 신호 처리 장치는 모든 블록에 대해 DIMD 모드에서 방향성 모드의 범위를 확장하는 방법을 적용할 수 있다. DIMD 모드에서 방향성 모드의 범위를 확장하는 방법은 블록마다 선택적으로 적용될 수 있다. 인코더는 현재 블록이 DIMD 모드로 부호화되는 경우에 방향성 범위를 나타내는 정보를 비트스트림에 포함하고, 시그널링할 수 있다. 디코더는 DIMD 모드로 부호화되는 경우에 방향성 범위를 나타내는 정보를 파싱하여 현재 블록에 대한 DIMD 인트라 예측 모드를 계산(유도)하는데 사용할 수 있다. 방향성 범위를 나타내는 정보는 2번 ~ 66번까지 방향성 모드의 범위가 사용되는지 2번 ~ 130번까지 방향성 모드의 범위를 사용되는지를 나타낼 수 있다. 비디오 신호 처리 장치는 현재 블록의 부호화 모드가 DIMD이고 방향성 모드가 2번 ~ 130번까지의 범위가 사용되었다면, 다음에 부호화될 블록을 위해 현재 블록의 방향성 모드의 범위를 2번 ~ 66번까지의 범위로 축소하여 인트라 예측 모드를 저장할 수 있다. 또는 비디오 신호 처리 장치는 현재 블록의 부호화 모드가 DIMD이고 방향성 모드가 2번 ~ 130번까지의 범위가 사용되었다면, 확장된 인트라 예측 모드의 범위대로 인트라 예측 모드를 저장할 수 있다. DIMD 모드에서 확장된 인트라 예측 모드의 범위의 계산을 위해, 미리 정의된 테이블의 범위는 17에서 33으로 확장될 수 있다. 미리 정의된 테이블의 값은 {0, 2048, 4096, 6144, 8192, 12288, 16384, 20480, 24576, 28672, 32768, 36864, 40960, 47104, 53248, 59392, 65536} 에서 {0, 1024, 2048, 3072, 4096, 5120, 6144, 7168, 8192, 10240, 12288, 14336, 16384, 18432, 20480, 22528, 24576, 26624, 28672, 30720, 32768, 34816, 36864, 38912, 40960, 44032, 47104, 50176, 53248, 56320, 59392, 62464, 65536}으로 변경되어 방향성 모드를 계산하는데 사용될 수 있다.
비디오 신호 처리 장치는 현재 블록의 크기, 현재 블록의 가로의 크기와 세로의 크기 간의 차이(또는 비율), 인트라 예측 방향성 모드에 중 적어도 어느 하나에 기초하여 인트라 예측 모드의 범위를 다르게 설정할 수 있다. 예를 들어, 현재 블록의 가로의 크기가 세로의 크기보다 크고, 인트라 예측 방향성 모드가 34번 모드(도 6 참고)보다 크다면, 비디오 신호 처리 장치는 현재 블록의 인트라 예측 모드의 범위를 2번~130번까지의 범위가 사용되도록, 현재 인트라 예측 모드의 범위를 스케일링할 수 있다. 이때 스케일링은 "(MODE<<1) - 2"을 이용하여 수행될 수 있다. 또는 비디오 신호 처리 장치는 현재 블록의 크기, 현재 블록의 가로의 크기와 세로의 크기 간의 차이(또는 비율) 중 적어도 어느 하나에 기초하여 인트라 예측 모드의 각도의 종류, 인트라 예측 모드의 개수를 다르게 설정할 수 있다. 예를 들어, 현재 블록의 가로의 크기가 세로의 크기보다 크다면, 비디오 신호 처리 장치는 도 6의 2번 내지 34번 모드 중 짝수 모드만 남기고 홀수 모드는 삭제하여 모드의 개수를 32개에서 16개로 줄일 수 있다. 그리고, 현재 블록의 가로의 크기가 세로의 크기보다 크다면, 비디오 신호 처리 장치는 도 6의 34번 내지 66번까지의 모드의 각 모드 사이에 새로운 각도 모드를 16개 추가하여, 모드의 개수를 31개에서 47개로 확장시킬 수 있다. 이때 새로운 각도 모드는 미리 지정된 각도 모드일 수 있고, 34번 모드에서 35번 사이의 각도, 35번에서 36번 사이의 각도와 같은 모드일 수 있다.
현재 블록에 TIMD(또는 TMRL) 모드가 적용되면 확장된 인트라 예측 모드의 범위가 사용될 수 있다. 따라서, 비디오 신호 처리 장치는 주변 블록으로부터 유도된 인트라 예측 모드가 확장된 인트라 예측 모드의 범위를 사용하지 않는 모드이거나 기본 인트라 예측 모드의 범위(2번 ~ 66번까지의 범위)로 저장된 모드인 경우, 인트라 예측 모드의 범위를 확장된 인트라 예측 모드의 범위로 스케일링할 수 있다. 이때 스케일링 방법은 "(MODE<<1) - 2"으로 계산될 수 있으며, 평면 모드와 DC모드는 변환되지 않을 수 있다. 원래 범위로 역스케일링은 "(MODE>>1) + 1"으로 계산될 수 있으며, 평면 모드와 DC모드는 변환되지 않을 수 있다. 확장된 인트라 예측 모드의 범위를 사용하지 않는 모드는 DIMD, TIMD, TMRL이 아닌 부호화 모드일 수 있으며, SGPM, ISP, MIP, Intra TMP, IBC, EIP, MPM 기반의 모드일 수 있다. 따라서, 주변 블록의 부호화 모드가 SGPM, ISP, MIP, Intra TMP, IBC, EIP, MPM 기반의 모드의 경우에는 확장된 인트라 예측 모드의 범위로 스케일링될 수 있으며, 현재 블록의 TIMD 인트라 예측 모드를 유도하는 데 사용될 수 있다.
현재 블록에 SGPM(또는 GPM 혹은 MPM 기반의 모드) 모드가 적용되면 기본 인트라 예측 모드의 범위(2번 ~ 66번까지의 범위)가 사용될 수 있다. 따라서, 비디오 신호 처리 장치는 주변 블록으로부터 유도된 인트라 예측 모드가 확장된 인트라 예측 모드의 범위를 사용하는 모드인 경우에는 확장된 인트라 예측 모드의 범위를 기본 인트라 예측 모드의 범위로 역스케일링을 수행할 수 있다. 주변 블록의 부호화 모드가 DIMD, TIMD, TMRL 기반의 모드의 경우에는 비디오 신호 처리 장치는 인트라 예측 모드의 범위를 기본 인트라 예측 모드의 범위로 역스케일링하여, 현재 블록의 인트라 예측 모드를 유도하는 데 사용될 수 있다.
현재 색차 블록에 DM (Derived Mode) 모드가 적용되면 기본 인트라 예측 모드의 범위(2번 ~ 66번까지의 범위)가 사용될 수 있다. 따라서, 비디오 신호 처리 장치는 현재 색차 블록에 대응되는 휘도 블록으로부터 유도된 인트라 예측 모드가 확장된 인트라 예측 모드의 범위를 사용하는 모드인 경우에는 확장된 인트라 예측 모드의 범위를 기본 인트라 예측 모드의 범위로 역스케일링할 수 있다. 비디오 신호 처리 장치는 현재 색차 블록에 대응되는 휘도 블록의 부호화 모드가 DIMD, TIMD, TMRL 기반의 모드의 경우에는 확장된 인트라 예측 모드의 범위를 기본 인트라 예측 모드의 범위로 역스케일링하여, 현재 색차 블록의 인트라 예측 모드를 유도하는 데 사용될 수 있다.
비디오 신호 처리 장치는 현재 블록에 DIMD 모드가 적용된 경우, 현재 블록에는 확장된 인트라 예측 모드의 범위가 사용될 수 있다. 따라서, 비디오 신호 처리 장치는 현재 블록에 DIMD 모드가 적용된 경우, 변환 커널을 유도함에 있어, 확장된 인트라 예측 모드의 범위를 기본 인트라 예측 모드의 범위로 역스케일링할 수 있다. 비디오 신호 처리 장치는 기본 인트라 예측 모드의 범위로 역스케일링된 인트라 예측 모드에 기초하여 MTS, LFNST, NSPT 등의 변환 커널 세트, 변환 커널, 변환 타입 중에 하나를 유도할 수 있다.
비디오 신호 처리 장치는 현재 블록에 대한 인트라 예측 모드를 보정하여 최종 인트라 예측 모드를 결정할 수 있다. 이때, 비디오 신호 처리 장치는 현재 블록의 인트라 예측 모드를 사용하여 추가적인 인트라 예측 모드를 유도한 후, 템플릿 코스트를 기반으로 코스트가 낮은 인트라 예측 모드를 결정하는 방식으로 인트라 예측 모드에 대한 보정을 수행할 수 있다. 추가적인 인트라 예측 모드는 인트라 예측 모드에서 미리 지정된 보정 값을 더하거나 빼서 구할 수 있으며, 미리 지정된 보정 값은 1이상의 정수 일 수 있다. 예를 들어, 현재 블록에 대한 인트라 예측 모드가 24번인 경우, 비디오 신호 처리 장치는 추가적인 인트라 예측 모드 23(24-1)번, 25(24+1)번을 유도할 수 있다. 그리고, 비디오 신호 처리 장치는 23, 24, 25번 인트라 예측 모드를 사용하여 템플릿 코스트를 계산하고, 템플릿 코스트가 가장 작은 인트라 예측 모드를 현재 블록의 인트라 예측 모드로 적용할 수 있다. 이때, 현재 블록의 인트라 예측 모드의 범위가 2번 ~ 66번까지의 범위인 경우, 비디오 신호 처리 장치는 2번 ~ 130번까지의 인트라 예측 모드를 생성하여, 추가적인 인트라 예측 모드로 설정할 수 있다. 그리고, 비디오 신호 처리 장치는 추가적인 인트라 예측 모드를 최종 인트라 예측 모드로 설정할 수 있다. 비디오 신호 처리 장치는 최종 인트라 예측 모드에 기초하여 현재 블록의 예측 블록을 획득할 수 있다. 현재 블록에 대한 인트라 예측 모드를 보정하는 방법은 DIMD, TIMD, TMRL, SGPM, ISP, MIP, Intra TMP, IBC, EIP, MPM 기반의 모드에 적용될 수 있다.
인트라 예측 모드의 범위는 블록마다 선택적으로 적용될 수 있고, 블록마다 선택적으로 인트라 예측 모드가 적용되는 방법은 AIDR(Adaptive Intra Directional mode Resolution)이라고 할 수 있다. 이때, 인트라 예측 모드의 범위는 다양하게 구성될 수 있다. 예를 들어, 제1 범위 모드는 2번 ~ 34번까지의 범위가 될 수 있으며, 제2 범위 모드는 2번 ~ 66번까지의 범위가 될 수 있으며, 제3 범위 모드는 2번 ~ 130번까지의 범위가 될 수 있다. 인코더는 현재 블록의 부호화 모드가 묵시적으로(암묵적으로) 인트라 예측 모드를 유도하는 모드(예를 들어 DIMD, TIMD, TMRL, SGPM, ISP, MIP, Intra TMP, IBC, EIP)가 아닌 경우(즉, MPM 기반의 부호화 모드로써, 명시적으로 인트라 예측 모드를 시그널링하는 모드), 범위 모드를 나타내는 정보를 비트스트림에 포함하여 시그널링할 수 있다. 범위 모드를 나타내는 정보는 Primary MPM 인덱스가 시그널링되기 전에 시그널링될 수 있다. 또는 범위 모드를 나타내는 정보는 Secondary MPM 인덱스가 시그널링되기 전에 시그널링될 수 있다. 또는 범위 모드를 나타내는 정보는 Non-MPM 인덱스가 시그널링되기 전에 시그널링될 수 있다. 또는 범위 모드를 나타내는 정보는 Primary MPM 인덱스, Secondary MPM 인덱스, Non-MPM 인덱스 중에서 어느 하나가 시그널링된 후에 시그널링될 수 있다. 디코더는 범위 모드를 나타내는 정보를 파싱하여 현재 블록에 대한 인트라 예측 모드의 범위를 설정할 수 있다.
현재 블록의 부호화 모드가 묵시적으로 인트라 예측 모드를 유도하는 모드(예를 들어 DIMD, TIMD, TMRL, SGPM, ISP, MIP, Intra TMP, IBC, EIP)가 적용된 경우, 묵시적으로 제3 범위 모드인 확장된 인트라 예측 모드의 범위가 사용될 수 있다. 현재 블록의 부호화 모드가 묵시적으로 인트라 예측 모드를 유도하는 모드인 경우에는 주변 블록의 인트라 예측 모드가 사용될 수 있다. 주변 블록으로부터 유도된 인트라 예측 모드가 확장된 인트라 예측 모드의 범위를 사용하지 않는 모드이거나 기본 인트라 예측 모드의 범위(2번 ~ 66번까지의 범위)로 저장된 모드, 제1 범위 모드 또는 제2 범위 모드인 경우, 비디오 신호 처리 장치는 인트라 예측 모드의 범위를 확장된 인트라 예측 모드의 범위로 스케일링할 수 있다.
현재 블록에 SGPM(또는 GPM 또는 MPM 기반의 모드) 모드가 적용될 때 기본 인트라 예측 모드의 범위(2번 ~ 66번까지의 범위)가 사용될 수 있다. 따라서, 주변 블록으로부터 유도된 인트라 예측 모드가 제1 범위 모드 또는 제3 범위 모드인 경우, 비디오 신호 처리 장치는 유도된 인트라 예측 모드를 기본 인트라 예측 모드의 범위로 스케일링 또는 역스케일링할 수 있다. 즉, 현재 블록에 기본 인트라 예측 모드의 범위로 부호화되는 모드가 적용되고, 주변 블록의 부호화 모드가 제1 범위 모드인 경우, 비디오 신호 처리 장치는 주변 블록의 부호화 모드를 기본 인트라 예측 모드의 범위로 스케일링할 수 있고, 스케일링된 인트라 예측 모드 범위를 현재 블록의 인트라 예측 모드를 유도하는 데 사용될 수 있다. 또는, 현재 블록에 기본 인트라 예측 모드의 범위로 부호화되는 모드가 적용되고, 주변 블록의 부호화 모드가 제3 범위 모드인 경우, 비디오 신호 처리 장치는 주변 블록의 부호화 모드를 기본 인트라 예측 모드의 범위로 역스케일링할 수 있고, 역스케일링된 인트라 예측 모드 범위를 현재 블록의 인트라 예측 모드를 유도하는 데 사용될 수 있다.
현재 색차 블록에 DM (Derived Mode) 모드가 적용될 때 기본 인트라 예측 모드의 범위(2번 ~ 66번까지의 범위)가 사용될 수 있다. 따라서, 현재 색차 블록에 대응되는 휘도 블록으로부터 유도된 인트라 예측 모드가 제1 범위 모드 또는 제3 범위 모드인 경우, 비디오 신호 처리 장치는 유도된 인트라 예측 모드를 기본 인트라 예측 모드의 범위로 스케일링 또는 역스케일링할 수 있다. 현재 색차 블록에 대응되는 휘도 블록의 부호화 모드가 제1 범위 모드인 경우에는 제1 범위 모드는 기본 인트라 예측 모드의 범위로 스케일링될 수 있고, 스케일링된 예측 모드 범위는 현재 색차 블록의 인트라 예측 모드를 유도하는 데 사용될 수 있다. 또는, 현재 색차 블록에 대응되는 휘도 블록의 부호화 모드가 제3 범위 모드인 경우에는 제3 범위 모드는 기본 인트라 예측 모드의 범위로 역스케일링될 수 있고, 역스케일링된 예측 모드 범위는 현재 색차 블록의 인트라 예측 모드를 유도하는 데 사용될 수 있다.
비디오 신호 처리 장치는 제1 범위 모드가 적용된 현재 블록에 대한 변환 커널을 유도할 때, 인트라 예측 모드를 기본 인트라 예측 모드의 범위로 스케일링한 후, 스케일링된 인트라 예측 모드에 기초하여 변환 커널을 유도할 수 있다. 비디오 신호 처리 장치는 제3 범위 모드가 적용된 현재 블록에 변환 커널을 유도할 때, 인트라 예측 모드를 기본 인트라 예측 모드의 범위로 역스케일링한 후, 역스케일링된 인트라 예측 모드에 기초하여 변환 커널을 유도할 수 있다. 인트라 예측 모드에 대한 스케일링 및 역스케일링 과정은 MTS, LFNST, NSPT 등에 적용될 수 있다.
확장된 인트라 예측 모드 범위는 모든 블록에 적용될 수 있다. 또한 비디오 신호 처리 장치는 현재 블록의 부호화 모드 또는 현재 블록의 범위 모드에 대한 정보 중에서 하나 이상을 사용하여 주변 블록으로부터 유도된 인트라 예측 모드에 대한 스케일링 및 역스케일링을 수행하여 현재 블록에 대한 인트라 예측 모드를 유도하는데 사용할 수 있다.
현재 블록의 부호화 모드가 명시적으로 인트라 예측 모드를 설정하는 모드(예를 들어 MPM 기반의 인트라 예측 모드)가 적용된 경우, 범위 모드에 대한 정보에 따라 Primary MPM, Secondary MPM, Non-MPM 리스트의 구성 방법이 달라질 수 있다. 또는 범위 모드에 대한 정보에 따라 Primary MPM, Secondary MPM, Non-MPM 리스트의 개수가 달라질 수 있다. 제1 범위 모드(2번 ~ 34번까지의 범위)의 경우, Primary MPM 리스트의 개수는 평면 모드를 제외하고 A개일 수 있으며, Seconary MPM은 사용되지 않고, Non-MPM 리스트의 개수는 B개일 수 있다. 이때, A, B는 1이상의 정수일 수 있으며, A는 5, B는 29일 수 있다. 또는 A는 3, B는 31일 수 있다. 제2 범위 모드(2번 ~ 66번까지의 범위)의 경우, Primary MPM 리스트의 개수는 평면 모드를 제외하고 C개일 수 있으며, Secondary MPM 리스트의 개수는 D개일 수 있으며, Non-MPM 리스트의 개수는 E개일 수 있다. 이때, C는 5, D는 16, E는 45일 수 있다. 제3 범위 모드(2번 ~ 130번까지의 범위)의 경우, Primary MPM 리스트의 개수는 평면 모드를 제외하고 F개일 수 있으며, Secondary MPM 리스트의 개수는 G개일 수 있으며, Non-MPM 리스트의 개수는 H개일 수 있다. 이때, F는 8, G는 32, H는 91일 수 있다. 또는 제3 범위 모드의 경우, Primary MPM 리스트의 개수는 평면 모드를 제외하고 F개일 수 있으며, Secondary MPM 리스트의 개수는 G개일 수 있으며, Third MPM 리스트의 개수는 H개일 수 있으며, Non-MPM 리스트의 개수는 I개일 수 있다. 이때, F는 8, G는 27, H는 32, I는 64일 수 있다. 또는 제3 범위 모드의 경우, Primary MPM, Secondary MPM, Non-MPM 리스트의 구성 방법은 제2 범위 모드의 구성 방법과 동일한 방법이 사용될 수 있다. 인코더에서는 추가적인 보정 값을 나타내는 정보를 포함하는 비트스트림을 생성하여 시그널링할 수 있고, 디코더는 추가적인 보정 값을 나타내는 정보를 파싱하여, 보정 값을 결정할 수 있다. 따라서, 제3 범위 모드의 경우, 비디오 신호 처리 장치는 MPM 리스트로부터 획득한 인트라 예측 모드에 추가적인 보정 값을 더하여 최종 인트라 예측 모드를 결정할 수 있다. 추가적인 보정 값의 범위는 -1, 0, +1 중에 하나일 수 있다. 또는 제3 범위 모드의 경우, Primay MPM, Secondary MPM, Non-MPM 리스트의 구성 방법은 제2 범위 모드의 구성 방법과 동일한 방법이 사용될 수 있다. 비디오 신호 처리 장치는, 결정된 인트라 예측 모드를 사용하여 제3 범위의 모드가 되도록 추가적인 인트라 예측 모드를 유도한 후, 템플릿 코스트를 기반으로 제3 범위의 최종 인트라 예측 모드를 결정할 수 있다. 이때, 템플릿 코스트가 가장 낮은 인트라 예측 모드가 최종 인트라 예측 모드가 될 수 있다. 이때에도, 추가적인 보정 값이 적용될 수 있다. 또한 비디오 신호 처리 장치는 추가적인 보정 값에 기초하여 구성된 여러 개의 인트라 예측 모드를 사용하여 예측 블록을 생성한 후, 여러 개의 예측 블록을 가중치 평균하여 최종 예측 블록을 생성할 수 있다.
도 41은 본 발명의 실시 예에 따른 참조 샘플 필터링을 보여준다.
비디오 신호 처리 장치 인트라 예측에서 복원된 주변 샘플을 이용한다. 이때, 비디오 신호 처리 장치는 참조 샘플에 대한 필터링을 수행할수 있다. 이를 통해 비디오 신호 처리 장치는 주변 샘플의 잡음으로 인해 발생되는 예측 블록의 주관적 화질 감소를 방지할 수 있다. 도 41의 (a)는 {1, 2, 1} 필터를 이용한 참조 샘플 필터링을 보여준다. 참조 샘플 위치 (X)에 대해 주변 샘플 A와 B를 사용하여 필터링이 수행되는 경우, 비디오 신호 처리 장치는 필터링된 샘플 (X')를 '(A + 2 * X + B) / 4'로 계산할 수 있다. 비디오 신호 처리 장치는 현재 예측할 블록에 인접한 모든 참조 샘플에 대하여 필터링을 수행할 수 있다. 도 41의 (b)는 사이드 배열에 대한 참조 샘플 필터링을 보여준다. 참조 샘플에 대한 메모리 접근을 쉽게 하기 위해, 비디오 신호 처리 장치는 필터링된 사이드 배열의 참조 샘플을 메인 배열에 복사하여 인트라 예측에 사용할 수 있다. 이때, 비디오 신호 처리 장치는 현재 블록의 인트라 예측 방향성 모드에 따라 메인 배열과 사이드 배열을 결정할 수 있다. 인트라 예측 방향성 모드가 34이상인 경우, 비디오 신호 처리 장치는 상단 샘플을 메인 배열로, 좌측 샘플을 사이드 배열로 결정할 수 있다. 인트라 예측 방향성 모드가 34 미만인 경우, 비디오 신호 처리 장치는 상단 샘플을 사이드 배열로, 좌측 샘플은 메인 배열로 결정할 수 있다. 현재 블록의 크기 및 인트라 예측 방향성 모드에 따라, 비디오 신호 처리 장치는 사이드 배열에 위치한 참조 샘플 중 일부를 수정 없이 메인 배열에 복사할 수 있다. 또는 현재 블록의 크기 및 인트라 예측 방향성 모드에 따라, 비디오 신호 처리 장치는 사이드 배열에 위치한 참조 샘플을 인접한 참조 샘플을 사용하여 필터링한 후, 필터링된 사이드 배열의 참조 샘플을 메인 배열에 복사할 수 있다. 이때, 필터링은 큐빅(cubic) 필터, 가우시안(gaussian) 필터, 저주파 필터, 고주파 필터, 및 스무딩 필터 중 어느 하나일 수 있다. 스무딩 필터는 1:2:1 필터일 수 있다. 구체적으로 비디오 신호 처리 장치는 현재 블록의 가로 및 세로의 크기, 인트라 예측 방향성 모드, 참조 샘플 라인의 위치, 및 사이드 배열에서 유도한 참조 샘플이 복사될 메인 배열의 위치 중 적어도 하나 이상을 사용하여, 소수점 샘플 단위로 참조 샘플 위치를 유도할 수 있다. 비디오 신호 처리 장치는 소수점 샘플 단위의 참조 샘플 위치에 인접한 참조 샘플을 사용하여 필터링을 수행할 수 있다. 또한, 비디오 신호 처리 장치는 필터링된 참조 샘플을 메인 배열에 복사하여 인트라 예측에 사용할 수 있다. 소수점 샘플 단위는 1/2 화소, 1/4 화소, 1/16 화소, 및 1/32 화소 중 하나일 수 있다. 비디오 신호 처리 장치는 현재 블록의 가로 및 세로의 크기, 인트라 예측 방향성 모드, 참조 샘플 라인의 위치, 및 사이드 배열에서 유도한 참조 샘플이 복사될 메인 배열의 위치 중 적어도 하나 이상을 사용하여, 참조 샘플에 대한 필터링을 수행할 지 결정할 수 있다. 구체적으로 유도된 소수점 샘플 단위의 참조 샘플 위치가 정수 단위 샘플 위치인 경우, 비디오 신호 처리 장치는 필터링을 수행하지 않을 수 있다. 이때, 비디오 신호 처리 장치는 정수 단위의 참조 샘플을 메인 배열에 복사하여 인트라 예측에 사용할 수 있다.
도 42는 본 발명의 실시 예에 따른 PDPC 필터링을 보여준다.
인트라 예측 블록과 인접한 블록 사이의 경계에서 불연속적인 샘플 값의 변화가 발생될 수 있다. 불연속성은 예측 블록의 상단과 좌측 경계 부분에서 발생될 수 있다. 비디오 신호 처리 장치는 예측 블록이 생성된 후, 예측 블록의 내부에 필터링을 수행할 수 있다. 이를 통해 비디오 신호 처리 장치는 인트라 예측 블록과 인접한 블록 사이의 불연속성을 제거할 수 있다. 구체적으로 비디오 신호 처리 장치는 인트라 모드로 예측한 값과 하나 이상의 미리 복원된 주변 샘플의 값을 가중 평균하는 필터링을 수행할 수 있다. 이때, 주변 샘플은 미리 지정된 위치의 샘플이 선택되거나 인트라 모드의 방향을 기초로 선택될 수 있다. 이를 PDPC(position dependent intra prediction combination)라 지칭한다. PDPC에서 비디오 신호 처리 장치는 인트라 예측 방향성 모드에 따라 필터링 방법을 결정할 수 있다. 도 42의 (a)는 인트라 예측 방향성 모드가 수평 방향인 경우의 PDPC 필터링 방법을 보여준다. 도 42의 (a)에서, 인코더 및 디코더가 예측 블록 내의 (1, 0) 샘플에 대한 필터링을 수행할 때, 비디오 신호 처리 장치는 복원된 주변 샘플 R(-1, 0), R(-1, -1), 및 R(1, -1) 중 적어도 하나와 (1,0) 샘플을 가중 평균하여 (1, 0) 샘플에 대한 필터링을 수행할 수 있다. 이때, 비디오 신호 처리 장치는 인트라 참조 샘플 사이의 차이를 예측 블록 내의 (1, 0) 샘플에 적용할 수 있다. 도 42의 (b)는 인트라 예측 방향성 모드가 평면(planar) 모드, DC 모드, 수평 방향 모드, 및 수직 방향 모드가 아닌 경우에 대한 PDPC 필터링 방법을 보여준다. 도 42의 (b)에서, 인코더 및 디코는 복원된 주변 샘플 R(3, -1), 및 R(-1, 3) 중 적어도 하나를 예측 블록의 (1, 1) 샘플과 가중 평균하여 (1, 1) 샘플에 대한 필터링을 수행할 수 있다. 구체적으로 예측 블록 내의 (1, 1) 샘플이 상단 주변 샘플 R(3, -1)로부터 예측된 것인 경우, 비디오 신호 처리 장치는 인트라 예측 방향성 모드가 지시하는 좌측 주변 샘플 R(-1, 3)를 사용하여 (1, 1) 샘플에 대한 보상을 적용할 수 있다. 여기서 R(x, y)는 현재 블록에 인접한 복원된 샘플일 수 있다. 비디오 신호 처리 장치는 인트라 예측 모드를 이용하여 제1 참조 샘플에서, 예측 블록 내 샘플에 대응되는 제1 주변 샘플로부터 예측 블록 내 샘플에 대한 예측을 수행할 수 있다. 비디오 신호 처리 장치는 제2 참조 샘플에서, 예측 블록 내 샘플 및/또는 제1 참조 샘플에 대응되는 제2 주변 샘플을 사용하여 PDPC를 수행할 수 있다.
앞서 설명한 실시 예들과 같이, PDPC가 적용되는 경우, 주변 샘플 사이의 차이를 기초로 예측 블록 내의 샘플에 대한 필터링이 수행된다. 인트라 예측 모드에 따라 상단 주변 샘플에 대응되는 좌측 주변 샘플을 유도할 수 없을 수 있다. 인트라 예측 모드에 따라서는 좌측 주변 샘플에 대응되는 상단 주변 샘플을 유도할 수 없을 수 있다. 비디오 신호 처리 장치는 상단 주변 샘플과 좌측 주변 샘플로부터 주변 샘플 사이의 변화 차이를 유도할 수 없는 인트라 예측 모드가 적용되는 인트라 예측에서는 PDPC를 적용하지 않을 수 있다. 비디오 신호 처리 장치는 현재 블록의 가로 또는 세로의 크기, 및 인트라 예측 모드 중 적어도 하나 이상을 기초로 현재 블록에 PDPC를 적용할 지 여부를 결정할 수 있다. 이때, 상단 주변 샘플과 좌측 주변 샘플은 좌상단 주변 샘플을 포함할 수 있다. 제1 참조 샘플, 제2 참조 샘플 중 적어도 하나는 주변 샘플 사이의 필터링을 통해서 생성된 샘플일 수 있다. 이때, 주변 샘플 사이의 필터링은 큐빅 필터, 가우시안 필터, 저주파 필터, 고주파 필터, 및 스무딩 필터 중 하나일 수 있다. 스무딩 필터는 1:2:1 필터일 수 있다.
도 43은 본 발명의 실시 예에 따른 그래디언트(gradient) PDPC를 보여준다.
인트라 예측 모드에 따라 주변 샘플 사이의 차이를 유도할 수 없는 경우, 비디오 신호 처리 장치는 예측 블록 내 샘플에 대응되는 주변 샘플을 이용하지 않고, 주변 샘플 중 인트라 예측 모드에 대응되는 샘플 사이의 차이를 예측 블록 내 샘플에 적용할 수 있다. 도 43의 실시 예에서, 비디오 신호 처리 장치는 예측 블록 내 샘플(X)에 대응되는 좌측 참조 샘플을 사용하여 PDPC 과정을 수행하지 않는다. 인코디 및 디코더는 참조 샘플 중 현재 인트라 예측 모드에 대응되는 r(-1+d, -1) 샘플과 r(-1, y) 샘플 사이의 차이를 이용하여, 예측 블록 내 샘플(X)에 대한 PDPC를 수행할 수 있다. 이를 그래디언트 PDPC라 지칭한다. y는 예측 블록 내 샘플의 수직 좌표일 수 있고, d는 인트라 예측 모드가 가리키는 샘플의 소수점 위치일 수 있다. 또한, y는 인트라 예측 모드에 따라 수평 좌표로 변경될 수 있다. 이때, 주변 샘플은 r(-1, -1+d) 샘플과 r(x, -1) 샘플일 수 있다. 비디오 신호 처리 장치는 인트라 예측 모드를 이용하여 예측 블록 내 샘플에 대응되지 않는 제1 참조 샘플과 제2 참조 샘플을 선택하고, 제1 참조 샘플과 제2 참조 샘플 사이의 차이를 사용하여 예측 블록 내 샘플에 적용하는 PDPC를 수행할 수 있다. 제1 참조 샘플 및 제2 참조 샘플 중 적어도 하나는 예측 블록 내 샘플에서 수직 및/또는 수평 좌표 중 하나를 사용하여 유도할 수 있다. 또한, 비디오 신호 처리 장치는 제1 참조 샘플, 제2 참조 샘플 중 적어도 하나는 좌상단 샘플일 수 있다. 이때, 제1 참조 샘플 및 제2 참조 샘플 중 적어도 하나는 주변 샘플 사이의 필터링을 통해 생성된 샘플일 수 있다. 또한, 주변 샘플 사이의 필터링은 큐빅 필터, 가우시안 필터, 저주파 필터, 고주파 필터, 및 스무딩 필터 중 하나일 수 있다. 스무딩 필터는 1:2:1 필터일 수 있다.
CIIP PDPC는 CIIP 모드에서 인트라 예측 블록에 PDPC를 적용하는 모드를 지칭한다.
컴퓨터 그래픽으로 생성되거나 스크린 영상을 캡쳐한 스크린 컨텐츠 영상은 카메라로 촬영된 영상과 다르게 급격한 에지 특성을 가지는 경향이 있다. 특히, 에지 성분은 글자나 도형에서 나타날 수 있다. 에지 성분 영상에 참조 샘플 필터링, PDPC를 적용할 경우, 에지 성분이 완만하게 바뀌어 원본 영상이 갖는 특성이 사라질 수 있다. 비디오 신호 처리 장치는 스크린 컨텐츠 영상에 인트라 예측에서 적용되는 스무딩(smoothing) 필터링을 적용하지 않을 수 있다. 이때, 스무딩 필터링은 참조 샘플 필터링, PDPC, 및 인트라 퓨전 중 적어도 어느 하나를 포함할 수 있다. 이때, PDPC는 그래디언트 PDPC 및 CIIP PDPC 중 적어도 어느 하나를 포함할 수 있다. 또한, 그래디언트 PDPC 및 CIIP PDPC 각각의 비활성화 여부를 지시하는 복수의 플래그가 비트스트림에 포함될 수 있다. 이후 설명하는 실시 예 들에서 PDPC의 비활성화 여부를 지시하는 플래그는 그래디언트 PDPC 및 CIIP PDPC 각각의 비활성화 여부를 지시하는 복수의 플래그일 수 있다.
인코더는 스무딩 필터링 비활성화 여부를 지시하는 스무딩 필터 정보를 비트스트림에 포함시킬 수 있다. 디코더는 비트스트림으로부터 스무딩 필터 정보를 획득하여, 스무딩 필터 비활성화 여부를 판단할 수 있다. 이때, 스무딩 필터 정보는 미리 지정된 레벨로 적용될 수 있다. 이때, 미리 지정된 레벨은 VPS(video parameter set), SPS(sequence parameter set), PPS(picture parameter set), 픽쳐, 슬라이스 타일 및 블록 중 어느 하나일 수 있다.
이러한 실시 예에서 참조 샘플 필터링이 수행되지 않는 경우, 비디오 신호 처리 장치는 도 41의 (b)를 통해 설명한 사이드 배열의 참조 샘플에 적용되는 필터링을 수행하지 않을 수 있다. 이때, 비디오 신호 처리 장치는 메인 배열에서 사용될 사이드 배열의 참조 샘플을 정수 샘플 단위의 참조 샘플로 사용할 수 있다. 인트라 예측 방향성 모드의 각도로 인해, 인코더 및 디코더가 정수 샘플 단위와 일치하는 참조 샘플을 획득하기 어려울 수 있다. 정수 샘플 단위의 참조 샘플을 유도하기 위해, 비디오 신호 처리 장치는 현재 블록의 가로 및 세로의 크기, 인트라 예측 방향성 모드, 참조 샘플 라인의 위치, 및 사이드 배열에서 유도한 참조 샘플이 복사될 메인 배열의 위치 중 적어도 하나 이상을 사용하여, 소수점 샘플 단위의 참조 샘플 위치를 유도할 수 있다. 이때, 비디오 신호 처리 장치는 유도한 소수점 샘플 단위의 참조 샘플 위치와 가장 가까운 정수 샘플 단위의 사이드 배열의 참조 샘플을 메인 배열에 복사하여 인트라 예측에 사용할 수 있다. 소수점 샘플 단위의 참조 샘플 위치는 1/2 화소, 1/4 화소, 1/16 화소, 및 1/32 화소 중 하나의 단위일 수 있다.
앞서 설명한 스무딩 필터 정보는 하나 이상의 플래그로, 하나 이상의 플래그는 각 스무딩 필터 별로 설정될 수 있다.
도 44는 본 명세서의 일 실시예에 따른 OBMC를 수행하는 과정을 나타내는 도면이다.
도 44를 참조하면 디코더는 현재 블록(예, 현재 코딩 유닛)의 움직임 정보(예, 움직임 벡터) 및 현재 블록의 주변 블록들의 움직임 정보를 획득할 수 있다(S810). 디코더는 현재 블록의 서브 블록에 OBMC가 적용되는지 여부를 결정할 수 있다(S820). 이때, 디코더는 각 서브 블록마다 OMBC가 적용되는지 여부를 결정할 수 있다. 디코더는 현재 블록에 어파인(affine) 모드(예, 머지 기반 affine 모드, AMVP 기반 affine 모드), sbTMVP(subblock-based temporal motion vector predictors) 모드, 또는 MP-DMVR(multi-pass decoder-side motion vector refinement) 모드가 적용되는 경우, 현재 블록의 서브 블록에 OBMC가 적용되는 것으로 판단할 수 있다. 현재 블록에 어파인 모드, sbTMVP모드, 또는 MP-DMVR 모드가 적용되는 경우 서브 블록 간 움직임 정보가 상이할 수 있기 때문이다. 디코더는 CU 단위의 OBMC를 수행할 수 있다(S830). CU 단위의 OBMC는 현재 블록의 상측 경계 및 좌측 경계를 포함하는 각 서브 블록마다 독립적으로 수행될 수 있다. 구체적으로, 디코더는 현재 블록을 서브 블록으로 분할할 수 있다. 이때, 각 서브 블록의 크기는 임의의 크기로 양의 값을 가질 수 있다. 예를 들어, 임의의 크기는 4일 수 있다. 디코더는 상기 현재 블록의 서브 블록에 OBMC가 적용되는지 여부에 기초하여, 서브 블록 단위로 OBMC를 수행할 수 있다(S840). 즉, 디코더는 서브 블록에 OBMC가 적용되는 것으로 판단하는 경우, 서브 블록 단위로 OBMC를 수행할 수 있다. S840 단계에서의 OBMC는 상측/좌측 경계를 포함하지 않는 현재 블록 유닛의 서브 블록에 수행될 수 있다. 즉, S830 단계에서 OBMC가 수행되는 서브 블록을 제외한 나머지 서브 블록에 OBMC가 수행될 수 있다. 디코더는 현재 블록의 서브 블록에 OBMC를 수행하고, 현재 블록의 예측 블록을 획득할 수 있다(S850).
이하에서 S830 단계에 대해 보다 구체적으로 설명한다. 디코더는 현재 블록의 제1 서브 블록의 움직임 정보와 제1 서브 블록의 주변 블록의 움직임 정보가 동일한지 판단할 수 있다. 움직임 정보가 서로 상이한 경우, 디코더는 제1 서브 블록에 대해 OBMC를 수행할 수 있다. 그리고 디코더는 현재 블록의 제2 서브 블록의 움직임 정보와 제2 서브 블록의 주변 블록의 움직임 정보가 동일한지 판단할 수 있다. 마찬가지로, 움직임 정보가 서로 상이한 경우, 디코더는 제2 서브 블록에 대해 OBMC를 수행할 수 있다. 이때, 제1 서브 블록의 움직임 정보와 제2 서브 블록의 움직임 정보가 서로 동일하고 그리고 제1 서브 블록의 주변 블록의 움직임 정보와 제2 서브 블록의 주변 블록의 움직임 정보가 서로 동일한 경우, 디코더는 제1 서브 블록과 제2 서브 블록을 하나의 서브 블록으로 묶은 후, OBMC를 수행할 수 있다. 이는 제1 서브 블록과 제2 서브 블록의 OBMC 수행과정을 각각 수행하지 않고 한 번에 수행함으로써, 결과는 동일하지만, 메모리 접근 횟수를 감소시키는 효과가 있다. 즉, 현재 블록의 각 서브 블록의 움직임 정보와 각 서브 블록의 주변 블록의 움직임 정보 간 움직임 차이를 비교하여 동일한 움직임 차이를 가지는 서브 블록을 하나의 서브 블록으로 묶어 OBMC를 수행할 수 있다. 한편, 제1 서브 블록의 주변 블록이 인트라 모드로 부호화되거나 제1 서브 블록의 주변 블록이 사용 가능하지 않은 상태인 경우, 디코더는 제1 서브 블록에 대해 OBMC를 수행하지 않고 다른 서브 블록(예, 제2 서브 블록)에 대해 S830 단계를 다시 수행할 수 있다. 또한, 디코더는 현재 블록의 각 서브 블록의 움직임 정보가 각 서브 블록의 주변 블록의 움직임 정보와 동일한 경우, 동일한 움직임 정보를 가지는 서브 블록에 대해서는 OBMC를 수행하지 않을 수 있다. 즉, 제1 서브 블록의 움직임 정보와 제1 서브 블록의 주변 블록의 움직임 정보가 동일하면, 디코더는 제1 서브 블록에 대해서는 OBMC를 수행하지 않고, 다른 서브 블록에 대해 S830 단계를 다시 수행할 수 있다. 이때, S830 단계는 현재 블록의 상측 경계를 포함하는 서브 블록들에 대해 먼저 수행된 후 현재 블록의 좌측 경계를 포함하는 서브 블록들에 대해 수행될 수 있다. 반대로, S830 단계는 현재 블록의 좌측 경계를 포함하는 서브 블록들에 대해 먼저 수행된 후 현재 블록의 상측 경계를 포함하는 서브 블록들에 대해 수행될 수 있다. 이때, S830 단계는 상측 경계를 포함하는 서브 블록들에 대해서는 좌측에 있는 서브 블록부터 수행될 수 있다. S830 단계는 좌측 경계를 포함하는 서브 블록들에 대해서는 상측에 있는 서브 블록부터 수행될 수 있다.
도 45는 본 명세서의 일 실시예에 따른 CU 단위의 OMBC를 수행하는 방법을 나타내는 도면이다.
구체적으로, 도 45는 S830 단계를 보다 상세히 나타내는 도면이다.
도 45를 참조하면 디코더는 현재 블록의 좌상단 블록인 A0 블록에 대해 OBMC를 수행할 수 있다(Case 1). 디코더는 A0 블록의 움직임 정보와 A0 블록과 인접한 상단 블록인 Ne-A0 블록의 움직임 정보가 서로 상이한 경우, A0 블록에 대한 OBMC를 수행할 수 있다. 이때, 디코더는 OBMC 수행을 위해, A0 블록의 움직임 정보를 사용하여 참조 픽쳐 0(reference picture 0)에서 제1 예측 블록(ref A0)을 획득하고, Ne-A0 블록의 움직임 정보를 A0 블록의 위치로 투영(projection)하여 참조 픽쳐 0에서 제2 예측 블록을 획득할 수 있다. 그리고 디코더는 미리 설정된 가중치에 기초하여 제1 예측 블록과 제2 예측 블록을 가중치 평균하여 A0 블록에 대한 최종 예측 블록을 획득할 수 있다.
또한, 디코더는 현재 블록의 좌측 블록인 L2 블록에 대해 OBMC를 수행할 수 있다(Case 2). 디코더는 L2 블록의 움직임 정보와 L2 블록과 인접한 좌측 블록인 Ne-L2 블록의 움직임 정보가 서로 상이한 경우, L2 블록에 대한 OBMC를 수행할 수 있다. 이때, 디코더는 OBMC 수행을 위해, L2 블록의 움직임 정보를 사용하여 참조 픽쳐 0에서 제1 예측 블록(ref L2)을 획득하고, Ne-L2의 움직임 정보를 L2 블록의 위치로 투영(projection)하여 참조 픽쳐 1(reference picture 1)에서 Ne-L2의 제2 예측 블록을 획득할 수 있다. 그리고 디코더는 미리 설정된 가중치에 기초하여 제1 예측 블록과 제2 예측 블록을 가중치 평균하여 L2 블록에 대한 최종 예측 블록을 획득할 수 있다.
이때 미리 설정된 가중치는 테이블 형태로 정의될 수 있다. 현재 블록과 주변 블록 간의 참조 픽쳐는 case 1과 같이 동일할 수도 있고, case 2와 같이 상이할 수도 있다.
도 45를 참조하면 현재 블록의 좌상단에 위치한 서브 블록인 A0(또는 L0) 블록에 인접한 블록이 2개(Ne-A0 블록, Ne-L0 블록)일 수 있다. 따라서 디코더는 A0 블록에 대해 OBMC를 2번 수행할 수 있다. 예를 들어, 디코더는 A0 블록의 움직임 정보와 Ne-A0 블록의 움직임 정보를 비교하여 움직임 정보가 상이한 경우, A0 블록에 대한 1차 OBMC를 수행할 수 있다. 이후 디코더는 A0 블록의 움직임 정보와 Ne-L0 블록의 움직임 정보를 비교하여 움직임 정보가 상이하다면 1차 OBMC를 수행한 A0 블록에 대한 2차 OBMC를 추가로 수행할 수 있다. 즉, 디코더는 1차 OBMC를 수행하여 획득한 예측 블록과 상기 1차 OBMC를 수행하여 획득한 예측 블록에 2차 OBMC를 수행하여 A0 블록에 대한 최종 예측 블록을 획득할 수 있으며, A0 블록에는 2번의 OBMC가 연속적으로(또는 순서대로) 수행될 수 있다. 따라서, 1차 OBMC가 2차 OBMC에 영향을 미칠 수 있다. 즉, 1차 OBMC와 2차 OBMC 간에는 의존성이 존재한다. 이러한 의존성을 제거하기 위해 디코더는 서브 블록의 인접한 주변 블록이 복수 개인 경우, OBMC를 병렬적으로 수행할 수 있다. 예를 들어, 디코더는 A0 블록의 움직임 정보와 Ne-A0 블록의 움직임 정보에 기초한 예측 블록과 A0 블록의 움직임 정보와 Ne-L0 블록의 움직임 정보에 기초한 예측 블록을 병렬적으로 획득할 수 있다. 이후 디코더는 병렬적으로 획득한 예측 블록들을 가중치 평균하여 A0 블록에 대한 최종 예측 블록을 획득할 수 있다. 한편, 디코더는 서브 블록의 인접한 주변 블록이 복수 개인 경우 어느 하나의 주변 블록의 움직임 정보에 기초하여 OBMC를 수행할 수 있다. 예를 들어, 디코더는 A0 블록의 움직임 정보와 Ne-A0 블록의 움직임 정보의 차이인 제1 움직임 차이와 A0 블록의 움직임 정보와 Ne-L0 블록의 움직임 정보의 차이인, 제2 움직임 차이를 획득할 수 있다. 그리고 디코더는 제1 움직임 차이와 제2 움직임 차이를 비교하여, 더 큰 움직임 차이에 대응하는 주변 블록의 움직임 정보를 이용하여 A0에 대한 OBMC를 수행할 수 있다. 예를 들어, 제1 움직임 차이가 제2 움직임 차이보다 크다면, 디코더는 제1 움직임 차이에 대응하는 주변 블록인 Ne-A0 블록의 움직임 정보를 이용하여 A0 블록의 상측 경계에 대한 OBMC만을 수행할 수 있다.
도 46은 본 발명의 일 실시예에 따른 서브 블록 단위의 OBMC를 수행하는 방법을 나타내는 도면이다.
구체적으로, 도 46은 S840 단계를 보다 상세히 나타내는 도면이다.
본 명세서에서의 CU 단위의 OBMC는 현재 CU 경계에 인접한 서브 블록들에 대한 OBMC를 의미하며, CU 경계 서브 블록 OBMC라고 기술될 수 있다. 서브 블록 단위의 OBMC는 현재 CU 내부의 서브 블록들(CU 경계에 인접하지 않은 서브 블록들)에 대한 OBMC를 의미하며, CU 내부 서브 블록 OBMC라 기술될 수 있다.
이때, OBMC의 수행을 위해 현재 블록의 참조 픽쳐가 사용되므로, 모든 서브 블록 단위에서의 참조 픽쳐는 동일할 수 있다.
디코더는 현재 서브 블록의 상, 하, 좌, 우측으로 인접한 각 주변 블록의 움직임 정보와 현재 서브 블록의 움직임 정보를 각각 비교할 수 있다. 그리고 디코더는 현재 서브 블록의 움직임 정보와 상이한 움직임 정보를 가지는 인접한 주변 블록에 대한 움직임 정보를 이용하여 현재 서브 블록에 대한 OBMC를 수행할 수 있다.
도 46을 참조하여 휘도 성분 서브 블록에 대한 OBMC를 수행하는 방법에 대해 설명한다. 현재 서브 블록이 휘도 성분 서브 블록이고, 현재 서브 블록의 움직임 정보와 현재 서브 블록의 상, 하, 좌, 우에 인접한 주변 블록들의 각 움직임 정보는 서로 상이할 수 있다. 이때, 디코더는 각각의 주변 블록에 대한 움직임 정보를 현재 서브 블록에 투영(projection)하여 예측 블록을 각각 생성할 수 있다. 즉, 도 10을 참조하면 현재 서브 블록의 상측에 인접한 주변 블록에 대한 움직임 정보에 기초하여 생성되는 예측 블록은 Ref.A 블록이고, 현재 서브 블록의 하측에 인접한 주변 블록에 대한 움직임 정보에 기초하여 생성되는 예측 블록은 Ref.B 블록이고, 현재 서브 블록의 좌측에 인접한 주변 블록에 대한 움직임 정보에 기초하여 생성되는 예측 블록은 Ref.L 블록이고, 현재 서브 블록의 우측에 인접한 주변 블록에 대한 움직임 정보에 기초하여 생성되는 예측 블록은 Ref.R 블록일 수 있다. 디코더는 Ref.A 블록, Ref.B 블록, Ref.L 블록, Ref.R 블록간 가중치 평균을 수행하여 현재 서브 블록에 대한 예측 블록을 획득할 수 있다. 이때, 여러 개의 예측 블록이 더해지므로, 디코더는 확장된 픽셀 범위를 사용하여 가중치 평균한 후, 다시 기존 픽셀 범위로 복원할 수 있다. 확장된 픽셀 범위의 전체 가중치에서 상, 하, 좌, 우에 해당하는 주변 블록들의 각 픽셀 위치에 따른 가중치의 합을 뺀 차이 값이 현재 예측 블록의 각 픽셀에 대한 가중치일 수 있다. 한편, 현재 서브 블록의 주변 블록이 인트라 모드로 부호화된 경우, 해당 주변 블록의 가중치는 0으로 설정될 수 있다. 또한, 현재 서브 블록의 주변 블록이 사용할 수 없는 경우, 사용할 수 없는 주변 블록의 가중치는 0으로 설정될 수 있다. 또한, 확장된 픽셀 범위를 사용할 경우, 비디오 신호 처리 장치(예, 인코더, 디코더)가 허용 가능한 값의 범위를 벗어날 수 있다. 따라서, 각 예측 블록의 픽셀 값을 임의의 값의 범위로 축소하여 가중치 평균 계산이 적용될 수 있다. 임의의 값의 범위로 축소하는 방법은 예측 블록의 각 픽셀 값에 오른쪽 쉬프트 연산인 ">>"을 임의의 정해진 수만큼 수행하는 방법이 사용될 수 있으며, 이때 임의의 정해진 수는 1이상의 정수 일 수 있으며, 2일 수 있다. 가중치 평균이 수행된 후 원래 범위로 복원하기 위해서 왼쪽 쉬프트 연산인 "<<"을 임의의 정해진 수만큼 수행하는 방법이 사용될 수 있으며, 임의의 정해진 수는 값의 범위를 축소한 만큼의 수와 동일할 수 있다.
도 46을 참조하여 색차 성분 서브 블록에 대한 OBMC를 수행하는 방법에 대해 설명한다. 예를 들어, 현재 픽쳐의 성분 포맷이 4:2:0일 경우, 색차 성분 블록의 가로 및 세로의 크기는 휘도 성분 블록의 가로 및 세로 크기의 절반이다. 즉, 휘도 성분 블록의 크기가 4x4이면, 색차 성분 블록의 크기는 2x2이다. 따라서, 가중치 테이블의 값도 2x2만 존재할 수 있다. 색차 성분 서브 블록에 대해 OBMC를 수행하는 방법은 휘도 성분 서브 블록에 대한 OBMC를 수행하는 방법과 유사할 수 있다. 다만, 색차 성분 서브 블록의 움직임 정보의 해상도는 휘도 성분 서브 블록의 움직임 정보의 해상도의 절반 일 수 있다. 즉, 휘도 성분 서브 블록의 움직임 정보와 휘도 성분 서브 블록의 주변 블록의 움직임 정보간 차이가 존재할 수 있으나, 색차 성분 서브 블록의 움직임 정보와 색차 성분 서브 블록의 주변 블록의 움직임 정보간 차이는 존재하지 않을 수 있다. 이때, 휘도 성분 서브 블록에만 OBMC가 적용될 수 있고, 색차 성분 서브 블록에서는 OBMC가 적용되지 않을 수 있다. 따라서, 휘도 성분 서브 블록에서 발생되지 않았던 블록킹 현상이 색차 성분 서브 블록에 발생할 수도 있다. 블록킹 현상을 해결하기 위해 휘도 성분 서브 블록에 대한 OBMC가 적용되면 색차 성분 서브 블록에 대해서도 OBMC가 적용될 수 있다. CU 단위 OBMC는 Y, U, V 성분 각각 수행될 수 있으며, 색차 성분 블록의 경우, 인접한 첫번째 픽셀 라인에 대해 OBMC가 수행될 수 있다. 이때 첫번째 픽셀 라인에 한정되지 않음은 당연하다.
도 47은 본 명세서의 일 실시예에 따른 가중치가 정의된 테이블을 나타내는 도면이다.
본 명세서에서의 가중치는 인접한 블록의 위치, 현재 블록의 컬러 성분(휘도 성분인지 색차 성분인지)에 기초하여 결정될 수 있다. 예를 들어, CU 단위 OBMC가 수행됨에 있어서, 현재 서브 블록이 현재 블록의 상측 경계를 포함하는 블록이고, 휘도 성분의 블록인 경우, 현재 서브 블록의 예측 블록에 대한 가중치는 상측부터 하측으로 증가되도록 설정될 수 있다(도 45의 Case 1 참조). 또한, CU 단위 OBMC가 수행됨에 있어서 현재 서브 블록이 현재 블록의 좌측 경계를 포함하는 블록이고, 휘도 성분의 블록인 경우, 현재 서브 블록의 예측 블록에 대한 가중치는 좌측부터 우측으로 증가되도록 설정될 수 있다(도 45의 Case 2 참조).
또한, 본 명세서에서의 가중치는 현재 블록(현재 블록의 서브 블록)의 주변 블록이 복원이 완료된 블록인지, 예측만 수행된 블록인지에 따라 결정될 수 있다. 예를 들어, 주변 블록이 복원이 완료된 블록인 경우, 블록킹 현상이 강하게 나타날 수 있으므로 높은 가중치에 기초한 필터링이 수행될 수 있다. 즉, 주변 블록 중 현재 블록의 경계와 인접한 부분에 대한 가중치는 현재 블록의 예측 블록에 대한 가중치보다 높게 설정될 수 있다. 반대로, 경계 부분은 영상 자체의 특성일 수 있으므로, 주변 블록 중 현재 블록의 경계에 인접한 부분에 대한 가중치는 현재 블록의 예측 블록에 대한 가중치보다 작게 설정될 수 있다. 경계 부분이 영상 자체 특성인지에 대해서 디코더는 현재 블록의 양자화 파라미터 정보 및 경계 주변의 픽셀 분포를 통해 확인할 수 있다. 영상 자체 특성인 경우, 디코더는 기존의 디블록킹 필터링 방법을 적용할 수 있다.
서브 블록 단위의 OBMC는 임의의 정해진 블록 크기(단위)에 따라 수행될 수 있다. 예를 들어, 디코더는 4x4 크기의 서브 블록에 대해 OBMC를 수행할 수 있다. 하지만, affine 모드, sbTMVP 모드, MP-DMVR 모드를 위한 서브 블록의 단위는 서로 상이할 수 있다. 예를 들어, Affine 모드는 4x4 서브 블록 단위로 처리되고, sbTMVP 모드는 8x8 서브 블록 단위로 처리되고, MP-DMVR 모드는 8x8, 8x4, 4x8, 4x4 서브 블록 단위로 처리되어 각 단위별로 움직임 정보가 다를 수 있다. OBMC는 현재 블록의 움직임 정보와 현재 블록의 주변 블록의 움직임 정보 간의 움직임 차이로 발생되는 블록 경계의 블록킹 현상을 완화시키는 효과가 있으므로, 각 부호화 모드에 따라 OBMC를 위한 서브 블록 단위가 변경될 필요가 있다. 실시 일 예로, sbTMVP 모드는 8x8 서브 블록 단위로 움직임 정보가 서로 다르므로, 현재 블록이 sbTMVP 모드로 부호화되었을 경우, 서브 블록 OBMC 처리를 위한 서브 블록의 단위는 8x8일 수 있다. 또 다른 실시 일 예로, MP-DMVR 모드는 8x8, 8x4, 4x8, 4x4 서브 블록 단위로 움직임 정보가 서로 다르므로, 현재 블록이 MP-DMVR 모드로 부호화되었을 경우, 서브 블록 OBMC 처리를 위한 서브 블록의 단위는 MP-DMVR 처리 단위와 동일하게 설정될 수 있다.
OBMC는 현재 블록의 움직임 정보가 단방향 예측인 경우에만 적용될 수 있다. OBMC는 현재 블록의 움직임 정보와 현재 블록의 주변 블록의 움직임 정보간 차이가 없는 경우, 수행되지 않을 수 있다. 이는 다양한 움직임 정보를 통해 양방향 예측 효과를 높이기 위함일 수 있다. 즉, 디코더가 OBMC를 수행할 때 다양한 움직임 정보를 적용하도록, 디코더는 주변 블록은 선택적으로 활용하거나 복수 개의 주변 블록에 대한 움직임 정보를 사용하거나 다른 참조 픽쳐에 대한 스케일된 움직임 정보를 사용할 수 있다.
디코더는 OBMC를 수행함에 있어 현재 블록의 주변 블록을 선택적으로 활용할 수 있다. 예를 들어, 디코더는 도 45의 A0 블록에 대한 OBMC를 수행함에 있어, Ne-A0 블록의 움직임 정보에 더하여 Ne-AL 블록 및 Ne-A1 블록의 움직임 정보를 추가적으로 사용할 수 있다. 디코더는 현재 블록의 주변 블록과 인접한 블록에 대한 움직임 정보를 추가적으로 사용할 수 있다.
디코더는 다른 참조 픽쳐를 사용하여 OBMC를 수행할 수 있다. 예를 들어, 디코더는 도 45의 L2 블록에 대한 OBMC를 수행함에 있어, 참조 픽쳐 1의 참조 블록에 더하여 참조 픽쳐 0으로 스케일된 Ne-L2 블록의 움직임 정보를 사용할 수 있다. 즉, 디코더는 3개의 예측 블록(L2 블록의 움직임 정보에 기초하여 획득되는 예측 블록, Ne-L2 블록의 움직임 정보에 기초하여 획득되는 예측 블록, 스케일된 Ne-L2 블록의 움직임 정보에 기초하여 획득되는 예측 블록)을 가중치 평균하여 L2 블록에 대한 예측 블록을 획득할 수 있다. 또한, 디코더는 2개의 예측 블록(L2 블록의 움직임 정보에 기초하여 획득되는 예측 블록, 스케일된 Ne-L2 블록에 기초하여 획득되는 예측 블록)을 가중치 평균하여 L2 블록에 대한 예측 블록을 획득할 수 있다. 또한, 디코더는 L2 블록의 움직임 정보가 사용하는 참조 픽쳐만을 사용하여 OBMC를 수행할 수 있다. 이 경우, 참조 픽쳐는 1개이므로 메모리 사용량이 감소한다는 효과가 있다.
OBMC 방법은 블록 간의 블록킹 현상을 줄여줄 수 있지만, 현재 블록의 주변 블록의 특성이 현재 블록과 다른 경우에 헤일로(Halo) 현상과 같은 잔상이 발생할 수 있다는 문제점이 있다. 헤일로 현상은 서로 다른 객체 간의 서로 다른 움직임으로 인해 발생될 수 있으므로, OBMC는 모든 블록에 일괄적으로 적용하지 않고 주변 블록 간의 특성에 따라 적용 여부가 결정될 수 있다.
도 48은 본 명세서의 일 실시예에 따른, OBMC 수행을 위한 템플릿을 구성하는 방법을 나타내는 도면이다.
도 48을 참조하면 디코더는 템플릿에 기초하여 현재 블록(코딩 블록)에 OBMC를 수행(적용)할 지 여부를 결정할 수 있다. 이하에서, 본 명세서의 일 실시예에 따른 현재 블록에 인접한 주변 블록(화소, 픽셀)을 사용하여 템플릿을 구성하는 방법에 대해 설명한다.
OBMC는 코딩 블록 단위로 수행 여부가 결정될 수 있고, 인코더는 OBMC의 수행 여부와 관련된 정보를 포함하는 비트스트림을 생성할 수 있다. 디코더는 비트스트림을 파싱하여 현재 블록에 OBMC가 수행되는지 여부를 결정할 수 있다. 현재 블록에 OBMC가 적용되는 경우, 현재 블록의 경계를 포함하는 모든 서브 블록들(도 48의 A0/L0, A1, A2, A3, L1, L2, L3 블록)에 OBMC가 적용될 수 있다. 이때, 각 서브 블록마다 특성이 다르므로, 디코더는 각 서브 블록 마다 OBMC가 적용되는지 여부를 판단할 수 있다.
OBMC 방법은 현재 블록의 주변 블록의 움직임 정보를 이용하므로, 디코더는 현재 블록과 현재 블록의 주변 블록 간의 유사도에 기초하여 현재 블록(현재 블록의 각 서브 블록)에 OBMC를 수행할지 여부를 결정할 수 있다. 또한, 디코더는 현재 블록과 현재 블록의 주변 블록 간의 유사도에 기초하여 각 서브 블록에 적용되는 OBMC를 위한 필터링의 길이와 가중치를 결정할 수 있다. 구체적으로, 현재 블록의 움직임 정보와 현재 블록의 주변 블록의 움직임 정보 간 차이, 현재 블록의 움직임 해상도 정보, 현재 블록의 주변 블록의 움직임 해상도 정보, 현재 블록의 예측 방향 정보(예, L0 예측, L1 예측, 양방향 예측), 현재 블록의 가로의 길이, 현재 블록의 세로의 길이, 현재 블록의 가로 및 세로의 길이의 곱, 현재 블록의 부호화 모드(예, 머지 모드, 어파인 모드, sbTMVP 모드 등) 중 적어도 어느 하나에 기초하여 디코더는 각 서브 블록의 OBMC 수행 여부, OBMC를 위한 필터링의 길이 및 가중치를 결정할 수 있다.
이때 OBMC를 위한 필터링의 길이 및 가중치는 예측 샘플에도 적용될 수 있다. 현재 서브 블록의 움직임 정보를 통해 예측한 샘플에 적용되는 필터링의 길이 및 가중치는, 현재 서브 블록에 인접한 블록의 움직임 정보를 통해 예측한 샘플에 적용되는 필터링의 길이와 가중치와 동일하거나 상이할 수 있다. 예를 들어, 현재 블록의 상측(또는 좌측) 주변 블록에 OBMC가 수행될 수 있다. 이때, 현재 서브 블록의 움직임 정보를 통해 예측한 샘플에 적용되는 필터링의 길이가 3개 픽셀 라인(또는 3개 픽셀 열)인 경우, 현재 서브 블록의 상측(또는 좌측)에 인접한 블록의 움직임 정보를 통해 예측한 샘플에 적용되는 필터링의 길이도 3개 픽셀 라인(또는 3개 픽셀 열)로 설정될 수 있다. 이때, 현재 서브 블록의 움직임 정보를 통해 예측한 샘플에 적용되는 OBMC 필터링의 길이가 3개 픽셀 라인인 경우, 각 픽셀 라인별 가중치(또는 각 픽셀 열별 가중치)는 '7, 15, 31'으로 설정될 수 있다. 또한, 현재 서브 블록의 상측(또는 좌측)에 인접한 블록의 움직임 정보를 통해 예측한 샘플에 적용되는 OBMC 필터링의 길이는 3개 픽셀 라인(또는 3개 픽셀 열)으로 설정되고, 각 픽셀 라인별 가중치(또는 각 픽셀 열별 가중치)를 '1, 1, 1'으로 설정될 수 있다.
도 48을 참조하면 디코더는 템플릿에 기초하여 현재 블록에 OBMC가 수행되는지 여부를 결정할 수 있다. 먼저, 디코더는 현재 블록에 인접한 복원된 블록의 픽셀들을 포함하는 템플릿을 구성할 수 있으며, 설명의 편의상 이를 기준 템플릿이라고 명명할 수 있다. 상측 템플릿의 너비는 각 서브 블록의 가로의 크기에 기초하여 결정될 수 있고, 상측 템플릿의 높이는 기 설정된 크기일 수 있다. 좌측 템플릿의 높이는 각 서브 블록의 세로의 크기에 기초하여 결정될 수 있고, 좌측 템플릿의 너비는 기 설정된 크기일 수 있다. 기 설정된 크기는 자연수로, 1일 수 있다. 이때, 각 서브 블록에 대한 상측 템플릿은 서브 블록의 크기에 기초하여 달라질 수 있으며, 서브 블록의 크기가 4x4일 경우, 상측 템플릿의 크기는 4x1일 수 있다. 다음으로, 디코더는 각 서브 블록마다 3가지의 코스트를 계산할 수 있다. 제1 코스트(Cost 1)는 현재 서브 블록의 움직임 정보에 기초하여 획득되고, 제2 코스트(Cost 2)는 현재 서브 블록에 인접한 블록의 움직임 정보에 기초하여 획득되고, 제3 코스트(Cost 3)는 현재 서브 블록의 움직임 정보와 현재 서브 블록에 인접한 블록의 움직임 정보에 기초하여 획득될 수 있다. 본 명세서에서 기술하는 코스트는 템플릿과 각 서브 블록의 움직임 정보를 이용하여 템플릿에 대응되는 영역을 예측한 샘플들 간의 픽셀 단위 SAD(Sum of Absolute Differences) 또는 MRSAD(Mean-Removed SAD) 계산을 통해 획득될 수 있다. 구체적으로, 제1 코스트는 현재 서브 블록에 인접한 복원된 블록의 픽셀들을 포함하는 템플릿(기준 템플릿)과 현재 서브 블록의 움직임 정보를 기준 템플릿에 투영(projection)하여 예측한 제1 참조 템플릿에 기초하여 획득될 수 있다. 제2 코스트는 상기 기준 템플릿과 현재 서브 블록에 인접한 블록의 움직임 정보를 기준 템플릿에 투영(projection)하여 예측한 제2 참조 템플릿에 기초하여 획득될 수 있다. 제3 코스트는 제1 참조 템플릿과 제2 참조 템플릿에 기초하여 획득될 수 있다. 또는, 제3 코스트는 현재 서브 블록의 움직임 정보를 이용하여 템플릿에 대응되는 영역을 예측한 샘플과 현재 서브 블록에 인접한 블록의 움직임 정보를 이용하여 템플릿에 대응되는 영역을 예측한 샘플을 가중치 평균하여 획득되는 예측 샘플과 기준 템플릿에 기초하여 획득될 수 있다. 이때, 가중치는 기 설정된 값으로, 0 이상의 소수 형태의 값일 수 있다. 예를 들어, 기 설정된 값은 1/4, 3/4 등일 수 있다. 다음으로, 디코더는 획득한 코스트에 기초하여 현재 서브 블록에 대한 OBMC의 수행 여부, OBMC를 위한 필터링의 길이, 및 가중치를 유도할 수 있다. 예를 들어, 획득한 코스트들 중 Cost 1(제1 코스트)이 가장 작다면, 대응되는 서브 블록에는 OBMC가 수행되지 않을 수 있다. 또한 획득한 코스트들 중 Cost 1이 가장 작다면, 대응되는 서브 블록에는 제2 OBMC 모드가 수행되거나 제2 OBMC 모드를 위한 필터링 길이보다 필터링 길이가 작은 새로운 OBMC 모드가 수행될 수 있다. 또한 "(Cost 2 + (Cost 2 >> 2) + (Cost 2 >> 3))"의 값이 Cost 1보다 작거나 같다면, 대응되는 서브 블록에는 제1 OBMC 모드가 수행될 수 있다. 여기서 "X>>Y"는 오른쪽 쉬프트 연산으로 X에 Y개수만큼 2로 나눈 몫이 출력될 수 있다. Cost 1이 Cost 2보다 작거나 같다면, 대응되는 서브 블록에는 제2 OBMC 모드가 수행될 수 있다. 반대로, Cost 1이 Cost 2보다 크다면, 대응되는 서브 블록에는 제3 OBMC 모드가 수행될 수 있다.
도 49는 본 명세서의 일 실시예에 따른 각 OBMC 모드에 따라 예측 블록을 생성하는 방법을 나타내는 도면이다.
도 49를 참조하여 본 명세서에서 기술하는 제1 OBMC 모드, 제2 OBMC 모드, 및 제3 OBMC 모드에 대해 설명한다.
도 49의 ref A0 블록과 Ne-A0 블록은 4x4 크기의 블록일 수 있다. 도 49의 ref A0는 현재 서브 블록일 수 있고, 도 9의 ref A0 블록과 동일할 수 있다. 도 49의 Ne-A0 블록은 현재 서브 블록의 상측에 인접한 주변 블록으로 도 45의 Ne-A0 블록과 동일할 수 있다. 도 49를 참조하면, ref A0 블록과 Ne-A0 블록 옆에 도시된 숫자는 OBMC 필터링의 길이와 가중치를 나타낼 수 있다. 디코더는 예측 블록 ref A0와 Ne-A0 블록을 가중치 평균하여, OBMC 필터링이 적용된 현재 서브 블록 A0를 획득할 수 있다. 제1 OBMC, 제2 OBMC 모드, 및 제3 OBMC 모드는 휘도 성분 블록, 색차 성분 블록에 각각 적용될 수 있다. 제1 OBMC 모드가 휘도 성분 블록에 적용되는 경우, 제1 OBMC 모드는 현재 휘도 성분 서브 블록의 4개의 픽셀 라인과 현재 서브 블록의 상측에 인접한 휘도 성분 블록의 4개의 픽셀 라인을 가중치 평균하여 현재 휘도 성분 서브 블록을 획득하는 모드일 수 있다. 제2 OBMC 모드가 휘도 성분 블록에 적용되는 경우, 제2 OBMC 모드는 현재 휘도 성분 서브 블록의 2개의 픽셀 라인과 현재 서브 블록의 상측에 인접한 휘도 성분 블록의 2개의 픽셀 라인을 가중치 평균하여 현재 휘도 성분 서브 블록을 획득하는 모드일 수 있다. 제3 OBMC 모드가 휘도 성분 블록에 적용되는 경우, 제3 OBMC 모드는 현재 휘도 성분 서브 블록의 3개의 픽셀 라인과 현재 서브 블록의 상측에 인접한 휘도 성분 블록의 3개의 픽셀 라인을 가중치 평균하여 현재 휘도 성분 서브 블록을 획득하는 모드일 수 있다. 제1 OBMC 모드, 제2 OBMC 모드, 및 제3 OBMC 모드가 색차 성분 블록에 적용되는 경우, 제1 OBMC 모드, 제2 OBMC 모드, 및 제3 OBMC 모드는 현재 색차 성분 서브 블록의 1개의 픽셀 라인과 현재 서브 블록의 상측에 인접한 색차 성분 블록의 1개의 픽셀 라인을 가중치 평균하여 현재 색차 성분 서브 블록을 획득하는 모드일 수 있다. 예를 들어, 제1 OBMC 모드가 휘도 성분 블록에 적용되는 경우, ref A0 블록의 휘도 성분 블록의 첫번째 픽셀 라인의 4개의 픽셀에 가중치 '26'이 곱해지고, 두번째 픽셀 라인의 4개의 픽셀에 가중치 '7'이 곱해지고, 세번째 픽셀 라인의 4개의 픽셀에 가중치 '15'가 곱해지고, 네번째 픽셀 라인의 4개의 픽셀에 가중치 '31'이 곱해져서, 가중치가 적용된 'ref A0' 휘도 성분 예측 블록이 생성될 수 있다. 또한 Ne-A0 블록의 첫번째 픽셀 라인의 4개의 픽셀에 가중치 '6'이 곱해지고, 두번째 픽셀 라인의 4개의 픽셀에 가중치 '1이 곱해지고, 세번째 픽셀 라인의 4개의 픽셀에 가중치 '1이 곱해지고, 네번째 픽셀 라인의 4개의 픽셀에 가중치 '1이 곱해져서, 가중치가 적용된 'Ne-A0' 휘도 성분 예측 블록이 생성될 수 있다. 디코더는 가중치가 적용된 'ref A0' 예측 블록과 가중치가 적용된 'Ne-A0' 예측 블록을 가중치 평균하여 A0에 대한 최종 예측 블록을 생성할 수 있다. 디코더는 제2 OBMC 모드, 제3 OBMC 모드도 동일한 방법으로 적용하여 A0에 대한 최종 예측 블록을 생성할 수 있다.
현재 서브 블록의 움직임 정보와 현재 서브 블록의 주변 블록의 움직임 정보를 이용하여 획득되는 코스트에 기초하여 템플릿 기반 OBMC의 수행 여부가 결정될 수 있다. 또한, 도 48을 통해 상술한 바와 같이 현재 블록의 경계를 포함하는 서브 블록에만 템플릿 기반 OBMC가 수행될 수 있다. 디코더는 각 서브 블록 단위마다 OBMC 적용 여부를 결정할 수 있다. 현재 블록의 경계를 포함하지 않는 서브 블록에는 템플릿 기반 OBMC가 적용되지 않을 수 있다. 한편, 현재 블록의 경계를 포함하는 서브 블록들 중 적어도 어느 하나의 서브 블록에 OBMC가 적용되면, 현재 블록의 경계를 포함하지 않는 서브 블록에도 OBMC가 적용될 수 있다. 또한, 현재 블록의 부호화 모드가 어파인 모드, DMVR(또는 Multi-pass DMVR) 모드, TM Merge, MMVD, affine MMVD, BM merge, GPM 모드 중 어느 하나인 경우, 현재 블록의 경계를 포함하지 않는 서브 블록에 OBMC가 적용될 수 있다.
현재 블록에 OBMC가 적용될 때의 화질 및 비트량과 현재 블록에 OBMC가 적용되지 않았을 때의 화질 및 비트량을 비교하여 현재 블록에 OBMC가 적용되는지 여부는 결정될 수 있다. 즉, 현재 블록에 OBMC가 적용될 때의 화질 및 비트량과 현재 블록에 OBMC가 적용되지 않았을 때의 화질 및 비트량을 비교하여 현재 블록에 OBMC가 적용될 때의 압축 효율이 좋다면 OBMC가 적용되고, 좋지 않다면 OBMC가 적용되지 않을 수 있다. 인코더는 현재 블록에 OBMC가 적용되는지 여부에 대한 정보(예, 신택스 요소)를 포함하는 비트스트림을 생성할 수 있다. 디코더는 비트스트림으로부터 현재 블록에 OBMC가 적용되는지 여부에 대한 정보를 파싱하여 현재 블록에 OBMC를 적용할지 여부를 결정할 수 있다. 파싱 결과 현재 블록에 OBMC가 적용된다면, 디코더는 현재 블록을 복수 개의 서브 블록으로 분할한 후, 각 서브 블록마다 템플릿 기반 OBMC를 수행할 수 있다. 이때, 각 서브 블록마다 OBMC의 수행 여부는 판단될 수 있다. 파싱 결과 현재 블록에 OBMC가 적용되지 않는 경우, 현재 블록의 모든 서브 블록에 템플릿 기반 OBMC가 수행되지 않을 수 있다.
도 50은 본 발명의 실시 예에 따른 비디오 신호 처리 장치가 OBMC Intra 를 수행하는 방법을 보여준다.
OBMC는 움직임 보상 과정에서 발생하는 주변 블록 사이의 블록킹 현상을 완하 시켜준다. 다만, 현재 블록에 OBMC가 수행될 때, 주변 블록이 인트라 모드로 부호화된 경우, OBMC가 수행될 수 없다. 현재 블록의 주변 블록이 인트라 모드로 부호화된 경우, 비디오 신호 처리 장치는 주변 블록으로부터 DIMD 모드를 유도하고, 유도된 DIMD 모드를 이용하여 현재 블록에 대한 인트라 예측 블록을 생성할 수 있다. 주변 블록으로부터 DIMD 모드를 유도하기 위해, 비디오 신호 처리 장치는 현재 블록에 인접한 주변 블록의 복원된 샘플을 이용하여 DIMD 모드를 유도할 수 있다. 이때, 비디오 신호 처리 장치는 현재 블록에 대한 인트라 예측 블록과 현재 블록의 움직임 정보를 사용하여 생성한 인터 예측 블록을 사용하여 OBMC를 수행하고 최종 예측 블록을 생성할 수 있다. 이때, 인트라 예측 블록과 인터 예측 블록 각각에 적용되는 가중치는 앞서 설명한 OBMC 실시 예들, 예컨대 도 47을 통해 설명한 실시 예에서 적용하는 가중치일 수 있다. 인트라 예측 블록에 대한 가중치와 인터 예측 블록에 대한 가중치는 서로 동일할 수 있다. 또한, 인트라 예측 블록에 대한 가중치와 인터 예측 블록에 대한 가중치는 서로 다를 수 있다.
도 50의 실시 예에서 현재 블록 내 서브 블록 A1, A2, A0/L0, 및 L2의 주변 블록은 인트라 모드로 부호화된다. 비디오 신호 처리 장치는 현재 블록 내 서브 블록인 A1, A2, A0/L0, 및 L2에 인접한 복원된 샘플을 이용하여, 인트라 예측 모드를 유도할 수 있다. 비디오 신호 처리 장치는 유도된 인트라 예측 모드 통해 인트라 예측 블록을 생성할 수 있다. 비디오 신호 처리 장치는 인트라 예측 블록과 현재 블록의 움직임 정보를 통해 생성한 인터 예측 블록을 가중 평균 하여 OBMC가 적용된 블록을 생성할 수 있다. 구체적인 실시 예에서 현재 블록 내 서브 블록 중 A0/L0 블록의 주변 블록은 인트라 모드와 인터 모드로 부호화된 블록일 수 있다. 이때, 비디오 신호 처리 장치는 인터 모드로 부호화된 주변 블록의 움직임 정보만을 사용하여 서브 블록 A0/L0에 대한 OBMC를 수행할 수 있다. 또 다른 구체적인 실시 예에서 현재 블록 내 서브 블록 중 A0/L0 블록의 주변 블록은 인트라 모드와 인터 모드로 부호화된 블록일 수 있다. 비디오 신호 처리 장치는 인터 모드로 부호화된 주변 블록의 움직임 정보를 사용하여 제1 예측 블록을 생성하할 수 있다. 비디오 신호 처리 장치는 서브 블록 A0/L0에 인접한, 복원된 샘플을 이용하여 유도된 인트라 예측 모드를 통해 제2 예측 블록을 생성할 수 있다. 비디오 신호 처리 장치는 현재 블록의 움직임 정보를 사용하여 제3 예측 블록을 생성할 수 있다. 이때, 비디오 신호 처리 장치는 제1 예측 블록, 제2 예측 블록, 및 제3 예측 블록을 가중 평균하여 최종 OBMC 예측 블록을 생성할 수 있다.
비디오 신호 처리 장치가 상기 인트라 예측 블록을 생성하는데 사용되는 참조 샘플 라인은 현재 블록에 인접한 참조 샘플 라인 '0'을 포함할 수 있다. 또한, 비디오 신호 처리 장치는 OBMC에서 사용되는 인트라 예측 블록을 생성하는 과정에서 여러 개의 참조 샘플 라인을 사용하여 예측하는 인트라 퓨젼을 사용할 수 있다. 또 다른 구체적인 실시 예에서 비디오 신호 처리 장치는 OBMC에서 사용되는 인트라 예측 블록을 생성하는 과정에서 인트라 퓨젼을 사용하지 않을 수 있다. 또한, 비디오 신호 처리 장치는 OBMC에서 사용되는 인트라 예측 블록을 생성하는 과정에서 PDPC를 사용할 수 있다. 또 다른 구체적인 실시 예에서 비디오 신호 처리 장치는 OBMC에서 사용되는 인트라 예측 블록을 생성하는 과정에서 PDPC를 사용하지 않을 수 있다. 비디오 신호 처리 장치는 OBMC에서 사용되는 인트라 예측 블록을 생성하는 과정에서 TIMD, OBIC, EIP, MIP, 및 PDP 중 하나를 이용하여 인트라 예측 블록을 생성할 수 있다. PDP에 대해서는 추후 자세히 설명한다. 비디오 신호 처리 장치는 인트라 예측 블록을 사용하는 OBMC를 휘도 블록 또는 색차 블록에 적용할 수 있다. 설명의 편의를 위해 OBMC에서 사용되는 인트라 예측 블록을 OBMC 인트라라 지칭한다.
또한, 주변 블록이 IBC 모드로 부호화된 경우, 비디오 신호 처리 장치는 주변 블록의 블록 벡터를 이용하여 현재 블록에 대한 제1 예측 블록을 생성하고, 현재 블록의 움직임 정보를 통해 예측한 제2 예측 블록을 생성하고, 제1 예측 블록과 제2 예측 블록을 가중치 평균하여 최종 예측 블록이 생성할 수 있다.
또한, 현재 블록에 OBMC가 적용되는 경우, 비디오 신호 처리 장치는 인트라 예측, IBC 예측 (또는 Intra TMP 예측), 및 인터 예측 중 적어도 하나 이상을 이용하여 현재 블록 내 서브 블록에 OBMC를 적용할 수 있다.
또한, 주변 블록이 인터 예측으로 부호화 되지 않은 경우, 비디오 신호 처리 장치는 주변 블록의 복원된 샘플을 이용한 Intra TMP 방법을 통해 블록 벡터를 유도하고, 현재 블록에 대한 Intra TMP 예측 블록을 생성할 수 있다. 이때, 비디오 신호 처리 장치는 Intra TMP 예측 블록과 현재 블록의 움직임 정보를 통해 예측한 예측 블록을 가중 평균하여 OBMC의 최종 예측 블록을 생성할 수 있다.
주변 블록이 인트라 모드로 부호화된 경우, 비디오 신호 처리 장치는 OBMC 과정에서 현재 블록의 경계 샘플에 필터링을 수행할 수 있다. 비디오 신호 처리 장치는 이를 통해 블록킹 현상을 완화시킬 수 있다. 구체적으로 주변 블록이 인트라 모드로 부호화된 경우, 비디오 신호 처리 장치는는 주변 블록으로부터 유도한 인트라 예측 모드를 사용하여 현재 블록의 경계 샘플에 PDPC를 적용할 수 있다. 이때, 인트라 예측 모드는 주변 블록의 인트라 예측 모드, DIMD, 및 TIMD 중 하나를 사용하여 유도할 수 있다. 이때, 비디오 신호 처리 장치는 PDPC가 적용된 예측 블록을 OBMC 블록으로 사용할 수 있다. 따라서 비디오 신호 처리 장치는 PDPC가 적용된 예측 블록인 OBMC 블록을 현재 블록에 대한 최종 예측 블록으로 사용할 수 있다. 또 다른 구체적인 실시 예에서 비디오 신호 처리 장치는 PDPC가 적용된 예측 블록과 인터 예측 블록을 가중 평균하여 현재 블록에 대한 최종 예측 블록을 생성할 수 있다. 앞서 설명한 실시 예들에서 OBMC 블록에 적용되는 PDPC는 휘도 블록 또는 색차 블록에 적용될 수 있다. 설명의 편의를 위해 OBMC 과정에서 사용되는 PDPC를 OBMC PDPC라 지칭한다.
주변 블록이 인트라 모드로 부호화되는 경우, 인코더는 OBMC에서 인터 예측 대신 사용되는 예측 방법에 대한 정보를 비트스트림에 포함시킬 수 있다. 설명의 편의를 위해 이를 대체 예측 방법 정보라 지칭한다. 대체 예측 방법에 관한 정보는 PDPC, 및 인트라 예측과 같이 인터 예측을 대신하여 예측 블록을 생성하는 데 사용되는 예측 방법을 나타낼 수 있다. OBMC를 수행하는 디코더는 대체 예측 방법에 관한 정보를 비트스트림으로부터 획득하고, 대체 예측 정보에 따라 인터 예측 대신 대체 예측 방법을 생성하여 예측 블록을 생성할 수 있다. 대체 예측 정보가 인트라 예측 모드의 사용을 지시하는 경우, 디코더는 인터 예측 블록 대신에 인트라 예측 블록을 사용하여 OBMC를 수행할 수 있다. 또한, 대체 예측 정보가 PDPC의 사용을 지시하는 경우, 디코더는 인터 예측 블록에 주변 블록으로부터 유도한 인트라 예측 모드를 사용하여 예측 블록의 경계 샘플에 PDPC를 수행할 수 있다. 또한, 대체 예측 정보가 DIMD 모드의 사용을 지시하는 경우, 디코더는 주변 블록으로부터 유도한 DIMD 인트라 예측 모드를 사용하여 인트라 예측 블록을 생성할 수 있다. 이때, 디코더는 생성한 인트라 예측 블록과 현재 블록의 인터 예측 블록을 가중 평균하여 최종 예측 블록이 생성할 수 있다.
OBMC 수행 과정에서 주변 블록이 인트라 모드로 부호화되는 경우, 비디오 신호 처리 장치는 인터 예측 블록 대신에 인트라 예측 블록을 사용하거나 PDPC를 적용할지, 필터링의 길이, 및 가중치 중 적어도 하나 이상을 템플릿 코스트를 기초로 결정할 수 있다. 템플릿 코스트 기반 적용 유무 결정 방안은 도 48에서 설명한 실시 예가 적용될 수 있다. 비디오 신호 처리 장치는 현재 블록에 인접한 복원된 픽셀을 사용하여 기준 템플릿을 구성할 수 있다. 비디오 신호 처리 장치는 현재 블록의 움직임 정보를 기초로 기준 템플릿 영역을 예측하여 제1 참조 템플릿을 구성할 수 있다. 비디오 신호 처리 장치는 현재 블록에 인접한 주변 샘플을 이용하여 유도된 인트라 예측 모드를 사용하여 기준 템플릿 영역을 예측하여 제2 참조 템플릿을 구성할 수 있다. 비디오 신호 처리 장치는 유도된 기준 템플릿, 제1 참조 템플릿, 및 제2 참조 템플릿 중 적어도 하나 이상을 사용하여 OBMC가 적용된 현재 블록에 인트라 예측 블록을 사용할지, 필터링의 길이, 및 가중치 중 적어도 하나 이상을 결정할 수 있다. 구체적으로 비디오 신호 처리 장치는 제1 코스트를 기준 템플릿과 제1 참조 템플릿 사이의 픽셀 단위 SAD(sum of absolute differences) 또는 MRSAD(mean-removed SAD) 계산을 통해 획득할 수 있다. 비디오 신호 처리 장치는 제2 코스트를 기준 템플릿과 제2 참조 템플릿 사이의 픽셀 단위 SAD 또는 MRSAD 계산을 통해 획득할 수 있다. 비디오 신호 처리 장치는 제3 코스트를 제1 참조 템플릿과 제2 참조 템플릿 간의 픽셀 단위 SAD 또는 MRSAD 계산을 통해 획득할 수 있다. 비디오 신호 처리 장치는 획득한 코스트 중 제1 코스트(Cost 1)가 가장 작다면, 대응되는 블록에 OBMC를 수행하지 않을 수 있다. 또한, 제2 코스트(Cost 2)로부터 획득한 값이 제1 코스트(Cost 1)보다 작거나 같다면, 비디오 신호 처리 장치는 대응되는 블록에 제1 OBMC 모드를 수행할 수 있다. 이때, 비디오 신호 처리 장치는 제2 코스트(Cost 2)에 미리 지정된 계산 식을 적용하여 제2 코스트(Cost 2)로부터 값을 획득할 수 있다. 미리 지정된 계산 식은 (Cost 2 + (Cost 2 >> 2) + (Cost 2 >> 3))일 수 있다. 제1 코스트(Cost 1)가 제2 코스트(Cost 2)보다 작거나 같다면, 비디오 신호 처리 장치는 대응되는 블록에 제2 OBMC 모드를 수행할 수 있다. 제1 코스트(Cost 1)가 제2 코스트(Cost 2)보다 크다면, 비디오 신호 처리 장치는 대응되는 블록에 제3 OBMC 모드를 수행할 수 있다. 제1 OBMC, 제2 OBMC, 및 제3 OBMC 모드는 서로 다른 필터링 길이, 가중치 값이 적용될 수 있다. 구체적인 실시 예에서 도 49를 통해 설명한 실시 예가 적용될 수 있다. 또한, 색차 블록에도 동일한 코스트 기반 OBMC 적용 방법이 적용될 수 있다.
OBMC가 수행 과정에서 주변 블록이 인트라 모드로 부호화되는 경우, 비디오 신호 처리 장치는 PDPC 적용 유무, 필터링의 길이, 및 가중치 중 적어도 하나 이상을 코스트를 기반으로 결정할 수 있다. 구체적으로 비디오 신호 처리 장치는 현재 블록의 움직임 정보를 기초로 현재 블록에 대한 예측 블록을 생성할 수 있다. 비디오 신호 처리 장치는 현재 블록에 인접한 주변 샘플을 이용하여 유도된 인트라 예측 모드를 사용하여, 움직임 정보를 통해 예측한 블록에 PDPC를 적용하여 PDPC 예측 블록을 생성할 수 있다. 비디오 신호 처리 장치는 현재 블록에 대한 예측 블록과 PDPC 예측 블록 사이의 픽셀 단위 SAD 또는 MRSAD 계산을 통해 코스트를 획득할 수 있다. 코스트가 미리 지정된 값보다 큰 경우, 비디오 신호 처리 장치는 대응되는 블록에 PDPC를 적용하지 않을 수 있다. 코스트가 미리 지정된 값보다 작거나 같은 경우, 비디오 신호 처리 장치는 PDPC가 적용된 예측 블록을 현재 블록의 최종 예측 블록으로 사용할 수 있다. 또 다른 구체적인 실시 예에서 비디오 신호 처리 장치는 움직임 정보를 통해 예측한 블록과 PDPC가 적용된 예측 블록을 가중 평균하여 현재 블록의 최종 예측 블록을 생성할 수 있다. 색차 블록에도 동일한 코스트 기반 방법이 적용될 수 있다.
도 51은 본 발명의 실시 예에 따른 비디오 신호 처리 장치가 OBMC 적용된 블록에 대한 디블록킹 필터링의 세기를 결정하는 방법을 보여준다.
현재 블록에 OBMC가 적용되는 경우, 비디오 신호 처리 장치는 인트라 예측 블록을 사용하여 현재 블록의 일부 서브 블록에 OBMC를 적용할 수 있다. 일부 서브 블록은 인트라 예측 블록으로 OBMC가 적용될 수 있다. 인트라 예측 블록과 인터 예측 블록 사이의 경계에서 블록킹 현상이 발생할 수 있다. OBMC 과정에서 서브 블록에 인트라 예측이 적용되어도, 디블록킹 필터링 과정에서는 현재 블록이 인터 부호화 모드이다. 비디오 신호 처리 장치는 인터 부호화 모드에서 적용되는 약한 필터링을 인트라 예측 블록과 인터 예측 블록 사이 경계에 적용할 수 있다. 현재 블록에 OBMC가 적용되고, 서브 블록에 인트라 예측이 적용된 경우, 비디오 신호 처리 장치는 디블록킹 필터링 과정에서 인트라 예측 블록과 인터 예측 블록 사이 경계에 인트라 부호화 모드에 적용되는 강한 필터링을 적용할 수 있다. 비디오 신호 처리 장치는 서브 블록 단위로 인트라 부호화 모드 및 인트라 예측 모드를 저장하고, 부호화 모드 및 예측 모드를 기초로 디블록킹 필터링의 필터링의 세기를 결정할 수 있다. 비디오 신호 처리 장치는 서브 블록 단위로 OBMC 인트라 모드의 적용 여부를 저장하고, OBMC 인트라 모드의 적용 여부를 기초로 디블록킹 필터링의 필터링의 세기를 결정할 수 있다.
도 51의 p와 q는 도 51에서 p 화소를 포함하는 p블록과 q 화소를 포함하는 q 블록일 수 있다. p 블록과 q 블록은 디블록킹 필터링이 수행되는 블록일 수 있다. 예를 들어, 코딩 블록의 서브 블록들 사이의 경계에 디블록킹 필터링이 수행되는 경우 p 블록과 q 블록은 경계를 포함하는 코딩 블록의 서브 블록일 수 있다. 또한, 코딩 블록의 서브 블록과 코딩 블록의 주변 블록 사이의 경계에 디블록킹 필터링이 수행되는 경우, p 블록은 코딩 블록의 주변 블록일 수 있고, q 블록은 코딩 블록의 서브 블록(코딩 블록의 경계를 포함하는 서브 블록)일 수 있다.
디코더는 p블록과 q블록 중 적어도 어느 하나의 블록에 대한 부호화 모드가 인트라 모드인지, CIIP 모드인지 또는 OBMC intra 인지를 판단할 수 있다. 적어도 어느 하나의 블록에 대한 부호화 모드가 인트라 모드, CIIP 모드, 또는 OBMC intra인 경우, 디코더는 현재 블록에 대한 필터링 세기를 나타내는 bS의 값을 2로 설정할 수 있다. 또한, 어느 하나의 블록에 대한 부호화 모드가 인트라 모드, CIIP 모드, 및 OBMC intra도 아닌 경우, 디코더는 p 블록과 q 블록 사이의 에지가 변환 블록 에지이거나 p 블록과 q 블록 적어도 어느 하나가 부호화된 변환 계수를 포함하는지 여부를 판단할 수 있다. 이때, p 블록과 q 블록 사이 에지가 변환 블록 에지이거나 p 블록과 q 블록 중 적어도 어느 하나가 부호화된 변환 계수를 포함하는 경우, 디코더는 bS의 값을 1로 설정할 수 있다. 또한, p 블록과 q 블록 사이 에지가 변환 블록 에지가 아니고, p 블록과 q 블록 중 적어도 어느 하나가 부호화된 변환 계수를 포함하지 않는 경우, 디코더는 p블록과 q 블록 중 적어도 어느 하나의 블록에 IBC 모드가 적용되는지 판단할 수 있다. 적어도 어느 하나의 블록에 IBC 모드가 적용되는 경우, 디코더는 bS의 값을 1로 설정할 수 있다. 이때, 적어도 어느 하나의 블록에 IBC 모드가 적용되지 않는 경우, 디코더는 p 블록의 움직임 정보와 q 블록의 움직임 정보의 차이가 4 이상이거나 p블록의 참조 픽쳐와 q 블록의 참조 픽쳐가 상이한지 판단할 수 있다. p 블록과 q 블록 모두 OBMC가 적용된 블록이 아니고, p 블록의 움직임 정보와 q 블록의 움직임 정보의 차이가 4 이상이거나 p블록의 참조 픽쳐와 q 블록의 참조 픽쳐가 상이한 경우, 디코더는 bS의 값을 1로 설정할 수 있다. p 블록과 q 블록 중 적어도 어느 하나가 OBMC가 적용된 블록이고, p 블록의 움직임 정보와 q 블록의 움직임 정보의 차이가 4 보다 작고 p블록의 참조 픽쳐와 q 블록의 참조 픽쳐가 상이하지 않는 경우, 디코더는 bS의 값을 0으로 설정할 수 있다. bS의 값이 클수록, 디블록킹 필터링의 세기는 커질 수 있다. bS의 값이 2이면 강한 필터링이 수행되고, bS의 값이 1이면 약한 필터링이 수행되고, bS의 값이 0이면 필터링이 수행되지 않을 수 있다. 또한, 강한 필터링이 적용되는 경우, p 블록과 q 블록 사이의 경계 주변의 미리 지정된 개수 이상의 화소 값이 변경될 수 있다. 약한 필터링이 적용되는 경우, 미리 지정된 개수보다 적은 화소 값이 변경될 수 있다. 미리 지정된 개수는 정수 일 수 있다. 예컨대, 미리 지정된 개수는 6일 수 있다.
비디오 신호 처리 장치는 인트라 예측 블록을 사용하여 현재 블록 내 서브 블록 A1, A2, A0/L0, 및 L2에 OBMC를 수행할 수 있다. 앞서 설명한 바와 같이 이를 OBMC Intra라 지칭할 수 있다. 비디오 신호 처리 장치는 인트라 예측으로 인해 발생된 OBMC Intra 예측 블록의 경계 부분에 필터링을 수행하여, 필터링된 OBMC Intra 예측 블록을 생성할 수 있다. 이때, 필터링은 1:2:1 저주파 필터링일 수 있다. 예컨대, 도 50의 OBMC Intra 블록 경계에 모두 필터링이 수행될 수 있다. 현재 블록에 대한 OBMC가 완료된 후, 비디오 신호 처리 장치는 필터링을 적용할 수 있다. 또 다른 구체적인 실시 예에서 OBMC Intra 블록에 대한 OBMC가 완료된 후, 비디오 신호 처리 장치는 서브 블록 단위로 필터링을 수행할 수 있다.
도 52는 본 발명의 실시 예에 따른 매트릭스 기반 인트라 예측 방법을 보여준다.
많은 영상 데이터를 통해 현재 블록과 참조 샘플 사이의 관계를 추론한 모델(또는 매트릭스)을 이용하여 인트라 예측을 수행하는 방법을 매트릭스 기반 인트라 예측 방법(matrix based position dependent intra prediction, PDP)라고 할 수 있다. 도 52의 실시 예에서, 비디오 신호 처리 장치는 현재 예측할 블록(p)에 인접한 복원된 참조 샘플(r) r(k)와 미리 정의된 매트릭스 F(x,y,k) 사이의 계산(도 52의 (b))을 통해 현재 블록에 대한 예측 블록 P(x,y)을 생성할 수 있다. 매트릭스는 현재 블록의 크기, 인트라 예측 방향성 모드에 따라 달라질 수 있다. 또한, 참조 샘플의 크기는 현재 블록의 크기에 따라 달라질 수 있다. 현재 블록의 가로 및 세로 크기가 미리 지정된 제1 크기보다 작거나 같은 경우, T1과 T2는 미리 지정된 제2 크기일 수 있다. 현재 블록의 가로 및 세로 크기가 미리 지정된 제1 크기보다 큰 경우, T1과 T2는 미리 지정된 제3 크기일 수 있다. 이때, 미리 지정된 제1 크기는 16일 수 있다. 또한, 미리 지정된 제2 크기는 2일 수 있다. 또한, 미리 지정된 제3 크기는 1일 수 있다. 또한, 도 47의 W, H 각각은 현재 블록의 너비와 높이를 나타낸다. MIP와 다르게, 현재 블록에 PDP를 적용할 수 있는 조건인 경우, 비디오 신호 처리 장치는 인트라 예측 방향성 모드를 사용하는 인트라 예측을 사용하지 않고, PDP를 통한 매트릭스 기반 인트라 예측을 사용하여 현재 블록에 대한 예측 블록을 생성할 수 있다. 이때, 현재 블록에 PDP를 적용 가능한지는 현재 블록의 크기, 현재 블록의 인트라 예측 방향성 모드, 현재 블록이 휘도 블록인지 또는 색차 블록인지, 추론된 매트릭스가 존재하는지, 참조 샘플이 존재하는지, 현재 블록의 부호화 모드, 및 참조 샘플 라인 중 적어도 하나 이상을 사용하여 결정할 수 있다. 현재 블록의 부호화 모드가 DIMD, OBIC, CIIP, SGPM, TIMD, TMRL, Directional Planar, EIP, MIP, ISP, IBC, Intra TMP, BDPCM, Platte, Inter 모드, LM, 및 CCCM 중 하나인 경우, 비디오 신호 처리 장치는 현재 블록에 PDP 기반 방법을 사용하지 못할 수 있다.
이하에서 DMVR을 사용하여 움직임 정보를 보정하는 방법에 대해 설명한다.
도 53 및 도 54는 본 명세서의 일 실시예에 따른 DMVR을 사용하여 움직임 정보를 보정하는 방법을 나타낸다.
DMVR은 BM(Bilateral Matching) 방법을 사용하여 현재 블록에 대한 보정된 움직임 정보를 획득하는 방법이다. BM(Bilateral Matching) 방법은 양방향 움직임을 가지는 블록에서 L0 참조 블록의 주변 탐색 영역(Search area)과 L1 참조 블록의 주변 탐색 영역에서 서로 간의 가장 유사한 부분을 찾아서 초기 움직임 정보를 보정하고, 보정된 움직임 정보를 현재 블록의 예측에 사용하는 방법이다. 탐색 영역의 크기는 참조 블록의 특정 지점을 기준으로 임의의 (m x n)크기로 설정될 수 있다. 예를 들어, 특정 지점은 참조 블록의 좌상단 위치 또는 참조 블록의 중앙 위치일 수 있고, 임의의 크기는 16 x 16일 수 있다. 가장 유사한 부분은 각 블록 간 화소 단위의 코스트 값을 계산하여 가장 작은 코스트 값에 대응되는 지점일 수 있다. 코스트 값은 SAD(Sum of Absolute Differences) 또는 MRSAD(Mean-Removed SAD) 방법을 이용하여 계산될 수 있다. 코스트 값의 계산을 위해 어떠한 방법이 사용되는지에 대한 정보는 비트스트림의 SPS, PPS, 픽쳐 헤더, 슬라이스 헤더 중 적어도 어느 하나에 포함될 수 있다. 디코더는 해당 정보를 파싱하여 설정되는 방법에 기초하여 코스트 값을 계산할 수 있다. 탐색 영역에 따라 코스트 값은 달라질 수 있고, 보정된 움직임 정보 또한 달라질 수 있다. 디코더는 현재 블록을 복수 개의 서브 블록으로 분할하여 각 서브 블록에 대하여 DMVR을 사용한 움직임 정보를 보정할 수 있다. 크기가 큰 블록들 대비 크기가 작은 블록들에 대한 움직임 정보가 더 정확하기 때문이다. 이때, 크기가 큰 블록에서는 DMVR이 수행되지 않고, 분할된 작은 블록(예, 서브 블록)에서만 DMVR이 수행될 수 있다. 도 54를 참조하면 하나의 블록은 여러 개(예를 들어, 4개)의 서브 블록으로 분할될 수 있다. 디코더는 분할된 각 서브 블록마다 DMVR을 사용하여 보정된 움직임 정보를 획득할 수 있다. 또는 디코더는 큰 블록에서 DMVR을 통해 찾은 보정된 움직임 정보를 사용하여 분할된 작은 블록에서 DMVR을 통해 보다 정확한 움직임 정보를 유도하는 다중 DMVR 방법을 사용할 수 있다.
이하에서 다중 DMVR 방법에 대해 설명한다.
도 55은 본 명세서의 일 실시예에 따른 다중 DMVR이 수행되는 과정을 나타낸다.
도 55의 (a)는 다중 DMVR이 수행되는 일반적인 과정을 나타내고, 도 55의 (b)는 다중 DMVR의 일반적인 과정을 보다 구체적으로 나타낸다.
도 55의 (a)를 참조하면, 다중 DMVR은 초기 움직임 정보에 기초하여 코딩 유닛(블록) 단위의 DMVR을 수행하여 하나 이상의 보정된 움직임 정보를 획득할 수 있다(S3310). 현재 코딩 블록에 TM이 적용되는 경우, 디코더는 S3310 단계에서 획득한 하나 이상의 보정된 움직임 정보를 이용하여 TM을 수행할 수 있다(S3320). TM을 수행하여 결정되는 현재 코딩 블록의 보정된 움직임 정보가 양방향에서 단방향으로 변경되었다면, DMVR 과정을 수행할 수 없으므로 S3320 이후의 단계들(S3330, S3340)은 수행되지 않고, 현재 블록의 움직임은 단방향으로 최종 결정된다. TM을 수행한 결과, 현재 코딩 블록의 보정된 움직임 정보가 양방향이라면, 디코더는 서브 블록 단위의 DMVR을 수행하여 각 서브 블록마다 서브 블록 단위의 보정된 움직임 정보를 획득할 수 있다(S3330). 그리고 디코더는 S3340 단계에서 획득한 서브 블록 단위의 보정된 움직임 정보를 BDOF에 기반하여 다시 보정하고, BDOF에 기반하여 보정된 움직임 정보를 최종적으로 획득할 수 있다.
도 55의 (b)를 참조하면, 도 55의 (a)의 S3310 단계는 정수 단위의 탐색을 이용하여 코딩 유닛(블록) 단위의 DMVR을 수행하는 단계(S3301)와 반화소 단위의 탐색을 이용하여 코딩 유닛(블록) 단위의 DMVR을 수행하는 단계(S3302)로 세분화 될 수 다. S3310 단계에서 디코더가 현재 코딩 유닛(블록)의 보정된 움직임 정보와 픽셀 기반 코스트 값을 계산하기 위해 3x3 Square 탐색을 사용할 수 있다. 이때, 움직임 해상도는 S3301 단계에서는 정수 단위로, S3302 단계에서는 반화소(1/2) 단위로 설정될 수 있다. S3301 단계에서 디코더는 초기 움직임 정보와 정수 단위 보정 값을 사용하여 보정된 움직임 정보를 획득할 수 있다.
이하에서 도 55의 (a)의 S3330 단계에 대해 자세히 설명한다.
S3330 단계에서 디코더는 현재 코딩 블록을 여러 개의 서브 블록으로 분할한 후, 각 서브 블록마다 도 55의 (b)의 S3304, S3305 단계가 수행될 수 있다. 이때 서브 블록의 크기는 최대 16 x 16일 수 있다.
디코더는 S3320 단계에서 획득한 보정된 움직임 정보를 S3304, S3305 단계를 위한 초기 움직임 정보로 설정할 수 있다. 디코더는 초기 움직임 정보를 이용하여 정수 단위의 전역 탐색을 수행하고, 현재 서브 블록에 대한 최적의 움직임 정보와 최적의 움직임 정보에 대한 코스트 값을 획득할 수 있다(S3304). S3304단계 이후, 디코더는 반화소(1/2) 단위의 3x3 Square 탐색을 수행할 수 있다. S3304 단계를 통해 획득되는 움직임 정보는 S3305 단계의 기준 움직임 정보로 사용될 수 있다. 즉, S3304 단계를 통해 획득된 정보에 기초하여 새로운 움직임 후보가 획득되고, 디코더는 새로운 움직임 후보를 평가할 수 있다(S3305). 디코더는 새로운 움직임 후보에 대한 평가를 수행하고, 최종 움직임 정보를 현재 서브 블록에 대해 저장할 수 있다. S3304, S3305 단계는 모든 서브 블록에 대해 반복되어 수행될 수 있다. 서브 블록 단위의 DMVR 과정은 서브 블록 간의 의존성이 없으므로, 모든 서브 블록이 병렬적으로 DMVR을 수행할 수 있다는 장점이 있다.
인코더는 S3320, S3303의 템플릿 매칭(TM)이 수행되는지(적용되는지) 여부를 나타내는 정보를 포함하는 비트스트림을 생성할 수 있다. 디코더는 템플릿 매칭의 적용 여부를 나타내는 정보를 파싱하여 현재 블록에 템플릿 매칭이 적용되는지 여부를 설정할 수 있다.
템플릿 매칭의 적용 여부는 현재 블록 또는 CU 단위로 결정될 수 있다. 예를 들어, 현재 블록에 템플릿 매칭이 적용되고, 현재 블록의 움직임 정보가 양방향 움직임이면, L0 움직임 정보와 L1 움직임 정보 각각에 템플릿 매칭이 수행될 수 있다. 그렇지 않다면, L0 움직임 정보와 L1 움직임 정보 모두에 템플릿 매칭이 수행되지 않을 수 있다.
템플릿 매칭의 적용 여부는 현재 블록의 움직임 정보의 방향 별로 결정될 수 있다. 예를 들어, 현재 블록의 L0 움직임 방향에는 템플릿 매칭이 적용되었고, L1 움직임 방향에는 템플릿 매칭이 적용되지 않았다면, 현재 블록의 L0 움직임 정보에는 템플릿 매칭을 적용하고, L1 움직임 정보에는 템플릿 매칭이 적용되지 않을 수 있다. 또는 인코더 및 디코더에서는 암묵적으로 현재 블록의 L0 움직임 방향에만 템플릿 매칭을 적용하고, L1 움직임 방향에는 보정된 L0 움직임 정보와 참조 픽쳐 간의 거리에 기초하여 L1 움직임 정보가 보정될 수 있다. 또한, L1 움직임 방향에 대한 템플릿 적용 여부를 시그널링하기 위한 컨텍스트 모델은 현재 블록의 크기, 현재 블록의 가로 및 세로의 크기 비율, 움직임 정보의 차분 값의 크기, L0 움직임 방향에 대한 템플릿 적용 여부 중에서 적어도 하나 이상에 기초하여 결정될 수 있다.
비디오 신호 처리 장치는 움직임 정보 후보 리스트 내의 움직임 정보 후보들에 대한 코스트 값과 움직임 정보 후보에 TM이 적용되는지 여부에 대한 정보에 기초하여 움직임 정보 후보 리스트를 재구성할 수 있다. 움직임 정보 후보 리스트에는 코스트 값이 최소인 움직임 정보 후보에 TM을 적용한 움직임 정보 후보와 코스트 값이 최소인 움직임 정보 후보에 TM이 적용되지 않은 움직임 정보 후보가 포함될 수 있다. 이때 움직임 정보 후보 리스트 내의 순서는 TM이 적용된 움직임 정보 후보가 첫 번째에 위치하고, TM이 적용되지 않은 움직임 정보 후보가 두 번째에 위치할 수 있다. 또는 그 반대의 순서도 가능할 수 있다. 즉, 움직임 후보 리스트는 TM의 적용 여부에 기초하여 구성될 수 있다. 이때, TM이 적용되는지 여부에 대한 정보와 최적의 움직임 정보 후보에 대한 정보는 통합될 수 있고, 통합된 움직임 정보 후보 리스트 중에서 어떤 움직임 정보 후보를 사용했는지 및 TM이 적용되었는지에 대한 인덱스 정보가 비트스트림에 포함될 수 있다. 디코더는 인덱스 정보를 파싱하여 현재 블록에 대한 움직임 정보 후보를 결정할 수 있다.
도 56은 본 명세서의 일 실시예에 따른 코딩 블록의 보정된 움직임 정보와 관련된 코스트 값을 획득하기 위한 탐색 방법을 나타낸다.
도 56을 참조하면 디코더는 초기 움직임 정보를 획득하고, 획득된 초기 움직임 정보에 기초하여 탐색할 움직임 후보들을 설정할 수 있다. 그리고 디코더는 설정된 움직임 후보들에 대한 평가를 수행하여 획득되는 코스트 값에 기초하여 보정된 움직임 정보를 획득할 수 있다. 그리고 디코더는 현재 블록의 움직임 정보 해상도에 따라 모델 기반 fractional MVD 최적화를 이용하여 최종적인 보정된 움직임 정보를 획득할 수 있다. 도 55의 (b)의 S3301, S3302, S3304, S3305, S3306 단계에서 획득되는 보정된 움직임 정보는 도 56와 도 57을 통해 설명하는 방법을 통해 획득될 수 있다.
도 57은 본 명세서의 일 실시예에 따른 3x3 Square 탐색 방법을 나타낸다.
이하에서 도 57을 참조하여 도 56을 통해 설명한 최종적인 보정된 움직임 정보를 획득하는 방법을 보다 구체적으로 설명한다.
디코더는 이전 단계에서 보정된 움직임 정보에 대한 코스트 값을 획득(계산)할 수 있다(S3501). 이때, 기존에 획득한 보정된 움직임 정보에 대한 코스트 값이 존재한다면 S3501 단계는 생략될 수 있다. S3501 단계에서 획득되는 코스트 값은 움직임 해상도에 따라 다른 방법으로 획득될 수 있다. 예를 들어, 움직임 해상도가 정수 단위라면, 보정된 움직임 정보에 대한 화소(픽셀) 기반 코스트 값으로 획득될 수 있으며 기준 코스트 값으로 사용된다. 움직임 해상도가 반화소(1/2) 단위라면, 디코더는 초기 움직임 정보와 보정된 움직임 정보를 사용하여 획득되는 움직임 정보에 기반한 코스트 값을 획득하고 보정된 움직임 정보에 대한 화소 기반 코스트 값을 획득한다. 다음으로 움직임 정보에 기반한 코스트 값이 화소(픽셀) 기반으로 계산된 코스트 값보다 크다면, 보정된 움직임 정보가 저장되고 다음 과정은 수행되지 않고 생략된다. 만일 움직임 정보에 기반한 코스트 값이 화소(픽셀) 기반으로 계산된 코스트 값보다 같거나 작다면, 화소(픽셀) 기반 코스트 값에 움직임 정보에 기반한 코스트 값을 더한 코스트 값이 기준 코스트 값으로 사용된다. 디코더는 탐색할 움직임 후보들에 대한 보정 값을 설정할 수 있다(S3502). 구체적으로, 정해진 3x3 Square 탐색 패턴에 따라 움직임 보정 후보 값은 유도될 수 있다. 이때 움직임 보정 후보 값은 움직임 해상도에 기초하여 설정될 수 있다. 움직임 해상도에 따라 움직임 보정 후보 값은 스케일되어 범위가 확장될 수 있다. 예를 들어, 정해진 3x3 Square 탐색 패턴의 수평 및 수직 방향은 Mv(-1, 1), Mv(0, 1), Mv(1, 1), Mv(1, 0), Mv(1, -1), Mv(0, -1), Mv(-1, -1), Mv(-1, 0)일 수 있다. 움직임 해상도가 반화소(1/2) 단위일 경우, 계산 복잡도를 감소시키기 위해 3x3 Square 탐색 패턴에서 홀수 번째만 평가가 수행되고, 짝수 번째는 평가가 수행되지 않을 수 있다. 디코더는 보정된 움직임 후보와 움직임 보정 후보 값을 이용하여 새로운 움직임 후보를 설정할 수 있다. 디코더는 L0 픽쳐리스트 내 픽쳐의 참조 블록에 대한 움직임 정보와 L1 픽쳐리스트 내 픽쳐의 참조 블록에 대한 움직임 정보를 재구성할 수 있다(S3504). 선형적인 특성을 가지는 L0 및 L1 움직임을 평가하기 위해서, 디코더는 보정된 L0 움직임 후보에는 움직임 보정 후보 값을 합산하고, 보정된 L1 움직임 후보에는 움직임 보정 후보 값을 차분하여 새로운 움직임 후보를 생성할 수 있다. 또한, 비선형적인 특성을 지니는 L0 및 L1 움직임을 평가하기 위해서, 디코더는 보정된 L0 움직임 후보는 수정하지 않고, 보정된 L1 움직임 후보에는 움직임 보정 후보 값을 합산하여 새로운 움직임 후보를 생성할 수 있다. 또는, 디코더는 보정된 L1 움직임 후보는 수정하지 않고, 보정된 L0 움직임 후보에는 움직임 보정 후보 값을 합산하여 새로운 움직임 후보를 생성할 수 있다. 디코더는 새로운 움직임 후보에 대한 움직임 정보에 기초한 코스트 값을 계산할 수 있다(S3505). 디코더는 새로운 움직임 후보에 대한 움직임 정보에 기초한 코스트 값을 기준 코스트 값과 비교할 수 있다(S3506). 움직임 정보에 기초한 코스트 값이 기준 코스트 값보다 큰 경우, 디코더는 움직임 정보에 기초한 코스트 값의 2배에 해당하는 값을 메모리에 저장할 수 있다. 그리고 디코더는 S3506 단계 이후의 과정은 수행하지 않고 S3502 단계부터 반복하여 다시 수행할 수 있다. 움직임 정보에 기초한 코스트 값이 기준 코스트 값보다 작은 경우, 디코더는 새로운 움직임 후보에 대한 화소(픽셀) 기반 코스트 값을 획득할 수 있다(S3507). 그리고, 기준 코스트 값을 움직임 정보에 기초한 코스트 값과 새로운 움직임 후보에 대한 화소 기반 코스트 값을 합산한 값으로 갱신할 수 있다. 만약 움직임 해상도가 반화소(1/2) 단위일 경우, 디코더는 다른 새로운 움직임 후보를 평가하기 위해서 S3501 단계부터 다시 반복하여 수행할 수 있다. 즉, 움직임 해상도가 반화소(1/2) 단위일 경우에는 디코더는 새로운 움직임 후보에 대한 평가 결과만 저장하고 최적의 움직임 후보로는 사용하지 않을 수 있다. 저장된 새로운 움직임 후보에 대한 평가 결과(코스트 값)는 이후에 수행될 수 있는 모델 기반 fractional MVD 최적화 단계에서 사용될 수 있다. 만일 움직임 해상도가 정수 단위일 경우, 새로운 움직임 후보에 대한 움직임 정보에 기초한 코스트 값과 화소(픽셀) 기반 코스트 값을 합산한 값이 초기 보정된 움직임 정보에 대한 화소(픽셀) 기반 코스트 값보다 작다면, 디코더는 새로운 움직임 후보를 최적의 움직임 정보로 저장할 수 있다. 만약 움직임 해상도가 정수 단위일 경우, 디코더는 S3507 단계에서 획득한 새로운 움직임 후보에 대한 화소(픽셀) 기반 코스트 값을 최적의 움직임 정보에 대한 코스트 값으로 저장할 수 있다. 이후, 디코더는 아직 탐색하지 못한 움직임 후보가 있는지 확인할 수 있다(S3508). 디코더는 아직 탐색하지 못한 움직임 후보가 있다면 새로운 움직임 후보를 평가하기 위해서 S3501 단계를 반복하여 수행할 수 있고, 모든 움직임 후보에 대해 평가를 하였다면 탐색한 움직임 후보에 대한 코스트 값들 중 가장 작은 코스트 값에 대응하는 움직임 후보를 최종 보정 움직임으로 저장할 수 있다(S3509). 디코더는 움직임 해상도가 반화소(1/2) 단위일 경우, 이전 단계에서 저장된 움직임 후보들에 대한 코스트 값들을 사용하여 모델 기반 fractional MVD 최적화 과정이 수행되어 최적의 반화소 단위의 보정 움직임 정보를 다시 계산할 수 있다(S3510). S3510 단계는 VVC(Versatile Video Coding)의 DMVR에서 정수 단위의 화소(픽셀) 기반 코스트 값을 사용하여 소수 화소 단위의 움직임을 유도하는 과정과 유사할 수 있다. 디코더는 최적 움직임 정보의 위치에 인접한 주변(좌, 우, 위, 아래) 움직임 정보에 대한 코스트 값을 사용하여 최적 움직임 정보를 획득할 수 있다.
도 57을 참조하여 설명한 탐색 방법은 임의의 정해진 횟수만큼 반복 수행될 수 있고, 반복 수행될 때, 디코더는 이전 탐색에서 획득한 최적 움직임 정보의 주변 위치만을 탐색할 수 있다.
도 58은 본 명세서의 일 실시예에 따른 정수 단위 전역 탐색 과정을 위해 구역별로 나누어진 탐색 영역을 나타낸다.
도 58을 참조하면, 정수 단위 전역 탐색은 탐색 영역을 가운데 위치를 중심으로 여러 개의 구역으로 나누고, 구역별로 서로 다른 가중치를 설정해서 수행되는 탐색일 수 있다. 탐색 영역의 가운데 위치는 초기 움직임 정보가 지시하는 참조 블록의 좌상단 화소(픽셀) 위치일 수 있다. 각 구역별 가중치는 현재 블록의 주변 블록 및 현재 블록의 움직임 특성에 따라 다르게 설정될 수 있다. 예를 들어, 현재 블록의 주변 블록 및 현재 블록의 움직임 간 유사성이 높을 경우, 가중치는 가운데 구역부터 가장자리 구역 순으로 높아지도록 설정될 수 있다. 반대로, 현재 블록의 주변 블록 및 현재 블록의 움직임 간 유사성이 낮을 경우, 가중치는 가운데 구역부터 가장자리 구역 순으로 낮아지도록 설정될 수 있다. 도 55의 (a)의 S3310 단계에서 획득되는 보정된 움직임 정보에 대한 화소(픽셀) 기반 코스트 값이 임의의 값보다 작다면, 정수 단위 전역 탐색은 수행되지 않을 수 있다. 또한, 탐색 영역 내에서 임의의 움직임 보정 값에 대한 화소(픽셀) 기반 코스트 값이 임의의 값보다 작다면, 임의의 움직임 보정 값이 최종 보정된 움직임 정보가 되고, 정수 단위 전역 탐색은 종료될 수 있다. 임의의 값은 현재 블록의 화소(픽셀) 수 또는 현재 블록의 크기가 될 수 있다. 예를 들어, 현재 블록의 크기는 16x16 일 수 있다.
도 59 및 도 60은 본 명세서의 일 실시예에 따른 정수 단위의 전역 탐색 과정을 나타낸다.
도 59를 참조하면 디코더는 입력된 초기 움직임 정보에 기초하여 탐색할 움직임 후보들을 설정할 수 있다. 그리도 디코더는 움직임 후보들에 대한 평가를 수행하여 최종 보정 움직임 정보를 획득할 수 있다. 정수 단위의 전역 탐색은 도 30에 도시된 바와 같이 가운데 구역부터 가장자리 구역 순으로, 각 구역별 모든 위치에 대하여 수행될 수 있다.
이하에서 도 60을 참조하여 정수 단위의 전역 탐색에 대해 보다 자세히 설명한다. 도 60을 참조하면 디코더는 블록의 크기에 따라 탐색 영역 내의 각 구역별 탐색 위치를 재설정할 수 있다(S3801). 이때, 블록의 크기가 임의의 값보다 작다면, 디코더는 계산 복잡도 감소를 위해 도 58의 가운데 위치를 기준으로 임의의 값만큼 축소된 탐색 영역만을 평가한다. 임의의 값은 현재 블록의 크기의 절반이거나 양의 정수가 될 수 있으며, 예를 들어, '8'일 수 있다. 초기 움직임 정보를 사용하여 화소(픽셀) 기반 코스트 값을 계산한 후, 그것을 최소 코스트 값으로 설정한다. 디코더는 움직임 후보의 탐색 위치에 대한 움직임 보정 값을 설정하고, 움직임 보정 값을 현재 블록에서 사용될 움직임 해상도(resolution)에 맞게 재설정할 수 있다(S3802, S3803). 디코더는 S3803 단계에서 재설정된 움직임 보정 값을 이용하여 새로운 움직임 후보를 설정할 수 있다. 디코더는 L0 픽쳐리스트 내 픽쳐의 참조 블록에 대한 움직임 정보와 L1 픽쳐리스트 내 픽쳐의 참조 블록에 대한 움직임 정보를 재구성할 수 있다(S3804). 선형적인 특성을 지니는 L0 및 L1 움직임을 평가하기 위해서, 디코더는 보정된 L0 움직임 후보에는 움직임 보정 후보 값을 합산하고, 보정된 L1 움직임 후보에는 움직임 보정 후보 값을 차분하여 새로운 움직임 후보를 생성할 수 있다. 또한 비선형적인 특성을 지니는 L0 및 L1 움직임을 평가하기 위해서, 디코더는 보정된 L0 움직임 후보는 수정하지 않고, 보정된 L1 움직임 후보에는 움직임 보정 후보 값을 합산하여 새로운 움직임 후보를 생성할 수 있다. 또한 디코더는 보정된 L1 움직임 후보는 수정하지 않고, 보정된 L0 움직임 후보에는 움직임 보정 후보 값을 합산하여 새로운 움직임 후보를 생성할 수 있다. 디코더는 새로운 움직임 후보에 대한 화소(픽셀) 기반 코스트 값을 획득할 수 있다(S3805). 각 구역별로 코스트 값을 차별화하기 위해 디코더는 미리 정의된 각 구역별 가중치 값을 사용하여 코스트 값을 재획득할 수 있다(S3806). 가중치 값은 실험을 통해 구해진 값으로 양의 정수 값이 될 수 있다. 예를 들어, 가중치 값은 '1', '2', … , '63'일 수 있다. 디코더는 재획득된 코스트 값이 최소 코스트 값보다 작다면, 최소 코스트 값을 재획득된 코스트 값으로 갱신할 수 있다. 디코더는 모든 움직임 후보에 대한 평가가 완료되었는지 여부를 평가할 수 있다(S3807). 아직 평가가 완료되지 않은 움직임 후보가 있다면 최소 코스트 값을 이용하여 S3802 단계부터 다시 수행할 수 있다. 모든 움직임 후보에 대한 평가가 완료되었다면 디코더는 움직임 후보들 각각의 코스트 값 중 가장 작은 코스트 값에 대응되는 움직임 후보의 정보를 최종 보정된 움직임 정보로 설정할 수 있다. 정수 단위의 전역 탐색은 복잡도를 낮추기 위해서 조기 종료 방법이 적용될 수 있다. S3806 단계에서 재획득된 코스트 값이 최소 코스트 값보다 작고, 재획득된 코스트 값에서 최소 코스트 값을 뺀 차이 값이 임의의 값보다 작을 경우, S3807 단계를 검사하지 않고 S3808 단계가 수행되고 정수 단위의 전역 탐색이 종료될 수 있다. 임의의 값은 현재 블록의 크기 혹은 픽셀 수가 될 수 있으며, 예를 들어, 16x16 일 수 있다.
도 61 및 도 62는 본 명세서의 일 실시예에 따른 BDOF에 기반한 움직임 정보의 보정을 수행하는 방법을 나타낸다.
도 61 및 도 62의 BDOF에 기반한 움직임 정보의 보정은 도 55의 S3340, S3306 단계의 BDOF 기반 움직임 정보의 보정을 구체적으로 나타낸다.
도 61을 참조하면, 디코더는 현재 블록을 서브 블록으로 분할한 후, 입력된 초기 움직임 정보에 기초하여 BDOF 기반 움직임 정보의 보정 값을 계산하여 최종 보정 움직임 정보를 획득할 수 있다. BDOF는 양방향 움직임으로 구성된 블록의 참조 블록으로부터 화소의 변화량을 추정하여 예측 블록을 보정하는데 사용될 수 있다. BDOF에서 유도된 움직임 정보를 이용하여 현재 블록의 움직임을 보정할 수 있다. 현재 블록이 affine, LIC, OBMC, sub-block MC, CIIP, SMVD, BCW with different weight, MMVD 중에서 적어도 하나의 모드로 부호화 되었다면, BDOF 기반 움직임 보정은 수행되지 않을 수 있다. 한편, BDOF 기반 움직임 보정은 다음의 조건 중 어느 하나라도 만족할 때 수행될 수 있다. BDOF 기반 움직임 보정이 수행되기 위한 조건은 현재 블록이 i) merge 모드의 움직임이 양방향인 경우, ii) 참조 픽쳐들과 현재 픽쳐 간의 거리가 동일한 경우, iii) 참조 블록들 간의 가중치 예측이 적용되지 않은 블록인 경우, iv) 현재 블록의 크기가 임의의 정해진 크기 이상일 경우일 수 있다. 임의의 정해진 크기는 블록의 가로, 세로일 수 있다. 예를 들어, 블록의 가로의 크기는 '8', 세로의 크기는 '8'일 수 있다. 또한, BDOF 기반 움직임 보정은 서브 블록 단위로 수행될 수 있고, 서브 블록의 크기는 최대 16x16일 수 있다.
이하에서는 각 서브 블록에 대해 BDOF 기반 움직임 보정을 수행하는 과정에 대해 설명한다. 도 40을 참조하면 인접한 서브 블록들 간에는 움직임 정보가 동일할 수 있으며, 동일한 움직임 정보를 가지는 서브 블록들을 병합하여 BDOF는 한 번만 수행할 수 있다(S4001, S4002). 현재 블록의 너비와 높이의 크기 차이에 따라 서브 블록들을 가로 혹은 세로 방향으로 병합할지 결정할 수 있다. 예를 들어, 현재 블록의 너비보다 높이가 크다면, 서브 블록들은 세로 방향으로 병합될 수 있고, 현재 블록의 높이보다 너비가 크다면, 서브 블록들은 가로 방향으로 병합될 수 있다. 디코더는 각각의 서브 블록 또는 병합된 서브 블록들에 대하여 S4003 내지 S4014 단계를 반복적으로 수행하여 보정된 움직임 정보 혹은 예측 블록을 획득할 수 있다.
디코더는 L0 참조 블록과 L1 참조 블록을 이용하여 BDOF 파라미터를 획득할 수 있다(S4003). BDOF 파라미터는 화소 값 간의 변화량 등이 있을 수 있다. 디코더는 현재 블록을 최대 8x8 크기의 서브 블록으로 분할한 후(S4004), 각각의 서브 블록마다 S4005 내지 S4012의 단계를 반복 수행할 수 있다.
디코더는 L0 및 L1 참조 블록 간의 화소(픽셀) 기반 코스트 값을 획득할 수 있다(S4005). 디코더는 코스트 값을 기 설정된 한계 값과 비교할 수 있다(S4006). 비교 결과 코스트 값이 기 설정된 한계 값보다 작다면 디코더는 움직임 보정을 수행하지 않고 움직임 보정 값에 (0,0)을 대입하여 L0 및 L1 참조 블록을 사용하여 서브 블록에 대한 예측 블록을 생성할 수 있다(S4007, S4009). 반대로, 비교 결과 코스트 값이 기 설정된 한계 값보다 같거나 크다면 디코더는 BDOF에 기반한 움직임 보정 값을 획득할 수 있다(S4008). 디코더는 움직임 보정 값이 (0,0)인지 여부를 확인할 수 있다(S4010). 움직임 보정 값이 (0,0)이라면, 디코더는 BDOF에 기반한 예측 블록을 생성할 수 있고, 움직임 보정 값이 (0,0)이 아니라면, S4008 단계에서 획득한 보정 값을 저장할 수 있다(S4011, S4012). S4012 단계에서 저장되는 보정된 움직임 정보는 도 61의 최종 보정된 움직임 정보일 수 있다.
디코더는 S4003 내지 S4012 단계가 모든 8x8 서브 블록마다 수행되었는지 확인할 수 있다(S4013). S4005 내지 S4012 단계가 수행되지 않은 8x8 서브 블록이 있다면 디코더는 S4005 내지 S4012 단계를 반복하여 수행할 수 있다. S4005 내지 S4012 단계가 모든 8x8 서브 블록에 수행되었다면 디코더는 모든 16x16 서브 블록에 대하여 S4003 내지 S4012 단계가 수행되었는지 확인할 수 있다(S4014). S4003 내지 S4012 단계가 수행되지 않은 16x16 서브 블록이 있다면 디코더는 S4003 내지 S4012 단계를 반복하여 수행할 수 있다. S4003 내지 S4012 단계가 모든 16x16 서브 블록에 수행되었다면 BDOF에 기반한 움직임 보정을 종료할 수 있다. 이때, 8x8 서브 블록은 16x16 서브 블록을 구성하는 서브 블록일 수 있다.
도 63 및 도 64는 본 명세서의 일 실시예에 따른 BDOF에 기반한 현재 블록에 대한 예측 블록을 생성하는 방법을 나타낸다.
도 63을 참조하면 디코더는 도 61 및 도 62에서 설명한 과정을 수행하여 획득된 최종 보정된 움직임 정보를 이용하여 현재 블록에 대한 예측 블록을 생성할 수 있다. 디코더는 현재 블록을 서브 블록으로 분할하여 각 서브 블록 단위로 최종 보정된 움직임 정보를 이용하여 BDOF에 기반한 현재 블록에 대한 예측 블록을 생성할 수 있다.
이하에서 BDOF에 기반한 예측 블록을 생성하는 구체적인 과정에 대해 설명한다.
도 64를 참조하면 디코더는 현재 블록을 8x8 서브 블록으로 분할할 수 있다(S4201). 디코더는 도 55의 S3330 또는 S3304, S3305 단계를 수행하여 획득되는 보정된 움직임 정보와 S3340 또는 S3306 단계를 수행하여 획득되는 움직임 보정 값을 합산하여 최종 보정된 움직임 정보를 획득할 수 있다(S4202). 이때, 디코더는 도 55의 S3340 또는 S3306 단계에서 획득된 움직임 보정 값이 (0,0)인지 여부를 확인할 수 있다(S4203). 확인 결과 움직임 보정 값이 (0,0)인 경우, 디코더는 휘도 성분에 대한 예측 블록으로 도 62의 S4009, S4011 단계에서 획득된 예측 블록을 사용할 수 있다(S4204). 또한, 확인 결과 움직임 보정 값이 (0,0)인 경우, 디코더는 색차 성분에 대한 예측 블록을 생성할 수 있다(S4206). 한편, 확인 결과 움직임 보정 값이 (0,0)이 아닌 경우, 디코더는 BDOF에 기반한 휘도 성분 및 색차 성분에 대한 예측 블록을 생성할 수 있다(S4205). 디코더는 상술한 S4202 내지 S4206 단계가 모든 8x8 서브 블록에 대해 수행되었는지 여부를 확인하고, 수행되지 않은 서브 블록이 있다면 S4202 내지 S4206 단계를 반복하여 수행할 수 있다(S4207).
도 65는 본 명세서의 일 실시예에 따른 색차 블록과 색차 블록에 대응되는 휘도 블록을 나타낸다.
비디오 신호 처리 장치는 색차 블록에 대응되는 휘도 블록의 움직임 정보에 기초하여 색차 블록에 대한 움직임 정보를 유도할 수 있다. 색차 블록에 대응되는 휘도 블록은 코-로케이트된(co-located) 휘도 블록으로 기술될 수 있다. 도 65를 참조하면 휘도 블록의 좌상단 픽셀(화소)의 위치는 (xCbL, yCbL)일 수 있고, 색차 블록의 좌상단 픽셀의 위치는 (xCbC, yCbC)일 수 있다. 움직임 정보는 움직임 벡터를 포함할 수 있다. 본 명세서에서의 색차 블록에 대한 움직임 정보를 유도하기 위한 휘도 블록은 IBC 모드 또는 인트라 TMP 모드로 부호화된 블록일 수 있다.
비디오 신호 처리 장치는 색차 블록에 대응되는 휘도 블록의 움직임 정보를 사용하여 색차 블록에 대한 움직임 정보를 유도(설정)할 수 있다. 비디오 신호 처리 장치는 휘도 블록으로부터 유도되는 움직임 정보를 사용하여 색차 블록에 대한 예측 블록을 생성할 수 있다. 비디오 포맷이 4:4:4인 경우, 휘도 블록과 색차 블록은 서로 동일한 크기를 가지므로 휘도 블록으로부터 유도된 움직임 정보는 색차 블록에 그대로(동일하게) 사용될 수 있다. 비디오 포맷이 4:4:4가 아닌 4:2:2 또는 4:2:0인 경우, 휘도 블록과 색차 블록은 서로 크기가 상이하므로 비디오 신호 처리 장치는 휘도 블록으로부터 유도한 움직임 정보를 스케일링하고, 스케일링된 움직임 정보를 색차 블록에 대한 움직임 정보로 사용할 수 있다. 이때, 휘도 블록으로부터 유도된 움직임 정보는 휘도 블록과 색차 블록 간의 크기 비율에 따라 스케일링될 수 있다. 비디오 신호 처리 장치는 스케일링된 움직임 정보를 사용하여 색차 블록에 대한 예측 블록을 생성할 수 있다. 예를 들어, 비디오 포맷이 4:2:0인 경우, 비디오 신호 처리 장치는 휘도 블록으로부터 유도한 움직임 정보 중 움직임 벡터를 스케일링하여 스케일링된 움직임 정보를 획득할 수 있다. 예를 들어, 비디오 신호 처리 장치는 휘도 블록으로부터 유도한 움직임 벡터의 수직 또는 수평 성분을 2로 나누어(또는 움직임 벡터의 수직 또는 수평 성분 >> 1) 스케일링된 움직임 정보를 획득할 수 있다. X >> Y 연산은 오른쪽 쉬프트 연산으로 X를 Y개수만큼 2로 나눈 몫을 출력한다.
현재 블록이 듀얼 트리 구조로 부호화된 경우, 현재 블록의 색차 블록과 휘도 블록의 분할 구조는 서로 상이할 수 있다. 하나의 색차 블록에 대응되는 휘도 블록은 복수 개일 수 있고, 각각의 휘도 블록의 움직임 정보는 상이할 수 있다. 즉, 비디오 신호 처리 장치가 복수의 휘도 블록들 중 어떠한 휘도 블록의 움직임 정보를 사용하여 색차 블록의 움직임 정보를 유도하는지에 따라 압축 성능은 달라질 수 있다. 이하에서는 비디오 신호 처리 장치가 색차 블록의 움직임 정보를 효과적으로 유도하기 위한 방법에 대해 설명한다.
비디오 신호 처리 장치는 하나의 색차 블록에 대응되는 휘도 블록이 분할되었는지 여부를 확인할 수 있다. 이때, 비디오 신호 처리 장치는 휘도 블록이 분할되었는지 여부는 휘도 블록의 분할 정보를 통해 확인할 수 있다. 비디오 신호 처리 장치는 휘도 블록의 특정 위치들에서의 움직임 정보들이 서로 동일한지 여부에 따라 휘도 블록의 분할 여부를 확인할 수 있다. 이때, 특정 위치들은 도 30을 참조하면 휘도 블록의 좌상단 픽셀(TL), 우상단 픽셀(TR), 가운데 픽셀(C), 좌하단 픽셀(BL), 우하단 픽셀(BR)일 수 있다. 예를 들어, 휘도 블록의 TL, TR, C, BL, BR의 움직임 정보가 서로 동일하면, 비디오 신호 처리 장치는 휘도 블록이 분할되지 않은 것으로 유추할 수 있다. 또는 휘도 블록의 TL, TR, C, BL, BR의 움직임 정보들 중 적어도 어느 하나가 상이하면, 비디오 신호 처리 장치는 휘도 블록이 두 개 이상의 블록으로 분할된 것으로 유추할 수 있다.
휘도 블록의 분할 여부에 따라 색차 블록의 움직임 정보를 유도하는 방법은 달라질 수 있다. 휘도 블록이 분할되지 않은 경우, 비디오 신호 처리 장치는 색차 블록의 특정 위치에 대응되는 휘도 블록의 움직임 정보를 색차 블록에 대한 움직임 정보로 사용할 수 있다. 이하에서 휘도 블록이 분할된 경우, 비디오 신호 처리 장치가 색차 블록에 대한 움직임 정보를 유도하는 방법에 대해 설명한다.
하나의 색차 블록에 대응되는 휘도 블록이 복수개인 경우, 비디오 신호 처리 장치는 복수개의 휘도 블록들의 움직임 정보들을 사용하여 움직임 후보 리스트를 구성할 수 있다. 비디오 신호 처리 장치는 코스트에 기초하여 움직임 후보 리스트에 포함된 움직임 정보들 중 어느 하나를 색차 블록에 대한 움직임 정보로 결정할 수 있다. 비디오 신호 처리 장치는 색차 블록에 인접한 복원된 주변 픽셀들을 사용하여 기준 템플릿을 구성할 수 있다. 비디오 신호 처리 장치는 움직임 후보 리스트 내 각각의 움직임 후보가 지시하는 위치의 참조 픽쳐 내 주변 픽셀들을 사용하여 참조 템플릿을 구성할 수 있다. 비디오 신호 처리 장치는 기준 템플릿과 참조 템플릿 간의 SAD(또는 MR-SAD)를 이용하여 움직임 후보 리스트에 포함된 움직임 후보들 각각의 코스트를 계산하고, 오름차순으로 움직임 후보들을 재정렬하여 움직임 후보 리스트를 재구성할 수 있다. 비디오 신호 처리 장치는 재정렬된 움직임 후보들 중 코스트가 가장 낮은 움직임 후보를 색차 블록에 대한 움직임 정보로 결정할 수 있다.
비디오 신호 처리 장치는 색차 블록을 여러 개의 서브 블록으로 분할한 후, 각 색차 서브 블록의 특정 위치에 대응되는 휘도 블록의 움직임 정보를 사용하여 각 색차 서브 블록의 움직임 정보를 결정할 수 있다.
비디오 신호 처리 장치는 공간적인 주변 블록으로부터 유도된 움직임 정보, 시간적인 주변 블록으로부터 유도된 움직임 정보, 히스토리 기반 움직임 정보, 평균값을 사용한 움직임 정보, 미리 정해진 움직임 정보, 제로(0,0) 움직임 정보 중에서 적어도 하나 이상을 사용하여 움직임 정보 후보 리스트를 구성할 수 있다.
비디오 신호 처리 장치는 새로운 움직임 정보 후보가 움직임 정보 후보 리스트에 존재하는지를 판단하여 새로운 움직임 정보 후보를 움직임 정보 후보 리스트에 추가할 지 여부를 결정할 수 있다. 이때, 새로운 움직임 정보 후보가 움직임 정보 후보 리스트에 존재하는지에 대한 판단은 움직임 정보 후보 리스트 내의 움직임 정보 후보들과 새로운 움직임 정보 후보가 동일하거나 유사한지에 기초하여 결정될 수 있다. 만일 움직임 정보 후보 리스트 내의 움직임 정보 후보들과 새로운 움직임 정보 후보가 동일하거나 유사할 경우, 비디오 신호 처리 장치는 새로운 움직임 정보 후보가 중복된 것으로 판단하여 움직임 정보 후보 리스트에 추가하지 않을 수 있다. 비디오 신호 처리 장치는 움직임 정보 후보들 간의 수평 및 수직 성분 (x, y)이 동일한지를 판단하여 움직임 정보 후보들 간의 동일성을 판단할 수 있다. 또는, 비디오 신호 처리 장치는 움직임 정보 후보들 간의 수평 및 수직 성분 (x, y) 각각의 차이가 임의의 값 이내인지를 판단하여 움직임 정보 후보들 간의 유사성을 판단할 수 있다. 여기서 임의의 값은 현재 블록에 TM 또는 DMVR이 적용되는지 여부, 현재 블록의 가로 또는 세로의 크기, 현재 블록의 움직임 해상도, 현재 블록에 RRIBC 모드가 적용되었는지 여부, 현재 블록에 zeroComp 모드가 적용되었는지 여부 중 적어도 어느 하나에 기초하여 결정될 수 있다. 예를 들어, 임의의 값은 1, 2, 4 등일 수 있다. 비디오 신호 처리 장치는 움직임 정보 후보 리스트 내의 움직임 정보 후보들과 새로운 움직임 정보 후보 간에 LIC 적용 여부, 움직임 벡터의 해상도, 움직임 벡터가 반화소 보상을 사용하는지 여부, 움직임 정보 후보의 RRIBC 모드, 움직임 정보 후보의 BCW 정보 중에서 적어도 하나 이상이 다른 경우, 움직임 정보 후보 리스트 내의 움직임 정보 후보들과 새로운 움직임 정보 후보는 동일하거나 유사하지 않다고 판단할 수 있다. 비디오 신호 처리 장치는 움직임 정보 후보 리스트 내의 움직임 정보 후보들과 새로운 움직임 정보 후보가 동일하거나 유사하지 않다고 판단되는 경우, 새로운 움직임 정보 후보를 움직임 정보 후보 리스트에 추가할 수 있다.
스크린 컨텐츠에서는 블록 벡터의 수평 및 수직 성분 중에서 하나가 '0'이 되는 경우가 자주 발생한다. 따라서, 비디오 신호 처리 장치는 블록 벡터의 수평 및 수직 성분 중에서 하나는 '0'으로 설정하고 나머지 성분에만 값이 존재하도록 하는 모드를 사용할 수 있으며, 이를 zeroComp 모드라고 할 수 있다. 인코더는 현재 블록에 zeroComp 모드가 적용되었다는 정보, 블록 벡터의 수평 방향이 '0'인지 수직 방향이 '0'인지에 대한 정보를 포함하는 비트스트림을 생성하고 시그널링할 수 있다. 디코더는 비트스트림에 포함된 현재 블록에 zeroComp 모드가 적용되었다는 정보, 블록 벡터의 수평 방향이 '0'인지 수직 방향이 '0'인지에 대한 정보를 파싱하여, 현재 블록에 대한 블록 벡터의 차분 값을 파싱할 때 사용하거나 현재 블록에 대한 블록 벡터를 계산할 때 사용할 수 있다. 예를 들어, 현재 블록에 zeroComp 모드가 적용되었고, 블록 벡터의 수평 방향이 '0'인 경우, 디코더는 수평 방향에 대한 블록 벡터 차분 값을 파싱하지 않고, 수직 방향에 대한 블록 벡터 차분 값만을 파싱할 수 있다. 그리고, 디코더는 최종적으로 현재 블록에 대한 블록 벡터를 계산할 때, 블록 벡터의 수평 방향 성분은 '0'으로 설정하고, 수직 방향 성분만 블록 벡터의 예측 값과 차분 값을 더하여 계산할 수 있다.
움직임 정보 후보 리스트를 구성하는 과정에서 사용되는 주변 블록은 현재 블록에 공간적으로 인접한 주변 블록일 수 있고, 공간적으로 인접하지 않고 멀리 떨어진 주변 블록일 수 있다. 또한 현재 픽쳐의 POC와 동일하지 않은 다른 참조 픽쳐로부터 현재 블록에 대응되는 시간적인 주변 블록이 사용될 수 있다. 여기서 시간적인 주변 블록으로 유도된 움직임 정보 후보는 TMVP(Temporal Motion Vector Predictor)로 기술될 수 있다.
비디오 신호 처리 장치는 주변 블록으로부터 유도되는 정보는 움직임 정보, RRIBC 타입 정보, LIC 수행 여부 정보, GPM 블록인지 여부 정보, IntraTMP의 움직임 정보인지 IBC 움직임 정보인지에 대한 정보, MHP에 대한 정보, BCW 정보 중에서 적어도 하나 이상에 기초하여 움직임 정보 후보 리스트를 구성할 수 있다. 예를 들어, 시간적인 주변 블록이 수평 방향의 RRIBC 블록인 경우, 비디오 신호 처리 장치는 현재 블록을 위한 움직임 정보 후보를 수평 방향의 RRIBC 움직임 정보로 설정할 수 있다. 또한 현재 블록에 대한 움직임 정보 후보 리스트를 구성할 때, 비디오 신호 처리 장치는 주변 블록의 RRIBC 타입 정보, 주변 블록의 LIC 수행 여부 정보, 주변 블록이 GPM 블록인지 여부 정보, 주변 블록이 CIIP 블록(또는 IBC-CIIP 블록)인지 여부 정보, 주변 블록이 IntraTMP 블록인지 또는 IBC 블록인지에 대한 정보, 주변 블록이 공간적으로 유도된 블록인지 혹은 시간적으로 유도된 블록인지 여부 정보, 주변 블록의 MHP에 대한 정보, 주변 블록의 BCW 정보, 현재 블록에 TM이 적용되는지 여부, 현재 블록이 BVD(Block Vector Difference)를 시그널링하는 부호화 모드인지 여부, 현재 블록이 Intra TMP 블록인지 또는 IBC 블록인지 여부에 대한 정보, 현재 블록이 RRIBC, GPM, LIC, CIIP 부호화 모드 중에서 적어도 하나 이상을 사용하는지 여부에 대한 정보 중에서 적어도 하나 이상을 사용하여 주변 블록의 부호화 정보들을 재설정한 후, 움직임 정보 후보로 사용할 수 있으며, 움직임 정보 후보를 움직임 정보 후보 리스트에 추가할 수 있다.
현재 블록에 대한 움직임 정보 후보 리스트를 구성할 때, 비디오 신호 처리 장치는 주변 블록의 RRIBC 타입 정보, 주변 블록의 LIC 수행 여부 정보, 주변 블록이 GPM 블록인지 여부 정보, 주변 블록이 CIIP 블록(혹은 IBC-CIIP 블록)인지 여부 정보, 주변 블록이 IntraTMP 블록인지 IBC 블록인지에 대한 정보, 주변 블록의 MHP에 대한 정보, 주변 블록의 BCW 정보, 현재 블록에 TM이 적용되는지 여부, 주변 블록이 공간적으로 유도된 블록인지 시간적으로 유도된 블록인지 여부 정보, 현재 블록이 BVD(Block Vector Difference)를 시그널링하는 부호화 모드인지 여부, 현재 블록이 Intra TMP 블록인지 혹은 IBC 블록인지 여부 정보, 현재 블록이 RRIBC, GPM, LIC, CIIP 부호화 모드 중에서 적어도 하나 이상을 사용하는지 여부 정보 중에서 적어도 하나 이상을 사용하여 주변 블록의 부호화 정보를 사용할지 여부를 결정할 수 있다. 비디오 신호 처리 장치는 주변 블록의 부호화 정보를 사용하여 결정되는 움직임 정보 후보를 움직임 정보 후보 리스트에 추가할 지 여부를 결정할 수 있다. 예를 들어, 현재 블록이 AMVP 부호화 모드이고, 현재 블록이 RRIBC 모드가 아니고, 현재 블록이 TM을 사용하지 않고, 현재 블록의 블록 벡터가 BVD(혹은 MBVD(merge mode with block vector differences)를 갖는 블록 벡터가 아니고, 주변 블록이 IBC 블록이고, 주변 블록의 RRIBC 타입이 수평 방향인 경우, 비디오 신호 처리 장치는 주변 블록의 움직임 정보 후보를 현재 블록의 움직임 정보 후보 리스트에 저장하지 않을 수 있다. 즉, 비디오 신호 처리 장치는 현재 블록이 AMVP 부호화 모드인 경우, 현재 블록이 어떠한 RRIBC 모드인지 미리 알 수 있으므로, 주변 블록의 RRIBC 모드가 어떤 것인지에 따라 주변 블록의 움직임 정보 후보를 움직임 정보 후보 리스트에 추가하거나 주변 블록의 움직임 정보 후보를 변경(또는 재설정)한 후 움직임 정보 후보 리스트에 추가하거나 움직임 정보 후보로 사용하지 않고 움직임 정보 후보 리스트에 추가하지 않을 수 있다. 즉, 비디오 신호 처리 장치는 주변 블록의 RRIBC 모드가 어떤 모드인지에 따라 주변 블록의 움직임 정보 후보를 현재 블록에 대한 움직임 정보 후보 리스트에 추가할 지 여부를 결정할 수 있다. 또한, 주변 블록의 RRIBC 모드가 어떤 모드인지에 따라 현재 블록에 대한 움직임 정보 후보 리스트의 구성이 달라질 수 있다. 주변 블록이 RRIBC 모드로 부호화 된 경우, 비디오 신호 처리 장치는 주변 블록의 움직임 정보를 RRIBC 타입에 맞게 변경한 후, 현재 블록에 대한 움직임 정보 후보로 사용할 수 있으며, 움직임 정보 후보 리스트에 추가할 수 있다.
비디오 신호 처리 장치가 시간적인 주변 블록을 선정하는 방법은 도 7과 같이 현재 픽쳐에 대응되는 픽쳐(Collocated picture)에서 현재 블록의 임의의 좌표에 대응되는 블록이 될 수 있으며, 여기서 임의의 좌표는 도 7의 BR 위치, Ctr 위치가 될 수 있다. 또는 현재 블록의 좌측에 인접한 A1 (도 7 참조) 블록의 움직임 벡터, 현재 블록의 Ctr (도 7 참조) 위치 좌표를 사용하여 생성한 벡터가 지시하는 블록이 시간적인 주변 블록으로 사용될 수 있다. 구체적으로 참조 픽쳐에서 현재 블록의 Ctr(또는 BR) 위치 좌표를 기준으로 현재 블록의 좌측에 인접한 A1 블록의 움직임 벡터만큼 이동한 위치에 대응되는 주변 블록이 시간적인 주변 블록으로 사용될 수 있다.
도 66은 본 명세서의 일 실시예에 따른 주변 블록을 유도하기 위한 위치를 나타낸다.
비디오 신호 처리 장치는 시간적인 주변 블록의 움직임 정보(예를 들어, 블록 벡터 또는 움직임 벡터)를 유도할 때, 현재 블록의 가로 및 세로의 크기에 따라 미리 정의된 다양한 위치로부터 움직임 정보를 유도할 수 있다. 또한, 미리 정의된 개수만큼 시간적인 주변 블록의 움직임 정보를 유도할 수 있고, 예를 들어, 미리 정의된 개수는 4일 수 있다. 도 66을 참조하면, 비디오 신호 처리 장치는 현재 블록의 가로 및 세로의 크기를 기준으로 BR0, Ctr0, BR1, Ctr1 위치로부터 움직임 정보를 유도할 수 있다. 미리 정의된 개수만큼의 움직임 정보가 채워지지 않았다면, 비디오 신호 처리 장치는 현재 블록의 가로 및 세로의 2개 크기를 기준으로 재계산된 BR0, Ctr0, BR1, Ctr1 위치로부터 움직임 정보를 유도할 수 있다. 움직임 정보를 유도하는 방법은 미리 정의된 개수만큼의 움직임 정보가 채워질 때까지 반복될 수 있다. 즉, 미리 정의된 개수만큼의 움직임 정보가 채워질 때까지 비디오 신호 처리 장치는 현재 블록의 가로 및 세로의 크기의 N배 크기를 기준으로 재계산된 움직임 정보를 유도할 수 있다. 여기서 N은 5일 수 있다.
또한, 비디오 신호 처리 장치는 시간적인 주변 블록으로부터 유도된 움직임 정보가 현재 블록의 위치보다 멀리 떨어진 경우, 유도된 움직임 정보가 현재 블록에 맞지 않을 수 있으므로, 임의의 값 이내인 경우를 판단하여 움직임 정보 후보로 사용할 지 여부를 결정할 수 있다. 예를 들어, 비디오 신호 처리 장치는 주변 블록의 가로 및 세로 크기, 현재 블록의 가로 및 세로 크기, 주변 블록의 중앙 위치에 대한 수평 및 수직 값 또는 현재 블록의 중앙 위치에 대한 수평 및 수직 값을 사용하여 시간적인 주변 블록으로부터 유도된 움직임 정보를 움직임 정보 후보로 사용할 지 여부를 결정할 수 있다. 구체적으로 주변 블록의 중앙 위치에 대한 수평 값과 현재 블록의 중앙 위치에 대한 수평 값 간의 차이의 절대 값이 현재 블록(또는 주변 블록)의 너비에 임의의 값을 곱한 값보다 클 경우, 비디오 신호 처리 장치는 시간적인 주변 블록으로부터 유도된 움직임 정보를 블록 벡터 후보로 사용하지 않을 수 있다. 또는 주변 블록의 중앙 위치에 대한 수직 값과 현재 블록의 중앙 위치에 대한 수직 값 간의 차이의 절대 값이 현재 블록(혹은 주변 블록)의 높이에 임의의 값을 곱한 값보다 클 경우, 비디오 신호 처리 장치는 시간적인 주변 블록으로부터 유도된 움직임 정보를 움직임 정보 후보로 사용하지 않을 수 있다. 여기서 임의의 값은 정수일 수 있으며, '3'일 수 있다.
주변 블록의 움직임 정보가 현재 블록을 위한 움직임 정보 후보로 사용가능한지 여부 또는 주변 블록의 움직임 정보를 움직임 정보 후보 리스트에 추가할지 여부는 주변 블록의 가로 및 세로 크기, 주변 블록의 부호화 모드 정보(IBC, Intra TMP), 주변 블록이 공간적으로 유도된 블록인지 시간적으로 유도된 블록인지에 대한 정보, 주변 블록의 RRIBC 타입 정보, 주변 블록에 TM(또는 DMVR), GPM, LIC, OBMC, MHP, Affine 중에서 하나 이상이 적용되었는지 정보에 따라 달라질 수 있다. 예를 들어, 주변 블록이 IBC 또는 Intra TMP 모드로 부호화된 블록이고, TM(또는 DMVR), GPM, LIC, OBMC, MHP, Affine 중에서 적어도 하나 이상이 적용되지 않았다면, 주변 블록의 움직임 정보는 현재 블록을 위한 움직임 정보 후보로 사용될 수 있고, 움직임 정보 후보 리스트에 추가될 수 있다. 또는, 현재 블록이 AMVP 모드로 부호화되고 현재 블록의 RRIBC 타입이 수직 방향이고, 주변 블록이 IBC 모드로 부호화된 블록이고, 주변 블록의 RRIBC 타입이 수평 방향인 경우, 주변 블록의 움직임 정보는 현재 블록을 위한 움직임 정보 후보로 사용될 수 없고, 움직임 정보 후보 리스트에 포함되지 않을 수 있다. 주변 블록의 RRIBC 타입이 수평 또는 수직 방향이고, 주변 블록의 움직임 정보가 현재 블록을 위한 움직임 정보 후보로 사용 가능한 경우, 비디오 신호 처리 장치는 주변 블록의 RRIBC 움직임 정보를 변경하지 않고 현재 블록을 위한 움직임 정보 후보로 사용하거나 수평 및 수직 방향 성분에 임의의 값을 더하여 새로운 움직임 정보를 생성한 후 움직임 정보 후보로 사용할 수 있다. 여기서 임의의 값은 주변 블록의 가로 및 세로 크기 또는 현재 블록의 가로 및 세로 크기에 기초하여 결정되는 정수 값으로, -3, -2, -1, 0, 1, 2, 3일 수 있다.
현재 블록을 위한 움직임 정보 후보는 현재 블록의 좌상단 위치로부터 수평 및 수직 방향으로 임의의 위치만큼 떨어진 주변 블록의 움직임 정보로부터 유도될 수 있다. 임의의 위치만큼 떨어진 주변 블록은 비-인접(Non-adjacent) 블록으로 기술될 수 있고, 임의의 위치만큼 떨어진 주변 블록의 움직임 정보는 비-인접 블록의 움직임 정보로 기술될 수 있다. 임의의 위치는 현재 블록의 가로 및 세로 크기에 따라 달라지거나 임의의 정수 값으로 설정될 수 있다. 이때, 임의의 정수 값은 16, 32 등이 될 수 있다. 이때, 임의의 위치는 IBC 참조 영역 메모리를 벗어나지 않는 한도 내에서 설정될 수 있다. 비-인접 움직임 정보를 움직임 정보 후보로 사용할 수 있는지 여부 또는 움직임 정보 후보 리스트에 추가할 수 있는지 여부는 비-인접 움직임 정보가 RRIBC 움직임 정보인지에 따라 달라질 수 있다. 예를 들어, 현재 블록이 AMVP 모드로 부호화되고, RRIBC 모드가 아니고, 비-인접 주변 블록으로 유도된 움직임 정보가 RRIBC 움직임 정보인 경우, 비디오 신호 처리 장치는 비-인접 주변 블록으로 유도된 움직임 정보를 움직임 정보 후보로 사용하지 않고, 움직임 정보 후보 리스트에 포함하지 않을 수 있다. 현재 블록이 머지 모드로 부호화되고, 비-인접 주변 블록으로 유도된 움직임 정보가 RRIBC 움직임 정보인 경우, 비디오 신호 처리 장치는 비-인접 주변 블록으로 유도된 움직임 정보를 움직임 정보 후보로 사용할 수 있고, 움직임 정보 후보 리스트에 추가할 수 있다.
또한, 현재 블록을 위한 움직임 정보 후보는 별도의 메모리에 저장된 움직임 정보들로부터 유도될 수 있다. 별도의 메모리에 저장된 움직임 정보들을 HBVP(History based Block Vector Predictor)라고 할 수 있으며, HBVP는 이전에 사용된 움직임 정보들로부터 획득될 수 있다. HBVP 후보를 움직임 정보 후보로 사용할 수 있는지 여부 또는 움직임 정보 후보 리스트에 추가할 수 있는지 여부는 HBVP 후보가 RRIBC 움직임 정보인지에 따라 달라질 수 있다. HBVP 후보가 움직임 정보 후보 리스트에 추가되는지 여부는 시간적인 주변 블록의 RRIBC 타입에 따라 달라질 수 있다. 예를 들어, 현재 블록이 AMVP 모드로 부호화되고, RRIBC 모드가 아니고, HBVP 후보가 RRIBC 움직임 정보인 경우, 비디오 신호 처리 장치는 HBVP 후보를 움직임 정보 후보로 사용하지 않을 수 있고, 움직임 정보 후보 리스트에 포함하지 않을 수 있다. 현재 블록이 머지 모드로 부호화되고, HBVP 후보가 RRIBC 움직임 정보인 경우, 비디오 신호 처리 장치는 HBVP 후보를 움직임 정보 후보로 사용할 수 있다. 현재 블록이 머지 모드로 부호화되고, HBVP 후보가 RRIBC 움직임 정보인 경우, 비디오 신호 처리 장치는 HBVP 후보를 움직임 정보 후보로 사용하지 않을 수 있고, 움직임 정보 후보 리스트에 포함하지 않을 수 있다. 또 다른 실시 일 예로, 현재 블록이 부호화 모드와 관계없이 HBVP 후보가 RRIBC 움직임 정보인 경우, 비디오 신호 처리 장치는 RRIBC 움직임 정보를 움직임 정보 후보로 사용하지 않을 수 있고, 움직임 정보 후보 리스트에 추가하지 않을 수 있다.
비디오 신호 처리 장치는 현재 블록의 움직임 정보 후보 리스트 내의 움직임 정보 후보로부터 새로운 움직임 정보 후보를 생성하여 움직임 정보 후보 리스트에 추가할 수 있다. 새롭게 추가되는 움직임 정보 후보는 페어-와이즈(Pair-wise) 움직임 정보 후보로 기술될 수 있다. 구체적으로, 비디오 신호 처리 장치는 움직임 정보 후보 리스트에서 제1 움직임 정보 후보와 제2 움직임 정보 후보를 획득하여 두 개의 움직임 정보 후보의 수평 성분 간의 평균과 수직 성분 간의 평균을 구해서 새로운 움직임 정보 후보를 생성할 수 있다. 그리고, 비디오 신호 처리 장치는 새로운 움직임 정보 후보를 움직임 정보 후보 리스트에 추가할 수 있다. 이때, 제1 움직임 정보 후보와 제2 움직임 정보 후보는 서로 다른 움직임 정보일 수 있다.
비디오 신호 처리 장치는 움직임 정보 후보 리스트가 미리 정의된 개수만큼 채워지지 않았다면, 미리 정의된 움직임 정보 후보들을 순서대로 움직임 정보 후보 리스트에 추가할 수 있다. 새로 추가되는 움직임 정보 후보는 움직임 정보의 수평과 수직 성분이 (0, 0)으로 구성된 제로 벡터를 사용한 움직임 정보일 수 있다. 또한, 제로 벡터를 기반으로 새로 추가되는 움직임 후보는 하나 이상일 수 있다. 각 제로 벡터 기반의 움직임 후보에 대한 참조 픽쳐는 달라질 수 있으며, 참조 픽쳐 리스트를 기반으로 제로 벡터 기반의 움직임 후보에 대한 참조 픽쳐가 설정될 수 있다.
도 67 내지 도 70은 본 명세서의 일 실시예에 따른 어파인 모션 예측을 나타낸다.
비디오 신호 처리 장치는 현재 픽쳐의 예측 블록(4510)과 다른 모양, 다른 크기, 다른 각도의 참조 블록(4520)을 참조하여 현재 블록을 예측할 수 있다. 이때 참조 블록(4520)은 현재 블록(4510)에 어파인 변환(affine transformation)으로 나타내어지는 블록일 수 있다. 이를 통해 스트레칭(스케일링)(stretching(scaling)), 회전(rotation), 전당(shearing), 반사(reflection), 직교 투영(orthogonal projection) 등이 나타내어질 수 있다.
어파인 모션(Affine motion), 어파인 변환을 나타내는 파라미터는 다양할 수 있다. 파라미터의 수가 많을 수록, 파라미터의 수가 적은 경우보다 더 다양한 모션(움직임)을 나타낼 수 있지만, 시그널링이나 계산 등에서 오버헤드가 발생할 수 있다. 예를 들어 6개의 파라미터에 의해 어파인 변환이 나타내어질 수 있다. 또는 3개의 컨트롤 포인트 모션 벡터에 의해 어파인 변환이 나타내어질 수 있다.
도 67을 통해 설명한 바와 같이 어파인 변환을 이용하여 복잡한 움직임을 표현하는 것이 가능하다. 그러나, 시그널링 오버헤드 및 연산을 줄이기 위해 더 간단한 어파인 모션 예측(affine motion prediction) 또는 어파인 변환이 사용될 수 있다. 움직임을 제한함으로써 더 간단한 어파인 모션 예측이 가능할 수 있다. 움직임을 제한한다는 것은 현재 블록이 참조 블록으로 변형되는 모양이 제한되는 것을 의미할 수 있다.
도 68을 참조하면, 비디오 신호 처리 장치는 v0, v1의 컨트롤 포인트 모션 벡터를 이용하여 어파인 모션 예측을 수행할 수 있다. v0, v1 두 개의 벡터를 사용하는 것은 4개의 파라미터를 사용하는 것과 동일할 수 있다. v0, v1 두 개의 벡터 또는 4개의 파라미터로 현재 블록이 어떤 모양의 참조 블록으로부터 예측되는지 나타낼 수 있다. 이와 같이 간단한 어파인 변환을 사용함으로써, 회전(rotation), 스케일링(zoom in/out)의 움직임이 나타내어질 수 있다. 도 68을 참조하면 실선으로 나타낸 현재 블록은 참조 픽쳐로부터 예측될 수 있다. 이때, 참조 픽쳐에서는 도 68의 점선으로 표현된 위치가 사용될 수 있다. 어파인 변환을 통해 현재 블록의 각 포인트(픽셀)은 다른 포인트로 매핑될 수 있다.
수학식 7은 모션 벡터 필드를 계산하는 수학식이다. 도 68의 컨트롤 포인트 모션 벡터 v0는 (v_0x, v_0y)이고 좌-상단 코너 컨트롤 포인트의 모션 벡터일 수 있다. 또한, 컨트롤 포인트 모션 벡터 v1은 (v_1x, v_1y)이고 우-상단 코너 컨트롤 포인트의 모션 벡터일 수 있다. 이 때 (x, y) 위치의 모션 벡터 (v_x, v_y)는 수학식 7을 사용하여 계산될 수 있다. 따라서 각 픽셀 위치 또는 어떤 위치에 대한 모션 벡터는 수학식 7에 기초하여 추정될 수 있다.
또한 수학식 7에서 (x, y)는 블록 내에서의 상대적 좌표일 수 있다. 예를 들어, (x, y)는 블록의 좌-상단 위치를 (0, 0)이라고 했을 때의 위치일 수 있다. v0가 픽쳐 상에서 위치(x0, y0)에 대한 컨트롤 포인트 모션 벡터이고, v1이 픽쳐 상에서 위치(x1, y1)에 대한 컨트롤 포인트 모션 벡터인 경우, 블록 내의 위치(x, y)를 v0, v1의 위치와 같은 좌표를 사용하여 나타내어질 수 있고, 수학식 7에서 x와 y를 각각 (x-x0), (y-y0)로 변경하여 나타내어질 수 있다. 또한 w (블록의 너비)는 (x1-x0)일 수 있다.
어파인 모션은 다수의 컨트롤 포인트 모션 벡터 또는 다수의 파라미터를 사용하여 나타내어질 수 있다.
도 69를 참조하면 비디오 신호 처리 장치는 v0, v1, v2 3개의 컨트롤 포인트 모션 벡터를 이용하여 어파인 모션 예측을 수행할 수 있다. v0, v1, v2 3개의 컨트롤 모션 벡터가 사용되는 것은 6개의 파라미터가 사용되는 것과 동일할 수 있다. v0, v1, v2 3개의 컨트롤 포인트 모션 벡터 또는 6개의 파라미터들은 현재 블록이 어떠한 모양의 블록으로부터 예측되는지 나타낼 수 있다. 도 69를 참조하면 실선으로 나타낸 현재 블록은 참조 픽쳐로부터 예측될 수 있다. 이때, 참조 픽쳐에서는 도 69의 점선으로 표현된 위치가 사용될 수 있다. 어파인 변환을 통해 현재 블록의 각 포인트(픽셀)은 다른 포인트로 매핑될 수 있다.
수학식 8은 모션 벡터 필드를 계산하는 수학식이다. 도 69의 컨트롤 포인트 모션 벡터 v0는 (mv_0^x, mv_0^y)이고 좌-상단 코너 컨트롤 포인트의 모션 벡터일 수 있다. 컨트롤 포인트 모션 벡터 v1은 (mv_1^x, mv_1^y)이고 우-상단 코너 컨트롤 포인트 모션 벡터일 수 있다. 컨트롤 포인트 모션 벡터 v2는 (mv_2^x, mv_2^y)이고 좌-하단 코너 컨트롤 포인트 모션 벡터일 수 있다. 이때, (x, y) 위치의 모션 벡터 (mv^x, mv^y)는 수학식 8을 이용하여 계산될 수 있다. 따라서 각 픽셀의 위치 또는 어떤 위치에 대한 모션 벡터는 수학식 8을 이용하여 추정될 수 있다.
또한 수학식 8에서 (x, y)는 블록 내에서의 상대적 좌표일 수 있다. 예를 들어, (x, y)는 블록의 좌-상단 위치를 (0, 0)이라고 했을 때의 위치일 수 있다. v0가 픽쳐 상에서 위치(x0, y0)에 대한 컨트롤 포인트 모션 벡터이고, v1이 픽쳐 상에서 위치(x1, y1)에 대한 컨트롤 포인트 모션 벡터이고, v2가 픽쳐 상에서 위치(x2, y2)에 대한 컨트롤 모션 벡터인 경우, 블록 내의 위치(x, y)는 v0, v1, v2의 위치와 같은 좌표를 사용하여 나타내어질 수 있고, 수학식 8에서 x와 y를 각각 (x-x0), (y-y0)로 변경하여 나타내어질 수 있다. 또한 w (블록의 너비)는 (x1-x0)일 수 있고, h (블록의 높이)는 (y2 - y0)일 수 있다.
본 명세서에서 설명한 바와 같이 모션 벡터 필드가 존재하고, 비디오 신호 처리 장치는 각 픽셀에 대한 모션 벡터를 계산할 수 있다. 도 70을 참조하면 모션 벡터의 계산을 보다 간단히 하기 위해 서브 블록 기반 어파인 변환이 수행될 수 있다. 도 70의 (a)의 작은 사각형은 서브블록일 수 있다. 비디오 신호 처리 장치는, 서브 블록의 대표 모션 벡터를 획득할 수 있다. 그리고, 비디오 신호 처리 장치는 대표 모션 벡터를 서브 블록의 픽셀들에 대해 사용할 수 있다. 도 67 내지 도 69를 통해 설명한 참조 블록은 도 70의 서브 블록과 대응될 수 있다. 또는 서브 블록에 병진 모션(translation motion)만 적용하여 더 간단히 모션 벡터가 표현될 수 있다. 도 70의 (a)의 v0, v1, v2는 컨트롤 포인트 모션 벡터일 수 있다.
서브 블록의 크기는 M*N일 수 있다. M과 N은 수학식 9에 기초하여 계산될 수 있다. 한편, 서브 블록의 크기는 고정되어 있을 수도 있는데, 예를 들어, 고정된 크기는 4x4 일 수 있다.
수학식 9의 MvPre는 모션 벡터 프랙션 정확도(motion vector fraction accuracy)일 수 있다. 또한 (v_0x, v_0y)와 (v_1x, v_1y), (v_2x, v_2y)는 각각 현재 블록의 좌-상단, 우-상단, 좌-하단 컨트롤 포인트 모션 벡터일 수 있다. (v_0x, v_0y)와 (v_1x, v_1y), (v_2x, v_2y)는 수학식 7을 통해 획득될 수 있다.
또한 비디오 신호 처리 장치는 서브 블록의 가운데 샘플 위치를 이용하여 서브 블록의 대표 모션 벡터를 획득할 수 있다. 또한 일반적인 모션 벡터(normal motion vector)보다 더 정확도가 높은 모션 벡터를 사용하여 서브 블록의 모션 벡터가 만들어질 수 있다. 이를 위해 모션 보상 보간 필터(motion compensation interpolation filters)가 적용될 수 있다.
도 71 및 도 72는 본 명세서의 일 실시예에 따른 어파인 모션 예측의 모드를 나타낸다.
어파인 모션 예측의 한 예로 어파인 인터 모드(affine inter mode) 또는 어파인 AMVP 인터 모드가 있을 수 있다. 어파인 인터 모드가 적용되는지 여부를 지시하는 플래그가 존재할 수 있다. 이때, 플래그는 비트스트림에 포함되어 시그널링될 수 있다. 도 71을 참조하면 v0 근처의 A, B, C 위치의 블록, v1 근처의 D, E 위치의 블록이 존재할 수 있다. 이때, A, B, C, D, E 위치의 각 블록에 해당하는 모션 벡터는 vA, vB, vC, vD, vE일 수 있다. 이각 블록의 모션 벡터를 이용하여 모션 벡터 또는 모션 벡터 예측자에 대한 후보 리스트가 구성될 수 있다. 후보 리스트는 다음 수식을 이용하여 구성될 수 있다.
{(v0, v1)|v0 = {vA, vB, vC}, v1 = {vD, vE}}
즉, 비디오 신호 처리 장치는 vA, vB, vC 중에서 선택되는 v0와 vD, vE 중에서 선택되는 v1으로 (v0, v1) 페어(pair)를 만들 수 있다. 이때, 비디오 신호 처리 장치는 이웃 블록의 참조 블록을 포함하는 픽쳐의 POC(picture order count), 현재 블록(또는 CU)의 참조 블록을 포함하는 POC, 현재 블록(또는 CU)의 POC에 기초하여 모션 벡터를 스케일링할 수 있다. 페어를 이용하여 후보 리스트가 구성되는 경우, 후보 리스트 내의 어떠한 페어가 사용되는지를 나타내는 정보는 비트스트림에 포함되어 시그널링될 수 있다. 또한 비디오 신호 처리 장치는 후보 리스트가 충분히 채워지지 않은 경우, 다른 인터 예측의 후보를 후보 리스트에 포함시킬 수 있다. 예를 들어, 비디오 신호 처리 장치는 AMVP 후보를 후보 리스트에 포함시킬 수 있다. 또한 비디오 신호 처리 장치는 후보 리스트에서 선택한 페어의 v0, v1을 어파인 모션 예측의 컨트롤 포인트 모션 벡터로 바로 사용하지 않고, 차분(difference)에 기초하여 보정하여 사용할 수 있다. 이때, 보정을 위한 차분에 대한 정보는 비트스트림에 포함되어 시그널링될 수 있다. 즉, 비디오 신호 처리 장치는 후보 리스트에서 선택한 페어의 v0, v1에 차분을 더하여 v0', v1'을 획득하고, v0', v1'을 어파인 모션 예측의 컨트롤 포인트 모션 벡터로 사용할 수 있다. 또한, 어파인 인터 모드는 코딩 유닛이 특정 크기 이상인 경우 사용될 수 있다.
어파인 모션 예측의 일 예로 어파인 머지 모드가 있을 수 있다. 어파인 머지 모드가 사용되는지 여부는 플래그에 의해 지시될 수 있고, 플래그는 비트스트림에 포함되어 시그널링될 수 있다. 비디오 신호 처리 장치는 어파인 머지 모드가 사용되는 경우, 현재 블록의 주변 블록에서 어파인 모션 예측이 사용된 경우 주변 블록의 모션 벡터들로부터 현재 블록의 컨트롤 포인트 모션 벡터를 획득(계산)할 수 있다. 예를 들어 비디오 신호 처리 장치가 어파인 모션 예측이 사용되었는지 확인하는 주변 블록은 도 72의 (a)와 같을 수 있다. 비디오 신호 처리 장치는 도 72의 (a)의 A, B, C, D, E 순서대로 어파인 모션 예측이 사용되었는지 확인할 수 있고, 어파인 모션 예측이 사용된 블록을 확인하면, 어파인 모션 예측이 사용된 블록(또는 주변 블록)의 모션 벡터를 사용하여 현재 블록의 컨트롤 포인트 모션 벡터를 획득할 수 있다. 도 72의 (a)의 A, B, C, D, E는 현재 블록의 좌측(left), 상측(above), 우 상측(above right), 좌 하측(left bottom), 좌 상측(above left)에 위치한 블록일 수 있다.
도 72의 (b)를 참조하면 비디오 신호 처리 장치는 A 위치의 블록이 어파인 모션 예측을 사용했던 경우 A 위치의 블록(또는 주변 블록)의 모션 벡터를 이용하여 v0, v1을 계산할 수 있다. A 위치의 블록(또는 주변 블록)의 모션 벡터는 v2, v3, v4일 수 있다.
비디오 신호 처리 장치는 컨트롤 포인트 모션 벡터를 유도(derive)할 때 각 컨트롤 포인트 모션 벡터에 가까운 블록부터 참조하여 정확도를 향상시킬 수 있다. 예를 들어, 도 72의 (a) 및 (b)를 참조하면 비디오 신호 처리 장치는 v0를 유도할 때 좌측 블록(A 블록)을 참조할 수 있고, v1을 유도할 때 상측 블록(B 블록)을 참조할 수 있다. 또는 비디오 신호 처리 장치는 v0를 유도할 때, A, D, 또는 E 위치의 블록을 참조할 수 있고, v1을 유도할 때 B 또는 C 위치의 블록을 참조할 수 있다.
도 73 및 도 74는 본 명세서의 일 실시예에 따른 어파인 모션 예측자의 유도를 나타낸다.
어파인 모션 예측을 위해 컨트롤 포인트 모션 벡터가 필요할 수 있다. 비디오 신호 처리 장치는 컨트롤 포인트 모션 벡터)에 기초하여 모션 벡터 필드, 즉 서브 블록이나 특정 위치에 대한 모션 벡터를 계산할 수 있다. 컨트롤 포인트 모션 벡터는 시드 벡터(seed vector)로 기술될 수 있다.
이때, 예측자(prediction)에 기초하여 컨트롤 포인트 모션 벡터가 획득될 수 있다. 예를 들어, 예측자가 컨트롤 포인트 모션 벡터가 될 수 있다. 또는 차분에 기초하여 보정된 예측자가 컨트롤 포인트 모션 벡터가 획득될 수 있다. 구체적으로, 비디오 신호 처리 장치는 예측자에 차분을 더하거나 빼서 컨트롤 포인트 모션 벡터를 획득할 수 있다.
이때, 컨트롤 포인트 모션 벡터의 예측자는 어파인 모션 예측(어파인 모션 보상)된 주변 블록의 컨트롤 포인트 모션 벡터 또는 모션 벡터로부터 유도될 수 있다. 예를 들어 비디오 신호 처리 장치는 기설정된 위치의 블록이 어파인 모션 예측된 경우, 어파인 모션 예측된 블록의 컨트롤 포인트 모션 벡터 또는 모션 벡터로부터 현재 블록의 어파인 모션 보상을 위한 예측자를 유도할 수 있다. 기설정된 위치는 현재 블록과 인접한 위치와 인접하지 않은 위치를 포함할 수 있다. 도 73을 참조하면 기설정된 위치는 A0, A1, B0, B1, B2 일 수 있다. 비디오 신호 처리 장치는 공간적으로(spatial) 또는 시간적으로(temporal) 기 설정된 위치의 컨트롤 포인트 모션 벡터 또는 모션 벡터를 참조할 수 있다. 비디오 신호 처리 장치는 도 73을 통해 설명한 방법을 이용하여 어파인 모션 보상의 후보를 획득할 수 있다. 이때, 후보는 상속된 후보(inherited candidate)로 기술될 수 있다. 비디오 신호 처리 장치가 기설정된 위치를 참조하는 순서는 미리 정해진 순서일 수 있다.
이하에서 어파인 모션 보상을 위한 컨트롤 포인트 모션 벡터에 대해 설명한다.
어파인 모션 보상을 위해 컨트롤 포인트 모션 벡터가 필요할 수 있다. 비디오 신호 처리 장치는 컨트롤 포인트 모션 벡터)에 기초하여 모션 벡터 필드, 즉 서브 블록이나 특정 위치에 대한 모션 벡터를 계산할 수 있다. 컨트롤 포인트 모션 벡터는 시드 벡터(seed vector)로 기술될 수 있다.
이때, 예측자(prediction)에 기초하여 컨트롤 포인트 모션 벡터가 획득될 수 있다. 예를 들어, 예측자가 컨트롤 포인트 모션 벡터가 될 수 있다. 또는 차분에 기초하여 보정된 예측자가 컨트롤 포인트 모션 벡터가 획득될 수 있다. 구체적으로, 비디오 신호 처리 장치는 예측자에 차분을 더하거나 빼서 컨트롤 포인트 모션 벡터를 획득할 수 있다.
이때, 컨트롤 포인트 모션 벡터의 예측자는 주변 블록의 모션 벡터로부터 유도될 수 있다. 예를 들어 비디오 신호 처리 장치는 주변 블록의 모션 벡터가 어파인 모션 보상된 모션 벡터 또는 어파인 모션 보상된 모션 벡터가 아니더라도 모션 벡터의 예측자를 유도하기 위해 사용할 수 있다. 예를 들어 현재 블록의 각 컨트롤 포인트 모션 벡터를 유도할 때, 비디오 신호 처리 장치는 컨트롤 포인트 모션 벡터에 대해 기설정된 위치의 모션 벡터를 컨트롤 포인트 모션 벡터의 예측자로 사용할 수 있다. 기설정된 위치는 현재 블록에 인접한 위치를 포함할 수 있다.
도 74를 참조하면 비디오 신호 처리 장치는 컨트롤 포인트 모션 벡터 mv0, mv1, mv2를 결정할 수 있다. 이때 기설정된 위치는 A, B, C, D, E, F, G 일 수 있다. A, B, C에 해당하는 모션 벡터가 mv0에 대한 예측자로 사용될 수 있다. 또한 D, E에 해당하는 모션 벡터가 mv1에 대한 예측자로 사용될 수 있다. 또한, F, G에 해당하는 모션 벡터가 mv2에 대한 예측자로 사용될 수 있다.
또한 mv0, mv1, mv2의 각 예측자를 결정하기 위해 컨트롤 포인트 위치를 참조하는 순서는 미리 정해져 있을 수 있다. 또한 컨트롤 포인트 모션 벡터의 예측자로 참조하는 기 설정된 위치는 각 컨트롤 포인트에 대해 복수 개 존재할 수 있고, 기 설정된 위치의 조합이 정해져 있을 수 있다.
비디오 신호 처리 장치는 도 74를 통해 설명한 방법을 이용하여 어파인 모션 보상의 후보를 획득할 수 있다. 어파인 모션 보상의 후보는 복원된 후보(constructed candidate) 또는 인터 후보(inter candidate) 또는 버츄얼 후보(virtual candidate)로 기술될 수 있다.
비디오 신호 처리 장치는 도 71 내지 도 74를 통해 설명한 방법 또는 방법들의 조합으로 어파인 모션 보상의 후보 리스트 또는 어파인 모션 보상의 컨트롤 포인트 모션 벡터 후보 리스트를 생성할 수 있다.
도 75는 본 명세서의 일 실시예에 따른 TMVP 움직임 후보를 유도하는 방법을 나타낸다.
비디오 신호 처리 장치는 현재 블록에 AMVP 모드가 적용되는 경우, AMVP 모드를 위한 움직임 정보 후보 리스트를 구성하여 현재 블록에 대한 움직임 정보를 예측할 수 있다. AMVP 모드를 위한 움직임 정보 후보 리스트는 L0 움직임 정보 후보 리스트, L1 움직임 정보 후보 리스트로 구분될 수 있다. AMVP 모드를 위한 움직임 정보 후보 리스트의 최대 개수는 1 이상의 정수일 수 있으며, 템플릿 기반의 움직임 보정 방법이 사용되는지 여부에 따라 최대 개수가 달라질 수 있다. 템플릿 기반의 움직임 보정 방법이 사용되는 경우, AMVP 모드를 위한 움직임 정보 후보 리스트의 최대 개수는 5일 수 있다. 템플릿 기반의 움직임 보정 방법이 사용되지 않는 경우, AMVP 모드를 위한 움직임 정보 후보 리스트의 최대 개수는 2일 수 있다. 비디오 신호 처리 장치는 현재 블록에 인접한 주변 블록의 움직임 정보, 시간적인 주변 블록의 움직임 정보(TMVP), 현재 블록에 인접하지 않은 주변 블록의 움직임 정보, 제로 벡터를 이용한 움직임 후보 중에서 적어도 하나 이상을 사용하여 AMVP 모드를 위한 움직임 정보 후보 리스트를 구성할 수 있다. 구체적으로, 비디오 신호 처리 장치는 현재 블록에 인접한 주변 블록(예를 들어, 도 73의 A0, A1, B0, B1, B2)의 움직임 정보 중에서 현재 블록의 참조 픽쳐와 동일한 참조 픽쳐를 사용한 움직임 정보를 움직임 정보 후보 리스트에 추가할 수 있다. 비디오 신호 처리 장치는 AMVP 모드를 위한 움직임 정보 후보 리스트를 템플릿 코스트를 기반으로 재정렬할 수 있다. 그리고, 비디오 신호 처리 장치는 재정렬된 움직임 정보 후보 리스트 내 움직임 정보 후보 중 최소의 템플릿 코스트를 갖는 움직임 정보 후보에 대해 TM 보정을 수행하여 보정된 움직임 정보 후보를 획득하고, 보정된 움직임 정보 후보를 현재 블록을 위한 움직임 후보로 사용할 수 있다.
비디오 신호 처리 장치는 움직임 정보 후보 리스트에 TMVP 움직임 후보를 추가할 수 있다. 비디오 신호 처리 장치가 시간적인 주변 블록을 선정하는 방법은 도 75의 (a)와 같이 대응되는 픽쳐에서 현재 블록의 미리 정의된 좌표에 대응되는 블록이 될 수 있다. 여기서 미리 정의된 좌표는 도 75의 (a)의 BR 위치, Ctr 위치일 수 있다. 비디오 신호 처리 장치는 대응되는 픽쳐의 POC, 시간적인 주변 블록에 대한 참조 픽쳐의 POC, 현재 픽쳐의 POC, 현재 블록에 대한 참조 픽쳐의 POC를 사용하여 TMVP 움직임 후보를 획득할 수 있다. 구체적으로, 비디오 신호 처리 장치는 POC 간의 거리 비례 기반으로 시간적인 주변 블록의 움직임 벡터(도 75의 (a)에서 점선으로 표시된 움직임 벡터)를 스케일하여 TMVP 움직임 후보(도 75의 (a)에서 실선으로 표시된 움직임 벡터)를 획득할 수 있고, 획득된 TMVP 움직임 후보를 움직임 정보 후보 리스트에 추가할 수 있다.
시간적인 주변 블록의 움직임 벡터를 유도하기 위해서, 비디오 신호 처리 장치는 참조 픽쳐에서 현재 블록에 대응되는 위치의 참조 블록을 사용할 수 있다. 만일 픽쳐 내 객체가 이동한 경우, 참조 픽쳐에서 현재 블록에 대응되는 위치의 참조 블록은 현재 블록과 유사하지 않을 수 있다. 따라서, 현재 블록과 유사성이 높은 대응되는 참조 블록을 유도하기 위해서, 비디오 신호 처리 장치는 객체의 움직임을 반영한 시간적인 주변 블록을 유도할 수 있다. 이때, 객체의 움직임을 반영하기 위해서, 비디오 신호 처리 장치는 현재 블록의 인접한 블록의 움직임 정보를 이용하여 움직임이 반영된 시간적인 주변 블록을 유도할 수 있다. 이를 모션 시프트(Motion shift) 기반의 TMVP 라고 할 수 있다.
비디오 신호 처리 장치는 모션 시프트(Motion shift) 기반의 TMVP 후보를 움직임 후보 리스트에 추가할 수 있다. 모션 시프트는 움직임 시프트로 기술될 수도 있다. 도 75의 (b)를 참조하면 비디오 신호 처리 장치는 현재 블록의 좌측에 인접한 A1 블록의 움직임 벡터, 현재 블록의 Ctr 위치 좌표를 사용하여 획득되는 벡터(도 75의 (b)의 PMV(Projected MV) of A1)가 지시하는 블록을 사용할 수 있다. 구체적으로, 비디오 신호 처리 장치는 대응되는 픽쳐에서 현재 블록의 Ctr(또는 BR) 위치 좌표를 기준으로 현재 블록의 좌측에 인접한 A1 블록의 움직임 벡터만큼 이동한 위치에 대응되는 주변 블록(도 75의 (b)의 대응 픽쳐의 Ctr 블록)을 시간적인 주변 블록으로 사용할 수 있다. 시간적인 주변 블록의 움직임 벡터는 스캐일되어 움직임 정보 후보 리스트에 포함될 수 있다.
도 76은 본 명세서의 일 실시예에 따른 모션 시프트 후보 리스트 기반의 TMVP를 유도하는 방법을 나타낸다.
비디오 신호 처리 장치는 모션 시프트 후보 리스트를 구성하여 최적의 모션 시프트 값을 유도할 수 있다. 최적의 모션 시프트 값은 템플릿 코스트에 기반하여 유도될 수 있다.
비디오 신호 처리 장치는 현재 블록에 인접하지 않은 주변 블록의 움직임 정보를 제1 움직임 후보 리스트에 추가할 수 있다. 그리고, 비디오 신호 처리 장치는 템플릿 코스트를 사용하여 제1 움직임 후보 리스트를 재정렬할 수 있다. 비디오 신호 처리 장치는 제1 움직임 후보 리스트를 이용하여 모션 시프트 후보 리스트를 구성할 수 있다. 비디오 신호 처리 장치는 모션 시프트 후보 리스트 내 각 모션 시프트를 사용하여 TMVP 후보 리스트를 유도할 수 있다. 비디오 신호 처리 장치는 유도된 TMVP 후보 리스트 내에서 최종 TMVP 후보를 선택할 수 있다.
이때, 비디오 신호 처리 장치는 주변 블록의 참조 픽쳐가 대응되는 픽쳐인 경우에만 주변 블록의 움직임 정보를 움직임 후보 리스트에 추가할 수 있다. 또한, 주변 블록의 움직임 벡터의 해상도는 정수 단위의 움직임 해상도로 변환되어 리스트에 추가될 수 있다. 또한, 비디오 신호 처리 장치는 새로 추가할 주변 블록의 움직임 정보가 제1 움직임 후보 리스트 내에 이미 존재하는지 판단한 후, 존재하지 않는 경우에만 리스트에 추가할 수 있다. 이때, 새로 추가될 움직임 정보와 제1 움직임 후보 리스트 내의 움직임 벡터가 동일한 경우, 비디오 신호 처리 장치는 새로 추가될 움직임 정보가 제1 움직임 후보 리스트 내에 이미 존재하는 것으로 판단할 수 있다. 또한, 비디오 신호 처리 장치는 새로 추가될 움직임 정보와 제1 움직임 후보 리스트 내의 움직임 벡터 간 차이가 미리 정의된 값보다 작은 경우, 새로 추가될 움직임 정보가 제1 움직임 후보 리스트 내에 이미 존재하는 것으로 판단할 수 있다. 미리 정의된 값은 1 이상의 정수 일 수 있으며, 2일 수 있다. 이러한 판단 과정은 프루닝(pruning)이라고 할 수 있다. 즉, 프루닝은 움직임 정보가 움직임 후보 리스트에 추가될 수 있는지 여부를 판단하는 유효성을 검사하는 과정일 수 있다. 인접하지 않은 주변 블록의 움직임 정보를 사용하여 유도되는 제1 움직임 후보 리스트의 최대 개수는 1 이상의 정수로 미리 정의된 값일 수 있으며, 예를 들어, 16일 수 있다.
도 77은 본 명세서의 일 실시예에 따른 템플릿 코스트를 사용하여 움직임 후보 리스트를 재정렬하는 방법을 나타낸다.
도 77을 참조하여 도 76에서 설명한 비디오 신호 처리 장치가 템플릿 코스트를 사용하여 제1 움직임 후보 리스트를 재정렬하는 방법에 대해 설명한다.
비디오 신호 처리 장치는 먼저, 현재 블록에 인접한 이미 복원된 샘플들을 이용하여 도 77의 (a)와 같이 참조 템플릿을 구성할 수 있다. 다음으로, 비디오 신호 처리 장치는 제1 움직임 후보 리스트의 움직임 후보를 현재 블록의 좌상단 위치로 투영(projection)할 수 있다. 그리고, 비디오 신호 처리 장치는 도 77의 (b)와 같이 대응되는 픽쳐에서 해당 움직임 후보가 지시하는 위치를 기반으로 예측 템플릿을 구성할 수 있다. 비디오 신호 처리 장치는 참조 템플릿과 예측 템플릿 간의 코스트를 계산할 수 있다. 비디오 신호 처리 장치는 템플릿 코스트를 기반으로 제1 움직임 후보 리스트를 재정렬할 수 있으며, 미리 정의된 개수만큼의 상위 후보들 만을 사용하여 제2 움직임 후보 리스트를 구성할 수 있다.
비디오 신호 처리 장치는 인접한 주변 블록의 움직임 정보, 제2 움직임 후보 리스트, HMVP(History based motion vector prediction) 움직임 후보 중에서 적어도 하나 이상을 사용하여 모션 시프트 후보 리스트를 구성할 수 있다. 모션 시프트 후보 리스트에 포함가능한 후보의 최대 개수는 1이상의 정수로 10일 수 있다. 모션 시프트 후보 리스트에는 인접한 주변 블록의 움직임 정보가 우선적으로 추가되며, 리스트 내 후보가 정해진 최대 개수만큼 채워지지 않았다면 제2 움직임 후보 리스트의 움직임 후보가 리스트에 추가될 수 있으며, 리스트가 정해진 최대 개수만큼 채워지지 않았다면 HMVP 움직임 후보가 추가될 수 있다.
비디오 신호 처리 장치는 모션 시프트 후보 리스트의 각 모션 시프트를 사용하여 TMVP 후보를 유도할 수 있다. 이때, 비디오 신호 처리 장치는 TMVP 후보를 유도하기 위해 도 75의 (b)를 통해 설명한 방법을 사용할 수 있다. 비디오 신호 처리 장치는 모션 시프트 후보 리스트를 사용하여 TMVP 후보 리스트를 유도할 수 있다. 이때, TMVP 후보 리스트 내 후보의 개수는 미리 정해진 개수로 8일 수 있다. TMVP 후보 리스트를 사용하여 최종적으로 유도되는 TMVP 후보의 개수는 미리 정해진 개수로 1일 수 있다. 따라서, TMVP 후보 리스트의 첫번째 TMVP 후보가 최종 TMVP 후보가 될 수 있다. 첫번째 TMVP 후보가 AMVP 모드를 위한 움직임 정보 후보 리스트에 이미 존재하는 경우, 첫번째 TMVP 후보는 AMVP 모드를 위한 움직임 정보 후보 리스트에 추가되지 않을 수 있다.
비디오 신호 처리 장치는 모션 시프트 기반의 TMVP 후보를 획득하기 위한 최적의 모션 시프트로 현재 픽쳐에 대응되는 픽쳐를 참조 픽쳐로 사용하는 블록의 움직임 정보를 선택할 수 있다. 이때, 비디오 신호 처리 장치는 미리 정해진 순서에 기초하여 주변 블록을 탐색하고, 대응되는 픽쳐를 참조 픽쳐로 사용하는 첫 번째 주변 블록의 움직임 정보를 최적의 모션 시프트로 선택할 수 있다. 이때, 미리 정의된 순서는 현재 블록에 인접한 주변 블록인 A1, A0, B1, B0, B2 블록(도 77의 (b) 참조), 현재 블록에 인접하지 않은 주변 블록 순일 수 있다. 또한, 최적의 모션 시프트는 HMVP 테이블로부터 유도된 움직임 정보가 될 수 있다.
도 78은 본 명세서의 일 실시예에 따른 모션 시프트 후보 리스트 기반의 TMVP 후보를 유도하는 방법을 나타낸다.
도 78의 (a)를 참조하면, 모션 시프트 후보 리스트에는 인접한 주변 블록의 움직임 정보, 제2 움직임 후보 리스트, HMVP(History based motion vector prediction) 움직임 후보가 포함될 수 있다. 이 중에서 제2 움직임 후보 리스트만 템플릿 코스트를 기반으로 재정렬된 후보일 수 있다. 따라서, 비디오 신호 처리 장치는 템플릿 코스트에 기반하여 모션 시프트 후보 리스트(도 76 참조)의 모든 후보에 대하여 재정렬을 수행할 수 있고, 재정렬된 모션 시프트 후보 리스트를 사용하여 TMVP 후보 리스트를 유도할 수 있다. 재정렬하는 과정에서 제2 움직임 후보 리스트의 템플릿 코스트는 이전에 계산된 템플릿 코스트가 사용될 수 있다.
도 78의 (b)를 참조하면, 비디오 신호 처리 장치는 제1 움직임 후보 리스트의 최대 개수를 16에서 10 으로 감소시키고, 모션 시프트 후보 리스트의 최대 개수는 10에서 16으로 증가시켜서, 모션 시프트 후보 리스트를 구성할 수 있고, 모션 시프트 후보 리스트를 사용하여 TMVP 후보 리스트를 구성할 수 있다. TMVP 후보 리스트 내 첫번째 TMVP 후보만이 사용되는 경우(도 76을 통해 설명한 방법), 비디오 신호 처리 장치는 최종 TMVP 후보가 AMVP 모드를 위한 움직임 정보 후보 리스트에 이미 존재하는 경우 TMVP 후보를 리스트에 추가하지 않을 수 있다. 이러한 문제를 해결하기 위해, 비디오 신호 처리 장치는 유효한 1개 이상의 최종 TMVP 후보가 선택될 때까지 TMVP 후보 리스트 내의 모든 TMVP 후보에 대하여, 각 TMVP 후보가 AMVP 모드를 위한 움직임 정보 후보 리스트에 이미 존재하는 지를 판단할 수 있다(도 78의 (b) 참조). 만일 TMVP 후보 리스트 내의 모든 TMVP 후보가 유효하지 않다면(즉, AMVP 모드를 위한 움직임 정보 후보 리스트에 이미 존재한다면), AMVP 모드를 위한 움직임 정보 후보 리스트에 최종 TMVP 후보가 추가되지 않을 수 있다. 이와 같은 방법으로 최대 2개의 최종 TMVP 후보가 AMVP 모드를 위한 움직임 정보 후보 리스트에 추가될 수 있다.
도 78의 (c)를 참조하면, 비디오 신호 처리 장치는 TMVP 후보 리스트의 최대 개수를 10으로 증가시키고, 최종 TMVP 후보 개수는 최대 1개로 구성할 수 있다.
비디오 신호 처리 장치는 제1 움직임 후보 리스트에 움직임 후보를 추가할 때, 움직임 해상도를 정수 단위 움직임 해상도로 변환한 후 리스트에 추가할 수 있다. 템플릿 기반의 재정렬 과정에서 보다 정확한 움직임을 통한 템플릿 코스트 계산을 위해서, 비디오 신호 처리 장치는 제1 움직임 후보 리스트에 움직임 후보를 추가할 때, 움직임 해상도 변환을 하지 않고 추가하거나 1/4 화소 단위로 변환하여 움직임 후보 리스트에 추가할 수 있다.
메모리를 절약하기 위해서 대응되는 픽쳐의 TMVP 움직임 정보는 미리 정의된 블록 크기마다 하나의 움직임 정보만 저장되어 있을 수 있다. 미리 정의된 블록 크기는 4x4, 8x8 등일 수 있다. 비디오 신호 처리 장치는 제1 움직임 후보 리스트에 움직임 후보를 추가할 때, 움직임 해상도를 TMVP 움직임 정보가 저장된 단위로 변환한 후 리스트에 추가할 수 있다. 예를 들어, TMVP 움직임 정보가 저장된 단위가 4x4 인 경우, 비디오 신호 처리 장치는 제1 움직임 후보 리스트에 움직임 후보를 추가할 때, 움직임 해상도를 4 화소 단위 움직임 해상도로 변환한 후 리스트에 추가할 수 있다.
움직임 해상도를 변환하는 방법은 제1 움직임 후보 리스트를 구성하거나 모션 시프트 후보 리스트를 구성할 때에도 적용될 수 있다.
도 78을 통해 설명한 실시 예에서 비디오 신호 처리 장치는 모션 시프트 후보 리스트를 기반으로 TMVP 후보 리스트를 구성할 수 있다. 또는, 비디오 신호 처리 장치는 TMVP 후보 리스트를 템플릿 코스트 기반하여 재정렬하고, 재정렬된 TMVP 후보 리스트를 출력할 수 있으며, 재정렬된 TMVP 후보 리스트를 기반으로 최종 TMVP 후보를 선택할 수 있다.
또한, 비디오 신호 처리 장치는 모션 시프트 후보 리스트를 구성하지 않고 모션 시프트 후보 리스트를 구성하는데 사용된 주변 블록의 움직임 정보를 사용하여 TMVP 후보를 획득한 후, TMVP 후보를 사용하여 TMVP 후보 리스트를 직접 유도할 수 있으며, 유도된 TMVP 후보 리스트를 사용하여 최종 TMVP 후보를 선택할 수 있다.
도 79 및 도 80은 본 명세서의 일 실시예에 따른 히스토리 파라미터 기반 어파인 모델로부터 어파인 후보를 유도하는 방법을 나타낸다.
비디오 신호 처리 장치는 현재 블록에 인접한 블록의 움직임 정보가 아닌 부호화 및 복호화 순서상 이전에 어파인 모드로 부호화 및 복호화된 어파인 움직임 정보를 이용하여 복원된 어파인 후보를 유도할 수 있다. 구체적으로 비디오 신호 처리 장치는 어파인 모드로 부호화된 블록의 CPMV와 블록의 너비 그리고 블록의 높이로부터 어파인 파라미터(a, b, c, d)를 획득할 수 있다. 그리고, 비디오 신호 처리 장치는 어파인 파라미터를 HPT(history-parameter table)에 저장할 수 있다. 수학식 10은 어파인 파라미터로부터 어파인 움직임을 계산하는 수학식을 나타낸다. 어파인 파라미터는 수학식 10의 역순으로 획득될 수 있다. HPT는 참조 픽쳐 리스트 및 참조 픽쳐 인덱스 별로 각각 구성될 수 있다. 예를 들어, 어파인 모드로 부호화된 블록이 L0 예측이고, 참조 픽쳐 인덱스 1이 사용되었다면, 비디오 신호 처리 장치는 HPT_L0_1 또는 HPT(L0, 1)에 어파인 파라미터를 저장할 수 있다. HPT는 어파인 모드로 부호화된 블록에서 업데이트되며, HPT는 픽쳐/서브픽쳐/슬라이스/타일의 각 CTU 줄에서 첫번째 CTU가 부호화되기 전에 HPT에 저장된 파라미터 값이 미리 지정된 값으로 초기화될 수 있다. 미리 지정된 값은 '0'이 될 수 있다. 또는 미리 지정된 값은 일반적으로 주로 사용되는 어파인 파라미터가 될 수 있다.
비디오 신호 처리 장치는 도 79의 A0, A1, A2, B0, B1, B2, B3 블록의 움직임 정보 중 하나를 사용하여 HPT(history-affine-parameter-based candidate)에 저장된 a, b, c, d를 불러온 후, 수학식 10을 사용하여 HAPC를 획득할 수 있다. 도 79에서 (a0, b0, c0, d0)는 어파인 파리미터(a, b, c, d) 중 하나일 수 있다. 수학식 10의 (mvh base, mvv base)는 A0, A1, A2, B0, B1, B2, B3 블록의 움직임 정보 중 하나일 수 있으며, 실시 일 예로 A0 블록의 움직임 정보일 수 있다. (xbase, ybase)는 A0, A1, A2, B0, B1, B2, B3 블록 중 하나의 중앙 위치 좌표일 수 있으며, 실시 일 예로, A0 블록의 중앙 위치 좌표 일 수 있다. (x, y)는 현재 블록 내의 샘플 위치 좌표일 수 있다. 수학식 10에서 (x, y)에 현재 블록의 좌상단, 우상단, 좌하단의 좌표를 대입하여, 현재 블록의 좌상단 샘플 위치의 MV, 우상단 샘플 위치의 MV, 좌하단 샘플 위치의 MV를 획득할 수 있다. 따라서 HAPC는 어파인 타입(4-parameter, 6-parameter)에 따라 최대 3개(6-parameter인 경우)의 CPMV(corner-position MV)로 계산될 수 있다. 또는 비디오 신호 처리 장치는 상기 계산된 CPMV, 현재 블록 내 샘플 좌표 (x, y), 현재 블록의 가로의 길이, 현재 블록의 세로의 길이를 이용하여 현재 블록 내 샘플 좌표 (x, y)의 MV를 계산할 수 있다.
비디오 신호 처리 장치는 현재 블록에 인접한 주변 블록의 움직임 정보를 사용하지 않고, 현재 블록에 인접하지 않은 주변 블록의 움직임 정보를 (mvh base, mvv base)로 사용하여 HAPC를 유도할 수 있다. 이때, (xbase, ybase)는 해당 주변 블록의 중앙 위치 좌표일 수 있다.
또한, 비디오 신호 처리 장치는 도 75의 (a) 혹은 도 66의 BR, Ctr 위치로부터 유도된 TMVP를 (mvh base, mvv base)로 사용하여 HAPC를 유도할 수 있다. 이때, (xbase, ybase)는 TMVP가 유도된 위치인 BR, Ctr 중에 하나가 될 수 있다.
또한, 인코더 및 디코더에서는 본 명세서에서 제시하는 모션 시프트 기반의 TMVP를 (mvh base, mvv base)로 사용하여 HAPC를 유도할 수 있으며, (xbase, ybase)는 현재 블록의 BR 위치, 현재 블록의 Ctr 위치, 모션 시프트 기반의 TMVP가 유도된 위치 중에서 하나가 될 수 있다.
도 80을 참조하면 비디오 신호 처리 장치는 HPT에 어파인 파라미터에 더하여 MVbase 정보 및 Posbase 정보를 같이 저장할 수 있다. 비디오 신호 처리 장치는 HPT에 저장된 어파인 파라미터, MVbase 정보 및 Posbase 정보와 수학식 10을 통해 HAPC를 획득할 수 있다.
비디오 신호 처리 장치는 다음에 부호화/복호화할 블록을 위해, 현재 블록에 인접하지 않은 주변 블록의 움직임 정보를 (mvh base, mvv base)로 설정할 수 있다. 그리고 비디오 신호 처리 장치는 (xbase, ybase)를 주변 블록의 중앙 위치 좌표로 설정한 후, HPT에 저장할 수 있다.
또한, 비디오 신호 처리 장치는 다음에 부호화/복호화할 블록을 위해, 도 75의 (a) 또는 도 66의 BR, Ctr 위치로부터 유도된 TMVP를 (mvh base, mvv base)로 설정할 수 있다. 그리고 비디오 신호 처리 장치는 (xbase, ybase)를 TMVP가 유도된 위치인 BR, Ctr 중에 하나로 설정한 후, HPT에 저장할 수 있다.
또한, 인코더 및 디코더에서는 다음에 부호화 또는 복호화할 블록을 위해, 모션 시프트 기반의 TMVP를 (mvh base, mvv base)로 설정할 수 있다. 그리고 비디오 신호 처리 장치는 (xbase, ybase)는 현재 블록의 BR 위치, 현재 블록의 Ctr 위치, 모션 시프트 기반의 TMVP가 유도된 위치 중에서 하나로 설정하여 HPT에 저장할 수 있다.
비디오 신호 처리 장치는 현재 블록의 부호화/복호화를 완료하고, 현재 블록의 움직임 정보를 다음에 부호화/복호화를 수행할 블록을 위해 저장할 수 있다. 이때, 현재 블록의 움직임 정보가 모션 시프트 기반의 TMVP를 통해 유도된 움직임 정보인 경우, 모션 시프트 기반의 TMVP가 저장될 수 있으며, 서브 블록 단위마다 각각 유도된 모션 시프트 기반의 TMVP가 하나 이상 저장될 수 있다.
비디오 신호 처리 장치는 움직임 후보 리스트의 움직임 후보가 어떤 주변 블록으로부터 유도된 것인지 또는 주변 블록의 부호화 모드가 어떤 것인지를 고려하여 재정렬을 수행할 수 있다. 구체적으로 비디오 신호 처리 장치는 움직임 후보를 움직임 후보 리스트에 추가할 때, 부호화 정보, 움직임 해상도 정보, LIC 적용 여부 정보, RRIBC 타입 정보, GPM 블록인지 여부 정보, Intra TMP 또는 IBC 부호화 모드인지에 대한 정보, MHP에 대한 정보, BCW 정보 중에서 적어도 하나 이상을 움직임 후보와 함께 움직임 후보 리스트에 추가할 수 있다. 이때, 부호화 정보는 움직임 후보가 유도된 주변 블록의 부호화 모드 정보일 수 있고, 예를 들어, 머지 모드, AMVP 모드, AMVP-머지 모드, MMVD 모드인지에 대한 정보)일 수 있다. 비디오 신호 처리 장치는 부호화 정보를 이용하여 움직임 후보 리스트를 재정렬할 수 있다. 예를 들어, 비디오 신호 처리 장치는 부호화 모드가 AMVP, AMVP-머지, MMVD, 머지인 순으로 움직임 후보 리스트를 재정렬할 수 있다. 또한, 비디오 신호 처리 장치는 부호화 모드 별로 템플릿 코스트 기반 재정렬 과정을 수행할 수 있다. 즉, 비디오 신호 처리 장치는 AMVP로 부호화된 움직임 후보가 2개 이상인 경우, 템플릿 코스트 기반으로 AMVP로 부호화된 움직임 후보들 간의 재정렬을 수행할 수 있으며, 최종적으로 부호화 모드별/템플릿 코스트 별로 재정렬된 움직임 후보 리스트를 생성할 수 있다.
비디오 신호 처리 장치는 새로운 움직임 후보를 움직임 후보 리스트에 추가할 때 움직임 후보에 대한 가중치 정보를 움직임 후보와 함께 리스트에 추가할 수 있다. 리스트에 추가된 움직인 후보에 대한 가중치 정보는 프루닝 과정에서 동일하거나 유사한 움직임 후보가 존재할 경우 업데이트될 수 있다. 이때, 움직임 후보에 대한 가중치는 움직임 후보가 유도된 주변 블록의 부호화 모드별로 다를 수 있다. 예를 들어, 움직임 후보에 대한 가중치는 주변 블록의 부호화 모드가 AMVP 인 경우가 AMVP-머지 모드인 경우보다 높게 설정될 수 있다. 또한, 움직임 후보에 대한 가중치는 주변 블록의 부호화 모드가 MMVD 인 경우가 머지 모드인 경우보다 높게 설정될 수 있다. 이때, 움직임 후보에 대한 가중치는 1 이상의 정수일 수 있다. 비디오 신호 처리 장치는 움직임 후보 리스트를 움직임 후보와 움직임 후보에 대한 가중치를 기반으로 재정렬할 수 있다. 이때, 가중치가 작은 움직임 후보부터 가중치가 높은 움직임 후보 순으로 움직임 후보 리스트는 재정렬될 수 있다. 또는 비디오 신호 처리 장치는 가중치가 높은 움직임 후보부터 가중치가 낮은 움직임 후보 순으로 움직임 후보 리스트를 재정렬할 수 있다. 또는 비디오 신호 처리 장치는 템플릿 코스트 기반의 움직임 후보 리스트를 재정렬할 때, 각 움직임 후보의 템플릿 코스트를 가중치 값을 기반으로 재계산하여 변경된 템플릿 코스트를 획득할 수 있다. 그리고, 비디오 신호 처리 장치는 변경된 템플릿 코스트를 기반으로 움직임 후보 리스트를 재정렬할 수 있다. 변경된 템플릿 코스트는 템플릿 코스트에서 가중치를 더하거나 빼거나 곱하거나 나누는 방법으로 획득될 수 있다. 또는 변경된 템플릿 코스트는 가중치를 스케일링하여 템플릿 코스트에서 스케일링된 가중치 값을 더하거나 빼거나 곱하거나 나누는 방법으로 획득될 수 있다. 이때, 가중치는 현재 블록의 크기에 기초하여 스케일링될 수 있다. 예를 들어, 현재 블록의 가로 및 세로 크기의 합이 16보다 작거나 같고(예를 들어, 현재 블록의 크기가 8x8보다 같거나 작은 경우), 가중치가 N인 경우, 비디오 신호 처리 장치는 N << 1을 계산하여 스케일링된 가중치를 획득할 수 있다. 또는 현재 블록의 가로 및 세로 크기의 합이 32보다 작거나 같은 경우(예를 들어, 현재 블록의 크기가 8x8보다 크고 16x16보다 같거나 작은 경우), 비디오 신호 처리 장치는 N << 2을 계산하여 스케일링된 가중치를 획득할 수 있다.
도 81은 본 명세서의 일 실시예에 따른 인접하지 않은 주변 블록의 위치들을 나타낸다.
비디오 신호 처리 장치는 움직임 후보 리스트를 구성할 때, 인접하지 않은 주변 블록의 움직임 정보를 움직임 후보 리스트에 추가할 수 있다. 이때, 인접하지 않은 주변 블록의 위치는 현재 블록의 너비 및 크기에 따라 결정될 수 있다. 비디오 신호 처리 장치는 인접하지 않은 주변 블록의 위치를 현재 블록의 너비 및 크기에 따라 간격을 재귀적으로 변경함으로써, 점점 멀리 떨어진 주변 블록으로부터 움직임 후보를 유도할 수 있다. 구체적으로 비디오 신호 처리 장치는 현재 블록의 너비와 높이를 기반으로 제1 수평 간격과 제1 수직 간격을 설정한 후, 제1 간격을 기반으로 미리 정의된 제1 주변 블록의 위치의 움직임 후보를 유도할 수 있다. 제1 간격과 미리 정의된 제1 주변 블록의 위치로부터 유도된 주변 블록은 A0, A1, A2, A3, A4일 수 있다. 다음으로 비디오 신호 처리 장치는 현재 블록의 너비의 2배로 제2 수평 간격을 설정하고, 현재 블록의 높이의 2배를 기반으로 제2 수직 간격을 설정한 후, 설정된 제2 간격을 기반으로 미리 정의된 제1 주변 블록의 위치의 움직임 후보를 유도할 수 있다. 제2 간격과 미리 정의된 제1 주변 블록의 위치로부터 유도된 주변 블록은 B0, B1, B2, B3, B4, B5, B6, B7, B8일 수 있다. 다음으로 비디오 신호 처리 장치는 현재 블록의 너비의 3배로 제3 수평 간격을 설정하고, 현재 블록의 높이의 3배를 기반으로 제3 수직 간격을 설정한 후, 설정된 제3 간격을 기반으로 미리 정의된 제1 주변 블록의 위치의 움직임 후보를 유도할 수 있다. 제3 간격과 미리 정의된 제1 주변 블록의 위치로부터 유도된 주변 블록은 C0, C1, C2, C3, C4, C5, C6, C7, C8일 수 있다. 같은 방법으로 비디오 신호 처리 장치는 미리 정의된 제 N 간격까지 멀리 떨어진 주변 블록으로부터 움직임 후보를 유도할 수 있다. 미리 정의된 N은 1이상의 정수 일 수 있으며, 7일 수 있다.
다음으로 비디오 신호 처리 장치는 미리 정의된 제2 주변 블록의 위치를 기반으로 움직임 후보를 유도할 수 있다. 구체적으로 비디오 신호 처리 장치는 현재 블록의 너비와 높이를 기반으로 제1 수평 간격과 제1 수직 간격을 설정한 후, 설정된 제1 간격을 기반으로 미리 정의된 제2 주변 블록의 위치의 움직임 후보를 유도할 수 있다. 제1 간격과 미리 정의된 제2 주변 블록의 위치로부터 유도된 주변 블록은 a0, a1, a2, a3일 수 있다. 다음으로 비디오 신호 처리 장치는 현재 블록의 너비의 2배로 제2 수평 간격을 설정하고, 현재 블록의 높이의 2배를 기반으로 제2 수직 간격을 설정한 후, 설정된 제2 간격을 기반으로 미리 정의된 제2 주변 블록의 위치의 움직임 후보를 유도할 수 있다. 제2 간격과 미리 정의된 제2 주변 블록의 위치로부터 유도된 주변 블록은 b0, b1, b2, b3 일 수 있다. 같은 방법으로 비디오 신호 처리 장치는 미리 정의된 제 N 간격까지 멀리 떨어진 주변 블록으로부터 움직임 후보를 유도할 수 있다. 미리 정의된 N은 1이상의 정수 일 수 있으며, 7일 수 있다.
비디오 신호 처리 장치는 인접하지 않은 주변 블록의 움직임 정보를 움직임 후보 리스트에 추가할 때, 현재 블록에서 가까운 주변 블록부터 멀리 떨어진 주변 블록 순으로 리스트에 추가할 수 있다. 또는 비디오 신호 처리 장치는 인접하지 않은 주변 블록의 움직임 정보를 움직임 후보 리스트에 추가할 때, 현재 블록에서 멀리 떨어진 주변 블록부터 가까운 주변 블록 순으로 리스트에 추가할 수 있다.
미리 정의된 제1 주변 블록의 위치는 현재 블록의 너비와 높이를 기반으로 결정될 수 있다.
비디오 신호 처리 장치는 현재 블록에 Intra TMP 또는 IBC 부호화 모드가 적용된 경우, 블록 벡터 후보 리스트로부터 유도된 블록 벡터를 사용하여 예측 블록을 생성할 수 있다. 이때, 비디오 신호 처리 장치는 공간적인 주변 블록으로부터 유도된 블록 벡터, 공간적으로 인접하지 않고 멀리 떨어진 주변 블록으로부터 유도된 블록 벡터, 시간적인 주변 블록으로부터 유도된 블록 벡터, 히스토리 기반 블록 벡터, 자동 재배치 블록 벡터(Auto relocated BV), 평균값을 사용한 블록 벡터, 미리 정해진 블록 벡터, 제로(0,0) 블록 벡터 중에서 적어도 하나 이상을 사용하여 블록 벡터 후보 리스트를 구성할 수 있다.
주변 블록으로부터 유도된 블록 벡터는 Intra TMP 탐색 영역을 벗어날 수 있다. 이 경우, 비디오 신호 처리 장치는 Intra TMP 탐색 영역을 벗어나는 제1 블록 벡터 후보를 Intra TMP 부호화 모드를 위한 블록 벡터 후보 리스트에서 제외할 수 있다. 또는 비디오 신호 처리 장치는 제1 블록 벡터 후보가 Intra TMP 탐색 영역 내에 위치하도록 블록 벡터를 수정한 후, 수정된 블록 벡터를 Intra TMP 부호화 모드를 위한 블록 벡터 후보 리스트에 추가시킬 수 있다. 여기서, 제1 블록 벡터의 수평 성분(수직 성분)이 Intra TMP 탐색 영역보다 좌측(상측)에 위치한 경우(탐색 영역을 벗어난 경우), 비디오 신호 처리 장치는 제1 블록 벡터의 수평 성분(수직 성분)과 가장 가까운 거리에 있는 Intra TMP 탐색 영역의 경계 위치로 제1 블록 벡터를 설정(수정)할 수 있다. 또는 제1 블록 벡터의 수평 성분(수직 성분)이 Intra TMP 탐색 영역보다 좌측(상측)에 위치한 경우(탐색 영역을 벗어난 경우), 비디오 신호 처리 장치는 제1 블록 벡터의 수평 성분(수직 성분)과 가장 가까운 거리에 있는 Intra TMP 탐색 영역의 경계에서 Intra TMP 템플릿 크기만큼 떨어진 탐색 영역 내부 위치로 제1 블록 벡터를 설정할 수 있다. 또는, 제1 블록 벡터의 수평 성분(수직 성분)이 Intra TMP 탐색 영역보다 우측(하측)에 위치한 경우(탐색 영역을 벗어난 경우), 비디오 신호 처리 장치는 제1 블록 벡터의 수평 성분(수직 성분)과 가장 가까운 거리에 있는 Intra TMP 탐색 영역의 경계에서 현재 블록의 크기만큼 떨어진 탐색 영역 내부 위치로 제1 블록 벡터를 설정할 수 있다.
Intra TMP 부호화 모드에서 참조 블록을 찾기 위해서 허용되는 탐색 영역과 IBC 부호화 모드에서 참조 블록을 획득하기 위한 참조 영역은 서로 다를 수 있다. Intra TMP 부호화 모드에서 탐색 영역은 현재 블록의 크기에 따라 다를 수 있다. 현재 블록의 크기가 큰 경우, Intra TMP 탐색 영역은 IBC 참조 영역보다 클 수 있다. 동일한 영역을 사용함으로써 메모리 효율을 높이기 위해서, 비디오 신호 처리 장치는 IBC 부호화 모드를 위한 참조 영역을 Intra TMP 부호화 모드를 위한 탐색 영역과 동일하게 설정할 수 있다. 이 경우, IBC 부호화 모드를 위한 참조 영역은 현재 블록의 크기에 따라 달라질 수 있다. 또한, 비디오 신호 처리 장치는 Intra TMP 부호화 모드를 위한 탐색 영역을 IBC 부호화 모드를 위한 참조 영역과 동일하게 설정할 수 있다. 일반적으로 IBC 참조 영역은 하나 이상의 CTU 줄을 참조 영역으로 사용하므로, Intra TMP 탐색 영역보다 클 수 있다. 하지만, 현재 블록의 크기가 큰 경우, IBC 참조 영역의 수직 범위는 Intra TMP 탐색 영역의 수직 범위보다 작을 수 있다. 따라서, 비디오 신호 처리 장치는 IBC 부호화 모드를 위한 참조 영역의 수평 범위와 Intra TMP 부호화 모드를 위한 탐색 영역의 수평 범위가 서로 다르더라도 IBC 부호화 모드를 위한 참조 영역의 수평 범위는 변경하지 않고, IBC 부호화 모드를 위한 참조 영역의 수직 범위를 Intra TMP 부호화 모드를 위한 탐색 영역의 수직 범위와 동일하게 설정할 수 있다. 또는 비디오 신호 처리 장치는 IBC 부호화 모드를 위한 참조 영역의 수평 범위와 Intra TMP 부호화 모드를 위한 탐색 영역의 수평 범위가 서로 다르더라도 Intra TMP 부호화 모드를 위한 탐색 영역의 수평 범위는 변경하지 않고, Intra TMP 부호화 모드를 위한 탐색 영역의 수직 범위를 IBC 부호화 모드를 위한 참조 영역의 수직 범위와 동일하게 설정할 수 있다.
비디오 신호 처리 장치는 새로운 블록 벡터 후보가 블록 벡터 후보 리스트에 존재하는지를 판단하여 새로운 블록 벡터 후보를 블록 벡터 후보 리스트에 추가할 지 여부를 결정할 수 있다. 이때, 비디오 신호 처리 장치는 블록 벡터 후보 리스트 내의 블록 벡터 후보들과 새로운 블록 벡터 후보가 동일하거나 유사한지에 기초하여 새로운 블록 벡터 후보가 블록 벡터 후보 리스트에 존재하는지에 대해 판단할 수 있다. 만일 블록 벡터 후보 리스트 내의 블록 벡터 후보들과 새로운 블록 벡터 후보가 동일하거나 유사할 경우, 비디오 신호 처리 장치는 새로운 블록 벡터 후보가 중복된 것으로 판단하여 블록 벡터 후보 리스트에 추가하지 않을 수 있다. 비디오 신호 처리 장치는 블록 벡터 후보의 수평 및 수직 성분 (x, y)이 동일한지에 기초하여 블록 벡터 후보들 간의 동일성을 판단할 수 있고, 블록 벡터 후보의 수평 및 수직 성분 (x, y) 각각의 차이가 임의의 값 이내인지에 기초하여 블록 벡터 후보들 간의 유사성을 판단할 수 있다. 여기서 임의의 값은 현재 블록이 TM 혹은 DMVR 을 적용하는지 여부, 현재 블록의 가로 또는 세로의 크기, 현재 블록의 움직임 해상도, 현재 블록에 RRIBC 모드가 적용되었는지 여부, 현재 블록에 zeroComp 모드가 적용되었는지 여부 중에서 적어도 하나를 사용하여 결정할 수 있으며, 예를 들어, '1, 2, 4' 등이 될 수 있다. 비디오 신호 처리 장치는 블록 벡터 후보의 LIC 적용 여부, 움직임 벡터의 해상도, 움직임 벡터가 반화소 보상을 사용하는지 여부, 블록 벡터 후보의 RRIBC 모드, 블록 벡터 후보의 BCW 정보 중 적어도 어느 하나에 기초하여 블록 벡터 후보 리스트 내의 블록 벡터 후보들과 새로운 블록 벡터 후보가 동일하거나 유사한지 판단할 수 있다. 비디오 신호 처리 장치는 블록 벡터 후보 리스트 내의 블록 벡터 후보들과 새로운 블록 벡터 후보 간에 블록 벡터 후보의 LIC 적용 여부, 움직임 벡터의 해상도, 움직임 벡터가 반화소 보상을 사용하는지 여부, 블록 벡터 후보의 RRIBC 모드, 블록 벡터 후보의 BCW 정보 중 적어도 어느 하나가 다른 경우, 블록 벡터 후보들은 서로 동일하거나 유사하지 않다고 판단할 수 있고, 새로운 블록 벡터 후보를 블록 벡터 후보 리스트에 추가할 수 있다.
블록 벡터 후보 리스트를 구성하는 과정에서 사용되는 주변 블록은 현재 블록에 공간적으로 인접한 주변 블록, 공간적으로 인접하지 않고 멀리 떨어진 주변 블록, 현재 픽쳐의 POC와 동일하지 않은 다른 참조 픽쳐로부터 현재 블록에 대응되는 시간적인 주변 블록일 수 있다. 여기서 시간적인 주변 블록으로 유도된 블록 벡터 후보를 TBVP(Temporal Block Vector Predictor)라고 할 수 있다. 블록 벡터 후보 리스트를 구성할 때, 주변 블록으로부터 유도되는 정보는 블록 벡터, RRIBC 타입 정보, LIC 수행 여부 정보, GPM 블록인지 여부 정보, IntraTMP의 블록 벡터인지 IBC 블록 벡터인지에 대한 정보, MHP에 대한 정보, BCW 정보 중에서 적어도 하나 이상 일 수 있다. 예를 들어, 비디오 신호 처리 장치는 시간적인 주변 블록이 수평 방향의 RRIBC 블록인 경우, 현재 블록을 위한 블록 벡터 후보를 수평 방향의 RRIBC 블록 벡터로 설정할 수 있다. 또한 비디오 신호 처리 장치는 현재 블록에 대한 블록 벡터 후보 리스트를 구성할 때, 주변 블록의 RRIBC 타입 정보, 주변 블록의 LIC 수행 여부 정보, 주변 블록이 GPM 블록인지 여부 정보, 주변 블록이 CIIP 블록(또는 IBC-CIIP 블록)인지 여부 정보, 주변 블록이 Intra TMP 블록인지 IBC 블록인지에 대한 정보, 주변 블록이 공간적으로 유도된 블록인지 시간적으로 유도된 블록인지 여부 정보, 주변 블록의 MHP에 대한 정보, 주변 블록의 BCW 정보, 현재 블록에 TM이 적용되는지 여부, 현재 블록이 BVD(Block Vector Difference)를 시그널링하는 부호화 모드인지 여부, 현재 블록이 Intra TMP 블록인지 IBC 블록인지 여부 정보, 현재 블록이 RRIBC, GPM, LIC, CIIP 부호화 모드 중에서 적어도 하나 이상을 사용하는지 여부 정보 중에서 적어도 하나 이상을 사용하여 주변 블록의 부호화 정보들을 재설정할 수 있다. 그리고, 비디오 신호 처리 장치는 재설정한 부호화 정보들에 기초하여 획득되는 블록 벡터를 블록 벡터 후보로 사용할 수 있으며, 블록 벡터 후보 리스트에 추가할 수 있다. 예를 들어, 주변 블록이 IBC 블록이고, 현재 블록이 TM을 사용하지 않고, 현재 블록이 BVD를 갖는 블록 벡터가 아닌 경우, 비디오 신호 처리 장치는 주변 블록의 RRIBC 타입을 블록 벡터 후보로 사용할 수 있으며, 블록 벡터 후보 리스트에 추가할 수 있다. 그렇지 않다면(주변 블록이 IBC 블록이거나 현재 블록이 TM을 사용하지 않거나, 현재 블록이 BVD를 갖는 블록 벡터인 경우), 비디오 신호 처리 장치는 주변 블록의 RRIBC 타입을 사용하지 않고, 블록 벡터 후보 리스트에 포함될 블록 벡터 후보의 RRIBC 타입은 RRIBC를 사용하지 않는 것으로 재설정할 수 있다. 또 다른 실시 일 예로, 주변 블록이 IBC 블록이고, 주변 블록이 RRIBC를 사용하지 않은 경우, 비디오 신호 처리 장치는 주변 블록의 LIC 적용 여부 정보를 블록 벡터 후보로 사용할 수 있으며, 블록 벡터 후보 리스트에 추가할 수 있다. 그렇지 않다면(주변 블록이 IBC 블록이 아니거나 또는 주변 블록이 RRIBC를 사용하는 경우), 비디오 신호 처리 장치는 주변 블록의 LIC 적용 여부 정보에 상관없이, 블록 벡터 후보 리스트에 포함될 블록 벡터 후보를 LIC를 적용하지 않도록 설정할 수 있다.
비디오 신호 처리 장치가 시간적인 주변 블록을 블록 벡터 후보 리스트에 추가할지 여부는 시간적인 주변 블록의 RRIBC 타입에 기초하여 결정될 수 있다. 예를 들어, 현재 블록이 AMVP 부호화 모드이고 주변 블록이 RRIBC 모드로 부호화된 경우, 비디오 신호 처리 장치는 주변 블록의 블록 벡터를 블록 벡터 후보로 사용하지 않을 수 있으며, 블록 벡터 후보 리스트에 추가하지 않을 수 있다. 또한, 현재 블록이 AMVP 부호화 모드일 경우, 비디오 신호 처리 장치는 주변 블록이 RRIBC 모드가 아닐 경우에만 주변 블록의 블록 벡터를 블록 벡터 후보로 사용할 수 있으며, 블록 벡터 후보 리스트에 추가할 수 있다. 이때 시간적인 주변 블록은 현재 블록과 동일하거나 유사한 위치일 수 있으므로, 비디오 신호 처리 장치는 주변 블록의 블록 벡터를 변경없이 블록 벡터 후보 리스트에 추가할 수 있다. 또는 비디오 신호 처리 장치는 시간적인 주변 블록의 RRIBC 블록 벡터를 주변 블록의 위치, 높이, 너비 그리고 현재 블록의 위치, 높이, 너비 중에서 적어도 하나 이상을 사용하여 변경한 후, 변경된 RRIBC 블록 벡터를 블록 벡터 후보 리스트에 추가할 수 있다.
또한 비디오 신호 처리 장치는 주변 블록의 RRIBC 타입 정보, 주변 블록의 LIC 수행 여부 정보, 주변 블록이 GPM 블록인지 여부 정보, 주변 블록이 CIIP 블록(또는 IBC-CIIP 블록)인지 여부 정보, 주변 블록이 Intra TMP 블록인지 IBC 블록인지에 대한 정보, 주변 블록의 MHP에 대한 정보, 주변 블록의 BCW 정보, 현재 블록에 TM이 적용되는지 여부, 주변 블록이 공간적으로 유도된 블록인지 시간적으로 유도된 블록인지 여부 정보, 현재 블록이 BVD(Block Vector Difference)를 시그널링하는 부호화 모드인지 여부, 현재 블록이 Intra TMP 블록인지 IBC 블록인지 여부 정보, 현재 블록이 RRIBC, GPM, LIC, CIIP 부호화 모드 중에서 적어도 하나 이상을 사용하는지 여부 정보 중에서 적어도 하나 이상을 사용하여 주변 블록의 부호화 정보를 블록 벡터 후보 리스트의 구성을 위해 사용할지 여부를 결정할 수 있으며, 블록 벡터 후보 리스트에 추가할 지 여부를 결정할 수 있다. 예를 들어, 현재 블록이 AMVP 부호화 모드이고, 현재 블록이 RRIBC 모드가 아니고, 현재 블록이 TM을 사용하지 않고, 현재 블록이 BVD(또는 MBVD(merge mode with block vector differences)를 갖는 블록 벡터가 아니고, 주변 블록이 IBC 블록이고, 주변 블록의 RRIBC 타입이 수평 방향인 경우, 비디오 신호 처리 장치는 주변 블록의 블록 벡터 후보를 현재 블록의 블록 벡터 후보 리스트에 저장하지 않을 수 있다. 즉, 현재 블록이 AMVP 부호화 모드일 경우, 비디오 신호 처리 장치는 현재 블록이 어떠한 RRIBC 모드인지 미리 알 수 있으므로, 주변 블록의 RRIBC 모드가 어떤 것인지에 따라 주변 블록의 블록 벡터 후보를 블록 벡터 후보 리스트에 추가하거나 주변 블록의 블록 벡터 후보를 변경(또는 재설정)한 후, 변경된 블록 벡터 후보를 블록 벡터 후보 리스트에 추가하거나 블록 벡터 후보로 사용하지 않고 블록 벡터 후보 리스트에 추가하지 않을 수 있다. 즉, 비디오 신호 처리 장치는 주변 블록의 RRIBC 모드가 어떤 모드인지에 따라 변경된 블록 벡터 후보를 현재 블록에 대한 블록 벡터 후보 리스트에 추가할 지 여부를 결정할 수 있다. 또한, 주변 블록의 RRIBC 모드가 어떤 모드인지에 따라 현재 블록에 대한 블록 벡터 후보 리스트의 구성이 달라질 수 있다.
주변 블록이 RRIBC 모드로 부호화 된 경우, 비디오 신호 처리 장치는 주변 블록의 블록 벡터를 RRIBC 타입에 맞게 변경한 후, 변경된 블록 벡터를 현재 블록에 대한 블록 벡터 후보로 사용할 수 있으며, 블록 벡터 후보 리스트에 추가할 수 있다. 주변 블록이 RRIBC 모드로 부호화 된 경우, 비디오 신호 처리 장치는 현재 블록의 위치를 기준으로 주변 블록의 블록 벡터를 변경한 후, 변경된 블록 벡터를 현재 블록에 대한 블록 벡터 후보로 사용할 수 있으며, 블록 벡터 후보 리스트에 추가할 수 있다. 현재 블록이 AMVP 모드이고, 주변 블록이 RRIBC 모드로 부호화 된 경우, 비디오 신호 처리 장치는 현재 블록의 RRIBC 타입과 주변 블록의 RRIBC 타입이 동일한 경우에만 주변 블록의 블록 벡터를 RRIBC 타입에 맞게 변경한 후, 변경된 블록 벡터를 현재 블록에 대한 블록 벡터 후보로 사용할 수 있으며, 블록 벡터 후보 리스트에 추가할 수 있다. 현재 블록이 AMVP 모드이고, 주변 블록이 RRIBC 모드로 부호화 된 경우, 비디오 신호 처리 장치는 현재 블록의 RRIBC 타입과 주변 블록의 RRIBC 타입이 동일한 경우에만, 현재 블록의 위치를 기준으로 주변 블록의 블록 벡터를 변경한 후, 변경된 블록 벡터를 현재 블록에 대한 블록 벡터 후보로 사용할 수 있으며, 블록 벡터 후보 리스트에 추가할 수 있다. 현재 블록이 AMVP 모드이고, 주변 블록이 RRIBC 모드로 부호화 된 경우, 비디오 신호 처리 장치는 주변 블록의 블록 벡터를 블록 벡터 후보로 사용하지 않을 수 있으며, 블록 벡터 후보 리스트에 추가하지 않을 수 있다. 현재 블록이 Merge 모드인 경우, 비디오 신호 처리 장치는 현재 블록의 RRIBC 타입과 주변 블록의 RRIBC 타입이 동일한지 여부와 상관없이 주변 블록의 블록 벡터를 RRIBC 타입에 맞게 변경한 후, 변경된 블록 벡터를 현재 블록에 대한 블록 벡터 후보로 사용할 수 있으며, 블록 벡터 후보 리스트에 추가할 수 있다. 현재 블록이 Merge 모드인 경우, 비디오 신호 처리 장치는 현재 블록의 RRIBC 타입과 주변 블록의 RRIBC 타입이 동일한지 여부와 상관없이 현재 블록의 위치를 기준으로 주변 블록의 블록 벡터를 변경한 후, 변경된 블록 벡터를 현재 블록에 대한 블록 벡터 후보로 사용할 수 있으며, 블록 벡터 후보 리스트에 추가할 수 있다. 현재 블록이 Merge 모드이고 TM을 적용하여 블록 벡터를 보정하는 모드이고, 주변 블록이 RRIBC 모드로 부호화 된 경우, 비디오 신호 처리 장치는 현재 블록의 위치를 기준으로 주변 블록의 블록 벡터를 변경하여 변경된 블록 벡터를 현재 블록에 대한 블록 벡터 후보로 사용할 수 있으며, 블록 벡터 후보 리스트에 추가할 수 있다. 이때, 비디오 신호 처리 장치는 주변 블록의 RRIBC 타입 정보를 그대로 유지하고, 주변 블록의 블록 벡터를 현재 블록을 위한 블록 벡터 후보 리스트에 추가할 수 있다. 또한, 비디오 신호 처리 장치는 주변 블록의 RRIBC 타입 정보를 RRIBC를 사용하지 않는 모드로 변경한 후, 주변 블록의 블록 벡터를 현재 블록을 위한 블록 벡터 후보 리스트에 추가될 수 있다. 현재 블록이 Merge 모드이고 현재 블록이 BVD(또는 MBVD) 를 갖는 블록 벡터 모드이고, 주변 블록이 RRIBC 모드로 부호화 된 경우, 비디오 신호 처리 장치는 현재 블록의 위치를 기준으로 주변 블록의 블록 벡터를 변경하여 변경된 블록 벡터를 현재 블록에 대한 블록 벡터 후보로 사용할 수 있으며, 블록 벡터 후보 리스트에 추가할 수 있다. 이때, 비디오 신호 처리 장치는 주변 블록의 RRIBC 타입 정보를 그대로 유지하고, 주변 블록의 블록 벡터를 현재 블록을 위한 블록 벡터 후보 리스트에 추가할 수 있다. 또한, 현재 블록이 Merge 모드이고 현재 블록이 BVD(또는 MBVD) 를 갖는 블록 벡터 모드이고, 주변 블록이 RRIBC 모드로 부호화 된 경우, 비디오 신호 처리 장치는 현재 블록의 위치를 기준으로 주변 블록의 블록 벡터를 변경하고 주변 블록의 RRIBC 타입 정보를 RRIBC를 사용하지 않는 모드로 변경한 후, 변경된 블록 벡터를 현재 블록을 위한 블록 벡터 후보 리스트에 추가될 수 있다.
비디오 신호 처리 장치는 현재 블록에 AMVP 모드가 적용되었고 RRIBC 모드가 적용된 경우, 미리 정의된 AMVP 모드를 위한 RRIBC 블록 벡터 후보 리스트를 사용할 수 있다. 또한, 비디오 신호 처리 장치는 현재 블록에 AMVP 모드가 적용되었고 블록 벡터의 수평 혹은 수직 성분 중에서 어느 하나가 '0'으로 구성되는 모드(zeroComp)가 적용된 경우, 미리 정의된 AMVP 모드를 위한 블록 벡터 후보 리스트를 사용할 수 있다. 이때, 미리 정의된 AMVP 모드를 위한 RRIBC 블록 벡터 후보 리스트 또는 zeroComp 모드를 위한 블록 벡터 후보 리스트에는 미리 정의된 후보 개수와 미리 정의된 블록 벡터 후보가 포함될 수 있다. 이때, 미리 정의된 후보 개수는 정수일 수 있으며, '2'일 수 있다. 또한, 미리 정의된 블록 벡터 후보는 RRIBC 타입 또는 zeroComp의 타입에 따라 다르게 구성될 수 있다. RRIBC 타입이 수평 방향 또는 zeroComp의 타입이 수직 방향 성분이 '0'인 경우, 미리 정의된 블록 벡터 후보는 (-Width, 0) 혹은 (-PosX,0) 중에 하나일 수 있다. 이때, RRIBC 타입이 수평 방향이므로, 수직 성분은 '0'으로 설정된다. 여기서 Width는 현재 블록의 너비이며, PosX는 픽쳐 내에서 현재 블록의 좌상단 화소 위치값에서 수평 성분의 값이 될 수 있다. RRIBC 타입이 수직 방향이거나 또는 zeroComp의 타입이 수평 방향 성분이 '0'인 경우, 미리 정의된 블록 벡터 후보는 (0, -Height) 혹은 (0, -PoxY) 중에 하나일 수 있다. 이때, RRIBC 타입이 수직 방향이므로, 수평 성분은 '0'으로 설정된다. 여기서 Height는 현재 블록의 높이이며, PosY는 픽쳐 내에서 현재 블록의 좌상단 화소 위치 값에서 수직 성분의 값이 될 수 있다.
비디오 신호 처리 장치에서 시간적인 주변 블록은 도 7과 같이 참조 픽쳐에서 현재 블록의 임의의 좌표에 대응되는 블록이 될 수 있으며, 여기서 임의의 좌표는 도 7의 BR 위치, Ctr 위치가 될 수 있다. 또는 현재 블록의 좌측에 인접한 A1 블록의 블록 벡터(또는 움직임 벡터), 현재 블록의 Ctr 위치 좌표를 사용하여 생성한 벡터가 지시하는 블록이 사용될 수 있다. 구체적으로 참조 픽쳐에서 현재 블록의 Ctr(또는 BR) 위치 좌표를 기준으로 현재 블록의 좌측에 인접한 A1 블록의 블록 벡터(또는 움직임 벡터)만큼 이동한 위치에 대응되는 주변 블록이 시간적인 주변 블록으로 사용될 수 있다.
비디오 신호 처리 장치는 시간적인 주변 블록의 블록 벡터(또는 움직임 벡터)를 유도할 때, 현재 블록의 가로 및 세로의 크기에 따라 미리 정의된 다양한 위치로부터 블록 벡터(또는 움직임 벡터)를 유도할 수 있다. 또한, 비디오 신호 처리 장치는 미리 정의된 개수만큼 시간적인 주변 블록의 블록 벡터(또는 움직임 벡터)를 유도할 수 있으며, 일 예로, 미리 정의된 개수는 '4'일 수 있다. 예를 들어, 도 66을 참고하면, 비디오 신호 처리 장치는 현재 블록의 가로 및 세로의 크기를 기준으로 BR0, Ctr0, BR1, Ctr1 위치로부터 블록 벡터를 유도할 수 있다. 미리 정의된 개수만큼의 블록 벡터(또는 움직임 벡터)가 블록 벡터(움직임 벡터) 후보 리스트에 채워지지 않았다면, 비디오 신호 처리 장치는 현재 블록의 가로 및 세로의 2배 크기를 기준으로 BR0, Ctr0, BR1, Ctr1 위치로부터 블록 벡터를 유도할 수 있다. 블록 벡터를 유도하는 과정은 미리 정의된 개수만큼의 블록 벡터(또는 움직임 벡터)가 채워질 때까지 현재 블록의 가로 및 세로의 크기의 N배까지 반복될 수 있다. 여기서 N은 5일 수 있다.
비디오 신호 처리 장치는 시간적인 주변 블록으로부터 여러 개의 블록 벡터를 유도할 수 있으며, 각 블록 벡터를 블록 벡터 후보 리스트에 추가할 때, 블록 벡터 후보 간의 동일성 및 유사성을 판단한 후, 블록 벡터 후보 리스트에 추가할지 여부를 결정할 수 있다.
비디오 신호 처리 장치는 현재 블록을 위한 블록 벡터 후보는 도 81와 같이, 현재 블록의 좌상단 위치로부터 수평 및 수직 방향으로 임의의 위치만큼 떨어진 주변 블록(비-인접 블록)의 블록 벡터로부터 유도될 수 있다. 비-인접 블록의 블록 벡터로부터 유도된 현재 블록을 위한 블록 벡터 후보는 비 인접 블록 벡터 후보라 기술될 수 있다. 여기서 임의의 위치는 현재 블록의 가로 및 세로 크기에 따라 달라지거나 또는 임의의 정수 값으로 설정될 수 있으며, 실시 일 예로, 16, 32 등이 될 수 있다. 이때, 임의의 위치는 IBC 참조 영역 메모리를 벗어나지 않는 한도 내에서 설정될 수 있다. 비-인접 블록 벡터를 블록 벡터 후보로 사용할 수 있는지 여부 또는 블록 벡터 후보 리스트에 추가할 수 있는지 여부는 비-인접 블록 벡터가 RRIBC 블록 벡터인지에 따라 달라질 수 있다. 실시 일 예로, 현재 블록이 AMVP 모드이고 RRIBC 모드가 아니고, 비-인접 주변 블록으로 유도된 블록 벡터가 RRIBC 블록 벡터인 경우, 비디오 신호 처리 장치는 블록 벡터를 블록 벡터 후보로 사용하지 않을 수 있으며, 블록 벡터 후보 리스트에 추가하지 않을 수 있다. 또 다른 실시 일 예로, 현재 블록이 Merge 이고, 비-인접 주변 블록으로 유도된 블록 벡터가 RRIBC 블록 벡터인 경우, 비디오 신호 처리 장치는 블록 벡터를 블록 벡터 후보로 사용할 수 있으며, 블록 벡터 후보 리스트에 추가할 수 있다.
비디오 신호 처리 장치는 현재 블록을 위한 블록 벡터 후보를 별도의 메모리에 저장된 블록 벡터들로부터 유도할 수 있다. 여기서, 별도의 메모리에 저장된 블록 벡터들을 HBVP(History based Block Vector Predictor)라고 할 수 있으며, HBVP 메모리는 이전에 사용된 블록 벡터들로부터 구성될 수 있다. 비디오 신호 처리 장치가 HBVP 후보를 블록 벡터 후보로 사용할 수 있는지 여부 혹은 블록 벡터 후보 리스트에 추가할 수 있는지 여부는 HBVP 후보가 RRIBC 블록 벡터인지에 따라 달라질 수 있다. 비디오 신호 처리 장치가 HBVP 후보를 블록 벡터 후보 리스트에 추가할지 여부는 시간적인 주변 블록의 RRIBC 타입에 따라 달라질 수 있다. 실시 일 예로, 현재 블록이 AMVP 모드이고 RRIBC 모드가 아니고, HBVP 후보가 RRIBC 블록 벡터인 경우, 비디오 신호 처리 장치는 블록 벡터를 블록 벡터 후보로 사용하지 않을 수 있으며, 블록 벡터 후보 리스트에 추가하지 않을 수 있다. 또 다른 실시 일 예로, 현재 블록이 Merge 모드이고, HBVP 후보가 RRIBC 블록 벡터인 경우, 비디오 신호 처리 장치는 해당 블록 벡터를 블록 벡터 후보로 사용할 수 있으며, 블록 벡터 후보 리스트에 추가할 수 있다. 또 다른 실시 일 예로, 현재 블록이 Merge 모드이고, HBVP 후보가 RRIBC 블록 벡터인 경우, 비디오 신호 처리 장치는 블록 벡터를 블록 벡터 후보로 사용하지 않을 수 있으며, 블록 벡터 후보 리스트에 추가하지 않을 수 있다. 또 다른 실시 일 예로, 현재 블록이 부호화 모드와 관계없이 HBVP 후보가 RRIBC 블록 벡터인 경우, 비디오 신호 처리 장치는 블록 벡터를 블록 벡터 후보로 사용하지 않을 수 있으며, 블록 벡터 후보 리스트에 추가하지 않을 수 있다.
비디오 신호 처리 장치는 RRIBC 타입에 따라 다수의 HBVP 메모리를 구성하여 현재 블록을 위한 블록 벡터 후보를 유도하는데 사용할 수 있다. 실시 일 예로, 비디오 신호 처리 장치는 RRIBC 모드가 사용되지 않은 블록 벡터만으로 구성된 HBVP 메모리, 수평 방향 타입의 RRIBC 모드가 사용된 블록 벡터만으로 구성된 HBVP 메모리, 수직 방향 타입의 RRIBC 모드가 사용된 블록 벡터만으로 구성된 HBVP 메모리를 구성할 수 있다. 만일 현재 블록이 AMVP 모드이고, 현재 블록의 RRIBC 타입이 수평 방향인 경우, 비디오 신호 처리 장치는 수평 방향 타입의 RRIBC 모드가 사용된 블록 벡터만으로 구성된 HBVP 메모리를 사용하여 블록 벡터 후보를 유도하는데 사용할 수 있다.
도 82는 본 명세서의 일 실시예에 따른 자동 재배치 움직임 후보를 유도하는 방법을 나타낸다
비디오 신호 처리 장치는 자동 재배치 움직임 후보를 현재 블록을 위한 움직임 후보 리스트에 추가하여 구성할 수 있다. 자동 재배치 움직임 후보는 현재 블록의 주변 블록으로부터 유도된 움직임 후보를 사용하거나 혹은 움직임 후보 리스트 내의 움직임 후보를 사용하여 유도할 수 있다. 비디오 신호 처리 장치가 현재 블록의 주변 블록으로부터 유도된 움직임 벡터(또는 블록 벡터)가 지시하는 참조 블록을 찾은 후, 참조 블록의 예측에 사용된 움직임 벡터(또는 블록 벡터)를 현재 블록을 기준으로 재배치(재계산)한 움직임 벡터를 자동 재배치 움직임 벡터 (Auto relocated motion vector)라고 할 수 있다. 또는 비디오 신호 처리 장치가 움직임 후보 리스트 내의 움직임 후보로부터 유도된 움직임 벡터가 지시하는 참조 블록을 찾은 후, 참조 블록의 예측에 사용된 움직임 벡터(또는 블록 벡터)를 현재 블록을 기준으로 재배치(재계산)한 움직임 벡터를 자동 재배치 움직임 벡터 (Auto relocated motion vector)라고 할 수 있다. 또한, 자동 재배치 움직임 벡터를 이용한 움직임 후보를 자동 재배치 움직임 후보 또는 CMVP(Chained Motion Vector Prediction) 후보라 할 수 있다.
도 82를 참조하면, MVL0k(0)는 자동 재배치 움직임 후보를 유도하기 위해 사용되는 초기 움직임 벡터일 수 있다. 먼저, 비디오 신호 처리 장치는 현재 픽쳐의 현재 블록의 MVL0k(0)가 지시하는 참조 픽쳐 내(RefPicL0k(0))의 참조 블록으로부터 움직임 벡터 또는 블록 벡터를 유도할 수 있다. MVL0k(0)가 지시하는 참조 픽쳐 내의 참조 블록으로부터 블록 벡터 BVk(0)가 유도되고, BVk(0)가 지시하는 참조 블록으로부터 또 다른 움직임 벡터 MVL0k(1)가 유도될 수 있다. 또한, MVL0k(1)가 지시하는 참조 블록으로 또 다른 움직임 벡터 또는 블록 벡터는 유도될 수 있으며, 비디오 신호 처리 장치는 이러한 과정을 반복적으로 m번 수행함으로써 최종적으로 MVL0k(m)이 지시하는 참조 블록(RefBlk)을 유도할 수 있다. 비디오 신호 처리 장치는 현재 블록(CurBlk)을 기준으로 참조 픽쳐(RefPicL0k(m)) 내의 참조 블록(RefBlk)까지의 움직임 벡터(MVL0k/m)를 자동 재배치 움직임 벡터로 설정할 수 있다. 자동 재배치 움직임 벡터(MVL0k/m)는 MVL0k(0) + BVk(0) + MVL0k(1) + MVL0k(2) + … + MVL0k(m)으로 계산될 수 있다. 또한 자동 재배치 움직임 벡터의 참조 픽쳐는 RefPicL0k(m)일 수 있다. 이때 참조 블록을 유도하는 과정이 반복적으로 m번 수행될 때, m은 자동 재배치 움직임 벡터가 유도되는 깊이일 수 있다.
비디오 신호 처리 장치는 자동 재배치 움직임 벡터가 움직임 후보 리스트에 존재하는지를 판단한 후, 존재하지 않는 경우에만 자동 재배치 움직임 벡터를 움직임 후보 리스트에 추가할 수 있다. 자동 재배치 움직임 벡터는 스스로 유도되지 않고, 기준 움직임 벡터가 필요할 수 있다. 따라서, 비디오 신호 처리 장치는 움직임 후보 리스트에 최소 하나 이상의 움직임 후보가 존재하는 경우, 자동 재배치 움직임 벡터를 유도할 수 있다. 비디오 신호 처리 장치는 미리 지정된 후보를 움직임 후보 리스트에 추가하고, 자동 재배치 움직임 벡터 후보를 움직임 후보 리스트에 추가할 수 있다. 미리 지정된 후보는 공간적인 주변 블록으로부터 유도된 움직임 후보, 공간적으로 인접하지 않고 멀리 떨어진 주변 블록으로부터 유도된 움직임 후보, 시간적인 주변 블록으로부터 유도된 움직임 후보, 히스토리 기반 움직임 후보, 평균값을 사용한 움직임 후보, 미리 정해진 움직임 후보, 제로(0,0) 움직임 후보 중 어느 하나일 수 있다. 구체적으로 비디오 신호 처리 장치는 공간적인 주변 블록으로부터 유도된 움직임 후보, 공간적으로 인접하지 않고 멀리 떨어진 주변 블록으로부터 유도된 움직임 후보, 시간적인 주변 블록으로부터 유도된 움직임 후보, 히스토리 기반 움직임 후보 중에서 적어도 하나를 움직임 후보 리스트에 추가한 후, 자동 재배치 움직임 후보를 유도하여 움직임 후보 리스트에 추가할 수 있다. 비디오 신호 처리 장치는 공간적인 주변 블록으로부터 유도된 움직임 후보, 공간적으로 인접하지 않고 멀리 떨어진 주변 블록으로부터 유도된 움직임 후보, 시간적인 주변 블록으로부터 유도된 움직임 후보, 히스토리 기반 움직임 후보 중에서 하나라도 유도되지 않은 경우(움직임 후보 리스트에 후보가 존재하지 않는 경우), 자동 재배치 움직임 후보를 유도하지 않을 수 있다. 또는 움직임 후보 리스트에 후보가 존재하지 않는 경우, 비디오 신호 처리 장치는 미리 정해진 움직임 벡터 또는 블록 벡터를 기반으로 자동 재배치 움직임 후보를 유도하여 움직임 후보 리스트에 추가할 수 있다. 여기서 미리 지정된 미리 정해진 움직임 벡터는 (-X, 0), (0, -Y), (-X, -Y) 중에 하나일 수 있으며, X, Y는 정수 일 수 있다.
도 83은 본 명세서의 일 실시예에 따른 자동 재배치 움직임 후보를 유도하기 위한 기준 위치를 나타낸다.
자동 재배치 움직임 벡터는 현재 블록의 중앙 위치를 기준으로 움직임 벡터만큼 이동한 위치로부터 유도될 수 있다. 도 83을 참조하면, 비디오 신호 처리 장치는 현재 블록(CurBlk)의 중앙 위치(C)를 기준으로 움직임 벡터(MVL0k(0))만큼 이동한 위치의 참조 블록으로부터 또 다른 움직임 벡터(MVL0k(1))를 유도할 수 있다. 하지만, 현재 블록의 중앙 위치를 기준으로 움직임 벡터만큼 이동한 위치의 참조 블록이 인트라 예측 모드로 부호화된 경우, 움직임 벡터가 존재하지 않을 수 있다. 이 경우, 비디오 신호 처리 장치는 현재 블록의 하나 이상의 위치들에 대해 특정 순서대로 각 위치의 움직임 벡터가 지시하는 참조 블록에서 움직임 벡터 또는 블록 벡터가 존재하는지 확인할 수 있다. 이때 특정 순서는 좌상단 위치(TR), 우상단 위치(TL), 좌하단 위치(BR), 우하단 위치(BL) 순서일 수 있고, 중앙 위치(C), 좌상단 위치(TR), 우상단 위치(TL), 좌하단 위치(BR), 우하단 위치(BL) 순서일 수 있다. 그리고 비디오 신호 처리 장치는 확인 과정에서 처음으로 유효한 움직임 벡터 또는 블록 벡터에 기초하여 자동 재배치 움직임 벡터를 유도할 수 있다. 또는, 비디오 신호 처리 장치는 각 위치의 움직임 벡터가 지시하는 참조 블록에서의 하나 이상의 유효한 움직임 벡터 또는 블록 벡터를 기초하여 자동 재배치 움직임 벡터를 유도할 수 있다. 비디오 신호 처리 장치는 유도된 하나 이상의 자동 재배치 움직임 벡터를 움직임 후보 리스트에 추가할 수 있다.
자동 재배치 움직임 벡터의 유도는 반복적으로 m번 수행될 수 있다. m은 자동 재배치 움직임 벡터가 유도되는 깊이라고 할 수 있다. 비디오 신호 처리 장치는 현재 블록의 중앙 위치(C), 좌상단 위치(TR), 우상단 위치(TL), 좌하단 위치(BR), 우하단 위치(BL) 순서를 기준으로 자동 재배치 움직임 벡터를 유도할 때, 각 위치별 유도되는 자동 재배치 움직임 벡터의 깊이가 낮은 순부터 높은 순서로 자동 재배치 움직임 벡터를 유도하여 움직임 후보 리스트에 추가할 수 있다. 또는 비디오 신호 처리 장치는 각 위치별 유도되는 자동 재배치 움직임 벡터의 깊이가 높은 순부터 낮은 순서로 자동 재배치 움직임 벡터를 유도하여 움직임 후보 리스트에 추가할 수 있다. 예를 들어, 비디오 신호 처리 장치는 현재 블록의 중앙 위치(C), 좌상단 위치(TR), 우상단 위치(TL), 좌하단 위치(BR), 우하단 위치(BL) 순서를 기준으로 자동 재배치 움직임 벡터가 유도되는 깊이가 1인 블록으로부터 유도된 자동 재배치 움직임 벡터를 먼저 움직임 후보 리스트에 추가할 수 있다. 다음으로, 비디오 신호 처리 장치는 자동 재배치 움직임 벡터가 유도되는 깊이가 2인 블록으로부터 유도된 자동 재배치 움직임 벡터들을 움직임 후보 리스트에 추가할 수 있다. 비디오 신호 처리 장치는 자동 재배치 움직임 벡터가 유도되는 깊이가 허용되는 깊이가 될 때까지 자동 재배치 움직임 벡터의 유도를 반복할 수 있으며, 또한 움직임 후보 리스트가 모두 채워질 때까지 반복할 수 있다.
도 83을 참조하면, 자동 재배치 움직임 벡터를 유도하기 위해 사용되는 기준 위치에 따라 서로 다른 자동 재배치 움직임 벡터가 유도될 수 있다. 이때, 비디오 신호 처리 장치는 5가지 기준 위치(중앙 위치(C), 좌상단 위치(TR), 우상단 위치(TL), 좌하단 위치(BR), 우하단 위치(BL))로부터 유도된 자동 재배치 움직임 벡터들 중에서 현재 블록에 가장 적합한 자동 재배치 움직임 벡터를 선정할 수 있으며, 선정된 자동 재배치 움직임 벡터를 기준으로 깊이가 낮은 순부터 높은 순서로 자동 재배치 움직임 벡터를 추가로 유도할 수 있다. 비디오 신호 처리 장치는 자동 재배치 움직임 벡터의 AMVR 정보, 자동 재배치 움직임 벡터가 AMVP인지 또는 머지를 사용하여 유도된 것인지에 대한 정보, 자동 재배치 움직임 벡터가 어파인 모드를 사용했는지에 대한 정보, 자동 재배치 움직임 벡터가 MVD 또는 MMVD를 통해 구성되었는지에 대한 정보, 자동 재배치 움직임 벡터들 간의 유사도 중에서 적어도 하나 이상을 사용하여 가장 적합한 자동 재배치 움직임 벡터를 선정할 수 있고, 선정된 자동 재배치 움직임 벡터를 움직임 후보 리스트에 추가할 수 있다. 예를 들어, 비디오 신호 처리 장치는 유도된 자동 재배치 움직임 벡터가 1/4 화소 단위의 움직임 벡터이거나 AMVP 모드를 사용하여 유도된 것인 경우, 자동 재배치 움직임 벡터를 움직임 후보 리스트에 추가할 수 있다. 예를 들어, 비디오 신호 처리 장치는 상기 조건에 따라 중앙 위치(C), 좌상단 위치(TR), 우상단 위치(TL), 좌하단 위치(BR), 우하단 위치(BL) 중에서 중앙 위치(C)로부터 유도된 제1 자동 재배치 움직임 벡터가 현재 블록에 가장 적합한 자동 재배치 움직임 벡터인 경우, 중앙 위치(C)로부터 유도된 제1 자동 재배치 움직임 벡터를 움직임 후보 리스트에 추가할 수 있다. 다음으로, 제1 자동 재배치 움직임 벡터가 지시하는 블록(예를 들어, 깊이 1인 블록)의 중앙 위치(C), 좌상단 위치(TR), 우상단 위치(TL), 좌하단 위치(BR), 우하단 위치(BL)로부터 유도된 자동 재배치 움직임 벡터 중에서 현재 블록에 가장 적합한 자동 재배치 움직임 벡터를 상기 조건에 따라 선정할 수 있으며, 선정된 제2 자동 재배치 움직임 벡터를 움직임 후보 리스트에 추가할 수 있다. 다음으로, 제2 자동 재배치 움직임 벡터가 지시하는 블록(예를 들어, 깊이 2인 블록)에 대해서도 상기 방법과 같이 수행할 수 있으며, 이를 깊이가 낮은 순부터 높은 순서로 반복하여 자동 재배치 움직임 벡터를 선정한 후, 움직임 후보 리스트에 추가할 수 있다. 또한, 비디오 신호 처리 장치는 유도된 자동 재배치 움직임 벡터들을 크기 순으로 정렬한 후, 중앙값을 사용하여 하나의 자동 재배치 움직임 벡터를 선정할 수 있으며, 선정된 자동 재배치 움직임 벡터를 움직임 후보 리스트에 추가할 수 있다.
비디오 신호 처리 장치는 최종 단계에서 유도된 자동 재배치 움직임 벡터, 중간 단계에서 유도된 하나 이상의 자동 재배치 움직임 벡터 중에서 하나 이상의 움직임 벡터를 사용하여 움직임 후보를 유도할 수 있으며, 움직임 후보를 움직임 후보 리스트에 추가할 수 있다. 움직임 후보는 L0 움직임 벡터만으로 구성된 움직임 후보이거나 L1 움직임 벡터만으로 구성된 단방향 움직임 후보일 수 있다. 또는 움직임 후보는 L0 움직임 벡터와 L1 움직임 벡터로 구성된 양방향 움직임 후보 또는 양예측 움직임 후보일 수 있다. 또는 움직임 후보는 MHP 부호화 모드와 유사하게, 3개 이상의 움직임 벡터로 구성된 움직임 후보 일 수 있다. 비디오 신호 처리 장치는 유도된 움직임 후보에 2개 이상의 움직임 벡터가 존재하는 경우, 각각의 움직임 벡터로부터 유도된 예측 블록에 동일한 가중치를 적용하여 가중치 평균을 통해 최종적으로 현재 블록을 위한 예측 블록을 생성할 수 있다. 또한 비디오 신호 처리 장치는 유도된 움직임 후보에 2개 이상의 움직임 벡터가 존재하는 경우, 각각의 움직임 벡터로부터 유도된 예측 블록에 서로 다른 가중치를 적용하여 가중치 평균을 통해 최종적으로 현재 블록을 위한 예측 블록을 생성할 수 있다. 가중치는 현재 블록 혹은 참조 블록의 가로 및 세로 크기, 참조 블록의 움직임 정보가 AMVP인지 또는 머지 인지 정보, 참조 블록이 어파인 모드를 사용했는지, 참조 블록이 MVD 또는 MMVD를 통해 움직임 정보가 구성되었는지, 참조 블록을 포함한 참조 픽쳐의 POC와 현재 픽쳐의 POC 간의 거리, 참조 블록이 단방향 움직임으로 구성되었는지, 참조 블록이 양방향 또는 양예측 움직임으로 구성되었는지, 참조 블록이 잔여 블록을 합산하여 생성된 블록인지 여부, 참조 블록의 잔여 블록에 대한 양자화 파라미터 정보, 참조 블록을 포함한 참조 픽쳐의 양자화 파라미터 정보, 참조 블록을 포함한 참조 픽쳐의 시간적인 계층(temporal layer) 정보 중에서 적어도 하나 이상을 사용하여 결정될 수 있다. 예를 들어, 참조 블록의 움직임 정보가 AMVP 모드를 사용한 경우의 가중치는 참조 블록의 움직임 정보가 머지 모드를 사용한 경우의 가중치보다 크게 설정될 수 있다. 참조 블록의 움직임 정보가 AMVP 모드를 사용한 경우의 가중치는 3일 수 있고, 참조 블록의 움직임 정보가 머지 모드를 사용한 경우의 가중치는 1일 수 있다.
비디오 신호 처리 장치는 최종 단계에서 유도된 자동 재배치 움직임 벡터, 중간 단계에서 유도된 하나 이상의 자동 재배치 움직임 벡터 중에서 하나 이상의 움직임 벡터를 조합하여 새로운 움직임 후보를 유도할 수 있다. 비디오 신호 처리 장치는 현재 블록 또는 참조 블록의 가로 및 세로 크기, 참조 블록의 움직임 정보가 AMVP인지 머지 인지 정보, 참조 블록이 어파인 모드를 사용했는지, 참조 블록이 MVD 또는 MMVD를 통해 움직임 정보가 구성되었는지, 참조 블록을 포함한 참조 픽쳐의 POC와 현재 픽쳐의 POC 간의 거리, 참조 블록이 단방향 움직임으로 구성되었는지, 참조 블록이 양방향 또는 양예측 움직임으로 구성되었는지, 참조 블록이 잔여 블록을 합산하여 생성된 블록인지 여부, 참조 블록의 잔여 블록에 대한 양자화 파라미터 정보, 참조 블록을 포함한 참조 픽쳐의 양자화 파라미터 정보, 참조 블록을 포함한 참조 픽쳐의 시간적인 계층(temporal layer) 정보 중에서 적어도 하나 이상을 사용하여 조합할 움직임 벡터를 선정할 수 있으며, 선정된 움직임 벡터를 사용하여 움직임 후보를 구성할 수 있다. 예를 들어, 비디오 신호 처리 장치는 자동 재배치 움직임 벡터를 조합하여 새로운 움직임 후보를 유도할 때, 자동 재배치 움직임 벡터가 지시하는 참조 블록을 포함한 참조 픽쳐의 시간적인 계층(temporal layer)이 서로 다른 움직임 벡터를 조합할 수 있다. 비디오 신호 처리 장치는 자동 재배치 움직임 벡터가 지시하는 참조 블록의 참조 픽쳐가 서로 다른 자동 재배치 움직임 벡터를 조합하여 새로운 움직임 후보를 유도할 수 있다. 비디오 신호 처리 장치는 자동 재배치 움직임 벡터가 지시하는 참조 블록의 참조 픽쳐의 POC가 서로 다른 자동 재배치 움직임 벡터를 조합하여 새로운 움직임 후보를 유도할 수 있다. 비디오 신호 처리 장치는 자동 재배치 움직임 벡터가 지시하는 참조 블록의 참조 픽쳐가 서로 동일한 경우, 조합된 움직임 후보를 유도하지 않을 수 있으며, 움직임 후보 리스트에 추가하지 않을 수 있다.
비디오 신호 처리 장치는 자동 재배치 움직임 벡터를 조합하여 유도된 새로운 움직임 후보들을 코스트를 기반으로 재정렬할 수 있으며, 재정렬된 움직임 후보에서 코스트가 낮은 순부터 높은 순으로 미리 지정된 개수만큼의 움직임 후보를 움직임 후보 리스트에 추가할 수 있다. 미리 지정된 개수는 정수로, 5일 수 있다. 코스트는 TM 또는 BM 기반으로 계산될 수 있다. 비디오 신호 처리 장치는 TM 기반으로 코스트를 계산할 때, 현재 블록에 인접한 복원된 샘플을 사용하여 기준 템플릿을 구성하고, 새로운 움직임 후보로부터 예측된 참조 블록에 인접한 샘플을 사용하여 참조 템플릿을 구성한 후, 기준 템플릿과 참조 템플릿 간의 SAD, MR-SAD 등을 이용하여 코스트를 계산할 수 있다. 비디오 신호 처리 장치는 BM 기반으로 코스트를 계산할 때, 상기 자동 재배치 움직임 벡터를 유도하기 위해 사용된 초기 움직임 벡터를 사용하여 예측된 블록과 새로운 움직임 후보로부터 예측된 참조 블록 간의 SAD, MR-SAD 등을 이용하여 코스트를 계산할 수 있다.
비디오 신호 처리 장치는 자동 재배치 움직임 벡터를 조합하여 유도된 새로운 움직임 후보에 대해 TM, BM, DMVR과 같은 움직임 보정 방법을 적용하지 않을 수 있다.
자동 재배치 움직임 벡터를 조합하여 유도된 새로운 움직임 후보는 머지 모드 또는 AMVP 모드를 위한 움직임 후보 리스트를 구성할 때 추가될 수 있다. AMVP는 머지 모드와 다르게 현재 블록을 위한 참조 픽쳐가 정해져 있다. 따라서, AMVP 모드를 위한 유도된 자동 재배치 움직임 벡터는 스케일링될 수 있으며, 비디오 신호 처리 장치는 스케일링된 자동 재배치 움직임 벡터를 사용하여 움직임 후보를 구성하여 움직임 후보 리스트에 추가할 수 있다. 스케일링된 자동 재배치 움직임 벡터는 현재 픽쳐의 POC, 현재 블록의 참조 픽쳐에 대한 POC, 자동 재배치 움직임 벡터가 지시하는 참조 블록을 포함하는 참조 픽쳐에 대한 POC, 자동 재배치 움직임 벡터를 사용하여 계산될 수 있다. 즉, 객체의 움직임이 일정하다는 가정하에, 비디오 신호 처리 장치는 현재 픽쳐의 POC와 현재 블록의 참조 픽쳐에 대한 POC 간의 거리와 현재 픽쳐의 POC와 자동 재배치 움직임 벡터가 지시하는 참조 블록을 포함하는 참조 픽쳐에 대한 POC 간의 거리의 비율을 자동 재배치 움직임 벡터에 곱하여 스케일링된 자동 재배치 움직임 벡터를 계산할 수 있다.
현재 블록이 AMVP 모드로 부호화된 경우, 비디오 신호 처리 장치는 현재 블록의 AMVR 정보에 따라 자동 재배치 움직임 벡터를 유도할 수 있다. 다시 말해서, 비디오 신호 처리 장치는 현재 블록의 AMVR 정보가 정수 화소인 경우, 정수 화소 단위 이상(정수 화소 단위 혹은 4의 정수 화소 단위)의 움직임 벡터가 사용된 참조 블록만을 사용하여 자동 재배치 움직임 벡터를 유도할 수 있다.
비디오 신호 처리 장치는 현재 블록의 가로 및 세로의 크기, 현재 블록의 부호화 모드(GPM, MHP, CIIP, IBC, Intra TMP, AMVP, Merge, AMVP-merge, Affine, OBMC, LIC, BCW 등)에 따라 자동 재배치 움직임 벡터에 대한 유도과정을 수행하지 않을 수 있으며, 움직임 후보 리스트에 자동 재배치 움직임 벡터를 추가하지 않을 수 있다. 예를 들어, 비디오 신호 처리 장치는 현재 블록의 가로 및 세로 크기가 미리 지정된 크기보다 작은 경우(또는 큰 경우), 자동 재배치 움직임 벡터에 대한 유도과정을 수행하지 않을 수 있다. 또는, 비디오 신호 처리 장치는 현재 블록의 부호화 모드가 GPM인 경우, 자동 재배치 움직임 벡터에 대한 유도과정을 수행하지 않을 수 있다. 또는, 비디오 신호 처리 장치는 현재 블록의 부호화 모드가 MHP인 경우, 자동 재배치 움직임 벡터에 대한 유도과정을 수행하지 않을 수 있다. 또는, 비디오 신호 처리 장치는 현재 블록에 OBMC가 적용된 경우, 자동 재배치 움직임 벡터에 대한 유도과정을 수행하지 않을 수 있다.
비디오 신호 처리 장치는 참조 블록의 가로 및 세로의 크기, 참조 블록의 부호화 모드(GPM, MHP, CIIP, IBC, Intra TMP, AMVP, Merge, AMVP-merge, Affine, OBMC, LIC, BCW 등)에 따라 참조 블록에서 자동 재배치 움직임 벡터를 유도하지 않을 수 있다. 실시 일 예로, 비디오 신호 처리 장치는 참조 블록의 가로 및 세로 크기가 미리 지정된 크기보다 작은 경우(또는 큰 경우), 참조 블록에서 자동 재배치 움직임 벡터를 유도하지 않을 수 있다. 또 다른 실시 일 예로, 비디오 신호 처리 장치는 참조 블록의 부호화 모드가 GPM인 경우, 참조 블록에서 자동 재배치 움직임 벡터를 유도하지 않을 수 있다. 또 다른 실시 일 예로, 비디오 신호 처리 장치는 참조 블록의 부호화 모드가 MHP인 경우, 참조 블록에서 자동 재배치 움직임 벡터를 유도하지 않을 수 있다. 또 다른 실시 일 예로, 비디오 신호 처리 장치는 참조 블록의 부호화 모드가 인트라 모드인 경우, 참조 블록에는 움직임 벡터가 존재하지 않으므로 자동 재배치 움직임 벡터를 유도하지 않을 수 있다. 또 다른 실시 일 예로, 비디오 신호 처리 장치는 참조 블록에 OBMC가 적용된 경우, 참조 블록에서 자동 재배치 움직임 벡터를 유도하지 않을 수 있다.
비디오 신호 처리 장치는 상술한 방법으로 유도된 자동 재배치 움직임 벡터가 지시하는 참조 블록에 OBMC, LIC, BCW 방법이 적용되었는지 여부에 따라 자동 재배치 움직임 벡터를 사용하여 예측된 블록에 OBMC, LIC, BCW 중 적어도 하나 이상을 적용하여 현재 블록의 예측 블록을 생성할지 결정할 수 있다. 예를 들어, 비디오 신호 처리 장치는 상술한 방법으로 유도된 자동 재배치 움직임 벡터가 지시하는 참조 블록에 LIC가 적용된 경우, 자동 재배치 움직임 벡터를 사용하여 예측된 블록에 LIC를 적용하여 현재 블록의 예측 블록을 생성할 수 있다. 비디오 신호 처리 장치는 상술한 방법으로 유도된 자동 재배치 움직임 벡터가 지시하는 참조 블록에 OBMC, LIC, BCW 방법이 적용되었는지 여부와 무관하게, 자동 재배치 움직임 벡터를 사용하여 예측된 블록에 OBMC, LIC, BCW 방법을 적용하지 않고 현재 블록의 예측 블록을 생성할 수 있다. 또한, 비디오 신호 처리 장치는 상술한 방법으로 유도된 자동 재배치 움직임 벡터가 지시하는 참조 블록에 OBMC, LIC, BCW 방법이 적용되었는지 여부와 무관하게, 자동 재배치 움직임 벡터를 사용하여 예측된 블록에 OBMC, LIC, BCW 방법을 적어도 하나 이상 적용하여 현재 블록의 예측 블록을 생성할 수 있다. 예를 들어, 비디오 신호 처리 장치는 상술한 방법으로 유도된 자동 재배치 움직임 벡터가 지시하는 참조 블록에 LIC가 적용되지 않았더라도 자동 재배치 움직임 벡터를 사용하여 예측된 블록에도 LIC를 적용하여 현재 블록의 예측 블록을 생성할 수 있다.
비디오 신호 처리 장치는 현재 블록의 예측 블록을 생성하기 위해 자동 재배치 움직임 벡터가 사용되는 경우, OBMC, MHP, LIC, BCW 중에서 적어도 하나와 관련된 신택스 정보를 시그널링하거나 파싱하지 않을 수 있으며, OBMC, MHP, LIC, BCW는 현재 블록에 적용하지 않는 것으로 설정할 수 있다.
비디오 신호 처리 장치는 자동 재배치 움직임 벡터로부터 유도된 참조 블록에 어파인 모드가 적용된 경우, 참조 블록에서 사용된 어파인 파라미터에 기초하여 현재 블록의 예측 블록을 생성할 수 있으며, 현재 블록에 어파인 모드를 적용할 수 있다.
비디오 신호 처리 장치는 현재 블록에 어파인 모드가 적용된 경우, 어파인 후보 리스트를 구성할 수 있으며, 이때 어파인 후보 리스트에 자동 재배치 움직임 벡터로부터 유도된 어파인 움직임 후보를 추가될 수 있다. 이때, 자동 재배치 움직임 벡터로부터 유도된 어파인 움직임 후보는 자동 재배치 움직임 벡터로부터 유도된 참조 블록에 사용된 어파인 파라미터에 기초하여 생성된 어파인 움직임 후보일 수 있다.
비디오 신호 처리 장치는 현재 블록을 여러 개의 서브 블록으로 분할한 후, 분할된 하나 이상의 서브 블록에 대해 자동 재배치 움직임 벡터를 유도할 수 있으며, 유도된 자동 재배치 움직임 벡터를 이용하여 서브 블록에 대한 예측 서브 블록을 생성할 수 있다. 또한 분할된 모든 서브 블록에 대해 자동 재배치 움직임 벡터가 유도될 수 있으며, 비디오 신호 처리 장치는 유도된 자동 재배치 움직임 벡터를 이용하여 서브 블록들에 대한 예측 서브 블록들을 생성할 수 있다.
비디오 신호 처리 장치는 현재 블록을 위한 참조 픽쳐 리스트 내의 참조 픽쳐만을 사용하여 자동 재배치 움직임 벡터가 지시하는 참조 블록을 획득할 수 있다. 다시 말해서, 자동 재배치 움직임 벡터가 지시하는 참조 블록이 현재 블록을 위한 참조 픽쳐 리스트 내의 참조 픽쳐가 아니라면, 비디오 신호 처리 장치는 자동 재배치 움직임 벡터를 현재 블록을 위한 움직임 벡터로 사용하지 않을 수 있다. 또는 자동 재배치 움직임 벡터가 지시하는 참조 블록이 현재 블록을 위한 참조 픽쳐 리스트 내의 참조 픽쳐가 아니라면, 비디오 신호 처리 장치는 자동 재배치 움직임 벡터가 현재 블록을 위한 참조 픽쳐 리스트 내의 참조 픽쳐의 참조 블록을 지시하도록, 자동 재배치 움직임 벡터에 상기 스케일링 방법을 적용할 수 있다. 그리고, 비디오 신호 처리 장치는 스케일링된 자동 재배치 움직임 벡터를 생성하여 움직임 후보 리스트에 추가할 수 있다.
자동 재배치 움직임 벡터는 참조 픽쳐로부터 유도되므로, 현재 블록을 위한 참조 픽쳐 리스트 내의 참조 픽쳐마다 움직임 정보가 저장되어 있어야 한다. 메모리를 절약하기 위해서, 인코더에서는 움직임 정보를 저장할 참조 픽쳐가 어떤 것인지 SPS/PPS/슬라이스/타일 레벨 중 적어도 어느 하나의 레벨에서 참조 픽쳐에 대한 정보를 시그널링할 수 있고, 디코더는 참조 픽쳐에 대한 정보를 파싱하여 움직임 정보를 저장된 참조 픽쳐가 어떤 것인지 설정할 수 있다. 또는 비디오 신호 처리 장치는 참조 픽쳐 리스트 내의 참조 픽쳐들 중에서 움직임 정보를 저장할 참조 픽쳐를 미리 지정할 수 있으며, 미리 지정된 참조 픽쳐는 참조 픽쳐 리스트 내에서 미리 지정된 참조 픽쳐 인덱스보다 작은 인덱스에 대응되는 참조 픽쳐일 수 있다. 미리 지정된 참조 픽쳐 인덱스는 정수일 수 있으며, 2, 3 등이 될 수 있다. 예를 들어, 미리 지정된 참조 픽쳐 인덱스가 3인 경우, 참조 픽쳐 리스트 내의 인덱스가 0, 1, 2인 참조 픽쳐에는 움직임 정보가 저장되어 있을 수 있으며, 비디오 신호 처리 장치는 인덱스가 0, 1, 2인 참조 픽쳐를 사용하여 자동 재배치 움직임 벡터를 유도할 수 있다. 인덱스가 3인 참조 픽쳐는 자동 재배치 움직임 벡터를 사용하여 참조 블록을 유도하는데 사용될 수 있지만, 움직임 정보가 저장되어 있지 않기 때문에 새로운 자동 재배치 움직임 벡터를 유도하는 용도로는 사용되지 않을 수 있다.
비디오 신호 처리 장치는 자동 재배치 움직임 벡터를 유도하는 과정에서 참조 픽쳐에 있는 움직임 정보를 읽어올 때 미리 지정된 범위의 움직임 정보를 읽어올 수 있다. 이때 미리 지정된 범위는 현재 블록을 포함하는 현재 CTU를 기준으로 설정될 수 있다. 예를 들어, 비디오 신호 처리 장치는 참조 픽쳐에서 현재 CTU의 수직 위치와 동일선상에 위치한 1줄의 CTU들 내의 움직임 정보를 읽어올 수 있으며, 현재 CTU의 수직 위치와 동일선상에 위치하지 않은 CTU로부터는 움직임 정보를 읽어올 수 없을 수 있다. 또는, 비디오 신호 처리 장치는 참조 픽쳐에서 현재 CTU의 수직 위치와 동일선상에 위치한 1줄의 CTU들과 참조 픽쳐에서 현재 CTU의 수직 위치에서 미리 정의된 수직 범위 내의 N줄의 CTU들 내의 움직임 정보를 읽어올 수 있으며, 그 이외의 미리 정의된 수직 범위 내의 N줄의 CTU를 벗어난 CTU로부터는 움직임 정보를 읽어올 수 없을 수 있다. 여기서 N은 정수로, 1, 2, 3일 수 있다. 인코더는 SPS/PPS/슬라이스/타일 레벨 중에서 적어도 하나의 레벨에서 N 값을 나타내는 정보를 시그널링할 수 있으며, 디코더는 N 값을 나타내는 정보를 파싱하여 N을 결정하고, 참조 픽쳐에서 미리 정의된 수직 범위 내의 N줄의 CTU들을 설정할 수 있다.
도 84는 본 발명의 실시 예에 따른 비디오 신호 처리 장치가 시간적인 주변 블록으로부터 자동 재배치 움직임 정보를 유도하는 것을 보여준다.
시간적인 주변 블록이 블록 벡터 기반의 부호화 모드로 부호화된 경우, 비디오 신호 처리 장치는 블록 벡터가 지시하는 블록의 움직임 정보(MV of A)를 이용하여 자동 재배치 움직임 벡터를 유도할 수 있다. 또 다른 구체적인 실시 예에서 시간적인 주변 블록이 블록 벡터 기반의 부호화 모드로 부호화된 경우, 비디오 신호 처리 장치는 블록 벡터가 지시하는 블록의 블록 벡터가 또 다시 지시하는 블록의 움직임 벡터를 이용하여 자동 재배치 움직임 벡터를 유도할 수 있다. 이때, 비디오 신호 처리 장치는 블록 벡터가 지시하는 블록의 움직임 정보(MV of A), 현재 블록이 포함된 현재 픽쳐의 POC와 참조 블록 B를 포함하는 픽쳐의 POC 사이의 거리, 및 참조 블록 A를 포함하는 픽쳐의 POC와 참조 블록 B를 포함하는 픽쳐의 POC 사이의 거리에 따라 스케일된 자동 재배치 움직임 벡터(AR-MV)를 계산할 수 있다. 비디오 신호 처리 장치는 스케일된 자동 재배치 움직임 벡터(AR-MV)를 현재 블록에 대한 움직임 후보 리스트에 추가할 수 있다.
비디오 신호 처리 장치는 최종 단계에서 유도된 자동 재배치 움직임 벡터, 중간 단계에서 유도된 하나 이상의 자동 재배치 움직임 벡터 중 하나 이상의 움직임 벡터를 사용하여 움직임 후보를 유도할 수 있다. 비디오 신호 처리 장치는 유도한 움직임 후보를 움직임 후보 리스트에 추가할 수 있다. 움직임 후보는 L0 움직임 벡터만으로 구성된 움직임 후보이거나 L1 움직임 벡터만으로 구성된 단방향 움직임 후보일 수 있다. 또 다른 구체적인 실시 예에서 움직임 후보는 L0 움직임 벡터와 L1 움직임 벡터로 구성된 양방향 움직임 후보 또는 양예측 움직임 후보일 수 있다. 또 다른 구체적인 실시 예에서 움직임 후보는 MHP 부호화 모드와 유사하게, 3개 이상의 움직임 벡터로 구성된 움직임 후보 일 수 있다. 유도된 움직임 후보에 2개 이상의 움직임 벡터가 존재하는 경우, 비디오 신호 처리 장치는 각각의 움직임 벡터로부터 유도된 예측 블록을 가중 평균하여 현재 블록을 위한 최종 예측 블록을 생성할 수 있다. 이때, 예측 블록에 적용되는 가중치는 동일할 수 있다. 또 다른 구체적인 실시 예에서 예측 블록에 적용되는 가중치는 서로 다를 수 있다. 이때, 비디오 신호 처리 장치는 현재 블록 또는 참조 블록의 가로 및 세로 크기, 참조 블록의 움직임 정보가 AMVP인지 또는 Merge 인지, 참조 블록이 Affine 모드를 사용하는지, 참조 블록이 MVD 혹은 MMVD를 통해 움직임 정보가 구성되는지, 참조 블록을 포함한 참조 픽쳐의 POC와 현재 픽쳐의 POC 사이의 거리, 참조 블록이 단방향 움직임으로 구성되는지, 참조 블록이 양방향 또는 양예측 움직임으로 구성되는지, 참조 블록이 잔여 블록을 합산하여 생성된 블록인지, 참조 블록의 잔여 블록에 대한 양자화 파라미터 정보, 참조 블록을 포함한 참조 픽쳐의 양자화 파라미터 정보, 참조 블록을 포함한 참조 픽쳐의 시간적인 계층(temporal layer) 정보 중 적어도 하나 이상을 사용하여 가중치를 설정할 수 있다. 비디오 신호 처리 장치는 참조 블록의 움직임 정보가 AMVP 모드를 사용한 경우의 가중치를 참조 블록의 움직임 정보가 Merge 모드를 사용한 경우의 가중치보다 크게 설정할 수 있다. 구체적인 실시 예에서, 참조 블록의 움직임 정보가 AMVP 모드를 사용한 경우의 가중치는 3이고, 참조 블록의 움직임 정보가 Merge 모드를 사용한 경우의 가중치는 1일 수 있다.
비디오 신호 처리 장치는 최종 단계에서 유도된 자동 재배치 움직임 벡터, 중간 단계에서 유도된 하나 이상의 자동 재배치 움직임 벡터 중 하나 이상의 움직임 벡터를 조합하여 새로운 움직임 후보를 유도할 수 있다. 비디오 신호 처리 장치는 현재 블록 또는 참조 블록의 가로 및 세로 크기, 참조 블록의 움직임 정보가 AMVP로 유도된 건지 또는 Merge로 유도된 건지, 참조 블록이 Affine 모드를 사용하는지, 참조 블록이 MVD 또는 MMVD를 통해 움직임 정보가 구성되는지, 참조 블록을 포함한 참조 픽쳐의 POC와 현재 픽쳐의 POC 사이의 거리, 참조 블록이 단방향 움직임으로 구성되었는지, 참조 블록이 양방향 혹은 양예측 움직임으로 구성되었는지, 참조 블록이 잔여 블록을 합산하여 생성된 블록인지 여부, 참조 블록의 잔여 블록에 대한 양자화 파라미터 정보, 참조 블록을 포함한 참조 픽쳐의 양자화 파라미터 정보, 참조 블록을 포함한 참조 픽쳐의 시간적인 계층(temporal layer) 정보 중에서 적어도 하나 이상을 사용하여 조합할 움직임 벡터를 선정할 수 있다. 비디오 신호 처리 장치는 선정된 움직임 벡터를 사용하여 움직임 후보를 구성할 수 있다. 비디오 신호 처리 장치가 자동 재배치 움직임 벡터를 조합하여 새로운 움직임 후보를 유도할 때, 비디오 신호 처리 장치는 자동 재배치 움직임 벡터가 지시하는 참조 블록을 포함하는 참조 픽쳐의 시간적인 계층(temporal layer)이 서로 다르게, 복수의 움직임 후보를 유도할 수 있다. 또 다른 구체적인 실시 예에서 비디오 신호 처리 장치는 자동 재배치 움직임 벡터가 지시하는 참조 블록의 참조 픽쳐가 서로 다르게, 복수의 움직임 후보를 유도할 수 있다. 또 다른 구체적인 실시 예에서 비디오 신호 처리 장치는 상기 자동 재배치 움직임 벡터가 지시하는 참조 블록의 참조 픽쳐의 POC가 서로 다르게, 복수의 움직임 후보를 유도할 수 있다. 또 다른 구체적인 실시 예에서 자동 재배치 움직임 벡터가 지시하는 참조 블록의 참조 픽쳐가 서로 동일한 경우, 비디오 신호 처리 장치는 조합된 움직임 후보를 유도하지 않고, 움직임 후보 리스트에 추가하지 않을 수 있다.
비디오 신호 처리 장치는 자동 재배치 움직임 벡터를 조합하여 유도된 새로운 움직임 후보를 코스트 기반으로 재정렬할 수 있다. 이때, 비디오 신호 처리 장치는 재정렬된 움직임 후보에서 코스트가 낮은 움직임 후보부터 미리 지정된 개수만큼 움직임 후보 리스트에 추가할 수 있다. 미리 지정된 개수는 정수일 수 있다. 예컨대, 5일 수 있다. 코스트는 TM 혹은 BM 기반으로 계산될 수 있다. TM 기반으로 코스트를 계산할 때, 현재 블록에 인접한 복원된 샘플을 사용하여 기준 템플릿을 구성하고, 새로운 움직임 후보로부터 예측된 참조 블록에 인접한 샘플을 사용하여 참조 템플릿을 구성하고, 기준 템플릿과 참조 템플릿 사이의 SAD 또는 MR-SAD를 이용하여 코스트를 계산할 수 있다. 비디오 신호 처리 장치가 BM 기반으로 코스트를 계산할 때, 비디오 신호 처리 장치는 자동 재배치 움직임 벡터를 유도하기 위해 사용된 초기 움직임 벡터를 사용하여 예측된 블록과 새로운 움직임 후보로부터 예측된 참조 블록 사이의 SAD 또는 MR-SAD를 이용하여 코스트를 계산할 수 있다.
비디오 신호 처리 장치는 자동 재배치 움직임 벡터를 조합하여 유도된 새로운 움직임 후보에, 움직임 보정 방법을 적용하지 않을 수 있다. 이때, 움짐익 보정 방법은 TM, BM, 및 DMVR 중 적어도 어느 하나를 포함할 수 있다.
비디오 신호 처리 장치는 자동 재배치 움직임 벡터를 조합하여 유도된 새로운 움직임 후보를 Merge 모드를 위한 움직임 후보 리스트 또는 AMVP 모드를 위한 움직임 후보 리스트에 추가할 수 있다.
AMVP는 Merge 모드와 다르게 현재 블록을 위한 참조 픽쳐가 정해져 있다. 따라서 비디오 신호 처리 장치는 유도된 자동 재배치 움직임 벡터를 스케일링할 수 있다. 비디오 신호 처리 장치는 스케일링된 자동 재배치 움직임 벡터를 사용하여 움직임 후보를 구성할 수 있다. 또한, 비디오 신호 처리 장치는 스케일링된 자동 재배치 움직임 벡터를 AMVP 모드를 위한 움직임 후보 리스트에 추가할 수 있다. 비디오 신호 처리 장치는 현재 픽쳐의 POC, 현재 블록의 참조 픽쳐에 대한 POC, 자동 재배치 움직임 벡터가 지시하는 참조 블록을 포함하는 참조 픽쳐에 대한 POC, 및 자동 재배치 움직임 벡터 중 적어도 어느 하나를 사용하여 자동 재배치 움직임 벡터를 스케일링할 수 있다. 객체의 움직임이 일정하다는 가정을 통해, 비디오 신호 처리 장치는 현재 픽쳐의 POC와 현재 블록의 참조 픽쳐에 대한 POC 사이의 거리와 현재 픽쳐의 POC와 자동 재배치 움직임 벡터가 지시하는 참조 블록을 포함하는 참조 픽쳐에 대한 POC 간의 거리의 비율을 자동 재배치 움직임 벡터에 곱하여 자동 재배치 움직임 벡터를 스케일링할 수 있다.
현재 블록이 AMVP 모드로 부호화된 경우, 비디오 신호 처리 장치는 현재 블록의 AMVR 정보에 따라 자동 재배치 움직임 벡터를 유도할 수 있다. 현재 블록의 AMVR 정보가 정수 화소일 경우, 비디오 신호 처리 장치는 정수 화소 단위 이상, 예컨대 정수 화소 단위 또는 4의 정수 화소 단위의 움직임 벡터가 사용된 참조 블록만을 사용하여 자동 재배치 움직임 벡터를 유도할 수 있다.
비디오 신호 처리 장치는 현재 블록의 가로 및 세로의 크기, 현재 블록의 부호화 모드에 따라 자동 재배치 움직임 벡터에 대한 유도과정을 수행하지 않을 수 있다. 이때, 비디오 신호 처리 장치는 움직임 후보 리스트에 자동 재배치 움직임 벡터를 추가하지 않을 수 있다. 현재 블록의 부호화 모드는 GPM, MHP, CIIP, IBC, Intra TMP, AMVP, Merge, AMVP-merge, Affine, OBMC, LIC, 및 BCW 중 적어도 어느 하나를 포함할 수 있다. 비디오 신호 처리 장치는 현재 블록의 가로 및 세로 크기에 관한 조건에 따라 자동 재배치 움직임 벡터에 대한 유도과정을 수행하지 않을 수 있다. 이때, 현재 블록의 가로 및 세로 크기에 관한 조건은 현재 블록의 가로 및 세로의 크기가 미리 지정된 크기보다 작은 것일 수 있다. 또 다른 구체적인 실시 예에서 현재 블록의 가로 및 세로 크기에 관한 조건은 현재 블록의 가로 및 세로의 크기가 미리 지정된 크기보다 큰 것일 수 있다. 또한, 비디오 신호 처리 장치는 현재 블록의 부호화 모드에 관한 조건에 따라 자동 재배치 움직임 벡터에 대한 유도과정을 수행하지 않을 수 있다. 현재 블록의 부호화 모드에 관한 조건은 현재 블록의 부호화 모드가 GPM인 것일 수 있다. 또 다른 구체적인 실시 예에서 현재 블록의 부호화 모드에 관한 조건은 현재 블록의 부호화 모드가 MHP인 것일 수 있다. 또 다른 구체적인 실시 예에서현재 블록의 부호화 모드에 관한 조건은 현재 블록의 부호화 모드가 OBMC인 것일 수 있다.
비디오 신호 처리 장치는 참조 블록의 가로 및 세로의 크기, 및 참조 블록의 부호화 모드 중 적어도 어느 하나를 기초로 참조 블록의 자동 재배치 움직임 벡터를 유도하지 않을 수 있다. 현재 블록의 부호화 모드는 GPM, MHP, CIIP, IBC, Intra TMP, AMVP, Merge, AMVP-merge, Affine, OBMC, LIC, 및 BCW 중 적어도 어느 하나를 포함할 수 있다. 비디오 신호 처리 장치는 참조 블록의 가로 및 세로 크기에 관한 조건에 따라 참조 블록의 자동 재배치 움직임 벡터에 대한 유도과정을 수행하지 않을 수 있다. 이때, 참조 블록의 가로 및 세로 크기에 관한 조건은 참조 블록의 가로 및 세로의 크기가 미리 지정된 크기보다 작은 것일 수 있다. 또 다른 구체적인 실시 예에서 참조 블록의 가로 및 세로 크기에 관한 조건은 참조 블록의 가로 및 세로의 크기가 미리 지정된 크기보다 큰 것일 수 있다. 또한, 비디오 신호 처리 장치는 참조 블록의 부호화 모드에 관한 조건에 따라 참조 블록의 자동 재배치 움직임 벡터에 대한 유도과정을 수행하지 않을 수 있다. 참조 블록의 부호화 모드에 관한 조건은 참조 블록의 부호화 모드가 GPM인 것일 수 있다. 또 다른 구체적인 실시 예에서 참조 블록의 부호화 모드에 관한 조건은 참조 블록의 부호화 모드가 MHP인 것일 수 있다. 또 다른 구체적인 실시 예에서현재 참조 블록의 부호화 모드에 관한 조건은 참조 블록의 부호화 모드가 OBMC인 것일 수 있다.
비디오 신호 처리 장치는 자동 재배치 움직임 벡터가 지시하는 참조 블록에 OBMC, LIC 또는 BCW 중 적어도 어느 하나가 적용된지에 따라 자동 재배치 움직임 벡터를 사용하여 예측된 블록에 OBMC, LIC 또는 BCW 중 적어도 어느 하나를 적용할 수 있다. 구체적으로 자동 재배치 움직임 벡터가 지시하는 참조 블록에OBMC, LIC 또는 BCW 어느 하나가 적용된 경우, 비디오 신호 처리 장치는 자동 재배치 움직임 벡터를 사용하여 예측된 블록에 해당 기법을 적용할 수 있다. 예컨대, 자동 재배치 움직임 벡터가 지시하는 참조 블록에 LIC가 적용된 경우, 비디오 신호 처리 장치는 자동 재배치 움직임 벡터를 사용하여 예측된 블록에 LIC를 적용할 수 있다. 또 다른 구체적인 실시 예에서 비디오 신호 처리 장치는 자동 재배치 움직임 벡터가 지시하는 참조 블록에 OBMC, LIC 또는 BCW 중 적어도 어느 하나가 적용된지와 관계없이 자동 재배치 움직임 벡터를 사용하여 예측된 블록에 OBMC, LIC 및 BCW를 적용하지 않을 수 있다. 또 다른 구체적인 실시 예에서 비디오 신호 처리 장치는 자동 재배치 움직임 벡터가 지시하는 참조 블록에 OBMC, LIC 또는 BCW 중 적어도 어느 하나가 적용된지와 관계없이 자동 재배치 움직임 벡터를 사용하여 예측된 블록에 OBMC, LIC 또는 BCW 중 적어도 어느 하나를 적용할 수 있다. 예컨대, 자동 재배치 움직임 벡터가 지시하는 참조 블록에 LIC가 적용되지 않더라도, 비디오 신호 처리 장치는 자동 재배치 움직임 벡터를 사용하여 예측된 블록에 LIC를 적용할 수 있다.
인코더는 자동 재배치 움직임 벡터가 사용되는 블록에 대한, OBMC, MHP, LIC, 또는 BCW 중 적어도 어느 하나와 관련된 신택스 정보를 비트스트림에 포함시킬 수 있다. 현재 블록에 자동 재배치 움직임 벡터가 사용되는 경우, 디코더는 OBMC, MHP, LIC, 또는 BCW 중 적어도 어느 하나와 관련된 신택스 정보 파싱할 수 있다.
자동 재배치 움직임 벡터로부터 유도된 참조 블록에 affine 모드가 적용된 경우, 비디오 신호 처리 장치는 참조 블록에서 사용된 affine 파라미터를 기초로 현재 블록에 대한 예측 블록을 생성할 수 있다. 이때, 현재 블록에 affine 모드가 적용될 수 있다. 현재 블록에 affine 모드가 적용된 경우, 비디오 신호 처리 장치는 affine 후보 리스트를 구성할 수 있다. 이때, 비디오 신호 처리 장치는 affine 후보 리스트에 자동 재배치 움직임 벡터로부터 유도된 affine 움직임 후보가 추가할 수 있다. 자동 재배치 움직임 벡터로부터 유도된 affine 움직임 후보는 자동 재배치 움직임 벡터로부터 유도된 참조 블록에 사용된 affine 파라미터에 기초하여 생성될 수 있다.
비디오 신호 처리 장치는 현재 블록을 여러 개의 서브 블록으로 분할한 후, 분할된 하나 이상의 서브 블록에 자동 재배치 움직임 벡터를 유도할 수 있다. 이때, 비디오 신호 처리 장치는 유도된 자동 재배치 움직임 벡터를 이용하여 해당 서브 블록에 대한 예측 서브 블록을 생성할 수 있다. 또한, 비디오 신호 처리 장치는 분할된 모든 서브 블록에서 자동 재배치 움직임 벡터가 유도될 수 있다. 또한, 비디오 신호 처리 장치는 유도된 자동 재배치 움직임 벡터를 이용하여 서브 블록에 대한 예측 서브 블록들을 생성할 수 있다.
비디오 신호 처리 장치는는 현재 블록을 위한 참조 픽쳐 리스트 내의 참조 픽쳐만을 사용하여 자동 재배치 움직임 벡터가 지시하는 참조 블록을 획득할 수 있다. 이때, 자동 재배치 움직임 벡터가 지시하는 참조 블록이 현재 블록을 위한 참조 픽쳐 리스트 내의 참조 픽쳐가 아닌 경우, 비디오 신호 처리 장치는 자동 재배치 움직임 벡터를 현재 블록을 위한 움직임 벡터로 사용하지 않을 수 있다. 또 다른 구체적인 실시 예에서 자동 재배치 움직임 벡터가 지시하는 참조 블록이 현재 블록을 위한 참조 픽쳐 리스트 내의 참조 픽쳐가 아닌 경우, 비디오 신호 처리 장치는 자동 재배치 움직임 벡터가 현재 블록을 위한 참조 픽쳐 리스트 내의 참조 픽쳐의 참조 블록을 지시하도록, 자동 재배치 움직임 벡터에 앞서 설명한 스케일링을 적용할 수 있다. 이를 통해 비디오 신호 처리 장치는 스케일링된 자동 재배치 움직임 벡터를 생성하고, 생성된 자동 재배치 움직임 벡터를 움직임 후보 리스트에 추가할 수 있다.
자동 재배치 움직임 벡터는 참조 픽쳐로부터 유도된다. 현재 블록을 위한 참조 픽쳐 리스트 내의 참조 픽쳐마다 움직임 정보가 저장되어야 한다. 메모리를 절약하기 위해, 인코더는 SPS, PPS, 슬라이스, 및 타일 중 적어도 어느 하나에서 움직임 정보를 저장할 참조 픽쳐가 어느 픽쳐인지 시그널링할 수 있다. 디코더는 SPS, PPS, 슬라이스, 및 타일 중 적어도 어느 하나에서 움직임 정보를 저장할 참조 픽쳐가 어느 픽쳐인지 나타내는 정보를 파싱할 수 있다. 비디오 신호 처리 장치는 파싱한 정보에 따라 움직임 정보를 저장하는 참조 픽쳐 판단할 수 있다. 또 다른 구체적인 실시 예에서 참조 픽쳐 리스트 내의 참조 픽쳐 중 움직임 정보를 저장할 참조 픽쳐가 미리 지정될 수 있다. 미리 지정된 참조 픽쳐는 참조 픽쳐 리스트 내에서 미리 지정된 참조 픽쳐 인덱스보다 작은 참조 픽쳐일 수 있다. 미리 지정된 참조 픽쳐 인덱스는 정수일 수 있다. 미리 지정된 참조 픽쳐 인덱스는 2 또는 3일 수 있다. 미리 지정된 참조 픽쳐 인덱스가 3인 경우, 비디오 신호 처리 장치는 참조 픽쳐 리스트 내의 참조 픽쳐 인덱스가 0, 1, 또는 2를 가지는 참조 픽쳐에서 움직임 정보가 저장된 것으로 판단할 수 있다. 또한, 비디오 신호 처리 장치는 참조 픽쳐 인덱스가 0, 1, 또는 2를 가지는 참조 픽쳐를 사용하여 자동 재배치 움직임 벡터를 유도할 수 있다. 이때, 비디오 신호 처리 장치는 자동 재배치 움직임 벡터를 사용하여 참조 블록을 유도하는데 참조 픽쳐 인덱스가 3인 참조 픽쳐를사용할 수 있다. 다만, 참조 픽쳐 인덱스가 3인 참조 픽쳐에 움직임 정보가 저장되어 있지 않기 때문에, 비디오 신호 처리 장치는 참조 픽쳐 인덱스가 3인 참조 픽쳐를 새로운 자동 재배치 움직임 벡터를 유도하는 용도로 사용하지 않을 수 있다.
도 85는 본 발명의 실시 예에 따른 비디오 신호 처리 장치가 블록 벡터를 유도하는 것을 보여준다.
비디오 신호 처리 장치는 현재 블록의 블록 벡터를 유도할 때, 주변 블록의 움직임 정보(MV)가 지시하는 참조 픽쳐의 참조 블록(Reference block A)으로부터 블록 벡터(BV)를 유도할 수 있다. 이때, 비디오 신호 처리 장치는 참조 블록의 블록 벡터를 이용하여 현재 블록의 블록 벡터를 유도할 수 있다. 또한, 비디오 신호 처리 장치는 유도된 현재 블록에 대한 블록 벡터(BV)를 현재 블록의 블록 벡터 후보 리스트에 추가될 수 있다. 이때, 비디오 신호 처리 장치는 블록 벡터 후보 리스트를 이용하여 현재 블록에 대한 최적의 블록 벡터를 결정할 수 있다. 또 다른 구체적인 실시 예에서 비디오 신호 처리 장치는 주변 블록의 움직임 정보가 지시하는 제1 참조 블록(Reference block A), 참조 픽쳐에서 참조 블록의 블록 벡터가 지시하는 제2 참조 블록(Reference block B), 및 유도된 블록 벡터가 지시하는 제3 참조 블록(Reference block C) 중 적어도 하나 이상을 이용하여 현재 블록을 예측할 수 있다. 구체적으로 비디오 신호 처리 장치는 제1 참조 블록(Reference block A), 제2 참조 블록(Reference block B), 및 제3 참조 블록(Reference block C) 중 적어도 2개 이상의 참조 블록을 가중 평균하여 현재 블록에 대한 예측 블록을 생성할 수 있다.
도 86은 본 발명의 실시 예에 따른 비디오 신호 처리 장치가 혼합 벡터를 이용하여 현재 블록을 예측하는 것을 보여준다.
비디오 신호 처리 장치는 혼합 벡터를 이용하여 현재 블록을 예측할 수 있다. 이때, 비디오 신호 처리 장치는 현재 블록을 위한 블록 벡터 정보와 현재 블록을 위한 움직임 정보의 조합으로 혼합 벡터를 획득할 수 있다. 혼합 벡터는 하나 이상 블록 벡터 정보와 하나 이상 움직임 정보를 포함할 수 있다. 움직임 정보는 단방향, 양방향, 또는 양예측으로 구성된 움직임 정보일 수 있다. 이때, 블록 벡터는 도 85를 통해 설명한 실시 예들을 통해 유도될 수 있다. 블록 벡터는 현재 블록을 위해 유도된 블록 벡터 후보 리스트의 블록 벡터 후보일 수 있다. 블록 벡터는 현재 블록의 주변 블록의 움직임 정보가 지시하는 참조 픽쳐의 참조 블록으로부터 유도되는 블록 벡터일 수 있다. 움직임 정보는 제2 참조 블록을 가리키는 움직임 정보일 수 있다. 제2 참조 블록은 현재 블록의 주변 블록의 움직임 정보가 지시하는 제1 참조 블록의 블록 벡터가 지시하는 참조 블록일 수 있다. 움직임 정보는 현재 블록의 시간적인 주변 블록의 블록 벡터가 지시하는 참조 블록의 움직임 정보일 수 있다. 비디오 신호 처리 장치는 블록 벡터 정보가 지시하는 블록 벡터와 움직임 정보가 지시하는 움직임 벡터를 가중 평균하여 혼합 벡터를 획득할 수 있다. 구체적으로 비디오 신호 처리 장치는 제1 움직임 벡터를 이용한 제1 예측 블록(Reference block A), 제2 움직임 벡터를 이용한 제2 예측 블록(Reference block A), 및 블록 벡터를 이용한 제3 예측 블록(Reference block C)을 가중 평균하여 현재 블록에 대한 예측 블록을 생성할 수 있다. 또 다른 구체적인 실시 예에서 비디오 신호 처리 장치는 2개의 블록 벡터를 이용한 2개의 예측 블록과 하나의 움직임 벡터를 이용한 예측 블록을 가중 평균하여 현재 블록에 대한 예측 블록을 생성할 수 있다. 비디오 신호 처리 장치는 혼합 벡터 후보 리스트를 이용하여 최적의 혼합 벡터가 결정할 수 있다. 이때, 혼합 벡터 후보 리스트는 후보 움직임 정보와 후보 블록 벡터를 포함할 수 있다. 또한, 혼합 벡터 후보 리스트의 후보는 움직임 정보와 블록 벡터의 조합일 수 있다. 또 다른 구체적인 실시 예에서 혼합 벡터 후보 리스트의 후보는 움직임 정보 후보와 블록 벡터 후보로 구별될 수 있다. 비디오 신호 처리 장치는 혼합 벡터 후보를 블록 벡터 정보, 움직임 정보, 및 블록 벡터 정보와 움직임 정보의 조합 정보 중 하나로 구성할 수 있다. 비디오 신호 처리 장치는 혼합 벡터 후보 리스트를 주변 블록으로부터 유도된 블록 벡터 정보와 주변 블록으로부터 유도된 움직임 정보의 조합으로 구성할 수 있다. 또한, 비디오 신호 처리 장치는 혼합 벡터 후보 리스트에 혼합 벡터를 이용하여 부호화된 주변 블록의 혼합 벡터를 혼합 벡터 후보로 추가할 수 있다. 비디오 신호 처리 장치는 현재 블록에 대한 혼합 벡터 후보 리스트를 구성할 때, 주변 블록의 부호화 모드에 따라 주변 블록의 정보를 혼합 벡터 후보로 사용할 지 결정할 수 있다. 이때, 주변 블록의 부호화 모드는 GPM, MHP, CIIP, IBC, Intra TMP, AMVP, Merge, AMVP-merge, Affine, OBMC, LIC, 및 BCW 중 적어도 어느 하나를 포함할 수 있다. 주변 블록의 부호화 모드가 RRIBC인 경우, 비디오 신호 처리 장치는 해당 블록의 블록 벡터, 움직임 정보, 혼합 벡터를 현재 블록의 혼합 벡터로 사용하지 않거나 또는 현재 블록에 대한 혼합 벡터 후보 리스트에 추가하지 않을 수 있다. 비디오 신호 처리 장치는 템플릿 코스트를 기초로 혼합 벡터 후보 리스트를 재정렬할 수 있다. 비디오 신호 처리 장치는 혼합 벡터를 이용한 블록 예측 방안을 블록 단위로, 적응적으로 수행할 수 있다. 인코더는 블록 별로 혼합 벡터가 적용되었는지 및 관련된 정보를 지시하는 정보를 비트스트림에 포함시킬 수 있다. 디코더는 블록 단위로 혼합 벡터 적용 여부에 관한 정보를 파싱하고, 현재 블록에 혼합 벡터를 적용할지 결정할 수 있다. 현재 블록에 혼합 벡터가 적용될 경우, 디코더는 인덱스 정보를 추가로 파싱할 수 있다. 디코더는 혼합 벡터 후보 리스트를 구성하고, 리스트에서 인덱스가 지시하는 혼합 후보를 현재 블록의 혼합 벡터로 사용할 수 있다. 또 다른 구체적인 실시 예에서 디코더는 인덱스 정보를 파싱하지 않고, 템플릿 코스트를 기초로 재정렬된 혼합 벡터 후보 리스트에서 템플릿 코스트가 최소인 혼합 후보를 현재 블록의 혼합 벡터로 사용할 수 있다.
픽쳐 내 유사한 패턴의 객체가 반복적으로 나타나는 경우, 블록 벡터 기반의 예측 기술이 효과적일 수 있다. 비디오 신호 처리 장치는 현재 블록을 여러 개의 서브 블록으로 분할할 수 있다. 분할된 서브 블록 중 적어도 하나 이상은 서로 다른 블록 벡터를 가질 수 있다. 비디오 신호 처리 장치는 블록 벡터(혹은 서브 블록 단위의 블록 벡터)를 통해 DMVR을 수행하여 보정된 블록 벡터를 생성할 수 있다. 이때, 비디오 신호 처리 장치는 2개 블록 벡터가 지시하는 현재 픽쳐 내 참조 블록 사이의 샘플 차이를 이용하여 DMVR을 수행할 수 있다. 2개 블록 벡터 중 첫 번째 블록 벡터는 블록 벡터 후보 리스트의 블록 벡터일 수 있다. 두 번째 블록 벡터는 첫 번째 블록 벡터를 이용하여 유도한 자동 재배치 블록 벡터 일 수 있다. 비디오 신호 처리 장치는 DMVR을 통해 보정된 블록 벡터를 이용하여 예측 블록을 생성할 수 있다. 비디오 신호 처리 장치는 DMVR을 통해 보정된 2개의 블록 벡터를 이용하여 획득한 예측 블록을 가중 평균하여 현재 블록에 대한 최종 예측 블록을 생성할 수 있다. 현재 블록이 BV 기반 부호화 모드(Intra TMP 혹은 IBC)이고 BV 기반 fusion 모드인 경우, 비디오 신호 처리 장치는 DMVR 기반 블록 벡터 보정 방법을 현재 블록에 적용할 수 있다. BV 기반 fusion 모드는 복수의 BV를 이용하여 예측한 블록들을 가중치 평균하여 하나의 예측 블록을 생성하는 모드이다. 또한, 비디오 신호 처리 장치는 블록 벡터(혹은 서브 블록 단위의 블록 벡터)를 통해 PROF 또는 BDOF을 수행하여, 현재 예측 블록에 대한 샘플 단위 오프셋 또는 서브 블록 단위 오프셋을 유도할 수 있다. 이를 통해 비디오 신호 처리 장치는 오프셋 기반으로 보정된 예측 블록(혹은 예측 샘플)을 생성할 수 있다. 비디오 신호 처리 장치가 BV를 이용하여 DMVR, PROF, BDOF 중 하나를 적용할 때, 비디오 신호 처리 장치는 블록 벡터 기반 LIC를 적용할 수 있다. BV를 이용하여 DMVR, PROF, 및 BDOF 중 어느 하나를 적용할 때, 비디오 신호 처리 장치는 블록 벡터 기반 LIC를 적용하지 않을 수 있다. 비디오 신호 처리 장치가 BV를 이용하여 DMVR, PROF, 및 BDOF 중 어느 하나를 적용할 때, 비디오 신호 처리 장치는 블록 벡터를 이용하여 예측된 블록에 필터링을 적용할 수 있다. 비디오 신호 처리 장치가 BV를 이용하여 DMVR, PROF, 및 BDOF 중 어느 하나를 적용할 때, 비디오 신호 처리 장치는 블록 벡터를 이용하여 예측된 블록에 필터링을 적용하지 않을 수 있다.
비디오 신호 처리 장치는 현재 블록의 혼합 벡터를 이용하여 DMVR를 수행하여 보정된 혼합 벡터를 생성할 수 있다. 구체적으로 비디오 신호 처리 장치는 제1 블록 벡터 정보를 이용한 제1 예측 블록의 좌상단 샘플 위치에 기초하여 미리 지정된 크기의 제1 탐색 영역을 설정하고, 제2 움직임 정보를 이용한 제2 예측 블록의 좌상단 샘플 위치에 기초하여 미리 지정된 크기의 제2 탐색 영역을 설정할 수 있다. 비디오 신호 처리 장치는 제1 탐색 영역과 제2 탐색 영역 내에서 제1 예측 블록과 제2 예측 블록의 위치를 변경해면서 제1 예측 블록과 제2 예측 블록 간의 유사도가 가장 높은 지점, 예컨대 제1 예측 블록의 좌상단 샘플 위치과 제2 예측 블록의 좌상단 샘플 위치를 찾을 수 있다. 비디오 신호 처리 장치는 유사도가 가장 높은 지점을 기초로 보정된 제1 블록 벡터 및 보정된 제2 움직임 정보를 획득할 수 있다. 미리 지정된 크기는 현재 블록의 가로 및 세로의 크기를 기초로 설정될 수 있다. 미리 지정된 가로의 크기는 M이고 미리 지정된 세로의 크기는 N이고, M과 N은 1이상의 정수일 수 있다. 또한, 비디오 신호 처리 장치는 현재 블록을 서브 블록으로 분할하여 각 서브 블록 단위로 DMVR을 수행할 수 있다. 비디오 신호 처리 장치는 서브 블록 단위의 보정된 블록 벡터, 보정된 움직임 정보를 생성할 수 있다. 현재 블록은 서브 블록 단위의 보정된 블록 벡터, 보정된 움직임 정보를 이용하여 현재 블록에 대한 예측 블록을 생성할 수 있다. 비디오 신호 처리 장치는 현재 블록의 혼합 벡터(블록 벡터와 움직임 정보의 조합)를 통해 BDOF를 수행하여 현재 예측 블록에 대한 샘플 단위 오프셋 또는 서브 블록 단위 오프셋을 유도할 수 있다. 이를 통해 비디오 신호 처리 장치는 오프셋 기반으로 보정된 예측 블록(혹은 예측 샘플)을 생성할 수 있다.
비디오 신호 처리 장치는 현재 블록의 가로 및 세로의 크기, 현재 블록의 부호화 모드에 따라 혼합 벡터 또는 혼합 벡터 후보 리스트의 허용(적용, 사용, 수행) 유무를 결정할 수 있다. 이때, 현재 블록의 부호화 모드는 GPM, MHP, CIIP, IBC, Intra TMP, AMVP, Merge, AMVP-merge, Affine, OBMC, LIC, 및 BCW 중 적어도 어느 하나를 포함할 수 있다. 비디오 신호 처리 장치는 현재 블록의 가로 및 세로 크기에 관한 조건에 따라 현재 블록에 혼합 벡터를 사용할지, 혼합 벡터 후보를 리스트를 이용하여 현재 블록에 대한 예측을 수행할 지, 또는 혼합 벡터 후보 리스트 구성을 수행할지 결정할 수 있다.
현재 블록의 부호화 모드가 RRIBC인 경우, 비디오 신호 처리 장치는 현재 블록에 혼합 벡터를 사용하지 않거나, 혼합 벡터 후보 리스트를 통한 예측을 수행하거나, 혼합 벡터 후보 리스트를 구성하지 않을 수 있다. 비디오 신호 처리 장치가 주변 블록의 블록 벡터 정보와 주변 블록의 움직임 정보 사이의 조합으로 혼합 벡터를 구성할 때, 비디오 신호 처리 장치는 각 주변 블록에 적용된 LIC 정보, Filtering 정보, 및 BCW 정보 중 적어도 하나 이상은 그대로 사용되거나 사용되지 않을 수 있다. 비디오 신호 처리 장치가 주변 블록의 블록 벡터 정보와 주변 블록의 움직임 정보 사이의 조합으로 혼합 벡터를 구성할 때, 비디오 신호 처리 장치는 각 주변 블록에 적용된 LIC 정보, Filtering 정보, 및 BCW 정보 중 적어도 하나 이상을 재설정할 수 있다. 비디오 신호 처리 장치는 재설정된 LIC 정보, Filtering 정보, 및 BCW 정보 중 적어도 하나 이상을 사용하여 현재 블록에 대한 예측 블록을 생성할 수 있다.
도 87은 본 명세서의 일 실시예에 따른 자동 재배치 움직임 벡터의 활성화 여부를 시그널링하는 방법을 나타낸다.
인코더는 혼합 벡터의 활성화 여부를 나타내는 플래그를 포함하는 비트스트림을 생성하여 시그널링할 수 있다. 디코더는 혼합 벡터의 활성화 여부를 나타내는 플래그를 파싱하여 혼합 벡터의 활성화 여부를 결정할 수 있다. 도 87을 참조하면 sps_mixed_vector_enabled_flag는 혼합 벡터의 활성화 여부를 나타내는 플래그일 수 있다. sps_mixed_vector_enabled_flag는 SPS에서 시그널링될 수 있다. 구체적으로 sps_mixed_vector_enabled_flag의 값이 1인 경우(즉, 참인 경우), sps_mixed_vector_enabled_flag는 혼합 벡터의 활성화를 나타낼 수 있다 비디오 신호 처리 장치는 움직임 후보 리스트를 구성하는 과정에서 혼합 벡터를 추가할 수 있다. sps_mixed_vector_enabled_flag의 값이 0인 경우(즉, 거짓인 경우) sps_mixed_vector_enabled_flag는 혼합 벡터의 비활성화를 나타낼 수 있다. sps_mixed_vector_enabled_flag가 파싱되지 않은 경우(비트스트림에 존재하지 않는 경우), sps_mixed_vector_enabled_flag의 값은 0으로 추론될 수 있다. 혼합 벡터의 활성화 여부를 나타내는 플래그는 SPS 뿐만 아니라 PPS, 서브픽쳐, 슬라이 및 타일 중 적어도 어느 하나의 레벨로 시그널링될 수 있다.
도 88은 본 명세서의 일 실시예에 따른 GCI 신택스 구조를 나타낸다.
본 발명의 실시 예에 따라른 GCI 신택스는 프로필 티어 레벨로호출될 수 있다. 프로필 티어 레벨 신택스는 시퀀스 파라미터 세트 RBSP 신택스, 비디오 파라미터 세트 RBSP 신택스, Decoding capability information RBSP 신택스에서 호출될 수 있다. GCI 신택스의 개별 신택스 요소는 시퀀스 파라미터 세트 RBSP 내에 신택스 요소와 대응될 수 있다. GCI 신택스의 개별 신택스 요소에 대응되는 플래그의 정의에 따라 시퀀스 파라미터 세트 RBSP 신택스 요소의 활성화 또는 비활성화 여부가 제한될 수 있다.
혼합 벡터 예측 관련 제한(constraint)을 지시하는 플래그를 gci_no_mixed_vector_constraint_flag로 지칭한다. gci_no_mixed_vector_constraint_flag 값이 1인 경우, gci_no_mixed_vector_constraint_flag는 전체 픽쳐에서 혼합 벡터의 사용이 허용되지 않음을 나타낼 수 있다. OlsScope 내 모든 픽쳐에서 sps_mixed_vector_enabled_flag의 값은 0으로 제한될 수 있다. gci_no_mixed_vector_constraint_flag 값이 0인 경우, gci_no_mixed_vector_constraint_flag는 전체 픽쳐에서 혼합 벡터의 사용이 금지되지 않음을 나타낼 수 있다. 이때, OlsScope 내 모든 픽쳐에서 sps_mixed_vector_enabled_flag의 값은 특정 값으로 제한되지 않을 수 있다.
본 명세서에서 비디오 신호 처리 장치가 현재 블록에 특정 방법을 적용하지 않는다는 의미는 다음과 같이 해석될 수 있다. 현재 블록에 특정 방법을 사용되는 것을 허용하지 않는다. 비디오 신호 처리 장치는 현재 블록에 특정 방법을 사용하지 않는다. 비디오 신호 처리 장치는 현재 블록에 특정 방법을 수행하지 않는다. 비디오 신호 처리 장치는 현재 블록에 특정 방법과 관련된 과정을 수행하지 않는다. 비디오 신호 처리 장치는 현재 블록에 대한 신택스를 파싱하는 과정에서 특정 방법과 관련된 신택스를 파싱하지 않는다. 비디오 신호 처리 장치는 현재 블록에 대한 신택스를 부호화하는 과정에서 특정 방법과 관련된 신택스를 시그널링하지 않고, 비트스트림에 포함시키지 않는다.
본 명세서에서 상술한 방법들은 디코더 또는 인코더의 프로세서를 통해 수행될 수 있다. 또한, 인코더는 상술한 방법들에 의해 디코딩되는 비트스트림을 생성할 수 있다. 또한, 인코더가 생성한 비트스트림은 컴퓨터 판독 가능한 비 일시적 저장 매체(기록 매체)에 저장될 수 있다.
본 명세서는 주로 디코더 관점에서 기술되었으나 인코더에서도 동일하게 동작될 수 있다. 본 명세서의 파싱이라는 용어는 비트스트림으로부터 정보를 획득하는 과정을 중점으로하여 설명되었으나 인코더 측면에서는 비트스트림에 해당 정보를 구성하는 것으로 해석될 수 있다. 따라서 파싱이라는 용어는 디코더 동작으로만 한정되지 않고 인코더에서는 비트스트림을 구성하는 행위로까지 해석될 수 있다. 또한, 이러한 비트스트림은 컴퓨터 판독 가능한 기록 매체에 저장되어 구성될 수 있다.
상술한 본 발명의 실시예들은 다양한 수단을 통해 구현될 수 있다. 예를 들어, 본 발명의 실시예들은 하드웨어, 펌웨어(firmware), 소프트웨어 또는 그것들의 결합 등에 의해 구현될 수 있다.
하드웨어에 의한 구현의 경우, 본 발명의 실시예들에 따른 방법은 하나 또는 그 이상의 ASICs(Application Specific Integrated Circuits), DSPs(Digital Signal Processors), DSPDs(Digital Signal Processing Devices), PLDs(Programmable Logic Devices), FPGAs(Field Programmable Gate Arrays), 프로세서, 컨트롤러, 마이크로 컨트롤러, 마이크로 프로세서 등에 의해 구현될 수 있다.
펌웨어나 소프트웨어에 의한 구현의 경우, 본 발명의 실시예들에 따른 방법은 이상에서 설명된 기능 또는 동작들을 수행하는 모듈, 절차 또는 함수 등의 형태로 구현될 수 있다. 소프트웨어 코드는 메모리에 저장되어 프로세서에 의해 구동될 수 있다. 상기 메모리는 프로세서의 내부 또는 외부에 위치할 수 있으며, 이미 공지된 다양한 수단에 의해 프로세서와 데이터를 주고받을 수 있다.
일부 실시예는 컴퓨터에 의해 실행되는 프로그램 모듈과 같은 컴퓨터에 의해 실행가능한 명령어를 포함하는 기록 매체의 형태로도 구현될 수 있다. 컴퓨터 판독 가능 매체는 컴퓨터에 의해 액세스될 수 있는 임의의 가용 매체일 수 있고, 휘발성 및 비휘발성 매체, 분리형 및 비분리형 매체를 모두 포함한다. 또한, 컴퓨터 판독 가능 매체는 컴퓨터 저장 매체 및 통신 매체를 모두 포함할 수 있다. 컴퓨터 저장 매체는 컴퓨터 판독가능 명령어, 데이터 구조, 프로그램 모듈 또는 기타 데이터와 같은 정보의 저장을 위한 임의의 방법 또는 기술로 구현된 휘발성 및 비휘발성, 분리형 및 비분리형 매체를 모두 포함한다. 통신 매체는 전형적으로 컴퓨터 판독가능 명령어, 데이터 구조 또는 프로그램 모듈과 같은 변조된 데이터 신호의 기타 데이터, 또는 기타 전송 메커니즘을 포함하며, 임의의 정보 전달 매체를 포함한다.
전술한 본 발명의 설명은 예시를 위한 것이며, 본 발명이 속하는 기술분야의 통상의 지식을 가진 자는 본 발명의 기술적 사상이나 필수적인 특징을 변경하지 않고서 다른 구체적인 형태로 쉽게 변형이 가능하다는 것을 이해할 수 있을 것이다. 그러므로 이상에서 기술한 실시예들은 모든 면에서 예시적인 것이며 한정적인 것이 아는 것으로 해석해야 한다. 예를 들어, 단일형으로 설명되어 있는 각 구성 요소는 분산되어 실시될 수도 있으며, 마찬가지로 분산된 것으로 설명되어 있는 구성 요소들도 결합된 형태로 실시될 수 있다.
본 발명의 범위는 상기 상세한 설명보다는 후술하는 특허청구범위에 의하여 나타내어지며, 특허청구범위의 의미 및 범위 그리고 그 균등 개념으로부터 도출되는 모든 변경 또는 변형된 형태가 본 발명의 범위에 포함되는 것으로 해석되어야 한다.

Claims (24)

  1. 비디오 신호 디코딩 장치에서,
    프로세서를 포함하며,
    상기 프로세서는
    현재 블록을 위한 블록 벡터와 현재 블록을 위한 움직임 정보를 기초로 혼합 벡터를 생성하고,
    상기 혼합 벡터를 사용하여 현재 블록에 대한 예측 블록을 생성하고
    비디오 신호 디코딩 장치.
  2. 제1항에서,
    상기 혼합 벡터는 상기 현재 블록을 위한 블록 벡터 정보가 지시하는 블록 벡터와 상기 현재 블록을 위한 움직임 정보가 지시하는 움직임 벡터를 포함하고,
    상기 프로세서는
    상기 블록 벡터를 기초로 제1 예측 블록을 획득하고 상기 움직임 벡터를 기초로 제2 예측 블록을 획득한 후, 제1 예측 블록과 제2 예측 블록을 가중 평균하여 상기 현재 블록에 대한 예측 블록을 생성하는
    비디오 신호 디코딩 장치.
  3. 제1항에서,
    상기 프로세서는
    상기 현재 블록의 제1 주변 블록으로부터 유도된 블록 벡터 정보와 상기 현 재 블록의 제2 주변 블록으로부터 유도된 움직임 정보로 혼합 벡터 리스트를 구성하고,
    상기 혼합 벡터 리스트로부터 상기 현재 블록을 위한 블록 벡터와 상기 현재 블록을 위한 움직임 정보를 획득하는
    비디오 신호 디코딩 장치.
  4. 제2항에서,
    상기 프로세서는
    상기 현재 블록의 주변 블록의 움직임 정보가 지시하는 참조 픽쳐의 참조 블록으로부터 블록 벡터를 유도하는
    비디오 신호 디코딩 장치.
  5. 제2항에서,
    상기 프로세서는
    상기 현재 블록의 주변 블록의 부호화 모드에 따라 상기 현재 블록의 주변 블록의 정보를 상기 혼합 벡터 후보 리스트의 후보로 사용할 지 결정하는
    비디오 신호 디코딩 장치.
  6. 비디오 신호 디코딩 장치에서,
    프로세서를 포함하며,
    상기 프로세서는
    현재 블록의 제1 움직임 정보를 사용하여 제1 예측 블록을 생성하고, 상기 현재 블록의 주변 블록과 상기 주변 블록으로부터 유도된 인트라 예측 모드를 사용하여 제2 예측 블록을 생성하고, 상기 제1 예측 블록과 상기 제2 예측 블록을 가중 평균하여 최종 예측 블록을 생성하는
    비디오 신호 디코딩 장치.
  7. 제6항에서,
    상기 프로세서는
    상기 주변 블록의 복원된 샘플을 이용하여 유도된 DIMD(decoder side intra mode derivation) 모드를 사용하여 상기 제2 예측 블록을 생성하는
    비디오 신호 디코딩 장치.
  8. 제6항에서,
    상기 프로세서는
    상기 제2 예측 블록을 생성할 때, 인트라 퓨젼을 사용하지 않는
    비디오 신호 디코딩 장치.
  9. 제6항에서,
    상기 프로세서는
    상기 제2 예측 블록을 생성할 때, PDPC(position dependent intra prediction combination)를 사용하지 않는
    비디오 신호 처리 장치.
  10. 제6항에서,
    상기 프로세서는
    상기 최종 예측 블록에 필터링을 수행하는
    비디오 신호 처리 장치.
  11. 비디오 신호 인코딩 장치에서,
    프로세서를 포함하며,
    상기 프로세서는
    현재 블록을 위한 블록 벡터와 현재 블록을 위한 움직임 정보를 기초로 혼합 벡터를 생성하고,
    상기 혼합 벡터를 사용하여 현재 블록에 대한 예측 블록을 생성하고
    비디오 신호 인코딩 장치.
  12. 제11항에서,
    상기 혼합 벡터는 상기 현재 블록을 위한 블록 벡터 정보가 지시하는 블록 벡터와 상기 현재 블록을 위한 움직임 정보가 지시하는 움직임 벡터를 포함하고,
    상기 프로세서는
    상기 블록 벡터를 기초로 제1 예측 블록을 획득하고 상기 움직임 벡터를 기초로 제2 예측 블록을 획득한 후, 제1 예측 블록과 제2 예측 블록을 가중 평균하여 상기 현재 블록에 대한 예측 블록을 생성하는
    비디오 신호 인코딩 장치.
  13. 제11항에서,
    상기 프로세서는
    상기 현재 블록의 제1 주변 블록으로부터 유도된 블록 벡터 정보와 상기 현 재 블록의 제2 주변 블록으로부터 유도된 움직임 정보로 혼합 벡터 리스트를 구성하고,
    상기 혼합 벡터 리스트로부터 상기 현재 블록을 위한 블록 벡터와 상기 현재 블록을 위한 움직임 정보를 획득하는
    비디오 신호 인코딩 장치.
  14. 제12항에서,
    상기 프로세서는
    상기 현재 블록의 주변 블록의 움직임 정보가 지시하는 참조 픽쳐의 참조 블록으로부터 블록 벡터를 유도하는
    비디오 신호 인코딩 장치.
  15. 제12항에서,
    상기 프로세서는
    상기 현재 블록의 주변 블록의 부호화 모드에 따라 상기 현재 블록의 주변 블록의 정보를 상기 혼합 벡터 후보 리스트의 후보로 사용할 지 결정하는
    비디오 신호 인코딩 장치.
  16. 비디오 신호 인코딩 장치에서,
    프로세서를 포함하며,
    상기 프로세서는
    현재 블록의 제1 움직임 정보를 사용하여 제1 예측 블록을 생성하고, 상기 현재 블록의 주변 블록과 상기 주변 블록으로부터 유도된 인트라 예측 모드를 사용하여 제2 예측 블록을 생성하고, 상기 제1 예측 블록과 상기 제2 예측 블록을 가중 평균하여 최종 예측 블록을 생성하는
    비디오 신호 인코딩 장치.
  17. 제16항에서,
    상기 프로세서는
    상기 주변 블록의 복원된 샘플을 이용하여 유도된 DIMD(decoder side intra mode derivation) 모드를 사용하여 상기 제2 예측 블록을 생성하는
    비디오 신호 인코딩 장치.
  18. 제16항에서,
    상기 프로세서는
    상기 제2 예측 블록을 생성할 때, 인트라 퓨젼을 사용하지 않는
    비디오 신호 인코딩 장치.
  19. 제16항에서,
    상기 프로세서는
    상기 제2 예측 블록을 생성할 때, PDPC(position dependent intra prediction combination)를 사용하지 않는
    비디오 신호 인코딩 장치.
  20. 제16항에서,
    상기 프로세서는
    상기 최종 예측 블록에 필터링을 수행하는
    비디오 신호 인코딩 장치.
  21. 비디오 신호 디코딩 장치의 동작 방법에서,
    현재 블록을 위한 블록 벡터와 현재 블록을 위한 움직임 정보를 기초로 혼합 벡터를 생성하는 단계; 및
    상기 혼합 벡터를 사용하여 현재 블록에 대한 예측 블록을 생성하는 단계를 포함하고
    동작 방법.
  22. 비디오 신호 디코딩 장치의 동작 방법은
    현재 블록의 제1 움직임 정보를 사용하여 제1 예측 블록을 생성하는 단계;
    상기 현재 블록의 주변 블록과 상기 주변 블록으로부터 유도된 인트라 예측 모드를 사용하여 제2 예측 블록을 생성하는 단계; 및 상기 제1 예측 블록과 상기 제2 예측 블록을 가중 평균하여 최종 예측 블록을 생성하는 단계를 포함하는
    동작 방법.
  23. 저장 매체에 포함되고, 비디오 신호를 포함하는 비트 스트림에서,
    비트 스트림을 생성하는 방법은
    현재 블록을 위한 블록 벡터와 현재 블록을 위한 움직임 정보를 기초로 혼합 벡터를 생성하는 단계; 및
    상기 혼합 벡터를 사용하여 현재 블록에 대한 예측 블록을 생성하는 단계를 포함하는
    비트 스트림.
  24. 저장 매체에 포함되고, 비디오 신호를 포함하는 비트 스트림에서,
    비트 스트림을 생성하는 방법은
    현재 블록의 제1 움직임 정보를 사용하여 제1 예측 블록을 생성하는 단계;
    상기 현재 블록의 주변 블록과 상기 주변 블록으로부터 유도된 인트라 예측 모드를 사용하여 제2 예측 블록을 생성하는 단계; 및 상기 제1 예측 블록과 상기 제2 예측 블록을 가중 평균하여 최종 예측 블록을 생성하는 단계를 포함하는
    비트 스트림.
PCT/KR2025/010290 2024-07-23 2025-07-14 비디오 신호 처리 방법 및 이를 위한 장치 Pending WO2026023972A1 (ko)

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
KR20240097257 2024-07-23
KR10-2024-0097257 2024-07-23
KR10-2024-0162317 2024-11-14
KR20240162317 2024-11-14

Publications (1)

Publication Number Publication Date
WO2026023972A1 true WO2026023972A1 (ko) 2026-01-29

Family

ID=98566121

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/KR2025/010290 Pending WO2026023972A1 (ko) 2024-07-23 2025-07-14 비디오 신호 처리 방법 및 이를 위한 장치

Country Status (1)

Country Link
WO (1) WO2026023972A1 (ko)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20170023086A (ko) * 2014-06-19 2017-03-02 브이아이디 스케일, 인크. 블록 벡터 도출을 이용하여 인트라 블록 복사 코딩을 위한 방법 및 시스템
KR20190107581A (ko) * 2018-03-12 2019-09-20 한국전자통신연구원 인트라 예측 모드의 유도를 위한 방법 및 장치
WO2023055172A1 (ko) * 2021-10-01 2023-04-06 엘지전자 주식회사 Ciip 기반 예측 방법 및 장치
KR20240090216A (ko) * 2021-10-01 2024-06-21 주식회사 윌러스표준기술연구소 참조 픽쳐를 기초로 인트라 예측 모드를 결정하는 비디오 신호 처리 방법 및 이를 위한 장치
KR20240112882A (ko) * 2022-01-04 2024-07-19 엘지전자 주식회사 Dimd 모드 기반 인트라 예측 방법 및 장치

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20170023086A (ko) * 2014-06-19 2017-03-02 브이아이디 스케일, 인크. 블록 벡터 도출을 이용하여 인트라 블록 복사 코딩을 위한 방법 및 시스템
KR20190107581A (ko) * 2018-03-12 2019-09-20 한국전자통신연구원 인트라 예측 모드의 유도를 위한 방법 및 장치
WO2023055172A1 (ko) * 2021-10-01 2023-04-06 엘지전자 주식회사 Ciip 기반 예측 방법 및 장치
KR20240090216A (ko) * 2021-10-01 2024-06-21 주식회사 윌러스표준기술연구소 참조 픽쳐를 기초로 인트라 예측 모드를 결정하는 비디오 신호 처리 방법 및 이를 위한 장치
KR20240112882A (ko) * 2022-01-04 2024-07-19 엘지전자 주식회사 Dimd 모드 기반 인트라 예측 방법 및 장치

Similar Documents

Publication Publication Date Title
WO2020060376A1 (ko) 인터 예측을 기반으로 비디오 신호를 처리하기 위한 방법 및 장치
WO2020067835A1 (ko) 어파인 예측을 이용하여 비디오 신호를 처리하기 위한 방법 및 장치
WO2023277535A1 (ko) 인트라 예측을 이용한 비디오 신호 처리 방법 및 이를 위한 장치
WO2023033486A1 (ko) 비디오 신호 처리 방법 및 이를 위한 장치
WO2019078686A1 (ko) 영상 부호화/복호화 방법, 장치 및 비트스트림을 저장한 기록 매체
WO2024058637A1 (ko) 비디오 신호 처리 방법 및 이를 위한 장치
WO2020005046A1 (ko) 영상 부호화/복호화 방법 및 장치
WO2023043296A1 (ko) Obmc를 이용한 비디오 신호 처리 방법 및 이를 위한 장치
WO2023182781A1 (ko) 템플릿 매칭에 기초한 비디오 신호 처리 방법 및 이를 위한 장치
WO2023055220A1 (ko) 참조 픽쳐를 기초로 인트라 예측 모드를 결정하는 비디오 신호 처리 방법 및 이를 위한 장치
WO2024155170A1 (ko) 비디오 신호 처리 방법 및 이를 위한 장치
WO2024091002A1 (ko) 비디오 신호 처리 방법 및 이를 위한 장치
WO2024053987A1 (ko) 기하학적 분할을 이용하는 비디오 신호 처리 방법 및 이를 위한 장치
WO2023140635A1 (ko) 경계 밖 블록을 이용하는 비디오 신호 처리 방법 및 이를 위한 장치
WO2023080691A1 (ko) 비디오 신호 처리 방법 및 이를 위한 장치
WO2020060374A1 (ko) 어파인 예측을 이용하여 비디오 신호를 처리하기 위한 방법 및 장치
WO2024155106A1 (ko) 비디오 신호 처리 방법 및 이를 위한 장치
WO2024039209A1 (ko) 비디오 신호 처리 방법 및 이를 위한 장치
WO2023171912A1 (ko) 비디오 프레임 경계에서의 예측블록 생성
WO2026023972A1 (ko) 비디오 신호 처리 방법 및 이를 위한 장치
WO2025084867A1 (ko) 비디오 신호 처리 방법 및 이를 위한 장치
WO2025071364A1 (ko) 움직임 시프트를 이용한 비디오 신호 처리 방법 및 이를 위한 장치
WO2025258912A1 (ko) 비디오 신호 처리 방법 및 이를 위한 장치
WO2026059323A1 (ko) 비디오 신호 처리 방법 및 이를 위한 장치
WO2026005507A1 (ko) 비디오 신호 처리 방법 및 이를 위한 장치

Legal Events

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

Ref document number: 25845068

Country of ref document: EP

Kind code of ref document: A1