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

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

Info

Publication number
WO2025258912A1
WO2025258912A1 PCT/KR2025/007668 KR2025007668W WO2025258912A1 WO 2025258912 A1 WO2025258912 A1 WO 2025258912A1 KR 2025007668 W KR2025007668 W KR 2025007668W WO 2025258912 A1 WO2025258912 A1 WO 2025258912A1
Authority
WO
WIPO (PCT)
Prior art keywords
block
mode
current block
prediction
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/007668
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 WO2025258912A1 publication Critical patent/WO2025258912A1/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/12Selection from among a plurality of transforms or standards, e.g. selection between discrete cosine transform [DCT] and sub-band transform or selection between H.263 and H.264
    • H04N19/122Selection of transform size, e.g. 8x8 or 2x4x8 DCT; Selection of sub-band transforms of varying structure or type
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/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/124Quantisation
    • 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/13Adaptive entropy coding, e.g. adaptive variable length coding [AVLC] or context adaptive binary arithmetic coding [CABAC]
    • 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/14Coding unit complexity, e.g. amount of activity or edge presence estimation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/60Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding
    • H04N19/61Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding in combination with predictive coding
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/60Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding
    • H04N19/625Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding using discrete cosine transform [DCT]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/60Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding
    • H04N19/63Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding using sub-band based transform, e.g. wavelets
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/70Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by syntax aspects related to video coding, e.g. related to compression standards
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/85Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using pre-processing or post-processing specially adapted for video compression
    • H04N19/86Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using pre-processing or post-processing specially adapted for video compression involving reduction of coding artifacts, e.g. of blockiness

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.
  • the present specification provides a video signal processing method and a device therefor.
  • the video signal decoding device includes a processor.
  • the processor obtains smoothing filtering information indicating whether smoothing filtering is disabled from the video signal, and determines whether smoothing filtering is applied in intra prediction based on the smoothing filtering information at a predetermined level, thereby predicting the current block.
  • the above smoothing filtering may include filtering on reference samples used for the intra prediction.
  • the above smoothing filtering may include PDPC.
  • the above smoothing filtering may include intra fusion.
  • the above pre-specified level may be SPS.
  • the above smoothing filtering may include a plurality of functions, and the above smoothing filtering information may include a plurality of flags indicating whether to disable each of the plurality of functions.
  • the processor may determine whether to use an integer-unit interpolation method that interpolates using only integer-unit samples based on the smoothing filtering information.
  • the processor may determine, when restoring the current block, whether to perform blending to generate a final prediction block by weighting and averaging multiple prediction blocks based on the smoothing filtering information.
  • the processor may determine that the current block does not have a residual signal if the current block is encoded in a pre-specified mode.
  • a video signal encoding device includes a processor.
  • the processor sets smoothing filtering information indicating whether smoothing filtering is disabled and includes the filtering information in the video signal. Based on the smoothing filtering information at a predetermined level, whether smoothing filtering is applied in intra prediction is determined, thereby predicting the current block.
  • the above smoothing filtering may include filtering on reference samples used for the intra prediction.
  • the above smoothing filtering may include PDPC.
  • the above smoothing filtering may include intra fusion.
  • the above pre-specified level may be SPS.
  • the above smoothing filtering may include a plurality of functions, and the above smoothing filtering information may include a plurality of flags indicating whether to disable each of the plurality of functions.
  • the processor can encode the current block so that it does not have a residual signal when the current block is encoded in a pre-specified mode.
  • a computer-readable non-transitory storage medium storing a bitstream comprises a step of setting smoothing filtering information indicating whether smoothing filtering is disabled; and a step of including the filtering information in the video signal. Based on the smoothing filtering information at a predetermined level, whether smoothing filtering is applied in intra prediction is determined, and the current block is predicted.
  • An operating method of a video signal decoding device includes the steps of: obtaining smoothing filtering information indicating whether smoothing filtering is disabled from the video signal; and determining whether smoothing filtering is applied in intra prediction based on the smoothing filtering information at a predetermined level to predict a current 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.
  • Figure 4 illustrates one embodiment of a method for signaling the splitting of a quad tree and a multi-type tree.
  • FIGS 5 and 6 illustrate the intra prediction method according to an embodiment of the present invention in more detail.
  • Figure 7 is a diagram showing the locations of surrounding blocks used to construct a motion candidate list in inter prediction.
  • FIG. 8 illustrates a method for determining a reference pixel line based on a template according to one embodiment of the present specification.
  • FIG. 9 is a diagram illustrating a block vector related to an IBC encoding method according to one embodiment of the present specification.
  • 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.
  • FIG. 12 illustrates a block vector of a block encoded in Intra TMP mode according to one embodiment of the present specification.
  • 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.
  • FIG. 14 illustrates how a current block is encoded in IBC-CIIP mode according to one embodiment of the present specification.
  • 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.
  • FIG. 16 illustrates types of transform kernels that can be used in video coding 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 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.
  • 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.
  • FIG. 24 illustrates block boundaries and samples around the boundaries in a deblocking filtering process according to one embodiment of the present specification.
  • FIG. 25 is a diagram illustrating a process of generating a prediction block using DIMD (Decoder side intra mode derivation) according to one embodiment of the present invention.
  • DIMD Decoder side intra mode derivation
  • FIG. 26 is a diagram showing the locations of surrounding pixels used to derive directional information according to one embodiment of the present invention.
  • FIG. 27 is a diagram illustrating a method for mapping directional modes according to one embodiment of the present invention.
  • FIG. 28 is a diagram showing a histogram for deriving an intra prediction directional mode according to one embodiment of the present invention.
  • 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. 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.
  • 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.
  • FIG. 33 illustrates a method for predicting a sample using a plurality of reference pixel lines according to one embodiment of the present invention.
  • 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.
  • FIG. 35 illustrates a method for generating prediction samples using a planar mode according to one embodiment of the present invention.
  • Figure 36 illustrates an intra prediction mode based on an extrapolation filter according to one embodiment of the present invention.
  • 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.
  • Figure 40 illustrates a method of using a candidate list based on a prediction mode according to one embodiment of the present invention.
  • Figure 41 shows reference sample filtering according to an embodiment of the present invention.
  • Figure 42 shows PDPC filtering according to an embodiment of the present invention.
  • Figure 43 shows a gradient PDPC according to an embodiment of the present invention.
  • FIG. 44 illustrates a method for signaling in SPS whether reference sample filtering and PDPC and intra fusion are enabled according to an embodiment of the present invention.
  • Figure 45 shows how constraints on smoothing filter information are set in the general_constraint_info() syntax.
  • Figure 46 shows an interpolation method when generating intra prediction samples according to an embodiment of the present invention.
  • Figure 47 shows a matrix-based intra prediction method according to an embodiment of the present invention.
  • FIG. 48 shows a peripheral sample used in DIMD chroma mode according to an embodiment of the present invention.
  • FIG. 49 shows a video signal processing device according to an embodiment of the present invention deriving a reference sample line from a chrominance block.
  • FIG. 50 shows a video signal processing device according to an embodiment of the present invention deriving a DIMD mode from a reference block derived based on a BV (block vector).
  • '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 captured image is an interlace image
  • one frame is divided into an odd (or odd, top) field and an even (or even, bottom) field, and each field is configured as one picture unit and can be encoded or decoded.
  • the captured image is a progressive image
  • one frame is configured as a picture and can be encoded or decoded.
  • the terms 'error signal', 'residual signal', 'residual signal', 'residual signal', and 'differential signal' may be used interchangeably.
  • 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.
  • POC Picture Order Count
  • 'left', 'upper left', 'upper left', 'upper right', 'right', 'lower right', 'lower left', and 'lower left' can be used interchangeably with 'left', 'upper left', 'top', 'upper right', 'right', 'lower right', 'bottom', and 'lower left'.
  • element and member can be used interchangeably with each other.
  • POC Picture Order Count
  • 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.
  • FIG. 1 is a schematic block diagram of a video signal encoding device (100) according to one embodiment of the present specification.
  • the encoding device (100) of the present invention includes a transform unit (110), a quantization unit (115), an inverse quantization unit (120), an inverse transform unit (125), a filtering unit (130), a prediction unit (150), and an entropy coding unit (160).
  • 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.
  • 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
  • the quantization unit (115) quantizes the transformation coefficient value output from the transformation unit (110).
  • 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.
  • the filtering unit (130) performs a filtering operation to improve the quality of the restored picture and enhance the coding efficiency.
  • a deblocking filter For example, a sample adaptive offset (SAO), and an adaptive loop filter may be included.
  • the filtered picture is stored in the Decoded Picture Buffer (DPB, 156) to be output or used as a reference picture.
  • DPB Decoded Picture Buffer
  • 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.
  • 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.
  • 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 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 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
  • 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 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.
  • 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 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 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.
  • 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.
  • 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.
  • 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 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 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.
  • 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.
  • the coding unit can be divided into multiple sub-blocks, and the prediction information of each sub-block can be the same or different.
  • 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 through a sub-block index (sbIdx).
  • the motion vector of the current block is likely to be similar to that of the surrounding blocks. Therefore, the motion vectors of the surrounding blocks can be used as motion vector predictors (mvp), and the motion vector of the current block can be derived using the motion vectors of the surrounding blocks. Furthermore, to improve the accuracy of the motion vector, the difference in motion vectors (mvd) between the optimal motion vector of the current block, found from the original image by the encoder, and the motion predictor can be signaled.
  • mvp motion vector predictors
  • Motion vectors can have various resolutions, and the resolution of motion vectors can vary on a block-by-block basis.
  • Motion vector resolution can be expressed in integer units, half-pixel units, quarter-pixel units, sixteenth-pixel units, and integer-4 pixel units. Since images such as screen content are in simple graphical forms such as characters, interpolation filters do not need to be applied, integer units and integer-4 pixel units can be selectively applied on a block-by-block basis.
  • Blocks encoded in affine mode which can express rotation and scale, have significant shape changes, so integer units, quarter-pixel units, and sixteenth-pixel units can be selectively applied on a block-by-block basis.
  • Information on whether to selectively apply motion vector resolution on a block-by-block basis is signaled with amvr_flag. If applicable, which motion vector resolution to apply to the current block is signaled with amvr_precision_idx.
  • the weights between the two prediction blocks can be applied equally or differently when applying weighted average, and information about the weights is signaled through bcw_idx.
  • the Merge method configures the motion information of the current block to be identical to the motion information of the adjacent blocks to the current block, and has the advantage of increasing the encoding efficiency of the motion information by spatially propagating the motion information without change in the homogeneous motion region.
  • the AMVP method predicts motion information in the L0 and L1 prediction directions respectively to express accurate motion information and signals the most optimal motion 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.
  • 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 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.
  • 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).
  • Such information can be expressed as a variable value, and information about the variable value can be included in the bitstream. That is, the decoder can determine whether the above-described methods are applied by parsing information about the variable value included in the bitstream. For example, whether the above-described methods are applied can be determined based on the horizontal length or the vertical length of the coding unit. The above-described methods can be applied if the horizontal or vertical length is 32 or more (e.g., 32, 64, 128, etc.). In addition, the above-described methods can be applied if the horizontal or vertical length is less than 32 (e.g., 2, 4, 8, 16). In addition, the above-described methods can be applied if the horizontal or vertical length is 4 or 8.
  • 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 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.
  • Another vector quantization method is trellis-coded quantization, which 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-stortion.
  • 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.
  • the intra prediction modes ⁇ 3, 4, 5, 6, 7, 8 ⁇ may be remapped (mapped) to ⁇ 67, 68, 69, 70, 71, 72 ⁇ , respectively.
  • the intra prediction mode may be reset to a value obtained by adding '65' to the intra prediction mode.
  • the intra prediction mode may be reset to a value obtained by subtracting '67' from the intra prediction mode.
  • 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 transform 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 block may vary depending on the distance between the surrounding block and the current block. The closer the distance between the surrounding block and the current block, the higher the histogram frequency value. Furthermore, the farther the distance between the surrounding block and the current block, the lower the histogram frequency value. For example, a value obtained by subtracting the distance between the surrounding block and the current block from the histogram frequency value for the intra prediction mode derived from the surrounding block (the product of the horizontal and vertical lengths of the surrounding block (or the sum of the horizontal and vertical lengths of the surrounding block)) 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 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 the 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, thereby deriving 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 implicitly 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 C excluding the planar mode, the number of Secondary MPM lists can be D, and the number of Non-MPM lists can be E. In this case, C can be 5, D can be 16, and E can be 45.
  • the number of Primary MPM lists can be F excluding the planar mode, the number of Secondary MPM lists can be G, and the number of Non-MPM lists can be H. In this case, F can be 8, G can be 32, and H can be 91.
  • 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 an 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 illustrates a method for signaling in SPS whether reference sample filtering and PDPC and intra fusion are enabled according to an embodiment of the present invention.
  • smoothing filter information can be set on a per-SPS basis.
  • the smoothing filter information can include at least one of a first flag indicating whether reference sample filtering is disabled on a per-SPS basis, a second flag indicating whether PDPC is disabled on a per-SPS basis, and a third flag indicating whether intra-fusion is disabled on a per-SPS basis.
  • the first flag is referred to as sps_ref_filter_disabled_flag
  • the second flag is referred to as sps_pdpc_disabled_flag
  • the third flag is referred to as sps_intra_fusion_disabled_flag.
  • sequence parameter set included for each sequence includes sps_ref_filter_disabled_flag, sps_pdpc_disabled_flag, and sps_intra_fusion_disabled_flag.
  • the decoder may not perform reference sample filtering within the sequence corresponding to the SPS, regardless of the coding mode of the current block, the size of the current block, and whether the current block is a luma block or a chroma block. If sps_ref_filter_disabled_flag indicates that reference sample filtering is not disabled, the decoder may determine whether to apply reference sample filtering to the current block based on the coding mode of the current block, the size of the current block, and whether the current block is a luma block or a chroma block.
  • sps_ref_filter_disabled_flag may indicate that reference sample filtering is disabled within the sequence corresponding to the SPS.
  • sps_ref_filter_disabled_flag can indicate that reference sample filtering is not disabled within the sequence corresponding to the SPS.
  • the encoder can set the value of sps_ref_filter_disabled_flag depending on whether reference sample filtering is disabled within the sequence corresponding to the SPS.
  • the decoder may not perform PDPC within the sequence corresponding to the SPS, regardless of the intra prediction directional mode of the current block, the size of the current block, and whether the current block is a luma block or a chroma block. If sps_pdpc_disabled_flag indicates that PDPC is not disabled, the decoder may determine whether to apply PDPC to the current block based on the intra prediction directional mode of the current block, the size of the current block, and whether the current block is a luma block or a chroma block.
  • sps_ref_filter_disabled_flag may indicate that PDPC is disabled within the sequence corresponding to the SPS. If the value of sps_pdpc_disabled_flag is 0, sps_ref_filter_disabled_flag can indicate that PDPC is not disabled within the sequence corresponding to the SPS. In addition, the encoder can set the value of sps_ref_filter_disabled_flag depending on whether PDPC is disabled within the sequence corresponding to the SPS.
  • the decoder may not perform intra fusion within the sequence corresponding to the SPS, regardless of the intra prediction directional mode of the current block, the size of the current block, and whether the current block is a luma block or a chroma block. If sps_intra_fusion_disabled_flag indicates that intra fusion is not disabled, the decoder may determine whether to apply intra fusion to the current block based on the intra prediction directional mode of the current block, the size of the current block, and whether the current block is a luma block or a chroma block.
  • sps_intra_fusion_disabled_flag may indicate that intra fusion is disabled within the sequence corresponding to the SPS.
  • sps_intra_fusion_disabled_flag can indicate that intra fusion is not disabled within the sequence corresponding to the SPS.
  • the encoder can set the value of sps_ref_filter_disabled_flag depending on whether intra fusion is disabled within the sequence corresponding to the SPS.
  • the decoder can infer that the smoothing filter information indicates that the smoothing filter is enabled. For example, if the sps_ref_filter_disabled_flag does not exist in the SPS, the decoder can infer the value of sps_ref_filter_disabled_flag as 0. In addition, if the sps_pdpc_disabled_flag does not exist in the SPS, the decoder can infer the value of sps_pdpc_disabled_flag as 0. In addition, if the sps_ intra_fusion_disabled_flag does not exist in the SPS, the decoder can infer the value of sps_ intra_fusion_disabled_flag as 0.
  • the smoothing filter information described above can be used to set constraints on smoothing filtering at predefined levels.
  • constraints on smoothing filter information can be set via GCI. This is described in Figure 45.
  • Figure 45 shows the constraints on smoothing filter information being set in the general_constraint_info() syntax.
  • the smoothing filter information may include at least one of a first constraint flag constraining whether to disable reference sample filtering, a second constraint flag constraining whether to disable PDPC, and a third constraint flag constraining whether to disable intra-fusion.
  • the first constraint flag is referred to as gci_no_ref_filter_constraint_flag
  • the second constraint flag is referred to as gci_no_pdpc_constraint_flag
  • the third constraint flag is referred to as gci_no_intra_fusion_constraint_flag.
  • Figure 45 shows that GCI includes gci_no_ref_filter_constraint_flag, gci_no_pdpc_constraint_flag, and gci_no_intra_fusion_constraint_flag.
  • the general_constraint_info() syntax can be called from the profile_tier_level() syntax.
  • the profile_tier_level() syntax can be called from the SPS, VPS, and Decoding capability information.
  • Each syntax element of the general_contraint_info() syntax can correspond to a syntax element in the SPS. Whether a syntax element in the SPS is disabled can be determined based on each syntax element of the general_contraint_info() syntax.
  • the decoder can determine whether a syntax element in the SPS is disabled based on the general_contraint_info() syntax.
  • the video signal processing device must set the value of sps_ref_filter_disabled_flag to 0 for all pictures existing in OlsScope. In this way, by setting the value of gci_no_ref_filter_constraint_flag to 1, you can force the activation of reference sample filtering. If the value of gci_no_ref_filter_constraint_flag is 0, the value of sps_ref_filter_disabled_flag is not forced to 0.
  • the video signal processing device must set the value of sps_ref_filter_disabled_flag to 1 for all pictures existing in OlsScope. In this way, by setting the value of gci_ref_filter_constraint_flag to 1, you can force the disabling of reference sample filtering. If the value of gci_ref_filter_constraint_flag is 0, the value of sps_ref_filter_disabled_flag is not forced to 1.
  • PDPC related constraint flag can be gci_no_pdpc_constraint_flag.
  • the video signal processing device must set the value of sps_pdpc_disabled_flag to 0 for all pictures existing in OlsScope. In this way, the activation of PDPC can be forced by setting the value of gci_no_pdpc_constraint_flag to 1. If the value of gci_no_pdpc_constraint_flag is 0, the value of sps_pdpc_disabled_flag is not forced to 0.
  • the video signal processing device must set the value of sps_pdpc_disabled_flag to 1 for all pictures existing in OlsScope. In this way, PDPC disabling can be forced by setting the value of gci_pdpc_constraint_flag to 1. If the value of gci_pdpc_constraint_flag is 0, the value of sps_pdpc_disabled_flag is not forced to 1.
  • the intra-fusion related constraint flag can be gci_no_intra_fusion_constraint_flag.
  • the video signal processing device must set the value of sps_intra_fusion_disabled_flag to 0 for all pictures existing in OlsScope.
  • the activation of the intra fusion method can be forced by setting the value of gci_no_intra_fusion_constraint_flag to 1. If the value of gci_no_intra_fusion_constraint_flag is 0, the value of sps_intra_fusion_disabled_flag is not forced to 0.
  • the video signal processing device must set the value of sps_intra_fusion_disabled_flag to 1 for all pictures existing in OlsScope.
  • the intra-fusion method can be forced to be disabled by setting the value of gci_intra_fusion_constraint_flag to 1. If the value of gci_intra_fusion_constraint_flag is 0, the value of sps_intra_fusion_disabled_flag is not forced to 1.
  • constraints related to GCI smoothing filter information were described as forcing the smoothing filter information to be disabled.
  • constraints related to GCI smoothing filter information may force the smoothing filter information not to be disabled.
  • a value of each constraint flag of 1 may indicate that the constraint regarding smoothing filter information is applied.
  • a bitstream may consist of one or more coded video sequences (CVSs). Each CVS is encoded independently of the other CVSs.
  • a CVS may consist of one or more layers. For each layer, quality, resolution, depth map, and transparency map may be set.
  • a coded layer video sequence (CLVS) represents a layer-wise CVS composed of consecutive PUs in decoding order within a layer. For example, there may be a CLVS for a layer with a specific quality, and a separate CLVS for a depth map.
  • the encoder can set smoothing filter information on a picture or slice basis.
  • the decoder can determine whether to disable the smoothing filter on a picture or slice basis based on the smoothing filter information.
  • a flag indicating whether to disable reference sample filtering on a picture basis can be referred to as ph_ref_filter_disable_flag.
  • a flag indicating whether to disable pdpc on a picture basis can be referred to as ph_pdpc_disable_flag.
  • a flag indicating whether to disable intra fusion on a picture basis can be referred to as ph_intra_fusion _disable_flag.
  • a flag indicating whether to disable reference sample filtering on a slice basis can be referred to as sh_ref_filter_disable_flag.
  • a flag indicating whether to disable pdpc on a slice basis can be referred to as sh_pdpc_disable_flag.
  • a flag indicating whether to disable intra fusion on a slice basis can be referred to as sh_intra_fusion _disable_flag.
  • a video signal processing device can determine whether to apply a smoothing filter on a block-by-block basis. At this time, the video signal processing device can implicitly determine whether to disable the smoothing filter on a block-by-block basis. Specifically, the video signal processing device can determine whether to disable the smoothing filter on a block-by-block basis by using at least one or more of whether the encoding mode of the current block and/or the surrounding blocks is a pre-specified encoding mode, whether the current block is a luminance block or a chrominance block, the intra prediction directional mode of the current block, the horizontal and vertical sizes of the current block, and the reference sample line information of the current block.
  • the video signal processing device may not use smoothing filtering for the current block.
  • the first condition may be that DIMD is applied to the current block and the DIMD blending mode is not applied.
  • the second condition may be that TIMD is applied to the current block and the TIMD blending mode is not applied.
  • the third condition may be that OBIC is applied to the current block and the OBIC blending mode is not applied.
  • the fourth condition may be that the encoding mode of the current block is not any one of Intra TMP, IBC, BDPCM, Palette mode, MIP, EIP, SGPM, TMRL, ISP, and PDP.
  • the video signal processing device may use smoothing filtering for the current block.
  • the first condition may be that DIMD is applied to the current block and the DIMD blending mode is applied.
  • the second condition may be that TIMD is applied to the current block and the TIMD blending mode is applied.
  • the third condition may be that OBIC is applied to the current block and the OBIC blending mode is applied.
  • the fourth condition may be that the encoding mode of the current block is any one of Intra TMP, IBC, BDPCM, Palette mode, MIP, EIP, SGPM, TMRL, ISP, and PDP.
  • the video signal processing device may not perform smoothing filtering on the current block.
  • the video signal processing device may not perform smoothing filtering on the current block.
  • Smoothing filtering may include smoothing filtering used when predicting a template in a prediction using template prediction.
  • Prediction using template prediction may include at least one of a candidate mode reordering in the DIMD, TIMD, DIMD, SGPM, GPM, and MPM lists.
  • the video signal processing device may apply smoothing filtering. Specifically, when selecting an optimal mode among the planar mode and the IBC and Intra TMP-based block vector modes in the DIMD and TIMD modes, the video signal processing device may apply a smoothing filter when predicting the template. Accordingly, when the encoder and decoder do not perform smoothing filtering according to the embodiments described above, the video signal processing device may not perform smoothing filtering in template prediction.
  • the video signal processing device may not perform smoothing filtering on the current block.
  • These embodiments may be applied when smoothing filtering is not disabled in units larger than a block, such as SPS, PPS, pictures, and slices. In another specific embodiment, these embodiments may be used when a decoder determines whether to finally disable smoothing filtering when indicating that smoothing filtering is disabled in units larger than a block, such as SPS, PPS, pictures, and slices.
  • a video signal processing device may implicitly apply the embodiment of determining whether to disable a smoothing filter on a block-by-block basis only when the smoothing filter can be disabled based on whether the smoothing filter is enabled or disabled in units larger than a block. In this case, the video signal processing device may determine whether to finally disable the smoothing filter on a block-by-block basis.
  • screen content images can contain a relatively large number of edge components. Therefore, an interpolation method for reference samples that takes into account the characteristics of screen content images is required for intra prediction.
  • the video signal processing device can use integer unit sample values for intra prediction without performing an interpolation method when generating an intra prediction block.
  • the video signal processing device predicts a sample within the current block from a reference sample using the intra prediction directional mode of the current block.
  • the position indicated by the intra prediction directional mode can be a point between integer unit reference samples ('1' in (b) of FIG. 46). In this situation, the video signal processing device can predict a sample within the current block using the integer unit sample closest to the '1' position without using an interpolation method.
  • a video signal processing device may derive a reference sample position in decimal sample units by using at least one of the horizontal and vertical sizes of the current block, an intra prediction directional mode, a position of a reference sample line, and a vertical and horizontal position of a sample to be predicted in the current block.
  • the video signal processing device may perform intra prediction using a reference sample in integer sample units that is closest to the reference sample position in decimal sample units.
  • the reference sample position in decimal sample units may be one of 1/2 pixel, 1/4 pixel, 1/16 pixel, and 1/32 pixel units.
  • a video signal processing device can determine whether to activate the application of an integer unit interpolation method at a pre-specified level.
  • the pre-specified level can be any one of a video parameter set (VPS), a sequence parameter set (SPS), a picture parameter set (PPS), a picture, a slice tile, and a block.
  • the video signal processing device can determine which of cubic, Gaussian, and integer interpolation to apply to each sample in the current block based on the difference between the reference samples.
  • the video signal processing device may compare the difference between the reference samples with a threshold value. Specifically, if the difference between the reference samples is greater than the first threshold value, the video signal processing device may apply the embodiments described above. This is because if the difference between the reference samples is large, it may be determined as the screen content described above. If the difference between the reference samples is greater than the first threshold value, the video signal processing device may not apply smoothing filtering to the current block. Furthermore, if the difference between the reference samples is greater than the first threshold value, the video signal processing device may apply integer-unit interpolation to the current block. Furthermore, the difference between the reference samples may represent an absolute value of the difference between the reference samples.
  • the first threshold value may be an integer, for example, 50, 100, or 200.
  • These embodiments may be applied when smoothing filtering is not disabled in units larger than a block, such as SPS, PPS, pictures, and slices. In another specific embodiment, these embodiments may be used when the decoder determines whether to ultimately disable smoothing filtering when indicating that smoothing filtering is disabled in units larger than a block, such as SPS, PPS, pictures, and slices.
  • the embodiment of determining the interpolation method on a block-by-block basis can be applied when integer-by-integer interpolation is activated in units larger than blocks, such as SPS, PPS, pictures, and slices.
  • the characteristics of screen content and camera-captured content may differ. Accordingly, additional smoothing filtering may be defined.
  • the additional smoothing filtering may be for camera-captured content.
  • the flag signaling smoothing filtering deactivation may be replaced with smoothing filtering mode information indicating not only whether smoothing filtering is deactivated but also whether additional smoothing filtering is applied. Based on the smoothing filtering mode information, the decoder can determine whether to apply a smoothing filter, and if so, which smoothing filter to apply.
  • the decoder when the decoder applies an additional smoothing filter, it can apply an additional interpolation method.
  • the encoder may exclude some pre-specified encoding methods and prediction methods during encoding.
  • the encoder may designate tools that are restricted according to the characteristics of the content.
  • the encoder may include information indicating whether such restrictions are applied in the bitstream.
  • such restrictions are referred to as constraints according to content characteristics, and the information indicating whether such restrictions are applied is referred to as content characteristic constraint information.
  • the content characteristic constraint may include at least one of encoding mode restrictions, filtering restrictions, prediction method restrictions, interpolation method changes, and transformation type restrictions.
  • the content characteristic constraint information may replace the smoothing filter information in the embodiments described above.
  • the encoder can signal content characteristic restriction information at a pre-specified level. Furthermore, the decoder can determine whether content characteristic restrictions are applicable based on the pre-specified level.
  • the pre-specified level can be any of the following: video parameter set (VPS), sequence parameter set (SPS), picture parameter set (PPS), picture, slice tile, or block.
  • the decoder may parse the information indicating one of the pre-specified intra prediction modes to determine the intra prediction mode for the current block. This embodiment may reduce the amount of bits required for intra prediction mode signaling.
  • the restriction on the intra prediction mode may also be applied to the intra prediction used in constructing the MPM list.
  • the edge region of screen content is often mixed with a background region that does not change. If the surrounding blocks of the current block are mixed with both the edge region and the background region, prediction using all surrounding samples may be inefficient. Therefore, the encoder can include information indicating the reference sample used for prediction in the current block in the bitstream. For convenience of explanation, this information is referred to as reference sample region information.
  • the decoder can parse the reference sample region information and determine the reference sample based on the reference sample region information.
  • the encoder can signal whether the reference sample region information is activated at a pre-specified level. Furthermore, the decoder can determine whether the reference sample region information is activated at each 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.
  • VPS video parameter set
  • SPS sequence parameter set
  • PPS picture parameter set
  • picture slice
  • tile block
  • block the information indicating whether the reference sample region information is activated can be referred to as reference sample region restriction activation information.
  • the decoder can determine which reference sample to use among the upper reference sample and the left reference sample based on the reference sample selection information.
  • the encoder may not signal a residual signal for a block to which the reference sample area restriction is applied.
  • a block to which the reference sample area restriction is applied may implicitly indicate a block without a residual signal.
  • the decoder may determine that a residual signal does not exist for a block to which the reference sample area restriction is applied. In this case, the decoder may use the predicted block as a reconstructed block without performing parsing on the residual signal.
  • the encoder can set a skip flag for each block of a picture encoded with intra prediction, indicating that there is no residual signal, and can include the skip flag in the bitstream.
  • the encoder can signal the skip flag as '1' and then signal information indicating in which mode the current block is predicted and include the information in the bitstream. At this time, the encoder may not signal whether a residual signal exists for the corresponding block.
  • the decoder can determine whether the block corresponding to the skip flag has a residual signal based on the skip flag. If the skip mode is applied to the current block, the decoder can parse information regarding which encoding mode is used for the current block.
  • the decoder may not parse information regarding the residual signal.
  • Information about the presence or absence of a residual signal can implicitly indicate that no residual signal exists, or can indicate that no luminance residual signal, no Cb chrominance residual signal, and no Cr chrominance residual signal exist.
  • Information indicating in which mode a block is encoded can indicate any one of DIMD, TIMD, OBIC, Intra TMP, IBC, EIP, TMRL, ISP, SGPM, GPM, MIP, and PDP.
  • 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 use the PDP-based method for the current block.
  • the video signal processing device may determine whether the PDP mode is applicable according to the intra prediction directional mode of the current block. In a specific embodiment, if the intra prediction directional mode of the current block is a pre-specified mode, the video signal processing device may apply the PDP to the current block.
  • the pre-specified mode may vary depending on the encoding mode of the current block.
  • the video signal processing device may apply PDP to the current block. If a reference sample used to predict the current block through PDP is in a slice and/or tile other than the slice and/or tile to which the current block belongs, the video signal processing device may not apply PDP to the current block. If the PDP mode is applied to the current block, the video signal processing device may vary the reference sample to be used depending on the intra prediction mode of the current block. In a specific embodiment, if the intra prediction mode is a pre-specified mode, the size of the reference sample may be a pre-specified first size.
  • the size of the reference sample may be a pre-specified second size.
  • the predefined mode can be a range greater than or equal to 19 and less than or equal to 49 for the intra prediction mode (see Fig. 6).
  • the predefined first size can be W x T1 for the upper reference sample and T2 x (H + T1) for the left reference sample.
  • the predefined second size can be 2W x T1 for the upper reference sample and T2 x (2H + T1) for the left reference sample.
  • W x T1 can have a horizontal length of W and a vertical length of T1.
  • the prediction using the matrix indicated by the intra prediction mode may be a mode that replaces the existing intra prediction method. If the prediction using the matrix indicated by the intra prediction mode is applied, it may not be necessary to signal whether to apply the PDP mode on a block-by-block basis.
  • the video signal processing device may determine a first threshold value for the sum of the histogram frequency values derived through the directionality calculation using at least one of the horizontal and vertical sizes of the current block and the ratio of the horizontal and vertical lengths of the current block. At this time, the directionality may be calculated using the surrounding samples and accumulated in the histogram until the sum of the frequency values is greater than the first threshold value. In a specific embodiment, when the horizontal and vertical sizes of the current block are smaller than a predetermined size, the video signal processing device may increase the number of surrounding samples used to calculate the directionality until the sum of the histogram frequency values derived through the directionality calculation is greater than a predetermined first value.
  • the predetermined size may be when the horizontal and vertical sizes of the current block are MxN.
  • M and N may be integers, such as 16x16.
  • the predetermined first value may be an integer, for example, 1000.
  • the predetermined first value may be a value obtained by multiplying the number of surrounding samples used to calculate the directionality by a predetermined second value.
  • the second value may be an integer, for example, 1000.
  • a method of inducing an intra prediction directionality mode by accumulating a histogram based on a first threshold may be referred to as an adaptive DIMD method or an adaptive Histogram of Gradients DIMD (HoG DIMD).
  • FIG. 48 shows a peripheral sample used in DIMD chroma mode according to an embodiment of the present invention.
  • a video signal processing device can derive a DIMD mode for a current chrominance block, wherein surrounding samples used to calculate directionality may be gray sample locations (samples around a current luminance block, samples around a current Cb chrominance block, and samples around a current Cr chrominance block) of FIG. 48.
  • the video signal processing device can derive an intra-prediction directional mode using the directionality calculated at the gray sample locations, and then generate an accumulated histogram based on the derived directional mode.
  • the video signal processing device can use the most frequently generated intra-prediction directional mode as an intra-prediction directional mode for the Cb and Cr chrominance blocks. This may be referred to as DIMD chroma.
  • FIG. 49 shows a video signal processing device according to an embodiment of the present invention deriving a reference sample line from a chrominance block.
  • a video signal processing device can set a reference sample line used when performing intra prediction in a chrominance block based on a reference sample line intra prediction mode list.
  • the reference sample line intra prediction mode list is a list composed of combination candidates between reference sample lines and intra prediction modes for chrominance blocks.
  • the reference sample line intra prediction mode list can be composed using combination candidates between reference sample lines (1, 3, 5) and intra prediction modes (DM mode (intra prediction mode of a luminance block corresponding to a current chrominance block), DIMD chroma, intra prediction mode of a corresponding luminance block (C, TL, TR, BL, BR in (a) of FIG.
  • DM mode intra prediction mode of a luminance block corresponding to a current chrominance block
  • DIMD chroma intra prediction mode of a corresponding luminance block
  • the reference sample line intra prediction mode list can be reordered based on the template cost.
  • the video signal processing device can configure a reference template using a luminance block corresponding to the reconstructed samples around the current chrominance block.
  • the video signal processing device can generate a prediction template for the reference template using the reference sample line and the intra prediction mode set from the candidates in the reference sample line intra prediction mode list.
  • the video signal processing device can calculate the cost using one of SAD, MR-SAD, and SATD (Sum of Absolute Transformed Differences) between the reference template and the prediction template.
  • the video signal processing device can set different weights for the cost calculated from the luminance template and the cost calculated from the chrominance template. Specifically, the video signal processing device can calculate the final cost using a higher weight for the cost calculated from the luminance template than for the cost calculated from the chrominance template.
  • a method for deriving a reference sample line from a chrominance block can be signaled on a block-by-block basis.
  • the encoder can include in the bitstream information indicating whether to use a method for deriving a reference sample line from the chrominance block.
  • the encoder can include in the bitstream information indicating an index for an optimal combination candidate from a reference sample line intra prediction mode list of the block.
  • FIG. 50 shows a video signal processing device according to an embodiment of the present invention deriving a DIMD mode from a reference block derived based on a BV (block vector).
  • a video signal processing device may derive a BV from information on neighboring blocks of the current block, and derive a DIMD mode from a reference block indicated by the BV in a reconstructed area within the current picture.
  • the video signal processing device may construct a BV list using at least one of the BVs used in neighboring blocks of the current block and the BVs derived through Intra TMP.
  • the video signal processing device may derive a BV for the current block using the BV list.
  • the BV list may be reordered based on a template cost.
  • the video signal processing device may use a predetermined number of BVs in an order of low to high template costs as BVs for the current block.
  • the predetermined number may be a positive integer.
  • the predetermined number may be any one of 1, 2, and 3.
  • the video signal processing device may generate a histogram by applying a Sobel filter to at least one sample position among the DIMD mode used in the reference block, the DIMD mode used in another reference block indicated by the BV of the reference block, samples within the reference block, and/or surrounding samples adjacent to the reference block.
  • the video signal processing device may derive the DIMD mode using at least one of the DIMD modes derived from the histogram.
  • the derived DIMD mode may be one or more intra prediction directional modes.
  • the video signal processing device may generate a prediction block (directional predictors) for the current block using the derived DIMD mode. When there are two or more DIMD modes, two or more prediction blocks may also be generated. At this time, the video signal processing device may generate a final prediction block by performing a weighted average of the prediction blocks.
  • the video signal processing device can generate one BV-based prediction block (non-directional predictor) by weighting and averaging one or more BV-based prediction blocks generated using one or more derived BVs.
  • the video signal processing device can generate a final prediction block (Prediction block) by weighting and averaging the BV-based prediction block and the intra-prediction mode-based prediction block generated using the intra-prediction mode.
  • the BV-based DIMD derivation method can be referred to as BVG-DIMD (Block Vector Guided DIMD) mode.
  • a video signal processing device can derive an intra prediction mode of a current block by combining DIMD and TIMD methods.
  • the video signal processing device can derive a pre-specified number (X) of intra prediction modes using DIMD.
  • X can be an integer greater than or equal to 1, for example, 8.
  • a template area for constructing a histogram can vary depending on the number of samples of the current block.
  • the video signal processing device can construct a histogram using a wider area than when a block equal to or smaller than the pre-specified number of samples is used.
  • the pre-specified number of samples can be an integer greater than or equal to 1, for example, 128.
  • the video signal processing device may construct a list and use the intra prediction mode with the lowest template cost to generate a prediction block for the current block.
  • the decoder may determine whether to apply the MDIP mode to the current block by parsing the MDIP application flag. If the current block is in the MDIP mode, the video signal processing device may construct a list and use the first intra prediction mode in the list to generate a prediction block for the current block. If the MDIP mode is not applied to the current block, the video signal processing device may exclude Y pre-specified intra prediction modes with lower priorities from the non-MPM list. At this time, the video signal processing device may reduce the maximum number of non-MPM lists by the pre-specified Y. Y may be an integer greater than or equal to 1, for example, 20.
  • the video signal processing device may use blending to generate a single prediction block by weighting and averaging multiple prediction blocks.
  • the DIMD mode may select a first predefined number of intra prediction directional modes having a high frequency value in a histogram based on the directionality of surrounding samples.
  • the video signal processing device may generate a prediction block for each of the selected multiple intra prediction modes and perform a weighted average on the generated prediction blocks to generate a single prediction block.
  • the video signal processing device may select a second predefined number of intra prediction directional modes having a high frequency value in a histogram derived based on the intra prediction modes of surrounding blocks.
  • the video signal processing device may generate a prediction block for each of the selected multiple intra prediction modes.
  • the video signal processing device may perform a weighted average on the generated prediction blocks to generate a single prediction block.
  • the video signal processing device may construct an intra prediction candidate list based on the intra prediction modes used in the surrounding blocks.
  • the video signal processing device can reorder each candidate in the list based on the template cost.
  • the video signal processing device can select a third number of intra prediction modes in the reordered intra prediction candidate list and generate a prediction block for each intra prediction mode.
  • the video signal processing device can generate one prediction block by performing a weighted average on the generated prediction blocks.
  • the first number, the second number, and the third number can be integers greater than or equal to 1, for example, 5, 5, and 2, respectively.
  • the video signal processing device can perform a weighted average on a block predicted using the planar mode together with another prediction block.
  • a prediction method using such a weighted average can be referred to as blending.
  • the encoder can include a blending flag in the bitstream to indicate whether blending is disabled.
  • the decoder can obtain the blending flag from the bitstream and determine whether blending is disabled.
  • the blending flag 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 intra prediction mode of the current block can be used for encoding the next block. If blending is disabled, the video signal processing device can store only a single intra prediction mode for the current block. If blending is disabled, the video signal processing device can derive only one intra prediction mode from a neighboring block. Even if blending is disabled, the video signal processing device can derive information about multiple intra prediction modes for the current block, derive a block vector for the current block, or derive motion information for the current block. The video signal processing device can store at least one of multiple intra prediction modes for the current block, weight information for each of the multiple intra prediction modes, feature weights by position for each of the multiple intra prediction modes, transform type information, block vector information, and motion information.
  • the encoder can set information indicating whether a specific function is to be disabled and whether a pre-specified alternative method needs to be performed at a pre-specified level, and can include activation information indicating this in the bitstream.
  • the pre-specified level can be any one of a video parameter set (VPS), a sequence parameter set (SPS), a picture parameter set (PPS), a picture, a slice tile, and a block.
  • the decoder can determine whether a specific function is to be disabled at a pre-specified level and whether an alternative method needs to be performed based on the activation information. This is because, as described above, camera-captured images have different characteristics from screen content images, so disabling a specific function may not be effective.
  • the specific feature may include a method of using two or more models in CCP prediction.
  • the specific feature may include a method of using two or more models in EIP prediction.
  • the specific feature may include sbTMVP.
  • the specific feature may include at least one of affine, a method of applying a block vector in fractional units, and a sub-block-based OBMC method.
  • An encoder can set information indicating whether to activate pre-specified pixel-level motion compensation for a specific function to a pre-specified level, and include pre-specified pixel-level motion compensation activation information indicating this in a bitstream.
  • the pre-specified level can be any one of a video parameter set (VPS), a sequence parameter set (SPS), a picture parameter set (PPS), a picture, a slice tile, and a block.
  • a decoder can determine whether pre-specified pixel-level motion compensation is activated at a pre-specified level based on the pre-specified pixel-level motion compensation activation information.
  • the video signal processing device can apply motion compensation only up to a pre-specified pixel unit. If an integer-level motion compensation method is activated and a video signal processing device applies a TM or BM method to a current block, the video signal processing device can apply motion compensation only up to an integer pixel unit. When the integer unit motion compensation method is activated and the video signal processing device applies the DMVR method to the current block, the video signal processing device may first perform motion compensation for the current block only up to the integer unit, divide the current block into sub-blocks, and then apply motion compensation only up to the integer pixel unit for each sub-block.
  • the pre-specified pixel unit may be one of a half-pixel unit, an integer unit, an integer pixel unit of 2, and an integer pixel unit of 4.
  • the pre-specified pixel unit may be signaled or parsed at a pre-specified level.
  • the pre-specified level may be any one of a video parameter set (VPS), a sequence parameter set (SPS), a picture parameter set (PPS), a picture, a slice tile, and a block.
  • the video signal processing device can apply a BF (Bilateral Filter) to the intra prediction block to generate a filtered intra prediction block.
  • the video signal processing device can apply BF to a block predicted in an intra encoding mode, a block predicted based on a block vector, and a block predicted based on motion information.
  • the video signal processing device can apply BF filtering to each prediction block to generate a filtered prediction block, and blend the filtered prediction blocks to generate one prediction block.
  • the video signal processing device can blend prediction blocks to generate one prediction block, and then apply BF to the generated prediction block to generate a filtered prediction block.
  • the video signal processing device can generate one prediction block, and apply BF to the prediction block to generate a filtered prediction block. If one of the DIMD, OBIC, TIMD, TIMD SAD, and TIMD merge modes is applied to the current block and blending is not applied, the video signal processing device may generate one prediction block and apply BF to the prediction block to generate a filtered prediction block. In another specific embodiment, if one of the DIMD, OBIC, TIMD, TIMD SAD, and TIMD merge modes is applied to the current block and blending is disabled, the video signal processing device may generate one prediction block and apply BF to the prediction block to generate a filtered prediction block. In these embodiments, the prediction block may be generated using the intra prediction mode, the block vector, or the motion information as described above.
  • the methods of the present invention can vary the applicability or scope of application by using at least one or more of the following: slice type information (e.g., information on whether it is I, P, or B), information on whether it is a tile, information on whether it is a subpicture, block size, CU depth, information on whether it is a CU block or a subblock, information on whether it is a prediction block or a transform block, information on whether it is a luminance signal or a chrominance signal, temporal layer information according to reference order and layer, AMVR resolution information of the current block, information on whether it is a reference frame or a non-reference frame.
  • slice type information e.g., information on whether it is I, P, or B
  • slice type information e.g., information on whether it is I, P, or B
  • information on whether it is a tile information on whether it is a subpicture, block size, CU depth, information on whether it is a CU block or a subblock, information on whether
  • the variable that determines the applicability or scope of application can be set so that the encoder and decoder use a predetermined value, and this can also be set to use a value determined according to a profile and level.
  • the encoder can include a variable value indicating the applicability or scope of application in the bitstream, and the decoder can parse the variable value to determine the applicability or scope of application.
  • the above methods can be performed only on a luminance signal and not on a chrominance signal, and information obtained from a luminance signal can be used in a chrominance signal. The above methods can be determined whether to be performed depending on whether the temporal layer information is greater than or less than a predetermined value.
  • the above methods can be determined whether to be performed depending on information about whether the frame is a reference frame or a non-reference frame.
  • the above methods can be applied if the horizontal length or vertical length is 32 or more (e.g., 32, 64, 128, etc.). In addition, the above methods can be applied if the horizontal length or vertical length is less than 32 (e.g., 2, 4, 8, 16). In addition, the above methods can be applied if the horizontal length or vertical length is 4 or 8.
  • when AMVP mode is applied to the current block can mean “when the current block is encoded in AMVP mode” or “when the current block is decoded in AMVP mode.”
  • the methods described herein may be performed by a processor of a decoder or encoder. Furthermore, the encoder may generate a bitstream decoded by the methods described above. Furthermore, the bitstream generated by the encoder may be stored on a computer-readable, non-transitory storage medium (recording medium).
  • embodiments of the present invention described above may be implemented through various means.
  • the embodiments of the present invention may be implemented through hardware, firmware, software, or a combination thereof.
  • the method according to embodiments of the present invention may be implemented by one or more ASICs (Application Specific Integrated Circuits), DSPs (Digital Signal Processors), DSPDs (Digital Signal Processing Devices), PLDs (Programmable Logic Devices), FPGAs (Field Programmable Gate Arrays), processors, controllers, microcontrollers, microprocessors, etc.
  • ASICs Application Specific Integrated Circuits
  • DSPs Digital Signal Processors
  • DSPDs Digital Signal Processing Devices
  • PLDs Programmable Logic Devices
  • FPGAs Field Programmable Gate Arrays
  • processors controllers, microcontrollers, microprocessors, etc.
  • the methods according to embodiments of the present invention may be implemented in the form of modules, procedures, or functions that perform the functions or operations described above.
  • the software code may be stored in memory and executed by the processor.
  • the memory may be located internally or externally to the processor and may exchange data with the processor via various known means.
  • Computer-readable media can be any available media that can be accessed by a computer, and includes both volatile and nonvolatile media, removable and non-removable media.
  • Computer-readable media can include both computer storage media and communication media.
  • Computer storage media includes both volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information, such as computer-readable instructions, data structures, program modules, or other data.
  • Communication media typically contains computer-readable instructions, data structures, or other data in a modulated data signal, such as program modules, or other transport mechanisms, and includes any information delivery media.

Landscapes

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

Abstract

비디오 신호 디코딩 장치가 개시된다. 비디오 신호 디코딩 장치는 프로세서를 포함한다. 상기 프로세서는 상기 비디오 신호로부터 스무딩 필터링의 비활성화 여부를 나타내는 스무딩 필터링 정보를 획득하고, 미리 지정된 레벨에서 상기 스무딩 필터링 정보에 따라 인트라 예측에서 스무딩 필터링의 적용 여부를 판단하여 현재 블록을 예측한다.

Description

비디오 신호 처리 방법 및 이를 위한 장치
본 발명은 비디오 신호의 처리 방법 및 장치에 관한 것으로, 보다 상세하게는 비디오 신호를 인코딩하거나 디코딩하는 비디오 신호 처리 방법 및 장치에 관한 것이다.
압축 부호화란 디지털화한 정보를 통신 회선을 통해 전송하거나, 저장 매체에 적합한 형태로 저장하기 위한 일련의 신호 처리 기술을 의미한다. 압축 부호화의 대상에는 음성, 영상, 문자 등의 대상이 존재하며, 특히 영상을 대상으로 압축 부호화를 수행하는 기술을 비디오 영상 압축이라고 일컫는다. 비디오 신호에 대한 압축 부호화는 공간적인 상관관계, 시간적인 상관관계, 확률적인 상관관계 등을 고려하여 잉여 정보를 제거함으로써 이루어진다. 그러나 최근의 다양한 미디어 및 데이터 전송 매체의 발전으로 인해, 더욱 고효율의 비디오 신호 처리 방법 및 장치가 요구되고 있다.
본 명세서는 비디오 신호 처리 방법 및 이를 위한 장치를 제공하여 비디오 신호의 코딩 효율을 높이기 위한 목적이 있다.
본 명세서는 비디오 신호 처리 방법 및 이를 위한 장치를 제공한다. 비디오 신호 디코딩 장치는 프로세서를 포함한다. 상기 프로세서는 상기 비디오 신호로부터 스무딩 필터링의 비활성화 여부를 나타내는 스무딩 필터링 정보를 획득하고, 미리 지정된 레벨에서 상기 스무딩 필터링 정보에 따라 인트라 예측에서 스무딩 필터링의 적용 여부를 판단하여 현재 블록을 예측한다.
상기 스무딩 필터링은 상기 인트라 예측에 사용되는 참조 샘플에 대한 필터링을 포함할 수 있다.
상기 스무딩 필터링은 PDPC를 포함할 수 있다.
상기 스무딩 필터링은 인트라 퓨전을 포함할 수 있다.
상기 미리 지정된 레벨은 SPS일 수 있다.
상기 스무딩 필터링은 복수의 기능을 포함하고, 상기 스무딩 필터링 정보는 복수의 기능 각각의 비활성화 여부를 지시하는 복수의 플래그를 포함할 수 있다.
상기 프로세서는 상기 현재 블록을 복원할 때, 상기 스무딩 필터링 정보를 기초로, 정수 단위의 샘플만을 사용하여 보간하는 정수 단위 보간 방법을 사용할지 결정할 수 있다.
상기 프로세서는 상기 현재 블록을 복원할 때, 상기 스무딩 필터링 정보를 기초로, 복수의 예측 블록을 가중 평균하여 최종 예측 블록을 생성하는 블렌딩을 수행할 지 결정할 수 있다.
상기 프로세서는 상기 현재 블록이 미리 지정된 모드로 부호화된 경우, 상기 현재 블록이 잔차 신호를 갖지 않는 것으로 판단할 수 있다.
본 발명의 실시 예에 따른 비디오 신호 인코딩 장치가 개시된다. 비디오 신호 인코딩 장치는 프로세서를 포함한다. 상기 프로세서는 스무딩 필터링의 비활성화 여부를 나타내는 스무딩 필터링 정보를 설정하고, 상기 필터링 정보를 상기 비디오 신호에 포함시킨다. 미리 지정된 레벨에서 상기 스무딩 필터링 정보에 따라 인트라 예측에서 스무딩 필터링의 적용 여부를 판단하여 현재 블록이 예측된다.
상기 스무딩 필터링은 상기 인트라 예측에 사용되는 참조 샘플에 대한 필터링을 포함할 수 있다.
상기 스무딩 필터링은 PDPC를 포함할 수 있다.
상기 스무딩 필터링은 인트라 퓨전을 포함할 수 있다.
상기 미리 지정된 레벨은 SPS일 수 있다.
상기 스무딩 필터링은 복수의 기능을 포함하고, 상기 스무딩 필터링 정보는 복수의 기능 각각의 비활성화 여부를 지시하는 복수의 플래그를 포함할 수 있다.
상기 현재 블록의 복원에서, 상기 스무딩 필터링 정보를 기초로, 정수 단위의 샘플만을 사용하여 보간하는 정수 단위 보간 방법을 사용할지 결정될 수 있다.
상기 현재 블록의 복원에서, 상기 스무딩 필터링 정보를 기초로, 복수의 예측 블록을 가중 평균하여 최종 예측 블록을 생성하는 블렌딩을 수행할 지 결정될 수 있다.
상기 프로세서는 상기 현재 블록이 미리 지정된 모드로 부호화된 경우, 상기 현재 블록이 잔차 신호를 갖지 않게 인코딩할 수 있다.
본 발명의 실시 예에 따라 비트스트림을 저장하는 컴퓨터 판독 가능한 비 일시적 저장 매체에서, 상기 비트스트림의 인코딩 방법은 스무딩 필터링의 비활성화 여부를 나타내는 스무딩 필터링 정보를 설정하는 단계; 및 상기 필터링 정보를 상기 비디오 신호에 포함시키는 단계를 포함한다. 미리 지정된 레벨에서 상기 스무딩 필터링 정보에 따라 인트라 예측에서 스무딩 필터링의 적용 여부를 판단하여 현재 블록이 예측된다.
본 발명의 실시 예에 따른 비디오 신호 디코딩 장치의 동작 방법은 상기 비디오 신호로부터 스무딩 필터링의 비활성화 여부를 나타내는 스무딩 필터링 정보를 획득하는 단계; 및 미리 지정된 레벨에서 상기 스무딩 필터링 정보에 따라 인트라 예측에서 스무딩 필터링의 적용 여부를 판단하여 현재 블록을 예측하는 단계를 포함한다.
본 명세서는 효율적으로 비디오 신호를 처리하기 위한 방법을 제공한다.
본 명세서에서 얻을 수 있는 효과는 이상에서 언급한 효과들로 제한되지 않으며, 언급하지 않은 또 다른 효과들은 아래의 기재로부터 본 발명이 속하는 기술분야에서 통상의 지식을 가진 자에게 명확하게 이해될 수 있을 것이다.
도 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는 본 발명의 실시 예에 따라 참조 샘플 필터링과 PDPC와 인트라 퓨젼의 활성화 여부를 SPS에서 시그널링 하는 방법을 보여준다.
도 45는 general_constraint_info() 신택스에서 스무딩 필터 정보의 제약이 설정되는 것을 보여준다.
도 46은 본 발명의 실시 예에 따라 인트라 예측 샘플 생성시 보간 방법을 보여준다.
도 47은 본 발명의 실시 예에 따른 매트릭스 기반 인트라 예측 방법을 보여준다.
도 48은 본 발명의 실시 예에 따라 DIMD 크로마 모드에서 사용되는 주변 샘플을 보여준다.
도 49는 본 발명의 실시 예에 따른 비디오 신호 처리 장치가 색차 블록에서 참조 샘플 라인을 유도하는 것을 보여준다.
도 50은 본 발명의 실시 예에 따른 비디오 신호 처리 장치가 BV(block vector)를 기초로 유도된 참조 블록에서 DIMD 모드를 유도하는 것을 보여준다.
본 명세서에서 사용되는 용어는 본 발명에서의 기능을 고려하면서 가능한 현재 널리 사용되는 일반적인 용어를 선택하였으나, 이는 당 분야에 종사하는 기술자의 의도, 관례 또는 새로운 기술의 출현 등에 따라 달라질 수 있다. 또한 특정 경우는 출원인이 임의로 선정한 용어도 있으며, 이 경우 해당되는 발명의 설명 부분에서 그 의미를 기재할 것이다. 따라서 본 명세서에서 사용되는 용어는, 단순한 용어의 명칭이 아닌 그 용어가 가진 실질적인 의미와 본 명세서의 전반에 걸친 내용을 토대로 해석되어야 함을 밝혀두고자 한다.
본 명세서에서 '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--stortion)에 대한 비용(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는 본 발명의 실시 예에 따라 참조 샘플 필터링과 PDPC와 인트라 퓨젼의 활성화 여부를 SPS에서 시그널링 하는 방법을 보여준다.
앞서 설명한 바와 같이 스무딩 필터 정보는 SPS 단위로 설정될 수 있다. 또한, 스무딩 필터 정보는 SPS 단위로 참조 샘플 필터링 비활성화 여부를 지시하는 제1 플래그, SPS 단위로 PDPC 비활성화 여부를 지시하는 제2 플래그, 및 SPS 단위로 인트라 퓨전 비활성화 여부를 지시하는 제3 플래그 중 적어도 어느 하나를 포함할 수 있다. 제1 플래그를 sps_ref_filter_disabled_flag로 지칭하고, 제2 플래그를 sps_pdpc_disabled_flag로 지칭하고, 제3 플래그를 sps_intra_fusion_disabled_flag로 지칭한다. 도 44는 시퀀스 별로 포함하되는 시퀀스 파라미터 셋이 sps_ref_filter_disabled_flag, sps_pdpc_disabled_flag 및 sps_intra_fusion_disabled_flag를 포함하는 것을 보여준다.
sps_ref_filter_disabled_flag가 참조 샘플 필터링이 비활성화됨을 지시하는 경우, 디코더는 현재 블록의 부호화 모드, 현재 블록의 크기, 현재 블록이 휘도 블록 인지 색차 블록인지와 관계없이, SPS에 해당하는 시퀀스 내에서 참조 샘플 필터링을 수행하지 않을 수 있다. sps_ref_filter_disabled_flag가 참조 샘플 필터링이 비활성화 되지 않음을 지시하는 경우, 디코더는 현재 블록의 부호화 모드, 현재 블록의 크기, 현재 블록이 휘도 블록인지 색차 블록인지에 따라 현재 블록에 참조 샘플 필터링을 적용할지 결정할 수 있다. 이때, sps_ref_filter_disabled_flag의 값이 1인 경우, sps_ref_filter_disabled_flag는 SPS에 해당하는 시퀀스 내에서 참조 샘플 필터링이 비활성화됨을 지시할 수 있다. sps_ref_filter_disabled_flag의 값이 0인 경우, sps_ref_filter_disabled_flag는 SPS에 해당하는 시퀀스 내에서 참조 샘플 필터링이 비활성화되지 않음을 지시할 수 있다. 또한, 인코더는 SPS에 해당하는 시퀀스 내에서 참조 샘플 필터링 비활성화 여부에 따라 sps_ref_filter_disabled_flag의 값을 설정할 수 있다.
sps_pdpc_disabled_flag가 PDPC가 비활성화됨을 지시하는 경우, 디코더는 현재 블록의 인트라 예측 방향성 모드, 현재 블록의 크기, 현재 블록이 휘도 블록 인지 색차 블록인지와 관계없이, SPS에 해당하는 시퀀스 내에서 PDPC을 수행하지 않을 수 있다. sps_pdpc_disabled_flag가 PDPC이 비활성화 되지 않음을 지시하는 경우, 디코더는 현재 블록의 인트라 예측 방향성 모드, 현재 블록의 크기, 현재 블록이 휘도 블록 인지 색차 블록인지에 따라 현재 블록에 PDPC을 적용할지 결정할 수 있다. 이때, sps_pdpc_disabled_flag의 값이 1인 경우, sps_ref_filter_disabled_flag는 SPS에 해당하는 시퀀스 내에서 PDPC가 비활성화됨을 지시할 수 있다. sps_pdpc_disabled_flag의 값이 0인 경우, sps_ref_filter_disabled_flag는 SPS에 해당하는 시퀀스 내에서 PDPC가 비활성화되지 않음을 지시할 수 있다. 또한, 인코더는 SPS에 해당하는 시퀀스 내에서 PDPC 비활성화 여부에 따라 sps_ref_filter_disabled_flag의 값을 설정할 수 있다.
sps_intra_fusion_disabled_flag가 인트라 퓨전이 비활성화됨을 지시하는 경우, 디코더는 현재 블록의 인트라 예측 방향성 모드, 현재 블록의 크기, 현재 블록이 휘도 블록 인지 색차 블록인지와 관계없이, SPS에 해당하는 시퀀스 내에서 인트라 퓨전을 수행하지 않을 수 있다. sps_intra_fusion_disabled_flag가 인트라 퓨전이 비활성화 되지 않음을 지시하는 경우, 디코더는 현재 블록의 인트라 예측 방향성 모드, 현재 블록의 크기, 현재 블록이 휘도 블록 인지 색차 블록인지에 따라 현재 블록에 인트라 퓨전을 적용할지 결정할 수 있다. 이때, sps_intra_fusion_disabled_flag의 값이 1인 경우, sps_ref_filter_disabled_flag는 SPS에 해당하는 시퀀스 내에서 인트라 퓨전이 비활성화됨을 지시할 수 있다. sps_intra_fusion_disabled_flag의 값이 0인 경우, sps_intra_fusion_disabled_flag는 SPS에 해당하는 시퀀스 내에서 인트라 퓨전이 비활성화되지 않음을 지시할 수 있다. 또한, 인코더는 SPS에 해당하는 시퀀스 내에서 인트라 퓨전 비활성화 여부에 따라 sps_ref_filter_disabled_flag의 값을 설정할 수 있다.
앞서 설명한 실시 예들에서, SPS에서 스무딩 필터 정보가 존재하지 않는 경우, 디코더는 스무딩 필터 정보가 스무딩 필터가 활성화되는 것을 지시하는 것으로 추론할 수 있다. 예컨대, SPS에서 sps_ref_filter_disabled_flag가 존재하지 않는 경우, 디코더는 sps_ref_filter_disabled_flag의 값을 0으로 추론할 수 있다. 또한, SPS에서 sps_pdpc_disabled_flag가 존재하지 않는 경우, 디코더는 sps_pdpc _disabled_flag의 값을 0으로 추론할 수 있다. 또한, SPS에서 sps_ intra_fusion_disabled_flag가 존재하지 않는 경우, 디코더는 sps_ intra_fusion_disabled_flag의 값을 0으로 추론할 수 있다.
앞서 설명한 스무딩 필터 정보는 미리 지정된 레벨 단위로 스무딩 필터링의 제약 여부가 설정될 수 있다. 이때, 스무딩 필터 정보의 제약은 GCI를 통해 설정될 수 있다. 이에 대해서는 도 45를 통해 설명한다. 도 45는 general_constraint_info() 신택스에서 스무딩 필터 정보의 제약이 설정되는 것을 보여준다.
스무딩 필터 정보는 참조 샘플 필터링 비활성화 여부를 제약하는 제1 제약 플래그, PDPC 비활성화 여부를 제약하는 제2 제약 플래그, 및 인트라 퓨전 비활성화 여부를 제약하는 제3 제약 플래그 중 적어도 어느 하나를 포함할 수 있다. 제1 제약 플래그를 gci_no_ref_filter_constraint_flag로 지칭하고, 제2 제약 플래그를 gci_no_pdpc_constraint_flag로 지칭하고, 제3 제약 플래그를 gci_no_intra_fusion_constraint_flag로 지칭한다. 도 45는 GCI가 gci_no_ref_filter_constraint_flag, gci_no_pdpc_constraint_flag 및 gci_no_intra_fusion_constraint_flag를 포함하는 것을 보여준다.
general_constraint_info() 신택스는 profile_tier_level() 신택스에서 호출될 수 있다. profile_tier_level() 신택스는 SPS, VPS, Decoding capability information에서 호출될 수 있다. general_contraint_info() 신택스의 개별 신택스 요소(element)는 SPS 내의 신택스 요소에 대응될 수 있다. general_contraint_info() 신택스의 개별 신택스 요소에 따라 SPS 내의 신택스 요소의 비활성화 여부가 결정될 수 있다. 디코더는general_contraint_info() 신택스를 기초로 SPS 내의 신택스 요소의 비활성화 여부를 판단할 수 있다.
gci_no_ref_filter_constraint_flag의 값이 1인 경우, 비디오 신호 처리 장치는 OlsScope 내에 존재하는 모든 픽쳐에 대해 sps_ref_filter_disabled_flag 값을 0과 같게 해야 한다. 이와 같이 gci_no_ref_filter_constraint_flag의 값을 1로 설정하여, 참조 샘플 필터링의 활성화를 강제할 수 있다. gci_no_ref_filter_constraint_flag의 값이 0인 경우, sps_ref_filter_disabled_flag 값은 0으로 강제되지 않는다.
gci_ref_filter_constraint_flag의 값이 1인 경우, 비디오 신호 처리 장치는 OlsScope내에 존재하는 모든 픽쳐에 대해 sps_ref_filter_disabled_flag의 값을 1과 같게 해야 한다. 이와 같이 gci_ref_filter_constraint_flag의 값을 1로 설정하여, 참조 샘플 필터링의 비활성화를 강제할 수 있다. gci_ref_filter_constraint_flag 값이 0인 경우, sps_ref_filter_disabled_flag 값은 1로 강제되지 않는다.
PDPC 관련 constraint flag는 gci_no_pdpc_constraint_flag일 수 있다.
gci_no_pdpc_constraint_flag의 값이 1인 경우, 비디오 신호 처리 장치는 OlsScope 내에 존재하는 모든 픽쳐에 대해 sps_pdpc_disabled_flag 값을 0과 같게 해야 한다. 이와 같이 gci_no_pdpc_constraint_flag의 값을 1로 설정하여 PDPC의 활성화를 강제할 수 있다. gci_no_pdpc_constraint_flag의 값이 0과 같은 경우, sps_pdpc_disabled_flag의 값을 0으로 강제되지 않는다.
gci_pdpc_constraint_flag의 값이 1인 경우, 비디오 신호 처리 장치는 OlsScope 내에 존재하는 모든 픽쳐들에 대해 sps_pdpc_disabled_flag의 값을 1과 같게 해야 한다. 이와 같이 gci_pdpc_constraint_flag의 값을 1로 설정하여 PDPC의 비활성화를 강제할 수 있다. gci_pdpc_constraint_flag의 값이 0인 경우, sps_pdpc_disabled_flag의 값은 1로 강제되지 않는다.
인트라 퓨젼 관련 constraint flag는 gci_no_intra_fusion_constraint_flag 일 수 있다.
gci_no_intra_fusion_constraint_flag의 값이 1인 경우, 비디오 신호 처리 장치는 OlsScope 내에 존재하는 모든 픽쳐들에 대해 sps_intra_fusion_disabled_flag의 값을 0과 같게 해야 한다. gci_no_intra_fusion_constraint_flag의 값을 1로 설정하여 인트라 퓨젼 방법의 활성화를 강제할 수 있다. gci_no_intra_fusion_constraint_flag의 값이 0인 경우, sps_intra_fusion_disabled_flag 값을 0으로 강제되지 않는다.
gci_intra_fusion_constraint_flag의 값이 1인 경우, 비디오 신호 처리 장치는 OlsScope 내에 존재하는 모든 픽쳐에 대해 sps_intra_fusion_disabled_flag 값을 1과 같게 해야 한다. gci_intra_fusion_constraint_flag의 값을 1로 설정하여 인트라 퓨젼 방법의 비활성화를 강제할 수 있다. gci_intra_fusion_constraint_flag 값이 0인 경우, sps_intra_fusion_disabled_flag 값은 1로 강제되지 않는다.
앞서 설명한 실시 예들에서 GCI의 스무딩 필터 정보에 관련된 제약이 스무딩 필터 정보가 비활성화 되는 것으로 강제하는 것으로 설명하였다. 또 다른 구체적인 실시 예에서 GCI의 스무딩 필터 정보에 관련된 제약이 스무딩 필터 정보가 비활성화되지 않는 것을 강제할 수 있다. 또한, 각각의 제약 플래그의 값이 1인 경우, 스무딩 필터 정보에 관한 제약이 적용되는 것을 나타낼 수 있다.
비트스트림은 하나 이상의 CVS(coded video sequence)로 구성될 수 있다. 각 CVS는 다른 CVS와 독립적으로 인코딩된다. CVS는 하나 이상의 레이어로 구성될 수 있다. 각 레이어 별로 화질, 해상도, 깊이 정보 맵, 투명도(transparencey) 맵이 설정될 수 있다. CLVS(coded layer video sequence)는 하나의 레이어 내에서 디코딩 순서상 연속된 PU로 구성된 레이어-별(layer-wise) CVS를 나타낸다. 예컨대, 특정 화질을 갖는 레이어에 대한 CLVS가 있고, 깊이 정보 맵을 위한 별도의 CLVS가 있을 수 있다.
인코더는 픽쳐 또는 슬라이스 단위로 스무딩 필터 정보를 설정할 수 있다. 또한, 디코더는 스무딩 필터 정보를 기초로 픽쳐 또는 슬라이스 단위로 스무딩 필터의 비활성화 여부를 판단할 수 있다. 픽쳐 단위로 참조 샘플 필터링 비활성화 여부를 지시하는 플래그를 ph_ref_filter_disable_flag로 지칭할 수 있다. 또한, 픽쳐 단위로 pdpc 비활성화 여부를 지시하는 플래그를 ph_pdpc_disable_flag로 지칭할 수 있다. 또한, 픽쳐 단위로 인트라 퓨전 비활성화 여부를 지시하는 플래그를 ph_intra_fusion _disable_flag로 지칭할 수 있다. 슬라이스 단위로 참조 샘플 필터링 비활성화 여부를 지시하는 플래그를 sh_ref_filter_disable_flag로 지칭할 수 있다. 또한, 슬라이스 단위로 pdpc 비활성화 여부를 지시하는 플래그를 sh_pdpc_disable_flag로 지칭할 수 있다. 또한, 슬라이스 단위로 인트라 퓨전 비활성화 여부를 지시하는 플래그를 sh_intra_fusion _disable_flag로 지칭할 수 있다.
비디오 신호 처리 장치는 스무딩 필터의 적용 여부를 블록 단위로 판단할 수 있다. 이때, 비디오 신호 처리 장치는 묵시적으로 스무딩 필터의 비활성화 여부를 블록 단위로 판단할 수 있다. 구체적으로 비디오 신호 처리 장치는 현재 블록 및/또는 주변 블록의 부호화 모드가 미리 지정된 부호화 모드인지, 현재 블록이 휘도 블록인지 또는 색차 블록인지, 현재 블록의 인트라 예측 방향성 모드, 현재 블록의 가로 및 세로 크기, 및 현재 블록의 참조 샘플 라인 정보 중 적어도 하나 이상을 사용하여 블록 단위로 스무딩 필터의 비활성화 여부를 결정할 수 있다. 이때, 미리 지정된 부호화 모드는 변환 스킵 블록, Intra TMP 블록, IBC 블록, BDPCM, Palette 모드, MIP, EIP, SGPM, GPM, TMRL, DIMD, TIMD, ISP, OBIC, 및 PDP 적용 여부 중 적어도 어느 하나를 포함할 수 있다.
다음의 제1 조건 내지 제4 조건 중 어느 하나를 만족하는 경우, 비디오 신호 처리 장치는 현재 블록에 스무딩 필터링을 사용하지 않을 수 있다. 제1 조건은 현재 블록에 DIMD가 적용되고, DIMD 블렌딩 모드가 적용되지 않은 경우일 수 있다. 제2 조건은 현재 블록에 TIMD가 적용되었고, TIMD 블렌딩 모드가 적용되지 않은 경우일 수 있다. 제3 조건은 현재 블록에 OBIC가 적용되고, OBIC 블렌딩 모드가 적용되지 않은 경우일 수 있다. 제4 조건은 현재 블록의 부호화 모드가 Intra TMP, IBC, BDPCM, Palette 모드, MIP, EIP, SGPM, TMRL, ISP, PDP 중에서 어느 하나의 모드가 아닌 경우일 수 있다.
다음의 제1 조건 내지 제4 조건 중 어느 하나를 만족하는 경우, 비디오 신호 처리 장치는 현재 블록에 스무딩 필터링을 사용할 수 있다. 제1 조건은 현재 블록에 DIMD가 적용되고, DIMD 블렌딩 모드가 적용되는 경우일 수 있다. 제2 조건은 현재 블록에 TIMD가 적용되었고, TIMD 블렌딩 모드가 적용되는 경우일 수 있다. 제3 조건은 현재 블록에 OBIC가 적용되고, OBIC 블렌딩 모드가 적용되는 경우일 수 있다. 제4 조건은 현재 블록의 부호화 모드가 Intra TMP, IBC, BDPCM, Palette 모드, MIP, EIP, SGPM, TMRL, ISP, PDP 중에서 어느 하나의 모드인 경우일 수 있다.
다음의 제1 조건 내지 제3 조건 중 어느 하나를 만족하는 경우, 비디오 신호 처리 장치는 현재 블록에 스무딩 필터링을 사용할 수 있다. 제1 조건은 현재 블록에 Intra TMP가 적용되고, LIC 모드가 적용된 경우일 수 있다. 제2 조건은 현재 블록에 Intra TMP가 적용되고, Intra TMP 필터링 방법이 적용된 경우일 수 있다. 제3 조건은 현재 블록에 Intra TMP가 적용되고, Intra TMP 퓨젼 방법이 적용된 경우일 수 있다.
이때, Intra TMP 필터링에서 비디오 신호 처리 장치는 블록 벡터가 지시하는 참조 블록에 인접한 샘플과 현재 블록에 인접한 샘플을 이용하여 선형 모델을 유도한다. 비디오 신호 처리 장치는 유도된 선형 모델을 참조 블록에 적용하여 필터링된 참조 블록을 현재 블록으로 획득한다. 또한, Intra TMP 퓨젼에서 비디오 신호 처리 장치는 복수의 블록 벡터를 사용하여 생성된 참조 블록을 가중 평균하여 현재 블록을 위한 예측 블록으로 획득한다.
현재 블록의 부호화 모드가 변환 스킵 블록인 경우, 비디오 신호 처리 장치는 현재 블록에 스무딩 필터링을 수행하지 않을 수 있다.
현재 블록의 예측 방향성 모드가 수평 방향, 수직 방향, 대각 방향, Planar, DC 모드 중 어느 하나인 경우, 비디오 신호 처리 장치는 현재 블록에 스무딩 필터링을 수행하지 않을 수 있다.
스무딩 필터링은 템플릿 예측을 사용하는 예측에서 템플릿을 예측할 때 사용되는 스무딩 필터링을 포함할 수 있다. 템플릿 예측을 사용하는 예측은 DIMD, TIMD, DIMD, SGPM, GPM, 및 MPM 리스트에서 후보 모드 재정렬 중 적어도 어느 하나를 포함할 수 있다. 인코더 및 디코더가 각 후보 별로 템플릿을 예측할 때, 비디오 신호 처리 장치는 스무딩 필터링을 적용할 수 있다. 구체적으로 DIMD 및 TIMD 모드에서 평면(planar) 모드와 IBC 및 Intra TMP 기반 블록 벡터 모드 중 최적의 모드를 선택할 때, 비디오 신호 처리 장치는 템플릿을 예측할 때 스무딩 필터를 적용할 수 있다. 따라서 앞서 설명한 실시 예들에 따라 인코더 및 디코더가 스무딩 필터링을 수행하지 않은 경우, 비디오 신호 처리 장치는 템플릿 예측에서 스무딩 필터링을 수행하지 않을 수 있다.
현재 블록의 참조 샘플 라인의 값이 '0'인 경우, 비디오 신호 처리 장치는 현재 블록에 스무딩 필터링을 수행하지 않을 수 있다.
이러한 실시 예들은 블록 보다 큰 단위, 예컨대 SPS, PPS, 픽쳐 및 슬라이스에서 스무딩 필터링이 비활성화되지 않은 경우에 적용될 수 있다. 또 다른 구체적인 실시 예에서 이러한 실시 예들은 블록 보다 큰 단위, 예컨대 SPS, PPS, 픽쳐 및 슬라이스에서 스무딩 필터링이 비활성화됨을 지시하는 경우, 디코더가 스무딩 필터링을 최종적으로 비활성화할지 판단할 때 사용될 수 있다. 비디오 신호 처리 장치는 묵시적으로 스무딩 필터의 비활성화 여부를 블록 단위로 판단하는 실시 예를 블록 보다 큰 단위에서 결정된 스무딩 필터의 활성화 여부에 따라 스무딩 필터를 비활성화 가능한 경우에만 적용할 수 있다. 이때, 비디오 신호 처리 장치는 최종적으로 스무딩 필터를 비활성화할지 블록 단위로 판단할 수 있다.
도 46은 본 발명의 실시 예에 따라 인트라 예측 샘플 생성시 보간 방법을 보여준다.
앞서 설명한 바와 스크린 컨텐츠 영상은 에지 성분이 비교적 많이 포함될 수 있다. 이에 따라 인트라 예측에서 스크린 컨텐츠 영상의 특성을 고려한 참조 샘플에 대한 보간 방법이 필요하다.
미리 지정된 조건을 만족하는 경우, 비디오 신호 처리 장치는 인트라 예측 블록을 생성할 때 보간 방법을 수행하지 않고 정수 단위 샘플 값을 이용하여 인트라 예측에 사용할 수 있다. 도 46의 실시 예에서, 비디오 신호 처리 장치는 현재 블록의 인트라 예측 방향성 모드를 이용하여 참조 샘플로부터 현재 블록 내의 샘플을 예측한다. 도 46의 (b)와 같이, 인트라 예측 방향성 모드가 지시하는 위치가 정수 단위 참조 샘플 사이의 지점(도 46의 (b)에서 '1')이 될 수 있다. 이와 같은 상황에서 비디오 신호 처리 장치는 보간 방법을 사용하여 않고, '1' 위치에서 가장 가까운 정수 단위 샘플을 사용하여 현재 블록 내 샘플을 예측할 수 있다.
구체적으로 정수 샘플 단위의 참조 샘플을 유도하기 위해, 비디오 신호 처리 장치는 현재 블록의 가로 및 세로의 크기, 인트라 예측 방향성 모드, 참조 샘플 라인의 위치, 및 현재 블록에서 예측할 샘플의 수직 및 수평 위치 중 적어도 하나 이상을 사용하여, 소수점 샘플 단위의 참조 샘플 위치를 유도할 수 있다. 이때, 비디오 신호 처리 장치는 소수점 샘플 단위의 참조 샘플 위치와 가장 가까운 정수 샘플 단위의 참조 샘플을 사용하여 인트라 예측을 수행할 수 있다. 소수점 샘플 단위의 참조 샘플 위치는 1/2 화소, 1/4 화소, 1/16 화소, 및 1/32 화소 단위 중 하나일 수 있다. 설명의 편의를 위해 이후 설명에서 이와 같이 인트라 예측 블록 생성 시 정수 단위의 샘플만을 사용하는 정수 단위 보간 방법이 적용되는 것을 정수 단위 보간 방법 적용이라 지칭한다.
비디오 신호 처리 장치는 미리 지정된 레벨에서 정수 단위 보간 방법 적용의 활성화 여부를 판단할 수 있다. 이때, 미리 지정된 레벨은 VPS(video parameter set), SPS(sequence parameter set), PPS(picture parameter set), 픽쳐, 슬라이스 타일 및 블록 중 어느 하나일 수 있다.
비디오 신호 처리 장치는 정수 단위 보간 방법 적용을 블록 단위로 결정할 수 있다. 구체적으로 비디오 신호 처리 장치는 현재 블록 및 주변 블록의 부호화 모드, 현재 블록이 휘도 블록 또는 색차 블록인지 여부, 현재 블록의 인트라 예측 방향성 모드, 현재 블록의 가로 및 세로 크기, 및 현재 블록의 참조 샘플 라인 정보 중 적어도 하나 이상을 사용하여 정수 단위 보간 방법 적용 여부를 결정할 수 있다. 이때, 미리 지정된 부호화 모드는 변환 스킵 블록, Intra TMP 블록, IBC 블록, BDPCM, Palette 모드, MIP, EIP, SGPM, GPM, TMRL, DIMD, TIMD, ISP, OBIC, 및 PDP 적용 여부 중 적어도 어느 하나를 포함할 수 있다. 또한, 비디오 신호 처리 장치는 정수 단위 보간 방법 적용이 활성화된 경우에 정수 단위 보간 방법 적용 여부를 결정할 수 있다.
또한, 인코더 및 디코더가 스무딩 필터링을 수행할 때, 비디오 신호 처리 장치는 참조 샘플 사이의 차이를 기초로 현재 블록에 스무딩 필터링 중 적어도 어느 하나를 적용할지 결정할 수 있다.
인코더 및 디코더가 보간 방법을 이용하여 현재 블록에 대한 예측 샘플을 생성할 때, 비디오 신호 처리 장치는 참조 샘플 사이의 차이를 기초로 현재 블록에 큐빅(cubic), 가우시안(Gaussian), 정수 단위 보간 중 어느 것을 적용할지 결정할 수 있다.
또 다른 구체적인 실시 예에서 인코더 및 디코더가 보간 방법을 이용하여 현재 블록에 대한 예측 샘플을 생성할 때, 비디오 신호 처리 장치는 참조 샘플 사이의 차이를 기초로 현재 블록 내 샘플마다 큐빅(cubic), 가우시안(Gaussian), 정수 단위 보간 중 어느 것을 적용할지 결정할 수 있다.
이러한 실시 예들에서 비디오 신호 처리 장치는 참조 샘플 사이의 차이를 임계값과 비교할 수 있다. 구체적으로 참조 샘플 사이의 차이가 제1 임계값보다 큰 경우, 비디오 신호 처리 장치는 앞서 설명한 실시 예들을 적용할 수 있다. 참조 샘플 사이의 차이가 크면 앞서 설명한 스크린 컨텐츠로 판단할 수 있기 때문이다. 참조 샘플 사이의 차이가 제1 임계값보다 큰 경우, 비디오 신호 처리 장치는 현재 블록에 스무딩 필터링을 적용하지 않을 수 있다. 또한, 참조 샘플 사이의 차이가 제1 임계값보다 큰 경우, 비디오 신호 처리 장치는 현재 블록에 정수 단위 보간을 적용할 수 있다. 또한, 참조 샘플 사이의 차이는 참조 샘플 사이의 차이의 절대값을 나타낼 수 있다. 제1 임계값은 정수, 예컨대, 50, 100, 또는 200일 수 있다.
또한, 비디오 신호 처리 장치는 참조 샘플 사이의 차이가 제2 임계값과 같거나 작은 같은 경우, 비디오 신호 처리 장치는 현재 블록에 스무딩 필터링을 적용하지 않을 수 있다. 또한, 참조 샘플 사이의 차이가제2 임계값과 같거나 작은 같은 경우, 비디오 신호 처리 장치는 현재 블록에 정수 단위 보간을 적용할 수 있다. 또한, 참조 샘플 사이의 차이는 참조 샘플 사이의 차이의 절대값을 나타낼 수 있다. 제2 임계값은 정수, 예컨대, 0, 5, 또는 10일 수 있다.
상기 참조 샘플 간의 차이에 기초하여 참조 샘플 필터링, PDPC, 인트라 퓨젼의 적용 여부를 결정하는 방법은 상기 SPS, PPS, Picture 및 슬라이스 단위에서 참조 샘플 필터링 및/또는 PDPC 및/또는 인트라 퓨젼 방법이 비활성화 가능하도록 설정되었을 경우, 블록 단위 및/또는 샘플 단위로 상기 참조 샘플 간의 차이에 기초하여 참조 샘플 필터링, PDPC, 인트라 퓨젼의 적용 여부를 추가적으로 결정할 수 있다.
이러한 실시 예들은 블록 보다 큰 단위, 예컨대 SPS, PPS, 픽쳐 및 슬라이스에서 스무딩 필터링이 비활성화되지 않은 경우에 적용될 수 있다. 또 다른 구체적인 실시 예에서 이러한 실시 예들은 블록 보다 큰 단위, 예컨대 SPS, PPS, 픽쳐 및 슬라이스에서 스무딩 필터링이 비활성화됨을 지시하는 경우, 디코더가 스무딩 필터링을 최종적으로 비활성화할지 판단할 때 사용될 수 있다.
또한, 블록 단위로 보간 방법을 판단하는 실시 예는 블록 보다 큰 단위, 예컨대 SPS, PPS, 픽쳐 및 슬라이스에서 정수 단위 보간 적용이 활성화된 경우에 적용될 수 있다.
또한, 앞서 설명한 실시 예들에서 스무딩 필터링에 포함되는 복수의 필터링 각각 별로 제1 임계값과 제2 임계값이 독립적으로 결정될 수 있다. 이에 따라 스무딩 필터링에 포함되는 복수의 필터링 각각 별로 제1 임계값과 제2 임계값이 같거나 다를 수 있다.
스크린 컨텐츠와 카메라 캡쳐 컨텐츠의 특성이 다를 수 있다. 이에 따라 추가 스무딩 필터링이 정의될 수 있다. 이때, 추가 스무딩 필터링은 카메라 캡쳐 컨텐츠를 위한 것일 수 있다. 앞서 설명한 스무딩 필터링 비활성화에 관한 실시 예들에서 스무딩 필터링 비활성화를 시그널링하는 플래그는 스무딩 필터링 비활성화여부뿐만 아니라 추가 스무딩 필터링 적용 여부를 나타내는 스무딩 필터링 모드 정보로 대체될 수 있다. 디코더는 스무딩 필터링 모드 정보를 기초로 스무딩 필터를 적용할지, 스무딩 필터를 적용하는 경우 어느 스무딩 필터를 적용할지 판단할수 있다.
또한, 정수 단위 보간 이외에 추가 보간 방법이 정의될 수 있다. 이때, 추가 보간 방법은 카메라 캡쳐 컨텐츠를 위한 것일 수 있다. 디코더는 앞서 설명한 실시 예들에서 정수 단위 보간 방법을 판단할지뿐만 아니라 추가 보간 방법을 적용할 지 함께 판단할 수 있다.
또한, 디코더가 추가 스무딩 필터를 적용할 때, 추가 보간 방법을 적용할 수 있다.
스크린 컨텐츠의 특성을 고려할 때, 인코더는 부호화 시 미리 지정된 몇 가지 인코딩 방법 및 예측 방법을 제외할 수 있다. 인코더는 이와 같이 컨텐츠의 특성에 따라 제한되는 툴을 지정할 수 있다. 또한, 인코더는 이러한 제한의 적용 여부를 지시하는 정보를 비트스트림에 포함시킬 수 있다. 설명의 편의를 위해 이러한 제한을 컨텐츠 특성에 따른 제한(constraint)이라 지칭하고, 이러한 제한의 적용 여부를 지시하는 정보를 컨텐츠 특성 제한 정보라 지칭한다. 구체적으로 컨텐츠 특성 제한은 부호화 모드의 제한, 필터링의 제한, 예측 방법의 제한, 보간 방법의 변경 및 변환 타입의 제한 중 적어도 어느 하나를 포함할 수 있다. 구체적인 실시 예에서 컨텐츠 특성 제한 정보는 앞서 설명한 실시 예들에서 스무딩 필터 정보를 대체할 수 있다.
인코더는 컨텐츠 특성 제한 정보를 미리 지정된 레벨로 시그널링할 수 있다. 또한, 디코더는 미리 지정된 레벨 별로 컨텐츠 특성 제한 여부를 판단할 수 있다. 이때, 미리 지정된 레벨은 VPS(video parameter set), SPS(sequence parameter set), PPS(picture parameter set), 픽쳐, 슬라이스 타일 및 블록 중 어느 하나일 수 있다.
컨텐츠 특성 제한 정보가 컨텐츠 특성 제한이 적용됨을 지시하는 경우, 디코더는 앞서 설명한 스무딩 필터링을 적용하지 않을 수 있다. 또한, 컨텐츠 특성 제한 정보가 컨텐츠 특성 제한이 적용됨을 지시하는 경우, 인코더는 미리 지정된 부호화 모드를 비활성화할 수 있다. 이때, 미리 지정된 부호화 모드는 MIP, EIP, SGPM, GPM, TMRL, DIMD, TIMD, 및 ISP 중 적어도 하나를 포함할 수 있다. 디코더는 미리 지정된 부호화 모드에 대한 파싱을 수행하지 않고, 미리 지정된 부호화 모드를 미리 지정된 값으로 추론할 수 있다. 미리 지정된 값은 미리 지정된 부호화 모드를 적용하지 않는 것을 나타낼 수 있다. 컨텐츠 특성 제한 정보가 컨텐츠 특성 제한이 적용됨을 지시하는 경우, 비디오 신호 처리 장치는 앞서 설명한 정수 단위 보간 방법을 적용할 수 있다. 정수 단위 보간 방법을 적용하는 구체적인 실시 예는 앞서 설명한 실시 예들 중 어느 하나를 따를 수 있다.
컨텐츠 특성 제한 정보가 컨텐츠 특성 제한이 적용됨을 지시하는 경우, 인코더는 미리 지정된 인트라 예측 모드만을 사용할 수 있다. 이때, 미리 지정된 인트라 예측 모드는 평면 모드, DC 모드, 수평 모드, 수직 모드, 및 대각 방향 모드 중 적어도 하나를 포함할 수 있다. 또 다른 구체적인 실시 예에서 미리 지정된 인트라 예측 모드는 평면 모드, 수직 방향 명면 모드, 수평 방향 평면 모드, DC 모드, 상단 샘플만을 사용한 DC 모드, 좌측 샘플만을 사용한 DC 모드, 수평 모드, 수직 모드, 대각 방향 모드, 및 역 대각 방향 모드 중 적어도 하나를 포함할 수 있다. 컨텐츠 특성 제한 정보가 컨텐츠 특성 제한이 적용됨을 지시하는 경우, 디코더는 미리 지정된 인트라 예측 모드 중 하나를 지시하는 정보를 파싱하여 현재 블록에 대한 인트라 예측 모드를 결정할 수 있다. 이러한 실시 예를 통해 인트라 예측 모드 시그널링에 소요되는 비트량을 줄일 수 있다. 인트라 예측 모드의 제한은 MPM 리스트 구성에 사용되는 인트라 예측에도 적용될 수 있다.
또한, 컨텐츠 특성 제한 정보는 복수의 정보로 구분되고, 앞서 설명한 컨텐츠 특성 제한에 관한 실시 예들 각각은 복수의 정보 각각에 따라 적용될 수 있다. 예컨대, 비트 스트림은 인트라 예측 모드 제한의 적용 여부만을 지시하는 인트라 예측 모드 제한 정보를 포함할 수 있다. 이때, 비디오 신호 처리 장치는 인트라 예측 모드 제한 정보를 블록 단위로 적용할 수 있다.
또한, 인코더는 인트라 예측 모드 제한이 적용되는 블록에 대한 잔차 신호를 시그널링하지 않을 수 있다. 인트라 예측 모드 제한이 적용되는 블록은 묵시적으로 잔차 신호가 없는 블록을 나타낼 수 있다. 디코더는 인트라 예측 모드 제한이 적용되는 블록에 대해서는 잔차 신호가 존재하지 않는 것으로 판단할 수 있다. 이때, 디코더는 잔차 신호에 대한 파싱을 수행하지 않고, 예측 블록을 복원 블록으로 사용할 수 있다.
스크린 컨텐츠의 에지 영역은 변화가 없는 배경 영역과 혼합되어 있는 경우가 대부분이다. 현재 블록의 주변 블록이 에지 영역과 배경 영역으로 혼합되어 있는 경우, 주변 샘플을 모두 사용하는 예측이 비효율적일 수 있다. 따라서, 인코더에서는 현재 블록에 예측에 사용되는 참조 샘플을 지시하는 정보를 비트스트림에 포함시킬 수 있다. 설명의 편의 위해 이 정보를 참조 샘플 영역 정보로 지칭한다. 디코더는 참조 샘플 영역 정보를 파싱하고, 참조 샘플 영역 정보에 따라 참조 샘플을 결정할 수 있다. 인코더는 참조 샘플 영역 정보의 활성화 여부를 미리 지정된 레벨로 시그널링할 수 있다. 또한, 디코더는 미리 지정된 레벨 별로 참조 샘플 영역 정보의 활성화 여부를 판단할 수 있다. 이때, 미리 지정된 레벨은 VPS(video parameter set), SPS(sequence parameter set), PPS(picture parameter set), 픽쳐, 슬라이스, 타일 및 블록 중 어느 하나일 수 있다. 참조 샘플 영역 정보의 활성화 여부를 지시하는 정보를 참조 샘플 영역 제한 활성화 정보로 지칭할 수 있따.
또한, 인코더가 미리 지정된 모드 중 하나의 부호화 모드를 사용하여 블록을 부호화하는 경우, 인코더는 블록 단위로 참조 샘플 영역 제한 활성화 정보를 비트스트림에 포함시킬 수 있다. 디코더는 현재 블록의 부호화 모드가 미리 지정된 모드 중에 하나인 경우, 디코더는 참조 샘플 영역 제한 활성화 정보를 파싱하여, 참조 샘플 영역 정보에 따라 참조 샘플을 결정할 수 있다. 미리 지정된 모드는 DIMD, TIMD, OBIC, Intra TMP, IBC, EIP, TMRL, ISP, SGPM, GPM, MIP, 및 PDP 중 적어도 하나를 포함할 수 있다.
참조 샘플 영역 제한이 활성화되는 경우, 디코더는 참조 샘플 선택 정보에 따라 상단 참조 샘플, 좌측 참조 샘플 중 어떠한 참조 샘플을 사용할지 결정할 수 있다. 또한, 인코더는 참조 샘플 영역 제한이 적용되는 블록에 대한 잔차 신호를 시그널링하지 않을 수 있다. 참조 샘플 영역 제한이 적용되는 블록은 묵시적으로 잔차 신호가 없는 블록을 나타낼 수 있다. 디코더는 참조 샘플 영역 제한이 적용되는 블록에 대해서는 잔차 신호가 존재하지 않는 것으로 판단할 수 있다. 이때, 디코더는 잔차 신호에 대한 파싱을 수행하지 않고, 예측 블록을 복원 블록으로 사용할 수 있다.
또한, 인코더는 DIMD 또는 TIMD로 부호화되는 블록에서 DIMD 또는 TIMD에서 사용되는 참조 샘플을 지시하는 정보를 비트스트림에 포함시킬 수 있다. 이때, DIMD 또는 TIMD에서 사용되는 참조 샘플을 지시하는 정보는 상단 참조 샘플 또는 좌측 참조 샘플을 지시할 수 있다. 현재 블록에 DIMD 또는 TIMD가 적용된 경우, 디코더는 DIMD 또는 TIMD에서 사용되는 참조 샘플을 지시하는 정보가 지시하는 참조 샘플을 사용하여 DIMD 또는 TIMD 예측을 수행할 수 있다.
또한, 인코더가 미리 지정된 모드 중 하나의 부호화 모드를 사용하여 블록을 부호화하는 경우, 인코더는 해당 블록에 대한 잔차 신호를 시그널링하지 않을 수 있다. 미리 지정된 모드 중 하나의 부호화 모드를 사용하여 부호화된 블록은 묵시적으로 잔차 신호가 없는 블록을 나타낼 수 있다. 디코더는 미리 지정된 모드 중 하나의 부호화 모드를 사용하여 부호화된 블록에 대해서는 잔차 신호가 존재하지 않는 것으로 판단할 수 있다. 이때, 디코더는 잔차 신호에 대한 파싱을 수행하지 않고, 예측 블록을 복원 블록으로 사용할 수 있다. 미리 지정되는 모드는 DIMD, TIMD, OBIC, Intra TMP, IBC, EIP, TMRL, ISP, SGPM, MIP, 및 PDP 중 적어도 어느 하나를 포함할 수 있다.
인코더는 인트라 예측으로 부호화되는 픽쳐의 블록마다 잔차 신호가 없음을 지시하는 스킵(skip) 플래그 설정하고, 스킵 플래그를 비트스트림에 포함시킬 수 있다. 또 다른 구체적인 실시 예에서 인코더는 현재 블록에 잔차 신호가 존재하지 않는 경우, 스킵 플래그를 '1'로 시그널링 한 후, 현재 블록이 어떤 모드로 예측 되는지를 나타내는 정보를 시그널링하여 비트스트림에 포함시킬 수 있다. 이때, 인코더는 해당 블록에 대한 잔차 신호가 존재하는지 여부를 시그널링하지 않을 수 있다. 디코더는 스킵 플래그를 기초로 스킵 플래그에 해당하는 블록이 잔차 신호를 갖는지 판단할 수 있다. 현재 블록에 스킵 모드가 적용된 경우, 디코더는 현재 블록에 어떠한 부호화 모드를 사용하는지에 대한 정보를 파싱할 수 있다. 이때, 디코더는 잔차 신호에 대한 정보를 파싱하지 않을 수 있다. 잔차 신호의 존재 여부에 대한 정보는 잔차 신호가 존재하지 않는다고 묵시적으로 나타낼 수 있으며, 휘도 잔차 신호와 Cb 색차 잔차 신호, Cr 색차 잔차 신호가 존재하지 않는다고 나타낼 수 있다. 블록이 어떤 모드로 부호화된지를 나타내는 정보는 DIMD, TIMD, OBIC, Intra TMP, IBC, EIP, TMRL, ISP, SGPM, GPM, MIP, 및 PDP 중 어느 하나를 지시할 수 있다.
도 47은 본 발명의 실시 예에 따른 매트릭스 기반 인트라 예측 방법을 보여준다.
많은 영상 데이터를 통해 현재 블록과 참조 샘플 사이의 관계를 추론한 모델(또는 매트릭스)을 이용하여 인트라 예측을 수행하는 방법을 매트릭스 기반 인트라 예측 방법(matrix based position dependent intra prediction, PDP)라고 할 수 있다. 도 47의 실시 예에서, 비디오 신호 처리 장치는 현재 예측할 블록(p)에 인접한 복원된 참조 샘플(r) r(k)와 미리 정의된 매트릭스 F(x,y,k) 사이의 계산(도 47의 (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 기반 방법을 사용하지 못할 수 있다. 또한, 비디오 신호 처리 장치는 PDP 모드에 대한 적용 가능 여부를 현재 블록의 인트라 예측 방향성 모드에 따라 결정할 수 있다. 구체적인 실시 예에서 현재 블록의 인트라 예측 방향성 모드가 미리 지정된 모드인 경우, 비디오 신호 처리 장치는 현재 블록에 PDP를 적용할 수 있다. 미리 지정된 모드는 현재 블록의 부호화 모드에 따라 달라질 수 있다. 현재 블록의 부호화 모드가 MPM 기반의 인트라 예측 모드이고, 인트라 예측 모드가 Planar(또는 Directional Planar), DC, 짝수 모드인 경우, 비디오 신호 처리 장치는 기존 인트라 예측 방향성 모드를 통한 인트라 예측을 사용하지 않고 PDP를 통한 매트릭스 기반 인트라 예측을 사용하여 현재 블록에 대한 예측 블록을 생성할 수 있다. 현재 블록의 부호화 모드는 DIMD, OBIC, CIIP, SGPM, TIMD, TMRL, Directional Planar, EIP, MIP, ISP, IBC, Intra TMP, BDPCM, Platte, Inter 모드, LM, 및 CCCM 중 하나의 모드일 수 있다. PDP를 통해 현재 블록을 예측하는데 사용되는 참조 샘플이 현재 블록이 속하는 슬라이스 및/또는 타일 내에 있는 경우, 비디오 신호 처리 장치는 현재 블록에 PDP를 적용할 수 있다. PDP를 통해 현재 블록을 예측하는데 사용되는 참조 샘플이 현재 블록이 속하는 슬라이스 및/또는 타일이 아닌 슬라이스 및 타일에 있는 경우, 비디오 신호 처리 장치는 현재 블록에 PDP를 적용하지 않을 수 있다. 현재 블록에 PDP 모드가 적용되는 경우, 비디오 신호 처리 장치는 현재 블록의 인트라 예측 모드에 따라 사용할 참조 샘플이 달라질 수 있다. 구체적인 실시 예에서 인트라 예측 모드가 미리 지정된 모드인 경우, 참조 샘플의 크기는 미리 지정된 제1 크기일 수 있다. 인트라 예측 모드가 미리 지정된 모드가 아닌 경우, 참조 샘플의 크기는 미리 지정된 제2 크기일 수 있다. 미리 지정된 모드는 인트라 예측 모드(도 6 참고)가 19보다 크거나 같고 49보다 작거나 같은 범위일 수 있다. 도 47에서, 미리 지정된 제1 크기는 상단 참조 샘플은 W x T1이고 좌측 참조 샘플은 T2 x (H + T1)일 수 있다. 또한, 미리 지정된 제2 크기는 상단 참조 샘플은 2W x T1이고 좌측 참조 샘플은 T2 x (2H + T1)일 수 있다. 이때, W x T1은 가로 길이가 W이고 세로 길이가 T1일 수 있다.
현재 블록에 PDP 방법이 적용 가능한 경우, 인트라 예측 방향성 모드를 통한 인트라 예측을 수행하지 않고 인트라 예측 모드가 지시하는 매트릭스를 이용하여 예측이 수행될 수 있다. 이때, 인트라 예측 모드가 지시하는 매트릭스를 이용하는 예측은 기존 인트라 예측 방법을 대체하는 모드일 수 있다. 인트라 예측 모드가 지시하는 매트릭스를 이용하는 예측이 적용되는 경우, 블록 단위로 PDP 모드에 대한 적용 여부를 시그널링하지 않아도 될 수 있다. 현재 블록에 DIMD, TIMD, OBIC, SGPM, TMRL, Intra TMP, IBC, 및 CIIP 중 어느 하나의 모드가 적용되고, 인트라 예측 방향성 모드가 PDP 방법이 적용 가능한 모드인 경우, 비디오 신호 처리 장치는 상기 인트라 예측 방향성 모드에 대한 예측 블록을 PDP 방법을 통해 생성할 수 있다. 구체적인 실시 예에서 현재 블록에 DIMD 모드가 적용된 경우, 비디오 신호 처리 장치는 최대 6개의 인트라 예측 방향성 모드를 통해 예측한 블록을 가중 평균할 수 있다. PDP 방법이 적용 가능한 인트라 예측 방향성 모드가 적용되는 경우, PDP 방법을 통해 예측 블록이 생성될 수 있다. 이때, DIMD 모드에서 가중 평균에 사용될 예측 블록은 인트라 예측 방향성 모드를 통해 예측한 블록 및 PDP 방법을 통해 예측한 블록 중 적어도 하나 이상일 수 있다. TIMD, OBIC, SGPM, TMRL, Intra TMP, IBC, 및 CIIP가 적용될 때, 이러한 실시 예들이 적용될 수 있다.
DIMD에서 비디오 신호 처리 장치는 현재 블록의 주변 샘플로부터 계산된 방향성을 이용하여 인트라 예측 방향성 모드를 유도한다. 방향성을 계산하는데 사용되는 주변 샘플의 개수에 따라 유도되는 인트라 예측 방향성 모드의 정확성이 달라질 수 있다. 현재 블록의 크기가 작은 경우, 방향성을 계산하는데 사용되는 주변 샘플의 개수가 작을 수 있다. 유도되는 인트라 예측 방향성 모드의 정확성을 향상시키기 위해, 비디오 신호 처리 장치는 방향성을 계산하는데 사용되는 주변 샘플의 개수를 현재 블록의 가로 및 세로 크기, 및 현재 블록의 가로와 세로 길이의 비율 중 적어도 하나 이상을 사용하여 결정할 수 있다. 비디오 신호 처리 장치는 방향성 계산을 통해 도출된 히스토그램 도수값의 합에 대한 제1 임계치 값을 현재 블록의 가로 및 세로 크기, 현재 블록의 가로와 세로 길이의 비율 중에서 적어도 하나 이상을 사용하여 결정할 수 있다. 이때, 제1 임계치값보다 도수값의 합이 커질 때까지 주변 샘플을 통해 방향성이 계산되어 히스토그램에 누적될 수 있다. 구체적인 실시 예에서 현재 블록의 가로 및 세로의 크기가 미리 지정된 크기보다 작은 경우, 비디오 신호 처리 장치는 방향성 계산을 통해 도출된 히스토그램 도수값의 합이 미리 지정된 제1 값보다 커질 때까지 방향성을 계산하는데 사용되는 주변 샘플의 개수를 증가시킬 수 있다. 미리 지정된 크기는 현재 블록의 가로와 세로 크기가 MxN인 경우일 수 있다. M, N은 정수 일 수 있고, 16x16일 수 있다. 미리 지정된 제1 값은 정수일 수 있고, 예컨대 1000일 수 있다. 또한, 미리 지정된 제1 값은 방향성을 계산하는데 사용되는 주변 샘플의 개수에 미리 지정된 제2 값을 곱셈한 값일 수 있다. 구체적으로 제2 값은 정수 일 수 있고, 예컨대 1000일 수 있다. 제1 임계치를 기반으로 히스토그램을 누적하여 인트라 예측 방향성 모드를 유도하는 방법을 적응적 DIMD (Adaptive DIMD) 방법 또는 적응적 HoG DIMD(Adaptive Histogram of Gradients DIMD)라 지칭할 수 있다.
도 48은 본 발명의 실시 예에 따라 DIMD 크로마 모드에서 사용되는 주변 샘플을 보여준다.
비디오 신호 처리 장치는 현재 색차 블록을 위한 DIMD 모드를 유도할 수 있으며, 이때 방향성을 계산하는데 사용되는 주변 샘플은 도 48의 회색 샘플 위치(현재 휘도 블록 주변의 샘플, 현재 Cb 색차 블록 주변의 샘플, 현재 Cr 색차 블록 주변의 샘플)일 수 있다. 비디오 신호 처리 장치는 회색 샘플 위치에서 계산된 방향성을 이용하여 인트라 예측 방향성 모드를 유도한 후, 유도된 방향성 모드를 기초로 누적 히스토그램을 생성할 수 있다. 비디오 신호 처리 장치는 가장 많이 발생된 인트라 예측 방향성 모드를 Cb, Cr 색차 블록을 위한 인트라 예측 방향성 모드로 사용할 수 있다. 이를 DIMD chroma 라 지칭할 수 있다.
도 49는 본 발명의 실시 예에 따른 비디오 신호 처리 장치가 색차 블록에서 참조 샘플 라인을 유도하는 것을 보여준다.
비디오 신호 처리 장치는 색차 블록에서 인트라 예측을 수행할 때 사용되는 참조 샘플 라인을, 참조 샘플 라인 인트라 예측 모드 리스트를 기초로 설정할 수 있다. 참조 샘플 라인 인트라 예측 모드 리스트는 참조 샘플 라인과 색차 블록을 위한 인트라 예측 모드 사이의 조합 후보로 구성된 리스트이다. 참조 샘플 라인 인트라 예측 모드 리스트는 참조 샘플 라인 (1, 3, 5)와 인트라 예측 모드(DM 모드(현재 색차 블록에 대응되는 휘도 블록의 인트라 예측 모드), DIMD 크로마, 대응되는 휘도 블록의 인트라 예측 모드(도 49의 (a)에서 C, TL, TR, BL, BR), 현재 색차 블록 주변의 인트라 예측 모드(도 49의 (a)에서 TL', T', TR', L', BL')) 간의 조합 후보를 사용하여 구성될 수 있다. 이때, 현재 색차 블록 주변의 인트라 예측 모드가 LM 모드(또는 CCP 모드), DBV 모드 중 하나인 경우, 현재 색차 블록 주변의 인트라 예측 모드는 인트라 예측 방향성 모드가 아니므로 참조 샘플 라인 인트라 예측 모드 리스트의 조합 후보로 사용되지 않을 수 있다. 또한, 현재 색차 블록 주변의 인트라 예측 모드가 DM 모드, DIMD 크로마 모드 중 하나인 경우, 현재 색차 블록 주변의 인트라 예측 모드는 이미 리스트에 포함된 모드이므로 참조 샘플 라인 인트라 예측 모드 리스트의 조합 후보로 사용되지 않을 수 있다. 이를 Chroma TMRL 라고 할 수 있다.
참조 샘플 라인 인트라 예측 모드 리스트는 템플릿 코스트를 기반으로 재정렬될 수 있다. 도 49의 (b)에서, 비디오 신호 처리 장치는 현재 색차 블록 주변의 복원된 샘플과 대응되는 휘도 블록을 이용하여 기준 템플릿을 구성할 수 있다. 비디오 신호 처리 장치는 참조 샘플 라인 인트라 예측 모드 리스트 내의 후보로부터 설정된 참조 샘플 라인과 인트라 예측 모드를 이용하여 기준 템플릿에 대한 예측 템플릿을 생성할 수 있다. 비디오 신호 처리 장치는 기준 템플릿과 예측 템플릿 사이의 SAD, MR-SAD, 및 SATD(Sum of Absolute Transformed Differences) 중 하나를 이용하여 코스트를 계산할 수 있다. 이때, 비디오 신호 처리 장치는 휘도 템플릿으로부터 계산된 코스트와 색차 템플릿으로부터 계산된 코스트의 가중치를 서로 다르게 설정할 있다. 구체적으로 비디오 신호 처리 장치는 휘도 템플릿으로부터 계산된 코스트가 색차 템플릿으로부터 계산된 코스트보다 높은 가중치를 사용하여 최종 코스트를 계산할 수 있다.
색차 블록에서 참조 샘플 라인을 유도하는 방법이 블록 단위로 시그널링될 수 있다. LM 모드 또는 CCP 모드가 적용되지 않는 블록에 대해, 인코더는 해당 색차 블록에서 참조 샘플 라인을 유도하는 방법의 사용 여부를 지시하는 정보를 비트스트림에 포함시킬 수 있다. 또한, 색차 블록에 참조 샘플 라인을 유도하는 방법이 사용되는 경우, 인코더는 해당 블록의 참조 샘플 라인 인트라 예측 모드 리스트에서 최적의 조합 후보에 대한 인덱스를 지시하는 정보를 비트스트림에 포함시킬 수 있다. 현재 블록에 LM 모드 또는 CCP 모드가 적용되지 않는 경우, 디코더는 플래그 정보를 파싱하고, 플래그 정보를 이용하여 색차 블록에서 참조 샘플 라인을 유도하는 방안을 적용할 지를 결정할 수 있다. 현재 색차 블록에서 참조 샘플 라인을 유도하는 방안이 적용된 경우, 디코더는 인덱스 정보를 파싱하고, 인덱스 정보를 이용하여 참조 샘플 라인 인트라 예측 모드 리스트에서 최적의 후보를 결정할 수 있다.
도 50은 본 발명의 실시 예에 따른 비디오 신호 처리 장치가 BV(block vector)를 기초로 유도된 참조 블록에서 DIMD 모드를 유도하는 것을 보여준다.
현재 블록의 인트라 예측 방향성 모드를 유도하기 위해, 비디오 신호 처리 장치는 현재 블록의 주변 블록 정보로부터 BV를 유도하고, 현재 픽쳐 내 복원된 영역에서 BV가 지시하는 참조 블록으로부터 DIMD 모드를 유도할 수 있다. 이때, 현재 블록을 위한 BV를 유도하기 위해, 비디오 신호 처리 장치는 현재 블록의 주변 블록에서 사용된 BV, 및 Intra TMP를 통해 유도된 BV 중에서 적어도 하나 이상을 이용하여 BV 리스트를 구성할 수 있다. 이때, 비디오 신호 처리 장치는 BV 리스트를 이용하여 현재 블록에 대한 BV를 유도할 수 있다. BV 리스트는 템플릿 코스트를 기초로 재정렬될 수 있다. 비디오 신호 처리 장치는 템플릿 코스트가 낮은 순서부터 높은 순서대로 미리 정해진 개수까지의 BV를 현재 블록에 대한 BV로 사용할 수 있다. 미리 정해진 개수는 양의 정수 일 수 있다. 예컨대, 미리 지정해진 개수는 1,2, 및 3 중 어느 하나일 수 있다. 또한, BV가 지시하는 참조 블록으로부터 DIMD 모드를 유도하기 위해, 비디오 신호 처리 장치는 참조 블록에서 사용된 DIMD 모드, 참조 블록의 BV가 지시하는 또 다른 참조 블록에서 사용된 DIMD 모드, 참조 블록 내 샘플 및/또는 참조 블록에 인접한 주변 샘플 중 적어도 하나의 샘플 위치에 소벨(Sobel) 필터를 적용하여 히스토그램을 생성할 수 있다. 비디오 신호 처리 장치는 히스토그램으로부터 유도된 DIMD 모드 중 적어도 하나를 사용하여 DIMD 모드를 유도할 수 있다. 유도된 DIMD 모드는 하나 이상의 인트라 예측 방향성 모드일 수 있다. 비디오 신호 처리 장치는 유도된 DIMD 모드를 이용하여 현재 블록에 대한 예측 블록(directional predictors)을 생성할 수 있다. DIMD 모드가 2개 이상인 경우, 예측 블록도 2개 이상 생성될 수 있다. 이때, 비디오 신호 처리 장치는 예측 블록을 가중 평균하여 최종 예측 블록을 생성할 수 있다. 또한, 비디오 신호 처리 장치는 유도된 하나 이상의 BV를 이용하여 생성된 하나 이상의 BV 기반 예측 블록을, 가중 평균하여 하나의 BV 기반 예측 블록(Non-directional predictor)을 생성할 수 있다. 또한, 비디오 신호 처리 장치는 BV 기반 예측 블록과 인트라 예측 모드를 이용하여 생성된 인트라 예측 모드 기반 예측 블록을 가중 평균하여 최종 예측 블록(Prediction block)을 생성할 수 있다. BV 기반 DIMD 유도 방안을 BVG-DIMD(Block Vector Guided DIMD) 모드라 지칭할 수 있다.
비디오 신호 처리 장치는 DIMD 및 TIMD 방법을 조합하여, 현재 블록의 인트라 예측 모드를 유도할 수 있다. 비디오 신호 처리 장치는 DIMD를 이용하여 미리 지정된 개수(X)의 인트라 예측 모드를 유도할 수 있다. 이때, X는 1이상의 정수로, 예컨대 8일 수 있다. 이때, 현재 블록의 샘플 수에 따라 히스토그램을 구성하기 위한 템플릿 영역이 달라질 수 있다. 또한, 미리 지정된 샘플 수보다 큰 블록의 경우, 비디오 신호 처리 장치는 미리 지정된 샘플 수와 같거나 작은 블록이 사용되는 경우에서보다 더 넓은 영역을 사용하여 히스토그램을 구성할 수 있다. 미리 지정된 샘플 수는 1 이상의 정수로, 예컨대 128일 수 있다. 인트라 예측 모드를 유도할 때, 비디오 신호 처리 장치는 모든 템플릿 영역에서 생성된 히스토그램을 기반으로 최대 L개의 인트라 예측 모드를 유도할 수 있다. 또한, 비디오 신호 처리 장치는 현재 블록의 상단 템플릿 영역에서 생성된 히스토그램을 기초로 최대 M개의 인트라 예측 모드를 유도할 수 있다. 이때, 비디오 신호 처리 장치는 현재 블록의 좌측 템플릿 영역을 사용해서 생성된 히스토그램을 기초로 최대 N개의 인트라 예측 모드를 유도하여, 도수값이 높은 순서대로 리스트에 추가할 수 있다. L, M, N은 1이상의 정수로, 예컨대 L=4, M=2, N=2 일 수 있다. 이를 통해 리스트가 채워지지 않는 경우, 비디오 신호 처리 장치는 최대 X개의 인트라 예측 모드가 채워질 때까지 리스트 내 모드와 인접한 모드를 리스트에 추가할 수 있다. 이때, 비디오 신호 처리 장치는 템플릿 코스트를 기반으로 리스트를 재정렬할 수 있다. 또한, 블록 내 샘플 수가 미리 지정된 샘플 수보다 작은 경우, 비디오 신호 처리 장치는 템플릿 코스트를 기반으로 리스트를 재정렬할 수 있다. 미리 지정된 샘플 수는 1 이상의 정수로, 예컨대 256일 수 있다. 비디오 신호 처리 장치는 템플릿 코스트가 가장 작은 리스트의 첫 번째 후보를 MDIP(most dominant intra prediction mode) 모드로 선정할 수 있다. 인코더는 현재 블록에 MDIP 모드를 적용할지 여부를 지시하는 MDIP 적용 플래그를 비트스트림에 포함시킬 수 있다. 디코더는 MDIP 적용 플래그를 파싱하여 현재 블록에 MDIP 모드를 적용할 지를 결정할 수 있다. 현재 블록이 MDIP 모드인 경우, 비디오 신호 처리 장치는 리스트를 구성하여 템플릿 코스트가 가장 낮은 인트라 예측 모드를 사용하여 현재 블록에 대한 예측 블록을 생성할 수 있다. 또 다른 구체적인 실시 예에서 디코더는 MDIP 적용 플래그를 파싱하여 현재 블록에 MDIP 모드를 적용할 지 결정할 수 있다. 현재 블록이 MDIP 모드인 경우, 비디오 신호 처리 장치는 리스트를 구성하고, 리스트에서 첫 번째 인트라 예측 모드를 사용하여 현재 블록에 대한 예측 블록을 생성할 수 있다. 현재 블록에 MDIP 모드가 적용되지 않은 경우, 비디오 신호 처리 장치는 리스트에서 우선 순위가 낮은 미리 지정된 Y개의 인트라 예측 모드를 non-MPM 리스트에서 제외시킬 수 있으다. 이때, 비디오 신호 처리 장치는 non-MPM 리스트의 최대 개수를 미리 지정된 Y개만큼 감소시킬 수 있다. Y는 1이상의 정수로, 예컨대, 20일 수 있다.
비디오 신호 처리 장치가 인트라 예측 블록을 생성할 때, 비디오 신호 처리 장치는 복수의 예측 블록을 가중 평균하여 단일 예측 블록을 생성하는 블렌딩을 사용할 수 있다. 구체적인 실시 예에서 DIMD 모드는 주변 샘플의 방향성에 기반한 히스토그램에서 도수값이 높은 인트라 예측 방향성 모드를 미리 정의된 제1 개수만큼 선정할 수 있다. 이때, 비디오 신호 처리 장치는 선정된 여러 개의 인트라 예측 모드마다 각각의 예측 블록을 생성하고, 생성한 예측 블록을 가중치 평균하여 하나의 예측 블록을 생성할 수 있다. 또한, OBIC 모드에서 비디오 신호 장치는 주변 블록의 인트라 예측 모드를 기반으로 유도된 히스토그램에서 도수값이 높은 인트라 예측 방향성 모드를 미리 정의된 제2 개수만큼 선정할 수 있다. 이때, 비디오 신호 처리 장치는 선정된 여러 개의 인트라 예측 모드마다 예측 블록을 생성할 수 있다. 비디오 신호 처리 장치는 생성한 예측 블록을 가중치 평균하여 하나의 예측 블록을 생성할 수 있다. 또한, TIMD 또는 TIMD SAD 모드에서 비디오 신호 처리 장치는 주변 블록에서 사용된 인트라 예측 모드를 기초로 인트라 예측 후보 리스트를 구성할 수 있다. 이때, 비디오 신호 처리 장치는 리스트의 각 후보를 템플릿 코스트 기반으로 재정렬할 수 있다. 비디오 신호 처리 장치는 재정렬된 인트라 예측 후보 리스트에서 미리 정의된 제3 개수만큼의 인트라 예측 모드를 선정하고, 인트라 예측 모드마다 예측 블록을 생성할 수 있다. 비디오 신호 처리 장치는 생성된 예측 블록을 가중 평균하여 하나의 예측 블록을 생성할 수 있다. 여기서 제1 개수, 제2 개수, 및 제3 개수는 1이상의 정수일 수 있고, 예컨대 각각 5, 5, 2일 수 있다. 또한, TIMD 또는 TIMD SAD 모드에서 가중치 평균이 적용될 때, 비디오 신호 처리 장치는 평면 모드를 사용하여 예측한 블록을 다른 예측 블로과 함께 가중 평균할 수 있다. 이러한 가중 평균을 사용하는 예측 방식을 블렌딩이라 지칭할 수 있다.
스크린 컨텐츠 영상의 특성상, 이러한 블렌딩이 효과적이지 않을 수 있다. 인코더는 블렌딩의 비활성화 여부를 지시하는 블렌딩 플래그를 비트스트림에 포함시킬 수 있다. 디코더는 비트스트림으로부터 블렌딩 플래그를 획득하여, 블렌딩의 비활성화 여부를 판단할 수 있다. 이때, 블렌딩 플래그는 미리 지정된 레벨로 적용될 수 있다. 이때, 미리 지정된 레벨은 VPS(video parameter set), SPS(sequence parameter set), PPS(picture parameter set), 픽쳐, 슬라이스 타일 및 블록 중 어느 하나일 수 있다.
만일 블렌딩 방식이 비활성화되고, 현재 블록에 DIMD 모드가 적용된 경우, 비디오 신호 처리 장치는 주변 샘플의 방향성을 기반으로 유도된 히스토그램에서 도수값이 가장 높은 하나의 인트라 예측 방향성 모드만을 사용하여 예측 블록을 생성할 수 있다. 또한, 블렌딩 방식이 비활성화 되고, 현재 블록에 OBIC 모드가 적용된 경우, 비디오 신호 처리 장치는 주변 블록에서 사용된 인트라 예측 모드를 기초로 유도된 히스토그램에서 도수값이 가장 높은 하나의 인트라 예측 방향성 모드만을 사용하여 예측 블록을 생성할 수 있다. 또한, 블렌딩 방식이 비활성화 되고, 현재 블록에 TIMD 모드, TIMD SAD 모드 또는 TIMD 머지모드가 적용된 경우, 비디오 신호 처리 장치는 주변 블록에서 사용된 인트라 예측 모드를 기초로 인트라 예측 후보 리스트를 구성할 수 있다. 이때, 비디오 신호 처리 장치는 리스트의 각 후보를 템플릿 코스트를 기초로 리스트를 재정렬하고, 템플릿 코스트가 가장 낮은 하나의 인트라 예측 모드를 사용하여 예측 블록을 생성할 수 있다. 비디오 신호 처리 장치가 블렌딩을 적용할 때, 비디오 신호 처리 장치는 복수의 인트라 예측 모드를 사용하여 예측할 블록과 Planar 모드로 예측한 블록을 가중 평균할 수 있다. 이때, 평면 모드로 예측한 블록은 BV 기반의 예측 블록으로 대체될 수 있다. 비디오 신호 처리 장치는 평면 모드로 예측한 블록과 BV 기반의 예측 블록 중 템플릿 코스트가 낮은 예측 모드를 사용할 수 있다. 블렌딩이 비활성화된 경우, 비디오 신호 처리 장치는 현재 블록에 대한 BV 유도 과정을 수행하지 않을 수 있다.
현재 블록의 인트라 예측 모드는 다음 블록의 부호화에 사용될 수 있다. 블렌딩이 비활성화된 경우, 비디오 신호 처리 장치는 현재 블록에 단일 인트라 예측 모드만 저장할 수 있다. 블렌딩이 비활성화된 경우, 비디오 신호 처리 장치는 주변 블록으로부터 하나의 인트라 예측 모드만 유도할 수 있다. 블렌딩이 비활성화되더라도, 비디오 신호 처리 장치는 현재 블록을 위해 복수의 인트라 예측 모드에 대한 정보를 유도하거나, 현재 블록에 대한 블록 벡터를 유도하거나 또는 현재 블록에 대한 움직임 정보를 유도할 수 있다. 비디오 신호 처리 장치는 현재 블록에 대한 복수의 인트라 예측 모드, 복수의 인트라 예측 모드 각각에 대한 가중치 정보, 복수의 인트라 예측 모드 각각에 대한 위치별 특성 가중치, 변환 타입 정보, 블록 벡터 정보, 및 움직임 정보 중 적어도 하나 이상을 저장할 수 있다.
인코더는 특정 기능에 대해 비활성화 여부 및 미리 지정된 대체 방법 수행 필요 여부를 지시하는 정보를 미리 지정된 레벨로 설정하고, 이를 지시하는 활성화 정보를 비트스트림에 포함시킬 수 있다. 이때, 미리 지정된 레벨은 VPS(video parameter set), SPS(sequence parameter set), PPS(picture parameter set), 픽쳐, 슬라이스 타일 및 블록 중 어느 하나일 수 있다. 디코더는 활성화 정보를 기초로 미리 지정된 레벨에서 특정 기능이 비활성화되었는지, 대체 방법을 수행할 지 판단할 수 있다. 이는 앞서 설명한 바와 같이 카메라 촬영 영상의 경우, 스크린 컨텐츠 영상과 특성이 다르기 때문에, 특정 기능을 비활성화하는 것은 효과적이지 않을 수 있기 때문이다. 또한, 기존의 방법을 그대로 적용하는 것도 비효과적일 수 있기 때문이다. 이러한 실시 예에서 특정 기능은 Intra TMP에서 LIC 모드, 필터링 모드, 퓨전 모드 중 적어도 하나일 수 있다. 또한, 특정 기능은 BF(Bilateral Filter)를 포함할 수 있다. 또한, 특정 기능은 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, Inter-CCCM, CCCM 머지 중 적어도 하나의 모델을 포함할 수 있다. 또한, 특정 기능은 CCP 예측에서 2개 이상의 모델을 사용하는 방법을 포함할 수 있다. 또한, 특정 기능은 EIP 예측에서 2개 이상의 모델을 사용하는 방법을 포함할 수 있다. 또한, 특정 기능은 sbTMVP를 포함할 수 있다. 또한, 특정 기능은 어파인(affine), 소수점 단위의 블록 벡터를 적용하는 방법, 및 서브 블록 단위의 OBMC 방법 중 적어도 하나를 포함할 수 있다.
인코더는 특정 기능에 대해 미리 지정된 화소 단위의 움직임 보정의 활성화 여부를 지시하는 정보를 미리 지정된 레벨로 설정하고, 이를 지시하는 미리 지정된 화소 단위 움직임 보정 활성화 정보를 비트스트림에 포함시킬 수 있다. 이때, 미리 지정된 레벨은 VPS(video parameter set), SPS(sequence parameter set), PPS(picture parameter set), 픽쳐, 슬라이스 타일 및 블록 중 어느 하나일 수 있다. 디코더는 미리 지정된 화소 단위 움직임 보정 활성화 정보를 기초로 미리 지정된 레벨에서 미리 지정된 화소 단위의 움직임 보정이 활성화되는지 판단할 수 있다. 미리 지정된 단위 움직임 보정이 활성화되고, 비디오 신호 처리 장치가 현재 블록에 TM 또는 BM 방식을 적용하는 경우, 비디오 신호 처리 장치는 미리 지정된 화소 단위까지만 움직임 보정을 적용할 수 있다. 정수 단위 움직임 보정 방법이 활성화되고, 비디오 신호 처리 장치가 현재 블록에 TM 또는 BM 방식을 적용하는 경우, 비디오 신호 처리 장치는 정수화소 단위까지만 움직임 보정을 적용할 수 있다. 정수 단위 움직임 보정 방법이 활성화되고, 비디오 신호 처리 장치가 현재 블록에 DMVR 방식을 적용하는 경우, 비디오 신호 처리 장치는 1차적으로 현재 블록에 대한 움직임 보정을 정수 단위까지만 수행하고, 현재 블록을 서브 블록으로 분할한 후, 서브 블록마다 정수 화소 단위까지만 움직임 보정을 적용할 수 있다. 미리 지정된 화소 단위는 반화소 단위, 정수 단위, 2의 정수 화소 단위, 및 4의 정수 화소 단위 중 하나 일 수 있다. 또 다른 구체적인 실시 예에서 미리 지정된 화소 단위는 미리 지정된 레벨로 시그널링되거나 파싱될 수 있다. 이때, 미리 지정된 레벨은 VPS(video parameter set), SPS(sequence parameter set), PPS(picture parameter set), 픽쳐, 슬라이스 타일 및 블록 중 어느 하나일 수 있다.
현재 블록이 인트라 예측 모드로 부호화되는 경우, 비디오 신호 처리 장치는 인트라 예측 블록에 BF(Bilateral Filter)를 적용하여 필터링된 인트라 예측 블록을 생성할 수 있다. 비디오 신호 처리 장치는 인트라 부호화 모드로 예측된 블록, 블록 벡터 기반으로 예측된 블록, 및 움직임 정보를 기반으로 예측된 블록에 BF를 적용할 수 있다. 현재 블록에 블렌딩이 적용된 경우, 비디오 신호 처리 장치는 예측 블록마다 BF 필터링을 적용하여 필터링된 예측 블록을 생성하고, 필터링된 예측 블록을 블렌딩하여 하나의 예측 블록을 생성할 수 있다. 또 다른 구체적인 실시 예에서 현재 블록에 블렌딩이 적용된 경우, 비디오 신호 처리 장치는 예측 블록을 블렌딩하여 하나의 예측 블록을 생성한 후, 생성한 예측 블록에 BF를 적용하여 필터링된 예측 블록을 생성할 수 있다. 현재 블록에 블렌딩이 적용되지 않은 경우, 하나의 예측 블록을 생성하고, 예측 블록에 BF를 적용하여 필터링된 예측 블록을 생성할 수 있다. 현재 블록에 DIMD, OBIC, TIMD, TIMD SAD, 및 TIMD 머지 모드 중 하나가 적용되고, 블렌딩이 적용되지 않은 경우, 비디오 신호 처리 장치는 하나의 예측 블록을 생성하고, 예측 블록에 BF를 적용하여 필터링된 예측 블록을 생성할 수 있다. 또 다른 구체적인 실시 예에서 현재 블록이 DIMD, OBIC, TIMD, TIMD SAD, 및 TIMD 머지 모드 중 하나가 적용되고, 블렌딩 방식이 비활성화된 경우, 비디오 신호 처리 장치는 하나의 예측 블록을 생성하고, 예측 블록에 BF를 적용하여 필터링된 예측 블록을 생성할 수 있다. 이러한 실시 예들에서 예측 블록은 앞서 설명한 바와 같이 인트라 예측 모드, 블록 벡터, 또는 움직임 정보를 이용하여 생성될 수 있다.
본 발명의 방법들은 슬라이스 타입 정보(일 예로, I, P, B 인지 여부 정보), 타일(Tile)인지 여부 정보, 서브 픽쳐인지 여부 정보, 블록 크기, CU 깊이, CU 블록인지 서브 블록 인지 여부 정보, 예측 블록인지 혹은 변환 블록인지 여부 정보, 휘도 신호인지 색차 신호인지 여부 정보, 참조 순서 및 계층에 따른 시간적인 계층 정보(temporal layer), 현재 블록의 AMVR 해상도 정보, 참조 프레임인지 혹은 비참조 프레임인지 여부 정보 등 최소 하나 이상을 사용하여 적용 여부 혹은 적용 범위가 달라질 수 있다. 이렇게 적용 여부 혹은 적용 범위를 결정하는 변수는 부호화기 및 복호화기가 미리 정해진 값을 사용하도록 설정할 수 있고, 이는 프로파일 및 레벨에 따라 정해진 값을 사용하도록 할 수도 있다. 또한, 부호화기가 적용 여부 혹은 적용 범위를 나타내는 변수 값을 비트스트림에 포함시킬 수 있으며, 복호화기는 해당 변수 값을 파싱하여 적용 여부 혹은 적용 범위를 결정할 수 있다. 상기 방법들은 휘도 신호에 대해서만 수행되고, 색차 신호에서는 수행되지 않을 수 있으며, 휘도 신호에서 구해진 정보를 색차 신호에서 사용할 수 있다. 상기 방법들은 시간적인 계층 정보가 미리 정해진 값보다 크거나 혹은 작을 경우에 따라 수행 여부가 결정될 수 있다. 상기 방법들은 참조 프레임인지 혹은 비참조 프레임인지에 대한 정보에 따라 수행 여부가 결정될 수 있다. 가로의 길이 또는 세로의 길이가 32 이상(예, 32, 64, 128 등)이면 상술한 방법들은 적용될 수 있다. 또한 가로의 길이 또는 세로의 길이가 32 보다 작은 경우(예, 2, 4, 8, 16)에 상술한 방법들은 적용될 수 있다. 또한 가로의 길이 또는 세로의 길이가 4 또는 8인 경우 상술한 방법들은 적용될 수 있다.
앞서 설명한 내용에서 "현재 블록에 AMVP 모드가 적용된 경우"는 "현재 블록이 AMVP 모드로 부호화되는 경우", "현재 블록이 AMVP 모드로 복호화되는 경우"를 의미할 수 있다.
본 명세서에서 상술한 방법들은 디코더 또는 인코더의 프로세서를 통해 수행될 수 있다. 또한, 인코더는 상술한 방법들에 의해 디코딩되는 비트스트림을 생성할 수 있다. 또한, 인코더가 생성한 비트스트림은 컴퓨터 판독 가능한 비 일시적 저장 매체(기록 매체)에 저장될 수 있다.
본 명세서는 주로 디코더 관점에서 기술되었으나 인코더에서도 동일하게 동작될 수 있다. 본 명세서의 파싱이라는 용어는 비트스트림으로부터 정보를 획득하는 과정을 중점으로하여 설명되었으나 인코더 측면에서는 비트스트림에 해당 정보를 구성하는 것으로 해석될 수 있다. 따라서 파싱이라는 용어는 디코더 동작으로만 한정되지 않고 인코더에서는 비트스트림을 구성하는 행위로까지 해석될 수 있다. 또한, 이러한 비트스트림은 컴퓨터 판독 가능한 기록 매체에 저장되어 구성될 수 있다.
상술한 본 발명의 실시예들은 다양한 수단을 통해 구현될 수 있다. 예를 들어, 본 발명의 실시예들은 하드웨어, 펌웨어(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 (20)

  1. 비디오 신호 디코딩 장치에서,
    프로세서를 포함하며,
    상기 프로세서는
    상기 비디오 신호로부터 스무딩 필터링의 비활성화 여부를 나타내는 스무딩 필터링 정보를 획득하고,
    미리 지정된 레벨에서 상기 스무딩 필터링 정보에 따라 인트라 예측에서 스무딩 필터링의 적용 여부를 판단하여 현재 블록을 예측하는
    비디오 신호 디코딩 장치.
  2. 제1항에서,
    상기 스무딩 필터링은 상기 인트라 예측에 사용되는 참조 샘플에 대한 필터링을 포함하는
    비디오 신호 디코딩 장치.
  3. 제1항에서,
    상기 스무딩 필터링은 PDPC(position dependent intra prediction combination)를 포함하는
    비디오 신호 디코딩 장치.
  4. 제1항에서,
    상기 스무딩 필터링은 인트라 퓨전을 포함하는
    비디오 신호 디코딩 장치.
  5. 제1항에서,
    상기 미리 지정된 레벨은 SPS(sequence parameter set)인
    비디오 신호 디코딩 장치.
  6. 제1항에서,
    상기 스무딩 필터링은 복수의 기능을 포함하고,
    상기 스무딩 필터링 정보는 복수의 기능 각각의 비활성화 여부를 지시하는 복수의 플래그를 포함하는
    비디오 신호 디코딩 장치.
  7. 제1항에서,
    상기 프로세서는
    상기 현재 블록을 복원할 때, 상기 스무딩 필터링 정보를 기초로, 정수 단위의 샘플만을 사용하여 보간하는 정수 단위 보간 방법을 사용할지 결정하는
    비디오 신호 디코딩 장치.
  8. 제1항에서,
    상기 프로세서는
    상기 현재 블록을 복원할 때, 상기 스무딩 필터링 정보를 기초로, 복수의 예측 블록을 가중 평균하여 최종 예측 블록을 생성하는 블렌딩을 수행할 지 결정하는
    비디오 신호 디코딩 장치.
  9. 제1항에서,
    상기 프로세서는
    상기 현재 블록이 미리 지정된 모드로 부호화된 경우, 상기 현재 블록이 잔차 신호를 갖지 않는 것으로 판단하는
    비디오 신호 처리 장치.
  10. 비디오 신호 인코딩 장치에서,
    프로세서를 포함하며,
    상기 프로세서는
    스무딩 필터링의 비활성화 여부를 나타내는 스무딩 필터링 정보를 설정하고,
    상기 필터링 정보를 상기 비디오 신호에 포함시키고,
    미리 지정된 레벨에서 상기 스무딩 필터링 정보에 따라 인트라 예측에서 스무딩 필터링의 적용 여부를 판단하여 현재 블록이 예측되는
    비디오 신호 인코딩 장치.
  11. 제10항에서,
    상기 스무딩 필터링은 상기 인트라 예측에 사용되는 참조 샘플에 대한 필터링을 포함하는
    비디오 신호 인코딩 장치.
  12. 제10항에서,
    상기 스무딩 필터링은 PDPC(position dependent intra prediction combination)를 포함하는
    비디오 신호 인코딩 장치.
  13. 제10항에서,
    상기 스무딩 필터링은 인트라 퓨전을 포함하는
    비디오 신호 인코딩 장치.
  14. 제10항에서,
    상기 미리 지정된 레벨은 SPS(sequence parameter set)인
    비디오 신호 인코딩 장치.
  15. 제10항에서,
    상기 스무딩 필터링은 복수의 기능을 포함하고,
    상기 스무딩 필터링 정보는 복수의 기능 각각의 비활성화 여부를 지시하는 복수의 플래그를 포함하는
    비디오 신호 인코딩 장치.
  16. 제10항에서,
    상기 현재 블록의 복원에서, 상기 스무딩 필터링 정보를 기초로, 정수 단위의 샘플만을 사용하여 보간하는 정수 단위 보간 방법을 사용할지 결정되는
    비디오 신호 인코딩 장치.
  17. 제10항에서,
    상기 현재 블록의 복원에서, 상기 스무딩 필터링 정보를 기초로, 복수의 예측 블록을 가중 평균하여 최종 예측 블록을 생성하는 블렌딩을 수행할 지 결정되는
    비디오 신호 인코딩 장치.
  18. 제10항에서,
    상기 프로세서는
    상기 현재 블록이 미리 지정된 모드로 부호화된 경우, 상기 현재 블록이 잔차 신호를 갖지 않게 인코딩하는
    비디오 신호 인코딩 장치.
  19. 비트스트림을 저장하는 컴퓨터 판독 가능한 비 일시적 저장 매체에서, 상기 비트스트림의 인코딩 방법은
    스무딩 필터링의 비활성화 여부를 나타내는 스무딩 필터링 정보를 설정하는 단계; 및
    상기 필터링 정보를 상기 비디오 신호에 포함시키는 단계를 포함하고,
    미리 지정된 레벨에서 상기 스무딩 필터링 정보에 따라 인트라 예측에서 스무딩 필터링의 적용 여부를 판단하여 현재 블록이 예측되는
    비 일시적 저장 매체.
  20. 비디오 신호 디코딩 장치의 동작 방법에서,
    상기 비디오 신호로부터 스무딩 필터링의 비활성화 여부를 나타내는 스무딩 필터링 정보를 획득하는 단계; 및
    미리 지정된 레벨에서 상기 스무딩 필터링 정보에 따라 인트라 예측에서 스무딩 필터링의 적용 여부를 판단하여 현재 블록을 예측하는 단계를 포함하는
    동작 방법.
PCT/KR2025/007668 2024-06-12 2025-06-04 비디오 신호 처리 방법 및 이를 위한 장치 Pending WO2025258912A1 (ko)

Applications Claiming Priority (8)

Application Number Priority Date Filing Date Title
KR20240076559 2024-06-12
KR10-2024-0076559 2024-06-12
KR20240088994 2024-07-05
KR10-2024-0088994 2024-07-05
KR20240116158 2024-08-28
KR10-2024-0116158 2024-08-28
KR20250038852 2025-03-26
KR10-2025-0038852 2025-03-26

Publications (1)

Publication Number Publication Date
WO2025258912A1 true WO2025258912A1 (ko) 2025-12-18

Family

ID=98050930

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/KR2025/007668 Pending WO2025258912A1 (ko) 2024-06-12 2025-06-04 비디오 신호 처리 방법 및 이를 위한 장치

Country Status (1)

Country Link
WO (1) WO2025258912A1 (ko)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101857755B1 (ko) * 2011-04-12 2018-05-15 한국전자통신연구원 스킵 모드를 이용한 영상 복호화 방법 및 이러한 방법을 사용하는 장치
KR20210114054A (ko) * 2019-03-12 2021-09-17 엘지전자 주식회사 영상 부호화/복호화 방법, 장치 및 비트스트림을 전송하는 방법
KR20220112787A (ko) * 2019-12-20 2022-08-11 프라운호퍼-게젤샤프트 추르 푀르데룽 데어 안제반텐 포르슝 에 파우 참조 픽처 리샘플링을 위한 프랙셔널 샘플 보간
KR102589351B1 (ko) * 2020-03-25 2023-10-16 주식회사 케이티 비디오 신호 처리 방법 및 장치
KR20240066144A (ko) * 2017-12-07 2024-05-14 한국전자통신연구원 채널들 간의 선택적인 정보 공유를 사용하는 부호화 및 복호화를 위한 방법 및 장치

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101857755B1 (ko) * 2011-04-12 2018-05-15 한국전자통신연구원 스킵 모드를 이용한 영상 복호화 방법 및 이러한 방법을 사용하는 장치
KR20240066144A (ko) * 2017-12-07 2024-05-14 한국전자통신연구원 채널들 간의 선택적인 정보 공유를 사용하는 부호화 및 복호화를 위한 방법 및 장치
KR20210114054A (ko) * 2019-03-12 2021-09-17 엘지전자 주식회사 영상 부호화/복호화 방법, 장치 및 비트스트림을 전송하는 방법
KR20220112787A (ko) * 2019-12-20 2022-08-11 프라운호퍼-게젤샤프트 추르 푀르데룽 데어 안제반텐 포르슝 에 파우 참조 픽처 리샘플링을 위한 프랙셔널 샘플 보간
KR102589351B1 (ko) * 2020-03-25 2023-10-16 주식회사 케이티 비디오 신호 처리 방법 및 장치

Similar Documents

Publication Publication Date Title
WO2019083334A1 (ko) 비대칭 서브 블록 기반 영상 부호화/복호화 방법 및 장치
WO2021040321A1 (ko) 영상 신호 부호화/복호화 방법 및 이를 위한 장치
WO2019078686A1 (ko) 영상 부호화/복호화 방법, 장치 및 비트스트림을 저장한 기록 매체
WO2018097590A1 (ko) 영상 부호화/복호화 방법, 장치 및 비트스트림을 저장한 기록 매체
WO2023033486A1 (ko) 비디오 신호 처리 방법 및 이를 위한 장치
WO2024058637A1 (ko) 비디오 신호 처리 방법 및 이를 위한 장치
WO2021112652A1 (ko) 영역 차등적 영상 부호화/복호화를 위한 방법, 장치 및 기록 매체
WO2020130714A1 (ko) 영상 신호 부호화/복호화 방법 및 이를 위한 장치
WO2020213963A1 (ko) 영상 신호 부호화/복호화 방법 및 이를 위한 장치
WO2021125752A1 (ko) 영상 신호 부호화/복호화 방법 및 이를 위한 장치
WO2023055220A1 (ko) 참조 픽쳐를 기초로 인트라 예측 모드를 결정하는 비디오 신호 처리 방법 및 이를 위한 장치
WO2024091002A1 (ko) 비디오 신호 처리 방법 및 이를 위한 장치
WO2024155170A1 (ko) 비디오 신호 처리 방법 및 이를 위한 장치
WO2024053987A1 (ko) 기하학적 분할을 이용하는 비디오 신호 처리 방법 및 이를 위한 장치
WO2023080691A1 (ko) 비디오 신호 처리 방법 및 이를 위한 장치
WO2023140635A1 (ko) 경계 밖 블록을 이용하는 비디오 신호 처리 방법 및 이를 위한 장치
WO2024039209A1 (ko) 비디오 신호 처리 방법 및 이를 위한 장치
WO2024155106A1 (ko) 비디오 신호 처리 방법 및 이를 위한 장치
WO2021071313A1 (ko) 영상 신호 부호화/복호화 방법 및 이를 위한 장치
WO2025258912A1 (ko) 비디오 신호 처리 방법 및 이를 위한 장치
WO2025216606A1 (ko) 인트라 예측 모드를 유도하는 방법 및 이를 위한 장치
WO2026024154A1 (ko) 비디오 신호 처리 방법 및 이를 위한 장치
WO2026005507A1 (ko) 비디오 신호 처리 방법 및 이를 위한 장치
WO2026059323A1 (ko) 비디오 신호 처리 방법 및 이를 위한 장치
WO2024215185A1 (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: 25822321

Country of ref document: EP

Kind code of ref document: A1