WO2024090923A1 - 휘도 샘플 기반 색차 샘플 예측을 사용하는 비디오 신호 처리 방법 및 이를 위한 장치 - Google Patents

휘도 샘플 기반 색차 샘플 예측을 사용하는 비디오 신호 처리 방법 및 이를 위한 장치 Download PDF

Info

Publication number
WO2024090923A1
WO2024090923A1 PCT/KR2023/016463 KR2023016463W WO2024090923A1 WO 2024090923 A1 WO2024090923 A1 WO 2024090923A1 KR 2023016463 W KR2023016463 W KR 2023016463W WO 2024090923 A1 WO2024090923 A1 WO 2024090923A1
Authority
WO
WIPO (PCT)
Prior art keywords
block
sample
luminance
chrominance
current block
Prior art date
Application number
PCT/KR2023/016463
Other languages
English (en)
French (fr)
Inventor
김경용
김동철
손주형
곽진삼
Original Assignee
주식회사 윌러스표준기술연구소
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 주식회사 윌러스표준기술연구소 filed Critical 주식회사 윌러스표준기술연구소
Publication of WO2024090923A1 publication Critical patent/WO2024090923A1/ko

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/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/103Selection of coding mode or of prediction mode
    • H04N19/109Selection of coding mode or of prediction mode among a plurality of temporal predictive coding modes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/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/11Selection of coding mode or of prediction mode among a plurality of spatial predictive coding modes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/117Filters, e.g. for pre-processing or post-processing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/119Adaptive subdivision aspects, e.g. subdivision of a picture into rectangular or non-rectangular coding blocks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/132Sampling, masking or truncation of coding units, e.g. adaptive resampling, frame skipping, frame interpolation or high-frequency transform coefficient masking
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/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/157Assigned coding mode, i.e. the coding mode being predefined or preselected to be further used for selection of another element or parameter
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/186Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being a colour or a chrominance component
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/593Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving spatial prediction techniques
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/70Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by syntax aspects related to video coding, e.g. related to compression standards

Definitions

  • the present invention relates to a method and device for processing video signals, and more particularly, to a method and device for processing video signals for encoding or decoding video signals.
  • Compression encoding refers to a series of signal processing technologies for transmitting digitized information through communication lines or storing it in a form suitable for storage media.
  • Targets of compression coding include audio, video, and text.
  • the technology for performing compression coding on video is called video image compression.
  • Compression coding for video signals is accomplished by removing redundant information by considering spatial correlation, temporal correlation, and probabilistic correlation.
  • spatial correlation e.g., spatial correlation, temporal correlation, and probabilistic correlation.
  • the purpose of this specification is to increase the coding efficiency of video signals by providing a video signal processing method and apparatus for the same.
  • a video signal decoding device includes a processor.
  • the processor determines a value of at least one sample among a peripheral luminance sample of a current block, a chrominance sample corresponding to the peripheral luminance sample of the current block, a peripheral luminance sample of a reference block, and a chrominance sample corresponding to the peripheral luminance sample of the reference block.
  • the processor may generate a chrominance prediction block using the obtained model and the luminance block of the current block, and restore the chrominance block of the current block by adding an error block to the chrominance prediction block.
  • the processor acquires a first model and a second model, generates a first chrominance prediction sample using the luminance sample of the current block and the first model, and Generate a second chrominance prediction sample using the luminance sample of the block and the second model, generate a third chrominance prediction sample by performing a weighted average of the first chrominance prediction sample and the second chrominance prediction sample, and generate a third chrominance prediction sample.
  • a chrominance prediction block can be generated using 3 chrominance prediction samples, and an error block can be added to the chrominance prediction block to restore the chrominance block of the current block.
  • the processor derives the first model using the first prediction block predicted using L0 motion information and makes predictions using L1 motion information.
  • the second model can be derived using one second prediction block.
  • the input value input to the model is a value obtained by subtracting a predetermined first offset value from the value of the luminance sample of the current block, a value obtained by subtracting a predetermined second offset value from the value of the Cb chrominance sample of the current block, and the current block. It may include a value obtained by subtracting a pre-specified third offset value from the value of the Cr color difference sample.
  • the first preset offset value is a value of a luminance sample at a preset position among the surrounding samples of the current block
  • the second preset offset value is a value of a Cb chrominance sample at the preset position
  • the preset third offset value is a value of a luminance sample at a preset position among neighboring samples of the current block.
  • the offset value may be the value of the Cr color difference sample at the predetermined position.
  • the processor sets a pre-designated basic first offset value to the first offset value, and a pre-designated basic second offset value to the second offset value.
  • the designated basic third offset value can be used as the third offset value.
  • the processor determines that the chrominance block of the current block cannot use the model-based coding mode, and provides at least one syntax related to the model. It may not be parsed.
  • the processor determines in a pre-specified order whether the luminance sample value at a plurality of pre-designated positions is valid as the first offset value, and sets the first offset value.
  • the value of the found luminance sample is the first offset value
  • the value of the Cb chrominance sample corresponding to the value of the found luminance sample is the second offset value
  • the value of the Cr color difference sample corresponding to the found luminance sample can be used as the third offset value.
  • the processor parses offset sample information indicating an offset sample from a bitstream including the video signal, and sets the value of the luminance sample indicated by the offset sample information to the first offset value and Cb indicated by the offset sample information.
  • the value of the color difference sample can be used as the second offset value, and the value of the Cr color difference sample indicated by the offset sample information can be used as the third offset value.
  • the processor acquires motion information for the current block, generates a luminance prediction block and a first chrominance prediction block for the current block using the motion information, and models the relationship between the luminance prediction block and the first chrominance prediction block.
  • Obtain a model add a luminance error block to the luminance prediction block to generate a restored luminance block for the current block, and generate a second chrominance block of the current block based on the obtained model and the restored luminance block.
  • Predict generate a third color difference prediction block by performing a weighted average of the first color difference block of the current block and the second color difference block of the current block, and add a color difference error block to the third color difference block to produce the color difference of the current block. Restore the block.
  • the processor may predict the second chrominance block of the current block using the obtained model and the restored luminance block.
  • the processor may predict a second chrominance sample of the current block using the obtained model and the reconstructed luminance sample of the reconstructed luminance block.
  • the obtained model may be derived using at least one of a vertical difference and a horizontal difference between the luminance prediction sample and a plurality of luminance samples surrounding the luminance prediction sample, and the vertical and horizontal coordinates of the luminance prediction sample.
  • the obtained model can be derived without down-sampling the luminance prediction sample.
  • the processor determines a restored luminance sample of the restored luminance block, a vertical difference and a horizontal difference between the restored luminance sample and a plurality of luminance samples surrounding the restored luminance sample, and the vertical and horizontal coordinates of the restored luminance sample.
  • the second chrominance sample of the current block can be predicted using at least one of the coordinates.
  • the processor may predict a second chrominance sample of the current block without downsampling the restored luminance sample for the current block.
  • the processor may apply a first weight to the first color difference sample and a second weight to the second color difference sample. At this time, the second weight may be greater than the first weight.
  • An encoding device that encodes a video signal according to an embodiment of the present invention includes a processor.
  • the processor determines a value of at least one sample among a peripheral luminance sample of a current block, a chrominance sample corresponding to the peripheral luminance sample of the current block, a peripheral luminance sample of a reference block, and a chrominance sample corresponding to the peripheral luminance sample of the reference block.
  • an encoding device for encoding a video signal includes a processor.
  • the processor acquires motion information for the current block, generates a luminance prediction block and a first chrominance prediction block for the current block using the motion information, and models the relationship between the luminance prediction block and the first chrominance prediction block.
  • Obtain a model add a luminance error block to the luminance prediction block to generate a restored luminance block for the current block, and generate a second chrominance block of the current block based on the obtained model and the restored luminance block.
  • a decoding method for decoding a video signal includes peripheral luminance samples of a current block, chrominance samples corresponding to the peripheral luminance samples of the current block, peripheral luminance samples of a reference block, and peripheral luminance samples of the reference block.
  • a decoding method for decoding a video signal includes obtaining motion information for a current block; generating a luminance prediction block and a first chrominance prediction block for the current block using the motion information; Obtaining a model that models the relationship between the luminance prediction block and the first chrominance prediction block; generating a restored luminance block for the current block by adding a luminance error block to the luminance prediction block; predicting a second chrominance block of the current block based on the obtained model and the restored luminance block; generating a third chrominance prediction block by performing a weighted average of the first chrominance block of the current block and the second chrominance block of the current block; and restoring the chrominance block of the current block by adding a chrominance error block to the third chrominance block.
  • a computer-readable non-transitory storage medium storing a bitstream is disclosed.
  • the bitstream is decoded using a decoding method.
  • the decoding method determines the value of at least one sample among a peripheral luminance sample of a current block, a chrominance sample corresponding to the peripheral luminance sample of the current block, a peripheral luminance sample of a reference block, and a chrominance sample corresponding to the peripheral luminance sample of the reference block.
  • a computer-readable non-transitory storage medium storing a bitstream is disclosed.
  • the bitstream is decoded using a decoding method.
  • the decoding method includes obtaining motion information for a current block; generating a luminance prediction block and a first chrominance prediction block for the current block using the motion information; Obtaining a model that models the relationship between the luminance prediction block and the first chrominance prediction block; generating a restored luminance block for the current block by adding a luminance error block to the luminance prediction block; predicting a second chrominance block of the current block based on the obtained model and the restored luminance block;
  • generating a third chrominance prediction block by performing a weighted average of the first chrominance block of the current block and the second chrominance block of the current block; and restoring the chrominance block of the current block by adding a chrominance error block to the third chrominance block.
  • FIG. 1 is a schematic block diagram of a video signal encoding device according to an embodiment of the present invention.
  • Figure 2 is a schematic block diagram of a video signal decoding device according to an embodiment of the present invention.
  • Figure 3 shows an embodiment in which a coding tree unit is divided into coding units within a picture.
  • Figure 4 shows one embodiment of a method for signaling splitting of quad trees and multi-type trees.
  • FIGS 5 and 6 show the intra prediction method according to an embodiment of the present invention in more detail.
  • Figure 7 is a diagram showing the positions of neighboring blocks used to generate a motion candidate list in inter prediction.
  • Figure 8 shows a block diagram in which CCLM is performed according to an embodiment of the present invention.
  • Figure 9 shows an example of a template configuration used to derive a linear model according to an embodiment of the present invention.
  • Figure 10 shows that the encoder and decoder according to an embodiment of the present invention derive two linear models based on a threshold.
  • Figure 11 shows a method of configuring syntax for the encoding mode of a linear model according to an embodiment of the present invention.
  • Figure 12 shows probability initialization information for the mmlm_flag context model according to an embodiment of the present invention.
  • Figure 13 shows probability initialization information for the mmlm_flag context model according to an embodiment of the present invention.
  • Figure 14 shows a method of deriving an intra prediction mode for the current block using motion information of neighboring blocks according to an embodiment of the present invention.
  • Figure 15 shows a method for predicting a chrominance block using a recursive linear model according to an embodiment of the present invention.
  • Figure 16 shows a reference region used to create a reference linear model according to an embodiment of the present invention.
  • Figure 17 shows reference samples and formulas used in CCCM according to an embodiment of the present invention.
  • Figure 18 shows a differential sample-based CCCM method according to an embodiment of the present invention.
  • Figure 19 shows a pre-specified number of ambient luminance samples around the current block that are considered for derivation of a model used for chrominance sample prediction according to an embodiment of the present invention.
  • Figure 20 shows luminance samples before downsampling used to derive chrominance samples in CCCM-ND mode according to an embodiment of the present invention.
  • Figure 21 shows luminance samples before downsampling used to derive chrominance samples in CCCM-ND mode according to an embodiment of the present invention.
  • Figure 22 shows a block diagram of a cross-component residual model (CCRM) according to an embodiment of the present invention.
  • CCRM cross-component residual model
  • FIG. 23 shows a block diagram of a cross-component residual model (CCRM) according to an embodiment of the present invention.
  • Figure 24 shows that CCRM is performed using the correlation between a luminance prediction block and a luminance restoration block according to an embodiment of the present invention.
  • a and/or B may be interpreted as meaning ‘including at least one of A or B.’
  • Coding can be interpreted as encoding or decoding depending on the case.
  • a device that performs encoding (encoding) of a video signal to generate a video signal bitstream is referred to as an encoding device or encoder
  • a device that performs decoding (decoding) of a video signal bitstream to restore a video signal is referred to as a decoder. It is referred to as a device or decoder.
  • a video signal processing device is used as a term that includes both an encoder and a decoder.
  • 'Unit' is used to refer to a basic unit of image processing or a specific location of a picture, and refers to an image area containing at least one of a luminance (luma) component and a chrominance (chroma) component.
  • 'block' refers to an image area containing specific components among the luminance component and chrominance component (i.e., Cb and Cr).
  • terms such as 'unit', 'block', 'partition', 'signal', and 'area' may be used interchangeably.
  • 'current block' refers to a block currently scheduled to be encoded
  • 'reference block' refers to a block for which encoding or decoding has already been completed and is used as a reference in the current block.
  • terms such as 'luma', 'luma', 'luminance', and 'Y' may be used interchangeably.
  • terms such as 'chroma', 'chroma', 'color difference', and 'Cb or Cr' may be used interchangeably, and since the color difference component is divided into two types, Cb and Cr, each color difference component will be used separately. You can.
  • 'sample' is a basic element that constitutes a picture or frame, and the value of the luminance sample can be 0 to 255 for 8 bits, and 0 to 4095 for 12 bits. may have, and terms such as 'sample', 'pixel', and 'pixel' may be used interchangeably.
  • a unit may be used as a concept that includes all coding units, prediction units, and transformation units.
  • a picture refers to a field or frame, and depending on the embodiment, the above terms may be used interchangeably. Specifically, when the captured image is an interlaced image, one frame is divided into an odd (or odd, top) field and an even (or even, bottom) field, and each field is created as a picture unit.
  • 'left', 'upper left', 'upper', 'upper right', 'right', 'lower right', 'bottom', and 'lower left' mean 'left', 'upper left', ' It can be used interchangeably with 'top', 'top right', 'bottom right', 'bottom right', 'bottom', and 'bottom left'. Additionally, element and member can be used interchangeably.
  • POC Picture Order Count
  • Figure 1 is a schematic block diagram of a video signal encoding device 100 according to an embodiment of the present invention.
  • 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, and a prediction unit 150. ) and an entropy coding unit 160.
  • the conversion unit 110 obtains a conversion coefficient value by converting the residual signal, which is the difference between the input video signal and the prediction signal generated by the prediction unit 150.
  • Discrete Cosine Transform DCT
  • DST Discrete Sine Transform
  • Wavelet Transform may be used.
  • Discrete cosine transform and discrete sine transform perform transformation by dividing the input picture signal into blocks. In transformation, coding efficiency may vary depending on the distribution and characteristics of values within the transformation region.
  • the transformation kernel used for transformation of the residual block may be a transformation kernel with separable characteristics of vertical transformation and horizontal transformation. In this case, transformation for the residual block can be performed separately into vertical transformation and horizontal transformation.
  • the encoder can perform vertical transformation by applying a transformation 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.
  • a transform kernel may be used as a term to refer to a set of parameters used for transforming a residual signal, such as a transform matrix, transform array, transform function, or transform.
  • 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 vertical transformation and horizontal transformation.
  • error signals may exist only in some areas of the coding block.
  • the conversion process may be performed only for some arbitrary areas.
  • an error signal may exist only in the first 2NxN block, and a conversion process is performed only on the first 2NxN block, but the conversion process is not performed on the second 2NxN block and may not be encoded or decoded.
  • N can be any positive integer.
  • the encoder may perform additional transformations before the transform coefficients are quantized.
  • the above-described transformation method may be referred to as a primary transform, and additional transformation may be referred to as a secondary transform.
  • Secondary transformation may be optional for each residual block.
  • the encoder may improve coding efficiency by performing secondary transformation on a region where it is difficult to concentrate energy in the low-frequency region only through primary transformation.
  • secondary transformation may be additionally performed on a block whose residual values appear large in directions other than the horizontal or vertical direction of the residual block.
  • secondary transformation may not be performed separately into vertical transformation and horizontal transformation. This secondary transform may be referred to as Low Frequency Non-Separable Transform (LFNST).
  • LTNST Low Frequency Non-Separable Transform
  • the quantization unit 115 quantizes the transform coefficient value output from the transform unit 110.
  • the picture is predicted using the already coded area through the prediction unit 150, and the residual value between the original picture and the predicted picture is added to the predicted picture to create a reconstructed picture.
  • a method of obtaining is used.
  • the encoder performs a process of restoring the current encoded 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 reconstructed picture and improve coding efficiency.
  • deblocking filters For example, deblocking filters, sample adaptive offset (SAO), and adaptive loop filters may be included.
  • the filtered picture is output or stored in a decoded picture buffer (DPB, 156) to be used as a reference picture.
  • DPB decoded picture buffer
  • a deblocking filter is a filter for removing distortion within blocks created at the boundaries between blocks in a restored picture.
  • the encoder can determine whether to apply a deblocking filter to the edge based on the distribution of pixels included in several columns or rows based on an arbitrary edge within the block.
  • the encoder can apply a long filter, strong filter, or weak filter depending on the deblocking filtering strength.
  • horizontal filtering 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 basis for a residual block to which a deblocking filter has been applied.
  • the encoder In order to correct the offset for a specific picture, the encoder divides the pixels included in the image into a certain number of areas, determines the area to perform offset correction, and uses a method (Band Offset) to apply the offset to the area. You can. Alternatively, the encoder can use a method of applying an offset (Edge Offset) by considering the edge information of each pixel.
  • Adaptive Loop Filter ALF is a method of dividing pixels included in an image into predetermined groups, then determining one filter to be applied to the group, and performing differential filtering for each group. Information related to whether to apply ALF may be signaled in units of coding units, and the shape and filter coefficients of the ALF filter to be applied may vary for each block. Additionally, an ALF filter of the same type (fixed type) may be applied regardless of the characteristics of the target block to be applied.
  • 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 the current picture
  • the inter prediction unit 154 performs inter prediction using the reference picture stored in the decoded picture buffer 156. Perform.
  • the intra prediction unit 152 performs intra prediction from the reconstructed areas in the current picture and transmits intra encoding information to the entropy coding unit 160.
  • Intra encoding information may include at least one of an intra prediction mode, a Most Probable Mode (MPM) flag, an MPM index, and information about a reference sample.
  • the inter prediction unit 154 may be generated including a motion estimation unit 154a and a motion compensation unit 154b.
  • the motion estimation unit 154a refers to a specific region of the reconstructed reference picture, finds the part most similar to the current region, and obtains a motion vector value that is the distance between regions.
  • Motion information reference direction indication information (L0 prediction, L1 prediction, bi-directional prediction), reference picture index, motion vector information, etc.) about the reference area obtained from the motion estimation unit 154a is transmitted to the entropy coding unit 160. so that it can be included in the bitstream.
  • the motion compensation unit 154b uses the motion information transmitted from the motion estimation unit 154a, the motion compensation unit 154b performs inter-motion compensation to generate a prediction block for the current block.
  • the inter prediction unit 154 transmits inter encoding information including motion information about the reference region to the entropy coding unit 160.
  • the prediction unit 150 may include an intra block copy (IBC) prediction unit (not shown).
  • the IBC prediction unit performs IBC prediction from the reconstructed samples in the current picture and transmits IBC encoding information to the entropy coding unit 160.
  • the IBC prediction unit refers to a specific region in the current picture and obtains a block vector value indicating a reference region used for prediction of the current region.
  • the IBC prediction unit may perform IBC prediction using the obtained block vector value.
  • the IBC prediction unit transmits IBC encoding information to the entropy coding unit 160.
  • IBC encoding information may include at least one of reference area size information and block vector information (index information for block vector prediction of the current block within the motion candidate list, block vector difference information).
  • the transform unit 110 obtains a transform coefficient value by transforming the residual value between the original picture and the predicted picture. At this time, transformation can be performed on a specific block basis within the picture, and the size of a specific block can vary within a preset range.
  • the quantization unit 115 quantizes the transform coefficient value generated by the transform unit 110 and transmits the quantized transform 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 scanning method for the quantized transform coefficient may be determined depending on the size of the transform block and the intra prediction mode. As an example, diagonal, vertical, and horizontal scans may be applied. This scan information can be signaled in block units and can be derived according to already established rules.
  • the entropy coding unit 160 generates a video signal bitstream by entropy coding information representing quantized transform coefficients, intra encoding information, and inter encoding information.
  • the entropy coding unit 160 may use a variable length coding (VLC) method or 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.
  • Context-based Adaptive Variable Length Coding CAVLC
  • CAVLC Context-based Adaptive Variable Length Coding
  • Arithmetic coding converts consecutive data symbols into a single decimal number using the probability distribution of each data symbol. Arithmetic coding can obtain the optimal decimal bits needed to express each symbol.
  • As arithmetic coding context-based adaptive binary arithmetic code (CABAC) can be used.
  • CABAC context-based adaptive binary arithmetic code
  • CABAC is a method of binary arithmetic encoding using multiple context models created based on probabilities obtained through experiments.
  • the context model can also be called a context model.
  • the CABAC initialization process is divided into context initialization and arithmetic coding initialization.
  • Context initialization is a process of initializing the probability of occurrence of each symbol, and is determined depending on the type of symbol, quantization parameter (QP), and slice type (whether I, P, or B).
  • QP quantization parameter
  • slice type whether I, P, or B
  • the context model provides the probability of occurrence of LPS (Least Probable Symbol) or MPS (Most Probable Symbol) for the symbol currently being coded and information (valMPS) about which empty value among 0 and 1 corresponds to the MPS.
  • LPS Local Probable Symbol
  • MPS Moving Probable Symbol
  • valMPS information about which empty value among 0 and 1 corresponds to the MPS.
  • One of several context models is selected through a context index (ctxIdx), and the context index can be derived through information on the current block to be encoded or information on surrounding blocks.
  • Initialization for binary arithmetic coding is performed based on the probability model selected from the context model.
  • Binary arithmetic coding is divided into probability intervals through the occurrence probabilities of 0 and 1, and then coding is carried out through the process where the probability interval corresponding to the bin to be processed becomes the entire probability interval for the next bin to be processed.
  • a probability update process may be performed in which the probability of the next bin to be processed is newly set through information on the processed bin.
  • the generated bitstream is encapsulated in a NAL (Network Abstraction Layer) unit as a basic unit.
  • 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.
  • VCL Video Coding Layer
  • non-VCL NAL units There are various types of VCL or non-VCL NAL units.
  • the NAL unit is created with NAL header information and data, RBSP (Raw Byte Sequence Payload), and the NAL header information includes summary information about the RBSP.
  • the RBSP of the VCL NAL unit includes an encoded integer number of coding tree units.
  • the bitstream In order to decode a bitstream in a video decoder, the bitstream must first be separated into NAL units, and then each separated NAL unit must be decoded. Meanwhile, the information required for decoding the video signal bitstream will be transmitted in a picture parameter set (PPS), sequence parameter set (SPS), video parameter set (VPS), etc. You can.
  • PPS picture parameter set
  • SPS sequence parameter set
  • VPS video parameter set
  • FIG. 1 shows the encoding device 100 according to an embodiment of the present invention, and the separately displayed blocks show elements of the encoding device 100 logically distinguished. Accordingly, the elements of the above-described encoding device 100 may be mounted as one chip or as a plurality of chips depending on the design of the device. According to one embodiment, the operation of each element of the above-described encoding device 100 may be performed by a processor (not shown).
  • Figure 2 is a schematic block diagram of a video signal decoding device 200 according to an embodiment of the present invention.
  • the decoding device 200 of the present invention includes an entropy decoding unit 210, an inverse quantization unit 220, an inverse transform unit 225, a filtering unit 230, and a prediction unit 250.
  • the entropy decoding unit 210 entropy decodes the video signal bitstream and extracts transform coefficient information, intra encoding information, and inter encoding information for each region. For example, the entropy decoder 210 may obtain a binarization code for transform coefficient information of a specific area from a video signal bitstream. Additionally, 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 summing the residual value obtained from the inverse transform unit 225 with the predicted value obtained from the prediction unit 250.
  • the filtering unit 230 improves image quality by performing filtering on the picture. This may include a deblocking filter to reduce block distortion and/or an adaptive loop filter to remove distortion of 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 using the coding type decoded through the entropy decoding unit 210, transform coefficients for each region, intra/inter coding information, etc.
  • the current picture including the current block or the decoded area of other pictures can be used. Only the current picture is used for reconstruction, that is, a picture (or tile/slice) that performs intra prediction or intra BC prediction is used as an intra picture or I picture (or tile/slice), intra prediction, and both inter prediction and intra BC prediction are used.
  • a picture (or tile/slice) that can be performed is called an inter picture (or tile/slice).
  • a picture (or tile/slice) that uses at most one motion vector and a reference picture index to predict sample values of each block among inter pictures (or tiles/slices) is called a predictive picture or a P picture (or , tile/slice), and a picture (or tile/slice) using up to two motion vectors and a reference picture index is called a bi-predictive picture or B picture (or tile/slice).
  • a P picture (or tile/slice) uses at most one set of motion information to predict each block
  • a B picture (or tile/slice) uses at most two sets of motion information to predict each block.
  • the 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 in the current picture.
  • 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 to the left and/or above the current block as reference samples.
  • reconstructed samples, reference samples, and samples of the current block may represent pixels. Additionally, sample values may represent pixel values.
  • the reference samples may be samples included in neighboring blocks of the current block.
  • the reference samples may be samples adjacent to the left border and/or samples adjacent to the upper boundary of the current block.
  • the reference samples are samples of neighboring blocks of the current block, which are located on a line within a preset distance from the left border of the current block and/or are located on a line within a preset distance from the upper border of the current block. These may be samples that do.
  • the surrounding blocks of the current block are the left (L) block, upper (A) block, Below Left (BL) block, Above Right (AR) block, or Above Left block adjacent to the current block.
  • AL may include at least one block.
  • the inter prediction unit 254 generates a prediction block using the reference picture and inter encoding information stored in the decoded picture buffer 256.
  • 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 refers to prediction using one reference picture included in the L0 picture list
  • L1 prediction refers to prediction using one reference picture included in the L1 picture list. This may require one set of motion information (eg, motion vector and reference picture index).
  • a maximum of two reference regions can be used, and these two reference regions may exist in the same reference picture or in different pictures.
  • the pair prediction method up to two sets of motion information (e.g., a motion vector and a reference picture index) can be used, and the two motion vectors may correspond to the same reference picture index or may correspond to different reference picture indices. It may be possible to respond.
  • the reference pictures are pictures located temporally before or after the current picture, and may be pictures that have already been reconstructed.
  • the two reference regions used in the bi-prediction method may be regions selected from the L0 picture list and the L1 picture list, respectively.
  • the inter prediction unit 254 may 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 a reference picture index.
  • the sample value of the block specified by the motion vector or its interpolated value may be used as a predictor of the current block.
  • an 8-tap interpolation filter can be used for the luminance signal and a 4-tap interpolation filter can be used for the chrominance signal.
  • the interpolation filter for motion prediction in subpel units is not limited to this. In this way, the inter prediction unit 254 performs motion compensation to predict the texture of the current unit from the 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 can reconstruct the current region by referring to a specific region containing reconstructed samples in the current picture.
  • the IBC prediction unit may perform IBC prediction using the IBC encoding information obtained from the entropy decoding unit 210.
  • IBC encoding information may include block vector information.
  • the predicted value output from the intra prediction unit 252 or the inter prediction unit 254 and the residual value output from the inverse transform unit 225 are added to generate a restored video picture. That is, the video signal decoding apparatus 200 restores the current block using the prediction block generated by the prediction unit 250 and the residual obtained from the inverse transform unit 225.
  • FIG. 2 shows a decoding device 200 according to an embodiment of the present invention, and the separately displayed blocks show elements of the decoding device 200 logically distinguished. Accordingly, the elements of the above-described decoding device 200 may be mounted as one chip or as a plurality of chips depending on the design of the device. According to one embodiment, the operation of each element of the above-described decoding device 200 may be performed by a processor (not shown).
  • signaling can be described as encoding each syntax from an encoder's perspective
  • parsing can be described as interpreting each syntax from a decoder's perspective. That is, each syntax can be signaled by being included in the bitstream from the encoder, and the decoder can parse the syntax and use it in the restoration process.
  • sequence of bits for each syntax listed according to the prescribed hierarchical generation can be referred to as a bitstream.
  • One picture may be divided into sub-pictures, slices, tiles, etc. and encoded.
  • a subpicture may include one or more slices or tiles. When one picture is divided into multiple slices or tiles and encoded, it can be displayed on the screen only when all slices or tiles in the picture have been decoded. On the other hand, when one picture is encoded with several subpictures, only arbitrary subpictures can be decoded and displayed on the screen.
  • a slice may contain multiple tiles or subpictures. Alternatively, a tile may include multiple subpictures or slices. Subpictures, slices, and tiles can be encoded or decoded independently of each other, which is effective in improving parallel processing and processing speed. However, there is a disadvantage in that the bit amount increases because encoded information of other adjacent subpictures, other slices, and other tiles cannot be used.
  • Subpictures, slices, and tiles can be divided into multiple Coding Tree Units (CTUs) and encoded.
  • CTUs Coding Tree Units
  • FIG. 3 shows an embodiment in which a Coding Tree Unit (CTU) is divided into Coding Units (CUs) within a picture.
  • CTU Coding Tree Unit
  • CUs Coding Units
  • a coding tree unit can be created with a luma coding tree block (CTB), two chroma coding tree blocks, and its encoded syntax information.
  • CB luminance coding block
  • CB luminance coding block
  • coding block can be divided into several sub-coding blocks.
  • One coding unit can be created as one transform unit (TU), or one coding unit can be divided into several transform units.
  • One transform unit can be created with a luminance transform block (Transform Block, TB), two chrominance transform blocks, and its encoded syntax information.
  • a coding tree unit may be divided into a plurality of coding units.
  • a coding tree unit may be a leaf node without being split. In this case, the coding tree unit itself may be a coding unit.
  • a coding unit refers to a basic unit for processing a picture in the video signal processing process described above, that is, intra/inter prediction, transformation, quantization, and/or entropy coding.
  • the size and shape of a coding unit within one picture may not be constant.
  • the 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 may refer to a rectangular block, but the present invention is not limited thereto.
  • the coding tree unit is first divided into a quad tree (Quad Tree, QT) structure. That is, in a quad tree structure, one node with a size of 2NX2N can be divided into four nodes with a size of NXN.
  • a quad tree may also be referred to as a quaternary tree.
  • Quad-tree partitioning can be performed recursively, and not all nodes need to be partitioned to the same depth.
  • the leaf nodes of the aforementioned quad tree can be further divided into a multi-type tree (MTT) structure.
  • MTT multi-type tree
  • one node in a multi-type tree structure, one node may be divided into a binary or ternary tree structure with horizontal or vertical division. That is, there are four division structures in the multi-type tree structure: vertical binary division, horizontal binary division, vertical ternary division, and horizontal ternary division.
  • the width and height of the nodes in each tree structure may both have values that are powers of 2.
  • BT Binary Tree
  • a node of size 2NX2N may be divided into two NX2N nodes by vertical binary division and into two 2NXN nodes by horizontal binary division.
  • a node of size 2NX2N is divided into nodes of (N/2)X2N, NX2N and (N/2)X2N by vertical ternary division, and horizontal ternary division By division, it can be divided into nodes of 2NX(N/2), 2NXN, and 2NX(N/2).
  • This multi-type tree partitioning can be performed recursively.
  • Leaf nodes of a multi-type tree can be coding units. 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 division. As an example, if the width or height of the current coding unit is greater than the maximum transform length, the current coding unit may be split into a plurality of transform units without explicit signaling regarding splitting. Meanwhile, in the above-described quad tree and multi-type tree, at least one of the following parameters may be defined in advance or transmitted through an RBSP of a higher level set such as PPS, SPS, VPS, etc.
  • Figure 4 shows one embodiment of a method for signaling splitting of quad trees and multi-type trees.
  • Preset flags can be used to signal division of the above-described quad tree and multi-type tree.
  • a flag 'split_cu_flag' indicating whether to split a node
  • a flag 'split_qt_flag' indicating whether to split a quad tree node
  • a flag 'mtt_split_cu_vertical_flag' indicating the splitting direction of a multi-type tree node, or a multi-type tree node.
  • At least one of the flags 'mtt_split_cu_binary_flag' that indicates the split shape of the type tree node can be used.
  • 'split_cu_flag' a flag indicating whether to split the current node, 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 coating tree unit, the coding tree unit includes one undivided coding unit. 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 divided into nodes of a quad tree or multi-type tree according to the value of 'split_qt_flag'.
  • the coding tree unit is the root node of the quad tree and can be first divided into a quad tree structure. In the quad tree structure, 'split_qt_flag' is signaled for each node 'QT node'.
  • quad tree division may 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 the quot tree) or a quot tree node, and quot tree splitting may not be allowed if the current node is a multi-type tree node.
  • Each quad tree leaf node 'QT leaf node' can be further divided into a multi-type tree structure. As described above, if 'split_qt_flag' is 0, the current node can be split into multi-type nodes. To indicate the split direction and split shape, 'mtt_split_cu_vertical_flag' and 'mtt_split_cu_binary_flag' may be signaled.
  • the luminance block and the chrominance block can be divided into the same form. That is, the chrominance block can be divided by referring to the division type of the luminance block. If the current chrominance block is smaller than a certain size, the chrominance block may not be divided even if the luminance block is divided.
  • the luminance block and the chrominance block may have different forms.
  • division information for the luminance block and division information for the chrominance block may be signaled, respectively.
  • not only the division information but also the encoding information of the luminance block and the chrominance block may be different.
  • at least one intra coding mode of a luminance block and a chrominance block, encoding information for motion information, etc. may be different.
  • a node to be divided into the smallest unit can be processed as one coding block.
  • the coding block may be divided into several sub-blocks (sub-coding blocks), and the prediction information of each sub-block may be the same or different.
  • the intra prediction mode of each subblock may be the same or different from each other.
  • the motion information of each sub-block may be the same or different.
  • each sub-block may be encoded or decoded independently from each other.
  • Each sub-block can be distinguished through a sub-block index (sbIdx).
  • a coding unit when a coding unit is divided into sub-blocks, it may be divided horizontally or vertically or diagonally.
  • ISP Intra Sub Partitions
  • inter mode the mode in which the current coding block is divided diagonally is called GPM (geometric partitioning mode).
  • GPM mode the position and direction of the diagonal line are derived using a pre-designated angle table, and the index information of the angle table is signaled.
  • Picture prediction (motion compensation) for coding is performed on coding units that are no longer divided (i.e., leaf nodes of coding tree units).
  • the basic unit that performs such prediction is hereinafter referred to as a prediction unit or prediction block.
  • the term unit used in this specification may be used as a replacement for the prediction unit, which is a basic unit for performing prediction.
  • the present invention is not limited to this, and can be understood more broadly as a concept including the coding unit.
  • Figures 5 and 6 show the 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 reconstructed samples located to the left and/or above the current block as reference samples.
  • Figure 5 shows an example of reference samples used for prediction of the current block in intra prediction mode.
  • the reference samples may be samples adjacent to the left boundary and/or samples adjacent to the upper boundary of the current block.
  • a maximum of 2W+2H+1 located to the left and/or above the current block Reference samples can be set using the surrounding samples.
  • pixels of multiple reference lines may be used for intra prediction of the current block.
  • Multiple reference lines can be created with n lines located within a preset range from the current block.
  • separate index information indicating lines to be set as reference pixels may be signaled, and may be called a reference line index.
  • the intra prediction unit may obtain reference samples by performing a reference sample padding process. Additionally, the intra prediction unit may perform a reference sample filtering process to reduce the error of intra prediction. That is, filtered reference samples can be obtained by performing filtering on surrounding samples and/or reference samples obtained through a reference sample padding process. The intra prediction unit predicts samples of the current block using the reference samples obtained in this way. The intra prediction unit predicts samples of the current block using unfiltered or filtered reference samples.
  • peripheral samples may include samples on at least one reference line. For example, neighboring samples may include adjacent samples on a line adjacent to the boundary of the current block.
  • Intra prediction mode information indicating the intra prediction direction may be signaled.
  • Intra prediction mode information indicates one of a plurality of intra prediction modes that generate 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.
  • the intra prediction mode set may include all intra prediction modes used for intra prediction (eg, a total of 67 intra prediction modes). More specifically, the intra prediction mode set may include a planar mode, a DC mode, and multiple (e.g., 65) angular modes (i.e., directional modes). Each intra prediction mode may be indicated through a preset index (i.e., intra prediction mode index). For example, as shown in FIG. 6, intra prediction mode index 0 indicates planar mode, and intra prediction mode index 1 indicates DC mode. Additionally, intra prediction mode indices 2 to 66 may respectively indicate different angle modes. The angle modes each indicate different angles within a preset angle range.
  • the angle mode may indicate an angle within an angle range between 45 degrees and -135 degrees clockwise (i.e., a first angle range).
  • the angle mode can 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 (HORizontal, HOR) mode
  • intra prediction mode index 34 indicates diagonal (DIA) mode.
  • the mode is indicated, and intra prediction mode index 50 indicates vertical (VER) mode, and 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 clockwise 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 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 between (45-offset2) degrees and (-135-offset2) degrees clockwise (i.e., a third angle range).
  • angle modes -10 to -1 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. Additionally, offset1 and offset2 can be positive numbers.
  • the plurality of angle modes generating the intra prediction mode set may include a basic angle mode and an extended angle mode.
  • the extended angle mode may be determined based on the basic angle mode.
  • the basic angle mode corresponds to the angle used in intra prediction of the existing HEVC (High Efficiency Video Coding) standard
  • the extended angle mode corresponds to the angle newly added in intra prediction of the next-generation video codec standard. It may be a mode that does this. More specifically, the default angle mode is the intra prediction mode ⁇ 2, 4, 6,... , 66 ⁇ , and the extended angle mode is the intra prediction mode ⁇ 3, 5, 7,... , 65 ⁇ may be an angle mode corresponding to one of the following. That is, the extended angle mode may be an angle mode between basic angle modes within the first angle range. Accordingly, the angle indicated by the extended angle mode can be determined based on the angle indicated by the basic angle mode.
  • the basic angle mode may be a mode corresponding to an angle within a preset first angle range
  • the extended angle mode may be a wide angle mode outside the first angle range. That is, the default angle mode is the intra prediction mode ⁇ 2, 3, 4, ... , 66 ⁇ , and the extended angle mode is the intra prediction mode ⁇ -14, -13, -12,... , -1 ⁇ and ⁇ 67, 68, ... , 80 ⁇ may be an angle mode corresponding to one of the following.
  • the angle indicated by the extended angle mode may be determined as the angle opposite to the angle indicated by the corresponding basic angle mode. Accordingly, the angle indicated by the extended angle mode can be determined based on the angle indicated by the basic angle mode.
  • the number of expansion angle modes is not limited to this, and additional expansion angles may be defined depending on the size and/or shape of the current block.
  • the total number of intra prediction modes included in the intra prediction mode set may vary depending on the generation of the basic angle mode and extended angle mode described above.
  • the spacing between extended angle modes may be set based on the spacing between corresponding basic angle modes.
  • the extended angle modes ⁇ 3, 5, 7, ... , 65 ⁇ are the corresponding fundamental angular modes ⁇ 2, 4, 6, ... , 66 ⁇ can be determined based on the interval between them.
  • the extended angle modes ⁇ -14, -13, ... , -1 ⁇ are the corresponding opposite fundamental angular modes ⁇ 53, 53,... , 66 ⁇ is determined based on the spacing between the extended angle modes ⁇ 67, 68,... , 80 ⁇ are the corresponding opposite fundamental angular modes ⁇ 2, 3, 4, ... , 15 ⁇ can be determined based on the interval between them.
  • the angular spacing between the extended angle modes may be set to be equal to the angular spacing between the corresponding basic angle modes.
  • the number of extended angle modes in the intra prediction mode set may be set to less than the number of basic angle modes.
  • the extended angle mode may be signaled based on the basic angle mode.
  • a wide angle mode i.e., extended angle mode
  • the basic angle mode that is replaced may be an angle mode corresponding to the opposite side of the wide angle mode. That is, the basic angle mode that is replaced is an angle mode that corresponds to an angle in the opposite direction of the angle indicated by the wide-angle mode or to an angle that differs from the angle in the opposite direction by a preset offset index.
  • the preset offset index is 1.
  • the intra-prediction mode index corresponding to the replaced basic angle mode may be remapped to the wide-angle mode to signal the corresponding wide-angle mode.
  • wide angle mode ⁇ -14, -13, ... , -1 ⁇ is the intra prediction mode index ⁇ 52, 53, ... , 66 ⁇ , respectively
  • the wide-angle mode ⁇ 67, 68, ... , 80 ⁇ is the intra prediction mode index ⁇ 2, 3, ... , 15 ⁇ can be signaled respectively.
  • the intra prediction mode index for the basic angle mode signals the extended angle mode, so that even if the angle modes used for intra prediction of each block are generated differently, the same set of intra prediction mode indexes are used for signaling of the intra prediction mode. can be used Accordingly, signaling overhead due to changes in intra prediction mode generation can be minimized.
  • whether to use the extended angle mode may be determined based on at least one of the shape and size of the current block.
  • the extended angle mode may be used for intra prediction of the current block, otherwise, only the basic 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 basic 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.
  • the intra prediction mode index indicates a specific angle mode
  • a reference sample or an interpolated reference sample corresponding to the specific angle from the current sample of the current block is used for prediction of the current pixel. Accordingly, different sets of reference samples and/or interpolated reference samples may 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 transformer to the intra prediction value of the current block. .
  • Movement (motion) information used for inter prediction may include reference direction indication information (inter_pred_idc), reference picture indices (ref_idx_l0, ref_idx_l1), and motion (motion) vectors (mvL0, mvL1).
  • Reference picture list utilization information (predFlagL0, predFlagL1) may be set according to the reference direction indication information.
  • the coding unit may be divided into several sub-blocks, and the prediction information of each sub-block may be the same or different.
  • the intra prediction mode of each subblock may be the same or different from each other.
  • the motion information of each sub-block may be the same or different.
  • each sub-block may be encoded or decoded independently from each other.
  • 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 the motion vector of neighboring blocks. Therefore, the motion vector of the neighboring block can be used as a motion vector predictor (mvp), and the motion vector of the current block can be derived using the motion vector of the neighboring block. Additionally, in order to increase the accuracy of the motion vector, the motion vector difference (mvd) between the optimal motion vector of the current block found in the original image by the encoder and the predicted value of the motion information may be signaled.
  • mvp motion vector predictor
  • mvd motion vector difference between the optimal motion vector of the current block found in the original image by the encoder and the predicted value of the motion information
  • the motion vector may have various resolutions, and the resolution of the motion vector may vary on a block basis.
  • Motion vector resolution can be expressed in integer units, half-pixel units, 1/4 pixel units, 1/16 pixel units, integer pixel units of 4, etc. Since images such as screen content are in the form of simple graphics such as text, there is no need to apply an interpolation filter, so integer units and integer pixel units of 4 can be selectively applied on a block basis.
  • Blocks encoded in affine mode which can express rotation and scale, have significant changes in shape, so integer units, 1/4 pixel units, and 1/16 pixel units can be selectively applied on a block basis.
  • Information on whether to selectively apply motion vector resolution on a block basis is signaled with amvr_flag. If applied, which motion vector resolution to apply to the current block is signaled with amvr_precision_idx.
  • the weights between two prediction blocks may be the same or different, and information about the weights is signaled through bcw_idx.
  • the Merge method is a method that generates the motion information of the current block to be the same as the motion information of neighboring blocks adjacent to the current block.
  • the Merge method has the advantage of increasing the coding efficiency of motion information by spatially propagating motion information without change in a motion region with homogeneity.
  • the AMVP method is a method that predicts motion information in the L0 and L1 prediction directions respectively and signals the most optimal motion information in order to express accurate motion information.
  • the decoder derives motion information for the current block through the AMVP or Merge method and then uses the reference block located in the motion information derived from the reference picture as a prediction block for the current block.
  • a method of deriving motion information in Merge or AMVP may be to generate a motion candidate list using the predicted value of motion information derived from neighboring blocks of the current block, and then index information for the optimal motion candidate is signaled. .
  • 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.
  • one merge index (merge_idx) is signaled.
  • the motion candidate list derived from one coding unit may vary, and a motion candidate index or merge index may be signaled for each motion candidate list. At this time, a mode in which there is no information about the remaining blocks in blocks encoded in Merge mode can be called Merge Skip mode.
  • Bidirectional movement information for the current block can be derived by mixing AMVP and Merge modes.
  • motion information in the L0 direction can be derived using the AMVP method
  • motion information in the L1 direction can be derived using the Merge method.
  • Merge can be applied to L0 and AMVP to L1. This encoding mode can be called AMVP-merge mode.
  • SMVD Symmetric MVD
  • MVD Motion Vector Difference
  • OBMC Overlapped Block Motion Compensation
  • the MMVD method is a method of correcting motion information using one candidate selected from among several motion difference value candidates.
  • Information about the correction value of motion information obtained through the MMVD method may be included in the bitstream and transmitted to the decoder.
  • the amount of bits can be saved by including information about the correction value of motion information in the bitstream.
  • the TM (Template Matching) method is a method of correcting motion information by creating a template using surrounding pixels of the current block and finding a matching area with the highest similarity to the template.
  • Template matching (TM) is a method of performing motion prediction in a decoder without including motion information in the bitstream in order to reduce the size of the encoded bitstream. At this time, since the decoder does not have the original image, it can roughly derive motion information about the current block using already restored neighboring blocks.
  • the DMVR (Decoder-side Motion Vector Refinement) method is a method of correcting motion information through the correlation of already restored reference images in order to find more accurate motion information. It uses the bidirectional motion information of the current block to compare the two reference pictures. This is a method of using the point with the best matching between reference blocks in a reference picture within a certain area as a new bidirectional movement.
  • the encoder corrects the motion information by performing DMVR in one block unit, then divides the block into sub-blocks and performs DMVR in each sub-block unit to correct the motion information of the sub-block again. This can be done, and this can be called MP-DMVR (Multi-pass DMVR).
  • the LIC (Local Illumination Compensation) method is a method of compensating for luminance changes between blocks. It derives a linear model using surrounding pixels adjacent to the current block, and then compensates for the luminance information of the current block through the linear model.
  • BDOF Bi-Directional Optical Flow
  • the motion of the current block can be corrected using motion information derived from the BDOF of this VVC.
  • PROF Prediction refinement with optical flow
  • PROF is a technology to improve the accuracy of sub-block-level affine motion prediction to be similar to the accuracy of pixel-level motion prediction.
  • PROF similar to BDOF, is a technology that obtains the final prediction signal by calculating correction values in pixel units for affine motion compensated pixel values in sub-block units based on optical flow.
  • CIIP Combined Inter-/Intra-picture Prediction
  • the IBC (Intra Block Copy) method is a method that finds the part most similar to the current block in an already reconstructed area in the current picture and uses the corresponding reference block as a prediction block for the current block. At this time, information related to the block vector, which is the distance between the current block and the reference block, may be included in the bitstream.
  • the decoder can calculate or set the block vector for the current block by parsing information related to the block vector contained in Paintstream.
  • the BCW (Bi-prediction with CU-level Weights) method does not generate a prediction block by averaging two prediction blocks that have been motion-compensated from different reference pictures, but applies weights adaptively on a block-by-block basis to compensate for motion. This is a method of performing a weighted average on two prediction blocks.
  • 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 prediction.
  • CCLM Cross-component linear model
  • MMLM Multi-model Linear mode
  • CCLM Cross-Component Prediction
  • MMLM uses multiple linear models, so it can be said to be a multiple (or complex) CCP model.
  • the encoder and decoder can construct a restored luminance block by adding the luminance prediction block of the current block and the error signal for the luminance block, and then construct a CCP model using the correlation between the restored 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 the chrominance prediction block to generate a first chrominance prediction block to which the CCP model is applied.
  • the final color difference block can be generated by adding the error signals for the first color difference prediction block and the color difference block.
  • the CCP model means using at least one type among the types of the CCP model.
  • a CCP model may consist of at least one CCP model.
  • One CCP model can be composed of two CCLMs, which can be referred to as MMLM.
  • a new CCP model may have a different type of CCP model, or the type of CCP model may be the same, but the parameters of the CCP model may have different values. If the types of CCP models are different between CCP models, they can be said to be different CCP models. If the type of CCP model is the same between CCP models, but the parameters between CCP models are different, they can be said to be different CCP models.
  • the CCP model may include at least one of the following: type information of the CCP model, parameter information of the CCP model, information on whether multiple CCPs such as MMLM or MM-CCCM were used, information on the average value of the luminance block, and downsampling filter information.
  • CCCM Convolutional cross-component model
  • GLM Gradient Linear Model
  • MM-CCCM (multi-model CCCM) is a method of deriving two CCCM parameters based on the average value of the reference area (or restored current luminance block).
  • GL-CCCM (Gradient and location based convolutional cross-component model) is an additional CCCM mode that uses gradient and location information.
  • the existing CCCM mode can derive a chrominance sample for the current block using a luminance sample at a position corresponding to the chrominance sample position to be predicted, four samples around the luminance sample, and coefficient information.
  • the GL-CCCM mode uses the luminance sample at the position corresponding to the chrominance sample to be predicted, the vertical and horizontal differences for the 8 samples around the luminance sample, the horizontal and vertical coordinates of the current luminance sample, and the coefficient information of the prediction model. You can use it to derive a color difference sample for the current block.
  • CCCM which predicts the chrominance block based on the luminance block
  • various down-sampling filters may be applied. This mode may be referred to as CCCM-MDF (CCCM with multiple downsampling filters).
  • the restored coefficients t' k for input coefficients t k depend only on the associated quantization index q k . That is, the quantization index for any restored coefficient has a different value from the quantization indexes for other restored coefficients.
  • t' k may be a value including the quantization error at t k and may be different or the same depending on the quantization parameter.
  • t'k may be named a restored transform coefficient or a dequantized transform coefficient
  • the quantization index may be named a quantized transform coefficient.
  • the reconstructed coefficients have the characteristic of being arranged at equal intervals.
  • the distance between two adjacent restored values can be referred to as the quantization step size.
  • the restored values may include 0, and the entire set of available restored values may be uniquely defined depending on the quantization step size.
  • the quantization step size may vary depending on the quantization parameter.
  • the set of allowable restored transform coefficients decreases due to quantization, and the number of elements of this set may be finite. Because of this, there is a limit to minimizing the average error between the original image and the restored image.
  • Vector quantization can be used as a method to minimize this average error.
  • a simple form of vector quantization method used in video encoding is sign data hiding. This is a method in which the encoder does not encode the sign of one non-zero coefficient, and the decoder determines the sign for the corresponding coefficient depending on whether the sum of the absolute values of all coefficients is even or odd. To this end, at least one coefficient may be increased or decreased by '1' in the encoder, and at least one coefficient is selected to be optimal in terms of cost for rate-distortion, so that the value is It can be adjusted. As an example embodiment, a coefficient having a value close to the boundary of the quantization interval may be selected.
  • Trellis-Coded Quantization Another vector quantization method is Trellis-Coded Quantization, and in video coding, it is used as an optimal path search technique to obtain an optimized quantization value in dependent quantization.
  • quantization candidates for all coefficients within a block are placed in a trellis graph, and the optimal trellis path between optimized quantization candidates is determined considering the cost of rate-distortion. and explore.
  • dependent quantization applied to video encoding may be designed such that the set of allowable restored transform coefficients for a transform coefficient depends on the value of the transform coefficient that precedes the current transform coefficient in reconstruction order. At this time, by selectively using multiple quantizers according to the transformation coefficient, the average error between the original image and the restored image is minimized, thereby increasing coding efficiency.
  • the MIP (Matrix Intra Prediction) method is a matrix-based intra prediction method. Unlike prediction methods that have directionality from pixels of neighboring blocks adjacent to the current block, pixels on the left and top of neighboring blocks are used as a predefined matrix. This is a method of obtaining a prediction signal using the and offset values.
  • the intra prediction mode for the template derived through the surrounding pixels of the template is used to restore the current block. It can be used for.
  • the decoder can generate a prediction template for the template using surrounding pixels (references) adjacent to the template, and use the intra prediction mode, which generates a prediction template most similar to the already restored template, to restore the current block. This method can be called TIMD (Template intra mode derivation).
  • an encoder can determine a prediction mode for generating a prediction block and generate a bitstream containing information about the determined prediction mode.
  • the decoder can set the intra prediction mode by parsing the received bitstream.
  • the bit amount of information about the prediction mode may be about 10% of the total bitstream size.
  • the encoder may not include information about the intra prediction mode in the bitstream. Accordingly, the decoder can derive (determine) an intra prediction mode for restoration of the current block using the characteristics of the surrounding blocks, and can restore the current block using the derived intra prediction mode.
  • the decoder infers directionality information by applying a Sobel filter horizontally and vertically to each surrounding pixel adjacent to the current block to derive the intra prediction mode, and then converts the directionality information into the intra prediction mode.
  • a mapping method can be used.
  • the method by which the decoder derives an intra prediction mode using neighboring blocks can be described as DIMD (Decoder side intra mode derivation).
  • a block predicted using the intra prediction directional mode may have discontinuous edges at the top and left boundaries of the block. For example, if the current block is predicted using the vertical direction mode, a discontinuous edge may appear at the left border of the block.
  • the encoder and decoder can apply filtering to samples at the boundaries within the prediction block. Filtering is performed on restored samples adjacent to the current prediction block, location information of restored samples adjacent to the current prediction block, samples at the boundary portion inside the current prediction block, location information of samples at the boundary portion inside the current prediction block, and location information of the samples at the boundary portion inside the current prediction block.
  • Whether to apply filtering and/or filtering weights may be determined using at least one of the intra prediction directional mode, the horizontal size, and the vertical size of the current prediction block.
  • the filtering weight refers to the weight for the sample at the boundary part inside the current prediction block and the weight for the restored sample adjacent to the current prediction block.
  • This filtering method can be called PDPC (Position dependent intra prediction combination).
  • Figure 7 is a diagram showing the positions of neighboring blocks used to generate a motion candidate list in inter prediction.
  • Surrounding blocks may be blocks in a spatial location or blocks in a temporal location. Surrounding blocks that are spatially adjacent to the current block are Left (A1) block, Left Below (A0) block, Above (B1) block, Above Right (B0) block, or Above Left. , B2) It can be at least one of the blocks.
  • the neighboring block temporally adjacent to the current block may be a block containing the upper left pixel position of the bottom right (BR) block of the current block in the corresponding picture (Collocated picture). If a neighboring block temporally adjacent to the current block is encoded in intra mode or a neighboring block temporally adjacent to the current block is located in an unusable position, the picture corresponding to the current picture (collocated picture) is selected.
  • a block containing the horizontal and vertical center (Center, Ctr) pixel position of the block can be used as a temporal peripheral block.
  • Motion candidate information derived from the corresponding picture may be referred to as TMVP (Temporal Motion Vector Predictor). Only one TMVP can be derived from one block, and after dividing one block into several sub-blocks, each TMVP candidate can be derived for each sub-block.
  • the TMVP derivation method on a sub-block basis may be referred to as sbTMVP (sub-block Temporal Motion Vector Predictor).
  • slice type information e.g., whether it is an I slice, a P slice, or a B slice
  • slice type information e.g., whether it is an I slice, a P slice, or a B slice
  • whether it is a tile whether it is a subpicture
  • the size of the current block the depth of the coding unit, and the current block. It may be determined based on at least one of information about whether it is a luminance block or a chrominance block, whether it is a reference frame or a non-reference frame, reference order, and temporal hierarchy according to the hierarchy.
  • Information used to determine whether the methods described in this specification will be applied may be information previously agreed upon between the decoder and the encoder. Additionally, this information may be determined according to profile and level.
  • This information can be expressed as variable values, and the bitstream can include information about variable values. That is, the decoder can determine whether the above-described methods are applied by parsing information about variable values included in the bitstream. For example, it may be determined whether the above-described methods will be applied based on the horizontal or vertical length of the coding unit. If the horizontal or vertical length is 32 or more (e.g., 32, 64, 128, etc.), the above-described methods can be applied. Additionally, the above-described methods can be applied when the horizontal or vertical length is less than 32 (e.g., 2, 4, 8, 16). Additionally, the above-described methods can be applied when the horizontal or vertical length is 4 or 8.
  • the encoder and decoder can first predict the chrominance sample of the current block based on the restored luminance block. Specifically, the encoder and decoder obtain a model that models the relationship between the value of the luminance sample and the value of the chrominance sample based on the surrounding sample values of the current block, and use the obtained model and the luminance block of the current block to obtain the chrominance sample of the current block. Blocks can be predicted. At this time, the model may include at least one of a linear model and a non-linear model. These embodiments will be described with reference to FIGS. 8 to 24.
  • Figure 8 shows a block diagram in which CCLM is performed according to an embodiment of the present invention. Additionally, Figure 9 shows an example of a template configuration used to derive a linear model according to an embodiment of the present invention.
  • the encoder and decoder When the encoder and decoder perform CCLM, the encoder and decoder are neighboring blocks adjacent to the current block, and the restored block can be used to construct a template.
  • the template is a set of restored blocks used in CCLM.
  • the encoder and decoder derive the parameters of the linear model of CCLM based on the configured template.
  • the luminance block is downsampled to match the size of the chrominance block.
  • the encoder and decoder use a linear model to predict the chrominance block of the current block. Additionally, more than two linear models can be used in CCLM.
  • CCLM in which two or more linear models are used is referred to as MMLM (Multi-model Linear mode).
  • a template may contain only some of the surrounding pixels adjacent to the current block.
  • the template may include a pixel indicated by 'O' in FIG. 9. If the 4:2:0 color format is used, the chrominance block is 1/4 the size of the luminance block.
  • downsampled luminance samples can be used in CCLM.
  • encoders and decoders can use two types of filters. The type of filter to be used may be determined based on at least one of the SPS, PPS, PH, Slice, Tile, CU, and sub-block of the current block. Additionally, the bit stream may include information about what type of filter will be used in CCLM.
  • the decoder can parse information about what type of filter will be used in CCLM from the bitstream.
  • the first type (Type 1) is a method of deriving the luminance sample at the center 'O' position using 6 samples.
  • the first type (Type 1) may be applied to position A to generate a down-sampled luminance template.
  • a luminance template represents a set of luminance sample values obtained according to a predetermined method.
  • the second type (Type 2) is a method of deriving a luminance sample at the center position using 5 samples.
  • the second type (Type 2) may be applied to position C to generate a down-sampled luminance template.
  • Figure 9B shows a method of configuring a down-sampled luminance template according to an example of the present invention.
  • the encoder and decoder may use the restored luminance samples of blocks surrounding the current block as the top three samples of the first type (Type 1). Additionally, the restored luminance samples within the current block may be used as the lower three samples of the first type (Type 1). The location of the final generated luminance pixel may be the hatched portion of FIG. 9 .
  • the same can be applied to the second type (Type 2) of this operation.
  • the encoder and decoder may configure a down-sampled luminance template using only the top three samples of the first type (Type 1).
  • the location of the final generated luminance pixel may be the hatched portion of FIG. 9 .
  • This operation can be equally applied to the second type (Type 2). Parallel processing performance can be improved through these embodiments.
  • the encoder and decoder can construct a template using only one line closest to the current block among the three upper pixel lines. At this time, one adjacent line sample may be padded into the second and third lines so that the existing first type (Type 1) and second type (Type 2) filter types can be applied. These embodiments can save memory on the line buffer.
  • the encoder can select a sample with good encoding efficiency among the samples adjacent to the left, samples adjacent to the top, and samples adjacent to the left and samples adjacent to the top of the current block and use it as a template.
  • the bit stream may include information about which position of the sample is used as a template for CCLM or MMLM, that is, information about the template position.
  • the decoder may parse information about the template location from the bit stream and construct a template based on the information about the template location.
  • this signaling method can be a factor in increasing the bit amount. Therefore, the encoder and decoder can implicitly determine the template position through the following embodiments.
  • a sample adjacent to the left of the current block is referred to as a left sample
  • a sample adjacent to the top of the current block is referred to as a top sample.
  • the encoder and decoder may determine the location of the template based on the intra prediction directional mode. Specifically, the encoder and decoder may determine a sample close to the direction indicated by the intra prediction directionality mode used for prediction of the current luminance block among the top sample, the sample adjacent to the left, and the sample adjacent to the top as the template position. For example, if the direction indicated by the intra prediction directionality mode is closer to the top sample than the left sample or is a pre-designated value, the encoder and decoder can use only the top template as a template for CCLM or MMLM.
  • the encoder and decoder can use only the left template as a template for CCLM.
  • the pre-specified values may be 50 and 18.
  • the encoder and decoder can use the top sample as a template for CCLM or MMLM.
  • the encoder and decoder can use the left sample as a template for CCLM.
  • the encoder and decoder can use the top sample and left sample as a template for CCLM or MMLM.
  • the encoder and decoder when the encoder and decoder construct a template of CCLM or MMLM, the encoder and decoder determine the value of the quantization parameter used when restoring the neighboring block adjacent to the left and the quantization used when restoring the neighboring block adjacent to the top. By comparing the values of the parameters, it is possible to determine which sample to use among the top sample, the sample adjacent to the left, and the sample adjacent to the top. Specifically, the encoder and decoder use CCLM or MMLM samples of neighboring blocks with the smaller value of the quantization parameter used when restoring the neighboring block on the left and the value of the quantization parameter used when restoring the neighboring block on the top. It can be used to configure templates.
  • the encoder and decoder All of the samples can be used to construct templates for CCLM or MMLM. Through this embodiment, samples restored with higher image quality can be used for CCLM or MMLM. In another specific embodiment, the encoder and the decoder use CCLM or It can be used to configure templates for MMLM.
  • the encoder and decoder Both the left and top samples can be used to construct a template for CCLM or MMLM.
  • the encoder and decoder may determine the location of the sample used for template construction based on the size of the current block. Specifically, the encoder and decoder can use both left and top samples as a template for CCLM or MMLM if the size of the current block is within a pre-specified value. The size of the current block can be determined based on the sum of the width and height of the current block. Additionally, the pre-designated value may be an integer of 1 or more.
  • the encoder and decoder may determine the location of the sample used to construct the template based on the width-to-height ratio of the current block. Specifically, if the width of the current block is longer than the length, the encoder and decoder can use the left sample to construct a template for CCLM or MMLM. In another specific embodiment, if the width of the current block is longer than the length, the encoder and decoder may use the top sample to construct a template for CCLM.
  • the encoder and decoder may determine the location of the sample used to construct the template based on whether the left sample is restored by applying CCLM or MMLM and the top sample is restored by applying CCLM or MMLM. Specifically, if CCLM and MMLM are not applied to the restoration of the left sample, and CCLM or MMLM are applied to the restoration of the top sample, the encoder and decoder can use the top sample to construct a template of CCLM or MMLM.
  • the encoder and decoder may use the left sample to construct a template of CCLM or MMLM. .
  • the encoder and decoder may be configured to perform a function based on the number of pixels on which reference sample padding has been performed in samples of the left neighboring block of the current block or the number of pixels on which reference sample padding has been performed on samples of the upper neighboring block of the current block. You can determine the location of the samples used to construct the template. Specifically, if the number of pixels on which reference sample padding has been performed in the sample of the left neighboring block of the current block is more than a pre-specified value, the encoder and decoder can configure the template of CCLM or MMLM without using the left sample. At this time, the pre-designated value may be an integer of 1 or more.
  • the encoder and decoder can configure the template of CCLM or MMLM without using the upper sample.
  • the pre-designated value may be an integer of 1 or more.
  • the encoder and decoder can derive a linear model using pre-specified default parameters.
  • the encoder and decoder may derive a linear model using pre-specified basic parameters.
  • the pre-specified value may be an integer greater than or equal to 1.
  • pre-designated basic parameters may be 0 for A1, X for B1, and 0 for shift.
  • X may be half of the maximum value of the range of the current video format. For example, if the current video format has an 8-bit range, X may be 128.
  • Figure 10 shows that the encoder and decoder according to an embodiment of the present invention derive two linear models based on a threshold.
  • the surrounding pixels used to construct the template may be pixels before deblocking filtering is applied. Additionally, when LMCS is applied to surrounding pixels used in template construction, pixels before inverse mapping are performed may be used. In another specific embodiment, when LMCS is applied to surrounding pixels used in template construction, pixels after inverse mapping are performed may be used.
  • the encoder and decoder can obtain the parameters of the linear model using the configured template. More than one linear model may be used per block.
  • the encoder can include information in the bitstream that indicates how many linear models will be used per block.
  • the decoder can parse information indicating how many linear models will be used for each block from the bitstream and derive linear models for the current chrominance block based on the information indicating how many linear models will be used.
  • Methods for the encoder and decoder to derive a linear model may include the least mean square (LMS) method and the MIN/MAX method.
  • LMS least mean square
  • the encoder and decoder generate two small values (X 0 A , X 1 A ) and two large values (X 0 B , look for
  • the encoder and decoder use the values of the color difference samples (Y 0 A , Y 1 A , Y 0 B , Y 1 B ) corresponding to the four samples and the average of small values (X A , Y A) using Equation 1. ) and the average of large values (X B , Y B ).
  • the encoder and decoder calculate the final linear model parameters a and b using Equation 2.
  • the encoder and decoder predict the chrominance block
  • the encoder and decoder can predict each sample of the chrominance block using linear model parameters (a, b) and luminance sample values, as shown in Equation 3.
  • the encoder and decoder can obtain the parameter values of the linear model using the template and Equation 4 and Equation 5.
  • Rec C (i) and Rec' L (i) refer to the chrominance sample and downsampled luminance sample in the template, respectively, and I refers to the number of samples in the template.
  • I refers to the sample at the location marked in gray.
  • the encoder and decoder can use two or more linear models instead of just one linear model.
  • encoders and decoders can use a mixture of CCLM mode, which uses only one existing linear model, and MMLM mode, which uses two or more linear models.
  • information regarding selection of the linear model may be signaled in CU units.
  • a method for deriving parameters for two linear models may be performed in the following order.
  • the encoder and decoder calculate the average value of the samples in the luminance template and the average value of the samples in the chrominance template.
  • a color difference template represents a set of color difference sample values obtained according to a predetermined method.
  • the encoder and decoder can use the average value scaled to an extended range through the number of samples of each template as each average value.
  • the encoder and decoder may use either a template containing down-sampled luminance sample values or a template containing luminance sample values before down-sampling as an average value for samples in the luminance template.
  • Encoders and decoders set the parameters for the linear model to default values.
  • the encoder and decoder can set A1 and A2 to 0, and B1 and B2 can be set to half the maximum value of the range of the current video format. For example, if the range of the video format is 8 bits, the encoder and decoder can set B1 and B2 to 128. Additionally, the encoder and decoder set the shift value to 0 to restore the scaled value to its original state.
  • the encoder and decoder can use two linear models with default parameters for CCML or MMLM.
  • the pre-specified value may be an integer greater than or equal to 1.
  • the pre-specified value may be 4.
  • the encoder and decoder divide chrominance samples at the same location as each sample of the luminance template into two groups according to the scaled average value of the samples in the luminance template. Specifically, the encoder and decoder may classify samples smaller than or equal to the average value into the first group, and samples larger than the average value into the second group.
  • the encoder and decoder perform padding with surrounding samples so that the number of samples in each group is a multiple of 2. At this time, if the number of samples in each group is within a pre-specified number, the encoder and decoder do not perform padding.
  • the pre-specified number may be an integer greater than or equal to 1.
  • the encoder and decoder may not derive two linear models but only one linear model.
  • the pre-specified number may be an integer greater than or equal to 1. For example, the pre-designated number may be 4.
  • the encoder and decoder derive parameters for the linear model for each group using Equation 4 and Equation 5. At this time, if the number of samples in each group is within a predetermined number, the encoder and decoder obtain a difference value by subtracting the average value of the samples in the luminance template from the average value of the samples in the chrominance template. The encoder and decoder end the linear model derivation process for the group by substituting the obtained difference value into the parameter B value for the linear model.
  • the encoder and decoder may not induce two linear models but only one linear model.
  • the pre-specified number may be an integer greater than or equal to 1. For example, the pre-designated number may be 4.
  • the encoder and decoder may use the average value of the restored luminance blocks within the current block instead of the average value of the luminance templates of neighboring blocks adjacent to the current block.
  • the encoder and decoder may use the average value between the average value of the current luminance block and the average value of the luminance template as a threshold for distinguishing two linear models. The threshold may be compared with the value of the luminance sample at the location of the sample that is finally generated by applying a down-sampling filter to the surrounding luminance samples of the current block.
  • the encoder and decoder apply a down-sampling filter to the surrounding luminance samples of the current block, and depending on whether the value of the luminance sample at the position of the final generated sample is greater than the threshold, the surrounding luminance sample of the current block is selected from one of two linear models. You can decide which model to use for derivation.
  • the down-sampling filter is a filter used to match the number of luminance samples to the number of chrominance samples.
  • the average value of the luminance block of the surrounding block may be the average value for the down-sampled luminance component.
  • the average value of the luminance block of the current block may also be the average value of the down-sampled luminance blocks.
  • the encoder and decoder may use an average value calculated using at least one of the pixel value of the luminance template of a neighboring block adjacent to the current block and the pixel value of the restored luminance block within the current block.
  • one of the average value of the current luminance block and the average value of the luminance template may be used as a threshold for distinguishing two linear models.
  • the average value of the luminance block of the surrounding block may be the average value for the down-sampled luminance components.
  • the average value of the luminance block of the current block may also be the average value of the down-sampled luminance blocks.
  • the average value of the luminance template and the luminance block may be the average value of the luminance template and the luminance block before down-sampling.
  • the weight for calculating the average value between the luminance template and the restored luminance block within the current block may vary depending on the size of the current block. Specifically, if the size of the current block is equal to or smaller than the pre-specified size, the encoder and decoder calculate the average value by multiplying the pixel value of the luminance template by a first weight and the pixel value of the restored luminance block within the current block by a second weight. You can. The calculated average value can be used as a threshold to distinguish two models in the MMLM method.
  • the pre-designated size may be determined differently depending on the horizontal and vertical sizes of the current block. In a specific embodiment, the pre-designated size may be the sum of the horizontal and vertical sizes of the current block.
  • the pre-specified size may be 12.
  • the first weight and the second weight may be integers.
  • the second weight may be set to be larger than the first weight.
  • the second weight may be set to be smaller than the first weight.
  • the first weight may be set to 1 and the second weight may be set to 4.
  • the average value calculation may vary depending on the weight. If the second weight is 4, when calculating the average value, the average value may be calculated by considering the size of the current block as 4 times. Through this, when calculating the average value, the proportion of the current block can be increased even if the size of the current block is small.
  • the average value of the chrominance template may be used instead of the average value of the luminance template to distinguish between two linear models.
  • the average value of each color difference template can be used for each of the two color difference components.
  • two linear models can be derived for each color difference component.
  • the encoder and decoder may use the average value of samples of the luminance template classified into two using the average value of the chrominance template as the threshold for applying the two linear models to the currently restored luminance block. Specifically, the encoder and decoder can select which linear model to apply to the samples of the currently restored luminance block using the average value of the two luminance averages for the luminance template.
  • the encoder may include information indicating a threshold for distinguishing two linear models in the bitstream.
  • the decoder can parse information indicating a threshold for distinguishing two linear models from the non-stream and distinguish the two linear models based on the information indicating a threshold for distinguishing the two parsed linear models.
  • information indicating a threshold for distinguishing two linear models may be an index indicating one of pre-designated values. Pre-specified values may include thresholds used in neighboring blocks.
  • information indicating a threshold for distinguishing linear models may be a threshold value.
  • Information indicating a threshold for distinguishing linear models may be included in the bitstream on a block basis.
  • the encoder may include in the bitstream a flag indicating whether the information indicating the threshold for distinguishing linear models directly indicates the threshold value or indicates one of pre-designated candidates.
  • the decoder can parse the corresponding flag from the bitstream and obtain a threshold for distinguishing linear models based on the parsed flag.
  • the number of pre-designated values may be pre-designated. Additionally, pre-designated values can be managed according to FIFO. Therefore, when one of the pre-designated values is added, any one of the pre-designated values can be excluded.
  • the number of linear models for the encoder and decoder can be derived according to the following examples.
  • the encoder and decoder can use only one linear model. In another specific embodiment, when the value of the reference line index is greater than 1, the encoder and decoder may use two linear models. This is because if the value of the reference line index used to construct the prediction sample for the current luminance block is greater than 1, it is likely to be a block that changes linearly.
  • the decoder may predict the chrominance block using only one linear model. This is because if the value of the reference line index is 0, it can be determined that samples adjacent to the current block are used. At this time, the encoder may not include syntax related to CCLM and MMLM in the bitstream. Additionally, the decoder may determine whether to parse syntax related to CCLM and MMLM according to the reference line index. If the reference line index is 0, the decoder may not parse the syntax related to CCLM and MMLM. At this time, the decoder can infer that the CCLM mode applied to the current block is a CCLM mode in which only one linear model is used.
  • the encoder and decoder may determine the number of linear models according to the horizontal or vertical size of the current block. Specifically, if the horizontal or vertical size of the current block is within a pre-specified value, only one linear model can be used. In another specific embodiment, when the horizontal or vertical size of the current block is greater than or equal to a pre-specified value, only one linear model can be used. In these embodiments, the pre-designated value may be an integer of 1 or more.
  • the encoder and decoder may divide the current block into sub-blocks and use each linear model for each divided sub-block.
  • the encoder and decoder can use the restored samples of the neighboring blocks located closest to the sub-block as a template for deriving the linear model of the sub-block.
  • the current block may be divided into four sub-blocks.
  • the encoder and decoder can use both the left and top templates in the first subblock.
  • encoders and decoders can only use the top template for the second subblock.
  • the encoder and decoder can only use the left template in the third subblock.
  • the encoder and decoder can derive a linear model by using both the top template of the second subblock and the left template of the third subblock in the fourth template.
  • at least one linear model may be derived for each sub-block.
  • the encoder and decoder use at least one of the following: an intra prediction mode of the current luminance block, a coefficient distribution of the residual block of the current luminance block, a quantization parameter of the current block, and whether CCLM or MMLM of neighboring blocks is used.
  • the number of linear models in the current block can be determined. Specifically, if there is one or more blocks using MMLM among neighboring blocks, the encoder and decoder can apply MMLM to the current block. If CCLM has been used in all neighboring blocks, the encoder and decoder can apply CCLM to the current block.
  • the encoder and decoder may obtain two linear models in the current block signaled as having MMLM used. At this time, using the similarity between the parameter values of the two linear models, the mode for the current block can be reset to CCLM and one linear model can be used. At this time, when the encoder and decoder determine the similarity between parameter values of two linear models, the encoder and decoder may use at least one of the similarity between a1 and a2 and the similarity between b1 and b2 in Equation 6. At this time, if the difference between the absolute values of the two values is within a pre-specified value, the encoder and decoder may determine that the parameter values of the two linear models are similar. The pre-specified value may be an integer greater than or equal to 1. Additionally, since there are two color difference components, the number of linear models may vary for each two color difference components.
  • Figure 11 shows a method of configuring syntax for the encoding mode of a linear model according to an embodiment of the present invention.
  • the same intra prediction directional mode for two color difference components (Cb, Cr) is applied. Therefore, the same number of linear models can be applied to the two color difference components.
  • an intra prediction mode may be signaled for each color difference component. The number of linear models can be determined for each two color difference components. Specifically, a horizontal intra prediction mode may be applied to the chrominance component Cb, and a prediction mode using two linear models may be applied to the chrominance component Cr.
  • information about whether LM mode, CCLM, or MMLM will be applied to two color difference components is first signaled, and then information about whether CCLM or MMLM will be applied to each color difference component is additionally signaled. It can be.
  • the decoder can implicitly decide whether to apply CCLM or MMLM. In this embodiment, since additional information about each color difference component is not signaled, the bit amount may be reduced.
  • the TIMD coding mode two intra prediction directional modes are used to generate the luminance prediction block.
  • This TIMD coding mode can be usefully applied to blocks in which directional characteristics do not clearly exist.
  • the encoder and decoder can implicitly set the intra prediction mode of the chrominance block of the current block to CCLM or MMLM mode.
  • the encoder and decoder can decide whether to apply the CCP mode to the current chrominance block according to the encoding mode of the current block. At this time, information about whether CCLM and MMLM will be used may be signaled.
  • CCLM or MMLM information about whether CCLM or MMLM will be used may be signaled for each chrominance component and included in the bitstream. If the current block is in TIMD mode, the decoder can parse the corresponding information about the chrominance component and decide whether to apply CCLM or MMLM according to the parsed information. In another specific embodiment, without signaling the chrominance component, the decoder may set that MMLM is applied and then determine whether to apply CCLM rather than MMLM according to the method for deriving the number of linear models described above. In addition, it can be implicitly determined that the mode for the chrominance signal uses CCLM or MMLM not only in blocks encoded in TIMD mode but also in blocks encoded in MIP and DIMD modes.
  • prediction blocks are each generated using two intra prediction directional modes, and each prediction block is weighted to generate the final prediction block.
  • the encoder and decoder add the residual block to the final prediction block to obtain a restored luminance block. Since CCLM or MMLM is then performed using the restored luminance block for the chrominance block, the number of processing steps increases, which may lower the processing speed. Therefore, the encoder and decoder can use the final predicted luminance block instead of using the restored luminance block as a luminance block for CCLM or MMLM. Through these embodiments, processing speed can be improved. Additionally, the final predicted luminance block may have lower accuracy than the restored luminance block.
  • the encoder can include information about which stage of the luminance block to use for CCLM or MMLM in the bitstream.
  • the decoder may parse the information and determine whether the luminance block to be referred to when performing CCLM or MMLM is the final predicted luminance block or the restored luminance block based on the parsed information.
  • Intra prediction directional modes for chrominance blocks can be broadly divided into DM (Derived Mode), EM (Explicit Mode), and LM (Linear Model).
  • DM mode is a mode that uses the intra prediction directional mode of the luminance block as the intra prediction directional mode of the chrominance block.
  • Derived Mode (DM) mode may also be referred to as Direct Mode (DM).
  • EM mode is a mode that specifies the intra prediction directionality mode of the chrominance block as one of planar, DC, horizontal, and vertical direction modes, and is applied differently from the intra prediction directionality mode of the luminance block.
  • EM mode may also be referred to as non-direct mode.
  • LM mode is a mode in which chrominance blocks are predicted through a restored luminance block and a linear model, and has different characteristics from the existing angular mode and non-angular mode (Planar, DC).
  • the intra prediction directional mode for such a chrominance block When the intra prediction directional mode for such a chrominance block is signaled, whether the LM mode is applied to the current block may be signaled before the intra prediction directional mode. If LM mode is not applied to the current block, information about DM mode or EM mode may be signaled. When LM mode is applied to the current block, information about whether CCLM or MMLM is applied and information about the location of the sample used in the template for obtaining a linear model may be signaled. Specifically, signaling may be performed according to the following embodiments.
  • a signaling method such as (a) of FIG. 11 may be used.
  • the encoder and decoder parse lm_flag. If the value of lm_flag is 0, the encoder and decoder may determine that LM mode is not used for the current block. At this time, the encoder and decoder parse information about EM and DM modes from the bitstream. If the lm_flag value is 1, the encoder and decoder determine that LM mode is used for the current block. At this time, the encoder and decoder parse mmlm_flag. If the mmlm_flag value is 1, the encoder and decoder determine that MMLM is applied to the current block.
  • the encoder and decoder parse template_idx, which is information about which template to use in MMLM. If the binary codeword of template_idx is '1', the encoder and decoder use both the left template and the top template to derive a linear model. If the binary codeword of template_idx is '00', the encoder and decoder derive a linear model using only the left template. If the binary codeword of template_idx is '01', the encoder and decoder derive a linear model using only the top template. If the mmlm_flag value is 0, the encoder and decoder determine that CCLM is applied to the current block. At this time, the encoder and decoder parse template_idx indicating which template will be used in the CCLM, and determine which template is applied to which CCLM, as described above.
  • the encoder and decoder When multiple CCP models such as MMLM and MM-CCCM are applied, the encoder and decoder must derive two or more linear models. A large number of samples may be required, and using both the left and top templates may be effective. Accordingly, the signaling method in (a) of Figure 11 can be changed as follows.
  • the encoder and decoder parse lm_flag. If the value of lm_flag is 0, the encoder and decoder determine that LM mode is not applied to the current block. At this time, the encoder and decoder parse information about EM and DM modes. If the value of lm_flag is 1, the encoder and decoder determine that LM mode is applied to the current block and parse mmlm_flag.
  • the encoder and decoder determine that MMLM is applied to the current block. At this time, the encoder and decoder can infer that both the left template and the top template are used. Specifically, the encoder and decoder can infer template_idx to 1 without parsing it. This is because when MMLM is applied, it can be effective to use both the left template and the top template.
  • the encoder and decoder can determine that CCLM is applied to the current block. At this time, the encoder and decoder parse template_idx, which indicates which template to use for CCLM. If the binary codeword of Template_idx is '1', a linear model is derived using both the left and top templates. If the binary codeword of template_idx is '00', the encoder and decoder derive a linear model using only the left template. If the binary codeword of template_idx is '01', the encoder and decoder derive a linear model using only the top template.
  • the encoder and decoder When the value of mmlm_flag is 1, the encoder and decoder perform at least one of the intra prediction mode of the current luminance block, the coding block size, the characteristics of the residual block, the quantization parameter, whether CCLM and MMLM are applied to the surrounding block, and the reference line index. You can use to decide whether to parse template_idx. If the encoder and decoder do not parse template_idx, the encoder and decoder can infer the value of template_idx as a pre-specified value. For example, if the size of the current block is within a pre-specified size, the encoder and decoder may not parse template_idx. At this time, the encoder and decoder can infer that the value of template_idx is 1.
  • the pre-specified size can be an integer greater than 1.
  • a signaling method such as (b) in FIG. 11 may be used.
  • the encoder and decoder parse lm_flag. If the value of lm_flag is '0, the encoder and decoder determine that the LM mode is not applied to the current block. At this time, the encoder and decoder parse information about EM and DM modes. If the value of lm_flag is 1, the encoder and decoder determine that LM mode is applied to the current block. At this time, the encoder and decoder parse template_idx, which is information about which template to use.
  • the encoder and decoder use both the left template and the top template to derive a linear model. If the binary codeword of template_idx is '00', the encoder and decoder derive a linear model using only the left template. If the binary codeword of template_idx is '01', the encoder and decoder derive a linear model using only the top template. At this time, the encoder and decoder can determine which model, CCLM or MMLM, to use, according to the determination method of the similarity of the parameters of the two linear models described above.
  • Figures 12 and 13 show probability initialization information for the mmlm_flag context model according to an embodiment of the present invention.
  • the encoder can entropy code mmlm_flag and template_idx using CABAC (Context adaptive binary arithmetic coding).
  • CABAC Context adaptive binary arithmetic coding
  • the context model for mmlm_flag and template_idx can be specified as values obtained through experimentation.
  • initValue in (a) of Figure 12 and (a) of Figure 13 represents the context model for mmlm_flag and template_idx. Additionally, shiftIdx is used when updating the probability for mmlm_flag and template_idx.
  • initValue is determined depending on whether the current slice type is I slice, P slice, or B slice.
  • Figure 12(b) and Figure 13(b) show context models that can be used according to each slice type.
  • the value of initType can be set to one of 0 to 2. If the type of the current slice is P slice, the value of initType can be set to one of 3 to 5. If the type of the current slice is a B slice, the value of initType can be set to one of 6 to 8.
  • initType value there may be at least one initType value used for each slice type.
  • initType When only one value of initType is defined per slice, if the type of the current slice is I slice, the value of initType is 0, the value of initValue for mmlm_flag corresponding to 0 is 20, and the initValue for template_idx corresponding to 0 The value of may be 17. Additionally, when the type of the current slice is P slice, the value of initType may be 3, the value of initValue for mmlm_flag corresponding to 3 may be 35, and the value of initValue for template_idx corresponding to 3 may be 0.
  • the value of initType may be 6
  • the value of initValue for mmlm_flag corresponding to 6 may be 38
  • the value of initValue for template_idx corresponding to 6 may be 0.
  • the value of initType according to slice type can be determined for each slice.
  • the order of use of the initType value may be determined according to the value of sh_cabac_init_flag defined in the slice header. If the value of sh_cabac_init_flag is 1 and the type of the current slice is P slice, the value of initType may be 6. Additionally, if the value of sh_cabac_init_flag is 1 and the type of the current slice is a B slice, the value of initType may be 3. If the value of sh_cabac_init_flag is 0 and the type of the current slice is P slice, the value of initType may be 3. If the value of sh_cabac_init_flag is 0 and the type of the current slice is B slice, the value of initType may be 6.
  • the mmlm_flag symbol to be currently coded or parsed is at least one of the intra prediction mode of the current luminance block, the type of the coding block, the quantization parameter, whether CCLM or MMLM is used in the surrounding block, the characteristics of the residual block, the motion information difference value, and the reference line index.
  • One of a plurality of context models may be selected based on one or more.
  • the shape of the coding block may include at least one of the horizontal or vertical size of the coding block, the width-to-height ratio of the coding block, and the difference between the width and height of the coding block.
  • the characteristics of the residual block may include at least one of the presence or absence of a residual signal of the luminance block and the location of the last transform coefficient.
  • a context model may be selected according to the following embodiments.
  • the context model of mmlm_flag may be selected based on the value of mmlm_flag of the neighboring block of the current block.
  • the context index indicated by the context model of mmlm_flag may be determined based on the sum of the mmlm_flag value of the left neighboring block adjacent to the current block and the mmlm_flag value of the upper neighboring block adjacent to the current block.
  • the value of the context index may be any one of 0 to 2. If the surrounding block is located in an unusable location, 0 may be added in the mmlm_flag sum operation described above.
  • the context model of mmlm_flag may be selected depending on the size of the current block. Specifically, if the size of the current block is larger than the pre-specified first value, the value of the context index may be 2. Additionally, if the size of the current block is smaller than the pre-designated second value, the value of the context index may be 0. In other cases, the value of the context index may be 1. At this time, the first pre-designated value may be 32x32. Additionally, the pre-designated second value may be 16x16. In another specific embodiment, the pre-designated first value and the pre-designated second value may be determined based on the sum of the horizontal and vertical sizes of the current block.
  • the context of mmlm_flag may be selected based on the difference between the horizontal and vertical sizes of the current block. Specifically, if the horizontal and vertical sizes of the current block are the same, the context index of mmlm_flag may be 0. If the vertical size is larger than the horizontal size, the context index may be 1. If the vertical size is smaller than the horizontal size, the context index of mmlm_flag may be 2.
  • a bypass type of binary arithmetic encoding using a fixed probability interval may be performed instead of binary arithmetic encoding mmlm_flag through a context model.
  • mmlm_flag may be encoded in binary arithmetic using only one context model.
  • the context model index is not derived, and a fixed context model can be used for all blocks in the slice. This is because each slice type has only one context model.
  • the symbol of template_idx to be currently coded or parsed is the intra prediction mode of the current luminance block, the type of the coding block, the quantization parameter, whether CCLM or MMLM is used in the surrounding block, the characteristics of the residual block, the motion information difference value, and the reference line index.
  • One of a plurality of context models may be selected based on at least one context model.
  • the shape of the coding block may include at least one of the horizontal or vertical size of the coding block, the width-to-height ratio of the coding block, and the difference between the width and height of the coding block.
  • the characteristics of the residual block may include at least one of the presence or absence of a residual signal of the luminance block and the location of the last transform coefficient.
  • template_idx is composed of two bins, a context model technique is applied to the first bin, and binary arithmetic encoding in the form of a bypass is performed for the second bin, or a fixed context A model can be used.
  • the context model of template_idx may be selected depending on the size of the current block. Specifically, if the size of the current block is larger than the pre-specified first value, the value of the context index may be 2. Additionally, if the size of the current block is smaller than the pre-designated second value, the value of the context index may be 0. In other cases, the value of the context index may be 1. At this time, the first pre-designated value may be 32x32. Additionally, the pre-designated second value may be 16x16. In another specific embodiment, the pre-designated first value and the pre-designated second value may be determined based on the sum of the horizontal and vertical sizes of the current block.
  • the context of template_idx may be selected based on the difference between the horizontal and vertical sizes of the current block. Specifically, if the horizontal and vertical sizes of the current block are the same, the context index of template_idx may be 0. If the vertical size is larger than the horizontal size, the context index may be 1. If the vertical size is smaller than the horizontal size, the context index of template_idx may be 2.
  • binary arithmetic coding in the form of a bypass using a fixed probability interval may be performed.
  • template_idx can be encoded in binary arithmetic using only one context model.
  • the context model index is not derived, and a fixed context model can be used for all blocks in the slice. This is because each slice type has only one context model.
  • Figure 14 shows a method of deriving an intra prediction mode for the current block using motion information of neighboring blocks according to an embodiment of the present invention.
  • the LM coding method uses a restored luminance block and a linear model, it can be used for the chrominance block of an intra-coded block or an inter-coded block.
  • the inter-coding mode has low dependency on neighboring blocks, so processing speed can be increased.
  • the LM encoding method is highly dependent on surrounding blocks, so processing speed may be slowed.
  • it may be difficult to apply it to coding methods with low processing speed (GPM, Affine, sbTMVP, BCW, PROF, BDOF, TM, MP-DMVR, OBMC, MHP, LIC).
  • the LM coding method can be applied only to chrominance blocks encoded in Merge, MergeSkip, MMVD, AMVP, SMVD, and CIIP, which are coding modes that have relatively high decoding processing speeds for luminance blocks.
  • the encoder and decoder can decide whether to allow the LM encoding method for the chrominance block depending on the encoding mode of the current block.
  • the bitstream may include information about whether to apply the LM coding method to the chrominance block according to the coding mode of the current block.
  • the decoder can parse the information according to the coding mode of the current block and determine whether to apply the LM coding method to the chrominance block of the block currently encoded in the inter coding mode.
  • Methods for predicting blocks are largely divided into intra prediction methods using spatial correlation and inter prediction methods using temporal correlation.
  • the encoder and decoder include (store) information related to intra prediction and do not store inter prediction information.
  • storing information in the encoder and decoder means writing information in the memory of the encoder and decoder
  • retrieving information means reading information stored in the memory.
  • the encoder and decoder store information related to inter prediction and do not store intra prediction information. Encoding information of the current block can be predicted through encoded information of neighboring blocks.
  • the encoder and decoder can perform prediction for the current block based on intra prediction information of neighboring blocks. If the surrounding blocks are all blocks predicted by inter prediction, prediction efficiency may be lowered when the encoder and decoder predict the current block using intra prediction. To compensate for this, the encoder and decoder can store intra prediction information for the block on which inter prediction was performed. Through this, the intra prediction efficiency of the next restored block can be improved.
  • the method of deriving intra prediction information from a block on which inter prediction has been performed is because the current block is likely to be similar to the image characteristics of the reference block. Specifically, the encoder and decoder can store the intra prediction information of the reference block as intra prediction information for the current block.
  • Figure 14 shows a method of deriving an intra prediction mode from the neighboring blocks when there are neighboring blocks of various sizes around the current block.
  • the encoder and decoder encode the current block using intra prediction
  • the encoder and decoder encode the intra prediction mode for the current block using the MPM list.
  • the encoder and decoder can use the motion information of the neighboring block to derive the intra prediction mode from the reference picture.
  • the encoder and decoder can use the intra prediction mode stored at a position moved by the motion information of the neighboring block based on the position corresponding to the upper left pixel position of the neighboring block in the reference picture.
  • the encoder and decoder can use the intra prediction mode stored in M4 or O5 of the reference picture.
  • the intra prediction mode of the current block may be similar to the intra prediction mode of neighboring blocks.
  • the encoder and decoder may use the intra prediction mode stored in J16 or J17 at a location close to the current block rather than H16 or I17.
  • the encoder and decoder can derive an intra prediction mode from a reference picture by projecting the motion information of neighboring blocks based on the position of the current block.
  • the encoder and decoder predict the neighboring block Ne-A2 based on the position corresponding to the upper left pixel position of the neighboring block Ne-A2/A3 in the reference picture.
  • the intra prediction mode stored in M4 which is a position moved by the motion information of A3, may not be used.
  • the encoder and decoder use the motion information of the neighboring blocks Ne-A2/A3 based on the position corresponding to the center pixel position of the current block in the reference picture.
  • the intra prediction mode stored in M10, the moved location can be derived and used as the intra prediction mode for neighboring blocks Ne-A2/A3.
  • the encoder and decoder can add the derived intra prediction mode to construct the MPM list of the current block.
  • the encoder and decoder may derive an intra prediction mode stored at a position moved by the motion information of the surrounding block based on a pre-designated position within the current block, rather than the position of the central pixel of the current block.
  • the pre-specified location may be one of the following: top left, top center, top right, center left, bottom left, bottom center, center, bottom right, and center right of the current block.
  • the encoder and decoder may generate an intra prediction block of the corresponding sub-block using at least one of several intra prediction modes derived from motion information of several neighboring blocks.
  • the encoder and decoder may use one of the median, average, minimum, and maximum values of the indices of each of the plurality of intra prediction modes as the optimal intra prediction mode.
  • the encoder and decoder can use motion information of neighboring blocks or the current luminance block to derive an intra prediction mode for the chrominance block from the reference picture.
  • the intra prediction mode derived from the reference picture is an LM encoding mode
  • the encoder and decoder provide information about which of CCLM, MMLM, CCCM, and GLM was used, and the template includes the left sample, top sample, and left sample. Which of the top samples was used and at least one of the filter coefficients can be obtained from the reference picture and used to predict the current chrominance block.
  • the encoder and decoder can store all LM encoding information for the corresponding chrominance block in the reference picture.
  • CIIP is a method of predicting the current block by performing both intra-prediction and inter-prediction for the current block and then performing a weighted average of the prediction blocks.
  • movement information for the current block is already included. Therefore, when the encoder and decoder derive the intra prediction mode from the reference picture, the encoder and decoder can use the motion information of the current block.
  • the intra prediction mode of the chrominance block derived from the reference picture is CCLM, MMLM, CCCM, or GLM mode
  • the encoder and decoder can predict the chrominance block in CIIP mode using the chrominance coding mode of the reference block.
  • the encoder and decoder can perform intra prediction and inter prediction only on the luminance block.
  • the encoder and decoder may generate a prediction block of the luminance block by performing a weighted average of the intra-predicted block and the inter-predicted block, and may generate a prediction block of the chrominance block using only the chrominance encoding mode of the reference block.
  • the processing speed for blocks encoded in CIIP mode can be increased. This is because inter prediction is not performed on color difference blocks.
  • the encoder may not signal information related to the chrominance encoding mode for blocks encoded in CIIP mode.
  • the encoder may not include information related to the chrominance encoding mode in the bitstream. If the current block is CIIP mode, the decoder may not parse information related to the chrominance encoding mode. At this time, if the current block is CIIP mode, the decoder may set (or infer) the chrominance coding mode of the current block to CCRM mode. Additionally, the decoder can generate a chrominance prediction block using the CCRM method described herein.
  • the accuracy of the linear model may vary depending on the accuracy of the samples.
  • noise may occur in random pixels. If samples from locations where such noise occurs are used to derive parameters of a linear model, the accuracy of the linear model may be lowered. Embodiments for solving this problem will be described.
  • Figure 15 shows a method for predicting a chrominance block using a recursive linear model according to an embodiment of the present invention.
  • the encoder and decoder may configure a template for the above-described embodiments and apply filtering between pixels within the template. At this time, the encoder and decoder may perform low-frequency filtering. This can reduce the impact of noise within the template. In another specific embodiment, the encoder and decoder may perform high-frequency filtering and determine a pixel whose value difference between neighboring pixels is greater than a threshold as noise. At this time, the encoder and decoder can remove noise from pixels determined to be noise. Specifically, the encoder and decoder can replace a pixel determined to be noise with one of the surrounding pixels or with a weighted average value of the surrounding pixels. In these embodiments, the encoder and decoder can selectively apply filtering of the template.
  • Whether or not template filtering is activated can vary on a picture, slice, or tile basis. Specifically, when template filtering is activated in the picture unit, whether or not template filtering is applied may vary in the slice, tile, CU, and sub-block units.
  • the encoder may include information on whether filtering of the template is activated or not in the bitstream for each SPS unit, PPS unit, PH unit, slice unit, or tile unit. Additionally, the encoder may include information on whether template filtering is applied on a CU or sub-block basis in the bitstream.
  • the decoder may include information on whether template filtering is activated in any one of SPS, PPS, PH, slice, and tile units. It can be parsed. When template filtering is activated, the decoder can parse information on whether filtering is applied in any one of CU and sub-block units and determine whether to apply filtering to pixels in the template according to the information on whether filtering is applied.
  • the encoder and decoder compare the parameters of the linear model obtained through the embodiments of applying filtering to pixels in the teamfleet described above with the parameters of the linear model obtained using samples of the existing template. It can be verified. Specifically, if the difference between the parameters of the linear model obtained through the embodiments of applying filtering to pixels in the teamfleet described above and the parameters of the linear model obtained using samples of the existing template is within a predetermined value, the encoder and The decoder may determine that the linear model obtained by applying filtering is the final linear model.
  • the pre-specified value may be an integer greater than or equal to 1.
  • the encoder and decoder can determine the linear model obtained by applying filtering as the final linear model.
  • the pre-specified ratio may be a value between 0 and 1. If the final linear model is not obtained, the encoder and decoder can derive the linear model again, excluding the samples used to obtain the linear model. The encoder and decoder can repeat this process until the final linear model is obtained. At this time, this process can be repeated within a predetermined number of times.
  • the encoder and decoder may obtain the last acquired linear model as the final linear model.
  • the pre-specified number of times may be an integer of 1 or more.
  • the process may be repeated until the number of samples other than those already used as templates is within a predetermined number.
  • the encoder and decoder may acquire the last acquired linear model as the final linear model. You can.
  • the pre-specified number may be 1 or more.
  • the encoder and decoder use only a pre-specified number of samples among the samples in the template.
  • the pre-specified number may be 4.
  • the encoder and decoder use parameters of the linear model obtained through the embodiments of applying filtering to pixels in the template among the embodiments described through the embodiment of FIG. 15 and samples in the template that were not used to derive the parameters of the linear model. Parameters of linear models can be verified. Specifically, the encoder and the decoder apply the linear model parameters obtained through the embodiments of applying filtering to pixels in the template described above to the luminance samples of samples not used to derive the parameters of the linear model among the samples in the template, and then apply the luminance samples to the luminance samples.
  • the color difference sample corresponding to can be predicted.
  • the encoder and decoder can verify the parameters of the linear model by comparing the predicted chrominance sample and the restored chrominance sample through the linear model parameters. If the difference between the chrominance sample predicted through the linear model parameter and the restored chrominance sample is within a pre-specified value, the encoder and decoder may determine the linear model obtained by applying filtering as the final linear model.
  • the pre-specified value may be an integer greater than or equal to 1. If the difference between the chrominance sample predicted through the linear model parameter and the restored chrominance sample is greater than or equal to a pre-specified value, the encoder and decoder derive a linear model again from the samples in the template excluding the sample used to obtain the linear model.
  • the encoder and decoder can repeat this process until the final linear model is obtained. At this time, linear model derivation may be repeated within a predetermined number of times. In a specific embodiment, if the encoder and decoder fail to obtain the final linear model within a predetermined number of times, the encoder and decoder select the final linear model with the smallest difference between the predicted chrominance sample and the restored chrominance sample through the linear model parameters. It can be obtained with a linear model. The pre-specified number of times may be an integer of 1 or more. In another specific embodiment, the process may be repeated until the number of samples in the template, excluding the samples used to derive the linear model, is within a predetermined number.
  • the encoder and decoder may use the chrominance sample predicted through the linear model parameters.
  • the linear model with the smallest difference between the and the restored color difference samples can be determined as the final linear model.
  • the pre-specified number may be an integer greater than or equal to 1.
  • Figure 16 shows a reference region used to create a reference linear model according to an embodiment of the present invention.
  • first type (Type 1) and second type (Type 2) filters may be used to generate downsampled luminance samples.
  • the dark gray sample represents the location where the downsampled luminance sample is generated, and the light gray sample represents surrounding pixels used to generate the luminance sample at the dark gray location.
  • These gray samples can be referred to as gray reference areas.
  • Encoders and decoders can use multiple reference pixel lines to predict the current block.
  • the encoder may include in the bitstream a reference pixel line index indicating which reference pixel line among several reference pixel lines is used.
  • the decoder can determine the reference pixel line used when generating a prediction block for the current block by parsing the reference pixel line index from the bitstream.
  • the reference area for the encoder and decoder to derive a linear model for generating a color difference prediction block may vary depending on the reference pixel line. If the reference pixel line used by the encoder and decoder to generate a prediction block for the current block is adjacent to the current block, the decoder uses gray color as shown in (a) of FIG. 16 to derive a linear model for generating a chrominance prediction block. Reference areas can be used. When the reference pixel line is adjacent to the current block, the reference pixel line is smaller than a predetermined value.
  • the pre-specified value may be an integer greater than or equal to 1. For example, the pre-designated value may be 2.
  • the decoder uses (b) of FIG. 16 to derive a linear model for generating a chrominance prediction block. You can also use the gray reference area. If the reference pixel line is not adjacent to the current block, the reference pixel line may be larger than a predetermined value.
  • the pre-specified value may be an integer greater than or equal to 1. For example, the pre-designated value may be 1.
  • the encoder and decoder When the encoder and decoder apply multiple CCP models such as MMLM and MM-CCCM, the encoder and decoder derive two linear models to predict chrominance blocks. If the reference pixel line used by the encoder and decoder to generate a prediction block for the current block is not adjacent to the current block, for example, if the reference pixel line index is greater than 1, the encoder and decoder generate a chrominance prediction block. Both the gray reference area in (a) of FIG. 16 and the gray reference area in (b) of FIG. 16 can be used to derive two linear models for.
  • the encoder and decoder derive one linear model in the gray reference area of (a) of Figure 16, and another linear model in the gray reference area of (b) of Figure 16, and then derive the two derived linear models. It can be used to generate prediction blocks for chrominance blocks.
  • Figure 17 shows reference samples and formulas used in CCCM according to an embodiment of the present invention.
  • the decoder can decide whether to use a chrominance prediction method based on a CCP model, such as CCLM, MMLM, GLM, and CCCM, depending on the location of the reference pixel line used to generate the luminance prediction block for the current block. If the reference pixel line index used to generate the luminance prediction block for the current block is greater than a pre-specified value, the decoder may not use chrominance prediction methods based on CCP models such as CCLM, MMLM, GLM, and CCCM.
  • a CCP model such as CCLM, MMLM, GLM, and CCCM
  • the decoder does not parse the syntax related to CCP models such as CCLM, MMLM, GLM, and CCCM, and it can be inferred that the chrominance prediction method based on CCP models such as CCLM, MMLM, GLM, and CCCM is not used.
  • the pre-specified value may be an integer greater than or equal to 1.
  • the pre-designated value may be 3.
  • Figure 17 shows the positions of reference samples (vertical hatching) for applying CCCM to the current prediction block (slanted hatching samples) and side samples (horizontal hatching) required when applying a cross-shaped filter.
  • the current prediction block (M (W) It may consist of 6x6 reference samples.
  • Side samples may occur outside the reference sample area when applying the cross-shaped sample filter in (b) of FIG. 17 to the chroma sample prediction equation in (c) of FIG. 17. At this time, an additional sample required may be a side sample.
  • (c) of FIG. 17 can be performed for each chroma component. Chroma components may be Cb or Cr.
  • the sample at the C (Center) location may be a luma sample corresponding to the Cb and Cr chroma samples, and N (North), E (East), S (South), and W (West) are adjacent to the luma sample at the C location. It may be a luma sample.
  • one sample needs to be added to the side sample for areas other than the reference sample.
  • Encoders and decoders can pad with C sample values if sample values are not available at the side sample locations. Specifically, referring to part A of FIG. 17(a), in order to calculate FIG. 17(c) for the sample at the upper right position in the reference sample area, the cross-shaped sample filter of FIG. 17(b) is used for the reference sample.
  • the encoder and decoder can be configured by padding samples at the N (North) and E (East) positions with C sample values.
  • the P value is a nonlinear term and can be defined as follows.
  • B is a bias term, which is an integer offset value and may be the middle value of the bit depth of the content. If the bit depth of the content is 10 bits, B may be 512.
  • seven coefficients can be set based on the luma and chroma samples of the reference sample area. At this time, the encoder and decoder minimize the MSE (Mean Square Error) value of the autocorrelation matrix for the luma input value and the cross-correlation vector for the luma input value and the chroma output value. Seven coefficients can be calculated to do this.
  • the encoder and decoder can obtain the autocorrelation matrix using LDL decomposition. In another specific embodiment, the encoder and decoder may use Cholesky decomposition to obtain an autocorrelation matrix. Additionally, the encoder and decoder can obtain seven coefficients using back-substitution.
  • P which is a nonlinear term, may be used as is or may be used according to the following formula.
  • Cg may be the gradient value at position C in (b) of FIG. 17.
  • midVal may be the middle value of bit depth (bitDepth). In content with a bit depth of 10 bits, midVal may be 512.
  • the value of P may be the average value of the gradient values of the reference sample.
  • meanG may be the average value of gradient values of reference samples.
  • C, N, S, E, W, and P in (c) of FIG. 17 can be changed as follows.
  • meanNonlinY (meanY * meanY + bitdepth>>1) >> bitdepth.
  • the encoder and decoder can only use samples at specific locations.
  • Figure 18 shows a differential sample-based CCCM method according to an embodiment of the present invention.
  • the encoder and decoder can calculate meanY and meanChroma values using at least one sample at positions A, B, C, D, E, F, G, a, b, c, d, e, f, and g in Figure 18.
  • the sample location to search may vary depending on the type of template used in CCCM.
  • the template used in CCCM may be not only the template in (a) of FIG. 17, but also an upper template that uses only the top pixels of the current block and an upper template that uses only the left pixels of the current block.
  • the top template can be used when applying CCCM to the current block.
  • the encoder and decoder can calculate meanY and meanChroma values using at least one sample at sample positions B, E, F, b, e, and f within the upper template.
  • Equation 7 the average value of each chroma component can be added to Equation 7.
  • predChromaVal c0C' + c1N' + c2S' + c3E' + c4W' + c5P' + c6B' + meanChroma
  • meanChroma may be the average value for each of the chroma samples (Cb, Cr) of the reference sample area.
  • B' may be defined as the difference between the average value of the luma sample in the reference sample and the average value for each chroma component, or the difference in absolute value.
  • predChromaVal c0C' + c1N' + c2S' + c3E' + c4W' + c5P' + meanChroma
  • the coefficient of the luma sample that can be used in Equation 8 can be obtained from a combination of five luma position samples.
  • the number of coefficients required may also vary depending on the number of lumas used in a specific embodiment.
  • luma samples of a pre-specified number and pre-specified locations may be used.
  • the luma samples (C, N, E, S, W) required in (c) of FIG. 17 and the luma samples (C', N', E', S', W') required in Equation 7 are different values. It can be replaced with 17(c) or Equation 7, which are relational expressions that can be used in CCCM, can be used as is or partially modified, but can be replaced with a gradient value instead of a value expressed as a luma sample value or a modified luma sample value.
  • an autocorrelation matrix can be calculated using the reconstructed values of luma and chroma samples. Since these samples are in the full range (between 0 and 1023 for 10-bit content), the values of the autocorrelation matrix are relatively large. For this purpose, a calculation process at a deep bit depth is required during model parameter calculation. Differentiating the meanY and meanNonlinY values can be a way to solve this problem. However, the method of differencing the average value requires additional pipeline steps because the average value must be calculated. Ultimately, it increases implementation complexity. To alleviate this drawback, pre-specified values for the luminance sample and the chrominance sample can be differentiated for each model.
  • the value obtained by subtracting the offset value from the value of the luminance sample and the chrominance sample input to each model can be used as the input value of the luminance sample and the chrominance sample, respectively.
  • the size of the value used to create the model can be reduced and the precision required for fixed point calculation can be reduced.
  • 16-bit fractional precision is used in the CCCM implementation instead of 22-bit precision.
  • Figure 18 shows offset differential sample based CCCM according to an embodiment of the present invention.
  • the offset value described above may be the value of a luminance sample at a pre-designated position among neighboring samples of the current block.
  • the pixel value at position A is used as offsets (offsetLuma, offsetCb, and offsetCr) for simplicity.
  • the encoder and decoder use the luminance sample value from the pixel value at position A as offsetLuma, the Cb chrominance sample value from the pixel value at position A as offsetCb, and the Cr chrominance sample value from the pixel value at position A as offsetCr. You can use it.
  • the sample values used for model creation and final prediction i.e., luma and chroma of the reference region, luma of the current PU) can be reduced by a fixed value as follows.
  • N' N - offsetLuma
  • the chroma value is predicted using the following equation 9, where offsetChroma and offsetCb values can be used for Cr and Cb components, respectively.
  • the encoder and decoder can use the pre-designated default offset values as offsetLuma, offsetCr, and offsetCb values.
  • the pre-designated first value and the pre-designated second value may be integers of 1 or more. Additionally, the pre-designated first value and the pre-designated second value may vary depending on the bit depth used to represent the current sample. When the bit depth is 10 bits, the pre-designated first value may be any one of 0, 128, 256, 512, 768, and 1023, and the second value may be a value greater than the first value among the remaining values.
  • the pre-specified default offsetLuma, offsetCr, and offsetCb values can be integers.
  • the first pre-specified value is any one of -256, -128, 0, 128, and 256
  • the second value is a value greater than the first value among the remaining values. You can.
  • the encoder and decoder may select additional candidate positions pre-specified, e.g., B, C in Figure 18. , D, E, F, G, a, b, c, d, e, f, and g, samples are searched in order, and it can be determined whether the value of the luminance sample at that location is valid as an offset value.
  • the encoder and decoder may determine that the value of the luminance sample at the corresponding position is valid as an offset value.
  • the encoder and decoder may use the value of the luminance sample that is initially determined to be valid or the value of the chrominance sample corresponding to the luminance sample as offset values, such as offsetLuma, offsetCr, and offsetCb.
  • the encoder and decoder may use the value of the luminance sample initially determined to be valid as offsetLuma, the value of the Cr chrominance sample corresponding to the luminance sample determined to be valid as offsetCr, and the value of the Cb chrominance sample as offsetCb.
  • samples at a plurality of predetermined locations such as locations A, B, C, D, E, F, G, a, b, c, d, e, f, and g in FIG. 18 are retrieved in order. While doing so, it can be determined whether the luminance sample value at the corresponding location is a valid offset value.
  • the encoder can include offset sample information indicating the most optimal sample position in the bitstream. After parsing the offset sample information from the bitstream, the decoder can use the value of the luminance sample corresponding to the offset sample information as the offset value.
  • the encoder may not use CCCM to encode the current chrominance block. . At this time, the encoder may not include information related to CCCM in the bitstream. If the value of the luminance sample at a pre-specified location does not fall within the pre-specified range, the decoder may not parse information related to CCCM. At this time, the decoder can infer that all syntax related to CCCM is 0. In another specific embodiment, the decoder may be configured to not use syntax related to CCCM.
  • candidate positions of luma samples that can be used as offset values such as positions A, B, C, D, E, F, G, a, b, c, d, e, f, g in Figure 18.
  • the encoder may not use CCCM to encode the current chrominance block. At this time, the encoder may not include information related to CCCM in the bitstream. If the values of all luma samples at candidate positions of luma samples that can be used as offset values do not fall within a pre-specified range, the decoder may not parse information related to CCCM. At this time, the decoder can infer that all syntax related to CCCM is 0. In another specific embodiment, the decoder may be configured to not use syntax related to CCCM.
  • the value of the luma sample at a pre-designated position may be less than a pre-designated first value or greater than a pre-designated second value.
  • the pre-specified second value may be determined according to the bit depth used to represent the current sample. When the bit depth is 10 bits, the pre-designated second value may be either 768 or 1023. Additionally, the pre-designated first value may be either 128 or 256.
  • a candidate location of a luma sample that can be used as an offset value may be determined according to the type of template used in CCCM.
  • the template used in CCCM may be not only the template in (a) of FIG. 17, but also an upper template that uses only the top pixels of the current block and an upper template that uses only the left pixels of the current block.
  • the encoder and decoder sequentially search for samples at sample positions B, E, F, b, e, and f within the top template, and the samples at those positions are You can check whether the sample is within a valid range. If the sample at that location is valid, the encoder and decoder can use the value of the luminance sample at that location as offsetLuma and the values of the chrominance sample at that location as offsetCr and offsetCb.
  • the encoder and decoder determine whether the value of the luma sample falls within a predetermined range
  • the encoder and decoder determine at least one of the minimum value, median value, maximum value, and average value of surrounding samples adjacent to the current block. You can set a pre-specified range using .
  • the encoder uses at least one of CCLM, MMLM, GLM, and CCCM used to encode the current chrominance block. May not be used. Additionally, the encoder may not include at least one piece of information related to CCLM, MMLM, GLM, or CCCM in the bitstream.
  • the decoder may not parse at least one or more information related to CCLM, MMLM, GLM, and CCCM.
  • the decoder may infer that at least one syntax related to CCLM, MMLM, GLM, and CCCM are all 0. In another specific embodiment, the decoder may be set to not use at least one or more syntaxes related to CCLM, MMLM, GLM, and CCCM.
  • the encoder and decoder apply a multi-CCP model such as MMLM and MM-CCCM
  • the encoder and decoder set the average value of the luminance samples of neighboring blocks as the first threshold, and based on the first threshold, two A linear model can be derived.
  • the encoder and decoder compare the value of the luminance sample of the current block with the first threshold to determine whether to derive a chrominance sample corresponding to the luminance sample using one linear model or to derive a chrominance sample corresponding to the luminance sample using two linear models. You can decide whether to derive the corresponding color difference sample.
  • the encoder and decoder can predict the chrominance sample using both linear models. Additionally, if the difference between the luminance sample of the current block and the first threshold is equal to or greater than a pre-specified value, the encoder and decoder can predict the chrominance sample using one linear model.
  • the encoder and decoder compare the luminance sample of the current block, a random number of luminance samples around the luminance sample of the current block, the luminance sample of the current block and a random number of luminance samples around the luminance sample of the current block with a first threshold.
  • a chrominance sample corresponding to a luminance sample of the current block may be predicted using at least one of the weights for the model.
  • the first linear model and the second linear model are linear models derived using the first threshold.
  • a sample belonging to a model may refer to a sample used to derive the model.
  • the method of determining whether the luminance sample belongs to the first linear model and the second linear model may be to determine that the luminance sample belongs to the first linear model if the luminance sample is equal to or smaller than the first threshold, and the luminance sample may be determined to belong to the first linear model. If it is greater than the threshold, it can be determined to belong to the second linear model.
  • Figure 19 shows a pre-specified number of ambient luminance samples around the current block that are considered for derivation of a model used for chrominance sample prediction according to an embodiment of the present invention.
  • Figure 19 (a) shows 4 luminance samples around the current block
  • Figure 19 (b) shows 8 luminance samples around the current block.
  • the encoder and decoder calculate the number of luminance samples belonging to the first linear model and the second linear model by comparing the luminance sample of the current block and a predetermined number of luminance samples around the luminance sample of the current block with a first threshold. At this time, the encoder and decoder can determine which linear model the luminance sample belongs to by comparing the value of the luminance sample at the position of the sample finally generated when a filter for downsampling the luminance sample is applied and the first threshold.
  • the encoder and decoder can predict the chrominance samples corresponding to the luminance samples of the current block using only the first linear model. If the number of luminance samples belonging to the second linear model is equal to or greater than the pre-specified first value, the encoder and decoder can predict the chrominance samples corresponding to the luminance samples of the current block using only the second linear model.
  • the pre-designated first value may be an integer of 1 or more, and may be 6.
  • the encoder and decoder set a first pre-specified weight to the first linear model and a pre-specified first weight to the second linear model. 2 Weights can be set.
  • the encoder and the decoder derive the first color difference sample derived using the first linear model and the second color difference samples derived using the second linear model, and then apply the first weight and the second color difference to the first color difference sample.
  • the samples can be weighted averaged using a second weight to derive a chrominance sample corresponding to the luminance sample of the current block.
  • the encoder and decoder set the first weight to the second linear model, and set the first weight to the first linear model.
  • a second weight can be set in the model.
  • the encoder and decoder derive first color difference samples derived using the first linear model and second color difference samples derived using the second linear model, and then apply a second weight and a second color difference to the first color difference samples.
  • the samples can be weight averaged using the first weight to finally derive a chrominance sample corresponding to the luminance sample of the current block.
  • the encoder and decoder can construct a chrominance prediction block using the chrominance samples.
  • the first weight and the second weight may be pre-designated values. Additionally, the first weight may be a larger value than the second weight. For example, the first weight may be 13. Additionally, the second weight may be 3. At this time, the weighted average between the sample values A and B can be calculated as (A * first weight + B * second weight) >> Shift.
  • the value of Shift may be determined according to the first weight and the second weight. The value of Shift is the value obtained by converting the sum of the first weight and the second weight into a binary number and then subtracting 1 from N, which is the number of converted binary bits.
  • the weighted average value is restored to the bit depth of the sample value.
  • the encoder and decoder generate a first linear model and It is possible to determine whether to use each of the second linear models. At this time, the encoder and decoder may use only the first linear model, only the second linear model, or may derive the chrominance sample by performing a weighted average of the samples derived from the first linear model and the second linear model. If the difference between the luminance sample of the current block and the first threshold, for example, the average value of the luminance samples of neighboring blocks, is greater than the second threshold, the luminance sample of the current block is compared with the first threshold.
  • the first threshold for example, the average value of the luminance samples of neighboring blocks
  • the encoder and decoder may predict the chrominance sample corresponding to the luminance sample of the current block using the second linear model.
  • the encoder and decoder can predict the chrominance sample corresponding to the luminance sample of the current block using the first linear model.
  • the encoder And the decoder may set a third weight to the first linear model and a fourth weight to the second linear model.
  • the encoder and decoder derive a first color difference sample derived using a first linear model and a second color difference sample derived using a second linear model, and the first color difference sample includes a third weight and a second color difference sample.
  • a weighted average can be performed using the fourth weight to finally derive a chrominance sample corresponding to the luminance sample of the current block.
  • the third weight and fourth weight may be pre-designated values.
  • the third weight may be 1.
  • the fourth weight may be 1.
  • the encoder and decoder may compare the luminance sample of the current block and the first threshold. If the luminance sample of the current block is less than or equal to the first threshold, the encoder and decoder may set a first weight to the first linear model and a second weight to the second linear model. At this time, the encoder and the decoder derive the first color difference sample derived using the first linear model and the second color difference samples derived using the second linear model, and then apply the first weight and the second color difference to the first color difference sample.
  • the samples can be weighted and averaged using a second weight to finally derive a chrominance sample corresponding to the luminance sample of the current block. If the luminance sample of the current block is greater than the first threshold, set the first weight to the second linear model, set the second weight to the first linear model, and then set the first chrominance sample derived using the first linear model. After deriving the second color difference samples derived using the second linear model, weight averaging is performed using the second weight for the first color difference sample and the first weight for the second color difference sample to finally obtain the luminance of the current block.
  • a color difference sample corresponding to the sample can be derived.
  • the first weight and the second weight may be pre-designated values.
  • the third weight may be 1.
  • the first weight may be 13.
  • the second weight may be 3.
  • the encoder and decoder can construct a chrominance prediction block using the chrominance samples.
  • the encoder and decoder use at least one of two linear models: one linear model derived from neighboring blocks of the current block and two linear models derived based on the average value of neighboring blocks of the current block.
  • a chrominance sample corresponding to the luminance sample can be derived.
  • the encoder and the decoder generate a first signal with each of a luminance sample of the current block, a predetermined number of luminance samples around the luminance sample of the current block, and a luminance sample of the current block and a predetermined number of luminance samples around the luminance sample of the current block. By comparing the threshold, the number of luminance samples belonging to the first linear model and the second linear model can be obtained.
  • the encoder and decoder determine the number of luminance samples belonging to the first linear model and the second linear model, the difference between the luminance sample of the current block and the first threshold, the first linear model, the second linear model, the third linear model, A chrominance sample corresponding to a luminance sample of the current block may be predicted using at least one of the weight for the first linear model, the weight for the second linear model, and the weight for the third linear model.
  • the first linear model and the second linear model are linear models derived using the first threshold.
  • the third linear model is a linear model derived using all samples of surrounding blocks.
  • the encoder and decoder can construct a chrominance prediction block using the chrominance samples.
  • the encoder and decoder compare the luminance sample of the current block and a predetermined number of luminance samples around the luminance sample of the current block, (b) in the embodiment of Figure 19 with a first threshold to determine which luminance sample belongs to the first linear model.
  • the number of luminance samples and the number of luminance samples belonging to the second linear model can be calculated. If the number of luminance samples belonging to the first linear model is equal to or greater than the first predetermined value, the encoder and decoder can predict chrominance samples corresponding to the luminance samples of the current block using only the first linear model.
  • the encoder and decoder can predict chrominance samples corresponding to the luminance samples of the current block using only the second linear model.
  • the first preset value may be 6. If the number of first linear models is greater than the number of second linear models, the encoder and decoder may set a first weight to the first linear model and a second weight to the third linear model. At this time, the encoder and decoder derive the first color difference sample derived using the first linear model and the second color difference sample derived using the third linear model, and then apply the first weight and the second color difference to the first color difference sample.
  • the samples can be weighted and averaged using a second weight to finally derive a chrominance sample corresponding to the luminance sample of the current block. If the number of luminance samples belonging to the first linear model is equal to or smaller than the number of luminance samples belonging to the second linear model, the encoder and decoder set the first weight to the second linear model and the second weight to the third linear model. can be set. At this time, the encoder and decoder may derive a first color difference sample derived using the second linear model and a second color difference sample derived using the third linear model.
  • the encoder and decoder may perform a weighted average using the first weight for the first color difference sample and the second weight for the second color difference sample to finally derive a color difference sample corresponding to the luminance sample of the current block.
  • the first weight and the second weight may be pre-designated values.
  • the first weight may be 13.
  • the second weight may be 3.
  • the encoder and decoder can construct a chrominance prediction block using the chrominance samples.
  • the encoder and decoder determine the difference between the luminance samples of the current block and a first threshold, such as the average value of the luminance samples of surrounding blocks, the difference between the luminance samples of the current block and the second threshold, or the luminance of the current block. Based on the difference between the sample and the third threshold, it may be determined whether to use each of the first linear model, the second linear model, and the third linear model. At this time, when the encoder and decoder use multiple models, the encoder and decoder may derive color difference samples by performing a weighted average of the multiple models. If the difference between the luminance sample of the current block and the first threshold is greater than the second threshold, the encoder and decoder compare the luminance sample of the current block and the first threshold.
  • a first threshold such as the average value of the luminance samples of surrounding blocks, the difference between the luminance samples of the current block and the second threshold, or the luminance of the current block.
  • the encoder and decoder may predict the chrominance sample corresponding to the luminance sample of the current block using the second linear model.
  • the encoder and decoder can predict the chrominance sample corresponding to the luminance sample of the current block using the first linear model. If the difference between the luminance sample of the current block and the first threshold is equal to or less than the second threshold, and the difference between the luminance sample of the current block and the first threshold is less than the third threshold, the encoder and decoder apply the first linear model to the first linear model.
  • the encoder and the decoder derive a first chrominance sample derived using the first linear model, a second chrominance sample derived using the second linear model, and a third chrominance sample derived using the third linear model. can do.
  • the encoder and decoder perform a weighted average using the third weight for the first chrominance sample, the fourth weight for the second chrominance sample, and the 5th weight for the third chrominance sample, and finally derive a chrominance sample corresponding to the luminance sample of the current block. can do.
  • the third weight, fourth weight, and fifth weight may be pre-designated values.
  • the third weight may be 1, and the fourth weight may be 1.
  • the fifth weight may be 1. If the difference between the luminance sample of the current block and the first threshold is equal to or greater than the third threshold, the encoder and decoder may compare the luminance sample of the current block and the first threshold. If the luminance sample of the current block is less than or equal to the first threshold, the encoder and decoder may set a first weight to the first linear model and a second weight to the third linear model. The encoder and decoder may derive first chrominance samples derived using a first linear model and second chrominance samples derived using a third linear model.
  • the encoder and decoder may perform a weighted average using a first weight for the first chrominance sample and a second weight for the second chrominance sample to finally derive a chrominance sample corresponding to the luminance sample of the current block. If the luminance sample of the current block is greater than the first threshold, the encoder and decoder may set a first weight to the second linear model and a second weight to the third linear model. At this time, the encoder and decoder may derive first color difference samples using a second linear model, and may derive second color difference samples using a third linear model.
  • the encoder and decoder may perform a weighted average using a first weight for the first chrominance sample and a second weight for the second chrominance sample to finally derive a chrominance sample corresponding to the luminance sample of the current block.
  • the first weight and the second weight may be pre-specified values. At this time, the first weight may be 13. Additionally, the second weight may be 3.
  • the encoder and decoder can construct a chrominance prediction block using the chrominance samples.
  • the encoder and decoder use CF (Chroma Fusion) as shown in Equation 10, a weighted average between the chrominance block (pred' C ) predicted through a general intra prediction mode without using LM mode and the current luminance block (rec' L ). It can be derived through .
  • the weighting parameters (a0, a1, a2) can be derived using the CCCM method.
  • the midValue can be calculated as 1 ⁇ (bitDepth - 1).
  • the encoder may include information indicating whether to use one CCCM model or two CCCM models in the bitstream. If the current chrominance block is encoded in CF mode, the decoder can parse information about how many CCCM models are used from the bitstream and predict the current chrominance block based on the parsed information.
  • GL-CCCM Gradient and location based convolutional cross-component model
  • the existing CCCM mode includes a luminance sample at a position corresponding to the chrominance sample position to be predicted, 4 samples around the luminance sample, (a) in the embodiment of FIG. 19, and coefficient information of the model (C0 to C6 in Equation 11) You can use to derive the color difference sample for the current block.
  • the luminance sample at a position corresponding to the chrominance sample position to be predicted the vertical difference (Gy in Equation 11), and the horizontal difference for 8 samples around the luminance sample.
  • the position value of the current luminance sample is the upper left position of the reference template used to derive the CCCM model, the upper left position of the current block, the relative position of the current pixel when the upper left position of the current block is (0,0), and the predefined A value recalculated through an offset value and a pre-designated shift value can be used.
  • the position value of the current luminance sample is (assuming that the upper left position of the current block is (0,0), the relative position value of the current pixel + the upper left position of the reference template used to derive the CCCM model from the upper left position of the current block. It can be calculated through difference value + pre-specified offset value) ⁇ pre-specified shift value).
  • the pre-designated offset value may be an integer.
  • the pre-designated offset value may be 8.
  • the pre-designated Schiff value may be an integer. For example, it may be '3'.
  • Gx and Gy can be calculated through Equation 12 using the sample in (b) of FIG. 19.
  • Model coefficient information that is, weight parameter information
  • Model coefficient information can be derived using a pre-designated area of already restored neighboring blocks around the current block.
  • Model coefficient information can be derived from the reference sample region using LDL decomposition as described in FIG. 17.
  • (b) in FIG. 17 can be changed and applied to (b) in FIG. 19, and (c) in FIG. 17 can be changed and applied to Equation 11.
  • the encoder may include a flag in the bitstream indicating information on whether GL-CCCM is used in the current block. The decoder can parse the corresponding flag from the bitstream and determine whether to predict the chrominance block by applying GL-CCCM to the current block.
  • the luminance samples used to calculate the vertical and horizontal differences between luminance samples can be used not only around the current luminance sample but also around luminance samples separated by a pre-specified difference.
  • the pre-designated difference may be 1 in FIG. 19, and may have values of 2, 3, and 4 in other cases.
  • the LM mode which predicts the current chrominance block using the restored current luminance block, can match the resolution of the luminance block to that of the chrominance block by applying a downsampling filter to the luminance block due to the difference in resolution between the luminance and chrominance blocks. there is. Due to this downsampling, the edge component information of the luminance block may be reduced. Accordingly, the encoder and decoder can predict the chrominance block using samples of the luminance block without down-sampling the samples of the luminance block. Specifically, the encoder and decoder can predict the chrominance block using samples of the luminance block before down-sampling.
  • Figures 20 and 21 show luminance samples before downsampling used to derive chrominance samples in CCCM-ND mode according to an embodiment of the present invention.
  • CCCM-ND (CCCM using non-downsampled luma samples) mode is a method of predicting a chrominance block by using samples of the luminance block before down-sampling, without down-sampling the samples of the luminance block.
  • Figure 20 shows a chrominance sample position C to be predicted and six luminance sample positions corresponding to the chrominance sample position. At this time, the luminance samples are samples before downsampling.
  • Color difference samples are calculated using Equation (13), a linear model using six luminance samples, L0, L1, L2, L3, L4, and L5 samples in FIG. 20, and four luminance samples, L0, L3 in FIG. 20, It can be calculated using a nonlinear model using L2 and L1 samples.
  • offsetLuma and offsetchroma have the same meaning as the difference values described in the specification.
  • B can be calculated as 1 ⁇ (bitDepth - 1).
  • LDL decomposition used in CCCM can be used to derive the coefficients (a0 to a10).
  • the encoder may include a flag in the bitstream indicating whether CCCM-ND has been applied to the current block.
  • the decoder can determine whether CCCM-ND is applied to the current block by parsing the corresponding flag from the bitstream. If CCCM-ND is applied to the current block, the encoder may not include information about GL-CCCM in the bitstream. If CCCM-ND is applied to the current block, the decoder may not parse information related to GL-CCCM. Additionally, the decoder may determine that GL-CCCM is not applied to the current block.
  • the encoder and decoder can use downsampled luminance samples from GL-CCCM to derive a model, and use the downsampled luminance samples of the current block to predict chrominance samples for the current block.
  • luminance samples before downsampling can be used to derive a model or be used to predict chrominance samples.
  • the chrominance samples are calculated through Equation 14, a linear model using 6 luminance samples, L0, L1, L2, L3, L4, L5 luminance samples in Figure 20, and 4 luminance samples, L0, L3, L2 in Figure 20.
  • a chrominance sample for the current block can be derived by reflecting the horizontal difference (Gx in Equation 14) and using the position values of the current luminance sample (X, Y in Equation 14) and coefficient information.
  • the encoder and decoder can calculate Gx and Gy through Equation 15 using the sample of FIG. 20.
  • offsetLuma and offsetchroma have the same meaning as the difference values described in the specification.
  • B can be calculated as 1 ⁇ (bitDepth - 1).
  • the LDL decomposition method used in CCCM can be used.
  • the luminance samples of FIG. 21 may be used instead of the luminance samples of FIG. 20, and the luminance samples of L6, L7, and L8, which are samples below the current color difference sample, may be used.
  • the luminance samples used in CCCM-ND may be used not only around the luminance sample corresponding to the current chrominance sample, but also around luminance samples separated by a predetermined difference.
  • the encoder and decoder use L0 to L8 when the pre-designated position is 1, and when the pre-designated position is 2, the encoder and decoder use at least one of the luminance samples L0 to L8 and I0 to I15 to calculate the chrominance difference. Samples can be predicted.
  • the encoder and decoder can selectively apply GL-CCCM and CCCM-ND. Specifically, when the encoder and decoder predict chrominance blocks, the encoder and decoder use a mode to predict chrominance blocks using GL-CCCM, a mode to predict chrominance blocks using CCCM-ND, and a mode to predict chrominance blocks using both GL-CCCM and CCCM-ND. Thus, one of the modes for predicting color difference blocks can be selected.
  • the encoder When predicting a chrominance block using the luminance block of the current block, if the chrominance block is predicted using only GL-CCCM, the encoder sets the value of the flag indicating whether to use CCCM-ND to 0 and determines whether to use GL-CCCM. By setting the indicating flag to 1, the two flags can be included in the bitstream. The decoder can parse the two flags from the bitstream and determine that the mode used to predict the chrominance block of the current block based on the two flags is to predict the chrominance block using only GL-CCCM.
  • the encoder When predicting a chrominance block through the luminance block of the current block, if a mode for predicting a chrominance block using only CCCM-ND is applied, the encoder sets the value of the flag indicating whether to use CCCM-ND to 1 and GL-CCCM Two flags can be included in the bitstream by setting the value of the flag indicating whether to use or not to 0.
  • the decoder may parse two flags from the bitstream and determine that the mode used to predict the chrominance block of the current block based on the two parsed flags is to predict the chrominance block using only CCCM-ND.
  • CCCM is a method of deriving linear and non-linear models using the correlation between luminance samples and chrominance samples of neighboring blocks adjacent to the current block, and then predicting chrominance samples of the current block using the restored luminance samples of the current block.
  • FIGS 22 and 23 show a block diagram of a cross-component residual model (CCRM) according to an embodiment of the present invention.
  • CCRM cross-component residual model
  • the encoder and decoder use the motion information of the current block to predict the luminance prediction block (Y') of the current block, the first chrominance prediction block (Cb') of the current block, Cr') and obtain a CCP model between the luminance prediction block (Y') of the current block and the first chrominance prediction block (Cb', Cr') of the current block.
  • the encoder and decoder can generate a restored luminance block of the current block using the luminance error block of the current block.
  • the encoder and decoder may apply the derived CCP model to the restored luminance block of the current block to generate second chrominance prediction blocks (fCb, fCr) of the current block.
  • the encoder and decoder can add a chrominance error block to the second chrominance prediction block of the current block predicted using the CCP model to finally generate chrominance blocks (Cb, Cr) of the current block.
  • This is called cross-component residual model (CCRM).
  • CCRM cross-component residual model
  • the encoder and decoder can generate chrominance samples on a sample-by-sample basis using the derived CCP model, and then obtain a chrominance prediction block using the chrominance samples.
  • the encoder and decoder use the motion information of the current block to predict the luminance prediction block (Y') of the current block and the first chrominance prediction block (Y') of the current block. Cb', Cr') and obtain a CCP model between the luminance prediction block (Y') of the current block and the first chrominance prediction block (Cb', Cr') of the current block.
  • the encoder and decoder can generate a restored luminance block of the current block using the luminance error block of the current block.
  • the encoder and decoder may apply the derived CCP model to the restored luminance sample of the current block to generate a chrominance prediction sample of the current block.
  • the encoder and decoder construct a second chrominance prediction block (fCb, fCr) using the second chrominance prediction samples of the current block predicted using the CCP model, and add the chrominance error block to the second chrominance prediction block to finally finalize the current block.
  • fCb, fCr second chrominance prediction block
  • a third color difference prediction block can be generated through averaging.
  • the encoder and decoder may apply a first weight to the first chrominance prediction block and a second weight to the second chrominance prediction block.
  • the first weight and the second weight are predefined values and may be integers.
  • the first weight may be a smaller value than the second weight.
  • the first weight may be 3.
  • the second weight may be 13.
  • the first weight may be 1.
  • the second weight may be 3.
  • the encoder and decoder can add the chrominance error block to the third chrominance prediction block to finally generate chrominance blocks (Cb, Cr) of the current block.
  • the encoder may include information indicating optimal weight values of the first weight and the second weight in the bitstream.
  • the decoder can parse information indicating the optimal weight values of the first weight and the second weight and generate a chrominance prediction block of the current block using the parsed information.
  • the encoder and decoder can generate chrominance samples on a sample-by-sample basis using the derived CCP model, and then obtain a chrominance prediction block using the chrominance samples.
  • the CCP models include CCLM, MMLM, GLM, CCCM, MM-CCCM, GL-CCCM, CCCM-ND, and CCCM-MDF, where CCLM and MMLM are linear models, and GLM, CCCM, MM-CCCM, and GL-CCCM. , CCCM-ND, and CCCM-MDF may be nonlinear models. That is, the CCP model may be one of CCLM, MMLM, GLM, CCCM, MM-CCCM, GL-CCCM, CCCM-ND, and CCCM-MDF.
  • the encoder and decoder correspond to the second chrominance prediction sample of the current block predicted using the CCP model in FIG. 22 and the second chrominance prediction sample in the first chrominance prediction block (Cb', Cr') in FIG. 22.
  • a third color difference prediction sample can be generated through a weighted average between the first color difference prediction samples.
  • the first chrominance prediction sample refers to a sample at the upper left position in the first chrominance prediction block (Cb', Cr') of FIG. 22.
  • the encoder and decoder may apply a first weight to the first chrominance prediction sample and a second weight to the second chrominance prediction sample.
  • the first weight and the second weight are predefined values and may be integers. Additionally, the first weight may be a smaller value than the second weight. For example, the first weight may be 3. Additionally, the second weight may be 13. For example, the first weight may be 1. Additionally, the second weight may be 3.
  • the encoder and decoder may construct a third chrominance prediction block using the third chrominance prediction sample. The encoder and decoder can add the chrominance error block to the third chrominance prediction block to finally generate chrominance blocks (Cb, Cr) of the current block.
  • the encoder may include information indicating optimal weight values of the first weight and the second weight in the bitstream.
  • the decoder can parse information indicating the optimal weight values of the first weight and the second weight and generate a chrominance prediction block of the current block using the parsed information.
  • the encoder and decoder when the current block is in an inter-coding mode, derive one or more CCP models using motion information used to generate a prediction block for the current block, One or more CCP models can optionally be used to predict the chrominance block of the current block.
  • the encoder can include information about which model is used in the bitstream.
  • the decoder can parse information about which model to use and predict the chrominance block of the current block using the model indicated by the parsed information.
  • the current block is in inter-coding mode, and bidirectional motion prediction can be applied to the current block.
  • the encoder and decoder can derive linear and non-linear models using the predicted luminance block and chrominance block of the current block weighted average through bidirectional movement.
  • the encoder and decoder may derive a CCP model using the predicted luminance block and chrominance block of the current block generated through L0 movement.
  • the encoder and decoder may derive a CCP model using the predicted luminance block and chrominance block of the current block generated through L1 movement.
  • the encoder can include information about which motion information among L0 and L1 is used to derive the CCP model in the bitstream.
  • the decoder parses information about which motion information among L0 and L1 is used to derive the CCP model from the bitstream, and uses the parsed information to determine the current block's level using one of the CCP models derived through L0 and L1.
  • a color difference prediction block can be created.
  • the encoder and decoder can add the chrominance error block to the generated chrominance prediction block to finally generate the chrominance block (Cb, Cr) of the current block.
  • the encoder and decoder can derive the first CCP model using the first luminance prediction block and the first chrominance prediction block generated through L0 motion information. there is. At this time, the encoder and decoder can derive the second CCP model using the second luminance prediction block and the second chrominance prediction block generated through L1 motion information. The encoder and decoder can generate a restored luminance block of the current block using the luminance error block of the current block.
  • the encoder and decoder apply the derived first CCP model to the restored luminance block of the current block to generate a third chrominance prediction block of the current block, and apply the derived second CCP model to the restored luminance block of the current block.
  • a fourth chrominance prediction block of the current block can be generated.
  • the encoder and decoder may generate a weighted average fifth chrominance prediction block using the first, second, third, and fourth chrominance prediction blocks and the respective first, second, third, and fourth weights.
  • the first, second, third, and fourth weights are predefined values and may be integers.
  • the encoder and decoder can add the chrominance error block to the fifth chrominance prediction block to finally generate chrominance blocks (Cb, Cr) of the current block.
  • blocks (Y', Cb', Cr') predicted using motion information of the current block are used to derive the CCP model.
  • the predicted block (Y', Cb', Cr') may be a reference block for the current block.
  • the encoder and decoder can derive the CCP model by additionally using samples of neighboring blocks adjacent to the current block as well as reference blocks for the current block.
  • the encoder and decoder refer to the current block obtained using the first luminance prediction sample and the first chrominance prediction sample of neighboring blocks adjacent to the current block, and the motion information of the current block.
  • a CCP model can be derived using both the second luminance prediction sample and the second chrominance prediction sample of the block.
  • the encoder and decoder may generate a restored luminance block of the current block by adding the luminance error block of the current block to the reference luminance block for the current block.
  • the encoder and decoder may apply the derived CCP model to the restored luminance block of the current block to generate a chrominance prediction block of the current block.
  • the encoder and decoder can add the chrominance error block to the chrominance prediction block of the current block predicted using the derived CCP model to finally generate the chrominance block of the current block.
  • the encoder and decoder can derive the first CCP model using the first luminance prediction sample and the first chrominance prediction sample of neighboring blocks adjacent to the current block. Additionally, a second CCP model can be derived using the second luminance prediction sample and the second chrominance prediction sample of the reference block for the current block obtained using the motion information of the current block.
  • the encoder and decoder may generate a restored luminance block of the current block by adding the luminance error block of the current block to the reference luminance block for the current block.
  • the encoder and decoder may apply the derived first CCP model to the restored luminance block of the current block to generate a third chrominance prediction block of the current block.
  • the encoder and decoder may generate a fourth chrominance prediction block of the current block by applying the derived second CCP model to the restored luminance block of the current block.
  • the encoder and decoder may generate a fifth chrominance prediction block through a weighted average between the third chrominance prediction block and the fourth chrominance prediction block.
  • the encoder and decoder may apply a first weight to the third chrominance prediction block and a second weight to the fourth chrominance prediction block.
  • the first weight and the second weight are predefined values and may be integers.
  • the first weight may be a smaller value than the second weight.
  • the first weight may be 3.
  • the second weight may be 13.
  • the first weight may be 1.
  • the second weight may be 3.
  • the encoder and decoder may add the chrominance error block to the fifth chrominance prediction block to finally generate the chrominance block of the current block.
  • the encoder and decoder can derive linear and non-linear models using any one of the methods described herein: CCCM, GL-CCCM, CCCM-ND, and GLM.
  • the encoder and decoder do not derive a CCP model for CCRM in the current block, but apply the CCP model of CCRM used in the reference block to the current block. That is, the encoder and decoder can generate a chrominance prediction block of the current block by applying the CCP model of CCRM used in the reference block to the restored luminance block of the current block.
  • the encoder and decoder can construct a CCP model list from reference blocks. At this time, the encoder and decoder can rearrange the CCP model list based on the template cost.
  • the encoder may include index information of the optimal CCP model for the current block in the CCP model list in the bitstream.
  • the decoder can parse the index information of the optimal CCP model from the bitstream and select the optimal CCP model for the current block from the CCP model list.
  • the encoder indicates whether to apply CCRM to the current block.
  • Information can be included in the bitstream. If an error signal exists in the luminance block of the current block, the decoder can parse information indicating whether to apply CCRM to the current block from the bitstream and determine whether to apply CCRM to the current block based on the parsed information.
  • the CCRM method is applied to the current block. It may not be used. If any of the encoding modes among OBMC, MHP, LIC, DMVR, BDOF, PROF, BCW, Affine, GPM, CIIP, IBC-GPM, IBC-CIIP, and IBC-LIC is applied to the current block, the encoder encodes CCRM and Related information may not be included in the bitstream.
  • the decoder encodes CCRM and Relevant information may not be parsed. At this time, the encoder may determine that CCRM is not applied to the current block.
  • the correlation between the luminance prediction block and the chrominance prediction block of the current block as well as the correlation between the luminance prediction block and the luminance restoration block may be used. These embodiments will be described with reference to FIG. 24.
  • Figure 24 shows that CCRM is performed using the correlation between a luminance prediction block and a luminance restoration block according to an embodiment of the present invention.
  • the encoder and decoder When the inter-encoding mode is applied to the current block, the encoder and decoder set the first luminance reference block (RefA in FIG. 24 (a)) indicated by the motion information of the current block as the first luminance restoration block, and perform the first luminance restoration.
  • a CCP model can be derived using the second luminance reference block (RefB in FIG. 24 (a)) and the first luminance restoration block indicated by the block's motion information.
  • the encoder and decoder may generate a luminance prediction block of the current block by applying the derived linear and non-linear models to the first luminance reference block (RefA (a) of FIG. 24).
  • a weighted average luminance prediction block of the current block can be generated using the weighted average between the luminance prediction block of the current block and the first luminance reference block ((a) RefA of FIG. 24).
  • the encoder and decoder When the current block is predicted through inter-coding mode and bidirectional motion, the encoder and decoder generate a first luminance reference block indicated by the L0 motion information of the current block and a second luminance reference block indicated by the L1 motion information of the current block.
  • the CCP model can be derived using .
  • the encoder and decoder may apply the derived CCP model to the first luminance reference block and the second luminance reference block, respectively, to generate the first and second luminance prediction blocks of the current block.
  • the encoder and decoder may generate a weighted average luminance prediction block of the current block through a weighted average between the first and second luminance prediction blocks of the current block and the first and second luminance reference blocks.
  • the above-mentioned prediction block generation method of the luminance block can also be applied to chrominance components.
  • the encoder and decoder can derive a CCP model for each chrominance component and apply it to chrominance block prediction.
  • the encoder and decoder determine if the surrounding block adjacent to the current block (A in (b) of FIG. 24) and the luminance prediction block for the A block (in FIG. 24) In (b), the CCP model can be derived using RefA0, RefA1).
  • the encoder and decoder may apply the derived CCP model to the luminance prediction blocks (Ref0, Ref1) of the current block to generate the first and second luminance prediction blocks of the current block.
  • the encoder and decoder may generate a weighted average luminance prediction block of the current block using a weighted average between the first and second luminance prediction blocks of the current block and the prediction blocks (Ref0, Ref1) of the current block. If the inter-coding mode is applied to the current block and it is predicted with bidirectional motion, the previously described method of generating a prediction block for the luminance block can be applied to the chrominance component. Additionally, the encoder and decoder can derive a CCP model for each chrominance component and apply chrominance block prediction.
  • the methods described above in this specification may be performed through a processor of a decoder or encoder. Additionally, the encoder can generate a bitstream that is decoded by a video signal processing method. Additionally, the bitstream generated by the encoder may be stored in a computer-readable non-transitory storage medium (recording medium).
  • parsing is not limited to the decoder operation, but can also be interpreted as the act of generating a bitstream in the encoder. Additionally, this bitstream can be generated and stored in a computer-readable recording medium.
  • Embodiments of the present invention described above can be implemented through various means.
  • embodiments of the present invention may be implemented by hardware, firmware, software, or a combination thereof.
  • the method according to embodiments of the present invention uses one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), and Programmable Logic Devices (PLDs).
  • 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 method according to embodiments of the present invention may be implemented in the form of a module, procedure, or function that performs the functions or operations described above.
  • Software code can be stored in memory and run by a processor.
  • the memory may be located inside or outside the processor, and may exchange data with the processor through various known means.
  • Computer-readable media can be any available media that can be accessed by a computer and includes both volatile and non-volatile media, removable and non-removable media. Additionally, computer-readable media may include both computer storage media and communication media.
  • Computer storage media includes both volatile and non-volatile, 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 includes computer readable instructions, data structures or other data of modulated data signals such as program modules, or other transmission mechanisms, and includes any information delivery medium.

Landscapes

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

Abstract

비디오 신호 디코딩 장치가 개시된다. 상기 디코딩 장치는 프로세서를 포함한다. 상기 프로세서는 현재 블록의 주변 휘도 샘플과 상기 현재 블록의 주변 휘도 샘플에 대응되는 색차 샘플, 참조 블록의 주변 휘도 샘플과 상기 참조 블록의 주변 휘도 샘플에 대응되는 색차 샘플 중 적어도 하나의 샘플의 값을 기초로 상기 현재 블록의 휘도 샘플의 값과 상기 현재 블록의 색차 샘플의 값의 관계를 모델링하는 모델을 획득하고, 상기 획득한 모델과 현재 블록의 휘도 블록을 사용하여 상기 현재 블록의 색차 블록을 예측한다.

Description

휘도 샘플 기반 색차 샘플 예측을 사용하는 비디오 신호 처리 방법 및 이를 위한 장치
본 발명은 비디오 신호의 처리 방법 및 장치에 관한 것으로, 보다 상세하게는 비디오 신호를 인코딩하거나 디코딩하는 비디오 신호 처리 방법 및 장치에 관한 것이다.
압축 부호화란 디지털화한 정보를 통신 회선을 통해 전송하거나, 저장 매체에 적합한 형태로 저장하기 위한 일련의 신호 처리 기술을 의미한다. 압축 부호화의 대상에는 음성, 영상, 문자 등의 대상이 존재하며, 특히 영상을 대상으로 압축 부호화를 수행하는 기술을 비디오 영상 압축이라고 일컫는다. 비디오 신호에 대한 압축 부호화는 공간적인 상관관계, 시간적인 상관관계, 확률적인 상관관계 등을 고려하여 잉여 정보를 제거함으로써 이루어진다. 그러나 최근의 다양한 미디어 및 데이터 전송 매체의 발전으로 인해, 더욱 고효율의 비디오 신호 처리 방법 및 장치가 요구되고 있다.
본 명세서는 비디오 신호 처리 방법 및 이를 위한 장치를 제공하여 비디오 신호의 코딩 효율을 높이기 위한 목적이 있다.
본 발명의 실시 예에 따른 비디오 신호 디코딩 장치는 프로세서를 포함한다. 상기 프로세서는 현재 블록의 주변 휘도 샘플과 상기 현재 블록의 주변 휘도 샘플에 대응되는 색차 샘플, 참조 블록의 주변 휘도 샘플과 상기 참조 블록의 주변 휘도 샘플에 대응되는 색차 샘플 중 적어도 하나의 샘플의 값을 기초로 상기 현재 블록의 휘도 샘플의 값과 상기 현재 블록의 색차 샘플의 값의 관계를 모델링하는 모델을 획득하고, 상기 획득한 모델과 현재 블록의 휘도 블록을 사용하여 상기 현재 블록의 색차 블록을 예측한다.
상기 프로세서는 상기 획득한 모델과 현재 블록의 휘도 블록을 사용하여 색차 예측 블록을 생성하고, 상기 색차 예측 블록에 오차 블록을 더하여 상기 현재 블록의 색차 블록을 복원할 수 있다.
상기 디코딩 장치가 상기 모델을 획득할 때, 상기 프로세서는 제1 모델과 제2 모델을 획득하고, 상기 현재 블록의 휘도 샘플과 상기 제1 모델을 사용하여 제1 색차 예측 샘플을 생성하고, 상기 현재 블록의 휘도 샘플과 상기 제2 모델을 사용하여 제2 색차 예측 샘플을 생성하고, 상기 제1 색차 예측 샘플과 상기 제2 색차 예측 샘플을 가중 평균하여 제3 차 색차 예측 샘플을 생성하고, 상기 제3 색차 예측 샘플을 사용하여 색차 예측 블록을 생성하고, 상기 색차 예측 블록에 오차블록을 더하여 상기 현재 블록의 색차 블록을 복원할 수 있다.
상기 프로세서는 상기 현재 블록이 인터 부호화 모드로 부호화되고, 양방향 예측이 적용된 경우, L0 움직임 정보를 사용하여 예측한 제1 예측 블록을 사용하여 상기 제1 모델을 유도하고, L1 움직임 정보를 사용하여 예측한 제2 예측 블록을 사용하여 상기 제2 모델을 유도할 수 있다.
상기 모델에 입력되는 입력값은 상기 현재 블록의 휘도 샘플의 값에서 미리 지정된 제1 오프셋 값만큼 뺀 값과 상기 현재 블록의 Cb 색차 샘플의 값에서 미리 지정된 제2 오프셋 값만큼 뺀 값과 상기 현재 블록의 Cr 색차 샘플의 값에서 미리 지정된 제3 오프셋 값만큼 뺀 값을 포함할 수 있다.
상기 미리 지정된 제1 오프셋 값은 상기 현재 블록의 주변 샘플 중 미리 지정된 위치의 휘도 샘플의 값이고, 상기 미리 지정된 제2 오프셋 값은 상기 미리 지정된 위치의 Cb 색차 샘플의 값이고, 상기 미리 지정된 제3 오프셋 값은 상기 미리 지정된 위치의 Cr 색차 샘플의 값일 수 있다.
상기 프로세서는 상기 미리 지정된 위치의 휘도 샘플의 값이 미리 지정된 범위 내에 속하지 않는 경우, 미리 지정된 기본 제1 오프셋 값을 상기 제1 오프셋 값, 미리 지정된 기본 제2 오프셋 값을 상기 제2 오프셋 값, 미리 지정된 기본 제3 오프셋 값을 상기 제3 오프셋 값으로 사용할 수 있다.
상기 프로세서는 상기 미리 지정된 위치의 휘도 샘플의 값이 미리 지정된 범위 내에 속하지 않는 경우, 상기 현재 블록의 색차 블록은 상기 모델 기반 부호화 모드를 사용할 수 없는 것으로 판단하고, 상기 모델과 관련된 적어도 하나의 신택스를 파싱하지 않을 수 있다.
상기 프로세서는 상기 미리 지정된 위치의 휘도 샘플의 값이 미리 지정된 범위 내에 속하지 않는 경우, 미리 지정된 복수의 위치의 휘도 샘플 값이 상기 제1 오프셋 값으로 유효한지 미리 지정된 순서대로 판단하고, 상기 제1 오프셋 값으로 유효한 휘도 샘플의 값이 발견된 경우, 상기 발견된 휘도 샘플의 값을 상기 제1 오프셋 값, 상기 발견된 휘도 샘플의 값에 대응하는 Cb 색차 샘플의 값을 상기 제2 오프셋 값, 및 상기 발견된 휘도 샘플에 대응하는 Cr 색차 샘플의 값을 상기 제3 오프셋 값으로 사용할 수 있다.
상기 프로세서는 상기 비디오 신호를 포함하는 비트스트림으로부터 오프셋 샘플을 지시하는 오프셋 샘플 정보를 파싱하고, 상기 오프셋 샘플 정보가 지시하는 휘도 샘플의 값을 상기 제1 오프셋 값, 상기 오프셋 샘플 정보가 지시하는 Cb 색차 샘플의 값을 제2 오프셋 값, 상기 오프셋 샘플 정보가 지시하는 Cr 색차 샘플의 값을 값을 상기 제3 오프셋 값으로 사용할 수 있다.
본 발명의 또 다른 실시 예에 따라 비디오 신호를 디코딩하는 디코딩 장치는 프로세서를 포함한다. 상기 프로세서는 현재 블록에 대한 움직임 정보를 획득하고, 상기 움직임 정보를 이용하여 현재 블록에 대한 휘도 예측 블록과 제1 색차 예측 블록을 생성하고, 상기 휘도 예측 블록과 제1 색차 예측 블록 간의 관계를 모델링하는 모델을 획득하고, 상기 휘도 예측 블록에 휘도 오차 블록을 더하여 상기 현재 블록에 대한 복원된 휘도 블록을 생성하고, 상기 획득한 모델과 상기 복원된 휘도 블록을 기초로 상기 현재 블록의 제2 색차 블록을 예측하고, 상기 현재 블록의 제1 색차 블록과 상기 현재 블록의 제2 색차 블록을 가중 평균하여 제3 색차 예측 블록을 생성하고, 상기 제3 색차 블록에 색차 오차 블록을 더하여 상기 현재 블록의 색차 블록을 복원한다.
상기 프로세서는 상기 획득한 모델과 상기 복원된 휘도 블록을 사용하여 상기 현재 블록의 제2 색차 블록을 예측할 수 있다.
상기 프로세서는 상기 획득한 모델과 상기 복원된 휘도 블록의 복원된 휘도 샘플을 사용하여 상기 현재 블록의 제2 색차 샘플을 예측할 수 있다.
상기 획득한 모델은 상기 휘도 예측 샘플과 상기 휘도 예측 샘플 주변의 복수의 휘도 샘플 사이의 수직 차이와 수평 차이, 및 상기 휘도 예측 샘플의 수직 좌표 및 수평 좌표 중에서 적어도 하나를 사용하여 유도될 수 있다.
상기 획득한 모델은 상기 휘도 예측 샘플을 다운 샘플링하지 않고 유도될 수 있다.
상기 프로세서는 상기 복원된 휘도 블록의 복원된 휘도 샘플, 상기 복원된 휘도 샘플과 상기 복원된 휘도 샘플 주변의 복수의 휘도 샘플 사이의 수직 차이와 수평 차이, 및 상기 복원된 휘도 샘플의 수직 좌표 및 수평 좌표 중 적어도 하나를 사용하여 상기 현재 블록의 제2 색차 샘플을 예측할 수 있다.
상기 프로세서는 상기 현재 블록에 대한 복원된 휘도 샘플을 다운 샘플링하지 않고, 상기 현재 블록의 제2 색차 샘플을 예측할 수 있다.
상기 프로세서는 상기 제1 색차 샘플에 제1 가중치를 적용하고, 상기 제2 색차 샘플에 제2 가중치를 적용할 수 있다. 이때, 상기 제2 가중치는 상기 제1 가중치보다 클 수 있다.
본 발명의 실시 예에 따라 비디오 신호를 인코딩하는 인코딩 장치는 프로세서를 포함한다. 상기 프로세서는 현재 블록의 주변 휘도 샘플과 상기 현재 블록의 주변 휘도 샘플에 대응되는 색차 샘플, 참조 블록의 주변 휘도 샘플과 상기 참조 블록의 주변 휘도 샘플에 대응되는 색차 샘플 중 적어도 하나의 샘플의 값을 기초로 상기 현재 블록의 휘도 샘플의 값과 상기 현재 블록의 색차 샘플의 값의 관계를 모델링하는 모델을 획득하고, 상기 획득한 모델과 현재 블록의 휘도 블록을 사용하여 상기 현재 블록의 색차 블록을 예측한다.
본 발명의 또 다른 실시 예에 따라 비디오 신호를 인코딩하는 인코딩 장치는 프로세서를 포함한다. 상기 프로세서는 현재 블록에 대한 움직임 정보를 획득하고, 상기 움직임 정보를 이용하여 현재 블록에 대한 휘도 예측 블록과 제1 색차 예측 블록을 생성하고, 상기 휘도 예측 블록과 제1 색차 예측 블록 간의 관계를 모델링하는 모델을 획득하고, 상기 휘도 예측 블록에 휘도 오차 블록을 더하여 상기 현재 블록에 대한 복원된 휘도 블록을 생성하고, 상기 획득한 모델과 상기 복원된 휘도 블록을 기초로 상기 현재 블록의 제2 색차 블록을 예측하고, 상기 현재 블록의 제1 색차 블록과 상기 현재 블록의 제2 색차 블록을 가중 평균하여 제3 색차 예측 블록을 생성하고, 상기 제3 색차 블록에 색차 오차 블록을 더하여 상기 현재 블록의 색차 블록을 복원한다. 본 발명의 실시 예에 따라 비디오 신호를 디코딩하는 디코딩 방법은 현재 블록의 주변 휘도 샘플과 상기 현재 블록의 주변 휘도 샘플에 대응되는 색차 샘플, 참조 블록의 주변 휘도 샘플과 상기 참조 블록의 주변 휘도 샘플에 대응되는 색차 샘플 중 적어도 하나의 샘플의 값을 기초로 상기 현재 블록의 휘도 샘플의 값과 상기 현재 블록의 색차 샘플의 값의 관계를 모델링하는 모델을 획득하는 단계와 상기 획득한 모델과 현재 블록의 휘도 블록을 사용하여 상기 현재 블록의 색차 블록을 예측하는 단계를 포함할 수 있다.
본 발명의 또 다른 실시 예에 따라 비디오 신호를 디코딩하는 디코딩 방법은 현재 블록에 대한 움직임 정보를 획득하는 단계; 상기 움직임 정보를 이용하여 현재 블록에 대한 휘도 예측 블록과 제1 색차 예측 블록을 생성하는 단계; 상기 휘도 예측 블록과 제1 색차 예측 블록 간의 관계를 모델링하는 모델을 획득하는 단계; 상기 휘도 예측 블록에 휘도 오차 블록을 더하여 상기 현재 블록에 대한 복원된 휘도 블록을 생성하는 단계; 상기 획득한 모델과 상기 복원된 휘도 블록을 기초로 상기 현재 블록의 제2 색차 블록을 예측하는 단계; 상기 현재 블록의 제1 색차 블록과 상기 현재 블록의 제2 색차 블록을 가중 평균하여 제3 색차 예측 블록을 생성하는 단계; 및 상기 제3 색차 블록에 색차 오차 블록을 더하여 상기 현재 블록의 색차 블록을 복원하는 단계를 포함할 수 있다.
본 발명의 실시 예에 따라 비트스트림을 저장하는 컴퓨터 판독 가능한 비 일시적 저장 매체가 개시된다. 상기 비트스트림은 디코딩 방법에 의해 디코딩된다. 상기 디코딩 방법은 현재 블록의 주변 휘도 샘플과 상기 현재 블록의 주변 휘도 샘플에 대응되는 색차 샘플, 참조 블록의 주변 휘도 샘플과 상기 참조 블록의 주변 휘도 샘플에 대응되는 색차 샘플 중 적어도 하나의 샘플의 값을 기초로 상기 현재 블록의 휘도 샘플의 값과 상기 현재 블록의 색차 샘플의 값의 관계를 모델링하는 모델을 획득하는 단계와 상기 획득한 모델과 현재 블록의 휘도 블록을 사용하여 상기 현재 블록의 색차 블록을 예측하는 단계를 포함한다.
본 발명의 또 다른 실시 예에 따라 비트스트림을 저장하는 컴퓨터 판독 가능한 비 일시적 저장 매체가 개시된다. 상기 비트스트림은 디코딩 방법에 의해 디코딩된다. 상기 디코딩 방법은 현재 블록에 대한 움직임 정보를 획득하는 단계; 상기 움직임 정보를 이용하여 현재 블록에 대한 휘도 예측 블록과 제1 색차 예측 블록을 생성하는 단계; 상기 휘도 예측 블록과 제1 색차 예측 블록 간의 관계를 모델링하는 모델을 획득하는 단계; 상기 휘도 예측 블록에 휘도 오차 블록을 더하여 상기 현재 블록에 대한 복원된 휘도 블록을 생성하는 단계; 상기 획득한 모델과 상기 복원된 휘도 블록을 기초로 상기 현재 블록의 제2 색차 블록을 예측하는 단계;
상기 현재 블록의 제1 색차 블록과 상기 현재 블록의 제2 색차 블록을 가중 평균하여 제3 색차 예측 블록을 생성하는 단계; 및 상기 제3 색차 블록에 색차 오차 블록을 더하여 상기 현재 블록의 색차 블록을 복원하는 단계를 포함한다.
본 명세서는 효율적으로 비디오 신호를 처리하기 위한 방법을 제공한다. 본 명세서에서 얻을 수 있는 효과는 이상에서 언급한 효과들로 제한되지 않으며, 언급하지 않은 또 다른 효과들은 아래의 기재로부터 본 발명이 속하는 기술분야에서 통상의 지식을 가진 자에게 명확하게 이해될 수 있을 것이다.
도 1은 본 발명의 일 실시예에 따른 비디오 신호 인코딩 장치의 개략적인 블록도이다.
도 2는 본 발명의 일 실시예에 따른 비디오 신호 디코딩 장치의 개략적인 블록도이다.
도 3은 픽쳐 내에서 코딩 트리 유닛이 코딩 유닛들로 분할되는 실시예를 도시한다.
도 4는 쿼드 트리 및 멀티-타입 트리의 분할을 시그널링하는 방법의 일 실시예를 도시한다.
도 5 및 도 6은 본 발명의 실시예에 따른 인트라 예측 방법을 더욱 구체적으로 도시한다.
도 7은 인터 예측에서 움직임 후보 리스트를 생성하기 위해 사용되는 주변 블록들의 위치를 나타낸 도면이다.
도 8은 본 발명의 실시 예에 따라 CCLM이 수행되는 블록도를 보여준다.
도 9는 본 발명의 실시 예에 따라 선형 모델을 유도하기 위해 사용되는 템플릿 구성의 일 실시 예를 보여준다.
도 10은 본 발명의 실시 예에 따른 인코더 및 디코더가 임계치를 기준으로 2개의 선형 모델을 유도하는 것을 보여준다.
도 11은 본 발명의 실시 예에 따라 선형 모델의 부호화 모드에 대한 신택스를 구성하는 방법을 보여준다.
도 12는 본 발명의 실시 예에 따라 mmlm_flag 문맥 모델에 대한 확률 초기화 정보를 보여준다.
도 13은 본 발명의 실시 예에 따라 mmlm_flag 문맥 모델에 대한 확률 초기화 정보를 보여준다.
도 14는 본 발명의 실시 예에 따라 주변 블록의 움직임 정보를 사용하여 현재 블록에 대한 인트라 예측 모드를 유도하는 방안을 보여준다.
도 15는 본 발명의 실시 예에 따라 재귀적 선형 모델을 이용하여 색차 블록을 예측하는 방법을 보여준다.
도 16은 본 발명의 실시 예에 따라 참조 선형 모델을 생성하기 위해 사용되는 참조 영역을 보여준다.
도 17은 본 발명의 실시 예에 따라 CCCM에 사요되는 참조 샘플 및 수식을 보여준다.
도 18은 본 발명의 실시 예에 따른 차분 샘플 기반 CCCM 방법을 보여준다.
도 19는 본 발명의 실시 예에 따라 색차 샘플 예측에 사용되는 모델의 유도에 고려되는 현재 블록 주변의 미리 지정된 개수의 주변 휘도 샘플을 보여준다.
도 20은 본 발명의 실시 예에 따른 CCCM-ND 모드에서 색차 샘플을 유도하기 위해 사용되는 다운샘플링되기 전의 휘도 샘플들을 보여준다.
도 21은 본 발명의 실시 예에 따른 CCCM-ND 모드에서 색차 샘플을 유도하기 위해 사용되는 다운샘플링되기 전의 휘도 샘플들을 보여준다.
도 22는 본 발명의 실시 예에 따른 CCRM(cross-component residual model)의 블록도를 보여준다.
도 23은 본 발명의 실시 예에 따른 CCRM(cross-component residual model)의 블록도를 보여준다.
도 24는 본 발명의 실시 예에 따라 휘도 예측 블록과 휘도 복원 블록 사이의 상관성을 이용하여 CCRM이 수행되는 것을 보여준다.
본 명세서에서 사용되는 용어는 본 발명에서의 기능을 고려하면서 가능한 현재 널리 사용되는 일반적인 용어를 선택하였으나, 이는 당 분야에 종사하는 기술자의 의도, 관례 또는 새로운 기술의 출현 등에 따라 달라질 수 있다. 또한 특정 경우는 출원인이 임의로 선정한 용어도 있으며, 이 경우 해당되는 발명의 설명 부분에서 그 의미를 기재할 것이다. 따라서 본 명세서에서 사용되는 용어는, 단순한 용어의 명칭이 아닌 그 용어가 가진 실질적인 의미와 본 명세서의 전반에 걸친 내용을 토대로 해석되어야 함을 밝혀두고자 한다.
본 명세서에서 'A 및/또는 B'는 'A 또는 B 중 적어도 하나를 포함하는'과 같은 의미로 해석될 수 있다.
본 명세서에서 일부 용어들은 다음과 같이 해석될 수 있다. 코딩은 경우에 따라 인코딩 또는 디코딩으로 해석될 수 있다. 본 명세서에서 비디오 신호의 인코딩(부호화)을 수행하여 비디오 신호 비트스트림을 생성하는 장치는 인코딩 장치 또는 인코더로 지칭되며, 비디오 신호 비트스트림의 디코딩(복호화)을 수행하여 비디오 신호를 복원하는 장치는 디코딩 장치 또는 디코더로 지칭된다. 또한, 본 명세서에서 비디오 신호 처리 장치는 인코더 및 디코더를 모두 포함하는 개념의 용어로 사용된다. 정보(information)는 값(values), 파라미터(parameter), 계수(coefficients), 성분(elements) 등을 모두 포함하는 용어로서, 경우에 따라 의미는 달리 해석될 수 있으므로 본 발명은 이에 한정되지 아니한다. '유닛'은 영상 처리의 기본 단위 또는 픽쳐의 특정 위치를 지칭하는 의미로 사용되며, 휘도(luma) 성분 및 색차(chroma) 성분 중 적어도 하나를 포함하는 이미지 영역을 가리킨다. 또한, '블록'은 휘도 성분 및 색차 성분들(즉, Cb 및 Cr) 중 특정 성분을 포함하는 이미지 영역을 가리킨다. 다만, 실시예에 따라서 '유닛', '블록', '파티션', '신호' 및 '영역' 등의 용어는 서로 혼용하여 사용될 수 있다. 또한, 본 명세서에서 '현재 블록'은 현재 부호화를 진행할 예정인 블록을 의미하며, '참조 블록'은 이미 부호화 또는 복호화가 완료된 블록으로 현재 블록에서 참조로 사용되는 블록을 의미한다. 또한, 본 명세서에서 '루마', 'luma', '휘도', 'Y' 등의 용어는 서로 혼용하여 사용될 수 있다. 또한, 본 명세서에서 '크로마', 'chroma' '색차', 'Cb 또는 Cr' 등의 용어는 서로 혼용하여 사용될 수 있으며, 색차 성분은 Cb와 Cr 2가지로 나누어지므로 각 색차 성분은 구분되어 사용될 수 있다. 또한, 본 명세서에서 '샘플(sample)'은 픽쳐 혹은 프레임을 구성하는 기본 원소이고, 휘도 샘플의 값은 8비트인 경우, 0 ~ 255 값을 가질 수 있고, 12비트인 경우, 0 ~ 4095값을 가질 수 있으며, '샘플', '픽셀', '화소' 등의 용어는 서로 혼용하여 사용될 수 있다. 또한, 본 명세서에서 유닛은 코딩 유닛, 예측 유닛, 변환 유닛을 모두 포함하는 개념으로 사용될 수 있다. 픽쳐는 필드 또는 프레임을 가리키며, 실시예에 따라 상기 용어들은 서로 혼용하여 사용될 수 있다. 구체적으로 촬영된 영상이 비월주사식(interlace) 영상일 경우, 하나의 프레임은 홀수(또는 기수, top) 필드와 짝수(또는 우수, bottom) 필드로 분리되어, 각 필드는 하나의 픽쳐 단위로 생성되어 부호화 또는 복호화 될 수 있다. 만일 촬영된 영상이 순차주사(progressive) 영상일 경우, 하나의 프레임이 픽쳐로서 생성되어 부호화 또는 복호화 될 수 있다. 또한, 본 명세서에서 '오차 신호', '레지듀얼 신호', '잔차 신호', '잔여 신호' 및 '차분 신호' 등의 용어는 서로 혼용하여 사용될 수 있다. 또한, 본 명세서에서 '인트라 예측 모드', '인트라 예측 방향성 모드', '인트라 예측 모드' 및 '인트라 예측 방향성 모드' 등의 용어는 서로 혼용하여 사용될 수 있다. 또한, 본 명세서에서 '모션', '움직임' 등의 용어는 서로 혼용하여 사용될 수 있다. 또한, 본 명세서에서 '좌측', '좌상측', '상측', '우상측', '우측', '우하측', '하측', '좌하측'은 '좌단', '좌상단', '상단', '우상단', '우단', '우하단', '하단', '좌하단'와 서로 혼용하여 사용될 수 있다. 또한, 원소(element), 멤버(member)는 서로 혼용하여 사용될 수 있다. POC(Picture Order Count)는 픽쳐(또는 프레임)의 시간적 위치 정보를 나타내며, 화면에 출력되는 재생 순서가 될 수 있으며, 픽쳐마다 고유의 POC를 가질 수 있다.
도 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)을 사용할 수 있다. 적응적 루프 필터(Adaptive Loop Filter, ALF)는 영상에 포함된 픽셀을 소정의 그룹으로 나눈 후, 해당 그룹에 적용될 하나의 필터를 결정하여 그룹마다 차별적으로 필터링을 수행하는 방법이다. ALF를 적용할지 여부에 관련된 정보는 코딩 유닛 단위로 시그널링될 수 있고, 각각의 블록에 따라 적용될 ALF 필터의 모양 및 필터 계수가 달라질 수 있다. 또한, 적용할 대상 블록의 특성에 관계없이 동일한 형태(고정된 형태)의 ALF 필터가 적용될 수도 있다.
예측부(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 Code, 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)과정이 수행되어 확률 구간이 넓어지고 해당 위치 정보가 출력된다. 또한, 각 빈이 처리된 후, 처리된 빈의 정보를 통해 다음 처리될 빈에 대한 확률이 새롭게 설정되는 확률 업데이트 과정이 수행될 수 있다.
상기 생성된 비트스트림은 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 유닛을 복호화해야 한다. 한편, 비디오 신호 비트스트림의 복호화를 위해 필요한 정보들은 픽쳐 파라미터 세트(Picture Parameter Set, PPS), 시퀀스 파라미터 세트(Sequence Parameter Set, SPS), 비디오 파라미터 세트(Video Parameter Set, VPS) 등에 포함되어 전송될 수 있다.
한편, 도 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 픽쳐 리스트 각각에서 선택된 영역일 수 있다.
인터 예측부(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개의 직사각형 노드들로 분할된다.
트리 분할 구조는 휘도 블록과 색차 블록이 동일한 형태로 분할될 수 있다. 즉, 색차 블록은 휘도 블록의 분할 형태를 참조하여 색차 블록을 분할할 수 있다. 현재 색차 블록이 임의의 정해진 크기보다 적다면, 휘도 블록이 분할되었더라도 색차 블록은 분할되지 않을 수 있다.
트리 분할 구조는 휘도 블록과 색차 블록이 서로 다른 형태를 가질 수 있다. 이때, 휘도 블록에 대한 분할 정보와 색차 블록에 대한 분할 정보가 각각 시그널링될 수 있다. 또한, 분할 정보 뿐만 아니라 휘도 블록과 색차 블록의 부호화 정보도 다를 수 있다. 실시 일 예로, 휘도 블록과 색차 블록의 인트라 부호화 모드, 움직임 정보에 대한 부호화 정보 등이 적어도 하나 이상 다를 수 있다.
가장 작은 단위로 분할될 노드는 하나의 코딩 블록으로 처리될 수 있다. 현재 블록이 코딩 블록일 경우, 코딩 블록은 여러 개의 서브 블록(서브 코딩 블록)으로 분할될 수 있으며, 각 서브 블록의 예측 정보는 서로 같거나 또는 다를 수 있다. 실시 일 예로, 코딩 유닛이 인트라 모드일 경우, 각 서브 블록의 인트라 예측 모드는 서로 같거나 또는 다를 수 있다. 또한, 코딩 유닛이 인터 모드일 경우, 각 서브 블록의 움직임 정보는 서로 같거나 또는 다를 수 있다. 또한, 각 서브 블록은 서로 독립적으로 인코딩 또는 디코딩이 가능할 수 있다. 각각의 서브 블록은 서브 블록 인덱스(sub-block index, sbIdx)를 통해 구분될 수 있다. 또한 코딩 유닛이 서브 블록으로 분할될 때, 수평 또는 수직 방향으로 분할되거나 사선으로 분할될 수 있다. 인트라 모드에서 현재 코딩 유닛을 수평 또는 수직 방향으로 2개 또는 4개의 서브 블록으로 분할하는 모드를 ISP(Intra Sub Partitions)이라 한다. 인터 모드에서 현재 코딩 블록을 사선으로 분할하는 모드를 GPM(geometric partitioning mode)이라 한다. GPM모드에서 사선의 위치와 방향은 미리 지정된 각도 테이블을 사용하여 유도하고, 각도 테이블의 인덱스 정보가 시그널링된다.
코딩을 위한 픽쳐 예측(모션 보상)은 더 이상 나누어지지 않는 코딩 유닛(즉 코딩 트리 유닛의 리프 노드)을 대상으로 이루어진다. 이러한 예측을 수행하는 기본 단위를 이하에서는 예측 유닛(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 방법을 통해 획득되는 움직임 정보의 보정 값에 대한 정보(예를 들어, 움직임 차분값 후보들 중에서 선택된 하나의 후보를 지시하는 인덱스 등)은 비트스트림에 포함되어 디코더로 전송될 수 있다. 기존의 움직임 정보 차분값을 비트스트림에 포함하는 것에 비해 움직임 정보의 보정 값에 대한 정보를 비트스트림에 포함함으로써 비트량을 절약할 수 있다.
TM(Template Matching) 방법은 현재 블록의 주변 화소를 통해 템플릿을 생성하여 템플릿과 가장 유사도가 높은 매칭 영역을 찾아서 움직임 정보를 보정하는 방법이다. TM(Template matching)은 부호화되는 비트스트림의 크기를 줄이기 위해서, 움직임 정보를 비트스트림에 포함하지 않고 디코더에서 움직임 예측을 수행하는 방법이다. 이때, 디코더는 원본 영상이 없으므로 이미 복원된 주변 블록을 사용하여 현재 블록에 대한 움직임 정보를 개략적으로 유도할 수 있다.
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) 방법은 서로 다른 참조 픽쳐로 부터 움직임 보상된 두 개의 예측 블록에 대하여, 평균으로 예측 블록을 생성하지 않고, 블록 단위로 적응적으로 가중치를 적용하여 움직임 보상된 두 개의 예측 블록에 가중치 평균을 수행하는 방법이다.
MHP(Multi-hypothesis prediction) 방법은 인터 예측 시 단방향 및 양방향 움직임 정보에 추가적인 움직임 정보를 전송함으로써, 다양한 예측 신호를 통한 가중치 예측을 수행하는 방법이다.
CCLM(Cross-component linear model)은 휘도 신호와 해당 휘도 신호와 동일한 위치에 있는 색차 신호 간의 높은 상관성을 이용하여 선형 모델을 생성한 후, 해당 선형 모델을 통해 색차 신호를 예측하는 방법이다. 현재 블록에 인접한 주변 블록 중에서 복원이 완료된 블록을 사용하여 템플릿을 생성한 후, 템플릿을 통해 선형 모델에 대한 파라미터가 유도된다. 다음으로, 영상 포맷에 따라 선택적으로 색차 블록의 크기에 맞게 복원된 현재 휘도 블록이 다운 샘플링된다. 마지막으로, 다운 샘플링된 휘도 블록과 해당 선형 모델을 이용하여 현재 블록의 색차 블록을 예측한다. 이때, 2개 이상의 선형 모델을 사용하는 방법을 MMLM(Multi-model Linear mode)이라고 한다. 또한, CCLM과 MMLM과 같이, 다른 신호들 간의 상관성을 이용한 예측 방법을 CCP(Cross-Component Prediction)이라고 할 수 있다. CCLM은 하나의 선형 모델을 사용하므로, 단일 CCP 모델이라고 할 수 있으며, MMLM은 여러 개의 선형 모델을 사용하므로, 다중(또는 복합) CCP 모델이라고 할 수 있다.
인코더 및 디코더에서는 현재 블록의 휘도 예측 블록과 휘도 블록에 대한 오차 신호를 더한 복원된 휘도 블록을 구성한 후, 복원된 휘도 블록과 휘도 예측 블록 간의 상관성을 이용하여 CCP 모델을 구성할 수 있다. 이때 CCP 모델은 CCLM, MMLM, GLM, CCCM, MM-CCCM, GL-CCCM, CCCM-ND, CCCM-MDF 중에 하나가 될 수 있다. 휘도 블록으로부터 유도된 CCP 모델을 색차 예측 블록에 적용하여 CCP 모델이 적용된 제1 색차 예측 블록을 생성할 수 있다. 제1 색차 예측 블록과 색차 블록에 대한 오차 신호를 더하여 최종 색차 블록을 생성할 수 있다.
또한, CCP 모델은 상기 CCP 모델의 타입 중에서 적어도 하나 이상의 타입을 사용한 것을 의미한다. CCP 모델은 적어도 하나 이상의 CCP 모델로 구성될 수 있다. 하나의 CCP 모델은 2개의 CCLM으로 구성될 수 있으며, 이를 MMLM이라고 할 수 있다. 새로운 CCP 모델은 CCP 모델의 타입이 다른 경우, CCP 모델의 타입이 동일하지만 CCP 모델의 파라미터가 다른 값인 경우가 될 수 있다. CCP 모델 간 CCP 모델의 타입이 다를 경우, 서로 다른 CCP 모델이라고 할 수 있다. CCP 모델 간 CCP 모델의 타입이 동일하지만 CCP 모델 간 파라미터가 다를 경우, 서로 다른 CCP 모델이라고 할 수 있다. CCP 모델 간 CCP 모델의 개수가 다를 경우(예를 들어, 제1 CCP 모델은 하나의 CCLM으로 구성되고, 제2 CCP 모델은 2개의 CCLM으로 구성된 경우), 서로 다른 CCP 모델이라고 할 수 있다. CCP 모델은 CCP 모델의 타입 정보, CCP 모델의 파라미터 정보, MMLM 혹은 MM-CCCM과 같이 Multiple CCP를 사용했는지 정보, 휘도 블록의 평균값 정보, 다운샘플링 필터 정보 중 적어도 하나 이상을 포함할 수 있다.
CCCM(Convolutional cross-component model)은 휘도 신호와 해당 휘도 신호와 동일한 위치에 있는 색차 신호 사이의 상관성을 이용하여 비선형 모델을 구성한 후, 해당 비선형 모델을 사용하여 색차 신호를 예측하는 방법이다.
GLM(Gradient Linear Model)은 CCLM과 같은 선형 모델에 휘도 샘플의 기울기를 추가로 반영하여 모델을 구성한 후, 해당 모델을 사용하여 색차 신호를 예측하는 방법이다.
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)라 지칭할 수 있다.
독립 스칼라 양자화(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-distortion)에 대한 비용(Cost)을 고려하여 탐색한다. 구체적으로, 비디오 부호화에 적용된 종속 양자화는 변환 계수에 대한 허용 가능한 복원된 변환 계수들의 집합이 복원 순서에서 현재 변환 계수에 선행하는 변환 계수의 값에 의존하도록 설계될 수 있다. 이때, 여러 개의 양자화기를 변환 계수에 따라 선택적으로 사용하게 함으로써, 원본 영상과 복원된 영상 간의 평균적인 오차를 최소화하여 부호화 효율을 높이는 효과가 있다.
인트라 예측 부호화 기술 중에서 MIP(Matrix Intra Prediction) 방법은 행렬 기반 인트라 예측 방법으로 현재 블록에 인접한 주변 블록의 픽셀로부터 방향성을 가지는 예측 방법과 달리, 주변 블록의 좌측 및 상단의 픽셀들을 미리 정의된 행렬 매트릭스와 오프셋 값을 이용하여 예측 신호를 구하는 방법이다.
현재 블록의 인트라 예측 모드를 유도하기 위해서, 현재 블록에 인접하면서 복원된 임의의 영역인 템플릿(template)을 기반으로, 해당 템플릿의 주변 픽셀을 통해 유도된 템플릿에 대한 인트라 예측 모드가 현재 블록의 복원을 위해 이용할 수 있다. 우선, 디코더는 템플릿에 인접한 주변 픽셀(reference)을 이용하여 템플릿에 대한 예측 템플릿을 생성하고, 이미 복원된 템플릿과 가장 유사한 예측 템플릿을 생성한 인트라 예측 모드를 현재 블록의 복원을 위해 사용할 수 있다. 이러한 방법을 TIMD(Template intra mode derivation)이라고 할 수 있다.
일반적으로 인코더는 예측 블록을 생성하기 위한 예측 모드를 결정하여 결정된 예측 모드에 대한 정보가 포함된 비트스트림을 생성할 수 있다. 디코더는 수신한 비트스트림을 파싱하여 인트라 예측 모드를 설정할 수 있다. 이때, 예측 모드에 대한 정보의 비트량은 전체 비트스트림 크기의 10% 정도일 수 있다. 예측 모드에 대한 정보의 비트량을 감소시키기 위해 인코더는 비트스트림에 인트라 예측 모드에 대한 정보를 포함하지 않을 수 있다. 이에, 디코더는 주변 블록의 특성을 이용하여 현재 블록의 복원을 위한 인트라 예측 모드를 유도(결정)할 수 있고, 유도된 인트라 예측 모드를 이용하여 현재 블록을 복원할 수 있다. 이때, 디코더는 인트라 예측 모드를 유도하기 위해 현재 블록에 인접한 주변 화소(pixel)들마다 소벨(Sobel) 필터를 가로 및 세로 방향으로 적용하여 방향성 정보를 유추한 후, 해당 방향성 정보를 인트라 예측 모드로 매핑하는 방법을 이용할 수 있다. 디코더가 주변 블록을 이용하여 인트라 예측 모드를 유도하는 방법은 DIMD(Decoder side intra mode derivation)로 기술될 수 있다.
인트라 예측 방향성 모드를 사용하여 예측된 블록은 블록의 상단 및 좌측 경계 부분에서 불연속적인 에지가 나타날 수 있다. 예를 들어, 현재 블록이 수직 방향 모드를 사용하여 예측된 경우, 블록의 좌측 경계 부분에서 불연속적인 에지가 나타날 수 있다. 인코더 및 디코더는 이러한 불연속성을 완화하기 위해, 예측 블록 내부의 경계 부분의 샘플에 대해 필터링을 적용할 수 있다. 필터링은 현재 예측 블록에 인접한 복원된 샘플, 현재 예측 블록에 인접한 복원된 샘플의 위치 정보, 현재 예측 블록 내부의 경계 부분의 샘플, 현재 예측 블록 내부의 경계 부분의 샘플의 위치 정보, 현재 예측 블록의 인트라 예측 방향성 모드, 현재 예측 블록의 가로의 크기 및 세로의 크기 중에서 적어도 하나 이상을 사용하여 필터링의 적용 여부 및/또는 필터링 가중치를 결정할 수 있다. 필터링 가중치는 현재 예측 블록 내부의 경계 부분의 샘플에 대한 가중치와 현재 예측 블록에 인접한 복원된 샘플에 대한 가중치를 의미한다. 이러한 필터링 방법을 PDPC(Position dependent intra prediction combination)라고 할 수 있다.
도 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 내지 도 24를 통해 설명한다.
도 8은 본 발명의 실시 예에 따라 CCLM이 수행되는 블록도를 보여준다. 또한, 도 9는 본 발명의 실시 예에 따라 선형 모델을 유도하기 위해 사용되는 템플릿 구성의 일 실시 예를 보여준다.
인코더 및 디코더가 CCLM을 수행할 때, 인코더 및 디코더는 현재 블록에 인접한 주변 블록이고, 복원된 블록을 사용하여 템플릿을 구성할 수 있다. 이때, 템플릿은 CCLM에 사용되는 복원된 블록의 집합이다. 인코더 및 디코더는 구성한 템플릿을 기초로 CCLM의 선형 모델의 파라미터를 유도한다. 이때, 휘도 블록은 색차 블록의 크기에 맞게 다운샘플링된다. 인코더 및 디코더는 선형 모델을 사용하여 현재 블록의 색차 블록을 예측한다. 또한, 2개 이상의 선형 모델이 CCLM에 사용될 수 있다. 2개 이상의 선형 모델이 사용되는 CCLM을 MMLM(Multi-model Linear mode)로 지칭한다.
템플릿은 현재 블록에 인접한 주변 픽셀 중 일부만을 포함할 수 있다. 구체적인 실시 예에서 템플릿은 도 9의 'O'으로 표시된 픽셀을 포함할 수 있다. 4:2:0 컬러 포맷이 사용되는 경우, 색차 블록은 휘도 블록의 1/4 크기이다. 휘도 픽셀과 색차 픽셀 간의 1:1 매칭을 위해, CCLM에 다운샘플링된 휘도 샘플이 사용될 수 있다. 다운샘플링된 휘도 샘플을 유도하기 위해, 인코더 및 디코더는 2가지 타입의 필터를 사용할 수 있다. 현재 블록의 SPS, PPS, PH, 슬라이스(Slice), 타일(Tile), CU, 및 서브블록(sub-block)에 중 적어도 어느 하나에 따라 어떠한 타입의 필터가 사용될 지 결정될 수 있다. 또한, 비트 스트림은 CCLM에서 어떠한 타입의 필터가 사용될 지에 대한 정보를 포함할 수 있다. 디코더는 CCLM에서 어떠한 타입의 필터가 사용될 지에 대한 정보를 비트스트림으로부터 파싱할 수 있다. 도 9의 실시 예에서 제1 타입(Type 1)은 6개의 샘플을 사용하여 가운데 'O' 위치의 휘도 샘플을 유도하는 방법이다. 도 9의 실시 예에서 A 위치에 제1 타입(Type 1)이 적용되어 다운 샘플링된 휘도 템플릿이 생성될 수 있다. 본 명세서에서 휘도 템플릿은 미리 지정된 방법에 따라 획득한 휘도 샘플 값의 집합을 나타낸다. 도 9의 실시 예에서 제2 타입(Type 2)은 5개 샘플을 사용하여 정 가운데 위치의 휘도 샘플을 유도하는 방법이다. 도 9의 실시 예에서 C 위치에 제2 타입(Type 2)이 적용되어 다운 샘플링된 휘도 템플릿을 생성할 수 있다.
다운샘플링된 휘도 템플릿을 획득하는 방법에 대해 설명한다.
도 9의 B는 본 발명의 일시 예에 따라 다운 샘플링된 휘도 템플릿을 구성하는 방법을 보여준다. 제1 타입(Type 1)의 필터가 적용될 때, 인코더 및 디코더는 제1 타입(Type 1)의 상위 3개 샘플은 현재 블록에 주변 블록의 복원된 휘도 샘플이 사용될 수 있다. 또한, 제1 타입(Type 1)의 하위 3개 샘플은 현재 블록 내의 복원된 휘도 샘플이 사용될 수 있다. 최종 생성되는 휘도 픽셀의 위치는 도 9의 빗금친 부분일 수 있다. 이러한 동작의 제2 타입(Type 2)에도 동일하게 적용될 수 있다.
또 다른 구체적인 실시 예에서, 인코더 및 디코더는 제1 타입(Type 1)의 상위 3개 샘플만을 사용하여 다운 샘플링된 휘도 템플릿을 구성할 수 있다. 최종 생성되는 휘도 픽셀의 위치는 도 9의 빗금친 부분일 수 있다. 이러한 동작은 제2 타입(Type 2)에도 동일하게 적용될 수 있다. 이러한 실시 예를 통해 병렬 처리 성능을 높일 수 있다.
또 다른 구체적인 실시 예에서 현재 블록의 상단 경계가 CTU 경계일 경우, 인코더 및 디코더는 상단 픽셀 3개 라인들 중에서 현재 블록에 가장 인접한 1개 라인만을 사용하여 템플릿을 구성할 수 있다. 이때, 기존 제1 타입(Type 1)과 제2 타입(Type 2)의 필터 타입이 적용될 수 있도록, 인접한 1개 라인 샘플이 2번째 라인과 3번째 라인으로 패딩될 수 있다. 이러한 실시 예들을 통해 라인 버퍼 상의 메모리를 절약할 수 있다.
인코더는 현재 블록의 좌측에 인접한 샘플, 상단에 인접한 샘플, 및 좌측에 인접한 샘플과 상단에 인접한 샘플 모두 중 인코딩 효율이 좋은 샘플을 선택하여 템플릿으로 사용할 수 있다. 비트 스트림은 어떠한 위치의 샘플이 CCLM 또는 MMLM의 템플릿으로 사용된지에 대한 정보, 즉 템플릿 위치에 관한 정보를 포함할 수 있다. 디코더는 비트 스트림으로부터 템플릿 위치에 관한 정보를 파싱하고, 템플릿 위치에 관한 정보를 기초로 템플릿을 구성할 수 있다. 다만 이러한 시그널링 방법은 비트량을 증가시키는 요인이 될 수 있다. 따라서 인코더 및 디코더는 다음과 같은 실시 예들을 통해 암묵적으로 템플릿 위치를 결정할 수 있다. 설명의 편의를 위해 현재 블록의 좌측에 인접한 샘플을 좌측 샘플로 지칭하고, 현재 블록의 상단에 인접한 샘플을 상단 샘플로 지칭한다.
구체적인 실시 예에서 인코더 및 디코더는 인트라 예측 방향성 모드를 기초로 템플릿의 위치를 결정할 수 있다. 구체적으로 인코더 및 디코더는 상단 샘플, 및 좌측에 인접한 샘플과 상단에 인접한 샘플 모두 중 현재 휘도 블록의 예측에 사용된 인트라 예측 방향성 모드가 지시하는 방향과 가까운 샘플을 템플릿 위치로 결정할 수 있다. 예컨대, 인트라 예측 방향성 모드가 지시하는 방향이 좌측 샘플보다 상단 샘플에 가깝거나 미리 지정된 값일 경우, 인코더 및 디코더는 상단 템플릿만을 사용하여 CCLM 또는 MMLM의 템플릿으로 사용할 수 있다. 또한, 인트라 예측 방향성 모드가 지시하는 방향이 상단 샘플보다 좌측 샘플에 가깝거나 미리 지정된 값일 경우, 인코더 및 디코더는 좌측 템플릿만을 사용하여 CCLM의 템플릿으로 사용할 수 있다. 구체적인 실시 예에서 미리 지정된 값은 50과 18일 수 있다. 이때, 인트라 예측 방향성 모드의 값이 50보다 큰 경우, 인코더 및 디코더는 상단 샘플을 CCLM 또는 MMLM의 템플릿으로 사용할 수 있다. 또한, 인트라 예측 방향성 모드의 값이 18 보다 적은 경우, 인코더 및 디코더는 좌측 샘플을 CCLM의 템플릿으로 사용할 수 있다. 또한, 인트라 예측 방향성 모드의 값이 18에서 50 사이인 경우, 인코더 및 디코더는 상단 샘플 및 좌측 샘플을 CCLM 또는 MMLM의 템플릿으로 사용할 수 있다.
또 다른 구체적인 실시 예에서 인코더 및 디코더가 CCLM 또는 MMLM의 템플릿을 구성할 때, 인코더 및 디코더는 좌측에 인접한 주변 블록을 복원할 때 사용한 양자화 파라미터의 값과 상단에 인접한 주변 블록을 복원할 때 사용한 양자화 파라미터의 값을 비교하여 상단 샘플, 및 좌측에 인접한 샘플과 상단에 인접한 샘플 모두 중 어느 위치의 샘플을 사용할지 결정할 수 있다. 구체적으로 인코더 및 디코더는 좌측에 인접한 주변 블록을 복원할 때 사용한 양자화 파라미터의 값과 상단에 인접한 주변 블록을 복원할 때 사용한 양자화 파라미터의 값 중 더 작은 값이 사용된 주변 블록의 샘플을 CCLM 또는 MMLM의 템플릿 구성에 사용할 수 있다. 좌측에 인접한 주변 블록을 복원할 때 사용한 양자화 파라미터의 값과 상단에 인접한 주변 블록을 복원할 때 사용한 양자화 파라미터의 값이 같거나 미리 지정된 값 이내의 차이를 가질 경우, 인코더 및 디코더는 좌측 샘플과 상단 샘플 모두를 사용하여 CCLM 또는 MMLM의 템플릿을 구성할 수 있다. 이러한 실시 예를 통해 보다 높은 화질로 복원된 샘플을 CCLM 또는 MMLM에 사용할 수 있다. 또 다른 구체적인 실시 예에서 인코더 및 디코더는 좌측에 인접한 주변 블록을 복원할 때 사용한 양자화 파라미터의 값과 상단에 인접한 주변 블록을 복원할 때 사용한 양자화 파라미터의 값 중 더 큰 값이 사용된 샘플을 CCLM 또는 MMLM의 템플릿 구성에 사용할 수 있다. 이러한 실시 예에서도 좌측에 인접한 주변 블록을 복원할 때 사용한 양자화 파라미터의 값과 상단에 인접한 주변 블록을 복원할 때 사용한 양자화 파라미터의 값이 같거나 미리 지정된 값 이내의 차이를 가질 경우, 인코더 및 디코더는 좌측 샘플과 상단 샘플 모두를 사용하여 CCLM 또는 MMLM의 템플릿을 구성할 수 있다.
또 다른 구체적인 실시 예에서 인코더 및 디코더는 현재 블록의 크기를 기초로 템플릿 구성에 사용하는 샘플의 위치를 결정할 수 있다. 구체적으로 인코더 및 디코더는 현재 블록의 크기가 미리 지정된 값 이내인 경우 좌측 샘플 및 상단 샘플 모두를 사용하여 CCLM 또는 MMLM의 템플릿으로 사용할 수 있다. 현재 블록의 크기는 현재 블록의 가로와 세로의 합을 기초로 결정될 수 있다. 또한, 미리 지정된 값은 1이상의 정수일 수 있다.
또 다른 구체적인 실시 예에서 인코더 및 디코더는 현재 블록의 가로와 세로의 비율을 기초로 템플릿 구성에 사용하는 샘플의 위치를 결정할 수 있다. 구체적으로 현재 블록의 가로가 세로보다 긴 경우, 인코더 및 디코더는 좌측 샘플을 사용하여 CCLM 또는 MMLM의 템플릿을 구성할 수 있다. 또 다른 구체적인 실시 예에서 현재 블록의 가로가 세로보다 긴 경우, 인코더 및 디코더는 상단 샘플을 사용하여 CCLM의 템플릿을 구성할 수 있다.
또 다른 구체적인 실시 예에서 인코더 및 디코더는 좌측 샘플이 CCLM 또는 MMLM이 적용되어 복원되었는지 및 상단 샘플이 CCLM 또는 MMLM이 적용되어 복원되었는지를 기초로 템플릿 구성에 사용하는 샘플의 위치를 결정할 수 있다. 구체적으로 좌측 샘플의 복원에 CCLM 및 MMLM이 적용되지 않았고, 상단 샘플의 복원에 CCLM 또는 MMLM이 적용된 경우, 인코더 및 디코더는 상단 샘플을 사용하여 CCLM 또는 MMLM의 템플릿을 구성할 수 있다. 또 다른 구체적인 실시 예에서 좌측 샘플의 복원에 CCLM 및 MMLM이 적용되지 않았고, 상단 샘플의 복원에 CCLM 또는 MMLM이 적용된 경우, 인코더 및 디코더는 좌측 샘플을 사용하여 CCLM 또는 MMLM의 템플릿을 구성할 수 있다.
또 다른 구체적인 실시 예에서 인코더 및 디코더는 현재 블록의 좌측 주변 블록의 샘플에서 참조 샘플 패딩이 수행된 픽셀의 수 또는 현재 블록의 상측 주변 블록의 샘플에서 참조 샘플 패딩이 수행된 픽셀의 수를 기초로 템플릿 구성에 사용하는 샘플의 위치를 결정할 수 있다. 구체적으로 현재 블록의 좌측 주변 블록의 샘플에서 참조 샘플 패딩이 수행된 픽셀의 수가 미리 지정된 값 이상인 경우, 인코더 및 디코더는 좌측 샘플을 사용하지 않고 CCLM 또는 MMLM의 템플릿을 구성할 수 있다. 이때, 미리 지정된 값은 1이상의 정수 일 수 있다. 구체적으로 현재 블록의 상측 주변 블록의 샘플에서 참조 샘플 패딩이 수행된 픽셀의 수가 미리 지정된 값 이상인 경우, 인코더 및 디코더는 상단 샘플을 사용하지 않고 CCLM 또는 MMLM의 템플릿을 구성할 수 있다. 이때, 미리 지정된 값은 1이상의 정수 일 수 있다. 또한, 좌측 샘플 및 상단 샘플을 모두 사용할 수 없는 경우, 인코더 및 디코더는 미리 지정된 기본 파라미터를 사용하여 선형 모델을 유도할 수 있다.
또 다른 구체적인 실시 예에서 템플릿에 포함된 샘플의 개수가 미리 지정된 값 이내인 경우, 인코더 및 디코더는 미리 지정된 기본 파라미터를 사용하여 선형 모델을 유도할 수 있다. 미리 지정된 값은 1이상의 정수일 수 있다.
앞서 설명한 실시 예들에서 미리 지정된 기본 파라미터는 A1은 0, B1은 X, 쉬프트(shift)는 0일 수 있다. 이때, X는 현재 영상 포맷의 범위의 최대값의 절반일 수 있다. 예컨대, 현재 영상 포맷이 8비트 범위를 갖는 경우, X는 128일 수 있다.
도 10은 본 발명의 실시 예에 따른 인코더 및 디코더가 임계치를 기준으로 2개의 선형 모델을 유도하는 것을 보여준다.
템플릿 구성에 사용되는 주변 픽셀은 디블록킹 필터링이 적용되기 전의 픽셀일 수 있다. 또한, 템플릿 구성에 사용되는 주변 픽셀에 LMCS가 적용된 경우, 역 매핑이 수행되기 전의 픽셀이 사용될 수 있다. 또 다른 구체적인 실시 예에서 템플릿 구성에 사용되는 주변 픽셀에 LMCS가 적용된 경우, 역 매핑이 수행된 후의 픽셀이 사용될 수 있다.
인코더 및 디코더는 구성한 템플릿을 사용하여 선형 모델의 파라미터를 획득할 수 있다. 블록 당 1개 이상의 선형 모델이 사용될 수 있다. 인코더는 비트스트림에 블록마다 몇 개의 선형 모델이 사용될지 지시하는 정보를 포함시킬 수 있다. 디코더는 비트스트림으로부터 블록마다 몇 개의 선형 모델이 사용될지 지시하는 정보를 파싱하고, 몇 개의 선형 모델이 사용될지 지시하는 정보를 기초로 현재 색차 블록을 위한 선형 모델들을 유도할 수 있다.
인코더 및 디코더가 선형 모델을 유도하는 방법은 LMS(least mean square) 방법과 MIN/MAX 방법을 포함할 수 있다.
먼저 MIN/MAX 방법에 대해 설명한다. 본 발명의 실시 예에 따른 MIN/MAX 방법에서 인코더 및 디코더는 템플릿의 미리 지정된 위치에서 2개의 작은 값(X0 A, X1 A)과 2개의 큰 값(X0 B, X1 B)을 찾는다. 또한, 인코더 및 디코더는 4개 샘플에 대응되는 색차 샘플의 값(Y0 A, Y1 A, Y0 B, Y1 B)과 수학식 1을 이용하여 작은 값들의 평균(XA, YA)과 큰 값들의 평균(XB, YB)을 유도한다. 인코더 및 디코더는 최종적인 선형 모델 파라미터 a, b를 수학식 2를 사용하여 계산한다. 인코더 및 디코더가 색차 블록을 예측할 때, 인코더 및 디코더는 수학식 3과 같이, 선형 모델 파라미터(a, b)와 휘도 샘플 값을 사용하여 색차 블록의 각 샘플을 예측할 수 있다.
수학식 1
Figure PCTKR2023016463-appb-img-000001
수학식 2
Figure PCTKR2023016463-appb-img-000002
수학식 3
Figure PCTKR2023016463-appb-img-000003
LMS 방법에 대해 설명한다. 인코더 및 디코더는 템플릿 및 수학식 4와 수학식 5를 사용하여 선형 모델의 파라미터 값을 획득할 수 있다. 수학식 4에서 RecC(i)와 Rec'L(i)는 각각 템플릿에서의 색차 샘플과 다운샘플링된 휘도 샘플을 의미하고, I는 템플릿 내의 샘플 개수를 의미한다. 도 9에서 I는 회색으로 마킹된 위치의 샘플을 의미한다.
수학식 4
Figure PCTKR2023016463-appb-img-000004
수학식 5
Figure PCTKR2023016463-appb-img-000005
인코더 및 디코더는 LM 모드의 부호화 효율을 향상시키기 위해서, 하나의 선형 모델만을 사용하지 않고 2개 이상의 선형 모델을 사용할 수 있다. 구체적으로 인코더 및 디코더는 기존의 하나의 선형 모델만을 사용하는 CCLM 모드와 2개 이상의 선형 모델을 사용하는 MMLM 모드를 혼합하여 사용할 수 있다. 이때, 선형 모델의 선택에 관한 정보는 CU 단위로 시그널링될 수 있다.
2개 이상의 선형 모델을 사용하는 MMLM 모드의 경우, 선형 모델의 개수가 증가함에 따라 계산 복잡도도 증가될 수 있다. 따라서 도 10과 같이, 2개의 선형 모델만이 사용되도록 제한될 수 있다.
수학식 6
Figure PCTKR2023016463-appb-img-000006
구체적인 실시 예에서 2개의 선형 모델에 대한 파라미터를 유도하기 위한 방법은 다음과 같은 순서로 수행될 수 있다.
인코더 및 디코더는 휘도 템플릿 내의 샘플들에 대한 평균값과 색차 템플릿 내의 샘플들에 대한 평균값을 구한다. 본 명세서에서 색차 템플릿은 미리 지정된 방법에 따라 획득한 색차 샘플 값의 집합을 나타낸다. 이때, 보다 정확하게 2개 선형 모델로 구분하기 위해, 인코더 및 디코더는 각 평균값으로 각 템플릿의 샘플 수를 통해 확장된 범위로 스케일된 평균값을 사용할 수 있다. 또한, 인코더 및 디코더는 휘도 템플릿 내의 샘플들에 대한 평균값으로 다운 샘플링된 휘도 샘플 값을 포함하는 템플릿 또는 다운 샘플링되기 전의 휘도 샘플 값을 포함하는 템플릿 중에서 하나를 사용할 수 있다.
인코더 및 디코더는 선형 모델에 대한 파라미터를 기본값으로 설정한다. 이때, 인코더 및 디코더는 A1 및 A2을 0으로 설정하고, B1 및 B2는 현재 영상 포맷의 범위의 최대값의 절반으로 설정할 수 있다. 예컨대, 영상 포맷의 범위가 8비트인 경우, 인코더 및 디코더는 B1 및 B2를 128으로 설정할 수 있다. 또한, 인코더 및 디코더는 스케일된 값을 원래대로 복원하기 위한 쉬프트(shift) 값은 0으로 설정한다.
만일 템플릿이 포함하는 샘플의 수가 미리 지정된 값 이내인 경우, 인코더 및 디코더는 기본 파라미터를 갖는 2개의 선형 모델을 CCML 또는 MMLM에 사용할 수 있다. 미리 지정된 값은 1이상의 정수일 수 있다. 미리 지정된 값은 4일 수 있다.
인코더 및 디코더는 휘도 템플릿 내의 샘플들에 대한 스케일링된 평균값에 따라, 휘도 템플릿의 각 샘플들과 동일한 위치의 색차 샘플들을 2개 그룹으로 나눈다. 구체적으로 인코더 및 디코더는 평균값보다 작거나 같은 샘플을 제1 그룹으로 분류하고, 평균값보다 큰 샘플을 제2 그룹으로 분류할 수 있다.
각 그룹 내의 샘플의 수가 2의 배수가 아닌 경우, 인코더 및 디코더는 각 그룹 내의 샘플의 수가 2의 배수가 되도록 주변 샘플을 통해 패딩을 수행한다. 이때, 각 그룹 내의 샘플의 수가 미리 지정된 개수 이내인 경우, 인코더 및 디코더는 패딩을 수행하지 않는다. 미리 지정된 개수는 1이상의 정수 일 수 있다. 또 다른 구체적인 실시 예에서 그룹 내의 샘플의 수가 미리 지정된 개수 이내인 경우, 인코더 및 디코더는 2개 선형 모델을 유도하지 않고 1개 선형 모델만을 유도할 수 있다. 미리 지정된 개수는 1이상의 정수 일 수 있다. 예컨대, 미리 지정된 개수는 4일 수 있다.
인코더 및 디코더는 각 그룹마다 선형 모델에 대한 파라미터를 수학식 4와 수학식 5를 사용해 유도한다. 이때, 각 그룹 내의 샘플의 수가 미리 지정된 개수 이내인 경우, 인코더 및 디코더는 색차 템플릿 내의 샘플들에 대한 평균값에서 휘도 템플릿 내의 샘플들에 대한 평균값을 뺀 차분 값을 구한다. 인코더 및 디코더는 구한 차분값을 선형 모델에 대한 파라미터 B값에 대입하여 해당 그룹에 대한 선형 모델 유도 과정을 종료한다. 또 다른 구체적인 실시 예에서 그룹 내의 샘플의 수가 미리 정해진 개수 이내인 경우, 인코더 및 디코더는 2개 선형 모델을 유도하지 않고 1개 선형 모델만 유도하도록 할 수 있다. 미리 지정된 개수는 1이상의 정수 일 수 있다. 예컨대, 미리 지정된 개수는 4일 수 있다.
MMLM, MM-CCCM과 같은 다중 CCP 모델에서 보다 정확한 선형 모델에 대한 파라미터를 유도하기 위해서 다음과 같은 다양한 방법이 적용될 수 있다.
인코더 및 디코더는 현재 블록에 인접한 주변 블록의 휘도 템플릿의 평균값 대신에 현재 블록 내의 복원된 휘도 블록의 평균값을 사용할 수 있다. 또 다른 구체적인 실시 예에서 인코더 및 디코더는 현재 휘도 블록의 평균값과 휘도 템플릿의 평균값 사이의 평균값을 2개 선형 모델을 구분하기 위한 임계치(threshold)로 사용할 수 있다. 임계치는 현재 블록의 주변 휘도 샘플에 다운 샘플링 필터가 적용되어 최종 생성되는 샘플의 위치의 휘도 샘플의 값과 비교될 수 있다. 구체적으로 인코더 및 디코더는 현재 블록의 주변 휘도 샘플들에 다운 샘플링 필터가 적용되어 최종 생성되는 샘플의 위치의 휘도 샘플의 값이 임계치보다 큰지에 따라, 현재 블록의 주변 휘도 샘플이 2개의 선형 모델 중 어느 모델 유도에 사용할 지 판단할 수 있다. 이때, 다운 샘플링 필터는 휘도 샘플의 개수를 색차 샘플의 개수에 맞추기 위해 사용되는 필터이다. 색차 포맷, 휘도 성분 대 색차 성분 간의 비율에 따라 주변 블록의 휘도 블록의 평균값은 다운 샘플링 된 휘도 성분에 대한 평균 값일 수 있다. 같은 조건에 따라 현재 블록의 휘도 블록의 평균 값도 다운 샘플링 된 휘도 블록들에 대한 평균 값일 수 있다.
또 다른 구체적인 실시 예에서 인코더 및 디코더는 현재 블록에 인접한 주변 블록의 휘도 템플릿의 픽셀값과 현재 블록 내의 복원된 휘도 블록의 픽셀값 중에서 적어도 하나 이상을 사용하여 계산된 평균값을 사용할 수 있다. 또 다른 구체적인 실시 예에서 현재 휘도 블록의 평균값과 휘도 템플릿의 평균값 중에서 어느 하나의 평균값을 2개 선형 모델을 구분하기 위한 임계치로 사용할 수 있다. 색차 포맷, 휘도 성분 대 색차 성분 사이의 비율에 따라 주변 블록의 휘도 블록의 평균값은 다운 샘플링 된 휘도 성분들에 대한 평균 값일 수 있다. 같은 조건에 따라 현재 블록의 휘도 블록의 평균 값도 다운 샘플링 된 휘도 블록들에 대한 평균 값일 수 있다. 또한, 색차 포맷, 휘도 성분 대 색차 성분 사이의 비율에 따라 휘도 템플릿과 휘도 블록의 평균값은 다운 샘플링되기 전의 휘도 템플릿과 휘도 블록에 대한 평균 값일 수 있다.
또 다른 구체적인 실시 예에서 현재 블록의 크기에 따라 휘도 템플릿과 현재 블록 내의 복원된 휘도 블록 간의 평균값을 계산하기 위한 가중치가 달라질 수 있다. 구체적으로 인코더 및 디코더는 현재 블록의 크기가 미리 지정된 크기보다 같거나 작은 경우, 휘도 템플릿의 픽셀값에는 제1 가중치를 곱하고 현재 블록 내의 복원된 휘도 블록의 픽셀값에는 제2 가중치를 곱하여 평균값을 계산할 수 있다. 계산된 평균값은 MMLM 방법에서 2개의 모델을 구분하기 위한 임계치로 사용할 수 있다. 이때, 미리 지정된 크기는 현재 블록의 가로의 크기 및 세로의 크기에 따라 다르게 결정될 수 있다. 구체적인 실시 예에서 미리 지정된 크기는 현재 블록의 가로의 크기와 세로의 크기의 합일 수 있다. 예컨대, 미리 지정된 크기는 12일 수 있다. 또한, 제1 가중치와 제2 가중치는 정수일 수 있다. 제1 가중치보다 제2 가중치를 크게 설정될 수 있다. 또 다른 구체적인 실시 예에서 제1 가중치보다 제2 가중치를 작게 설정될 수 있다. 예컨대, 제1 가중치는 1로 설정되고, 제2 가중치는 4로 설정될 수 있다. 또한, 가중치에 따라 평균값 계산도 달라질 수 있다. 제2 가중치가 4일 경우, 평균값 계산 시, 현재 블록의 크기를 4배로 간주하여 평균값이 계산될 수 있다. 이를 통해 평균값 계산 시, 현재 블록의 크기가 작아도 현재 블록의 비중을 늘릴 수 있다.
또 다른 구체적인 실시 예에서 2개 선형 모델로 구분하기 위해서 휘도 템플릿의 평균값 대신에 색차 템플릿의 평균값이 사용될 수 있다. 이때, 2개의 색차 성분마다 각각의 색차 템플릿의 평균값이 사용될 수 있다. 또한, 각 색차 성분마다 2개의 선형 모델이 유도될 수 있다. 이때, 인코더 및 디코더는 현재 복원된 휘도 블록에 2개 선형 모델을 적용하기 위한 임계치는 색차 템플릿의 평균값을 사용하여 2개로 분류된 휘도 템플릿의 샘플들의 평균값을 사용할 수 있다. 구체적으로 인코더 및 디코더는 휘도 템플릿에 대한 2개의 휘도 평균값의 평균값을 사용하여 현재 복원된 휘도 블록의 샘플에 어떠한 선형 모델을 적용할 지 선택할 수 있다.
또 다른 구체적인 실시 예에서 인코더는 2개의 선형 모델을 구분하기 위한 임계치를 지시하는 정보를 비트스트림에 포함시킬 수 있다. 디코더는 2개의 선형 모델을 구분하기 위한 임계치를 지시하는 정보를 비스트림으로부터 파싱하고, 파싱한 2개 선형 모델을 구분하기 위한 임계치를 지시하는 정보를 기초로 2개 선형 모델을 구분할 수 있다. 이때, 2개의 선형 모델을 구분하기 위한 임계치를 지시하는 정보는 미리 지정된 값들 중 어느 하나를 지시하는 인덱스일 수 있다. 미리 지정된 값들은 주변 블록에서 사용된 임계치를 포함할 수 있다. 또 다른 구체적인 실시 예에서 선형 모델을 구분하기 위한 임계치를 지시하는 정보는 임계치 값일 수 있다. 선형 모델을 구분하기 위한 임계치를 지시하는 정보는 블록 단위로 비트스트림에 포함될 수 있다. 또한, 인코더는 선형 모델을 구분하기 위한 임계치를 지시하는 정보가 임계치 값을 직접적으로 지시하는지 또는 미리 지정된 후보 중 어느 하나를 지시하는지 나타내는 플래그를 비트스트림에 포함시킬 수 있다. 디코더는 해당 플래그를 비트스트림으로부터 파싱하고, 파싱한 플래그를 기초로 선형 모델을 구분하기 위한 임계치를 획득할 수 있다. 또한, 미리 지정된 값들의 개수는 미리 지정될 수 있다. 또한, 미리 지정된 값들은 FIFO에 따라 관리될 수 있다. 따라서 미리 지정된 값들에 어느 하나가 추가될 때 미리 지정된 값들 중 어느 하나가 제외될 수 있다.
인코더 및 디코더는 선형 모델의 개수는 다음의 실시 예들에 따라 유도할 수 있다.
구체적인 실시 예에서 현재 휘도 블록에 대한 예측 샘플을 구성하는데 사용된 참조 라인 인덱스의 값이 1보다 큰 경우, 인코더 및 디코더는 1개의 선형 모델만을 사용할 수 있다. 또 다른 구체적인 실시 예에서 참조 라인 인덱스의 값이 1보다 큰 경우, 인코더 및 디코더는 2개의 선형 모델을 사용할 수 있다. 이는 현재 휘도 블록에 대한 예측 샘플을 구성하는데 사용된 참조 라인 인덱스의 값이 1보다 큰 경우 선형적으로 변화하는 블록일 가능성이 높기 때문이다.
또 다른 구체적인 실시 예에서 현재 휘도 블록에 대한 예측 샘플을 구성하는데 사용한 참조 라인 인덱스의 값이 0인 경우, 디코더는 1개 선형 모델만을 사용하여 색차 블록을 예측할 수 있다. 이는 참조 라인 인덱스의 값이 0인 경우, 현재 블록에 인접한 샘플들이 사용된 것으로 판단할 수 있기 때문이다. 이때, 인코더는 CCLM 및 MMLM과 관련된 신택스를 비트스트림에 포함시키지 않을 수 있다. 또한, 디코더는 참조 라인 인덱스에 따라 CCLM 및 MMLM과 관련된 신택스의 파싱 여부를 결정할 수 있다. 참조 라인 인덱스가 0인 경우, 디코더는 CCLM 및 MMLM과 관련된 신택스를 파싱하지 않을 수 있다. 이때, 디코더는 현재 블록에 적용되는 CCLM 모드를 1개의 선형 모델만이 사용되는 CCLM 모드로 추론할 수 있다.
또 다른 구체적인 실시 예에서 인코더 및 디코더는 현재 블록의 가로 혹은 세로 크기에 따라 선형 모델의 개수를 결정할 수 있다. 구체적으로 현재 블록의 가로 또는 세로의 크기가 미리 지정된 값 이내인 경우, 1개의 선형 모델만 사용될 수 있다. 또 다른 구체적인 실시 예에서 현재 블록의 가로 또는 세로의 크기가 미리 지정된 값 이상인 경우, 1개의 선형 모델만 사용될 수 있다. 이러한 실시 예들에서 미리 지정된 값은 1이상의 정수일 수 있다.
또 다른 구체적인 실시 예에서 현재 블록의 크기가 미리 지정된 크기 이상일 경우, 인코더 및 디코더는 현재 블록을 서브 블록으로 분할하고, 분할된 서브 블록 마다 각각의 선형 모델을 사용할 수 있다. 이때, 인코더 및 디코더는 서브 블록의 선형 모델을 유도하기 위한 템플릿에 해당 서브 블록을 기준으로 가장 가깝게 위치한 주변 블록의 복원된 샘플을 사용할 수 있다. 예컨대 도 9에서 현재 블록이 4개의 서브 블록으로 분할 될 수 있다. 이때, 인코더 및 디코더는 첫 번째 서브 블록에 좌측 및 상단 템플릿을 모두 사용할 수 있다. 또한, 인코더 및 디코더는 두 번째 서브 블록에 상단 템플릿만 사용할 수 있다. 또한, 인코더 및 디코더는 세 번째 서브 블록에 좌측 템플릿만 사용할 수 있다. 또한, 인코더 및 디코더는 네 번째 템플릿에 두 번째 서브 블록의 상단 템플릿과 세 번째 서브 블록의 좌측 템플릿을 모두 사용하여 선형 모델을 유도할 수 있다. 이때, 서브 블록마다 적어도 하나 이상의 선형 모델이 유도될 수 있다.
또 다른 구체적인 실시 예에서 인코더 및 디코더는 현재 휘도 블록의 인트라 예측 모드, 현재 휘도 블록의 잔여 블록의 계수 분포, 현재 블록의 양자화 파라미터, 및 주변 블록의 CCLM 또는 MMLM의 사용 여부 중 적어도 하나 이상을 사용하여 현재 블록의 선형 모델 개수를 결정할 수 있다. 구체적으로 주변 블록 중에서 MMLM이 사용된 블록이 하나 이상 존재할 경우, 인코더 및 디코더는 현재 블록에 MMLM을 적용할 수 있다. 모든 주변 블록에 CCLM이 사용되었다면, 인코더 및 디코더는 현재 블록에 CCLM을 적용할 수 있다.
또 다른 구체적인 실시 예에서 인코더 및 디코더는 MMLM이 사용된 것으로 시그널링된 현재 블록에 2개의 선형 모델을 획득할 수 있다. 이때, 2개의 선형 모델의 파라미터 값 사이의 유사성을 사용하여, 현재 블록에 대한 모드를 CCLM으로 재설정하고 1개의 선형 모델을 사용할 수 있다. 이때, 인코더 및 디코더가 2개의 선형 모델의 파라미터 값 사이의 유사성을 판단할 때, 인코더 및 디코더는 수학식 6에서 a1과 a2간의 유사성, b1, b2간의 유사성 중 적어도 하나 이상을 사용할 수 있다. 이때, 두 값의 절대값 사이의 차이가 미리 지정된 값 이내인 경우, 인코더 및 디코더는 2개의 선형 모델의 파라미터 값이 유사하다고 판단할 수 있다. 미리 지정된 값은 1이상의 정수일 수 있다. 또한, 색차 성분은 2개가 존재하므로, 2개의 색차 성분마다 선형 모델의 개수가 달라질 수 있다.
도 11은 본 발명의 실시 예에 따라 선형 모델의 부호화 모드에 대한 신택스를 구성하는 방법을 보여준다.
일반적으로 2개의 색차 성분(Cb, Cr)에 대한 인트라 예측 방향성 모드는 동일한 모드가 적용된다. 따라서 2개의 색차 성분에 동일한 개수의 선형 모델이 적용될 수 있다. 또 다른 구체적인 실시 예에서 부호화 효율을 높이기 위해서 각 색차 성분마다 인트라 예측 모드가 각각 시그널링 될 수 있다. 2개의 색차 성분 별로 선형 모델의 개수가 결정될 수 있다. 구체적으로 색차 성분 Cb에는 수평 방향의 인트라 예측 모드가 적용되고, 색차 성분 Cr에는 2개의 선형 모델을 사용한 예측 모드가 적용될 수 있다. 또 다른 구체적인 실시 일 예에서 2개의 색차 성분에 LM모드, CCLM 또는 MMLM를 적용할지에 대한 정보가 먼저 시그널링된 후, 각각의 색차 성분마다 CCLM 또는 MMLM 중 어느 것이 적용될지에 대한 정보가 추가로 시그널링될 수 있다. 또 다른 구체적인 실시 예에서 2개 색차 성분 모두 MMLM을 적용할지가 시그널링된 후, 각 색차 성분마다 유도된 2개의 선형 모델의 유사성이 판단될 수 있다. 이때, 디코더는 CCLM 또는 MMLM을 적용할 지 암묵적으로 결정할 수 있다. 이러한 실시 예에서 각 색차 성분에 대한 추가적인 정보가 시그널링되지 않으므로, 비트량이 감소될 수 있다.
TIMD 부호화 모드의 경우, 휘도 예측 블록을 생성하는 데 2개의 인트라 예측 방향성 모드가 사용된다. 이러한 TIMD 부호화 모드는 방향성 특성이 명확하게 존재하지 않는 블록에 유용하게 적용될 수 있다. 구체적으로 현재 블록에 TIMD 모드가 적용되면, 인코더 및 디코더는 현재 블록의 색차 블록의 인트라 예측 모드를 CCLM 또는 MMLM 모드로 암묵적으로 설정할 수 있다. 구체적으로 인코더 및 디코더는 현재 블록의 부호화 모드에 따라 현재 색차 블록에 CCP 모드를 적용할 지 결정할 수 있다. 이때, CCLM이 사용될 지 및 MMLM이 사용될 지에 대한 정보가 시그널링 될 수 있다. 또한, CCLM이 사용될 지 또는 MMLM이 사용될 지에 대한 정보는 각 색차 성분마다 시그널링 되어 비트스트림에 포함될 수 있다. 현재 블록이 TIMD 모드일 경우, 디코더는 색차 성분에 대한 해당 정보를 파싱하고, 파싱한 정보에 따라 CCLM 또는 MMLM을 적용할지 결정할 수 있다. 또 다른 구체적인 실시 예에서 색차 성분에 대한 시그널링 없이, 디코더는 MMLM이 적용된 것으로 설정한 후, 앞서 설명한 선형 모델 개수 유도 방안에 따라 MMLM이 아닌 CCLM을 적용할 지 판단할 수 있다. 또한, TIMD 모드로 부호화된 블록뿐만아니라 MIP 및 DIMD 모드로 부호화된 블록에서도 색차 신호에 대한 모드를 CCLM 또는 MMLM을 사용하는 것으로 암묵적으로 판단할 수 있다.
인코더 및 디코더가 TIMD 및 DIMD 부호화 모드를 사용하는 경우, 2개의 인트라 예측 방향성 모드를 사용하여 예측 블록을 각각 생성하고, 각 예측 블록들을 가중 평균하여 최종 예측 블록을 생성한다. 인코더 및 디코더는 최종 예측 블록에 잔여 블록을 더해 복원된 휘도 블록을 획득한다. 이후 색차 블록에 대하여 복원된 휘도 블록을 사용하여 CCLM 혹은 MMLM을 수행하므로, 처리 단계가 많아져 처리 속도가 낮아질 수 있다. 따라서 인코더 및 디코더는 CCLM 혹은 MMLM을 위한 휘도 블록으로 복원된 휘도 블록을 사용하지 않고, 최종 예측된 휘도 블록을 사용할 수 있다. 이러한 실시 예를 통해 처리 속도를 향상시킬 수 있다. 또한, 최종 예측된 휘도 블록은 복원된 휘도 블록에 비해 정확도가 낮을 수 있다. 따라서 인코더는 어떤 단계의 휘도 블록이 CCLM 또는 MMLM에 사용할 지에 대한 정보를 비트스트림에 포함시킬 수 있다. 디코더는 해당 정보를 파싱하고, 파싱된 정보를 기초로 CCLM 또는 MMLM 수행 시 참조할 휘도 블록이 최종 예측된 휘도 블록인지 또는 복원된 휘도 블록인지 판단할 수 있다.
색차 블록에 대한 인트라 예측 방향성 모드는 크게 DM(Derived Mode), EM(Explicit Mode), LM(Linear Model)로 구분될 수 있다. DM 모드는 휘도 블록의 인트라 예측 방향성 모드를 색차 블록의 인트라 예측 방향성 모드로 사용하는 모드이다. DM(Derived Mode) 모드는 Direct Mode(DM)로도 지칭될 수 있다. EM 모드는 색차 블록의 인트라 예측 방향성 모드를 평면(Planar), DC, 수평, 수직 방향 모드 중 어느 하나로 지정하는 모드로, 휘도 블록의 인트라 예측 방향성 모드와 동일하지 않게 적용된다. EM 모드는 논-다이렉트 모드(Non-direct Mode)로도 지칭될 수 있다. LM 모드는 복원된 휘도 블록과 선형 모델을 통해 색차 블록이 예측되는 모드로, 기존의 각도 모드 및 비각도 모드(Planar, DC)와는 다른 특징을 가진다.
이러한 색차 블록에 대한 인트라 예측 방향성 모드가 시그널링될 때, 현재 블록에 LM 모드의 적용 여부가 인트라 예측 방향성 모드보다 먼저 시그널링될 수 있다. 현재 블록에 LM 모드가 적용되지 않는 경우, DM 모드 또는 EM 모드에 대한 정보가 시그널링될 수 있다. 현재 블록에 LM 모드가 적용될 경우, CCLM 적용 여부 또는 MMLM 적용 여부에 대한 정보와 선형 모델을 구하기 위한 템플릿에 사용되는 샘플의 위치에 대한 정보가 시그널링될 수 있다. 구체적으로 다음과 같은 실시 예들에 따라 시그널링될 수 있다.
구체적인 실시 예에서 도 11의 (a)와 같은 시그널링 방법이 사용될 수 있다. 인코더 및 디코더는 lm_flag를 파싱한다. lm_flag의 값이 0인 경우, 인코더 및 디코더는 현재 블록에 LM 모드가 사용하지 않는 것으로 판단할 수 있다. 이때, 인코더 및 디코더는 비트스트림에서 EM 및 DM 모드에 대한 정보를 파싱한다. lm_flag 값이 1인 경우, 인코더 및 디코더는 현재 블록에 LM 모드를 사용하는 것으로 판단한다. 이때, 인코더 및 디코더는 mmlm_flag를 파싱한다. mmlm_flag 값이 1인 경우, 인코더 및 디코더는 현재 블록에 MMLM이 적용되는 것으로 판단한다. 또한, 인코더 및 디코더는 MMLM에서 어느 템플릿을 사용할지에 대한 정보인 template_idx를 파싱한다. template_idx의 이진 코드워드가 '1'인 경우, 인코더 및 디코더는 좌측 템플릿과 상단 템플릿을 모두 사용하여 선형 모델을 유도한다. template_idx의 이진 코드워드가 '00'인 경우, 인코더 및 디코더는 좌측 템플릿만을 사용하여 선형 모델을 유도한다. template_idx의 이진 코드워드가 '01'인 경우, 인코더 및 디코더는 상단 템플릿만을 사용하여 선형 모델을 유도한다. mmlm_flag 값이 0인 경우, 인코더 및 디코더는 현재 블록에 CCLM이 적용되는 것으로 판단한다. 이때, 인코더 및 디코더는 CCLM에 어느 템플릿이 사용될지 지시하는 template_idx를 파싱하고, 앞서 설명한 동작과 같이 어느 CCLM에 어느 템플릿이 적용되는지 판단한다.
MMLM, MM-CCCM과 같은 다중 CCP 모델이 적용되는 경우, 인코더 및 디코더는 2개 이상의 선형 모델을 유도해야 한다. 많은 개수의 샘플이 필요할 수 있고, 좌측과 상단 템플릿을 모두 사용하는 것이 효과적일 수 있다. 따라서, 도11의 (a)의 시그널링 방법은 다음과 같이 변경될 수 있다. 인코더 및 디코더는 lm_flag를 파싱한다. lm_flag의 값이 0인 경우, 인코더 및 디코더는 현재 블록에 LM 모드가 적용되지 않는 것으로 판단한다. 이때, 인코더 및 디코더는 EM 및 DM 모드에 대한 정보를 파싱한다. lm_flag의 값이 1인 경우, 인코더 및 디코더는 현재 블록에 LM 모드가 적용되는 것으로 판단하고, mmlm_flag를 파싱한다. mmlm_flag의 값이 1인 경우, 인코더 및 디코더는 현재 블록에 MMLM이 적용되는 것으로 판단한다. 이때, 인코더 및 디코더는 좌측 템플릿과 상단 템플릿이 모두 사용되는 것으로 추론할 수 있다. 구체적으로 인코더 및 디코더는 template_idx를 파싱하지 않고 1로 추론(infer)할 수 있다. MMLM이 적용될 경우, 좌측 템플릿과 상단 템플릿을 모두 사용되는 것이 효과적일 수 있기 때문이다.
mmlm_flag 값이 0인 경우, 인코더 및 디코더는 현재 블록에 CCLM이 적용되는 것으로 판단할 수 있다. 이때, 인코더 및 디코더는 CCLM에 어느 템플릿을 사용할지 지시하는 template_idx를 파싱한다. Template_idx 의 이진 코드워드가 '1'이면, 좌측과 상단 템플릿을 모두 사용하여 선형 모델을 유도한다. template_idx의 이진 코드워드가 '00'인 경우, 인코더 및 디코더는 좌측 템플릿만을 사용하여 선형 모델을 유도한다. template_idx의 이진 코드워드가 '01'인 경우, 인코더 및 디코더는 상단 템플릿만을 사용하여 선형 모델을 유도한다. mmlm_flag의 값이 1일 때, 인코더 및 디코더는 현재 휘도 블록의 인트라 예측 모드, 부호화 블록 크기, 잔여 블록의 특성, 양자화 파라미터, 주변 블록의 CCLM 및 MMLM 적용 여부, 및 참조 라인 인덱스 중 적어도 어느 하나 이상을 사용하여 template_idx에 대한 파싱 여부를 결정할 수 있다. 인코더 및 디코더가 template_idx를 파싱하지 않는 경우, 인코더 및 디코더는 template_idx의 값을 미리 지정된 값으로 추론할 수 있다. 예컨대, 현재 블록의 크기가 미리 지정된 크기 이내인 경우, 인코더 및 디코더는 template_idx를 파싱하지 않을 수 있다. 이때, 인코더 및 디코더는 template_idx의 값을 1로 추론할 수 있다. 미리 지정된 크기는 1이상의 정수 일 수 있다.
또 다른 구체적인 실시 예에서 도11의 (b)와 같은 시그널링 방법이 사용될 수 있다. 인코더 및 디코더는 lm_flag를 파싱한다. lm_flag의 값이 '0인 경우, 인코더 및 디코더는 현재 블록에 LM 모드가 적용되지 않는 것으로 판단한다. 이때, 인코더 및 디코더는 EM 및 DM 모드에 대한 정보를 파싱한다. lm_flag의 값이 1인 경우, 인코더 및 디코더는 현재 블록에 LM 모드가 적용되는 것으로 판단한다. 이때, 인코더 및 디코더는 어느 템플릿을 사용할지에 대한 정보인 template_idx를 파싱한다. template_idx의 이진 코드워드가 '1'인 경우, 인코더 및 디코더는 좌측 템플릿과 상단 템플릿을 모두 사용하여 선형 모델을 유도한다. template_idx의 이진 코드워드가 '00'인 경우, 인코더 및 디코더는 좌측 템플릿만을 사용하여 선형 모델을 유도한다. template_idx의 이진 코드워드가 '01'이면, 인코더 및 디코더는 상단 템플릿만을 사용하여 선형 모델을 유도한다. 이때, 인코더 및 디코더는 CCLM 또는 MMLM 중 어느 모델을 사용할지를 앞서 설명한 2개의 선형 모델의 파라미터의 유사성을 판단 방법에 따라 판단할 수 있다.
도 12 및 도 13은 본 발명의 실시 예에 따라 mmlm_flag 문맥 모델에 대한 확률 초기화 정보를 보여준다.
인코더는 mmlm_flag와 template_idx를 CABAC(Context adaptive binary arithmetic coding)을 사용하여 엔트로피 코딩할 수 있다. mmlm_flag와 template_idx에 대한 문맥 모델은 실험을 통해 획득한 값으로 지정될 수 있다. 도 12의 (a)와 도 13의 (a)의 initValue는 mmlm_flag와 template_idx에 대한 문맥 모델을 나타낸다. 또한, shiftIdx는 mmlm_flag와 template_idx에 대한 확률 업데이트시 사용된다. initValue는 현재 슬라이스의 타입이 I 슬라이스, P 슬라이스, B 슬라이스 인지에 따라 결정된다. 도 12의 (b)와 도13의 (b)는 각 슬라이스 타입에 따라 사용될 수 있는 문맥 모델을 나타낸다. 현재 슬라이스의 타입이 I 슬라이스일 경우, initType의 값은 0 내지 2 중 하나로 설정될 수 있다. 현재 슬라이스의 타입이 P 슬라이스일 경우, initType의 값은 3 내지 5 중 하나로 설정될 수 있다. 현재 슬라이스의 타입이 B 슬라이스일 경우, initType의 값은 6 내지 8 중 하나로 설정될 수 있다.
각 슬라이스 타입마다 사용되는 initType의 값은 적어도 하나 이상일 수 있다. initType의 값이 슬라이스마다 하나만 정의될 경우, 현재 슬라이스의 타입이 I 슬라이스일 경우, initType의 값은 0이고, 0에 대응되는 mmlm_flag에 대한 initValue의 값은 20이고, 0에 대응되는 template_idx에 대한 initValue의 값은 17일 수 있다. 또한, 현재 슬라이스의 타입이 P 슬라이스일 경우, initType의 값은 3이고, 3에 대응되는 mmlm_flag에 대한 initValue의 값은 35이고, 3에 대응되는 template_idx에 대한 initValue의 값은 0일 수 있다. 현재 슬라이스의 타입이 B 슬라이스일 경우, initType의 값은 6이고, 6에 대응되는 mmlm_flag에 대한 initValue의 값은 38이고, 6에 대응되는 template_idx에 대한 initValue의 값은 0일 수 있다.
또한, 슬라이스 타입에 따른 initType의 값은 슬라이스마다 결정될 수 있다. 구체적인 실시 예에서 슬라이스 헤더에 정의된 sh_cabac_init_flag의 값에 따라 initType의 값의 사용 순서가 결정될 수 있다. sh_cabac_init_flag의 값이 1이고, 현재 슬라이스의 타입이 P 슬라이스일 경우, initType의 값은 6일 수 있다. 또한, sh_cabac_init_flag의 값이 1이고, 현재 슬라이스의 타입이 B 슬라이스일 경우, initType의 값은 3일 수 있다. sh_cabac_init_flag의 값이 0이고, 현재 슬라이스의 타입이 P 슬라이스일 경우, initType의 값은 3일 수 있다. sh_cabac_init_flag의 값이 0이고, 현재 슬라이스의 타입이 B 슬라이스일 경우, initType의 값은 6일 수 있다.
현재 코딩하거나 혹은 파싱할 mmlm_flag 심볼은 현재 휘도 블록의 인트라 예측 모드, 부호화 블록의 형태, 양자화 파라미터, 주변 블록의 CCLM 또는 MMLM 사용 여부, 잔여 블록의 특성, 움직임 정보 차분값, 및 참조 라인 인덱스 중 적어도 하나 이상을 기초로 복수의 문맥 모델 중 하나가 선택될 수 있다. 이때, 부호화 블록의 형태는 부호화 블록의 가로 또는 세로 크기, 부호화 블록의 가로와 세로 비율, 및 부호화 블록의 가로와 세로의 차이 중 적어도 어느 하나를 포함할 수 있다.
또한, 잔여 블록의 특성은 휘도 블록의 잔여 신호 존재 여부 및 마지막 변환 계수의 위치 중 적어도 어느 하나를 포함할 있다. 구체적으로 다음과 같은 실시 예들에 따라 문맥 모델이 선택될 수 있다.
현재 블록의 주변 블록의 mmlm_flag의 값을 기초로 mmlm_flag의 문맥 모델이 선택될 수 있다. 구체적으로 현재 블록에 인접한 좌측 주변 블록의 mmlm_flag의 값과 현재 블록에 인접한 상측 주변 블록의 mmlm_flag의 값의 합을 기초로 mmlm_flag의 문맥 모델이 지시하는 문맥 인덱스가 결정될 수 있다. 이때, 문맥 인덱스의 값은 0 내지 2 중 어느 하나일 수 있다. 주변 블록이 사용 불가능한 위치하는 경우, 앞서 설명한 mmlm_flag 합의 연산에서 0이 더해질 수 있다.
또 다른 구체적인 실시 예에서 현재 블록의 크기에 따라 mmlm_flag의 문맥 모델이 선택될 수 있다. 구체적으로 현재 블록의 크기가 미리 지정된 제1 값보다 큰 경우, 문맥 인덱스의 값은 2일 수 있다. 또한, 현재 블록의 크기가 미리 지정된 제2 값보다 작은 경우, 문맥 인덱스의 값은 0일 수 있다. 이외의 경우, 문맥 인덱스의 값은 1일 수 있다. 이때, 미리 지정된 제1 값은 32x32일 수 있다. 또한, 미리 지정된 제2 값은 16x16일 수 있다. 또 다른 구체적인 실시 예에서 미리 지정된 제1 값과 미리 지정된 제2 값은 현재 블록의 가로 크기 및 세로 크기의 합을 기초로 결정될 수 있다.
또 다른 구체적인 실시 예에서 현재 블록의 가로의 크기와 세로의 크기의 차이를 기초로 mmlm_flag의 문맥이 선택될 수 있다. 구체적으로 현재 블록의 가로의 크기와 세로의 크기가 동일할 경우, mmlm_flag의 문맥 인덱스는 0일 수 있다. 가로보다 세로의 크기가 큰 경우, 문맥 인덱스는 1일 수 있다. 가로보다 세로의 크기가 작은 경우, mmlm_flag의 문맥 인덱스는 2일 수 있다.
또 다른 구체적인 실시 예에서 mmlm_flag를 문맥 모델을 통해 이진 산술 부호화하지 않고, 고정된 확률 구간을 사용하는 바이패스(bypass) 형태의 이진 산술 부호화가 수행될 수 있다.
또 다른 구체적인 실시 예에서 하나의 문맥 모델만을 사용하여 mmlm_flag를 이진 산술 부호화할 수 있다. 이러한 실시 예에서 문맥 모델 인덱스이 유도되지 않고, 고정된 문맥 모델이 슬라이스의 모든 블록에 사용될 수 있다. 슬라이스 타입별로 각각 하나의 문맥 모델만을 가지기 때문이다.
현재 코딩하거나 혹은 파싱할 template_idx의 심볼은 현재 휘도 블록의 인트라 예측 모드, 부호화 블록의 형태, 양자화 파라미터, 주변 블록의 CCLM 또는 MMLM 사용 여부, 잔여 블록의 특성, 움직임 정보 차분값, 및 참조 라인 인덱스 중 적어도 하나 이상을 기초로 복수의 문맥 모델 중 하나가 선택될 수 있다. 이때, 부호화 블록의 형태는 부호화 블록의 가로 또는 세로 크기, 부호화 블록의 가로와 세로 비율, 및 부호화 블록의 가로와 세로의 차이 중 적어도 어느 하나를 포함할 수 있다. 또한, 잔여 블록의 특성은 휘도 블록의 잔여 신호 존재 여부 및 마지막 변환 계수의 위치 중 적어도 어느 하나를 포함할 있다. 이러한 실시 예들에서 template_idx는 2개의 빈(bin)으로 구성되고, 첫 번째 빈에 대해 문맥 모델 기법이 적용되고, 두 번째 빈에 대해 바이패스(bypass) 형태의 이진 산술 부호화가 수행되거나 또는 고정된 문맥 모델이 사용될 수 있다.
또 다른 구체적인 실시 예에서 현재 블록의 크기에 따라 template_idx의 문맥 모델이 선택될 수 있다. 구체적으로 현재 블록의 크기가 미리 지정된 제1 값보다 큰 경우, 문맥 인덱스의 값은 2일 수 있다. 또한, 현재 블록의 크기가 미리 지정된 제2 값보다 작은 경우, 문맥 인덱스의 값은 0일 수 있다. 이외의 경우, 문맥 인덱스의 값은 1일 수 있다. 이때, 미리 지정된 제1 값은 32x32일 수 있다. 또한, 미리 지정된 제2 값은 16x16일 수 있다. 또 다른 구체적인 실시 예에서 미리 지정된 제1 값과 미리 지정된 제2 값은 현재 블록의 가로 크기 및 세로 크기의 합을 기초로 결정될 수 있다.
또 다른 구체적인 실시 예에서 현재 블록의 가로의 크기와 세로의 크기의 차이를 기초로 template_idx의 문맥이 선택될 수 있다. 구체적으로 현재 블록의 가로의 크기와 세로의 크기가 동일할 경우, template_idx의 문맥 인덱스는 0일 수 있다. 가로보다 세로의 크기가 큰 경우, 문맥 인덱스는 1일 수 있다. 가로보다 세로의 크기가 작은 경우, template_idx의 문맥 인덱스는 2일 수 있다.
또 다른 구체적인 실시 예에서 template_idx를 문맥 모델을 통해 이진 산술 부호화하지 않고, 고정된 확률 구간을 사용하는 바이패스(bypass) 형태의 이진 산술 부호화가 수행될 수 있다.
또 다른 구체적인 실시 예에서 하나의 문맥 모델만을 사용하여 template_idx를 이진 산술 부호화할 수 있다. 이러한 실시 예에서 문맥 모델 인덱스이 유도되지 않고, 고정된 문맥 모델이 슬라이스의 모든 블록에 사용될 수 있다. 슬라이스 타입별로 각각 하나의 문맥 모델만을 가지기 때문이다.
도 14는 본 발명의 실시 예에 따라 주변 블록의 움직임 정보를 사용하여 현재 블록에 대한 인트라 예측 모드를 유도하는 방안을 보여준다.
LM 부호화 방법은 복원된 휘도 블록과 선형 모델을 사용하므로, 인트라 부호화된 블록이나 인터 부호화된 블록의 색차 블록에 사용될 수 있다. 인터 부호화 모드는 주변 블록과의 의존성이 낮으므로 처리 속도가 높아질 수 있다. LM 부호화 방법은 주변 블록의 의존성이 크므로 처리 속도가 낮아질 수 있다. LM 부호화 방법을 인터 부호화 모드에 적용하는 경우, 처리 속도가 낮은 부호화 방법(GPM, Affine, sbTMVP, BCW, PROF, BDOF, TM, MP-DMVR, OBMC, MHP, LIC)에서 적용하기 어려울 수 있다. 휘도 블록에 대한 복호화 처리 속도가 상대적으로 높은 부호화 모드인 Merge, MergeSkip, MMVD, AMVP, SMVD, CIIP로 부호화된 색차 블록에만 LM 부호화 방법이 적용될 수 있다. 구체적으로 인코더 및 디코더는 현재 블록의 부호화 모드에 따라 색차 블록에 LM 부호화 방법을 허용할 지를 결정할 수 있다. 이때, 비트스트림은 현재 블록의 부호화 모드에 따라 색차 블록에 LM 부호화 방법을 적용할지에 대한 정보를 포함할 수 있다. 디코더는 현재 블록의 부호화 모드에 따라 해당 정보를 파싱하여 현재 인터 부호화 모드로 부호화된 블록의 색차 블록에 LM 부호화 방법의 적용 여부를 결정할 수 있다.
블록을 예측하는 방법은 크게 공간적인 상관성을 이용한 인트라 예측 방법과 시간적인 상관성을 이용한 인터 예측 방법으로 나뉜다. 현재 블록이 인트라 예측에 의해 예측되는 블록인 경우, 인코더 및 디코더는은 인트라 예측과 관련된 정보를 포함(저장)하고, 인터 예측 정보는 저장하지 않는다. 여기서, 인코더 및 디코더가 정보를 저장한다는 의미는 인코더 및 디코더의 메모리 내에 정보를 쓰는(write) 것을 의미하며, 정보를 불러오는 것은 메모리에 저장된 정보를 읽는(read) 것을 의미한다. 반대로, 현재 블록이 인터 예측에 의해 예측되는 블록인 경우, 인코더 및 디코더는 인터 예측과 관련된 정보를 저장하고, 인트라 예측 정보를 저장하지 않는다. 현재 블록의 부호화 정보는 주변 블록의 부호화된 정보를 통해서 예측될 수 있다. 예를 들어 현재 블록이 인트라 예측에 의해 예측될 경우, 인코더 및 디코더는 주변 블록의 인트라 예측 정보를 기초로 현재 블록에 대한 예측을 수행할 수 있다. 주변 블록이 모두 인터 예측에 의해 예측된 블록인 경우, 인코더 및 디코더가 현재 블록을 인트라 예측을 사용하여 예측할 때 예측의 효율이 낮아질 수 있다. 이를 보완하기 위해, 인코더 및 디코더는 인터 예측이 수행된 블록에 대한 인트라 예측 정보를 저장할 수 있다. 이를 통해 다음에 복원될 블록의 인트라 예측 효율을 높일 수 있다. 인터 예측이 수행된 블록에서 인트라 예측 정보를 유도하는 방법은 현재 블록이 참조 블록의 영상 특성과 유사할 가능성이 높기 때문이다. 구체적으로 인코더 및 디코더는 참조 블록의 인트라 예측 정보를 현재 블록에 대한 인트라 예측 정보로 저장할 수 있다.
도 14는 현재 블록 주변에 다양한 크기의 주변 블록이 존재할 경우, 해당 주변 블록에서 인트라 예측 모드를 유도하는 방법을 보여준다. 인코더 및 디코더가 현재 블록을 인트라 예측을 사용하여 부호화할 경우, 주변 블록의 인트라 예측 모드를 사용하여 MPM 리스트를 구성한 후, 인코더 및 디코더는 MPM 리스트를 이용하여 현재 블록에 대한 인트라 예측 모드를 부호화한다. 이때, 주변 블록의 인트라 예측 모드를 유도할 때, 주변 블록이 인터 예측을 수행한 블록일 경우, 인코더 및 디코더는 주변 블록의 움직임 정보를 사용하여 참조 픽쳐로 부터 인트라 예측 모드를 유도할 수 있다. 이때, 인코더 및 디코더는 참조 픽쳐에서 주변 블록의 좌상단 픽셀 위치에 대응되는 위치를 기준으로 주변 블록의 움직임 정보만큼 이동한 위치에 저장된 인트라 예측 모드를 사용할 수 있다. 도 14에서 Ne-A2/A3 주변 블록의 경우, 인코더 및 디코더는 참조 픽쳐의 M4 또는 O5에 저장된 인트라 예측 모드를 사용할 수 있다.
현재 블록의 인트라 예측 모드는 주변 블록의 인트라 예측 모드와 유사할 수 있다. 주변 블록의 인트라 예측 모드를 유도하기 위해 사용되는 위치는 현재 블록과 가까울수록 인트라 예측 모드의 정확도가 더욱 높아질 수 있다. 따라서 인코더 및 디코더는 주변 블록의 인트라 예측 모드를 유도하기 위해 사용되는 위치를 현재 블록과 가까운 위치로 재설정할 수 있다. 도 14에서 인코더 및 디코더가 Ne-L3에 대한 인트라 예측 모드를 유도할 때, 인코더 및 디코더는 H16 또는 I17이 아닌 현재 블록과 가까운 위치의 J16 또는 J17에 저장된 인트라 예측 모드를 사용할 수 있다. 또한, 인코더 및 디코더는 주변 블록의 움직임 정보를 현재 블록의 위치 기준으로 투영(projection)하여 참조 픽쳐로부터 인트라 예측 모드를 유도할 수 있다. 도 14에서 주변 블록 Ne-A2/A3에 대한 인트라 예측 모드를 유도하기 위해, 인코더 및 디코더는 참조 픽쳐에서 주변 블록 Ne-A2/A3의 좌상단 픽셀 위치에 대응되는 위치를 기준으로 주변 블록 Ne-A2/A3의 움직임 정보만큼 이동한 위치인 M4에 저장된 인트라 예측 모드를 사용하지 않을 수 있다. 이때, 인코더 및 디코더는 주변 블록 Ne-A2/A3에 대한 인트라 예측 모드를 유도하기 위해, 참조 픽쳐에서 현재 블록의 중앙 픽셀 위치에 대응되는 위치를 기준으로 주변 블록 Ne-A2/A3의 움직임 정보만큼 이동한 위치인 M10에 저장된 인트라 예측 모드를 유도하여 주변 블록 Ne-A2/A3를 위한 인트라 예측 모드로 사용할 수 있다. 인코더 및 디코더는 유도된 인트라 예측 모드를 현재 블록의 MPM 리스트를 구성하는데 추가할 수 있다. 이때, 인코더 및 디코더는 현재 블록의 중앙 픽셀의 위치가 아닌 현재 블록 내의 미리 지정된 위치를 기준으로 주변 블록의 움직임 정보만큼 이동한 위치에 저장된 인트라 예측 모드를 유도할 수 있다. 미리 지정된 위치는 현재 블록의 좌상단, 상단 중앙, 우상단, 좌측 중앙, 좌하단, 하측 중앙, 중앙, 우하단, 및 우측 중앙 중 하나 일 수 있다. 이때, 인코더 및 디코더는 여러 개의 주변 블록들의 움직임 정보로 유도된 여러 개의 인트라 예측 모드 중 적어도 하나를 사용하여 해당 서브 블록의 인트라 예측 블록을 생성할 수 있다. 인코더 및 디코더는 복수의 인트라 예측 모드 중 복수의 예측 모드 각각의 인덱스의 중앙값, 평균값, 최소값, 및 최대값 중 하나를 최적의 인트라 예측 모드로 사용할 수 있다.
앞서 설명한 실시 예들은 현재 블록의 색차 블록에 대한 LM 부호화 모드에 대한 유도에 적용될 수 있다. 구체적으로 인코더 및 디코더는 주변 블록 또는 현재 휘도 블록의 움직임 정보를 사용하여, 참조 픽쳐로부터 색차 블록에 대한 인트라 예측 모드를 유도할 수 있다. 이때, 인코더 및 디코더는 참조 픽쳐로부터 유도된 인트라 예측 모드가 LM 부호화 모드일 경우, CCLM, MMLM, CCCM, 및 GLM 중 어느 것을 사용했는지에 대한 정보, 템플릿이 좌측 샘플, 상단 샘플, 및 좌측 샘플과 상단 샘플 중 어느 것을 사용했는지, 및 필터 계수 중 적어도 하나를 참조 픽쳐로부터 획득하여 현재 색차 블록을 예측하는데 사용할 수 있다. 이를 위해 인코더 및 디코더는 참조 픽쳐에서 해당 색차 블록에 대한 LM 부호화 정보가 모두 저장할 수 있다.
CIIP는 현재 블록에 대한 인트라 예측과 인터 예측을 모두 수행한 후 예측 블록을 가중 평균하여 현재 블록을 예측하는 방법이다. CIIP 모드에서, 현재 블록에 대한 움직임 정보가 이미 포함되어 있다. 따라서 인코더 및 디코더가 참조 픽쳐로부터 인트라 예측 모드를 유도할 때, 인코더 및 디코더는 현재 블록의 움직임 정보를 사용할 수 있다. 이때, 참조 픽쳐로부터 유도된 색차 블록의 인트라 예측 모드가 CCLM, MMLM, CCCM, 또는 GLM 모드일 경우, 인코더 및 디코더는 CIIP 모드의 색차 블록을 참조 블록의 색차 부호화 모드로 예측할 수 있다. 이때, 인코더 및 디코더는 휘도 블록에 대해서만 인트라 예측과 인터 예측을 수행할 수 있다. 구체적으로 인코더 및 디코더는 인트라 예측된 블록과 인터 예측된 블록을 가중 평균하여 휘도 블록의 예측 블록을 생성하고, 참조 블록의 색차 부호화 모드만을 사용하여 색차 블록의 예측 블록을 생성할 수 있다. 이를 통해 CIIP 모드로 부호화된 블록에 대한 처리 속도를 높일 수 있다. 색차 블록에 대해서는 인터 예측이 수행되지 않기 때문이다. 또한, 인코더는 CIIP 모드로 부호화된 블록에 대하여 색차 부호화 모드와 관련된 정보를 시그널링하지 않을 수 있다. 구체적으로 현재 블록이 CIIP 모드인 경우, 인코더는 색차 부호화 모드와 관련된 정보는 비트스트림에 포함시키지 않을 수 있다. 현재 블록이 CIIP 모드인 경우, 디코더는 색차 부호화 모드와 관련된 정보를 파싱하지 않을 수 있다. 이때, 디코더는 현재 블록이 CIIP 모드인 경우, 현재 블록의 색차 부호화 모드를 CCRM 모드로 설정(또는 암시(infer))할 수 있다. 또한, 디코더는 본 명세서에서 기술한 CCRM 방법을 사용하여 색차 예측 블록을 생성할 수 있다.
선형 모델에 대한 파라미터의 유도 방법은 약속된 위치의 샘플만이 사용되므로, 샘플의 정확성에 따라 선형 모델의 정확도가 달라질 수 있다. 카메라로 촬영된 영상의 경우, 임의의 픽셀에서 잡음이 발생할 수 있다. 이러한 잡음이 발생된 위치의 샘플을 선형 모델의 파라미터 유도에 사용할 경우, 선형 모델의 정확도가 낮아질 수 있다. 이러한 문제를 해결하기 위한 실시 예들에 대해 설명한다.
도 15는 본 발명의 실시 예에 따라 재귀적 선형 모델을 이용하여 색차 블록을 예측하는 방법을 보여준다.
인코더 및 디코더는 앞서 설명한 실시 예들을 위한 템플릿을 구성하고, 템플릿 내의 픽셀 사이에 필터링을 적용할 수 있다. 이때, 인코더 및 디코더는 저주파 필터링을 수행할 수 있다. 이를 통해 템플릿 내의 잡음으로 인한 영향을 줄일 수 있다. 또 다른 구체적인 실시 예에서 인코더 및 디코더는 고주파 필터링을 수행하고, 주변 픽셀 사이의 값 차이가 임계치 이상인 픽셀을 잡음으로 판단할 수 있다. 이때, 인코더 및 디코더는 잡음으로 판단된 픽셀의 잡음을 제거할 수 있다. 구체적으로 인코더 및 디코더는 잡음으로 판단된 픽셀을 주변 픽셀 중 하나로 대체하거나 주변 픽셀들을 가중 평균한 값으로 대체할 수 있다. 이러한 실시 예들에서, 인코더 및 디코더는 템플릿의 필터링을 선택적으로 적용할 수 있다. 템플릿 필터링의 활성화 여부는 픽쳐, 슬라이스, 타일 단위로 달라질 수 있다. 구체적으로 픽쳐 단위에서 템플릿 필터링이 활성화된 경우, 슬라이스, 타일, CU, 서브 블록 단위에서 템플릿 필터링의 적용 여부가 달라질 수 있다. 인코더는 SPS 단위, PPS 단위, PH 단위, 슬라이스 단위, 또는 타일 단위 별로 템플릿의 필터링 활성화 여부 정보를 비트스트림에 포함시킬 수 있다. 또한, 인코더는 CU 단위 또는 서브 블록 단위별로 템플릿의 필터링 적용 여부 정보를 비트스트림에 포함시킬 수 있다.디코더는 SPS, PPS, PH, 슬라이스, 타일 중 어느 하나의 단위에서 템플릿 필터링의 활성화 여부 정보를 파싱할 수 있다. 디코더는 템플릿 필터링이 활성화된 경우, CU 및 서브 블록 중 어느 하나의 단위에서 필터링 적용 여부 정보를 파싱하고, 필터링 적용 여부 정보에 따라 템플릿 내의 픽셀에 필터링을 적용할지 결정할 수 있다.
인코더 및 디코더는 도 15의 실시 예에서와 같이 앞서 설명한 팀플릿 내의 픽셀에 필터링을 적용하는 실시 예들을 통해 획득한 선형 모델의 파라미터와 기존 템플릿의 샘플을 사용하여 획득한 선형 모델의 파라미터를 비교하여 검증할 수 있다. 구체적으로 앞서 설명한 팀플릿 내의 픽셀에 필터링을 적용하는 실시 예들을 통해 획득한 선형 모델의 파라미터와 기존 템플릿의 샘플을 사용하여 획득한 선형 모델의 파라미터 사이의 차이가 미리 지정된 값 이내인 경우, 인코더 및 디코더는 필터링을 적용하여 획득한 선형 모델을 최종 선형 모델로 판단할 수 있다. 미리 지정된 값은 1이상의 정수일 수 있다. 또 다른 구체적인 실시 예에서 앞서 설명한 팀플릿 내의 픽셀에 필터링을 적용하는 실시 예들을 통해 획득한 선형 모델의 파라미터와 기존 템플릿의 샘플을 사용하여 획득한 선형 모델의 파라미터 사이의 비율이 미리 지정된 비율 이상인 경우, 인코더 및 디코더는 필터링을 적용하여 획득한 선형 모델을 최종 선형 모델로 판단할 수 있다. 미리 지정된 비율은 0 내지 1 사이의 값일 수 있다. 최종 선형 모델을 획득하지 못한 경우, 인코더 및 디코더는 선형 모델을 획득하는 데 사용한 샘플을 제외하고, 다시 선형 모델을 유도할 수 있다. 인코더 및 디코더는 최종 선형 모델을 획득할 때까지 이 과정을 반복할 수 있다. 이때, 이 과정은 미리 지정된 횟수 내에서 반복될 수 있다. 구체적인 실시 예에서 미리 지정된 횟수 내에서 최종 선형 모델을 획득하지 못한 경우, 인코더 및 디코더는 마지막에 획득한 선형 모델을 최종 선형 모델로 획득할 수 있다. 미리 지정된 횟수는 1이상의 정수일 수 있다. 또 다른 구체적인 실시 예에서 이미 템플릿으로 사용된 샘플을 제외한 나머지 샘플의 개수가 미리 지정된 개수 이내일 때까지 반복될 수 있다. 구체적인 실시 예에서 이미 템플릿으로 사용된 샘플을 제외한 나머지 샘플의 개수가 미리 지정된 개수 이내일 때까지 최종 선형 모델을 획득하지 못한 경우, 인코더 및 디코더는 마지막에 획득한 선형 모델을 최종 선형 모델로 획득할 수 있다. 미리 지정된 개수는 1이상의 개수일 수 있다.
CCLM, MMLM을 사용하여 선형 모델의 파라미터를 유도할 때, 인코더 및 디코더는 템플릿 내의 샘플 중에서 미리 지정된 개수의 샘플만을 사용한다. 미리 지정된 개수는 4일 수 있다. 인코더 및 디코더는 도 15의 실시 예를 통해 설명한 실시 예들 중 템플릿 내의 픽셀에 필터링을 적용하는 실시 예들을 통해 획득한 선형 모델의 파라미터, 선형 모델의 파라미터를 유도하는데 사용되지 않은 템플릿 내의 샘플을 이용하여 선형 모델의 파라미터를 검증할 수 있다. 구체적으로 인코더 및 디코더는 앞서 설명한 템플릿 내의 픽셀에 필터링을 적용하는 실시 예들을 통해 획득한 선형 모델의 파라미터를 템플릿 내의 샘플 중 선형 모델의 파라미터 유도에 사용되지 않은 샘플의 휘도 샘플에 적용한 후, 휘도 샘플에 대응하는 색차 샘플을 예측할 수 있다. 인코더 및 디코더는 선형 모델 파라미터를 통해 예측된 색차 샘플과 복원된 색차 샘플을 비교하여 선형 모델의 파라미터를 검증할 수 있다. 선형 모델 파라미터를 통해 예측된 색차 샘플과 복원된 색차 샘플 사이의 차이가 미리 지정된 값 이내인 경우, 인코더 및 디코더는 필터링을 적용하여 획득한 선형 모델을 최종 선형 모델로 판단할 수 있다. 미리 지정된 값은 1이상의 정수일 수 있다. 선형 모델 파라미터를 통해 예측된 색차 샘플과 복원된 색차 샘플 사이의 차이가 미리 지정된 값 이상인 경우, 인코더 및 디코더는 템플릿 내의 샘플에서 선형 모델을 획득하는 데 사용한 샘플을 제외한 나머지 샘플 중에서 다시 선형 모델을 유도할 수 있다. 인코더 및 디코더는 최종 선형 모델을 획득할 때까지 이 과정을 반복할 수 있다. 이때, 선형 모델 유도는 미리 지정된 횟수 내에서 반복될 수 있다. 구체적인 실시 예에서 인코더 및 디코더가 미리 지정된 횟수 내에서 최종 선형 모델을 획득하지 못한 경우, 인코더 및 디코더는 선형 모델 파라미터를 통해 예측된 색차 샘플과 복원된 색차 샘플 사이의 차이가 가장 작은 선형 모델을 최종 선형 모델로 획득할 수 있다. 미리 지정된 횟수는 1이상의 정수일 수 있다. 또 다른 구체적인 실시 예에서 이미 템플릿 내의 샘플 중 선형 모델 유도에 사용된 샘플을 제외한 나머지 샘플의 개수가 미리 지정된 개수 이내일 때까지 반복될 수 있다. 구체적인 실시 예에서 인코더 및 디코더가 이미 템플릿으로 사용된 샘플을 제외한 나머지 샘플의 개수가 미리 지정된 개수 이내일 때까지 최종 선형 모델을 획득하지 못한 경우, 인코더 및 디코더는 선형 모델 파라미터를 통해 예측된 색차 샘플과 복원된 색차 샘플 간의 차이가 가장 작은 선형 모델을 최종 선형 모델로 결정할 수 있다. 미리 지정된 개수는 1이상의 정수일 수 있다.
도 16은 본 발명의 실시 예에 따라 참조 선형 모델을 생성하기 위해 사용되는 참조 영역을 보여준다.
도 9를 통해 설명한 실시 예들과 같이, 다운샘플링된 휘도 샘플을 생성하기 위해서 제1 타입(Type 1)과 제2 타입(Type 2) 필터가 사용될 수 있다. 도 16에서 짙은 회색 샘플은 다운샘플링된 휘도 샘플이 생성되는 위치이며, 옅은 회색 샘플은 짙은 회색 위치의 휘도 샘플을 생성하기 위해서 사용되는 주변 픽셀들을 나타낸다. 이러한 회색 샘플들을 회색 참조 영역이라 할 수 있다. 인코더 및 디코더는 현재 블록을 예측하는데 여러 개의 참조 픽셀 라인(Reference line)을 사용할 수 있다. 이때, 인코더는 여러 개의 참조 픽셀 라인 중 어느 참조 픽셀 라인을 사용하는지 나타내는 참조 픽셀 라인 인덱스를 비트스트림에 포함시킬 수 있다. 디코더는 비트스트림으로부터 참조 픽셀 라인 인덱스를 파싱하여 현재 블록에 대한 예측 블록을 생성할 때 사용되는 참조 픽셀 라인을 판단할 수 있다. 인코더 및 디코더가 참조 픽셀 라인에 따라 색차 예측 블록을 생성하기 위한 선형 모델을 유도하기 위한 참조 영역이 달라질 수 있다. 인코더 및 디코더가 현재 블록에 대한 예측 블록을 생성할 때 사용되는 참조 픽셀 라인이 현재 블록과 인접한 경우, 디코더는 색차 예측 블록을 생성하기 위한 선형 모델을 유도하기 위해서 도 16의 (a)와 같이 회색 참조 영역을 사용할 수 있다. 참조 픽셀 라인이 현재 블록과 인접한 경우는 참조 픽셀 라인이 미리 지정된 값보다 작은 경우이다. 미리 지정된 값은 1이상의 정수일 수 있다. 예컨대, 미리 지정된 값은 2일 수 있다. 인코더 및 디코더가 현재 블록에 대한 예측 블록을 생성할 때 사용되는 참조 픽셀 라인이 현재 블록과 인접하지 않은 경우, 디코더는 색차 예측 블록을 생성하기 위한 선형 모델을 유도하기 위해서 도 16의 (b)와 같이 회색 참조 영역을 사용할 수 있다. 참조 픽셀 라인이 현재 블록과 인접하지 않은 경우는 참조 픽셀 라인이 미리 지정된 값보다 큰 경우일 수 있다. 미리 지정된 값은 1이상의 정수일 수 있다. 예컨대, 미리 지정된 값은 1일 수 있다.
인코더 및 디코더가 MMLM, MM-CCCM과 같은 다중 CCP 모델을 적용할 때, 인코더 및 디코더는 2개 선형 모델을 유도하여 색차 블록을 예측한다. 인코더 및 디코더가 현재 블록에 대한 예측 블록을 생성할 때 사용되는 참조 픽셀 라인이 현재 블록과 인접하지 않은 경우, 예컨대, 참조 픽셀 라인 인덱스가 1보다 큰 경우, 인코더 및 디코더는 색차 예측 블록을 생성하기 위한 2개의 선형 모델을 유도하기 위해 도 16의 (a)의 회색 참조 영역과 도16의 (b)의 회색 참조 영역 모두를 사용할 수 있다. 인코더 및 디코더는 도16의 (a)의 회색 참조 영역에서 하나의 선형 모델을 유도하고, 도16의 (b)의 회색 참조 영역에서 또 다른 선형 모델을 유도한 후, 유도한 2개의 선형 모델을 색차 블록에 대한 예측 블록을 생성하는 데 사용할 수 있다.
도 17은 본 발명의 실시 예에 따라 CCCM에 사용되는 참조 샘플 및 수식을 보여준다.
색차 블록에 대한 예측 블록을 생성하는 데 사용되는 선형 모델 또는 비선형 모델은 현재 블록에 인접할수록 현재 블록의 특성을 잘 표현할 수 있다. 따라서, 현재 블록에 인접할수록 더욱 효과적인 모델을 유도할 수 있다. 만일 현재 블록에 대한 휘도 예측 블록을 생성하는데 사용된 참조 픽셀 라인이 현재 블록에 인접한 참조 픽셀이 아니고, 멀리 떨어질 수록, 현재 블록에 인접한 영역에 잡음이 포함되어 있을 가능성이 높아진다. 이러한 잡음으로 인해 효과적인 선형 모델을 유도하지 못할 수도 있다. 따라서 디코더는 현재 블록에 대한 휘도 예측 블록을 생성하는데 사용된 참조 픽셀 라인의 위치에 따라 CCLM, MMLM, GLM, 및 CCCM과 같은 CCP 모델 기반의 색차 예측 방법의 사용 여부를 결정할 수 있다. 현재 블록에 대한 휘도 예측 블록을 생성하는데 사용된 참조 픽셀 라인 인덱스가 미리 지정된 값보다 큰 경우, 디코더는 CCLM, MMLM, GLM, 및 CCCM 등과 같은 CCP 모델 기반의 색차 예측 방법을 사용하지 않을 수 있다. 이때, 디코더는 CCLM, MMLM, GLM, 및 CCCM 등과 같은 CCP 모델과 관련된 신택스를 파싱하지 않고 CCLM, MMLM, GLM, 및 CCCM과 같은 CCP 모델 기반의 색차 예측 방법이 사용되지 않음으로 추론할 수 있다. 미리 지정된 값은 1이상의 정수일 수 있다. 예컨대, 미리 지정된 값은 3일 수 있다.
도 17의 (a)는 현재 예측 블록(사선 빗금 샘플들)에 CCCM이 적용되기 위한 참조 샘플(수직 빗금)과 십자 모양의 필터를 적용할 때 필요한 사이드 샘플(수평 빗금)의 위치를 보여준다. 현재 예측 블록(M(W)xN(H))은 크로마 대 루마의 샘플 개수 비율은 1:1 관계에서 상측 6줄의 참조 샘플(2Mx6), 좌측 6줄의 참조 샘플(6x2N) 및 좌-상단의 6x6 참조 샘플로 구성될 수 있다. 사이드 샘플(수평 빗금)은 도 17의 (b)의 십자형 샘플 필터를 도 17의 (c)의 크로마 샘플 예측 관계식에 적용할 때 참조 샘플 영역을 벗어나는 경우가 발생할 수 있다. 이때, 추가로 필요한 샘플이 사이드 샘플일 수 있다. 도 17의 (c)는 크로마 성분 각각에 대해 수행될 수 있다. 크로마 성분은 Cb, Cr일 수 있다. C(Center) 위치의 샘플은 Cb, Cr 크로마 샘플에 대응되는 루마 샘플일 수 있고, N(North), E(East), S(South), 및 W(West)는 C위치의 루마 샘플과 인접한 루마 샘플일 수 있다. C 샘플의 위치에 따라 참조 샘플 이외의 영역에 대해 사이드 샘플에 한 샘플씩 추가될 필요가 있다. 인코더 및 디코더는 사이드 샘플 위치에서 샘플 값이 사용가능(available)하지 않으면 C 샘플 값으로 패딩 할 수 있다. 구체적으로 도 17의 (a)의 A 부분을 참고하면, 참조 샘플 영역 중에서 우상단 위치의 샘플에 대하여 도 17의 (c)를 계산하기 위해, 도 17의 (b)의 십자형 샘플 필터를 참조 샘플의 우상단에 적용될 수 있다. 이때, C(Center), S(South), 및 W(West) 위치의 샘플은 참조 샘플 영역 이내이므로, 샘플값이 존재한다. 다만, N(North), E(East) 위치의 샘플은 참조 샘플 영역 밖이므로, 샘플값이 존재하지 않는다. 따라서, 인코더 및 디코더는 N(North), E(East) 위치의 샘플을 C 샘플 값으로 패딩하여 구성할 수 있다. 도 17의 (c)에서 P 값은 비선형 값(nonlinear term)으로 다음과 같이 정의될 수 있다.
P = ( C*C + midVal ) >> bitDepth , 10-bit 컨텐츠인 경우 P = ( C*C + 512 ) >> 10 일 수 있다.
도 17의 (c)에서 B는 바이어스 텀(Bias term)으로 정수 오프셋 값으로 컨텐츠의 비트 깊이(bitdepth)의 중간 값일 수 있다. 컨테츠의 비트 깊이가 10 비트일 경우, B는 512일 수 있다. 도 17의 (c)에서 7개의 계수는 참조 샘플 영역의 루마와 크로마 샘플을 기초로 설정될 수 있다. 이때, 인코더 및 디코더는 루마 입력 값에 대한 오토코릴레이션 매트릭스(autocorrelation matrix), 루마 입력 값과 크로마 출력 값에 대한 크로스-코릴레이션 벡터(cross-correlation vector)의 MSE(Mean Square Error)값을 최소화하도록 7개의 계수를 계산할 수 있다. 인코더 및 디코더는 LDL 분해(decomposition)을 사용하여 오토코릴레이션 매트릭스를 구할 수 있다. 또 다른 구체적인 실시 예에서 인코더 및 디코더는 숄레스키 분해(Cholesky decomposition)를 사용하여 오토코릴레이션 매트릭스를 구할 수 있다. 또한, 인코더 및 디코더는 후 치환(back-substitution)을 사용하여 7개의 계수를 구할 수 있다.
도 17의 (c)에서 B 값을 다음과 같이 정의하여 그중 하나를 적용할 수 있다.
1. 각 크로마 성분의 평균값
2. 참조 샘플 전체의 루마 샘플들의 평균값과 각 크로마 성분의 평균값과의 차이, 또는 절대값의 차이
도 17의 (c)에서 크로마 샘플 예측 관계식에서 비선형 텀(nonlinear term)인 P는 그대로 사용될 수도 있고, 다음과 같은 수식에 따라사용될 수도 있다.
1. P = (Cg*Cg + midVal) >> bitDepth: Cg는 도 17의 (b)에서 C위치의 그래디언트(gradient)값일 수 있다. midVal은 비트 깊이(bitDepth)의 중간 값일 수 있다. 비트 깊이가 10비트인 컨텐츠에서 midVal은 512일 수 있다.
2. 또는, P의 값은 참조 샘플의 그래디언트 값의 평균값일 수 있다.
3. 또는, 도 17의 (b) 위치의 그래디언트 값들의 평균값일 수 있다.
4. 또는 P=(meanG*meanG+bitDepth>>1)>>bitdepth 일 수 있다. meanG는 참조 샘플들의 그래디언트 값들의 평균 값일 수 있다.
또한, 도 17의 (c)의 C, N, S, E, W, P는 다음처럼 변경될 수 있다. C'= C-meanY, N'=N-meanY, S'=S-meanY, E'=E-meanY, W'=W-meanY, P'=P-meanNonlinY, meanY는 참조 샘플 영역에서의 루마들의 평균 값일 수 있다. meanNonlinY는
meanNonlinY = (meanY * meanY) >> bitdepth 일 수 있다.
또는, meanNonlinY = (meanY * meanY + bitdepth>>1) >> bitdepth 일 수 있다.
meanY, meanChroma를 계산하기 위해, 인코더 및 디코더는 특정 위치의 샘플들만을 사용할 수 있다.
도 18은 본 발명의 실시 예에 따른 차분 샘플 기반 CCCM 방법을 보여준다.
인코더 및 디코더는 도 18의 A, B, C, D, E, F, G, a, b, c, d, e, f, g 위치의 샘플 적어도 하나 이상을 사용하여 meanY, meanChroma 값을 계산할 수 있다. 또한, CCCM에서 사용되는 템플릿의 형태에 따라 검색할 샘플 위치가 달라질 수 있다. 예를 들어, CCCM에서 사용되는 템플릿이 도 17의 (a)의 템플릿뿐만 아니라, 현재 블록의 상단 픽셀들만을 사용하는 상단 템플릿, 현재 블록의 좌측 픽셀들만을 사용하는 상측 템플릿이 존재할 수 있다. 이때, 현재 블록에 CCCM을 적용할 때 상단 템플릿이 사용될 수 있다. 이러한 경우, 인코더 및 디코더는 상단 템플릿 내의 샘플 위치 B, E, F, b, e, f 위치의 샘플 적어도 하나 이상 사용하여 meanY, meanChroma 값을 계산할 수 있다.
변경된, C', N', S', W', P'에 기초하여 도 17의 (c)는 아래 수학식 7과 같이 변경될 수 있다. 수학식 7에는 도 17의 (c)와 다르게 각 크로마 성분의 평균값이 추가될 수 있다.
수학식 7
predChromaVal = c0C' + c1N' + c2S' + c3E' + c4W' + c5P' + c6B' + meanChroma
: meanChroma는 참조 샘플 영역의 크로마 샘플들(Cb, Cr) 각각에 대한 평균값일 수 있다.
수학식 7에서 B'는 참조 샘플내의 루마 샘플 평균값과 크로마 각 성분 별 평균값의 차이 또는 절대값의 차이로 정의할 수도 있다.
수학식 7에서 B'를 제외하고 다음과 같이 정의될 수 있다.
수학식8
predChromaVal = c0C' + c1N' + c2S' + c3E' + c4W' + c5P' + meanChroma
수학식 8에서 사용될 수 있는 루마 샘플의 계수는 5개 루마 위치 샘플의 조합으로부터 획득될 수 있다. 구체적인 실시 예에서 사용되는 루마 개수에 따라 필요한 계수 개수도 달라 질 수 있다. 또한, 수학식 8에서 미리 지정된 개수 및 미리 지정된 위치의 루마 샘플이 사용될 수 있다.
도 17의 (c)에서 필요한 루마 샘플들(C, N, E, S, W )과 수학식 7에서 필요한 루마 샘플들(C', N', E', S', W')을 다른 값으로 대체할 수 있다. CCCM에 사용될 수 있는 관계식인 도 17의 (c) 혹은 수학식 7은 그대로 사용하거나 부분변경 하되 루마 샘플 값 혹은 변형된 루마 샘플 값으로 표현되는 값 대신 그래디언트 값으로 대체될 수 있다.
CCCM에서 오토코릴레이션 매트릭스(autocorrelation matrix)는 루마 및 크로마 샘플의 재구성된 값을 사용하여 계산될 수 있다. 이러한 샘플은 전체 범위(10비트 콘텐츠의 경우 0에서 1023 사이)이므로 오토코릴레이션 매트릭스의 값이 상대적으로 크다. 이를 위해 모델 파라미터 계산 중 깊은 비트 깊이(depth)에서의 계산 과정이 필요하다. meanY, meanNonlinY 값을 차분하는 방법은 이러한 문제를 해결하는 방법이 될 수 있다. 하지만, 평균 값을 차분하는 방법은 평균값을 계산해야 하므로 추가적인 파이프라인 단계가 필요하다. 결국, 구현 복잡도를 높인다. 이러한 단점을 완화하기 위해, 각 모델에 대해 휘도 샘플 및 색차 샘플에 미리 지정된 값을 차분할 수 있다. 구체적으로 각 모델에 입력되는 휘도 샘플의 값과 색차 샘플의 값에서 오프셋 값을 뺀 값을 각각 휘도 샘플의 입력 값과 색차 샘플의 입력 값으로 사용할 수 있다. 이를 통해 모델 생성에 사용되는 값의 크기를 감소시키고, 고정점 연산에 필요한 정밀도를 감소시킬 수 있다. 또한, CCCM 구현에 22비트 정밀도 대신 16비트 소수 정밀도가 사용된다. 이러한 실시 예들에 대해서는 도 18을 통해 설명한다.
도 18은 본 발명의 실시 예에 따라 오프셋 차분 샘플 기반 CCCM을 보여준다.
앞서 설명한 오프셋 값은 현재 블록의 주변 샘플 중 미리 지정된 위치의 휘도 샘플의 값일 수 있다. 도 18에서 A 위치의 픽셀 값은 단순화를 위해 오프셋(offsetLuma, offsetCb 및 offsetCr)으로 사용된다. 구체적으로 인코더 및 디코더는 A 위치의 픽셀 값에서 휘도 샘플 값을 offsetLuma로 사용하고, A 위치의 픽셀 값에서 Cb 색차 샘플 값을 offsetCb로 사용하고, A 위치의 픽셀 값에서 Cr 색차 샘플 값을 offsetCr로 사용할 수 있다. 모델 생성 및 최종 예측에 사용된 샘플 값(즉, 기준 영역의 루마 및 크로마, 현재 PU의 루마)은 다음과 같이 고정 값만큼 감소될 수 있다.
C' = C - offsetLuma
N' = N - offsetLuma
S' = S - offsetLuma
E' = E - offsetLuma
W' = W - offsetLuma
P' = nonLinear(C')
B = midValue = 1 << (bitDepth - 1)
크로마 값은 다음의 수학식 9를 사용하여 예측되는데, 여기서 offsetChroma는 Cr과 Cb 성분에 대해 각각 offsetCr과 offsetCb값이 사용될 수 있다.
수학식 9
predChromaVal = c0C' + c1N' + c2S' + c3E' + c4W' + c5P' + c6B + offsetChroma
이때, offsetLuma 값으로 사용되는 도 18에서 A 위치의 휘도 샘플의 값이 0일 경우, 차분 과정이 없어진다. 따라서 기존의 깊은 비트 깊이(depth)에서 계산이 다시 필요할 수 있다. 이러한 문제를 해결하기 위해, 다음과 같이 다양한 방법이 적용될 수 있다.
offsetLuma 값으로 사용되는 미리 지정된 위치, 예컨대 도 18에서 A 위치의 휘도 샘플의 값이 미리 지정된 범위에 속하지 않는 경우, 인코더 및 디코더는 미리 지정된 기본 오프셋 값을 offsetLuma, offsetCr, offsetCb값으로 사용할 수 있다. 미리 지정된 제1 값과 미리 지정된 제2 값은 1이상의 정수일 수 있다. 또한, 미리 지정된 제1 값과 미리 지정된 제2 값은 현재 샘플을 표현하는데 사용되는 비트 깊이(bitdepth)에 따라 달라질 수 있다. 비트 깊이가 10비트일 경우, 미리 지정된 제1 값은 0, 128, 256, 512, 768, 및 1023 중 어느 하나이고, 제2 값은 나머지 값 중 제1 값 보다 큰 값일 수 있다. 미리 지정된 기본 offsetLuma, offsetCr, offsetCb 값은 정수일 수 있다. 또 다른 구체적인 실시 예에서 비트 깊이가 10비트일 경우, 미리 지정된 제1 값은 -256, -128, 0, 128, 및 256 중 어느 하나이고, 제2 값은 나머지 값 중 제1 값 보다 큰 값일 수 있다.
또 다른 실시 예에서, offsetLuma 값으로 미리 지정된 위치, 예컨대 도 18에서 A 위치의 휘도 샘플의 값이 미리 지정된 범위에 속하지 않는 경우, 인코더 및 디코더는 미리 지정된 추가 후보 위치, 예컨대 도 18의 B, C, D, E, F, G, a, b, c, d, e, f, g 위치의 샘플을 순서대로 검색하며 해당 위치의 휘도 샘플의 값이 오프셋 값으로 유효한지 판단할 수 있다. 이때, 휘도 샘플의 값이 미리 지정된 범위에 속하는 경우, 인코더 및 디코더는 해당 위치의 휘도 샘플의 값이 오프셋 값으로 유효하다고 판단할 수 있다. 인코더 및 디코더는 최초로 유효하다고 판단된 휘도 샘플의 값 또는 휘도 샘플에 대응하는 색차 샘플의 값을 오프셋 값, 예컨대 offsetLuma, offsetCr, offsetCb의 값으로 사용할 수 있다. 구체적으로 인코더 및 디코더는 최초로 유효하다고 판단된 휘도 샘플의 값을 offsetLuma로, 유효하다고 판단된 휘도 샘플에 대응하는 Cr 색차 샘플의 값을 offsetCr로, Cb 색차 샘플의 값을 offsetCb로 사용할 수 있다.
또 다른 실시 예에서, 미리 지정된 복수의 위치, 예컨대 도 18에서 A, B, C, D, E, F, G, a, b, c, d, e, f, g 위치의 샘플을 순서대로 검색하면서 해당 위치의 휘도 샘플의 값이 오프셋 값으로 유효한 값인지 판단할 수 있다. 인코더는 유효한 모든 휘도 샘플의 값을 사용하여 CCCM을 적용한 후, 가장 최적의 샘플 위치를 지시하는 오프셋 샘플 정보를 비트스트림에 포함시킬 수 있다. 디코더는 비트스트림으로부터 오프셋 샘플 정보를 파싱한 후, 오프셋 샘플 정보에 해당하는 휘도 샘플의 값을 오프셋 값으로 사용할 수 있다.
또 다른 실시 예에서, offsetLuma 값으로 사용되는 미리 지정된 위치, 예컨대 도 18에서 A 위치의 휘도 샘플의 값이 미리 지정된 범위에 속하지 않는 경우, 인코더는 현재 색차 블록을 부호화하는데 CCCM을 사용하지 않을 수 있다. 이때, 인코더는 CCCM과 관련된 정보를 비트스트림에 포함시키지 않을 수 있다. 미리 지정된 위치의 휘도 샘플의 값이 미리 지정된 범위에 속하지 않는 경우, 디코더는 CCCM과 관련된 정보를 파싱하지 않을 수 있다. 이때, 디코더는 CCCM과 관련된 신택스를 모두 0으로 추론할 수 있다. 또 다른 구체적인 실시 예에서 디코더는 CCCM과 관련된 신택스를 사용하지 않음으로 설정할 수 있다.
또 다른 실시 예에서, 오프셋 값으로 사용될 수 있는 루마 샘플의 후보 위치, 예컨대 도 18에서 A, B, C, D, E, F, G, a, b, c, d, e, f, g 위치의 모든 루마 샘플의 값이 미리 지정된 범위에 속하지 않는 경우, 인코더는 현재 색차 블록을 부호화하는데 CCCM을 사용하지 않을 수 있다. 이때, 인코더는 CCCM과 관련된 정보를 비트스트림에 포함시키지 않을 수 있다. 오프셋 값으로 사용될 수 있는 루마 샘플의 후보 위치의 모든 루마 샘플의 값이 미리 지정된 범위에 속하지 않는 경우, 디코더는 CCCM과 관련된 정보를 파싱하지 않을 수 있다. 이때, 디코더는 CCCM과 관련된 신택스를 모두 0으로 추론할 수 있다. 또 다른 구체적인 실시 예에서 디코더는 CCCM과 관련된 신택스를 사용하지 않음으로 설정할 수 있다.
앞서 설명한 실시 예들에서 미리 지정된 위치의 루마 샘플의 값이 미리 지정된 범위에 속하지 않는 경우는 미리 지정된 제1 값보다 작거나 또는 미리 지정된 제2 값보다 큰 경우일 수 있다. 미리 지정된 제2 값은 현재 샘플을 표현하는데 사용되는 비트 깊이에 따라 결정될 수 있다. 비트 깊이가 10비트일 경우, 미리 지정된 제2 값은 768 및 1023 중 어느 하나일 수 있다. 또한, 미리 지정된 제1 값은 128 및 256 중 어느 하나 일 수 있다.
앞서 설명한 실시 예들에서 오프셋 값으로 사용될 수 있는 루마 샘플의 후보 위치가 CCCM에 사용되는 템플릿의 형태에 따라 결정될 수 있다. 예를 들어, CCCM에서 사용되는 템플릿이 도 17의 (a)의 템플릿뿐만 아니라, 현재 블록의 상단 픽셀들만을 사용하는 상단 템플릿, 현재 블록의 좌측 픽셀들만을 사용하는 상측 템플릿이 존재할 수 있다. 이때, 현재 블록에 CCCM을 적용할 때 상단 템플릿이 사용되는 경우, 인코더 및 디코더는 상단 템플릿 내의 샘플 위치 B, E, F, b, e, f 위치의 샘플을 순서대로 검색하면서 해당 위치의 샘플이 유효한 범위 내의 샘플인지 검사할 수 있다. 해당 위치의 샘플이 유효한 경우, 인코더 및 디코더는 해당 위치의 휘도 샘플의 값을 offsetLuma로 사용하고 해당 위치의 색차 샘플의 값을 offsetCr 및 offsetCb로 사용할 수 있다.
앞서 설명한 실시 예들에서 인코더 및 디코더가 루마 샘플의 값이 미리 지정된 범위 내에 속하는지 판단할 때, 인코더 및 디코더는 현재 블록에 인접한 주변 샘플들의 최소값, 중간값, 최대값, 및 평균값 중 적어도 하나 이상을 사용하여 미리 지정된 범위를 설정할 수 있다.
도 18에서 A 위치의 픽셀값이 미리 지정된 제1 값보다 작거나 또는 미리 지정된 제2 값보다 큰 경우, 인코더는 현재 색차 블록을 부호화하는데 사용되는 CCLM, MMLM, GLM, 및 CCCM 중 적어도 하나 이상을 사용하지 않을 수 있다. 또한 인코더는 CCLM, MMLM, GLM, CCCM과 관련된 적어도 하나 이상의 정보를 비트스트림에 포함시키지 않을 수 있다. 도 18에서 A 위치의 픽셀값이 미리 지정된 제 1값보다 작거나 또는 미리 지정된 제2 값보다 큰 경우, 디코더는 CCLM, MMLM, GLM, 및 CCCM과 관련된 적어도 하나 이상의 정보를 파싱하지 않을 수 있다. 또한, 디코더는 CCLM, MMLM, GLM, 및 CCCM과 관련된 적어도 하나 이상의 신택스를 모두 0으로 추론할 수 있다. 또 다른 구체적인 실시 예에서 디코더는 CCLM, MMLM, GLM, 및 CCCM과 관련된 적어도 하나 이상의 신택스를 사용하지 않음으로 설정할 수 있다.
인코더 및 디코더가 MMLM, MM-CCCM과 같은 다중 CCP 모델을 적용할 때, 인코더 및 디코더는 주변 블록의 휘도 샘플의 평균값을 제1 임계치로 설정하고, 제1 임계치를 기준으로 주변 블록을 통해 2개의 선형 모델을 유도할 수 있다. 이때, 인코더 및 디코더는 현재 블록의 휘도 샘플의 값과 제1 임계치를 비교하여, 하나의 선형 모델을 사용하여 휘도 샘플에 대응하는 색차 샘플을 유도할 지 또는 2개의 선형 모델을 사용하여 휘도 샘플에 대응하는 색차 샘플을 유도할 지 결정할 수 있다. 구체적으로 현재 블록의 휘도 샘플과 제1 임계치 사이의 차이가 미리 지정된 값보다 작을 경우, 인코더 및 디코더는 2개의 선형 모델을 모두 사용하여 색차 샘플을 예측할 수 있다. 또한, 인코더 및 디코더는 현재 블록의 휘도 샘플과 제1 임계치 사이의 차이가 미리 지정된 값보다 같거나 큰 경우, 인코더 및 디코더는 하나의 선형 모델을 사용하여 색차 샘플을 예측할 수 있다.
인코더 및 디코더는 현재 블록의 휘도 샘플, 현재 블록의 휘도 샘플 주변의 임의의 개수의 휘도 샘플, 현재 블록의 휘도 샘플과 현재 블록의 휘도 샘플 주변의 임의의 개수의 휘도 샘플을 제1 임계치와 비교하여 제1 선형 모델과 제2 선형 모델에 속하는 샘플의 개수, 현재 블록의 휘도 샘플과 제1 임계치 사이의 차이, 제1 선형 모델, 제2 선형 모델, 제1 선형 모델에 대한 가중치, 및 제2 선형 모델에 대한 가중치 중 적어도 하나 이상을 사용하여 현재 블록의 휘도 샘플에 대응하는 색차 샘플을 예측할 수 있다. 이때, 제1 선형 모델과 제2 선형 모델은 제1 임계치를 이용하여 유도된 선형 모델이다. 이후 설명에서 어느 모델에 속하는 샘플은 해당 모델을 유도하는데 사용된 샘플을 의미할 수 있다. 이때, 휘도 샘플이 제1 선형 모델과 제2 선형 모델에 속하는 지 판단하는 방법은 휘도 샘플이 제1 임계치보다 같거나 작은 경우, 제1 선형 모델에 속하는 것으로 판단할 수 있으며, 휘도 샘플이 제1 임계치보다 큰 경우, 제2 선형 모델에 속하는 것으로 판단할 수 있다.
도 19는 본 발명의 실시 예에 따라 색차 샘플 예측에 사용되는 모델의 유도에 고려되는 현재 블록 주변의 미리 지정된 개수의 주변 휘도 샘플을 보여준다.
도 19의 (a)는 현재 블록의 주변 4개의 휘도 샘플들을 보여주며, 도 19의 (b)는 현재 블록의 주변 8개의 휘도 샘플들을 보여준다. 인코더 및 디코더는 현재 블록의 휘도 샘플과 현재 블록의 휘도 샘플 주변의 미리 지정된 개수의 휘도 샘플을 제1 임계치와 비교하여 제1 선형 모델과 제2 선형 모델에 속하는 휘도 샘플의 개수를 계산한다. 이때, 인코더 및 디코더는 휘도 샘플을 다운샘플링하는 필터를 적용하였을 때 최종 생성되는 샘플의 위치의 휘도 샘플의 값과 제1 임계치와 비교하여 어느 선형 모델에 속하는 휘도 샘플인지 판단할 수 있다. 제1 선형 모델에 속하는 휘도 샘플의 개수가 미리 지정된 제1 값보다 같거나 큰 경우, 인코더 및 디코더는 현재 블록의 휘도 샘플에 대응되는 색차 샘플은 제1 선형 모델만을 사용하여 예측할 수 있다. 제2 선형 모델에 속하는 휘도 샘플의 개수가 미리 지정된 제1 값보다 같거나 큰 경우, 인코더 및 디코더는 현재 블록의 휘도 샘플에 대응되는 색차 샘플은 제2 선형 모델만을 사용하여 예측할 수 있다. 이때, 미리 지정된 제1 값은 1이상의 정수 일 수 있으며, 6일 수 있다. 제1 선형 모델에 속하는 휘도 샘플의 개수가 제2 선형 모델에 속하는 휘도 샘플의 개수보다 큰 경우, 인코더 및 디코더는 제1 선형 모델에는 미리 지정된 제1 가중치를 설정하고 제2 선형 모델에는 미리 지정된 제2 가중치를 설정할 수 있다. 이때, 인코더 및 디코더는 제1 선형 모델을 사용하여 유도된 제1 색차 샘플과 제2 선형 모델을 사용하여 유도된 제2 색차 샘플들을 유도한 후, 제1 색차 샘플에는 제1 가중치, 제2 색차 샘플에는 제2 가중치를 사용하여 가중 평균하여 현재 블록의 휘도 샘플에 대응되는 색차 샘플을 유도할 수 있다. 그렇지 않다면, 즉 제1 선형 모델에 속하는 휘도 샘플의 개수가 제2 선형 모델에 속하는 휘도 샘플의 개수보다 같거나 작은 경우, 인코더 및 디코더는 제2 선형 모델에 제1 가중치를 설정하고, 제1 선형 모델에는 제2 가중치를 설정할 수 있다. 이때, 인코더 및 디코더는 제1 선형 모델을 사용하여 유도된 제1 색차 샘플과 제2 선형 모델을 사용하여 유도된 제2 색차 샘플들을 유도한 후, 제1 색차 샘플에는 제2 가중치, 제2 색차 샘플에는 제1 가중치를 사용하여 가중치 평균하여 최종적으로 현재 블록의 휘도 샘플에 대응되는 색차 샘플을 유도할 수 있다. 인코더 및 디코더는 상기 색차 샘플을 사용하여 색차 예측 블록을 구성할 수 있다. 이때, 제1 가중치 및 제2 가중치는 미리 지정된 값일 수 있다. 또한, 제1 가중치는 제2 가중치보다 큰 값일 수 있다. 예컨대, 제1 가중치는 13일 수 있다. 또한, 제2 가중치는 3일 수 있다. 이때, 샘플값 A와 B 값 사이의 가중치 평균은 (A * 제1 가중치 + B * 제2 가중치) >> Shift로 계산될 수 있다. Shift의 값은 제1 가중치와 제2 가중치에 따라 결정될 수 있다. Shift의 값은 제1 가중치와 제2 가중치의 합을 이진수로 변환한 후, 변환된 이진수 비트의 개수 인 N에서 1만큼 뺀 값이다. 예를 들어, 제1 가중치가 13이고, 제2 가중치가 3인 경우, 가중치의 합은 16이고, 이진수로 변환하면, 10000이고, 이진수 비트의 개수는 5이고, Shift의 값은 4가 된다. 이에 따라 샘플값 A와 B 값을 가중치 평균으로 계산할 때, 가중치 평균값은 샘플값의 비트 깊이(depth)로 다시 복원된다.
또 다른 구체적인 실시 예에서 인코더 및 디코더는 현재 블록의 휘도 샘플과 제1 임계치, 예컨대 주변 블록의 휘도 샘플의 평균값 사이의 차이와 제2 임계치 또는 제3 임계치 사이의 차이를 통해, 제1 선형 모델 및 제2 선형 모델 각각을 사용할지 판단할 수 있다. 이때, 인코더 및 디코더는 제1 선형 모델만을 사용하거나, 제2 선형 모델만 사용하거나, 제1 선형 모델과 제2 선형 모델을 유도한 샘플을 가중 평균하여 색차 샘플 유도할 수 있다. 현재 블록의 휘도 샘플과 제1 임계치, 예컨대 주변 블록의 휘도 샘플의 평균값 사이의 차이가 제2 임계치보다 큰 경우, 현재 블록의 휘도 샘플과 제1 임계치를 비교한다. 현재 블록의 휘도 샘플이 제1 임계치보다 큰 경우, 인코더 및 디코더는 현재 블록의 휘도 샘플에 대응하는 색차 샘플을 제2 선형 모델을 사용하여 예측할 수 있다. 현재 블록의 휘도 샘플이 제1 임계치보다 같거나 작은 경우, 인코더 및 디코더는 현재 블록의 휘도 샘플에 대응하는 색차 샘플을 제1 선형 모델을 사용하여 예측할 수 있다. 현재 블록의 휘도 샘플과 제1 임계치, 예컨대 주변 블록의 휘도 샘플의 평균값 사이의 차이가 제2 임계치보다 같거나 작고 현재 블록의 휘도 샘플과 제1 임계치 사이의 차이가 제3 임계치보다 작은 경우, 인코더 및 디코더는 제1 선형 모델에 제3 가중치를 설정하고 제2 선형 모델에 제4 가중치를 설정할 수 있다. 이때, 인코더 및 디코더는 제1 선형 모델을 사용하여 유도된 제1 색차 샘플과 제2 선형 모델을 사용하여 유도된 제2 색차 샘플들을 유도하고, 제1 색차 샘플에는 제3 가중치, 제2 색차 샘플에는 제4 가중치를 사용하여 가중 평균하여 최종적으로 현재 블록의 휘도 샘플에 대응되는 색차 샘플을 유도할 수 있다. 이때, 제3 가중치 및 제4 가중치는 미리 지정된 값일 수 있다. 예컨대, 제3 가중치는 1일 수 있다. 이때, 제4 가중치는 1일 수 있다. 현재 블록의 휘도 샘플과 제1 임계치 사이의 차이가 제3 임계치보다 같거나 큰 경우, 인코더 및 디코더는 현재 블록의 휘도 샘플과 제1 임계치를 비교할 수 있다. 현재 블록의 휘도 샘플이 제1 임계치보다 작거나 같은 경우, 인코더 및 디코더는 제1 선형 모델에 제1 가중치를 설정하고, 제2 선형 모델에 제2 가중치를 설정할 수 있다. 이때, 인코더 및 디코더는 제1 선형 모델을 사용하여 유도된 제1 색차 샘플과 제2 선형 모델을 사용하여 유도된 제2 색차 샘플들을 유도한 후, 제1 색차 샘플에는 제1 가중치, 제2 색차 샘플에는 제2 가중치를 사용하여 가중 평균하여 최종적으로 현재 블록의 휘도 샘플에 대응되는 색차 샘플을 유도할 수 있다. 현재 블록의 휘도 샘플이 제1 임계치보다 큰 경우, 제2 선형 모델에는 제1 가중치를 설정하고 제1 선형 모델에는 제2 가중치를 설정한 후, 제1 선형 모델을 사용하여 유도된 제1 색차 샘플과 제2 선형 모델을 사용하여 유도된 제2 색차 샘플들을 유도한 후, 제1 색차 샘플에는 상기 제2 가중치, 제2 색차 샘플에는 상기 제1 가중치를 사용하여 가중치 평균하여 최종적으로 현재 블록의 휘도 샘플에 대응되는 색차 샘플을 유도할 수 있다. 이때, 제1 가중치 및 제2 가중치는 미리 지정된 값일 수 있다. 예컨대, 제3 가중치는 1일 수 있다. 예컨대, 제1 가중치는 13일 수 있다. 또한, 제2 가중치는 3일 수 있다. 인코더 및 디코더는 상기 색차 샘플을 사용하여 색차 예측 블록을 구성할 수 있다.
또 다른 구체적인 실시 예에서 인코더 및 디코더는 현재 블록의 주변 블록으로부터 유도된 하나의 선형 모델과, 현재 블록의 주변 블록의 평균값을 기반으로 유도된 2개의 선형 모델 중 적어도 하나 이상을 사용하여 현재 블록의 휘도 샘플에 대응되는 색차 샘플을 유도할 수 있다. 구체적으로 인코더 및 디코더는 현재 블록의 휘도 샘플, 현재 블록의 휘도 샘플 주변의 미리 지정된 개수의 휘도 샘플, 및 현재 블록의 휘도 샘플과 현재 블록의 휘도 샘플 주변의 미리 지정된 개수의 휘도 샘플 각각과 제1 임계치를 비교하여 제1 선형 모델과 제2 선형 모델에 속하는 휘도 샘플의 개수를 획득할 수 있다. 이때, 인코더 및 디코더는 제1 선형 모델과 제2 선형 모델에 속하는 휘도 샘플의 개수, 현재 블록의 휘도 샘플과 제1 임계치 사이의 차이, 제1 선형 모델, 제2 선형 모델, 제3 선형 모델, 제1 선형 모델에 대한 가중치, 제2 선형 모델에 대한 가중치, 및 제3 선형 모델에 대한 가중치 중 적어도 하나 이상을 사용하여 현재 블록의 휘도 샘플에 대응하는 색차 샘플을 예측할 수 있다. 제1 선형 모델과 제2 선형 모델은 제1 임계치를 이용하여 유도된 선형 모델이다. 또한, 제3 선형 모델은 주변 블록의 모든 샘플을 이용하여 유도된 선형 모델이다. 인코더 및 디코더는 상기 색차 샘플을 사용하여 색차 예측 블록을 구성할 수 있다.
구체적인 실시 예에서 인코더 및 디코더는 현재 블록의 휘도 샘플과 현재 블록의 휘도 샘플 주변의 미리 지정된 개수의 휘도 샘플, 도 19의 실시 예에서 (b)를 제1 임계치와 비교하여 제1 선형 모델에 속하는 휘도 샘플의 개수와 제2 선형 모델에 속하는 휘도 샘플의 개수를 계산할 수 있다. 제1 선형 모델에 속하는 휘도 샘플의 개수가 제1 미리 지정된 값보다 같거나 큰 경우, 인코더 및 디코더는 현재 블록의 휘도 샘플에 대응되는 색차 샘플을 제1 선형 모델만을 사용하여 예측할 수 있다. 제2 선형 모델의 개수가 제1 미리 지정된 값보다 같거나 큰 경우, 인코더 및 디코더는 현재 블록의 휘도 샘플에 대응되는 색차 샘플을 제2 선형 모델만을 사용하여 예측할 수 있다. 이때, 제1 미리 지정된 값은 6일 수 있다. 제1 선형 모델의 개수가 제2 선형 모델의 개수보다 큰 경우, 인코더 및 디코더는 제1 선형 모델에는 제1 가중치를 설정하고 제3 선형 모델에는 제2 가중치를 설정할 수 있다. 이때, 인코더 및 디코더는 제1 선형 모델을 사용하여 유도된 제1 색차 샘플과 제3 선형 모델을 사용하여 유도된 제2 색차 샘플들을 유도한 후, 제1 색차 샘플에는 제1 가중치, 제2 색차 샘플에는 제2 가중치를 사용하여 가중 평균하여 최종적으로 현재 블록의 휘도 샘플에 대응되는 색차 샘플을 유도할 수 있다. 제1 선형 모델에 속하는 휘도 샘플의 개수가 제2 선형 모델에 속하는 휘도 샘플의 개수보다 같거나 작은 경우, 인코더 및 디코더는 제2 선형 모델에 제1 가중치를 설정하고 제3 선형 모델에 제2 가중치를 설정할 수 있다. 이때, 인코더 및 디코더는 제2 선형 모델을 사용하여 유도된 제1 색차 샘플과 제3 선형 모델을 사용하여 유도된 제2 색차 샘플을 유도할 수 있다. 이때, 인코더 및 디코더는 제1 색차 샘플에 제1 가중치, 제2 색차 샘플에 제2 가중치를 사용하여 가중 평균하여 최종적으로 현재 블록의 휘도 샘플에 대응되는 색차 샘플을 유도할 수 있다. 이때, 제1 가중치 및 제2 가중치는 미리 지정된 값일 수 있다. 예컨대, 제1 가중치는 13일 수 있다. 또한, 제2 가중치는 3일 수 있다. 인코더 및 디코더는 상기 색차 샘플을 사용하여 색차 예측 블록을 구성할 수 있다.
또 다른 구체적인 실시 예에서 인코더 및 디코더는 현재 블록의 휘도 샘플과 제1 임계치, 예컨대 주변 블록의 휘도 샘플의 평균값 사이의 차이, 현재 블록의 휘도 샘플과 제2 임계치 사이의 차이, 또는 현재 블록의 휘도 샘플과 제3 임계치 사이의 차이를 기초로 제1 선형 모델, 제2 선형 모델 및 제3 선형 모델 각각을 사용할지 판단할 수 있다. 이때, 인코더 및 디코더가 복수의 모델을 사용하는 경우, 인코더 및 디코더는 복수의 모델을 가중 평균하여 색차 샘플을 유도할 수 있다. 현재 블록의 휘도 샘플과 제1 임계치 사이의 차이가 제2 임계치보다 큰 경우, 인코더 및 디코더는 현재 블록의 휘도 샘플과 제1 임계치를 비교한다. 현재 블록의 휘도 샘플이 제1 임계치보다 큰 경우, 인코더 및 디코더는 현재 블록의 휘도 샘플에 대응하는 색차 샘플을 제2 선형 모델을 사용하여 예측할 수 있다. 현재 블록의 휘도 샘플이 제1 임계치보다 같거나 작은 경우, 인코더 및 디코더는 현재 블록의 휘도 샘플에 대응하는 색차 샘플을 제1 선형 모델을 사용하여 예측할 수 있다. 현재 블록의 휘도 샘플과 제1 임계치 사이의 차이가 제2 임계치보다 같거나 작고 현재 블록의 휘도 샘플과 제1 임계치 사이의 차이가 제3 임계치보다 작은 경우, 인코더 및 디코더는 제1 선형 모델에 제3 가중치를 설정하고 제2 선형 모델에 제4 가중치를 설정하고, 제3 선형 모델에는 제5 가중치를 설정할 수 있다. 이때, 인코더 및 디코더는 제1 선형 모델을 사용하여 유도된 제1 색차 샘플, 제2 선형 모델을 사용하여 유도된 제2 색차 샘플, 및 제3 선형 모델을 사용하여 유도된 제3 색차 샘플을 유도할 수 있다. 인코더 및 디코더는 제1 색차 샘플에는 제3 가중치, 제2 색차 샘플에는 제4 가중치, 제3 색차 샘플에 제5 가중치를 사용하여 가중 평균하여 최종적으로 현재 블록의 휘도 샘플에 대응되는 색차 샘플을 유도할 수 있다. 이때, 제3 가중치, 제4 가중치 및 제5 가중치는 미리 지정된 값일 수 있다. 예컨대, 제3 가중치는 1일 수 있다, 또한, 제4 가중치는 1일 수 있다. 또한, 제5 가중치는 1일 수 있다. 현재 블록의 휘도 샘플과 제1 임계치 사이의 차이가 제3 임계치보다 같거나 큰 경우, 인코더 및 디코더는 현재 블록의 휘도 샘플과 제1 임계치를 비교할 수 있다. 현재 블록의 휘도 샘플이 제1 임계치보다 작거나 같은 경우, 인코더 및 디코더는 제1 선형 모델에 제1 가중치를 설정하고, 제3 선형 모델에 제2 가중치를 설정할 수 있다. 인코더 및 디코더는 제1 선형 모델을 사용하여 유도된 제1 색차 샘플과 제3 선형 모델을 사용하여 유도된 제2 색차 샘플들을 유도할 수 있다. 인코더 및 디코더는 제1 색차 샘플에 제1 가중치, 제2 색차 샘플에 제2 가중치를 사용하여 가중 평균하여 최종적으로 현재 블록의 휘도 샘플에 대응되는 색차 샘플을 유도할 수 있다. 현재 블록의 휘도 샘플이 제1 임계치보다 큰 경우, 인코더 및 디코더는 제2 선형 모델에 제1 가중치를 설정하고, 제3 선형 모델에 제2 가중치를 설정할 수 있다. 이때, 인코더 및 디코더는 제2 선형 모델을 사용하여 제1 색차 샘플을 유도하고, 제3 선형 모델을 사용하여 제2 색차 샘플들을 유도할 수 있다. 인코더 및 디코더는 제1 색차 샘플에 제1 가중치, 제2 색차 샘플에 제2 가중치를 사용하여 가중 평균하여 최종적으로 현재 블록의 휘도 샘플에 대응되는 색차 샘플을 유도할 수 있다. 제1 가중치 및 제2 가중치는 미리 지정된 값일 수 있다. 이때, 제1 가중치는 13일 수 있다. 또한, 제2 가중치는 3일 수 있다. 인코더 및 디코더는 상기 색차 샘플을 사용하여 색차 예측 블록을 구성할 수 있다.
인코더 및 디코더는 CF(Chroma Fusion)을 수학식 10과 같이, LM 모드를 사용하지 않고 일반적인 인트라 예측 모드를 통해 예측한 색차 블록(pred'C)과 현재 휘도 블록(rec'L) 사이의 가중치 평균을 통해 유도할 수 있다. 이때, 가중 파라미터(a0, a1, a2)는 CCCM 방식을 사용하여 유도될 수 있다. 중간값(midValue)은 1 << (bitDepth - 1)로 계산될 수 있다. 또한, 인코더는 하나의 CCCM 모델을 사용할 지 또는 2개의 CCCM 모델을 사용할 지를 지시하는 정보를 비트스트림에 포함시킬 수 있다. 현재 색차 블록이 CF 모드로 부호화된 경우, 디코더는 비트스트림으로부터 몇 개의 CCCM 모델을 사용하는지에 대한 정보를 파싱하고, 파싱한 정보를 기초로 현재 색차 블록을 예측할 수 있다.
수학식 10
Figure PCTKR2023016463-appb-img-000007
GL-CCCM(Gradient and location based convolutional cross-component model)은 그래디언트(Gradient)와 위치(location) 정보를 이용한 추가적인 CCCM 모드이다. 기존의 CCCM 모드는 예측할 색차 샘플 위치에 대응되는 위치의 휘도 샘플과 해당 휘도 샘플 주변의 4개 샘플, 도 19의 실시 예에서 (a), 그리고 모델의 계수 정보(수학식 11의 C0 내지 C6)를 사용하여 현재 블록에 대한 색차 샘플을 유도할 수 있다. GL-CCCM 모드는 도 19의 (b)와 같이, 예측할 색차 샘플 위치에서 대응되는 위치에 있는 휘도 샘플과, 해당 휘도 샘플 주변의 8개 샘플에 대한 수직 차이(수학식 11에서 Gy), 수평 차이(수학식 11에서 Gx)를 반영하고, 또한 현재 휘도 샘플의 위치 값(수학식 11에서 X, Y)과 그것의 모델 계수 정보(수학식 11의 C0 내지 C6)를 사용하여 현재 블록에 대한 색차 샘플을 유도할 수 있다. 이때 현재 휘도 샘플의 위치 값은 CCCM 모델을 유도하는 데 사용되는 참조 템플릿의 좌상단 위치, 현재 블록의 좌상단 위치, 현재 블록의 좌상단 위치를 (0,0)이라 했을 때 현재 픽셀의 상대적인 위치, 미리 지정된 오프셋 값과 미리 지정된 쉬프트값을 통해 재계산된 값이 사용될 수 있다. 이때, 현재 휘도 샘플의 위치 값은 (현재 블록의 좌상단 위치를 (0,0)이라 했을 때 현재 픽셀의 상대적인 위치값 + 현재 블록 좌상단 위치에서 CCCM 모델을 유도하는 데 사용되는 참조 템플릿의 좌상단 위치 간의 차이값 + 미리 지정된 오프셋값) << 미리 지정된 쉬프트값)을 통해 계산될 수 있다. 이때, 미리 지정된 오프셋값은 정수일 수 있다. 예컨대, 미리 지정된 오프셋값은 8일 수 있다. 또한, 미리 지정된 쉬프값은 정수일 수 있다. 예컨대, '3'일 수 있다. 또한, Gx, Gy는 도 19의 (b)의 샘플을 사용하여 수학식 12를 통해 계산될 수 있다.
수학식 11
Figure PCTKR2023016463-appb-img-000008
수학식 12
Figure PCTKR2023016463-appb-img-000009
모델 계수 정보, 즉 가중치 파라미터 정보는 현재 블록 주변의 이미 복원된 주변 블록의 미리 지정된 영역을 사용하여 유도될 수 있다. 모델 계수 정보는 도 17에서 설명한 것과 같이 LDL 분해(decomposition)가 사용하여 참조 샘플 영역으로부터 유도될 수 있다. 이때, 도 17의 (b)는 도 19의 (b)로 변경되어 적용될 수 있으며, 도 17의 (c)는 수학식 11로 변경되어 적용될 수 있다. 또한, 인코더는 현재 블록에 GL-CCCM가 사용되었는지에 대한 여부 정보를 지시하는 플래그를 비트스트림에 포함시킬 수 있다. 디코더는 비트스트림으로부터 해당 플래그 파싱하여 현재 블록에 GL-CCCM을 적용하여 색차 블록을 예측할지 결정할 수 있다.
GL-CCCM에서 휘도 샘플의 수직, 수평 차이를 계산하는데 사용되는 휘도 샘플은 현재 휘도 샘플 주변뿐만 아니라 미리 지정된 차이만큼 떨어진 주변 휘도 샘플이 사용될 수 있다. 이때, 미리 지정된 차이는 도 19에서는 1일 수 있고, 이외 2, 3, 4의 값을 가질 수 있다.
복원된 현재 휘도 블록을 이용하여 현재 색차 블록을 예측하는 LM 모드는 휘도와 색차 블록 간의 해상도 차이로 인해, 휘도 블록에 다운샘플링 필터를 적용하여 휘도 블록의 해상도를 색차 블록의 해상도와 동일하게 맞출 수 있다. 이러한 다운샘플링으로 인해 휘도 블록의 에지 성분 정보가 감소될 수 있다. 따라서, 인코더 및 디코더는 휘도 블록의 샘플들을 다운 샘플링하지 않고, 휘도 블록의 샘플들을 사용하여 색차 블록을 예측할 수 있다. 구체적으로 인코더 및 디코더는 다운 샘플링되기 전의 휘도 블록의 샘플들을 사용하여 색차 블록을 예측할 수 있다.
도 20 내지 도 21은 본 발명의 실시 예에 따른 CCCM-ND 모드에서 색차 샘플을 유도하기 위해 사용되는 다운샘플링되기 전의 휘도 샘플들을 보여준다.
CCCM-ND(CCCM using non-downsampled luma samples) 모드는 휘도 블록의 샘플들을 다운 샘플링하지 않고, 다운 샘플링되기 전의 휘도 블록의 샘플들을 사용하여 색차 블록을 예측하는 방법이다. 도 20은 예측할 색차 샘플 위치 C와 그 색차 샘플 위치에 대응되는 6개의 휘도 샘플 위치를 보여준다. 이때, 휘도 샘플은 다운샘플링되기 전의 샘플들이다. 색차 샘플은 수학식 13을 통해 계산되며, 6개의 휘도 샘플들, 도 20에서 L0, L1, L2, L3, L4, L5 샘플들을 사용한 선형 모델과 4개의 휘도 샘플들, 도 20에서 L0, L3, L2, L1 샘플들을 사용한 비선형 모델을 사용하여 계산될 수 있다. 수학식 13에서 offsetLuma, offsetchroma는 명세서 내에서 설명한 차분값과 동일한 의미이다. B는 1 << (bitDepth - 1)로 계산될 수 있다. 계수(a0 내지 a10)를 유도하기 위해서 CCCM에서 사용된 LDL 분해(decomposition)가 사용될 수 있다.
수학식 13
Figure PCTKR2023016463-appb-img-000010
인코더는 현재 블록에 CCCM-ND가 적용되었는지를 지시하는 플래그를 비트스트림에 포함시킬 수 있다. 디코더는 비트스트림으로부터 해당 플래그를 파싱하여 현재 블록에 CCCM-ND가 적용되는지 판단할 수 있다. 현재 블록에 CCCM-ND가 적용된 경우, 인코더는 GL-CCCM에 대한 정보를 비트스트림에 포함시키지 않을 수 있다. 현재 블록에 CCCM-ND가 적용된 경우, 디코더는 GL-CCCM과 관련된 정보를 파싱하지 않을 수 있다. 또한, 디코더는 현재 블록에 GL-CCCM을 적용하지 않는 것으로 판단할 수 있다.
인코더 및 디코더는 GL-CCCM에서 다운샘플링된 휘도 샘플을 사용하여 모델을 유도하고, 현재 블록의 다운 샘플링된 휘도 샘플을 사용하여 현재 블록에 대한 색차 샘플을 예측할 수 있다. 이때, GL-CCCM에서도 CCCM-ND와 같이, 다운샘플링되기 전의 휘도 샘플을 사용하여 모델을 유도하거나 색차 샘플을 예측하는데 사용할 수 있다.
수학식 14
Figure PCTKR2023016463-appb-img-000011
색차 샘플은 수학식 14을 통해 계산되며, 6개의 휘도 샘플, 도 20에서 L0, L1, L2, L3, L4, L5 휘도 샘플을 사용한 선형 모델과 4개의 휘도 샘플, 도 20에서 L0, L3, L2, L1 휘도 샘플을 사용한 비선형 모델, 예측할 색차 샘플 위치에 대응되는 위치의 휘도 샘플과, 해당 휘도 샘플 주변의 샘플(도 20에서 L1 내지 L8 휘도 샘플)에 대한 수직 차이(수학식 14에서 Gy), 수평 차이(수학식 14에서 Gx)를 반영하고, 현재 휘도 샘플의 위치 값(수학식 14에서 X, Y)과 계수 정보를 사용하여 현재 블록에 대한 색차 샘플을 유도할 수 있다. 이때, 인코더 및 디코더는 Gx, Gy를 도 20의 샘플을 사용하여 수학식 15를 통해 계산할 수 있다. 수학식 14에서 offsetLuma, offsetchroma는 명세서 내에서 설명한 차분값과 동일한 의미이다. B는 1 << (bitDepth - 1)로 계산될 수 있다. 계수(a0 내지 a14)를 유도하기 위해서 CCCM에서 사용된 LDL 분해(decomposition) 방식이 사용될 수 있다.
수학식 15
Figure PCTKR2023016463-appb-img-000012
또 다른 구체적인 실시 예에서 도20의 휘도 샘플들 대신에 도21의 휘도 샘플들이 사용될 수 있으며, 현재 색차 샘플 아래의 샘플들인 L6, L7, L8의 휘도 샘플이 사용될 수 있다.
CCCM-ND에서 사용되는 휘도 샘플들은 현재 색차 샘플에 대응되는 휘도 샘플 주변뿐만 아니라 미리 지정된 차이만큼 떨어진 주변 휘도 샘플들이 사용될 수 있다. 이때, 인코더 및 디코더는 도 21과 같이, 미리 지정된 위치가 1일 경우 L0 내지 L8을 사용하고, 미리 지정된 위치가 2일 경우, L0 내지 L8, I0 내지 I15 휘도 샘플 중에서 적어도 하나 이상을 사용하여 색차 샘플을 예측할 수 있다.
현재 블록의 휘도 블록을 통해 색차 블록을 예측할 때, 인코더 및 디코더는 GL-CCCM과 CCCM-ND를 선택적으로 적용할 수 있다. 구체적으로 인코더 및 디코더가 색차 블록을 예측할 때, 인코더 및 디코더는 GL-CCCM을 사용하여 색차 블록 예측하는 모드, CCCM-ND을 사용하여 색차 블록 예측하는 모드, GL-CCCM과 CCCM-ND를 모두 사용하여 색차 블록 예측하는 모드 중 하나의 모드를 선택할 수 있다.
현재 블록의 휘도 블록을 통해 색차 블록을 예측할 때, GL-CCCM만을 사용하여 색차 블록 예측하는 경우, 인코더는 CCCM-ND 사용 여부를 지시하는 플래그의 값을 0으로 설정하고, GL-CCCM 사용 여부를 지시하는 플래그를 1로 설정하여, 두 플래그를 비트스트림에 포함시킬 수 있다. 디코더는 두 플래그를 비트스트림으로부터 파싱하고, 두 플래그를 기초로 현재 블록의 색차 블록을 예측할 때 사용하는 모드를 GL-CCCM만을 사용하여 색차 블록 예측하는 것으로 판단할 수 있다.
현재 블록의 휘도 블록을 통해 색차 블록을 예측할 때, CCCM-ND만을 사용하여 색차 블록 예측하는 모드가 적용되는 경우, 인코더는 CCCM-ND 사용 여부를 지시하는 플래그의 값을 1로 설정하고 GL-CCCM의 사용 여부를 지시하는 플래그의 값을 0으로 설정하여 2개의 플래그를 비트스트림에 포함시킬 수 있다. 디코더는 비트스트림으로부터 2개의 플래그를 파싱하고, 파싱된 2개의 플래그를 기초로 현재 블록의 색차 블록을 예측할 때 사용하는 모드를 CCCM-ND만을 사용하여 색차 블록 예측하는 것으로 판단할 수 있다.
현재 블록의 휘도 블록을 통해 색차 블록을 예측할 때, GL-CCCM과 CCCM-ND를 모두 사용하여 색차 블록 예측하는 모드가 적용된 경우, CCCM-ND 사용 여부를 지시하는 플래그의 값을 1로 설정하고 GL-CCCM의 사용 여부를 지시하는 플래그의 값을 1로 설정하여 2개의 플래그를 비트스트림에 포함시킬 수 있다. 디코더는 비트스트림으로부터 2개의 플래그를 파싱하고, 파싱된 2개의 플래그를 기초로 현재 블록의 색차 블록을 예측할 때 사용하는 모드를 GL-CCCM과 CCCM-ND를 모두 사용하여 색차 블록 예측하는것으로 판단할 수 있다.
CCCM은 현재 블록에 인접한 주변 블록의 휘도 샘플과 색차 샘플 사이의 상관성을 이용하여 선형 및 비선형 모델을 유도한 후, 현재 블록의 복원된 휘도 샘플을 이용하여 현재 블록의 색차 샘플을 예측하는 방법이다.
이러한 2가지 신호 사이의 상관성을 이용한 방법에 적용될 수 있는 실시 예들에 설명한다.
도 22 및 도 23은 본 발명의 실시 예에 따른 CCRM(cross-component residual model)의 블록도를 보여준다.
도 22와 같이, 현재 블록에 인터 부호화 모드가 적용된 경우, 인코더 및 디코더는 현재 블록의 움직임 정보를 이용하여 현재 블록의 휘도 예측 블록(Y')과 현재 블록의 제1 색차 예측 블록(Cb', Cr')을 생성하고, 현재 블록의 휘도 예측 블록(Y')과 현재 블록의 제1 색차 예측 블록(Cb', Cr') 사이의 CCP 모델을 획득할 수 있다. 인코더 및 디코더는 현재 블록의 휘도 오차 블록을 이용하여 현재 블록의 복원된 휘도 블록을 생성할 수 있다. 인코더 및 디코더는 유도된 CCP 모델을 현재 블록의 복원된 휘도 블록에 적용하여 현재 블록의 제2 색차 예측 블록(fCb, fCr)을 생성할 수 있다. 인코더 및 디코더는 CCP 모델을 이용하여 예측된 현재 블록의 제2 색차 예측 블록에 색차 오차 블록을 더하여 최종적으로 현재 블록의 색차 블록(Cb, Cr)을 생성할 수 있다. 이를 CCRM(cross-component residual model)이라 지칭한다. CCRM은 다음과 실시 예들로 변형될 수 있다.
인코더 및 디코더는 유도된 CCP 모델을 사용하여 샘플 단위로 색차 샘플을 생성한 후, 색차 샘플을 이용하여 색차 예측 블록을 획득할 수 있다.
구체적으로, 도 22와 같이, 현재 블록에 인터 부호화 모드가 적용된 경우, 인코더 및 디코더는 현재 블록의 움직임 정보를 이용하여 현재 블록의 휘도 예측 블록(Y')과 현재 블록의 제1 색차 예측 블록(Cb', Cr')을 생성하고, 현재 블록의 휘도 예측 블록(Y')과 현재 블록의 제1 색차 예측 블록(Cb', Cr') 사이의 CCP 모델을 획득할 수 있다. 인코더 및 디코더는 현재 블록의 휘도 오차 블록을 이용하여 현재 블록의 복원된 휘도 블록을 생성할 수 있다. 인코더 및 디코더는 유도된 CCP 모델을 현재 블록의 복원된 휘도 샘플에 적용하여 현재 블록의 색차 예측 샘플을 생성할 수 있다. 인코더 및 디코더는 CCP 모델을 이용하여 예측된 현재 블록의 제2 색차 예측 샘플들을 사용하여 제2 색차 예측 블록(fCb, fCr)을 구성하고, 제2 색차 예측 블록에 색차 오차 블록을 더하여 최종적으로 현재 블록의 색차 블록을 생성할 수 있다.
구체적인 실시 예에서 인코더 및 디코더는 도 22에서 CCP 모델을 이용하여 예측된 현재 블록의 제2 색차 예측 블록(fCb, fCr)과 도 22의 제1 색차 예측 블록(Cb', Cr') 사이의 가중 평균을 통해 제3 색차 예측 블록을 생성할 수 있다. 이때, 인코더 및 디코더는 제1 색차 예측 블록에는 제1 가중치를 적용하고 제2 색차 예측 블록에는 제2 가중치를 적용할 수 있다. 이때, 제1 가중치와 제2 가중치는 미리 정의된 값이고, 정수일 수 있다. 또한, 제1 가중치는 제2 가중치보다 작은 값일 수 있다. 예컨대, 제1 가중치는 3일 수 있다. 또한, 제2 가중치는 13일 수 있다. 예컨대, 제1 가중치는 1일 수 있다. 또한, 제2 가중치는 3일 수 있다. 인코더 및 디코더는 제3 색차 예측 블록에 색차 오차 블록을 더하여 최종적으로 현재 블록의 색차 블록(Cb, Cr)을 생성할 수 있다. 인코더는 제1 가중치와 제2 가중치의 최적의 가중치 값을 지시하는 정보를 비트스트림에 포함시킬 수 있다. 현재 블록에 CCRM이 적용된 경우, 디코더는 제1 가중치와 제2 가중치의 최적의 가중치 값을 지시하는 정보를 파싱하고, 파싱한 정보를 사용하여 현재 블록의 색차 예측 블록을 생성할 수 있다.
인코더 및 디코더는 유도된 CCP 모델을 사용하여 샘플 단위로 색차 샘플을 생성한 후, 색차 샘플을 이용하여 색차 예측 블록을 획득할 수 있다. 여기서 CCP 모델은 CCLM, MMLM, GLM, CCCM, MM-CCCM, GL-CCCM, CCCM-ND, CCCM-MDF 가 있으며, 여기서 CCLM, MMLM 는 선형 모델이고, GLM, CCCM, MM-CCCM, GL-CCCM, CCCM-ND, CCCM-MDF 는 비선형 모델일 수 있다. 즉, CCP 모델은 CCLM, MMLM, GLM, CCCM, MM-CCCM, GL-CCCM, CCCM-ND, CCCM-MDF 중에 하나의 CCP 모델일 수 있다.
구체적인 실시 예에서 인코더 및 디코더는 도 22에서 CCP 모델을 이용하여 예측된 현재 블록의 제2 색차 예측 샘플과 도 22의 제1 색차 예측 블록(Cb', Cr')에서 제2 색차 예측 샘플에 대응되는 제1 색차 예측 샘플 사이의 가중 평균을 통해 제3 색차 예측 샘플을 생성할 수 있다. 이때, 제2 색차 예측 샘플이 현재 블록의 좌상단 위치의 샘플일 경우, 제1 색차 예측 샘플은 도 22의 제1 색차 예측 블록(Cb', Cr')에서 좌상단 위치의 샘플을 의미한다. 이때, 인코더 및 디코더는 제1 색차 예측 샘플에는 제1 가중치를 적용하고 제2 색차 예측 샘플에는 제2 가중치를 적용할 수 있다. 이때, 제1 가중치와 제2 가중치는 미리 정의된 값이고, 정수일 수 있다. 또한, 제1 가중치는 제2 가중치보다 작은 값일 수 있다. 예컨대, 제1 가중치는 3일 수 있다. 또한, 제2 가중치는 13일 수 있다. 예컨대, 제1 가중치는 1일 수 있다. 또한, 제2 가중치는 3일 수 있다. 인코더 및 디코더는 제3 색차 예측 샘플을 사용하여 제3 색차 예측 블록을 구성할 수 있다. 인코더 및 디코더는 제3 색차 예측 블록에 색차 오차 블록을 더하여 최종적으로 현재 블록의 색차 블록(Cb, Cr)을 생성할 수 있다. 인코더는 제1 가중치와 제2 가중치의 최적의 가중치 값을 지시하는 정보를 비트스트림에 포함시킬 수 있다. 현재 블록에 CCRM이 적용된 경우, 디코더는 제1 가중치와 제2 가중치의 최적의 가중치 값을 지시하는 정보를 파싱하고, 파싱한 정보를 사용하여 현재 블록의 색차 예측 블록을 생성할 수 있다.
또 다른 구체적인 실시 예에서, 도 23과 같이, 현재 블록이 인터 부호화 모드가 적용된 경우, 인코더 및 디코더는 현재 블록에 대한 예측 블록을 생성하는데 사용된 움직임 정보들을 이용하여 하나 이상의 CCP 모델을 유도하고, 하나 이상의 CCP 모델을 선택적으로 사용하여 현재 블록의 색차 블록을 예측할 수 있다. 이때, 인코더는 어떤 모델이 사용되는지에 대한 정보를 비트스트림에 포함시킬 수 있다. 디코더는 어떤 모델을 사용할지에 대한 정보를 파싱하고, 파싱한 정보가 지시하는 모델을 사용하여 현재 블록의 색차 블록을 예측할 수 있다. 구체적으로 현재 블록이 인터 부호화 모드이고 현재 블록에 양방향 움직임 예측이 적용될 수 있다. 이때, 인코더 및 디코더는 양방향 움직임을 통해 가중 평균된 현재 블록의 예측 휘도 블록과 색차 블록을 사용하여 선형 및 비선형 모델을 유도할 수 있다. 또 다른 구체적인 실시 예에서 인코더 및 디코더는 L0 움직임을 통해 생성된 현재 블록의 예측 휘도 블록과 색차 블록을 사용하여 CCP 모델을 유도할 수 있다. 또 다른 구체적인 실시 예에서 인코더 및 디코더는 L1 움직임을 통해 생성된 현재 블록의 예측 휘도 블록과 색차 블록을 사용하여 CCP 모델을 유도할 수 있다. 현재 블록에 양방향 움직임 예측이 적용된 경우, 인코더는 L0와 L1 중 어떤 움직임 정보가 CCP 모델을 유도하는데 사용되는지에 대한 정보를 비트스트림에 포함시킬 수 있다. 디코더는 비트스트림으로부터 L0와 L1 중 어떤 움직임 정보가 CCP 모델을 유도하는데 사용되는지에 대한 정보를 파싱하고, 파싱된 정보를 이용하여 L0와 L1을 통해 유도된 CCP 모델 중 하나를 사용하여 현재 블록의 색차 예측 블록을 생성할 수 있다. 인코더 및 디코더는 생성된 색차 예측 블록에 색차 오차 블록을 더하여 최종적으로 현재 블록의 색차 블록(Cb, Cr)을 생성할 수 있다.
현재 블록이 인터 부호화 모드이고 현재 블록에 양방향 움직임 예측이 적용된 경우, 인코더 및 디코더는 L0 움직임 정보를 통해 생성된 제1 휘도 예측 블록과 제1 색차 예측 블록을 이용하여 제1 CCP 모델을 유도할 수 있다. 이때, 인코더 및 디코더는 L1 움직임 정보를 통해 생성된 제2 휘도 예측 블록과 제2 색차 예측 블록을 이용하여 제2 CCP 모델을 유도할 수 있다. 인코더 및 디코더는 현재 블록의 휘도 오차 블록을 이용하여 현재 블록의 복원된 휘도 블록을 생성할 수 있다. 인코더 및 디코더는 유도된 제1 CCP 모델을 현재 블록의 복원된 휘도 블록에 적용하여 현재 블록의 제3 색차 예측 블록을 생성하고, 유도된 제2 CCP 모델을 현재 블록의 복원된 휘도 블록에 적용하여 현재 블록의 제4 색차 예측 블록을 생성할 수 있다. 인코더 및 디코더는 제1, 제2, 제3, 제4 색차 예측 블록과 각각의 제1, 제2, 제3, 제4 가중치를 사용하여 가중 평균된 제5 색차 예측 블록을 생성할 수 있다. 이때, 제1, 제2, 제3, 제4 가중치는 미리 정의된 값이고, 정수일 수 있다. 인코더 및 디코더는 제5 색차 예측 블록에 색차 오차 블록을 더하여 최종적으로 현재 블록의 색차 블록(Cb, Cr)을 생성할 수 있다.
도 22를 통해 설명한 실시 예들에서는 CCP 모델을 유도하기 위해, 현재 블록의 움직임 정보를 이용하여 예측된 블록(Y', Cb', Cr')을 이용한다. 이때, 예측된 블록(Y', Cb', Cr')은 현재 블록에 대한 참조 블록 일 수 있다. CCP 모델의 성능을 향상시키기 위해, 인코더 및 디코더는 현재 블록에 대한 참조 블록뿐만 아니라 현재 블록에 인접한 주변 블록의 샘플을 추가적으로 이용하여 CCP 모델을 유도할 수 있다.
구체적으로 현재 블록에 인터 부호화 모드가 적용된 경우, 인코더 및 디코더는 현재 블록에 인접한 주변 블록의 제1 휘도 예측 샘플과 제1 색차 예측 샘플, 현재 블록의 움직임 정보를 이용하여 획득한 현재 블록에 대한 참조 블록의 제2 휘도 예측 샘플과 제2 색차 예측 샘플을 모두 이용하여 CCP 모델을 유도할 수 있다. 인코더 및 디코더는 현재 블록에 대한 참조 휘도 블록에 현재 블록의 휘도 오차 블록을 더하여 현재 블록의 복원된 휘도 블록을 생성할 수 있다. 인코더 및 디코더는 유도된 CCP 모델을 현재 블록의 복원된 휘도 블록에 적용하여 현재 블록의 색차 예측 블록을 생성할 수 있다. 인코더 및 디코더는 유도된 CCP 모델을 이용하여 예측된 현재 블록의 색차 예측 블록에 색차 오차 블록을 더하여 최종적으로 현재 블록의 색차 블록을 생성할 수 있다.
구체적으로 현재 블록에 인터 부호화 모드가 적용된 경우, 인코더 및 디코더는 현재 블록에 인접한 주변 블록의 제1 휘도 예측 샘플과 제1 색차 예측 샘플을 이용하여 제1 CCP 모델을 유도할 수 있다. 또한, 현재 블록의 움직임 정보를 이용하여 획득한 현재 블록에 대한 참조 블록의 제2 휘도 예측 샘플과 제2 색차 예측 샘플을 이용하여 제2 CCP 모델을 유도할 수 있다. 인코더 및 디코더는 현재 블록에 대한 참조 휘도 블록에 현재 블록의 휘도 오차 블록을 더하여 현재 블록의 복원된 휘도 블록을 생성할 수 있다. 인코더 및 디코더는 유도된 제1 CCP 모델을 현재 블록의 복원된 휘도 블록에 적용하여 현재 블록의 제3 색차 예측 블록을 생성할 수 있다. 또한, 인코더 및 디코더는 유도된 제2 CCP 모델을 현재 블록의 복원된 휘도 블록에 적용하여 현재 블록의 제4 색차 예측 블록을 생성할 수 있다. 인코더 및 디코더는 제3 색차 예측 블록과 제4 색차 예측 블록 사이의 가중 평균을 통해 제5 색차 예측 블록을 생성할 수 있다. 인코더 및 디코더는 제3 색차 예측 블록에는 제1 가중치를 적용하고, 제4 색차 예측 블록에는 제2 가중치를 적용할 수 있다. 이때, 제1 가중치와 제2 가중치는 미리 정의된 값이고, 정수일 수 있다. 또한, 제1 가중치는 제2 가중치보다 작은 값일 수 있다. 예컨대, 제1 가중치는 3일 수 있다. 또한, 제2 가중치는 13일 수 있다. 예컨대, 제1 가중치는 1일 수 있다. 또한, 제2 가중치는 3일 수 있다. 인코더 및 디코더는 제5 색차 예측 블록에 색차 오차 블록을 더하여 최종적으로 현재 블록의 색차 블록을 생성할 수 있다.
CCRM이 적용될 때, 인코더 및 디코더는 본 명세서에서 설명된 CCCM, GL-CCCM, CCCM-ND, GLM 중에서 어느 하나의 방법을 사용하여 선형 및 비선형 모델을 유도할 수 있다.
만일 현재 블록에 대응되는 참조 블록에 CCRM이 적용된 경우, 인코더 및 디코더는 현재 블록에는 CCRM을 위한 CCP 모델을 유도하지 않고, 참조 블록에서 사용된 CCRM의 CCP 모델을 현재 블록에 적용할 수 있다. 즉, 인코더 및 디코더는 참조 블록에서 사용된 CCRM의 CCP 모델을 현재 블록의 복원된 휘도 블록에 적용하여 현재 블록의 색차 예측 블록을 생성할 수 있다. 또는, 인코더 및 디코더는 참조 블록들로부터 CCP 모델 리스트를 구성할 수 있다. 이때, 인코더 및 디코더는 CCP 모델 리스트를 템플릿 코스트를 기초하여 재정렬할 수 있다. 인코더는 CCP 모델 리스트에서 현재 블록에 대한 최적의 CCP 모델의 인덱스 정보를 비트스트림에 포함시킬 수 있다. 디코더는 비트스트림으로부터 최적의 CCP 모델의 인덱스 정보를 파싱하여, CCP 모델 리스트로부터 현재 블록에 대한 최적 CCP 모델을 선택할 수 있다.
현재 블록에 AMVP, 머지, amvp-merge, IntraTMP, IBC, 및 merge-TM 모드 중 어느 하나가 적용되고, 현재 블록의 휘도 블록에 오차 신호가 존재하는 경우, 인코더는 현재 블록에 CCRM을 적용할지 지시하는 정보를 비트스트림에 포함시킬 수 있다. 현재 블록의 휘도 블록에 오차 신호가 존재하는 경우, 디코더는 비트스트림으로부터 현재 블록에 CCRM을 적용할지 지시하는 정보를 파싱하고, 파싱한 정보를 기초로 현재 블록에 CCRM을 적용할 지 결정할 수 있다.
만일 현재 블록에 OBMC, MHP, LIC, DMVR, BDOF, PROF, BCW, Affine, GPM, CIIP, IBC-GPM, IBC-CIIP, 및 IBC-LIC 중 어떤 부호화 모드가 적용된 경우, 현재 블록에 CCRM 방법이 사용되지 않을 수 있다. 현재 블록에 OBMC, MHP, LIC, DMVR, BDOF, PROF, BCW, Affine, GPM, CIIP, IBC-GPM, IBC-CIIP, 및 IBC-LIC 중 어떤 부호화 모드가 적용된 경우, 인코더는 현재 블록에 CCRM과 관련된 정보를 비트스트림에 포함시키지 않을 수 있다. 현재 블록에 OBMC, MHP, LIC, DMVR, BDOF, PROF, BCW, Affine, GPM, CIIP, IBC-GPM, IBC-CIIP, 및 IBC-LIC 중 어떤 부호화 모드가 적용된 경우, 디코더는 현재 블록에 CCRM과 관련된 정보를 파싱하지 않을 수 있다. 이때, 인코더는 현재 블록에 CCRM을 적용하지 않는 것으로 판단할 수 있다.
CCRM이 수행될 때, 현재 블록의 휘도 예측 블록과 색차 예측 블록 사이의 상관성뿐만 아니라 휘도 예측 블록과 휘도 복원 블록 사이의 상관성이 사용될 수 있다. 이러한 실시 예들에 대해서는 도 24를 통해 설명한다.
도 24는 본 발명의 실시 예에 따라 휘도 예측 블록과 휘도 복원 블록 사이의 상관성을 이용하여 CCRM이 수행되는 것을 보여준다.
현재 블록이 인터 부호화 모드가 적용된 경우, 인코더 및 디코더는 현재 블록의 움직임 정보가 지시하는 제1 휘도 참조 블록(도 24의 (a) RefA)을 제1 휘도 복원 블록으로 설정하고, 제1 휘도 복원 블록의 움직임 정보가 지시하는 제2 휘도 참조 블록(도 24의 (a) RefB)과 제1 휘도 복원 블록을 이용하여 CCP 모델을 유도할 수 있다. 인코더 및 디코더는 유도된 선형 및 비선형 모델을 제1 휘도 참조 블록(도 24의 (a) RefA)에 적용하여 현재 블록의 휘도 예측 블록을 생성할 수 있다. 현재 블록의 휘도 예측 블록과 제1 휘도 참조 블록(도 24의 (a) RefA) 사이의 가중 평균을 사용해 가중 평균된 현재 블록의 휘도 예측 블록을 생성할 수 있다.
현재 블록이 인터 부호화 모드가 적용되고 양방향 움직임을 통해 예측된 경우, 인코더 및 디코더는 현재 블록의 L0 움직임 정보가 지시하는 제1 휘도 참조 블록과 현재 블록의 L1 움직임 정보가 지시하는 제2 휘도 참조 블록을 이용하여 CCP 모델을 유도할 수 있다. 인코더 및 디코더는 유도된 CCP 모델을 제1 휘도 참조 블록과 제2 휘도 참조 블록에 각각 적용하여 현재 블록의 제1, 제2 휘도 예측 블록을 생성할 수 있다. 인코더 및 디코더는 현재 블록의 제1, 제2 휘도 예측 블록과 제1, 제2 휘도 참조 블록 사이의 가중 평균을 통해 가중 평균된 현재 블록의 휘도 예측 블록을 생성할 수 있다. 색차 성분들에 대해서도 상기 언급된 휘도 블록의 예측 블록 생성 방법이 적용될 수 있다. 인코더 및 디코더는 색차 성분별로 CCP 모델을 유도하여 색차 블록 예측에 적용할 수 있다.
현재 블록에 인터 부호화 모드가 적용되고 양방향 움직임을 통해 예측된 경우, 인코더 및 디코더는 만일 현재 블록에 인접한 주변 블록(도 24의 (b)에서 A)과 A블록에 대한 휘도 예측 블록(도 24의 (b)에서 RefA0, RefA1)을 이용하여 CCP 모델을 유도할 수 있다. 인코더 및 디코더는 유도된 CCP 모델을 현재 블록의 휘도 예측 블록(Ref0, Ref1)에 적용하여, 현재 블록의 제1, 제2 휘도 예측 블록을 생성할 수 있다. 인코더 및 디코더는 현재 블록의 제1, 제2 휘도 예측 블록과 현재 블록의 예측 블록(Ref0, Ref1) 사이의 가중 평균을 사용해 가중 평균된 현재 블록의 휘도 예측 블록을 생성할 수 있다. 현재 블록에 인터 부호화 모드가 적용되고 양방향 움직임으로 예측된 경우, 색차 성분에 대해서도 앞서 설명한 휘도 블록의 예측 블록 생성 방법이 적용될 수 있다. 또한, 인코더 및 디코더는 색차 성분별로 CCP 모델을 유도하여 색차 블록 예측 적용할 수 있다.
본 명세서에서 상술한 방법들은 디코더 또는 인코더의 프로세서를 통해 수행될 수 있다. 또한, 인코더는 비디오 신호 처리 방법에 의해 디코딩되는 비트스트림을 생성할 수 있다. 또한, 인코더가 생성한 비트스트림은 컴퓨터 판독 가능한 비 일시적 저장 매체(기록 매체)에 저장될 수 있다.
본 명세서는 주로 디코더 관점에서 기술되었으나 인코더에서도 동일하게 동작될 수 있다. 본 명세서의 파싱이라는 용어는 비트스트림으로부터 정보를 획득하는 과정을 중점으로하여 설명되었으나 인코더 측면에서는 비트스트림에 해당 정보를 생성하는 것으로 해석될 수 있다. 따라서 파싱이라는 용어는 디코더 동작으로만 한정되지 않고 인코더에서는 비트스트림을 생성하는 행위로까지 해석될 수 있다. 또한, 이러한 비트스트림은 컴퓨터 판독 가능한 기록 매체에 저장되어 생성될 수 있다.
상술한 본 발명의 실시예들은 다양한 수단을 통해 구현될 수 있다. 예를 들어, 본 발명의 실시예들은 하드웨어, 펌웨어(firmware), 소프트웨어 또는 그것들의 결합 등에 의해 구현될 수 있다.
하드웨어에 의한 구현의 경우, 본 발명의 실시예들에 따른 방법은 하나 또는 그 이상의 ASICs(Application Specific Integrated Circuits), DSPs(Digital Signal Processors), DSPDs(Digital Signal Processing Devices), PLDs(Programmable Logic Devices), FPGAs(Field Programmable Gate Arrays), 프로세서, 컨트롤러, 마이크로 컨트롤러, 마이크로 프로세서 등에 의해 구현될 수 있다.
펌웨어나 소프트웨어에 의한 구현의 경우, 본 발명의 실시예들에 따른 방법은 이상에서 설명된 기능 또는 동작들을 수행하는 모듈, 절차 또는 함수 등의 형태로 구현될 수 있다. 소프트웨어 코드는 메모리에 저장되어 프로세서에 의해 구동될 수 있다. 상기 메모리는 프로세서의 내부 또는 외부에 위치할 수 있으며, 이미 공지된 다양한 수단에 의해 프로세서와 데이터를 주고받을 수 있다.
일부 실시예는 컴퓨터에 의해 실행되는 프로그램 모듈과 같은 컴퓨터에 의해 실행가능한 명령어를 포함하는 기록 매체의 형태로도 구현될 수 있다. 컴퓨터 판독 가능 매체는 컴퓨터에 의해 액세스될 수 있는 임의의 가용 매체일 수 있고, 휘발성 및 비휘발성 매체, 분리형 및 비분리형 매체를 모두 포함한다. 또한, 컴퓨터 판독 가능 매체는 컴퓨터 저장 매체 및 통신 매체를 모두 포함할 수 있다. 컴퓨터 저장 매체는 컴퓨터 판독가능 명령어, 데이터 구조, 프로그램 모듈 또는 기타 데이터와 같은 정보의 저장을 위한 임의의 방법 또는 기술로 구현된 휘발성 및 비휘발성, 분리형 및 비분리형 매체를 모두 포함한다. 통신 매체는 전형적으로 컴퓨터 판독가능 명령어, 데이터 구조 또는 프로그램 모듈과 같은 변조된 데이터 신호의 기타 데이터, 또는 기타 전송 메커니즘을 포함하며, 임의의 정보 전달 매체를 포함한다.
전술한 본 발명의 설명은 예시를 위한 것이며, 본 발명이 속하는 기술분야의 통상의 지식을 가진 자는 본 발명의 기술적 사상이나 필수적인 특징을 변경하지 않고서 다른 구체적인 형태로 쉽게 변형이 가능하다는 것을 이해할 수 있을 것이다. 그러므로 이상에서 기술한 실시예들은 모든 면에서 예시적인 것이며 한정적인 것이 아는 것으로 해석해야 한다. 예를 들어, 단일형으로 설명되어 있는 각 생성 요소는 분산되어 실시될 수도 있으며, 마찬가지로 분산된 것으로 설명되어 있는 생성 요소들도 결합된 형태로 실시될 수 있다.
본 발명의 범위는 상기 상세한 설명보다는 후술하는 특허청구범위에 의하여 나타내어지며, 특허청구범위의 의미 및 범위 그리고 그 균등 개념으로부터 도출되는 모든 변경 또는 변형된 형태가 본 발명의 범위에 포함되는 것으로 해석되어야 한다.

Claims (24)

  1. 비디오 신호를 디코딩하는 디코딩 장치에서,
    프로세서를 포함하고,
    상기 프로세서는
    현재 블록의 주변 휘도 샘플과 상기 현재 블록의 주변 휘도 샘플에 대응되는 색차 샘플, 참조 블록의 주변 휘도 샘플과 상기 참조 블록의 주변 휘도 샘플에 대응되는 색차 샘플 중 적어도 하나의 샘플의 값을 기초로 상기 현재 블록의 휘도 샘플의 값과 상기 현재 블록의 색차 샘플의 값의 관계를 모델링하는 모델을 획득하고,
    상기 획득한 모델과 현재 블록의 휘도 블록을 사용하여 상기 현재 블록의 색차 블록을 예측하는
    디코딩 장치.
  2. 제1항에서,
    상기 프로세서는
    상기 획득한 모델과 현재 블록의 휘도 블록을 사용하여 색차 예측 블록을 생성하고,
    상기 색차 예측 블록에 오차 블록을 더하여 상기 현재 블록의 색차 블록을 복원하는
    디코딩 장치.
  3. 제1항에서,
    상기 프로세서는
    상기 디코딩 장치가 상기 모델을 획득할 때, 제1 모델과 제2 모델을 획득하고,
    상기 현재 블록의 휘도 샘플과 상기 제1 모델을 사용하여 제1 색차 예측 샘플을 생성하고,
    상기 현재 블록의 휘도 샘플과 상기 제2 모델을 사용하여 제2 색차 예측 샘플을 생성하고,
    상기 제1 색차 예측 샘플과 상기 제2 색차 예측 샘플을 가중 평균하여 제3 색차 예측 샘플을 생성하고,
    상기 제3 색차 예측 샘플을 사용하여 색차 예측 블록을 생성하고,
    상기 색차 예측 블록에 오차블록을 더하여 상기 현재 블록의 색차 블록을 복원하는
    디코딩 장치.
  4. 제3항에서,
    상기 프로세서는
    상기 현재 블록이 인터 부호화 모드로 부호화되고, 양방향 예측이 적용된 경우, L0 움직임 정보를 사용하여 예측한 제1 예측 블록을 사용하여 상기 제1 모델을 유도하고, L1 움직임 정보를 사용하여 예측한 제2 예측 블록을 사용하여 상기 제2 모델을 유도하는
    디코딩 장치.
  5. 제2항에서,
    상기 모델에 입력되는 입력값은 상기 현재 블록의 휘도 샘플의 값에서 미리 지정된 제1 오프셋 값만큼 뺀 값과 상기 현재 블록의 Cb 색차 샘플의 값에서 미리 지정된 제2 오프셋 값만큼 뺀 값과 상기 현재 블록의 Cr 색차 샘플의 값에서 미리 지정된 제3 오프셋 값만큼 뺀 값을 포함하는
    디코딩 장치.
  6. 제5항에서,
    상기 미리 지정된 제1 오프셋 값은 상기 현재 블록의 주변 샘플 중 미리 지정된 위치의 휘도 샘플의 값이고,
    상기 미리 지정된 제2 오프셋 값은 상기 미리 지정된 위치의 Cb 색차 샘플의 값이고,
    상기 미리 지정된 제3 오프셋 값은 상기 미리 지정된 위치의 Cr 색차 샘플의 값인
    디코딩 장치.
  7. 제6항에서,
    상기 프로세서는
    상기 미리 지정된 위치의 휘도 샘플의 값이 미리 지정된 범위 내에 속하지 않는 경우, 미리 지정된 기본 제1 오프셋 값을 상기 제1 오프셋 값, 미리 지정된 기본 제2 오프셋 값을 상기 제2 오프셋 값, 미리 지정된 기본 제3 오프셋 값을 상기 제3 오프셋 값으로 사용하는
    디코딩 장치.
  8. 제6항에서,
    상기 프로세서는
    상기 미리 지정된 위치의 휘도 샘플의 값이 미리 지정된 범위 내에 속하지 않는 경우, 상기 현재 블록의 색차 블록은 상기 모델 기반 부호화 모드를 사용할 수 없는 것으로 판단하고, 상기 모델과 관련된 적어도 하나의 신택스를 파싱하지 않는
    디코딩 장치.
  9. 제6항에서,
    상기 프로세서는
    상기 미리 지정된 위치의 휘도 샘플의 값이 미리 지정된 범위 내에 속하지 않는 경우, 미리 지정된 복수의 위치의 휘도 샘플 값이 상기 제1 오프셋 값으로 유효한지 미리 지정된 순서대로 판단하고, 상기 제1 오프셋 값으로 유효한 휘도 샘플의 값이 발견된 경우, 상기 발견된 휘도 샘플의 값을 상기 제1 오프셋 값, 상기 발견된 휘도 샘플의 값에 대응하는 Cb 색차 샘플의 값을 상기 제2 오프셋 값, 및 상기 발견된 휘도 샘플에 대응하는 Cr 색차 샘플의 값을 상기 제3 오프셋 값으로 사용하는
    디코딩 장치.
  10. 제6항에서,
    상기 프로세서는
    상기 비디오 신호를 포함하는 비트스트림으로부터 오프셋 샘플을 지시하는 오프셋 샘플 정보를 파싱하고, 상기 오프셋 샘플 정보가 지시하는 휘도 샘플의 값을 상기 제1 오프셋 값, 상기 오프셋 샘플 정보가 지시하는 Cb 색차 샘플의 값을 제2 오프셋 값, 상기 오프셋 샘플 정보가 지시하는 Cr 색차 샘플의 값을 값을 상기 제3 오프셋 값으로 사용하는
    디코딩 장치.
  11. 비디오 신호를 디코딩하는 디코딩 장치에서,
    프로세서를 포함하고,
    상기 프로세서는
    현재 블록에 대한 움직임 정보를 획득하고,
    상기 움직임 정보를 이용하여 현재 블록에 대한 휘도 예측 블록과 제1 색차 예측 블록을 생성하고,
    상기 휘도 예측 블록과 제1 색차 예측 블록 간의 관계를 모델링하는 모델을 획득하고,
    상기 휘도 예측 블록에 휘도 오차 블록을 더하여 상기 현재 블록에 대한 복원된 휘도 블록을 생성하고,
    상기 획득한 모델과 상기 복원된 휘도 블록을 기초로 상기 현재 블록의 제2 색차 블록을 예측하고,
    상기 현재 블록의 제1 색차 블록과 상기 현재 블록의 제2 색차 블록을 가중 평균하여 제3 색차 예측 블록을 생성하고,
    상기 제3 색차 블록에 색차 오차 블록을 더하여 상기 현재 블록의 색차 블록을 복원하는
    디코딩 장치.
  12. 제11항에서,
    상기 프로세서는
    상기 획득한 모델과 상기 복원된 휘도 블록을 사용하여 상기 현재 블록의 제2 색차 블록을 예측하는
    디코딩 장치.
  13. 제11항에서,
    상기 프로세서는
    상기 획득한 모델과 상기 복원된 휘도 블록의 복원된 휘도 샘플을 사용하여 상기 현재 블록의 제2 색차 샘플을 예측하는
    디코딩 장치.
  14. 제13항에서,
    상기 획득한 모델은
    상기 휘도 예측 샘플과 상기 휘도 예측 샘플 주변의 복수의 휘도 샘플 사이의 수직 차이와 수평 차이, 및 상기 휘도 예측 샘플의 수직 좌표 및 수평 좌표 중에서 적어도 하나를 사용하여 유도된
    디코딩 장치.
  15. 제13항에서,
    상기 획득한 모델은
    상기 휘도 예측 샘플을 다운 샘플링하지 않고 유도되는
    디코딩 장치.
  16. 제13항에서,
    상기 프로세서는상기 복원된 휘도 블록의 복원된 휘도 샘플, 상기 복원된 휘도 샘플과 상기 복원된 휘도 샘플 주변의 복수의 휘도 샘플 사이의 수직 차이와 수평 차이, 및 상기 복원된 휘도 샘플의 수직 좌표 및 수평 좌표 중 적어도 하나를 사용하여 상기 현재 블록의 제2 색차 샘플을 예측하는
    디코딩 장치.
  17. 제13항에서,
    상기 프로세서는상기 현재 블록에 대한 복원된 휘도 샘플을 다운 샘플링하지 않고, 상기 현재 블록의 제2 색차 샘플을 예측하는
    디코딩 장치.
  18. 제13항에서,
    상기 프로세서는상기 제1 색차 샘플에 제1 가중치를 적용하고,
    상기 제2 색차 샘플에 제2 가중치를 적용하고,
    상기 제2 가중치는 상기 제1 가중치보다 큰
    디코딩 장치.
  19. 비디오 신호를 인코딩하는 인코딩 장치에서,
    프로세서를 포함하고,
    상기 프로세서는
    현재 블록의 주변 휘도 샘플과 상기 현재 블록의 주변 휘도 샘플에 대응되는 색차 샘플, 참조 블록의 주변 휘도 샘플과 상기 참조 블록의 주변 휘도 샘플에 대응되는 색차 샘플 중 적어도 하나의 샘플의 값을 기초로 상기 현재 블록의 휘도 샘플의 값과 상기 현재 블록의 색차 샘플의 값의 관계를 모델링하는 모델을 획득하고,
    상기 획득한 모델과 현재 블록의 휘도 블록을 사용하여 상기 현재 블록의 색차 블록을 예측하는
    인코딩 장치.
  20. 비디오 신호를 인코딩하는 인코딩 장치에서,
    프로세서를 포함하고,
    상기 프로세서는
    현재 블록에 대한 움직임 정보를 획득하고,
    상기 움직임 정보를 이용하여 현재 블록에 대한 휘도 예측 블록과 제1 색차 예측 블록을 생성하고,
    상기 휘도 예측 블록과 제1 색차 예측 블록 간의 관계를 모델링하는 모델을 획득하고,
    상기 휘도 예측 블록에 휘도 오차 블록을 더하여 상기 현재 블록에 대한 복원된 휘도 블록을 생성하고,
    상기 획득한 모델과 상기 복원된 휘도 블록을 기초로 상기 현재 블록의 제2 색차 블록을 예측하고,
    상기 현재 블록의 제1 색차 블록과 상기 현재 블록의 제2 색차 블록을 가중 평균하여 제3 색차 예측 블록을 생성하고,
    상기 제3 색차 블록에 색차 오차 블록을 더하여 상기 현재 블록의 색차 블록을 복원하는
    인코딩 장치.
  21. 비디오 신호를 디코딩하는 디코딩 방법에서,
    현재 블록의 주변 휘도 샘플과 상기 현재 블록의 주변 휘도 샘플에 대응되는 색차 샘플, 참조 블록의 주변 휘도 샘플과 상기 참조 블록의 주변 휘도 샘플에 대응되는 색차 샘플 중 적어도 하나의 샘플의 값을 기초로 상기 현재 블록의 휘도 샘플의 값과 상기 현재 블록의 색차 샘플의 값의 관계를 모델링하는 모델을 획득하는 단계와
    상기 획득한 모델과 현재 블록의 휘도 블록을 사용하여 상기 현재 블록의 색차 블록을 예측하는 단계를 포함하는
    디코딩 방법.
  22. 비디오 신호를 디코딩하는 디코딩 방법에서,
    현재 블록에 대한 움직임 정보를 획득하는 단계;
    상기 움직임 정보를 이용하여 현재 블록에 대한 휘도 예측 블록과 제1 색차 예측 블록을 생성하는 단계;
    상기 휘도 예측 블록과 제1 색차 예측 블록 간의 관계를 모델링하는 모델을 획득하는 단계;
    상기 휘도 예측 블록에 휘도 오차 블록을 더하여 상기 현재 블록에 대한 복원된 휘도 블록을 생성하는 단계;
    상기 획득한 모델과 상기 복원된 휘도 블록을 기초로 상기 현재 블록의 제2 색차 블록을 예측하는 단계;
    상기 현재 블록의 제1 색차 블록과 상기 현재 블록의 제2 색차 블록을 가중 평균하여 제3 색차 예측 블록을 생성하는 단계; 및
    상기 제3 색차 블록에 색차 오차 블록을 더하여 상기 현재 블록의 색차 블록을 복원하는 단계를 포함하는
    디코딩 방법.
  23. 비트스트림을 저장하는 컴퓨터 판독 가능한 비 일시적 저장 매체에서,
    상기 비트스트림은 디코딩 방법에 의해 디코딩되고,
    상기 디코딩 방법은
    현재 블록의 주변 휘도 샘플과 상기 현재 블록의 주변 휘도 샘플에 대응되는 색차 샘플, 참조 블록의 주변 휘도 샘플과 상기 참조 블록의 주변 휘도 샘플에 대응되는 색차 샘플 중 적어도 하나의 샘플의 값을 기초로 상기 현재 블록의 휘도 샘플의 값과 상기 현재 블록의 색차 샘플의 값의 관계를 모델링하는 모델을 획득하는 단계와
    상기 획득한 모델과 현재 블록의 휘도 블록을 사용하여 상기 현재 블록의 색차 블록을 예측하는 단계를 포함하는
    비 일시적 저장 매체.
  24. 비트스트림을 저장하는 컴퓨터 판독 가능한 비 일시적 저장 매체에서,
    상기 비트스트림은 디코딩 방법에 의해 디코딩되고,
    상기 디코딩 방법은
    현재 블록에 대한 움직임 정보를 획득하는 단계;
    상기 움직임 정보를 이용하여 현재 블록에 대한 휘도 예측 블록과 제1 색차 예측 블록을 생성하는 단계;
    상기 휘도 예측 블록과 제1 색차 예측 블록 간의 관계를 모델링하는 모델을 획득하는 단계;
    상기 휘도 예측 블록에 휘도 오차 블록을 더하여 상기 현재 블록에 대한 복원된 휘도 블록을 생성하는 단계;
    상기 획득한 모델과 상기 복원된 휘도 블록을 기초로 상기 현재 블록의 제2 색차 블록을 예측하는 단계;
    상기 현재 블록의 제1 색차 블록과 상기 현재 블록의 제2 색차 블록을 가중 평균하여 제3 색차 예측 블록을 생성하는 단계; 및
    상기 제3 색차 블록에 색차 오차 블록을 더하여 상기 현재 블록의 색차 블록을 복원하는 단계를 포함하는
    비 일시적 저장 매체.
PCT/KR2023/016463 2022-10-26 2023-10-23 휘도 샘플 기반 색차 샘플 예측을 사용하는 비디오 신호 처리 방법 및 이를 위한 장치 WO2024090923A1 (ko)

Applications Claiming Priority (6)

Application Number Priority Date Filing Date Title
KR10-2022-0139744 2022-10-26
KR20220139744 2022-10-26
KR20230049596 2023-04-14
KR10-2023-0049596 2023-04-14
KR20230051599 2023-04-19
KR10-2023-0051599 2023-04-19

Publications (1)

Publication Number Publication Date
WO2024090923A1 true WO2024090923A1 (ko) 2024-05-02

Family

ID=90831290

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/KR2023/016463 WO2024090923A1 (ko) 2022-10-26 2023-10-23 휘도 샘플 기반 색차 샘플 예측을 사용하는 비디오 신호 처리 방법 및 이를 위한 장치

Country Status (1)

Country Link
WO (1) WO2024090923A1 (ko)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20170107448A (ko) * 2015-01-27 2017-09-25 퀄컴 인코포레이티드 적응적 크로스 컴포넌트 잔차 예측
WO2020192717A1 (en) * 2019-03-26 2020-10-01 Beijing Bytedance Network Technology Co., Ltd. Parameter derivation for inter prediction
KR20210138760A (ko) * 2019-03-25 2021-11-19 광동 오포 모바일 텔레커뮤니케이션즈 코포레이션 리미티드 이미지 요소 예측 방법, 인코더, 디코더 및 저장 매체
US20220329816A1 (en) * 2019-12-31 2022-10-13 Beijing Bytedance Network Technology Co., Ltd. Cross-component prediction with multiple-parameter model

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20170107448A (ko) * 2015-01-27 2017-09-25 퀄컴 인코포레이티드 적응적 크로스 컴포넌트 잔차 예측
KR20210138760A (ko) * 2019-03-25 2021-11-19 광동 오포 모바일 텔레커뮤니케이션즈 코포레이션 리미티드 이미지 요소 예측 방법, 인코더, 디코더 및 저장 매체
WO2020192717A1 (en) * 2019-03-26 2020-10-01 Beijing Bytedance Network Technology Co., Ltd. Parameter derivation for inter prediction
US20220329816A1 (en) * 2019-12-31 2022-10-13 Beijing Bytedance Network Technology Co., Ltd. Cross-component prediction with multiple-parameter model

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
S. BANDYOPADHYAY (INTERDIGITAL), X. XIU (INTERDIGITAL), Y. HE (INTERDIGITAL): "CE10-related: Local Illumination compensation simplifications", 13. JVET MEETING; 20190109 - 20190118; MARRAKECH; (THE JOINT VIDEO EXPLORATION TEAM OF ISO/IEC JTC1/SC29/WG11 AND ITU-T SG.16 ), 11 January 2019 (2019-01-11), XP030201507 *

Similar Documents

Publication Publication Date Title
WO2018066867A1 (ko) 영상 부호화/복호화 방법, 장치 및 비트스트림을 저장한 기록 매체
WO2020076143A1 (ko) 다중 가정 예측을 사용하는 비디오 신호 처리 방법 및 장치
WO2019182385A1 (ko) 영상 부호화/복호화 방법, 장치 및 비트스트림을 저장한 기록 매체
WO2019235896A1 (ko) 적응적 모션 벡터 레졸루션을 이용하는 비디오 신호 처리 방법 및 장치
WO2017086747A1 (ko) 기하 변환 픽처를 이용한 영상의 부호화/복호화 방법 및 장치
WO2018097589A1 (ko) 영상 부호화/복호화 방법, 장치 및 비트스트림을 저장한 기록 매체
WO2019066524A1 (ko) 영상 부호화/복호화 방법, 장치 및 비트스트림을 저장한 기록 매체
WO2018124333A1 (ko) 인트라 예측 모드 기반 영상 처리 방법 및 이를 위한 장치
WO2017069505A1 (ko) 영상의 부호화/복호화 방법 및 이를 위한 장치
WO2020251330A1 (ko) 단순화된 mpm 리스트 생성 방법을 활용하는 영상 부호화/복호화 방법, 장치 및 비트스트림을 전송하는 방법
WO2018097590A1 (ko) 영상 부호화/복호화 방법, 장치 및 비트스트림을 저장한 기록 매체
WO2020085800A1 (ko) 서브블록 기반의 모션 보상을 이용한 비디오 신호 처리 방법 및 장치
WO2020204413A1 (ko) 복원 픽처를 수정하는 비디오 또는 영상 코딩
WO2017034113A1 (ko) 인터 예측 모드 기반 영상 처리 방법 및 이를 위한 장치
WO2020096427A1 (ko) 영상 신호 부호화/복호화 방법 및 이를 위한 장치
WO2021172914A1 (ko) 레지듀얼 코딩에 대한 영상 디코딩 방법 및 그 장치
WO2020251329A1 (ko) Mip 모드 매핑이 단순화된 영상 부호화/복호화 방법, 장치 및 비트스트림을 전송하는 방법
WO2020213976A1 (ko) Bdpcm을 이용한 영상 부호화/복호화 방법, 장치 및 비트스트림을 전송하는 방법
WO2020256393A1 (ko) 루마 맵핑 기반 비디오 또는 영상 코딩
WO2020197207A1 (ko) 맵핑을 포함하는 필터링 기반 비디오 또는 영상 코딩
WO2019066523A1 (ko) 영상 부호화/복호화 방법, 장치 및 비트스트림을 저장한 기록 매체
WO2021172916A1 (ko) 영상 디코딩 방법 및 그 장치
WO2021172907A1 (ko) 영상 디코딩 방법 및 그 장치
WO2021071339A1 (ko) 영상 부호화/복호화 방법, 장치 및 비트스트림을 저장한 기록 매체
WO2020256470A1 (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: 23883029

Country of ref document: EP

Kind code of ref document: A1