Cross-component codec for 4:2:0 or 4:2:2 video

By designing downsampling filters and transform skip block sizes for brightness and chromaticity components in video encoding and decoding technology, the problem of low chromaticity block parameter derivation and transform skip block efficiency in the prior art is solved, and the editing is improved Decoding performance.

CN115462081BActive Publication Date: 2025-01-10DOUYIN VISION CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202180029354.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2020-04-18
Filing Date
2021-04-19
Publication Date
2025-01-10
Estimated Expiration
2041-04-19

AI Technical Summary

Technical Problem

In the existing video codec technology, the cross component linear model (CCLM) and the maximum block size design of the transform skip codec block have the problem of mismatch between the chrominance components and the luminance components, resulting in parameter derivation and transformation skip of the chrominance block. Over-code is inefficient.

Method used

Different downsampling filters and transform skip codec blocks are used to design the maximum block size, and the brightness and chromaticity components are processed according to the color format and transformation type to ensure the parameter derivation accuracy of the chroma block and the transform skip efficiency.

Benefits of technology

The parameter derivation accuracy of chroma blocks and the efficiency of transform skip encoding and decoding are improved, and the performance and efficiency of video encoding and decoding are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115462081B_ABST
    Figure CN115462081B_ABST
Patent Text Reader

Abstract

A method of video processing is provided, comprising: for conversion between a video block of a video having a 4:2:2 color format and a bitstream of the video, determining parameters of a cross-component linear model for the video block according to a rule; and performing the conversion based on the determination, wherein a syntax element indicates whether chroma samples of the video are vertically shifted relative to luma samples of the video, and wherein the rule specifies that the parameter is determined independently of a value of the syntax element.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS

[0002] This is the national phase application of International Patent Application No. PCT / CN2021 / 087998, filed on April 19, 2021, which claims priority to and the benefit of International Patent Application No. PCT / CN2020 / 085484, filed on April 18, 2020. The entire disclosure of the above application is incorporated by reference as part of the disclosure of this application. Technical Field

[0003] This document deals with video and image coding technologies. Background Art

[0004] Digital video accounts for the largest usage of bandwidth on the Internet and other digital communications networks. As the number of connected user devices capable of receiving and displaying video increases, bandwidth demand for digital video usage is expected to continue to grow. Summary of the Invention

[0005] The disclosed techniques may be used by video or image decoder or encoder embodiments to perform encoding or decoding using cross-component linear model prediction.

[0006] In one example aspect, a method of processing video is disclosed. The method includes: for converting between a chroma block of the video and a coded representation of the video, deriving parameters of a cross-component linear model from downsampled co-located adjacent top luma samples, the downsampled co-located adjacent top luma samples being generated from N top-neighboring rows of the co-located luma block using a downsampling filter, where N is a positive integer; and performing the conversion using a predicted chroma block generated using the cross-component linear model.

[0007] In another example aspect, a method of processing video is disclosed. The method includes: for conversion between a video block of video having a 4:2:2 color format and a bitstream of the video, determining parameters of a cross-component linear model for the video block according to a rule; and performing the conversion based on the determination, wherein a syntax element indicates whether chroma samples of the video are vertically shifted relative to luma samples of the video, and wherein the rule specifies that the parameters are determined independently of a value of the syntax element.

[0008] In another example aspect, a method of processing video is disclosed. The method includes performing conversion between the video and a bitstream of the video according to a rule, wherein the format rule specifies that a field indicating whether chroma sample positions are vertically shifted relative to corresponding luma sample positions is set to a default value because the video has a 4:2:2 or 4:4:4 color format.

[0009] In another example aspect, a method of processing video is disclosed. The method includes: for conversion between a video block of the video and a bitstream of the video, determining parameters of a cross-component linear model (CCLM) for the video block according to a rule; and performing the conversion based on the determination, wherein the rule specifies that a variable representing adjacent luma samples is to be used in determining the parameters of the CCLM only if the variable has a specific value.

[0010] In another example aspect, a method for processing video is disclosed. The method includes: for converting between a video including a video unit and a bitstream of the video, determining whether to enable a first codec for the video unit according to a rule, wherein the rule specifies that the first codec and a second codec are mutually exclusive, and wherein the first codec or the second codec includes a symbol data hiding tool; and performing the conversion according to the determination.

[0011] In another example aspect, a method for processing video is disclosed. The method includes: for converting between a video including a video unit and a bitstream of the video, determining whether to enable a first codec for the video unit according to a rule, wherein the rule specifies that the first codec and a second codec are mutually exclusive, and wherein the first codec or the second codec includes a dependent quantization tool; and performing the conversion according to the determination.

[0012] In another example aspect, a method of processing video is disclosed. The method includes performing conversion between a video including one or more pictures comprising one or more slices and a bitstream of the video according to a rule, wherein the rule specifies that a slice type of a slice depends on a reference picture entry of a reference picture list for the slice.

[0013] In another example aspect, a method of processing a video is disclosed. The method includes performing conversion between a video comprising one or more pictures including one or more slices and a bitstream of the video according to a rule, wherein the rule specifies a number of filters allowed in an adaptive parameter set (APS) or a number of APSs depending on coded information of the video.

[0014] In another example aspect, the above method may be implemented by a video encoder apparatus including a processor.

[0015] In yet another example aspect, the methods may be implemented in the form of processor-executable instructions and stored on a computer-readable program medium.

[0016] These and other aspects are also described in this document. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1AThe nominal vertical and horizontal positions of the 4:2:2 luma and chroma samples in the picture are shown.

[0018] Figure 1B An example of a video encoder is shown.

[0019] Figure 2 Examples of 67 intra prediction modes are shown.

[0020] Figure 3 Examples of horizontal and vertical traversal scans are shown.

[0021] Figure 4 Examples of the locations of the sample points used for the derivation of α and β are shown.

[0022] Figure 5 An example of partitioning a block of 4x8 samples into two independent decodable areas is shown.

[0023] Figure 6 An example order of processing pixel rows to maximize throughput for a 4xN block with a vertical predictor is shown.

[0024] Figure 7 An example of a low frequency non-separable transform (LFNST) process is shown.

[0025] Figure 8 An example of adjacent chroma samples and downsampled co-located adjacent luma samples used in the derivation of CCLM parameters for 4:2:2 video is shown.

[0026] Figure 9 An example of a video processing apparatus is shown.

[0027] Figure 10 A block diagram of a video encoder is shown.

[0028] Figure 11 is a flowchart of an example of a video processing method.

[0029] Figure 12 is a block diagram of an example of a video processing system.

[0030] Figure 13 An example of the samples in the current block and the top left sample to be used is shown.

[0031] Figure 14 is a block diagram illustrating an example video encoding and decoding system.

[0032] Figure 15 is a block diagram illustrating an encoder according to some embodiments of the disclosed technology.

[0033] Figure 16 is a block diagram illustrating a decoder according to some embodiments of the disclosed technology.

[0034] Figure 17A and Figure 17B is a flow chart of an example video processing method according to some embodiments of the disclosed technology.

[0035] Figure 18 is a flow chart of an example method of video processing according to some embodiments of the disclosed technology.

[0036] 19A to 19D is a flow chart of an example video processing method according to some embodiments of the disclosed technology. DETAILED DESCRIPTION

[0037] This document provides various techniques that can be used by decoders of image or video bitstreams to improve the quality of decompressed or decoded digital video or images. For the sake of brevity, the term "video" is used herein to include both sequences of pictures (traditionally referred to as video) and single images. In addition, video encoders can also implement these techniques during the encoding process to reconstruct decoded frames for further encoding.

[0038] For ease of understanding, section headings are used in this document, and the section headings do not limit the embodiments and techniques to the corresponding subsections. Therefore, embodiments from one section can be combined with embodiments from other sections.

[0039] 1. Brief Overview

[0040] The present invention relates to video coding and decoding technology. Specifically, it relates to cross-component linear model prediction and other coding and decoding tools in image / video coding and decoding. The present invention can be applied to existing video coding and decoding standards (such as HEVC) or to standards to be finalized (Multi-functional Video Codec). It may also be applicable to future video coding and decoding standards or video codecs. 2. Background Technology

[0042] Video codec standards have evolved primarily through the development of the well-known ITU-T and ISO / IEC standards. ITU-T developed H.261 and H.263, ISO / IEC developed MPEG-1 and MPEG-4 Vision, and the two organizations jointly developed the H.262 / MPEG-2 Video, H.264 / MPEG-4 Advanced Video Codec (AVC) standards, and H.265 / HEVC standards. Since H.262, video codec standards have been based on a hybrid video codec architecture that uses temporal prediction plus transform coding. To explore future video codec technologies beyond HEVC, VCEG and MPEG jointly established the Joint Video Exploration Team (JVET) in 2015. Since then, many new methods have been adopted by JVET and incorporated into reference software called the Joint Exploration Model (JEM). In April 2018, the Joint Video Experts Team (JVET) between VCEG (Q6 / 16) and ISO / IEC JTC1 SC29 / WG11 (MPEG) was established to develop the VVC standard with the goal of reducing the bit rate by 50% compared to HEVC.

[0043] The latest version of the VVC draft, Versatile Video Coding (Draft 7), can be found at:

[0044] http: / / phenix.it-sudparis.eu / jvet / doc_end_user / documents / 16_Geneva / wg11 / JVET-P2001-v9.zip

[0045] The latest reference software for VVC (called VTM) can be found at the following URL:

[0046] https: / / vcgit.hhi.fraunhofer.de / jvet / VVCSoftware_VTM / - / tags / VTM-6.0

[0047] 2.1. Color Space and Chroma Subsampling

[0048] A color space, also called a color model (or color system), is an abstract mathematical model that simply describes the range of colors as a tuple of numbers, usually 3 or 4 values ​​or color components (such as RGB). Fundamentally, a color space is an elaboration of coordinate systems and subspaces.

[0049] For video compression, the most commonly used color spaces are YCbCr and RGB.

[0050] YCbCr, Y'CbCr, or Y Pb / Cb Pr / Cr, also written as YCBCR or Y'CBCR, is a family of color spaces used as part of the color imaging pipeline in video and digital photography systems. Y' is the luma component, while CB and CR are the blue-difference and red-difference chroma components. Y' (with a superscript notation) is distinguished from Y, which is luma, meaning that light intensity is encoded nonlinearly based on the gamma-corrected RGB primaries.

[0051] Chroma subsampling is the practice of encoding images at a lower resolution for chroma information than for luminance information, taking advantage of the fact that the human visual system is less sensitive to color differences than to luminance. 2.1.1.4:4:4

[0053] Each of the three Y'CbCr components has the same sampling rate, so there is no chroma subsampling. This scheme is sometimes used in high-end film scanners and film post-production. 2.1.2.4:2:2

[0055] The two chroma components are sampled at half the rate of luma: the horizontal chroma resolution is halved, while the vertical chroma resolution remains unchanged. This reduces the bandwidth of the uncompressed video signal by one-third with little or no visual difference. Examples of nominal vertical and horizontal positions for a 4:2:2 color format are shown in the VVC working draft. Figure 1A Depicted in. 2.1.3.4:2:0

[0057] In 4:2:0, horizontal sampling is doubled compared to 4:1:1, but because the Cb and Cr channels are sampled only on alternate lines in this scheme, vertical resolution is halved. Therefore, the data rate remains the same. Cb and Cr are subsampled by a factor of 2 both horizontally and vertically. There are three variants of the 4:2:0 scheme, with different horizontal and vertical positions.

[0058] In MPEG-2, Cb and Cr are co-located in the horizontal direction and located between pixels in the vertical direction (spaced apart).

[0059] In JPEG / JFIF, H.261, and MPEG-1, Cb and Cr are interspersed between alternate luminance samples.

[0060] In 4:2:0 DV, Cb and Cr are co-located horizontally and vertically on alternate lines.

[0061] Table 2-1 SubWidthC and SubHeightC values ​​derived from chroma_format_idc and separate_colour_plane_flag

[0062]

[0063]

[0064] 2.2. Encoding and decoding process of typical video codecs

[0065] Figure 1B An example of a VVC encoder block diagram is shown, which contains three in-loop filtering blocks: a deblocking filter (DF), sample adaptive offset (SAO), and ALF. Unlike DF, which uses a predefined filter, SAO and ALF use the original samples of the current picture to reduce the mean square error between the original samples and the reconstructed samples by adding an offset and applying a finite impulse response (FIR) filter, respectively. The offset and filter coefficients are signaled via codec-side information. ALF is located at the last processing stage for each picture and can be seen as a tool that attempts to capture and repair artifacts created by previous stages.

[0066] Intra-mode codec with 67 intra-prediction modes

[0067] To capture arbitrary edge directions present in natural videos, the number of directional intra modes is extended from 33 used in HEVC to 65. The additional directional modes are Figure 2 Depicted as red dashed arrows in , planar and DC modes remain unchanged. These more dense directional intra prediction modes apply to all block sizes and both luma and chroma intra prediction.

[0068] like Figure 2 As shown, the traditional angular intra prediction direction is defined as 45 degrees to -135 degrees in a clockwise direction. In VTM, for non-square blocks, several traditional angular intra prediction modes are adaptively replaced with wide-angle intra prediction modes. The replaced modes are signaled using the original method and remapped to the wide-angle mode index after parsing. The total number of intra prediction modes remains unchanged at 67, and the intra mode codec remains unchanged.

[0069] In HEVC, each intra-coded block has a square shape, with each side length being a power of 2. Therefore, no division operation is required to generate the intra predictor using the DC mode. In VVC, blocks can have a rectangular shape, and in general, a division operation is required for each block. To avoid the division operation for DC prediction, for non-square blocks, only the longer side is used to calculate the average.

[0070] Figure 2 Examples of 67 intra prediction modes are shown.

[0071] 2.4. Inter-frame prediction

[0072] For each inter-frame predicted CU, the motion parameters consist of a motion vector, a reference picture index and a reference picture list usage index, as well as additional information required by the new codec features of VVC that will be used for inter-frame prediction sample generation. The motion parameters can be signaled in an explicit or implicit manner. When a CU is encoded and decoded in skip mode, the CU is associated with one PU and has no significant residual coefficients, no coded motion vector increments or reference picture indices. The merge mode is specified, whereby the motion parameters of the current CU are obtained from neighboring CUs, including spatial and temporal candidates, as well as the additional scheduling introduced in VVC. The merge mode is applicable not only to skip mode, but also to any inter-frame predicted CU. An alternative to the merge mode is the explicit transmission of motion parameters, where each CU explicitly signals the motion vector, the corresponding reference picture index and reference picture list usage flag for each reference picture list, as well as other required information.

[0073] 2.5. Intra-block copy (IBC)

[0074] Intra-block copying (IBC) is a tool adopted in the HEVC extension on SCC. It is well known that it significantly improves the encoding and decoding efficiency of screen content materials. Since the IBC mode is implemented as a block-level encoding and decoding mode, block matching (BM) is performed at the encoder to find the best block vector (or motion vector) for each CU. Here, the block vector is used to indicate the displacement from the current block to the reference block, which has been reconstructed within the current picture. The luminance block vector of the CU encoded and decoded by IBC is integer precision. The chrominance block vector is also rounded to integer precision. When combined with AMVR, the IBC mode can switch between 1-pixel and 4-pixel motion vector precision. The CU encoded and decoded by IBC is regarded as a third prediction mode in addition to the intra or inter prediction mode. The IBC mode is applicable to CUs whose width and height are both less than or equal to 64 luminance samples.

[0075] On the encoder side, hash-based motion estimation is performed for IBC. The encoder performs RD checks on blocks with a width or height of no more than 16 luma samples. For non-merge mode, a block vector search is first performed using a hash-based search. If the hash search does not return a valid candidate, a local search based on block matching is performed.

[0076] In hash-based search, the hash key matching (32-bit CRC) between the current block and the reference blocks is extended to all allowed block sizes. The hash key calculation for each position in the current picture is based on a 4×4 sub-block. For larger current block sizes, the hash key that matches the hash key of the reference block is determined when all hash keys of all 4×4 sub-blocks match the hash keys in the corresponding reference positions. If multiple reference blocks are found whose hash keys match the hash key of the current block, the block vector cost of each matching reference is calculated and the one with the lowest cost is selected.

[0077] In the block matching search, the search range is set to cover both the previous and current CTUs.

[0078] At CU level, IBC mode is signaled using a flag, which can be signaled as IBC AMVP mode or IBC skip / merge mode as shown below:

[0079] -IBC skip / merge mode: merge candidate index is used to indicate which block vectors from neighboring candidate IBC codec blocks in the list are used to predict the current block. The merge list consists of spatial candidates, HMVP candidates and pairwise candidates.

[0080] -IBC AMVP mode: Block vector differences are encoded and decoded in the same way as motion vector differences. The block vector prediction method uses two candidates as predictors, one from the left neighbor and one from the upper neighbor (if IBC codec). When any neighbor is unavailable, the default block vector is used as the predictor. A flag is signaled to indicate the block vector predictor index.

[0081] 2.6. Palette Mode

[0082] For palette mode signaling, the palette mode is encoded and decoded as the prediction mode of the codec unit, that is, the prediction mode of the codec unit can be MODE_INTRA, MODE_INTER, MODE_IBC and MODE_PLT. If the palette mode is used, the pixel values ​​in the CU are represented by a small set of representative color values. This set is called a palette. For pixels whose values ​​are close to the palette color, the palette index is signaled. For pixels whose values ​​are outside the palette, the pixel is represented by an escape symbol and the quantized pixel value is signaled directly.

[0083] To decode a palette-coded block, the decoder needs to decode the palette colors and indices. The palette colors are described by a palette table and encoded by the palette table codec. An escape flag is signaled for each CU to indicate whether an escape symbol is present in the current CU. If an escape symbol is present, the palette table is incremented by one and the last index is assigned to the escape mode. The palette indices of all pixels in the CU form a palette index map and are encoded by the palette index map codec.

[0084] In order to encode and decode the palette table, a palette predictor is maintained. The predictor is initialized at the beginning of each stripe where the predictor is reset to 0. For each entry in the palette predictor, a reuse flag is signaled to indicate whether it is part of the current palette. The reuse flag is sent using run-length encoding of zero. After this, the number of new palette entries is signaled using an exponential Golomb code of order 0. Finally, the component values ​​of the new palette entries are signaled. After encoding the current CU, the palette predictor will be updated with the current palette and entries from the previous palette predictor that are not reused in the current palette will be added to the end of the new palette predictor until the maximum allowed size is reached (palette padding).

[0085] To encode and decode the palette index map, use Figure 3 The indexes are encoded and decoded by horizontal and vertical traversal scans as shown. The scan order is explicitly signaled in the bitstream using palette_transpose_flag.

[0086] Figure 3 Examples of horizontal and vertical traversal scans are shown.

[0087] Palette indexes are encoded and decoded using two main palette sampling modes: 'INDEX' and 'COPY_ABOVE'. A flag is used to signal the mode, except when the top row is used when horizontal scanning is used, the first column is used when vertical scanning is used, or the previous mode is 'COPY_ABOVE'. In 'COPY_ABOVE' mode, the palette index of the sample in the row above is copied. In 'INDEX' mode, the palette index is signaled explicitly. For both 'INDEX' and 'COPY_ABOVE' modes, a runlength value is signaled, which specifies the number of pixels to be encoded and decoded using the same mode.

[0088] The encoding order of the index map is as follows: First, the number of index values ​​for the CU is signaled. Then the actual index value for the entire CU is signaled using truncated binary encoding. Both the index number and the index value are encoded and decoded in bypass mode. This groups the index-related bypass bins together. Then, the palette mode (INDEX or COPY_ABOVE) and the run value are signaled in an interleaved manner. Finally, the component escape values ​​corresponding to the escape samples of the entire CU are grouped together and encoded and decoded in bypass mode. An additional syntax element last_run_type_flag is signaled after the signaling of the index value. This syntax element is used in conjunction with the index number to avoid the need to signal the run value corresponding to the last run in the block.

[0089] In VTM, a binary tree is enabled for the I slice, separating the luminance (Luma) and chroma (Chroma) codecs. Therefore, in this scheme, the palette is applied separately to the luminance (Y component) and chroma (Cb and Cr components). If the binary tree is disabled, the palette is applied to the Y, Cb, and Cr components together, the same as the HEVC palette.

[0090] 2.7. Cross-component linear model prediction

[0091] The cross-component linear model (CCLM) prediction mode is used in VVC. For this mode, the chrominance samples are predicted based on the reconstructed luma samples of the same CU using the following linear model:

[0092] pred C (i, j) = α·rec L ′(i, j)+β (2-1)

[0093] where pred C (i, j) represents the predicted chroma sample in the CU, and rec L (i, j) represents the downsampled reconstructed luma samples of the same CU.

[0094] Figure 4 An example of the positions of the left and upper samples involved in the LM mode and the samples of the current block is shown.

[0095] Figure 4 Examples of the locations of the sample points used for the derivation of α and β are shown.

[0096] In addition to the upper template and the left template being used together to calculate the linear model coefficients in LM mode, they can also be used alternately in the other two LM modes (i.e., LM_A and LM_L modes). In LM_A mode, only the upper template is used to calculate the linear model coefficients. In order to obtain more samples, the upper template is expanded to (W+H). In LM_L mode, only the left template is used to calculate the linear model coefficients. In order to obtain more samples, the left template is expanded to (H+W). For non-square blocks, the upper template is expanded to W+W and the left template is expanded to H+H.

[0097] The CCLM parameters (α and β) are derived using up to four adjacent chroma samples and their corresponding downsampled luma samples. Assuming the current chroma block dimension is W×H, W' and H' are set to

[0098] —When LM mode is applied, W'=W, H'=H;

[0099] —When LM-A mode is applied, W'=W+H;

[0100] —When LM-L mode is applied, H'=H+W;

[0101] The upper adjacent position is represented as S[0, -1]...S[W'-1, -1], and the left adjacent position is represented as S[-1, 0]...S[-1, H'-1]. Then the four sample points are selected as

[0102] - When LM mode is applied and both upper and left adjacent samples are available, S[W' / 4, -1], S[3W' / 4, -1], S[-1, H' / 4], S[-1, 3H' / 4];

[0103] — When the LM-A mode is applied or only upper adjacent samples are available, S[W' / 8, -1], S[3W' / 8, -1], S[5W' / 8, -1], S[7W' / 8, -1];

[0104] - When LM-L mode is applied or only left adjacent samples are available, S[-1, H' / 8], S[-1, 3H' / 8], S[-1, 5H' / 8], S[-1, 7H' / 8];

[0105] Downsample the four adjacent brightness samples at the selected position and perform four comparisons to find the smaller of the two values: x 0 A and x 1 A , and two larger values: x 0 B and x 1 BTheir corresponding chroma sample values ​​are represented by y 0 A 、y 1 A 、y 0 B and y 1 B Then x A 、x B 、y A and y B The derivation is:

[0106] X a =(x 0 A +x 1 A +1)>>1;X b =(x 0 B +x 1 B +1)>>1;Y a =(y0 A +y 1 A +1)>>1;

[0107] Y b =(y 0 B +y 1 B +1)>>1 (2-2)

[0108] Finally, the linear model parameters α and β are obtained according to the following equations.

[0109]

[0110] β=Y b -α·X b (2-4)

[0111] The division operation for calculating the parameter α is implemented using a lookup table. To reduce the memory required to store the table, the diff value (the difference between the maximum and minimum values) and the parameter α are expressed in exponential notation. For example, diff is approximated using a 4-bit significant part and an exponent. Therefore, the table for 1 / diff is simplified to 16 elements for 16 meaningful values, as shown below:

[0112] DivTable[]={0, 7, 6, 5, 5, 4, 4, 3, 3, 2, 2, 1, 1, 1, 1, 0}

[0113] (2-5)

[0114] The benefit of doing this is that it reduces both the computational complexity and the memory size required to store the required tables.

[0115] To match the chroma sample positions of a 4:2:0 video sequence, two downsampling filters are applied to the luma samples, achieving a 2:1 downsampling ratio in both the horizontal and vertical directions. The choice of downsampling filter is specified by the SPS level flag. The two downsampling filters are shown below, corresponding to "Type 0" and "Type 2" content, respectively.

[0116]

[0117]

[0118] Note that when the upper reference line is at a CTU boundary, only one luma line (typically a line buffer in intra prediction) is used to derive the downsampled luma samples.

[0119] This parameter calculation is performed as part of the decoding process rather than just as an encoder search operation. As a result, no syntax is used to pass the α and β values ​​to the decoder.

[0120] For chroma intra mode coding and decoding, a total of 8 intra modes are allowed for chroma intra mode coding and decoding. These modes include five traditional intra modes and three cross-component linear model modes (LM, LM_A and LM_L). The chroma mode signaling and derivation process are shown in Table 2-2. Chroma mode coding and decoding directly depends on the intra prediction mode of the corresponding luminance block. Since separate block partitioning structures for luminance and chrominance components are enabled in the I slice, one chroma block can correspond to multiple luminance blocks. Therefore, for the chroma DM mode, the intra prediction mode of the corresponding luminance block covering the center position of the current chroma block is directly inherited.

[0121] Table 2-2. Derivation of chrominance prediction from luma mode when ccm_is is enabled

[0122]

[0123]

[0124] Specification of INTRA_LT_CCLM, INTRA_L_CCLM, and INTRA_T_CCLM intra prediction modes in JVET-Q2001-vE 8.4.5.2.13

[0126] The inputs to this process are:

[0127] —Intra prediction mode predModeIntra,

[0128] - the sample position of the upper left sample of the current transform block relative to the upper left sample of the current picture (xTbC, yTbC),

[0129] - variable nTbW specifying the transform block width,

[0130] — variable nTbH specifying the transform block height,

[0131] — variable cIdx specifying the color component of the current block,

[0132] - Chroma neighboring samples p[x][y], where x = -1, y = 0..2×nTbH-1, and x = 0..2×nTbW-1, y = -1.

[0133] The output of this process is the predicted samples predSamples[x][y], where x = 0..nTbW-1, y = 0..nTbH-1.

[0134] The current brightness position (xTbY, yTbY) is derived as follows:

[0135] (xTbY, yTbY) = (xTbC<<(SubWidthC-1), yTbC<<(SubHeightC-1)) (351)

[0136] The variables availL, availT, and availTL are derived as follows:

[0137] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using as input the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY-1, yTbY), checkPredModeY set equal to false (FLASE), and cIdx, and assign the output to availL.

[0138] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY, yTbY-1), checkPredModeY set equal to false (FLASE), and cIdx as input, and assign the output to availT.

[0139] —The variable availTL is derived as follows:

[0140] availTL=availL&&availT (352)

[0141] The number of available top-right adjacent chroma samples numTopRight is derived as follows:

[0142] —The variable numTopRight is set to 0, and availTR is set to true (TRUE).

[0143] - When predModeIntra is equal to INTRA_T_CCLM, the following applies for x=nTbW..2×nTbW-1 until availTR is equal to FALSE or x is equal to 2×nTbW-1:

[0144] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using as input the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY+x, yTbY-1), checkPredModeY set equal to false (FLASE), and cIdx, and assign the output to availTR.

[0145] —When availTR is equal to true (TRUE), numTopRight is increased by 1.

[0146] The number of available lower left adjacent chroma samples numLeftBelow is derived as follows:

[0147] —The variable numLeftBelow is set to 0, and availLB is set to true (TRUE).

[0148] When predModeIntra is equal to INTRA_L_CCLM, the following applies for y=nTbH..2×nTbH-1 until availLB is equal to FALSE or y is equal to 2×nTbH-1:

[0149] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY-1, yTbY+y), checkPredModeY set equal to false (FLASE), and cIdx as input, and assign the output to availLB.

[0150] —When availLB is equal to TRUE, numLeftBelow is increased by 1.

[0151] The number of available adjacent chroma samples numSampT at the top and upper right and the number of available adjacent chroma samples numSampL at the left and lower left are derived as follows:

[0152] If predModeIntra is equal to INTRA_LT_CCLM, the following applies:

[0153] numSampT=availT? nTbW:0 (353)

[0154] numSampL=availL? nTbH:0 (354)

[0155] — Otherwise, the following applies:

[0156] numSampT=(availT&&predModeIntra==INTRA_T_CCLM)?

[0157] (nTbW+Min(numTopRight,nTbH)):0 (355)

[0158] numSampL=(availL&&predModeIntra==INTRA_L_CCLM)? (nTbH+Min(numLeftBelow,nTbW)):0 (356)

[0160] The variable bCTUboundary is derived as follows:

[0161] bCTUboundary=(yTbY&(CtbSizeY-1)==0)? TRUE:FALSE (357)

[0162] The variable cntN and array pickPosN, where N is replaced by L and T, are derived as follows:

[0163] —The variable numIs4N is derived as follows:

[0164] numIs4N=((availT&&availL&&predModeIntra==INTRA_LT_CCLM)?0:1)(358)

[0165] —The variable startPosN is set equal to numSampN>>(2+numIs4N).

[0166] - The variable pickStepN is set equal to Max(1, numSampN>>(1+numIs4N)).

[0167] —If availN is equal to TRUE and predModeIntra is equal to INTRA_LT_CCLM or INTRA_N_CCLM, then the following assignments are made:

[0168] —cntN is set equal to Min(numSampN, (1+numIs4N)<<1).

[0169] - pickPosN[pos] is set equal to (startPosN+pos×pickStepN), where pos=0..cntN-1.

[0170] Otherwise, cntN is set equal to 0.

[0171] The predicted sample point predSample[x][y], where x = 0..nTbW-1 and y = 0..nTbH-1, is derived as follows:

[0172] — If numSampL and numSampT are both equal to 0, then the following applies:

[0173] predSamples[x][y]=1<<(BitDepth-1) (359)

[0175] — Otherwise, the following ordered steps apply:

[0176] 1. The co-located luma sample pY[x][y] where x=0..nTbW×SubWidthC-1, y=0..TbH×SubHeightC-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).

[0177] 2. The adjacent brightness samples pY[x][y] are derived as follows:

[0178] - When numSampL is greater than 0, the adjacent left luma sample pY[x][y] with x = -1..-3, y = 0..SubHeightC×numSampL-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).

[0179] - When availT is equal to FALSE, the adjacent top luma sample pY[x][y] where x = -1..SubWidthC×numSampT-1, y = -1..-2 is set equal to luma sample pY[x][0].

[0180] - When availL is equal to FALSE, the adjacent left luma sample pY[x][y] where x = -1..-3, y = -1..SubHeightC×numSampL-1 is set equal to the luma sample pY[0][y].

[0181] - When numSampT is greater than 0, the adjacent top luma sample pY[x][y] where x = 0..SubWidthC×numSampT-1, y = -1..-2 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).

[0182] —When availTL is equal to true (TRUE), the adjacent upper left luma sample pY[x][y] where x=-1, y=-1, -2 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).

[0183] 3. The downsampled co-located luminance sample pDsY[x][y], where x = 0..nTbW-1 and y = 0..nTbH-1, is derived as follows:

[0184] If SubWidthC and SubHeightC are both equal to 1, then the following applies:

[0185] —pDsY[x][y], where x=1..nTbW-1, y=1..nTbH-1 is derived as follows:

[0186] pDstY[x][y]=pY[x][y] (360)

[0187] — Otherwise, the following applies:

[0188] —The one-dimensional filter coefficient arrays F1 and F2 and the two-dimensional filter coefficient arrays F3 and F4 are specified as follows.

[0189] F1[0]=2,F1[1]=0 (361)

[0190] F2[0]=1,F2[1]=2,F2[2]=1 (362)

[0191] F3[i][j]=F4[i][j]=0, ​​where i=0..2, j=0..2(363)

[0192] If SubWidthC and SubHeightC are both equal to 2, then the following applies:

[0193] F1[0]=1,F1[1]=1 (364)

[0194] F3[0][1]=1,F3[1][1]=4,F3[2][1]=1,F3[1][0]

[0195] =1, F3[1][2]=1 (365)

[0196] F4[0][1]=1,F4[1][1]=2,F4[2][1]=1 (366)

[0197] F4[0][2]=1,F4[1][2]=2,F4[2][2]=1 (367)

[0198] — Otherwise, the following applies:

[0199] F3[1][1]=8 (368)

[0200] F4[0][1]=2, F4[1][1]=4, F4[2][1]=2, (369)

[0201] - If sps_chroma_vertical_collocated_flag is equal to 1, the following applies:

[0202] —pDsY[x][y], where x=0..nTbW-1, y=0..nTbH-1 is derived as follows:

[0203] pDsY[x][y]=(F3[1][0]×pY[SubWidthC×x][SubHeightC×y-1]+

[0204] F3[0][1]×pY[SubWidthC×x-1][SubHeightC×y]+

[0205] F3[1][1]×pY[SubWidthC×x][SubHeightC×y]+(370)

[0206] F3[2][1]×pY[SubWidthC×x+1][SubHeightC×y]+

[0207] F3[1][2]×pY[SubWidthC×x][SubHeightC×y+1]+4)>>3

[0208] Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies:

[0209] —pDsY[x][y], where x=0..nTbW-1, y=0..nTbH-1 is derived as follows:

[0210] pDsY[x][y]=(F4[0][1]×pY[SubWidthC×x-1][SubHeightC×y]+

[0211] F4[0][2]×pY[SubWidthC×x-1][SubHeightC×y+1]+

[0212] F4[1][1]×pY[SubWidthC×x][SubHeightC×y]+(371)

[0213] F4[1][2]×pY[SubWidthC×x][SubHeightC×y+1]+

[0214] F4[2][1]×pY[SubWidthC×x+1][SubHeightC×y]+

[0215] F4[2][2]×pY[SubWidthC×x+1][SubHeightC×y+1]+4)>>3

[0216] 4. When numSampL is greater than 0, the selected adjacent left chroma sample pSelC[idx] is set equal to p[-1][pickPosL[idx]], where idx = 0..cntL-1, and the selected downsampled adjacent left luma sample pSelDsY[idx], where idx = 0..cntL-1, is derived as follows:

[0217] —The variable y is set equal to pickPosL[idx].

[0218] If SubWidthC and SubHeightC are both equal to 1, then the following applies:

[0219] pSelDsY[idx]=pY[-1][y] (372)

[0220] — Otherwise, the following applies:

[0221] If sps_chroma_vertical_collocated_flag is equal to 1, the following applies: pSelDsY[idx] = (F3[1][0] x pY[-SubWidthC][SubHeightC x y-1] +

[0222] F3[0][1]×pY[-1-SubWidthC][SubHeightC×y]+

[0223] F3[1][1]×pY[-SubWidthC][SubHeightC×y]+(373)

[0224] F3[2][1]×pY[1-SubWidthC][SubHeightC×y]+

[0225] F3[1][2]×pY[-SubWidthC][SubHeightC×y+1]+4)>>3

[0226] Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies: pSelDsY[idx] = (F4[0][1] × pY[-1-SubWidthC][SubHeightC×y] +

[0227] F4[0][2]×pY[-1-SubWidthC][SubHeightC×y+1]+

[0228] F4[1][1]×pY[-SubWidthC][SubHeightC×y]+(374)

[0229] F4[1][2]×pY[-SubWidthC][SubHeightC×y+1]+

[0230] F4[2][1]×pY[1-SubWidthC][SubHeightC×y]+

[0231] F4[2][2]×pY[1-SubWidthC][SubHeightC×y+1]+4)>>3

[0232] 5. When numSampT is greater than 0, the selected adjacent top chroma sample pSelC[idx] is set equal to p[pickPosT[idx-cntL]][-1], where idx=cntL..cntL+cntT-1, and the downsampled adjacent top luma sample pSelDsY[idx], where idx=0..cntL+cntT-1 is specified as follows:

[0233] —The variable x is set equal to pickPosT[idx-cntL].

[0234] If SubWidthC and SubHeightC are both equal to 1, then the following applies:

[0235] pSelDsY[idx]=pY[x][-1] (375)

[0236] — Otherwise, the following applies:

[0237] - If sps_chroma_vertical_collocated_flag is equal to 1, the following applies:

[0238] If bCTUboundary is equal to FALSE, then the following applies: pSelDsY[idx] = (F3[1][0] x pY[SubWidthC x x][-1-SubHeightC] +

[0239] F3[0][1]×pY[SubWidthC×x-1][-SubHeightC]+

[0240] F3[1][1]×pY[SubWidthC×x][-SubHeightC]+(376)

[0241] F3[2][1]×pY[SubWidthC×x+1][-SubHeightC]+

[0242] F3[1][2]×pY[SubWidthC×x][1-SubHeightC]+4)>>3

[0243] — Otherwise (bCTUboundary is TRUE), the following applies:

[0244] pSelDsY[idx]=(F2[0]×pY[SubWidthC×x-1][-1]+

[0245] F2[1]×pY[SubWidthC×x][-1]+(377)

[0246] F2[2]×pY[SubWidthC×x+1][-1]+2)>>2

[0247] Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies:

[0248] If bCTUboundary is equal to FALSE, the following applies:

[0249] pSelDsY[idx]=(F4[0][1]×pY[SubWidthC x-1][-1]+

[0250] F4[0][2]×pY[SubWidthC×x-1][-2]+

[0251] F4[1][1]×pY[SubWidthC×x][-1]+(378)

[0252] F4[1][2]×pY[SubWidthC×x][-2]+

[0253] F4[2][1]×pY[SubWidthC×x+1][-1]+

[0254] F4[2][2]×pY[SubWidthC×x+1][-2]+4)>>3

[0255] — Otherwise (bCTUboundary is TRUE), the following applies:

[0256] pSelDsY[idx]=(F2[0]×pY[SubWidthC×x-1][-1]+

[0257] F2[1]×pY[SubWidthC×x][-1]+(379)

[0258] F2[2]×pY[SubWidthC×x+1][-1]+2)>>2

[0259] 6. When cntT+cntL is not equal to 0, the variables minY, maxY, minC, and maxC are derived as follows:

[0260] —When cntT+cntL is equal to 2, pSelComp[3] is set equal to pSelComp[0], pSelComp[2] is set equal to pSelComp[1], pSelComp[0] is set equal to pSelComp[1], pSelComp[1] is set equal to pSelComp[3], and Comp is replaced by DsY and C.

[0261] —The arrays minGrpIdx and maxGrpIdx are derived as follows:

[0262] minGrpIdx[0]=0 (380)

[0263] minGrpIdx[1]=2 (381)

[0264] maxGrpIdx[0]=1 (382)

[0265] maxGrpIdx[1]=3 (383)

[0266] —When pSelDsY[minGrpIdx[0]] is greater than pSelDsY[minGrpIdx[1]], minGrpIdx[0] and minGrpIdx[1] are swapped as follows:

[0267] (minGrpIdx[0], minGrpIdx[1])=Swap(minGrpIdx[0], minGrpIdx[1 (384)

[0268] —When pSelDsY[maxGrpIdx[0]] is greater than pSelDsY[maxGrpIdx[1]], maxGrpIdx[0] and maxGrpIdx[1] are swapped as follows:

[0269] (maxGrpIdx[0], maxGrpIdx[1])=Swap(maxGrpIdx[0], maxGrpIdx[1] (385)

[0271] —When pSelDsY[minGrpIdx[0]] is greater than pSelDsY[maxGrpIdx[1]], the arrays minGrpIdx and maxGrpIdx are swapped as follows:

[0272] (minGrpIdx, maxGrpIdx) = Swap (minGrpIdx, maxGrpIdx) (386)

[0273] —When pSelDsY[minGrpIdx[1]] is greater than pSelDsY[maxGrpIdx[0]], minGrpIdx[1] and maxGrpIdx[0] are swapped as follows:

[0274] (minGrpIdx[1], maxGrpIdx[0])=Swap(minGrpIdx[1], maxGrpIdx[0]) (387)

[0276] —The variables maxY, maxC, minY, and minC are derived as follows:

[0277] maxY=(pSelDsY[maxGrpIdx[0]]+pSelDsY[maxGrpIdx[1]]+1)>>1 (388)

[0278] maxC=(pSelC[maxGrpIdx[0]]+pSelC[maxGrpIdx[1]]+1)>>1 (389)

[0279] minY=(pSelDsY[minGrpIdx[0]]+pSelDsY[minGrpIdx[1]]+1)>>1 (390)

[0280] minC=(pSelC[minGrpIdx[0]]+pSelC[minGrpIdx[1]]+1)>>1(391)

[0281] 7. The variables a, b, and k are derived as follows:

[0282] — If numSampL is equal to 0 and numSampT is equal to 0, then the following applies:

[0283] k=0 (392)

[0284] a=0 (393)

[0285] b=1<<(BitDepth-1) (394)

[0286] — Otherwise, the following applies:

[0287] diff=maxY-minY (395)

[0288] — If diff is not equal to 0, the following applies:

[0289] diffC=maxC-minC (396)

[0290] x=Floor(Log2(diff)) (397)

[0291] normDiff=((diff<<4)>>x)&15 (398)

[0292] x+=(normDiff!=0)? 1:0 (399)

[0293] y=Abs(diffC)>0? Floor(Log2(Abs(diffC)))+1:0 (400)

[0294] a=(diffC×(divSigTable[normDiff]|8)+2 y - 1 )>>y (401)

[0295] k=((3+xy)<1)? 1:3+xy (402)

[0296] a=((3+xy)<1)? Sign(a)×15:a (403)

[0297] b=minC-((a×minY)>>k) (404)

[0298] where divSigTable[] is specified as follows:

[0299] divSigTable[]={0, 7, 6, 5, 5, 4, 4, 3, 3, 2, 2, 1, 1, 1, 1, 0} (405)

[0300] — Otherwise (diff is equal to 0), the following applies:

[0301] k=0 (406)

[0302] a=0 (407)

[0303] b=minC (408)

[0304] 8. The predicted sample point predSample[x][y], where x = 0..nTbW-1 and y = 0..nTbH-1, is derived as follows:

[0305] predSamples[x][y]=Clip1(((pDsY[x][y]×a)>>k)+b) (409)

[0306] NOTE - This process uses sps_chroma_vertical_collocated_flag. However, to simplify the implementation, it does not use sps_chroma_horizontal_collocated_flag.

[0307] 2.8. Block Differential Pulse Code Modulation (BDPCM)

[0308] BDPCM was proposed in JVET-M0057. Due to the shape of the horizontal (vertical) predictor, which uses the left (A) (top (B)) pixels to predict the current pixel, the most throughput-efficient way to process a block is to process all pixels of a column (row) in parallel and process these columns (rows) sequentially. To improve throughput, we introduce the following procedure: when the predictor selected on this block is vertical, the block of width 4 is split into two halves with a horizontal boundary; when the predictor selected on this block is horizontal, the block of height 4 is split into two halves with a vertical boundary.

[0309] When a block is split, samples from one region are not allowed to use pixels from another region to compute a prediction: if this happens, the predicted pixel is replaced by a reference pixel in the prediction direction. This is done for different positions of the current pixel X in a vertically predicted 4×8 block. Figure 5 Shown in.

[0310] Figure 5An example of partitioning a block of 4x8 samples into two independent decodable areas is shown.

[0311] Due to this feature, it is now possible to process a 4×4 block in 2 cycles, a 4×8 or 8×4 block in 4 cycles, and so on, as Figure 6 shown.

[0312] Figure 6 An example order of processing pixel rows to maximize throughput for a 4xN block with a vertical predictor is shown.

[0313] Table 2-3 summarizes the number of cycles required to process a block, depending on the block size, showing that any block with both dimensions greater than or equal to 8 can be processed with 8 pixels per cycle or more, which is easily solvable.

[0314] Table 2-3. Worst-case throughput for blocks of size 4×N, N×4

[0315]

[0316] 2.9. Quantized Residual Domain BDPCM

[0317] JVET-N0413 proposed quantized residual domain BDPCM (hereinafter referred to as RBDPCM). Intra-frame prediction is performed on the entire block by replicating samples in the prediction direction (horizontal or vertical prediction) similar to intra-frame prediction. The residual is quantized, and the delta between the quantized residual and its predictor (horizontal or vertical) quantized value is encoded and decoded.

[0318] For a block of size M (rows) × N (columns), let r i,j , 0≤i≤M-1, 0≤j≤N-1 is the prediction residual after performing intra prediction horizontally (copying the left adjacent pixel values ​​row by row across the prediction block) or vertically (copying the top adjacent row to each row in the prediction block) using the unfiltered samples from the upper or left block boundary samples. Let Q(r i,j ), 0≤i≤M-1, 0≤j≤N-1 represents the residual r i , j The quantized version of , where the residual is the difference between the original block value and the predicted block value. Block DPCM is then applied to the quantized residual samples to obtain a value with elements The modified M×N array of When vertical BDPCM is signaled:

[0319]

[0320] For horizontal prediction, similar rules are applied and the residual quantization samples are obtained by

[0321]

[0322] Residual quantization samples is sent to the decoder.

[0323] At the decoder side, the above calculation is inverted to produce Q(r i,j ),0≤i≤M-1,0≤j≤N-1. For vertical prediction,

[0324]

[0325] For the horizontal case,

[0326]

[0327] The inverse quantized residual Q -1 (Q(r i , j )) is added to the intra-block prediction value to generate the reconstructed sample value.

[0328] The main advantage of this scheme is that the inverse DPCM can be performed dynamically during coefficient analysis, simply by adding the predictor when the coefficients are analyzed, or it can be performed after analysis.

[0329] In quantized residual domain BDPCM, the transform skip method is often used.

[0330] 2.10. Multiple Transform Set (MTS) in VVC

[0331] In VTM, large block size transforms are enabled, up to 64×64, which is mainly used for higher resolution video, such as 1080p and 4K sequences. For transform blocks with a size (width or height, or both width and height) equal to 64, the high-frequency transform coefficients are zeroed, so that only the low-frequency coefficients are retained. For example, for an M×N transform block, where M is the block width and N is the block height, when M is equal to 64, only the left 32 columns of transform coefficients are retained. Similarly, when N is equal to 64, only the top 32 rows of transform coefficients are retained. When transform skip mode is used for large blocks, the entire block will be used without clearing any values. VTM also supports a configurable maximum transform size in SPS, allowing the encoder to flexibly select transform sizes up to 16 lengths, 32 lengths, or 64 lengths according to the needs of the specific implementation.

[0332] In addition to the DCT-II used in HEVC, a Multiple Transform Selection (MTS) scheme is used for residual coding of blocks in inter- and intra-frame coding. This scheme uses multiple selected transforms from DCT8 / DST7. The newly introduced transform matrices are DCT-VII and DCT-VIII. Tables 2-4 show the basis functions of the selected DST / DCT.

[0333] Table 2-4. Basic functions of DCT-II / VIII and DSTVII transforms for N-point input

[0334]

[0335]

[0336] To maintain the orthogonality of the transform matrix, the quantization of the transform matrix is ​​more accurate than that in HEVC. To keep the intermediate values ​​of the transformed coefficients within the 16-bit range, all coefficients should be 10 bits after horizontal and vertical transforms.

[0337] To control the MTS scheme, separate enable flags are specified at the SPS level for intra and inter frames. When MTS is enabled at the SPS, a CU-level flag is signaled to indicate whether MTS is applied. Here, MTS applies only to luma. The MTS CU-level flag is signaled when the following conditions are met.

[0338] - Both width and height are less than or equal to 32

[0339] -CBF flag equal to 1

[0340] If the MTS CU flag is equal to zero, DCT2 is applied in both directions. However, if the MTS CU flag is equal to 1, two other flags are additionally signaled to indicate the transform type for the horizontal and vertical directions, respectively. The transform and signaling mapping table is shown in Table 2-5. The transform selection of ISP is unified, and implicit MTS is used by eliminating the dependency on intra mode and block shape. If the current block is in ISP mode, or if the current block is an intra block and both intra and inter explicit MTS are turned on, only DST7 is used for both horizontal and vertical transform kernels. When it comes to transform matrix accuracy, an 8-bit main transform kernel is used. Therefore, all transform kernels used in HEVC remain unchanged, including 4-point DCT-2 and DST-7, 8-point, 16-point and 32-point DCT-2. Moreover, other transform kernels including 64-point DCT-2, 4-point DCT-8, 8-point, 16-point, 32-point DST-7 and DCT-8 use 8-bit main transform kernel.

[0341] Table 2-5. Transformation and signaling mapping table

[0342]

[0343]

[0344] To reduce the complexity of large-size DST-7 and DCT-8, high-frequency transform coefficients are zeroed for DST-7 and DCT-8 blocks with size (width or height, or both) equal to 32. Only coefficients in the 16×16 low-frequency region are retained.

[0345] As in HEVC, the residual of a block can be coded or decoded in transform skip mode. To avoid syntax coding redundancy, the transform skip flag is not signaled when the CU level MTS_CU_flag is not equal to zero. The block size restrictions for transform skip are the same as MTS in JEM4, which indicates that transform skip applies to CUs with both block width and block height equal to or less than 32. Note that when LFNST or MIP is activated for the current CU, the implicit MTS transform is set to DCT2. Moreover, when MTS is enabled for inter-frame coded blocks, implicit MTS can still be enabled.

[0346] 2.1.1. Low-Frequency Non-Separable Transform (LFNST)

[0347] In VVC, such as Figure 7 As shown, LFNST (Low-Frequency Non-Separable Transform) is applied between the forward main transform and quantization (at the encoder) and between dequantization and inverse main transform (at the decoder side), which is called a simplified auxiliary transform. In LFNST, a 4×4 non-separable transform or an 8×8 non-separable transform is used depending on the block size. For example, 4×4 LFNST is applied to small blocks (i.e., min(width, height) < 8), while 8×8 LFNST is applied to larger blocks (i.e., min(width, height) > 4).

[0348] Figure 7 An example of a low frequency non-separable transform (LFNST) process is shown.

[0349] The following describes the application of the non-separable transformation used in LFNST, taking the input as an example. To apply 4×4 LFNST, the 4×4 input block X

[0350]

[0351] First, we express it as a vector

[0352]

[0353] The non-separable transformation is calculated as in The 16×1 coefficient vector is then transformed using the scan order of the block (horizontally, vertically, or diagonally). Reorganized into 4×4 blocks. Coefficients with smaller indices are placed in the 4×4 coefficient block together with smaller scan indices.

[0354] 2.11.1 Simplified Inseparable Transform

[0355] The LFNST (Low Frequency Non-Separable Transform) applies a non-separable transform based on direct matrix multiplication to achieve it in a single pass without multiple iterations. However, the dimension of the non-separable transform matrix needs to be reduced to minimize the computational complexity and the storage spatial domain for storing transform coefficients. Therefore, the Simplified Non-Separable Transform (or RST) method is used in LFNST. The main idea of the Simplified Non-Separable Transform is to map an N-dimensional vector (N of the 8×8 NSST usually equals 64) to an R-dimensional vector in a different space, where N / R (R < N) is the reduction factor. Thus, the RST matrix replaces the N×N matrix to become an R×N matrix as shown below:

[0356]

[0357] The R rows of the transform are the R basis of the N-dimensional space. The inverse transform matrix of the RT is the transpose of its forward transform. For 8×8 LFNST, a reduction factor of 4 is used to reduce the traditional 8×8 non-separable transform matrix size of 64×64 to a direct matrix of 16×48. Therefore, a 48×16 inverse RST matrix is ​​used at the decoder to generate the core (primary) transform coefficients of the 8×8 upper left region. When using a 16×48 matrix with the same transform set configuration instead of a 16×64 matrix, each matrix takes 48 input data from the three 4×4 blocks in the upper left 8×8 block, excluding the lower right 4×4 block. With the help of dimensionality reduction, the memory usage of storing all LFNST matrices is reduced from 10KB to 8KB, with reasonable performance degradation. To reduce complexity, LFNST is restricted to only be applied when all coefficients outside the first coefficient subgroup are non-significant. Therefore, when LFNST is applied, all primary transform coefficients must be zero. This allows for the adjustment of LFNST index signaling at the least significant position, thus avoiding the additional coefficient scans required in current LFNST designs to check for significant coefficients only at specific positions. The worst-case handling of LFNST (in terms of per-pixel multiplications) restricts the non-separable transforms for 4×4 and 8×8 blocks to 8×16 and 8×48 transforms, respectively. In these cases, when applying LFNST, the least significant scan position must be less than 8, and less than 16 for other sizes. For blocks of shape 4×n and N×4 with N>8, the proposed restriction means that LFNST is now applied only once, and only to the top-left 4×4 region. When applying LFNST, the number of operations required for the main transform is reduced in this case, as all main-only coefficients are zero. From the encoder's perspective, the quantization of the coefficients is significantly simplified when testing the LFNST transform. The first 16 coefficients (in scan order) must be quantized for maximum rate distortion optimization, with the remaining coefficients forced to zero.

[0358] 2.11.2. LFNST Transform Selection

[0359] A total of 4 transform sets are used in LFNST, each using 2 inseparable transform matrices (kernels). The mapping from intra prediction modes to transform sets is predefined as shown in Table 2-6. If one of the three CCLM modes (INTRA_LT_CCLM, INTRA_T_CCLM, or INTRA_L_CCLM) is used for the current block (81 <= predModeIntra <= 83), transform set 0 is selected for the current chroma block. For each transform set, the selected inseparable auxiliary transform candidate is further specified by the LFNST index that is explicitly signaled. After the transform coefficients, the index is signaled once per CU in the bitstream.

[0360] Table 2-6. Transformation selection table

[0361] IntraPredMode Tr set index IntraPredMode<0 1 0<=IntraPredMode<=1 0 2<=IntraPredMode<=12 1 13<=IntraPredMode<=23 2 24<=IntraPredMode<=44 3 45<=IntraPredMode<=55 2 56<=IntraPredMode<=80 1 81<=IntraPredMode<=83 0

[0362] 2.11.3.LFNST Index Signaling and Its Interaction with Other Tools

[0363] Since LFNST is restricted to being applicable only when all coefficients outside the first coefficient subgroup are non-significant, the LFNST index encoding depends on the position of the last significant coefficient. In addition, the LFNST index is context-encoded, but does not depend on the intra prediction mode, and only the first binary number is context-encoded. In addition, LFNST is applied to intra CUs in both intra and inter slices and for both luma and chroma. If binary tree is enabled, the LFNST indexes for luma and chroma are signaled separately. For inter slices (binary tree disabled), a single LFNST index is signaled and used for both luma and chroma.

[0364] When ISP mode is selected, LFNST is disabled and the RST index is not signaled, as even if RST is applied to every feasible partition, the performance improvement is minimal. In addition, disabling RST for ISP prediction residuals can reduce coding complexity. When MIP mode is selected, LFNST is also disabled and the index is not signaled.

[0365] Considering that due to the existing maximum transform size limit (64×64), larger CUs than 64×64 are implicitly split (TU tiling), LFNST index search can increase the data buffer by four times for a certain number of decoding pipeline stages. Therefore, the maximum size allowed by LFNST is limited to 64×64. Note that LFNST is only enabled in DCT2.

[0366] 2.12. Transform Skip for Chroma

[0367] Chroma Transform Skip (TS) was introduced in VVC. The motivation was to unify TS and MTS signaling between luma and chroma by relocating transform_skip_flag and mts_idx to the residual_coding section. A context model was added for the chroma TS. The context model and binarization for mts_idx remained unchanged. Furthermore, TS residual codec was applied when using the chroma TS.

[0368] Semantics

[0369] transform_skip_flag[x0][y0][cIdx] specifies whether the transform is applied to the associated luma transform block. Array indices x0, y0 specify the position (x0, y0) of the top-left luma sample of the transform block under consideration relative to the top-left luma sample of the picture. transform_skip_flag[x0][y0][cIdx] equal to 1 specifies that no transform is applied to the current luma transform block. Array index cIdx specifies the indicator of the color component; equal to 0 for luma, 1 for Cb, and 2 for Cr. transform_skip_flag[x0][y0][cIdx] equal to 0 specifies that whether the transform is applied to the current transform block depends on other syntax elements. When transform_skip_flag[x0][y0][cIdx] is not present, it is inferred to be equal to 0.

[0370] BDPCM for Chroma

[0371] In addition to chroma TS support, BDPCM is added to the chroma component. If sps_bdpcm_enable_flag is 1, another syntax element, sps_bdpcm_chroma_enable_flag, is added to the SPS. These flags have the following behavior, as shown in Table 2-7.

[0372] Table 2-7. SPS flags for luminance and chrominance BDPCM

[0373]

[0374] When BDPCM is only applied to luma, the current behavior is unchanged. When BDPCM is also applied to chroma, a bdpcm_chroma_flag is sent for each chroma block. This indicates whether BDPCM is used on the chroma block. When enabled, BDPCM is used for both chroma components, and an additional bdpcm_dir_chroma flag is encoded, indicating the prediction direction used for both chroma components.

[0375] The deblocking filter is deactivated on the boundary between two Block-DPCM blocks, since neither block uses the transform stage that is usually responsible for blocking artifacts. This deactivation occurs independently for the luma and chroma components.

[0376] 3. Examples of technical problems solved by the disclosed solutions

[0377] The current design of linear parameter derivation in CCLM and TS has the following problems:

[0378] 1. For non-4:4:4 color formats, the derivation of linear parameters in CCLM involves adjacent chroma samples and downsampled co-located adjacent luminance samples. Figure 8 As shown in Figure 2, in the current VVC, when the nearest row is not at a CTU boundary, the second row above the current block of 4:2:2 video is used to derive the downsampled co-located adjacent top luma sample. However, for 4:2:2 video, the vertical resolution remains unchanged. Therefore, there is a phase shift between the downsampled co-located adjacent top luma sample and the adjacent chroma samples.

[0379] Figure 8 An example of adjacent chroma samples and downsampled co-located adjacent luma samples used in the derivation of CCLM parameters for 4:2:2 video is shown.

[0380] 2. In the current VVC, for the signaling of the luma transform skip flag and the signaling of the chroma transform skip flag, the same maximum block size is used in the conditional check. This design does not take the color format into consideration, which is not desirable.

[0381] a. A similar problem exists for the signaling of the luma BDPCM flag and the signaling of the chroma BDPCM flag, where the same maximum block size is used in the conditional check.

[0382] 3. In VVC as specified in JVET-Q2001-vE, the left neighboring sample is placed before the upper neighboring sample in the selected neighboring sample list. However, it may be better to place the upper neighboring sample before the left neighboring sample.

[0383] 4. In VVC specified in JVET-Q2001-vE, two adjacent rows of luma samples are allocated. However, when sps_chroma_vertical_collocated_flag is equal to 1, three adjacent rows of luma samples are required.

[0384] 5. In VVC specified in JVET-Q2001-vE, when the left-neighboring luma sample is not available, the left-neighboring luma sample is padded with the leftmost sample of the current block, and the top-neighboring luma sample is padded with the top-left-neighboring luma sample. However, the top-neighboring luma sample has not yet been derived. For example, in JVET-Q2001-VE.

[0385] "— when availL is equal to FALSE, the adjacent left luma sample pY[x][y] with x = -1..-3, y = -1..SubHeightC×numSampL-1 is set equal to the luma sample pY[0][y]. — when numSampT is greater than 0, the adjacent top luma sample pY[x][y] with x = 0..SubWidthC×numSampT-1, y = -1..-2 is set equal to the reconstructed luma sample at position (xTbY+x, yTbY+y) before the deblocking filtering process."

[0386] 6. In VVC specified in JVET-Q2001-vE, when the top (or / and left) neighboring luma samples are not available, they are incorrectly derived. For example, in JVET-Q2001-vE, "when availT is equal to FALSE, the neighboring top luma sample pY[x][y] where x = -1..SubWidthC×numSampT-1, y = -1..-2 is set equal to luma sample pY[x][0]" is used to derive the top neighboring luma samples when they are not available. However, when the top neighboring luma sample is not available, numSampT is set to 0.

[0387] 7. In the current VVC, when the top and left neighboring luminance samples are available, the top left neighboring luminance sample is used for the derivation of CCLM parameters, but when the top and left neighboring luminance samples are in different strips (for example, in the case of raster strips), the top left neighboring luminance sample is not available.

[0388] 4. List of Examples and Techniques

[0389] The following list should be considered as examples to explain the general concept. These items should not be interpreted narrowly. In addition, these items can be combined in any way.

[0390] In this article, the term "CCLM" refers to a codec that uses cross-color component information to predict the samples / residuals of the current color component or to derive the reconstruction of the samples in the current color component. It is not limited to the CCLM technology described in VVC.

[0391] Derivation of linear parameters in CCLM

[0392] 1. When deriving CCLM parameters for a chroma block, one or more upper neighboring rows of its co-located luma block may be used to derive its downsampled co-located top luma samples.

[0393] a. In one example, when the current chroma block is not at the top CTU boundary, the nearest upper row of the co-located luma block, rather than the second row above, can be used to derive the downsampled co-located adjacent top luma sample.

[0394] i. In one example, a same downsampling filter can be used to derive the downsampled co-located adjacent top luma samples and the downsampled co-located adjacent left luma samples.

[0395] 1) For example, a [1 2 1] filter can be used. More specifically, pDsY[x]=(pY[2×

[0396] x-1][-1]+2×pY[2×x][-1]+pY[2×x+1][-1]+2)>>2, where pY[2×x][-1],

[0397] pY[2×x-1][-1], pY[2×x+1][-1] are the luminance samples from the nearest upper adjacent row, and pDsY[x] represents the downsampled co-located adjacent top luminance sample.

[0398] ii. In one example, different downsampling filters (eg, different filter taps / different filter coefficients) may be used to derive the downsampled co-located adjacent top luma samples and the downsampled co-located adjacent left luma samples.

[0399] iii. In one example, a same downsampling filter may be used to derive the downsampled co-located adjacent top luma samples regardless of the location of the chroma blocks (e.g., the chroma blocks may or may not be at the top CTU boundary).

[0400] iv. In one example, the above method can be applied only to pictures / videos in 4:2:2 format.

[0401] b. In one example, when the current chroma block is not at the top CTU boundary, the upper neighboring luma samples, including the nearest upper row of the co-located luma block but excluding the second row above, can be used to derive the downsampled co-located upper neighboring luma samples.

[0402] c. In one example, the derivation of downsampled co-located adjacent top luma samples may depend on samples located at multiple rows.

[0403] i. In one example, it may rely on the second nearest row and the nearest row above the co-located luma block.

[0404] ii. In one example, for different color formats (eg, 4:2:0 and 4:2:2), a same downsampling filter can be used to derive downsampled co-located adjacent top luma samples.

[0405] 1) In one example, a 6-tap filter (eg, [1 2 1; 1 2 1]) may be used.

[0406] a) In one example, the downsampled co-located adjacent top luma sample may be derived as: pDsY[x]=(pY[2×x-1][-2]+2×pY[2×x][-2]+pY[2×x-1][-1]+2×pY[2×x][-1]+pY[2×x+1][-1]+pY[2×x+1][-1]+4)>>3, where pY is the corresponding luma sample and pDsY[x] represents the downsampled co-located adjacent top luma sample.

[0407] b) Alternatively, also when sps_cclm_colocated_chroma_flag is equal to 0, the above method may be applied.

[0408] 2) In one example, a 5-tap filter may be used (eg, [0 1 0; 1 4 1; 0 1 0]).

[0409] a) In one example, the downsampled co-located adjacent top luma sample may be derived as: pDsY[x]=(pY[2×x][-2]+pY[2×x][-1]+4×pY[2×x][-1]+pY[2×x+1][-1]+pY[2×x][0]+4)>>3, where pY is the corresponding luma sample and pDsY[x] represents the downsampled co-located adjacent top luma sample.

[0410] b) Alternatively, also when sps_cclm_colocated_chroma_flag is equal to 1, the above method may be applied.

[0411] iii. In one example, the above method can be applied only to pictures / videos in 4:2:2 format.

[0412] Change the maximum block size for skipping codec blocks (e.g., in the case where transform_skip_flag is equal to 1, or in BDPCM or other modes that skip transform processing / use a signature transform)

[0413] 2. The maximum block size of a transform skip codec block may depend on the color component. The maximum block size of transform skip codec blocks for luma and chroma are denoted by MaxTsSizeY and MaxTsSizeC respectively.

[0414] a. In one example, the maximum block sizes for luma and chroma components may be different.

[0415] b. In one example, the maximum block size for the two chroma components may be different.

[0416] c. In one example, the maximum block size for luma and chroma components or for each color component may be signaled separately.

[0417] i. In one example, MaxTsSizeC / MaxTsSizeY may be signaled at the sequence level / picture level / slice level / slice group level, such as in the sequence header / picture header / SPS / VPS / DPS / PPS / APS / slice header / slice group header.

[0418] ii. In one example, MaxTsSizeY may be signaled conditionally, such as depending on whether transform skip is enabled / BDPCM is enabled.

[0419] iii. In one example, MaxTsSizeC may be signaled conditionally, such as depending on color format / transform skip enabled / BDPCM enabled.

[0420] iv. Alternatively, a predictive codec between the maximum block sizes for luma and chroma components may be used.

[0421] d. In one example, MaxTsSizeC may depend on MaxTsSizeY.

[0422] i. In one example, MaxTsSizeC may be set equal to MaxTsSizeY.

[0423] ii. In one example, MaxTsSizeC may be set equal to MaxTsSizeY / N (N is an integer). For example, N=2.

[0424] e. In one example, MaxTsSizeC can be set according to the chroma subsampling ratio.

[0425] i. In one example, MaxTsSizeC is set equal to MaxTsSizeY>>SubWidthC, where SubWidthC is defined in Table 2-1.

[0426] ii. In one example, MaxTsSizeC is set equal to MaxTsSizeY>>SubHeightC, where SubHeightC is defined in Table 2-1.

[0427] iii. In one example, MaxTsSizeC is set equal to MaxTsSizeY>>max(SubWidthC, SubHeightC).

[0428] iv. In one example, MaxTsSizeC is set equal to MaxTsSizeY>>min(SubWidthC, SubHeightC).

[0429] 3. The maximum allowed block size, width and height of the transform codec block can be defined differently.

[0430] a. In one example, the maximum allowed block size width and height can be signaled separately.

[0431] b. In one example, the maximum allowed block size width and height of the chroma transform codec block can be expressed as MaxTsSizeWC and MaxTsSizeHC, respectively. MaxTsSizeWC can be set equal to MaxTsSizeY>>SubWidthC, and MaxTsSizeHC can be set equal to MaxTsSizeY>>SubHeightC.

[0432] i. In one example, MaxTsSizeY is that defined in bullet 2.

[0433] 4. Whether to signal the transform skip flag for chroma blocks (e.g., transform_skip_flag[x0][y0][1] and / or transform_skip_flag[x0][y0][2]) may depend on the maximum allowed size of the chroma transform skip codec block.

[0434] a. In one example, the chroma transform skip flag may be conditionally signaled based on the following conditions:

[0435] i. In one example, the condition is: tbW is less than or equal to MaxTsSizeC and tbH is less than or equal to MaxTsSizeC, where tbW and tbH are the width and height of the current chroma block.

[0436] 1) In one example, MaxTsSizeC may be defined as that in bullet points 2-3.

[0437] ii. In one example, the condition is: tbW is less than or equal to MaxTsSizeWC and tbH is less than or equal to MaxTsSizeHC, where tbW and tbH are the width and height of the current chroma block, and MaxTsSizeWC and MaxTsSizeHC represent the maximum allowed block size width and height of the chroma transform skip codec block, respectively.

[0438] 1) In one example, MaxTsSizeWC and / or MaxTsSizeHC may be defined as in bullet point 3.

[0439] b. In one example, the above method can be applied to the encoding and decoding of the chroma BDPCM flag (eg, intra_bdpcm_chroma_flag) by replacing "transform skip" with "BDPCM".

[0440] 5. It is proposed to use one syntax to indicate the use of TS for two chrominance color components, rather than encoding and decoding two TS flags for two chrominance color components.

[0441] a. In one example, instead of encoding and decoding transform_skip_flag[x0][y0][1] and / or transform_skip_flag[x0][y0][2]), a single syntax element (eg, TS_chroma_flag) may be encoded and decoded.

[0442] i. In one example, the value of a single syntax element is a binary value.

[0443] 1) Furthermore, alternatively, two chroma component blocks share the same TS mode on / off control according to a single syntax element.

[0444] a) In one example, a single syntax element with a value equal to 0 indicates that TS is disabled for both.

[0445] b) In one example, a single syntax element with a value equal to 0 indicates that TS is enabled for both.

[0446] 2) In addition, alternatively, the second syntax element may be further signaled based on whether the value of the single syntax element is equal to K (eg, K=1).

[0447] a) In one example, a single syntax element with a value equal to 0 indicates that TS is disabled for both; a single syntax element with a value equal to 0 indicates that TS is enabled for at least one of the two chroma components.

[0448] b) The second syntax element may be used to indicate to which of the two chroma components the TS is applied and / or whether the TS is applied to both of them.

[0449] ii. In one example, the value of a single syntax element is a non-binary value.

[0450] 1) In one example, a single syntax element with a value equal to K0 indicates that TS is disabled for both.

[0451] 2) In one example, a single syntax element with a value equal to K1 indicates that TS is enabled for the first chroma color component and disabled for the second color component.

[0452] 3) In one example, a single syntax element with a value equal to K2 indicates that TS is disabled for the first chroma color component and enabled for the second color component.

[0453] 4) In one example, a single syntax element with a value equal to K3 indicates that TS is enabled for both.

[0454] 5) In one example, a single syntax element can be encoded and decoded using fixed-length, unary, truncated unary, and k-order EG binarization methods.

[0455] iii. In one example, the single syntax element and / or the second syntax element may be context coded or bypass coded.

[0456] General Statement

[0457] 6. Whether and / or how to apply the above disclosed method can be signaled at the sequence level / picture level / slice level / slice group level, such as in the sequence header / picture header / SPS / VPS / DPS / PPS / APS / slice header / slice group header.

[0458] 7. Whether and / or how to apply the above disclosed method depends on codec information, such as color format, single tree / binary tree partitioning.

[0459] Additional statement to CCLM

[0460] 8. During CCLM parameter derivation, the upper neighboring sample point is placed in a selected neighboring sample point list before the left neighboring sample point, and the CCLM parameters are deduced using the selected neighboring sample point list (e.g., using a four-point derivation method where the two larger values ​​are averaged, the two smaller values ​​are averaged, and the two averages are used to derive the linear parameters). An example is demonstrated in Example 5.

[0461] 9. During CCLM parameter derivation, when the downsampled upper adjacent luma sample denoted as pSelDsY[idx] is obtained, the index value idx shall be in the range of cntL to cntL+cntT-1, where cntL and cntT represent the number of left adjacent chroma samples and upper adjacent chroma samples, respectively, used to derive CCLM parameters.

[0462] a. An example is demonstrated in Example 5.

[0463] b. Additionally, alternatively, the left neighboring sample point is placed in the selected neighboring sample point list before the upper neighboring sample point.

[0464] 10. During the CCLM parameter derivation process, three rows of adjacent luminance samples are allocated. An example is demonstrated in Example 6.

[0465] 11. During CCLM parameter derivation, the upper left adjacent luminance samples of row T1 and column T2 are allocated.

[0466] a. In one example, T1 = 2 and T2 = 2. An example is demonstrated in Example 12.

[0467] b. In one example, T1=3 and T2=3.

[0468] 12. During CCLM parameter derivation, the number of rows of upper luma neighboring samples to allocate may depend on a variable or syntax element indicating whether the chroma sample positions are not vertically shifted relative to the corresponding luma sample positions, such as sps_chroma_vertical_collocated_flag in JVET-Q2001-vE.

[0469] a. In one example, when sps_chroma_vertical_collocated_flag is equal to 1, three rows of upper adjacent luma samples are allocated. Otherwise, two rows of upper adjacent luma samples are allocated. An example is demonstrated in Example 7.

[0470] 13. In the above example, adjacent luminance samples may be adjacent luminance samples before downsampling or adjacent luminance samples after downsampling.

[0471] 14. In the CCLM parameter derivation process, whether and / or how to fill the upper left neighboring sample points may depend on the availability of at least one of the upper left neighboring sample points, rather than the availability of the left neighboring sample points and / or the upper neighboring sample points.

[0472] a. In one example, the availability of at least one of the upper left neighboring samples may depend on whether at least one of the upper left neighboring samples and the samples in the current block are in the same slice or in different slices.

[0473] i. In addition, the strips can be rectangular or non-rectangular.

[0474] b. In one example, if at least one of the upper left neighboring sample and the samples in the current block are in different slices, the upper left neighboring sample is padded.

[0475] c. In one example, if the availability of at least one upper left neighboring sample point is false, fill the upper left neighboring sample point.

[0476] 15. During CCLM parameter derivation, when the upper left adjacent luminance samples are “unavailable”, they may not be used.

[0477] a. In one example, a neighboring sample is "unavailable" if it is outside the current picture, or current sub-picture, or current slice, or current slice, or current tile, or current CTU, or current processing unit, or any other current video unit.

[0478] i. In one example, for Figure 13 For the non-rectangular stripe case shown, the upper left adjacent luma sample that is in a different stripe than the current block is "unavailable".

[0479] b. In one example, whether the top left neighboring luma samples are used in the CCLM process may depend on whether they are in the same picture / sub-picture / slice / slice / brick / CTU / processing unit / other video unit as the current block.

[0480] i. In one example, when the top left neighboring luma samples are in a different raster strip than the current block, they may not be used in the CCLM process.

[0481] 1) An example is demonstrated in Example 10.

[0482] ii. In one example, the top left neighboring luma samples may not be used in the CCLM process even though they are in the same picture / sub-picture / slice / slice / brick / CTU / processing unit / other video unit as the current block.

[0483] c. During CCLM parameter derivation, when the upper left adjacent luma sample is "unavailable", repeated padding can be used to generate the upper left adjacent luma sample. Let (x, y) denote the upper left sample position of the current block. Let pY[i][j] denote the reconstructed luma sample before the deblocking filter process. Let pD[m][n] denote the padded upper left luma sample, where m = x-1...xM, n = y-1...yN, where m and n are integers such as 1.

[0484] i. In one example, when left or / and top adjacent luma samples are available, a repeat padding method can be used.

[0485] ii. In one example, when the top-neighboring luma sample is available, the top-left-neighboring luma sample may be filled from the top-neighboring luma sample.

[0486] 2) In one example, pD[m][n]=pY[x][n].

[0487] iii. In one example, when the left adjacent luma samples are available, the top left adjacent luma samples may be filled from the left adjacent luma samples.

[0488] 3) In one example, pD[m][n]=pY[m][y].

[0489] iv. In one example, when the top-neighboring luma samples are available and the left-neighboring luma samples are available, the top-left-neighboring luma samples may be filled from the top-neighboring luma samples.

[0490] 4) In one example, pD[m][n]=pY[x][n].

[0491] v. Alternatively, when the top-neighboring luma samples are available and the left-neighboring luma samples are available, the top-left-neighboring luma samples may be filled from the left-neighboring luma samples.

[0492] 5) In one example, pD[m][n]=pY[m][y].

[0493] vi. In one example, M=2, N=2, or M=3, N=3.

[0494] d. Alternatively, when the top left adjacent luma samples are "unavailable", they can be replaced by predefined values.

[0495] i. In one example, the predetermined value may be equal to a constant value, such as 128.

[0496] ii. In one example, the predefined value may be derived using the left or / and top adjacent luma samples.

[0497] 6) In one example, the predefined value may be equal to the average value of the adjacent luminance samples on the left or / and top.

[0498] iii. In one example, the predefined value may depend on the bit depth of the sample. For example, the predefined value may be equal to 1<<(BD-1), where BD represents the bit depth of the sample.

[0499] e. Alternatively, even if the upper left adjacent luma sample is "available", the above filling method in bullet 14.c and the predefined value in bullet 14.d may be used to replace the available upper left adjacent luma sample.

[0500] i. An example is demonstrated in Example 11.

[0501] f. In one example, whether to check the availability of the top left neighboring luma sample may depend on whether the left neighboring luma sample is available or / and whether the top neighboring luma sample is available.

[0502] i. In one example, the availability of the top-left neighboring luma sample is checked only when both the left-neighboring luma sample and the top-neighboring luma sample are available. An example is shown in Embodiment 17.

[0503] g. In one example, whether and / or how to use or fill the top left neighboring luma samples may depend on the availability of the top left, or / and left, or / and top neighboring luma samples.

[0504] i. In one example, the top-left neighboring luma sample may be used only if the top-left neighboring luma sample is available.

[0505] ii. In one example, the top-left adjacent luma sample can be used only when the top-left, left, and top adjacent luma samples are available. An example is shown in Example 18.

[0506] iii. In one example, when left and / or top neighboring luma samples are available, the top left neighboring luma samples may be filled.

[0507] 1) In one example, the top-left neighboring luma sample may be filled only if the left or top neighboring luma sample is available and the top-left neighboring luma sample is not available.

[0508] 2) In one example, the top-left neighboring luma sample may be filled only if the left and top neighboring luma samples are available and the top-left neighboring luma sample is not available.

[0509] 3) In one example, the top adjacent luma sample can be used to fill the upper left adjacent luma sample. The upper left adjacent luma sample pY[x][y] where x=-1,-2, y=-1,-2 is set equal to the luma sample pY[0][y]. An example is shown in Example 18.

[0510] 4) In one example, the top adjacent luma sample can be used to fill the upper left adjacent luma sample. The upper left adjacent luma sample pY[x][y] where x=-1,-2, y=-1,-2 is set equal to the luma sample pY[x][0]. An example is shown in Example 19.

[0511] 5) In one example, the top left adjacent luma samples may be filled with the top and left adjacent luma samples.

[0512] h. In one example, whether to check the availability of the upper left neighboring luma sample, or / and use the upper left neighboring luma sample, or / and fill the upper left neighboring luma sample may depend on the chroma color format.

[0513] i. In one example, when using a 4:4:4 color format, there is no need to check the availability of the upper left adjacent luma sample, or / and use the upper left adjacent luma sample, or / and fill the upper left adjacent luma sample. An example is shown in Embodiment 20.

[0514] i. In one example, whether to fill the upper left adjacent luma sample and / or which samples need to be filled may depend on a variable or syntax element indicating whether the chroma sample position is not vertically shifted relative to the corresponding luma sample position, such as sps_chroma_vertical_collocated_flag in JVET-Q2001-vE.

[0515] i. In one example, when sps_chroma_vertical_collocated_flag is equal to 1, the upper left adjacent luma samples are filled. Otherwise, the upper left adjacent samples are not filled. An example is demonstrated in Example 14.

[0516] 16. In the CCLM process, when the top (or / and left) neighboring luma samples are not available, the top (or / and left) neighboring luma samples are derived using the topmost (or / and leftmost) sample of the current block. The top-left neighboring samples may be derived using the available left (or / and top) neighboring luma samples. a. In one example, when the top neighboring luma samples are not available, the topmost sample and the left neighboring luma samples of the current block may be used to derive the top and top-left neighboring luma samples.

[0517] i. In one example, the top adjacent luma sample pY[x][y] where x=0..SubWidthC×nTbW-1, y=-1..-2 is set equal to the luma sample pY[x][0]. And the top left adjacent luma sample pY[x][y] where x=-1, y=-1..-2 is set equal to the luma sample pY[x][0], where pY[0][0] represents the top left sample of the current block, nTbW represents the width of the current block, and SubWidthC is defined in 2.1.

[0518] ii. In one example, the top adjacent sample pY[x][y] where x=0..SubWidthC×nTbW-1, y=-1..-N is set equal to the luma sample pY[x][0]. And the top left adjacent luma sample pY[x][y] where x=-M..-1, y=-1..-N is set equal to the luma sample pY[x][0], where pY[0][0] represents the top left sample of the current block, nTbW represents the width of the current block, and SubWidthC is defined in 2.1. An example is demonstrated in Example 13.

[0519] 1) In one example, M and N are integers, such as M=2 and N=3.

[0520] 2) In one example, M may depend on the chroma color format, such as M=SubWidthC, which is defined in 2.1.

[0521] 3) In one example, a maximum of T top-left adjacent luma samples may be filled, where T is an integer (such as 1).

[0522] a) In one example, pY[-M][-1]=pY[-M][0], where M=1 or M=SubWidthC.

[0523] b. In one example, when the left-neighboring luma samples are not available, the leftmost sample and the top-neighboring luma samples of the current block may be used to derive the left and top-left-neighboring luma samples.

[0524] i. In one example, the left adjacent luma sample pY[x][y] where x=0..-3, y=-1..SubHeightC×nTbH-1 is set equal to the luma sample pY[0][y]. And the top left adjacent luma sample pY[x][y] where x=0..-3, y=-1 is set equal to the luma sample pY[0][y], where pY[0][0] represents the top left sample of the current block, nTbH represents the height of the current block, and SubHeightC is defined in 2.1.

[0525] ii. In one example, the left adjacent luma sample pY[x][y] where x=-1..-M, y=0..SubHeightC×nTbH-1 is set equal to the luma sample pY[0][y]. And the top left adjacent luma sample pY[x][y] where x=-1..-M, y=-1..-N is set equal to the luma sample pY[0][y], where pY[0][0] represents the top left sample of the current block, nTbH represents the height of the current block, and SubHeightC is defined in 2.1. An example is demonstrated in Example 15.

[0526] 1) In one example, M and N are integers, such as M=2, N=3.

[0527] 2) In one example, M may depend on the chroma color format, such as N=SubHeightC, which is defined in 2.1.

[0528] 3) In one example, a maximum of T top-left adjacent luma samples may be filled, where T is an integer (such as 1).

[0529] a) In one example, pY[-1][-N]=pY[0][-N], where N=1 or N=SubHeightC.

[0530] b) Alternatively, T is equal to 2. pY[-1][-1]=pY[0][-1], pY[-1][-2]=pY[0][-2].

[0531] iii. In one example, the upper left adjacent luma sample may be filled after the top adjacent luma sample is derived. An example is demonstrated in Example 16.

[0532] c. In one example, in the process of filling the top (or / and left) neighboring luma samples, the top left neighboring luma samples derived in item 13 may be used.

[0533] d. In one example, whether to fill the top (or / and left) adjacent luma (or chroma) samples and / or which adjacent samples need to be filled depends on the chroma color format.

[0534] i. In one example, when using a 4:4:4 color format, it is not necessary to fill the top (or / and left) adjacent luma samples. An example is shown in Example 21.

[0535] e. In one example, when filling the top (or / and left) adjacent luma samples, the top left adjacent luma samples are filled using the method in 15 (such as 15.c). An example is shown in Example 22.

[0536] 17. During CCLM prediction, the top adjacent samples, left adjacent samples, and upper left adjacent samples can be filled in a fixed order. The adjacent samples can be luminance samples or chrominance samples.

[0537] a. For example, the order may be top adjacent dot fill, left adjacent dot fill, and upper left adjacent dot fill.

[0538] b. For example, the order may be left adjacent fill, top adjacent sample point fill, and top left adjacent sample point fill.

[0539] c. For example, the order may be upper left adjacent fill, top adjacent sample point fill, and left adjacent sample point fill.

[0540] d. For example, the order may be top left adjacent fill, left adjacent sample point fill, and top adjacent sample point fill.

[0541] The downsampling process in CCLM for 18.4:2:2 color format video can be decoupled from a syntax element or variable (such as sps_chroma_vertical_collocated_flag in JVET-Q2001-vE) that indicates whether the chroma sample positions are vertically shifted relative to the corresponding luma sample positions.

[0542] a. In one example, the downsampling process may refer to downsampling the adjacent upper luma samples, or / and downsampling the adjacent left luma samples, or / and downsampling the samples in the current luma block.

[0543] b. In one example, regardless of whether sps_chroma_vertical_collocated_flag is equal to 1 or 0, a fixed filter (such as a 3-tap horizontal filter with coefficients [1 / 4, 2 / 4, 1 / 4] or [2 / 8, 4 / 8, 2 / 8]) can be used for the downsampling process in CCLM of 4:2:2 color format video. An example is shown in Examples 27 and 28.

[0544] 19. In one example, a variable or syntax element indicating whether the chroma sample positions are vertically shifted relative to the corresponding luma sample positions (e.g., sps_chroma_vertical_collocated_flag in JVET-Q2001-vE) may be set to a default value, such as 0 or 1 for 4:2:2 and / or 4:4:4:4 color formats.

[0545] a. In one example, when sps_chroma_vertical_collocated_flag is not present, it can be inferred to be equal to 1.

[0546] b. In one example, when sps_chroma_vertical_collocated_flag is not present, it can be inferred to be equal to 0.

[0547] 20. In the CCLM process, a variable representing an adjacent luminance sample can be used only when the variable is set to a valid value. An example is shown in Embodiment 29 and Embodiment 30.

[0548] a. In one example, the variable representing the adjacent above luma sample can be set equal to the reconstructed luma sample before the deblocking filtering process.

[0549] i. In one example, when the adjacent above luma sample is available (e.g., availT is equal to true in JVET-Q2001-vE), the variable representing the adjacent above luma sample denoted by pY[x][y] is set equal to the reconstructed luma sample before the deblocking filtering process at the position (xTbY+x, yTbY+y), where (xTbY, yTbY) represents the upper left position of the current block.

[0550] 1) In one example, x and y can be in the range of x=0...SubWidthC×max(numSampT, nTbW)-1, y=-1, -2, where nTbW represents the width of the current block, and SubWidthC is defined in 2.1, and numSampT indicates the number of adjacent chroma samples available in the top and upper right corners and is defined in JVET-Q2001-vE.

[0551] b. In one example, the variable representing the adjacent left luma sample can be set equal to the reconstructed luma sample before the deblocking filtering process.

[0552] i. In one example, when the adjacent left luma sample is available (e.g., availL is equal to true in JVET-Q2001-vE), the variable representing the adjacent left luma sample denoted by pY[x][y] is set equal to the reconstructed luma sample before the deblocking filtering process at the position (xTbY+x, yTbY+y), where (xTbY, yTbY) represents the upper left position of the current block.

[0553] 1) In one example, x and y can be in the range of x=-1..-3, y=0..SubHeightC×max(numSampL,nTbH)-1, where nTbH represents the width of the current block, and SubHeightC is defined in 2.1, and numSampL indicates the number of adjacent chroma samples available on the left and bottom left, and is defined in JVET-Q2001-vE.

[0554] 21. The slice type of a slice may depend on the reference picture entries of the slice.

[0555] a. In one example, if the number of reference picture entries of list 0 is equal to 0, and the number of reference picture entries of list 1 is equal to 0, then the slice type must be I slice.

[0556] i. In one example, the slice type is not signaled in this case.

[0557] b. In one example, if the number of reference picture entries of list 0 is greater than 0, and the number of reference picture entries of list 1 is equal to 0, then the slice type must be a P slice.

[0558] i. Alternatively, if the number of reference picture entries of list 0 is greater than 0, and the number of reference picture entries of list 1 is equal to 0, the slice type cannot be a B slice.

[0559] ii. In one example, the slice type is not signaled in this case.

[0560] c. The reference picture entries for a slice may be signaled or inferred before the slice type is signaled or inferred.

[0561] i. The reference picture entries for a slice may be signaled in the picture header associated with the picture.

[0562] 22. The total number of filters allowed in an APS or the total number of APSs may be limited according to coded information (such as the number of sub-pictures).

[0563] a. The total number of filters allowed in an APS may include the total number of ALFs in all APS NAL units with PUs, luma / chroma ALFs, and CC-ALFs in an APS.

[0564] b. The total number of filters allowed in an APS may include the total number of adaptive loop filter classes for luma components (or luma ALF filters), the total number of alternative filters for chroma components (chroma ALF filters), and / or the total number of cross-component filters in all APS NAL units with PUs.

[0565] c.APS is ALF APS / Scaled List APS / LMCS APS.

[0566] d. How to signal the APS ID, and / or the number of APSs to be used by the video unit depends on the number of restrictions.

[0567] 23. Conformant bitstreams shall follow the following rules: If BDPCM is enabled for a video unit (e.g., sequence / picture / slice / slice / brick / sub-picture), symbol data hiding shall be disabled.

[0568] a. Alternatively, the conforming bitstream should follow the following rule, if symbol data hiding is enabled for a video unit (e.g., sequence / picture / slice / slice / brick / sub-picture), then BDPCM is disabled.

[0569] 24. Conformant bitstreams shall follow the following rules: If transform skipping / codec tools that only apply signature transforms are enabled for a video unit (e.g., sequence / picture / slice / tile / sub-picture), symbol data hiding shall be disabled.

[0570] a. Alternatively, the conforming bitstream should follow the following rule, if symbol data hiding is enabled for a video unit (e.g. sequence / picture / slice / tile / sub-picture), then only transform skipping / codec tools that identify transforms are applied are disabled.

[0571] 25. Conformant bitstreams should follow the following rules: If BDPCM is enabled for a video unit (e.g., sequence / picture / slice / slice / brick / sub-picture), DQ (dependent quantization) is disabled.

[0572] a. Alternatively, the conforming bitstream should follow the following rule, if DQ is enabled for a video unit (e.g., sequence / picture / slice / slice / brick / sub-picture), then BDPCM is disabled.

[0573] 26. Conformant bitstreams shall follow the following rules: DQ (dependent quantization) shall be disabled if transform skip / codec tools that only apply the identified transform are enabled for a video unit (e.g., sequence / picture / slice / slice / brick / sub-picture).

[0574] a. Alternatively, conforming bitstreams should follow the following rule, if DQ is enabled for a video unit (e.g. sequence / picture / slice / tile / sub-picture), then only transform skipping of the identified transform is applied / codec tools are disabled.

[0575] 5. Examples

[0576] This section shows example embodiments and methods for modifying the current VVC standard to describe these embodiments. Changes to the VVC specification are highlighted in bold and italics. Deleted text is marked with double brackets (e.g., [[a]] indicates the deletion of the character "a").

[0577] Example 1

[0578] The working draft specified in JVET-P2001-v9 may be modified as follows.

[0579] 8.4.5.2.13 Specification of INTRA_LT_CCLM, INTRA_L_CCLM and INTRA_T_CCLM intra prediction modes

[0580] …

[0581] 3. The downsampled co-located luminance sample pDsY[x][y], where x = 0..nTbW-1 and y = 0..nTbH-1, is derived as follows:

[0582] If SubWidthC and SubHeightC are both equal to 1, then the following applies:

[0583] —pDsY[x][y], where x=1..nTbW-1, y=1..nTbH-1 is derived as follows:

[0584] pDstY[x][y]=pY[x][y] (8-159)

[0585] — Otherwise, the following applies:

[0586] —The one-dimensional filter coefficient arrays F1 and F2 and the two-dimensional filter coefficient arrays F3 and F4 are specified as follows.

[0587] F1[i]=1, where i=0..1 (8-160)

[0588] F2[0]=1,F2[1]=2,F2[2]=1 (8-161)

[0589] F3[i][j]=F4[i][j]=0, ​​where i=0..2, j=0..2 (8-162)

[0590] If SubWidthC and SubHeightC are both equal to 2, then the following applies:

[0591] F1[0]=1,F1[1]=1 (8-163)

[0592] F3[0][1]=1,F3[1][1]=4,F3[2][1]=1,F3[1][0]=1,F3[1][2]=1 (8-164)

[0593] F4[0][1]=1, F4[1][1]=2, F4[2][1]=1 (8-165)

[0594] F4[0][2]=1, F4[1][2]=2, F4[2][2]=1 (8-166)

[0595] — Otherwise, the following applies:

[0596] F1[0]=2,F1[1]=0 (8-167)

[0597] F3[1][1]=8 (8-168)

[0598] F4[0][1]=2, F4[1][1]=4, F4[2][1]=2, (8-169)

[0599] …

[0600] 5. When numSampT is greater than 0, the selected adjacent top chroma sample pSelC[idx] is set equal to p[pickPosT[idx-cntL]][-1], where idx=cntL..cntL+cntT-1, and the downsampled adjacent top luma sample pSelDsY[idx], where idx=0..cntL+cntT-1, is specified as follows:

[0601] …

[0602] Otherwise (sps_cclm_colocated_chroma_flag is equal to 0), the following applies:

[0603] — If x is greater than 0, the following applies:

[0604] If bCTUboundary is equal to FALSE, the following applies:

[0605] pSelDsY[idx]=(F4[0][1]×pY[SubWidthC×x-1][[[-2]]-1]+

[0606] F4[0][2]×pY[SubWidthC×x-1][[[-1]]-2]+

[0607] F4[1][1]×pY[SubWidthC×x][[[-2]]-1]+(8-193)

[0608] F4[1][2]×pY[SubWidthC×x][[[-1]]-2]+

[0609] F4[2][1]×pY[SubWidthC×x+1][[[-2]]-1]+

[0610] F4[2][2]×pY[SubWidthC×x+1][[[-1]]-2]+4)>>3

[0611] — Otherwise (bCTUboundary is TRUE), the following applies:

[0612] pSelDsY[idx]=(F2[0]×pY[SubWidthC×x-1][-1]+

[0613] F2[1]×pY[SubWidthC×x][-1]+(8-194)

[0614] F2[2]×pY[SubWidthC×x+1][-1]+2)>>2

[0615] — Otherwise (x is equal to 0), the following applies:

[0616] —If availTL is equal to TRUE and bCTUboundary is equal to FALSE, then the following applies:

[0617] pSelDsY[idx]=(F4[0][1]×pY[-1][[[-2]]-1]+F4[0][2]×pY[-1][[[-1] ]-2]+F4[1][1]×pY[0][[[-2]]-1]+F4[1][2]×pY[0][[[-1]]-2]+(8-195)

[0618] F4[2][1]×pY[1][[[-2]]-1]+F4[2][2]×pY[1][[[-1]]-2]+4)>>3

[0619] — Otherwise, if availTL is equal to TRUE and bCTUboundary is equal to TRUE, then the following applies:

[0620] pSelDsY[idx]=(F2[0]×pY[-1][-1]+F2[1]×pY[0][-1]+

[0621] F2[2]×pY[1][-1]+2)>>2 (8-196)

[0622] Otherwise, if availTL is equal to FALSE and bCTUboundary is equal to TRUE, then the following applies:

[0623] pSelDsY[idx]=(F1[1]×pY[0][-2]+F1[0]×pY[0][-1]+1)>>1

[0624] (8-197)

[0625] Otherwise (availTL equals FALSE and bCTUboundary equals TRUE), the following applies:

[0626] pSelDsY[idx]=pY[0][-1] (8-198)

[0627] …

[0628] 5.2. Example 2

[0629] This embodiment shows an example of encoding and decoding the chroma transform skip flag according to the maximum allowed transform skip encoding and decoding block size. The working draft specified in JVET-P2001-v9 can be modified as follows.

[0630] 7.3.9.10 Transformation unit syntax

[0631] …

[0632]

[0633]

[0634] …

[0635] 5.3. Example 3

[0636] This embodiment shows an example of encoding and decoding the chroma BDPCM flag according to the maximum allowed chroma transform skip codec block size. The working draft specified in JVET-P2001-v9 may be modified as follows.

[0637] 7.3.9.5 Codec unit syntax

[0638] …

[0639]

[0640]

[0641] …

[0642] 5.4. Example 4

[0643] The working draft specified in JVET-Q2001-vE may be modified as follows. 8.4.5.2.13

[0645] The inputs to this process are:

[0646] —Intra prediction mode predModeIntra,

[0647] - the sample position of the upper left sample of the current transform block relative to the upper left sample of the current picture (xTbC, yTbC),

[0648] - variable nTbW specifying the transform block width,

[0649] — variable nTbH specifying the transform block height,

[0650] — variable cIdx specifying the color component of the current block,

[0651] - Chroma neighboring samples p[x][y], where x = -1, y = 0..2×nTbH-1, and x = 0..2×nTbW-1, y = -1.

[0652] The output of this process is the predicted samples predSamples[x][y], where x = 0..nTbW-1, y = 0..nTbH-1.

[0653] The current brightness position (xTbY, yTbY) is derived as follows:

[0654] (xTbY, yTbY) = (xTbC<<(SubWidthC-1), yTbC<<(SubHeightC-1)) (351)

[0656] The variables availL, availT, and availTL are derived as follows:

[0657] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using as input the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY-1, yTbY), checkPredModeY set equal to false (FLASE), and cIdx, and assign the output to availL.

[0658] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY, yTbY-1), checkPredModeY set equal to false (FLASE), and cIdx as input, and assign the output to availT.

[0659] —The variable availTL is derived as follows:

[0660] availTL=availL&&availT (352)

[0661] The number of available top-right adjacent chroma samples numTopRight is derived as follows:

[0662] —The variable numTopRight is set to 0, and availTR is set to true (TRUE).

[0663] - When predModeIntra is equal to INTRA_T_CCLM, the following applies for x=nTbW..2×nTbW-1 until availTR is equal to FALSE or x is equal to 2×nTbW-1:

[0664] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using as input the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY+x, yTbY-1), checkPredModeY set equal to false (FLASE), and cIdx, and assign the output to availTR.

[0665] —When availTR is equal to true (TRUE), numTopRight is increased by 1.

[0666] The number of available lower left adjacent chroma samples numLeftBelow is derived as follows:

[0667] —The variable numLeftBelow is set to 0, and availLB is set to true (TRUE).

[0668] When predModeIntra is equal to INTRA_L_CCLM, the following applies for y=nTbH..2×nTbH-1 until availLB is equal to FALSE or y is equal to 2×nTbH-1:

[0669] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY-1, yTbY+y), checkPredModeY set equal to false (FLASE), and cIdx as input, and assign the output to availLB.

[0670] —When availLB is equal to TRUE, numLeftBelow is increased by 1.

[0671] The number of available adjacent chroma samples numSampT at the top and upper right and the number of available adjacent chroma samples numSampL at the left and lower left are derived as follows:

[0672] If predModeIntra is equal to INTRA_LT_CCLM, the following applies:

[0673] numSampT=availT? nTbW:0 (353)

[0674] numSampL=availL? nTbH:0 (354)

[0675] — Otherwise, the following applies:

[0676] numSampT=(availT&&predModeIntra==INTRA_T_CCLM)? (nTbW+Min(numTopRight,nTbH)):0 (355)

[0677] numSampL=(availL&&predModeIntra==INTRA_L_CCLM)? (nTbH+Min(numLeftBelow,nTbW)):0 (356)

[0678] The variable bCTUboundary is derived as follows:

[0679] bCTUboundary=(yTbY&(CtbSizeY-1)==0)? TRUE:FALSE (357)

[0681] The variable cntN and array pickPosN, where N is replaced by L and T, are derived as follows:

[0682] —The variable numIs4N is derived as follows:

[0683] numIs4N=((availT&&availL&&predModeIntra==INTRA_LT_CCLM)?0:1) (358)

[0684] —The variable startPosN is set equal to numSampN>>(2+numIs4N).

[0685] - The variable pickStepN is set equal to Max(1, numSampN>>(1+numIs4N)).

[0686] —If availN is equal to TRUE and predModeIntra is equal to INTRA_LT_CCLM or INTRA_N_CCLM, then the following assignments are made:

[0687] —cntN is set equal to Min(numSampN, (1+numIs4N)<<1).

[0688] - pickPosN[pos] is set equal to (startPosN+pos×pickStepN), where pos=0..cntN-1.

[0689] Otherwise, cntN is set equal to 0.

[0690] The predicted sample point predSample[x][y], where x = 0..nTbW-1 and y = 0..nTbH-1, is derived as follows:

[0691] — If numSampL and numSampT are both equal to 0, then the following applies:

[0692] predSamples[x][y]=1<<(BitDepth-1) (359)

[0693] — Otherwise, the following ordered steps apply:

[0694] 1. The co-located luma sample pY[x][y] where x=0..nTbW×SubWidthC-1, y=0..TbH×SubHeightC-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).

[0695] 2. The adjacent brightness samples pY[x][y] are derived as follows:

[0696] —When numSampL is greater than 0, the adjacent left luma sample pY[x][y] where x=-1..-3, y=0..SubHeightC×numSampL-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).

[0697] - When availT is equal to FALSE, the adjacent top luma sample pY[x][y] where x = -1..SubWidthC×numSampT-1, y = -1..-2 is set equal to luma sample pY[x][0].

[0698] - When availL is equal to FALSE, the adjacent left luma sample pY[x][y] where x = -1..-3, y = -1..SubHeightC×numSampL-1 is set equal to the luma sample pY[0][y].

[0699] When numSampT is greater than 0, the adjacent top luma sample pY[x][y] where x=0..SubWidthC×numSampT-1, y=-1..-2 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).

[0700] —When availTL is equal to true (TRUE), the adjacent upper left luma sample pY[x][y] where x=-1, y=-1, -2 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).

[0701] 3. The downsampled co-located luminance sample pDsY[x][y], x=0..nTbW-1, y=0..nTbH-1 is derived as follows:

[0702] If SubWidthC and SubHeightC are both equal to 1, then the following applies:

[0703] —pDsY[x][y], where x=1..nTbW-1, y=1..nTbH-1 is derived as follows:

[0704] pDstY[x][y]=pY[x][y] (360)

[0705] — Otherwise, the following applies:

[0706] —The one-dimensional filter coefficient arrays F1 and F2 and the two-dimensional filter coefficient arrays F3 and F4 are specified as follows.

[0707] F1[0]=2,F1[1]=0 (361)

[0708] F2[0]=1,F2[1]=2,F2[2]=1 (362)

[0709] F3[i][j]=F4[i][j]=0, ​​where i=0..2, j=0..2 (363)

[0710] If SubWidthC and SubHeightC are both equal to 2, then the following applies:

[0711] F1[0]=1,F1[1]=1 (364)

[0712] F3[0][1]=1,F3[1][1]=4,F3[2][1]=1,F3[1][0]=1,

[0713] F3[1][2]=1 (365)

[0714] F4[0][1]=1,F4[1][1]=2,F4[2][1]=1 (366)

[0715] F4[0][2]=1,F4[1][2]=2,F4[2][2]=1 (367)

[0716] — Otherwise, the following applies:

[0717] F3[1][1]=8 (368)

[0718] F4[0][1]=2, F4[1][1]=4, F4[2][1]=2, (369)

[0719] - If sps_chroma_vertical_collocated_flag is equal to 1, the following applies:

[0720] —pDsY[x][y], where x=0..nTbW-1, y=0..nTbH-1 is derived as follows:

[0721] pDsY[x][y]=(F3[1][0]×pY[SubWidthC×x][SubHeightC×y-1]+

[0722] F3[0][1]×pY[SubWidthC×x-1][SubHeightC×y]+

[0723] F3[1][1]×pY[SubWidthC×x][SubHeightC×y]+(370)

[0724] F3[2][1]×pY[SubWidthC×x+1][SubHeightC×y]+

[0725] F3[1][2]×pY[SubWidthC×x][SubHeightC×y+1]+4)>>3

[0726] Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies:

[0727] —pDsY[x][y], where x=0..nTbW-1, y=0..nTbH-1 is derived as follows:

[0728] pDsY[x][y]=(F4[0][1]×pY[SubWidthC×x-1][SubHeightC×y]+

[0729] F4[0][2]×pY[SubWidthC×x-1][SubHeightC×y+1]+

[0730] F4[1][1]×pY[SubWidthC×x][SubHeightC×y]+(371)

[0731] F4[1][2]×pY[SubWidthC×x][SubHeightC×y+1]+

[0732] F4[2][1]×pY[SubWidthC×x+1][SubHeightC×y]+

[0733] F4[2][2]×pY[SubWidthC×x+1][SubHeightC×y+1]+4)>>3

[0734] [[4. When numSampL is greater than 0, the selected adjacent left chroma sample pSelC[idx] is set equal to p[-1][pickPosL[idx]], where idx = 0..cntL-1, and the selected downsampled adjacent left luma sample pSelDsY[idx], where idx = 0..cntL-1 is derived as follows:

[0735] —The variable y is set equal to pickPosL[idx].

[0736] If SubWidthC and SubHeightC are both equal to 1, then the following applies:

[0737] pSelDsY[idx]=pY[-1][y] (372)

[0738] — Otherwise, the following applies:

[0739] - If sps_chroma_vertical_collocated_flag is equal to 1, the following applies:

[0740] pSelDsY[idx]=(F3[1][0]×pY[-SubWidthC][SubHeightC×y-1]+

[0741] F3[0][1]×pY[-1-SubWidthC][SubHeightC×y]+

[0742] F3[1][1]×pY[-SubWidthC][SubHeightC×y]+(373)

[0743] F3[2][1]×pY[1-SubWidthC][SubHeightC×y]+

[0744] F3[1][2]×pY[-SubWidthC][SubHeightC×y+1]+4)>>3

[0745] Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies:

[0746] pSelDsY[idx]=(F4[0][1]×pY[-1-SubWidthC][SubHeightC×y]+

[0747] F4[0][2]×pY[-1-SubWidthC][SubHeightC×y+1]+

[0748] F4[1][1]×pY[-SubWidthC][SubHeightC×y]+(374)

[0749] F4[1][2]×pY[-SubWidthC][SubHeightC×y+1]+

[0750] F4[2][1]×pY[1-SubWidthC][SubHeightC×y]+

[0751] F4[2][2]×pY[1-SubWidthC][SubHeightC×y+1]+4)>>3

[0752] 5. When numSampT is greater than 0, the selected adjacent top chroma sample pSelC[idx] is set equal to p[pickPosT[idx-cntL]][-1], where idx=cntL..cntL+cntT-1, and the downsampled adjacent top luma sample pSelDsY[idx], where idx=0..cntL+cntT-1 is specified as follows:

[0753] —The variable x is set equal to pickPosT[idx-cntL].

[0754] If SubWidthC and SubHeightC are both equal to 1, then the following applies:

[0755] pSelDsY[idx]=pY[x][-1] (375)

[0756] — Otherwise, the following applies:

[0757] - If sps_chroma_vertical_collocated_flag is equal to 1, the following applies:

[0758] If bCTUboundary is equal to FALSE, the following applies:

[0759] pSelDsY[idx]=(F3[1][0]×pY[SubWidthC×x][-1-SubHeightC]+

[0760] F3[0][1]×pY[SubWidthC×x-1][-SubHeightC]+

[0761] F3[1][1]×pY[SubWidthC×x][-SubHeightC]+(376)

[0762] F3[2][1]×pY[SubWidthC×x+1][-SubHeightC]+

[0763] F3[1][2]×pY[SubWidthC×x][1-SubHeightC]+4)>>3

[0764] — Otherwise (bCTUboundary is TRUE), the following applies:

[0765] pSelDsY[idx]=(F2[0]×pY[SubWidthC×x-1][-1]+

[0766] F2[1]×pY[SubWidthC×x][-1]+(377)

[0767] F2[2]×pY[SubWidthC×x+1][-1]+2)>>2

[0768] Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies:

[0769] If bCTUboundary is equal to FALSE, the following applies:

[0770] pSelDsY[idx]=(F4[0][1]×pY[SubWidthC x-1][-1]+

[0771] F4[0][2]×pY[SubWidthC×x-1][-2]+

[0772] F4[1][1]×pY[SubWidthC×x][-1]+(378)

[0773] F4[1][2]×pY[SubWidthC×x][-2]+

[0774] F4[2][1]×pY[SubWidthC×x+1][-1]+

[0775] F4[2][2]×pY[SubWidthC×x+1][-2]+4)>>3

[0776] — Otherwise (bCTUboundary is TRUE), the following applies:

[0777] pSelDsY[idx]=(F2[0]×pY[SubWidthC×x-1][-1]+

[0778] F2[1]×pY[SubWidthC×x][-1]+(379)

[0779] F2[2]×pY[SubWidthC×x+1][-1]+2)>>2]]

[0780] 4. When numSampT is greater than 0, the selected adjacent top chroma sample pSelC[idx] is set equal to p[pickPosT[idx]][-1], where idx = 0..cntT-1, and the downsampled adjacent top luma sample pSelDsY[idx], where idx = 0..cntT-1 is specified as follows:

[0781] —The variable x is set equal to pickPosT[idx].

[0782] If SubWidthC and SubHeightC are both equal to 1, then the following applies:

[0783] pSelDsY[idx]=pY[x][-1] (375)

[0784] — Otherwise, the following applies:

[0785] - If sps_chroma_vertical_collocated_flag is equal to 1, the following applies:

[0786] If bCTUboundary is equal to FALSE, the following applies:

[0787] pSelDsY[idx]=(F3[1][0]×pY[SubWidthC×x][-1-SubHeightC]+

[0788] F3[0][1]×pY[SubWidthC×x-1][-SubHeightC]+

[0789] F3[1][1]×pY[SubWidthC×x][-SubHeightC]+(376)

[0790] F3[2][1]×pY[SubWidthC×x+1][-SubHeightC]+

[0791] F3[1][2]×pY[SubWidthC×x][1-SubHeightC]+4)>>3

[0792] — Otherwise (bCTUboundary is TRUE), the following applies:

[0793] pSelDsY[idx]=(F2[0]×pY[SubWidthC×x-1][-1]+

[0794] F2[1]×pY[SubWidthC×x][-1]+(377)

[0795] F2[2]×pY[SubWidthC×x+1][-1]+2)>>2

[0796] Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies:

[0797] If bCTUboundary is equal to FALSE, the following applies:

[0798] pSelDsY[idx]=(F4[0][1]×pY[SubWidthC x-1][-1]+

[0799] F4[0][2]×pY[SubWidthC×x-1][-2]+

[0800] F4[1][1]×pY[SubWidthC×x][-1]+(378)

[0801] F4[1][2]×pY[SubWidthC×x][-2]+

[0802] F4[2][1]×pY[SubWidthC×x+1][-1]+

[0803] F4[2][2]×pY[SubWidthC×x+1][-2]+4)>>3

[0804] — Otherwise (bCTUboundary is TRUE), the following applies:

[0805] pSelDsY[idx]=(F2[0]×pY[SubWidthC×x-1][-1]+

[0806] F2[1]×pY[SubWidthC×x][-1]+(379)

[0807] F2[2]×pY[SubWidthC×x+1][-1]+2)>>2

[0808] 5. When numSampL is greater than 0, the selected adjacent left chroma sample pSelC[idx] is set equal to p[-1][pickPosL[idx-cntT]], where idx=cntT..cntT+cntL-1, and the selected downsampled adjacent left luma sample pSelDsY[idx], idx=cntT..cntT+cntL-1, which is derived as follows:

[0809] —The variable y is set equal to pickPosL[idx-cntT].

[0810] If SubWidthC and SubHeightC are both equal to 1, then the following applies:

[0811] pSelDsY[idx]=pY[-1][y] (372)

[0812] — Otherwise, the following applies:

[0813] If sps_chroma_vertical_collocated_flag is equal to 1, the following applies: pSelDsY[idx] = (F3[1][0] x pY[-SubWidthC][SubHeightC x y-1] +

[0814] F3[0][1]×pY[-1-SubWidthC][SubHeightC×y]+

[0815] F3[1][1]×pY[-SubWidthC][SubHeightC×y]+(373)

[0816] F3[2][1]×pY[1-SubWidthC][SubHeightC×y]+

[0817] F3[1][2]×pY[-SubWidthC][SubHeightC×y+1]+4)>>3

[0818] Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies:

[0819] pSelDsY[idx]=(F4[0][1]×pY[-1-SubWidthC][SubHeightC×y]+

[0820] F4[0][2]×pY[-1-SubWidthC][SubHeightC×y+1]+

[0821] F4[1][1]×pY[-SubWidthC][SubHeightC×y]+(374)

[0822] F4[1][2]×pY[-SubWidthC][SubHeightC×y+1]+

[0823] F4[2][1]×pY[1-SubWidthC][SubHeightC×y]+

[0824] F4[2][2]×pY[1-SubWidthC][SubHeightC×y+1]+4)>>3

[0825] 6. When cntT+cntL is not equal to 0, the variables minY, maxY, minC, and maxC are derived as follows:

[0826] —When cntT+cntL is equal to 2, pSelComp[3] is set equal to pSelComp[0], pSelComp[2] is set equal to pSelComp[1], pSelComp[0] is set equal to pSelComp[1], pSelComp[1] is set equal to pSelComp[3], and Comp is replaced by DsY and C.

[0827] —The arrays minGrpIdx and maxGrpIdx are derived as follows:

[0828] minGrpIdx[0]=0 (380)

[0829] minGrpIdx[1]=2 (381)

[0830] maxGrpIdx[0]=1 (382)

[0831] maxGrpIdx[1]=3 (383)

[0832] —When pSelDsY[minGrpIdx[0]] is greater than pSelDsY[minGrpIdx[1]], minGrpIdx[0] and minGrpIdx[1] are swapped as follows:

[0833] (minGrpIdx[0], minGrpIdx[1])=Swap(minGrpIdx[0], minGrpIdx[1]) (384)

[0835] —When pSelDsY[maxGrpIdx[0]] is greater than pSelDsY[maxGrpIdx[1]], maxGrpIdx[0] and maxGrpIdx[1] are swapped as follows:

[0836] (maxGrpIdx[0], maxGrpIdx[1])=Swap(maxGrpIdx[0], maxGrpIdx[1]) (385)

[0838] —When pSelDsY[minGrpIdx[0]] is greater than pSelDsY[maxGrpIdx[1]], the arrays minGrpIdx and maxGrpIdx are swapped as follows:

[0839] (minGrpIdx, maxGrpIdx) = Swap (minGrpIdx, maxGrpIdx) (386)

[0840] —When pSelDsY[minGrpIdx[1]] is greater than pSelDsY[maxGrpIdx[0]], minGrpIdx[1] and maxGrpIdx[0] are swapped as follows:

[0841] (minGrpIdx[1], maxGrpIdx[0])=Swap(minGrpIdx[1], maxGrpIdx[0]) (387)

[0843] —The variables maxY, maxC, minY, and minC are derived as follows:

[0844] maxY=(pSelDsY[maxGrpIdx[0]]+pSelDsY[maxGrpIdx[1]]+1)>>1 (388)

[0846] maxC=(pSelC[maxGrpIdx[0]]+pSelC[maxGrpIdx[1]]+1)>>1 (389)

[0848] minY=(pSelDsY[minGrpIdx[0]]+pSelDsY[minGrpIdx[1]]+1)>>1 (390)

[0850] minC=(pSelC[minGrpIdx[0]]+pSelC[minGrpIdx[1]]+1)>>1 (391)

[0851] 7. The variables a, b, and k are derived as follows:

[0852] — If numSampL is equal to 0 and numSampT is equal to 0, then the following applies:

[0853] k=0 (392)

[0854] a=0 (393)

[0855] b=1<<(BitDepth-1) (394)

[0856] — Otherwise, the following applies:

[0857] diff=maxY-minY (395)

[0858] — If diff is not equal to 0, the following applies:

[0859] diffC=maxC-minC (396)

[0860] x=Floor(Log2(diff)) (397)

[0861] normDiff=((diff<<4)>>x)&15 (398)

[0862] x+=(normDiff!=0)? 1:0 (399)

[0863] y=Abs(diffC)>0? Floor(Log2(Abs(diffC)))+1:0 (400)

[0864] a=(diffC×(divSigTable[normDiff]|8)+2 y - 1 )>>y (401)

[0865] k=((3+xy)<1)? 1:3+xy (402)

[0866] a=((3+xy)<1)? Sign(a)×15:a (403)

[0867] b=minC-((a×minY)>>k) (404)

[0868] where divSigTable[] is specified as follows:

[0869] divSigTable[]={0, 7, 6, 5, 5, 4, 4, 3, 3, 2, 2, 1, 1, 1, 1, 0} (405)

[0871] — Otherwise (diff is equal to 0), the following applies:

[0872] k=0 (406)

[0873] a=0 (407)

[0874] b=minC (408)

[0875] 8. The predicted sample point predSample[x][y], where x = 0..nTbW-1 and y = 0..nTbH-1, is derived as follows:

[0876] predSamples[x][y]=Clip1(((pDsY[x][y]×a)>>k)+b) (409)

[0877] NOTE - This process uses sps_chroma_vertical_collocated_flag. However, to simplify the implementation, it does not use sps_chroma_horizontal_collocated_flag.

[0878] 5.5. Example 5

[0879] The working draft specified in JVET-Q2001-vE may be modified as follows. 8.4.5.2.13

[0881] The inputs to this process are:

[0882] —Intra prediction mode predModeIntra,

[0883] - the sample position of the upper left sample of the current transform block relative to the upper left sample of the current picture (xTbC, yTbC),

[0884] - variable nTbW specifying the transform block width,

[0885] — variable nTbH specifying the transform block height,

[0886] — variable cIdx specifying the color component of the current block,

[0887] - Chroma adjacent samples p[x][y], where x = -1, y = 0..2×nTbH-1, x = 0..2×nTbW-1, y = -1.

[0888] The output of this process is the predicted samples predSamples[x][y], where x = 0..nTbW-1, y = 0..nTbH-1.

[0889] The current brightness position (xTbY, yTbY) is derived as follows:

[0890] (xTbY, yTbY) = (xTbC<<(SubWidthC-1), yTbC<<(SubHeightC-1)) (351)

[0892] The variables availL, availT, and availTL are derived as follows:

[0893] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using as input the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY-1, yTbY), checkPredModeY set equal to false (FLASE), and cIdx, and assign the output to availL.

[0894] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY, yTbY-1), checkPredModeY set equal to false (FLASE), and cIdx as input, and assign the output to availT.

[0895] —The variable availTL is derived as follows:

[0896] availTL=availL&&availT (352)

[0897] The number of available top-right adjacent chroma samples numTopRight is derived as follows:

[0898] —The variable numTopRight is set to 0, and availTR is set to true (TRUE).

[0899] - When predModeIntra is equal to INTRA_T_CCLM, the following applies for x=nTbW..2×nTbW-1 until availTR is equal to FALSE or x is equal to 2×nTbW-1:

[0900] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using as input the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY+x, yTbY-1), checkPredModeY set equal to false (FLASE), and cIdx, and assign the output to availTR.

[0901] —When availTR is equal to true (TRUE), numTopRight is increased by 1.

[0902] The number of available lower left adjacent chroma samples numLeftBelow is derived as follows:

[0903] —The variable numLeftBelow is set to 0, and availLB is set to true (TRUE).

[0904] When predModeIntra is equal to INTRA_L_CCLM, the following applies for y=nTbH..2×nTbH-1 until availLB is equal to FALSE or y is equal to 2×nTbH-1:

[0905] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY-1, yTbY+y), checkPredModeY set equal to false (FLASE), and cIdx as input, and assign the output to availLB.

[0906] —When availLB is equal to TRUE, numLeftBelow is increased by 1.

[0907] The number of available adjacent chroma samples numSampT at the top and upper right and the number of available adjacent chroma samples numSampL at the left and lower left are derived as follows:

[0908] If predModeIntra is equal to INTRA_LT_CCLM, the following applies:

[0909] numSampT=availT? nTbW:0 (353)

[0910] numSampL=availL? nTbH:0 (354)

[0911] — Otherwise, the following applies:

[0912] numSampT=(availT&&predModeIntra==INTRA_T_CCLM)? (nTbW+Min(numTopRight,nTbH)):0 (355)

[0913] numSampL=(availL&&predModeIntra==INTRA_L_CCLM)? (nTbH+Min(numLeftBelow,nTbW)):0 (356)

[0914] The variable bCTUboundary is derived as follows:

[0915] bCTUboundary=(yTbY&(CtbSizeY-1)==0)? TRUE:FALSE (357)

[0916] The variable cntN and array pickPosN, where N is replaced by L and T, are derived as follows:

[0917] —The variable numIs4N is derived as follows:

[0918] numIs4N=((availT&&availL&&predModeIntra==INTRA_LT_CCLM)?0:1)(358)

[0919] —The variable startPosN is set equal to numSampN>>(2+numIs4N).

[0920] - The variable pickStepN is set equal to Max(1, numSampN>>(1+numIs4N)).

[0921] —If availN is equal to TRUE and predModeIntra is equal to INTRA_LT_CCLM or INTRA_N_CCLM, then the following assignments are made:

[0922] —cntN is set equal to Min(numSampN, (1+numIs4N)<<1).

[0923] - pickPosN[pos] is set equal to (startPosN+pos×pickStepN), where pos=0..cntN-1.

[0924] Otherwise, cntN is set equal to 0.

[0925] The predicted sample point predSample[x][y], where x = 0..nTbW-1 and y = 0..nTbH-1, is derived as follows:

[0926] — If numSampL and numSampT are both equal to 0, then the following applies:

[0927] predSamples[x][y]=1<<(BitDepth-1) (359)

[0928] — Otherwise, the following ordered steps apply:

[0929] 1. The co-located luma sample pY[x][y] where x=0..nTbW×SubWidthC-1, y=0..TbH×SubHeightC-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).

[0930] 2. The adjacent brightness samples pY[x][y] are derived as follows:

[0931] —When numSampL is greater than 0, the adjacent left luma sample pY[x][y] where x=-1..-3, y=0..SubHeightC×numSampL-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).

[0932] - When availT is equal to FALSE, the adjacent top luma sample pY[x][y] where x = -1..SubWidthC×numSampT-1, y = -1..-2 is set equal to luma sample pY[x][0].

[0933] - When availL is equal to FALSE, the adjacent left luma sample pY[x][y] where x = -1..-3, y = -1..SubHeightC×numSampL-1 is set equal to the luma sample pY[0][y].

[0934] When numSampT is greater than 0, the adjacent top luma sample pY[x][y] where x=0..SubWidthC×numSampT-1, y=-1..-2 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).

[0935] —When availTL is equal to true (TRUE), the adjacent upper left luma sample pY[x][y] where x=-1, y=-1, -2 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).

[0936] 3. The downsampled co-located luminance sample pDsY[x][y], where x = 0..nTbW-1 and y = 0..nTbH-1, is derived as follows:

[0937] If SubWidthC and SubHeightC are both equal to 1, then the following applies:

[0938] —pDsY[x][y], where x=1..nTbW-1, y=1..nTbH-1 is derived as follows:

[0939] pDstY[x][y]=pY[x][y] (360)

[0940] — Otherwise, the following applies:

[0941] —The one-dimensional filter coefficient arrays F1 and F2 and the two-dimensional filter coefficient arrays F3 and F4 are specified as follows.

[0942] F1[0]=2,F1[1]=0 (361)

[0943] F2[0]=1,F2[1]=2,F2[2]=1 (362)

[0944] F3[i][j]=F4[i][j]=0, ​​where i=0..2, j=0..2 (363)

[0945] If SubWidthC and SubHeightC are both equal to 2, then the following applies:

[0946] F1[0]=1,F1[1]=1 (364)

[0947] F3[0][1]=1,F3[1][1]=4,F3[2][1]=1,F3[1][0]=1,

[0948] F3[1][2]=1 (365)

[0949] F4[0][1]=1,F4[1][1]=2,F4[2][1]=1 (366)

[0950] F4[0][2]=1,F4[1][2]=2,F4[2][2]=1 (367)

[0951] — Otherwise, the following applies:

[0952] F3[1][1]=8 (368)

[0953] F4[0][1]=2, F4[1][1]=4, F4[2][1]=2, (369)

[0954] - If sps_chroma_vertical_collocated_flag is equal to 1, the following applies:

[0955] —pDsY[x][y], where x=0..nTbW-1, y=0..nTbH-1 is derived as follows:

[0956] pDsY[x][y]=(F3[1][0]×pY[SubWidthC×x][SubHeightC×y-1]+

[0957] F3[0][1]×pY[SubWidthC×x-1][SubHeightC×y]+

[0958] F3[1][1]×pY[SubWidthC×x][SubHeightC×y]+(370)

[0959] F3[2][1]×pY[SubWidthC×x+1][SubHeightC×y]+

[0960] F3[1][2]×pY[SubWidthC×x][SubHeightC×y+1]+4)>>3

[0961] Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies:

[0962] —pDsY[x][y], where x=0..nTbW-1, y=0..nTbH-1 is derived as follows:

[0963] pDsY[x][y]=(F4[0][1]×pY[SubWidthC×x-1][SubHeightC×y]+

[0964] F4[0][2]×pY[SubWidthC×x-1][SubHeightC×y+1]+

[0965] F4[1][1]×pY[SubWidthC×x][SubHeightC×y]+(371)

[0966] F4[1][2]×pY[SubWidthC×x][SubHeightC×y+1]+

[0967] F4[2][1]×pY[SubWidthC×x+1][SubHeightC×y]+

[0968] F4[2][2]×pY[SubWidthC×x+1][SubHeightC×y+1]+4)>>3

[0969] 4. When numSampL is greater than 0, the selected adjacent left chroma sample pSelC[idx] is set equal to p[-1][pickPosL[idx]], where idx = 0..cntL-1, and the selected downsampled adjacent left luma sample pSelDsY[idx], where idx = 0..cntL-1, is derived as follows:

[0970] —The variable y is set equal to pickPosL[idx].

[0971] If SubWidthC and SubHeightC are both equal to 1, then the following applies:

[0972] pSelDsY[idx]=pY[-1][y] (372)

[0973] — Otherwise, the following applies:

[0974] - If sps_chroma_vertical_collocated_flag is equal to 1, the following applies:

[0975] pSelDsY[idx]=(F3[1][0]×pY[-SubWidthC][SubHeightC×y-1]+

[0976] F3[0][1]×pY[-1-SubWidthC][SubHeightC×y]+

[0977] F3[1][1]×pY[-SubWidthC][SubHeightC×y]+(373)

[0978] F3[2][1]×pY[1-SubWidthC][SubHeightC×y]+

[0979] F3[1][2]×pY[-SubWidthC][SubHeightC×y+1]+4)>>3

[0980] Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies:

[0981] pSelDsY[idx]=(F4[0][1]×pY[-1-SubWidthC][SubHeightC×y]+

[0982] F4[0][2]×pY[-1-SubWidthC][SubHeightC×y+1]+

[0983] F4[1][1]×pY[-SubWidthC][SubHeightC×y]+(374)

[0984] F4[1][2]×pY[-SubWidthC][SubHeightC×y+1]+

[0985] F4[2][1]×pY[1-SubWidthC][SubHeightC×y]+

[0986] F4[2][2]×pY[1-SubWidthC][SubHeightC×y+1]+4)>>3

[0987] 5. When numSampT is greater than 0, the selected adjacent top chroma sample pSelC[idx] is set equal to p[pickPosT[idx-cntL]][-1], where idx=cntL..cntL+cntT-1, and the downsampled adjacent top luma sample pSelDsY[idx], where idx=[[0]]cntL..cntL+cntT-1 is specified as follows:

[0988] —The variable x is set equal to pickPosT[idx-cntL].

[0989] If SubWidthC and SubHeightC are both equal to 1, then the following applies:

[0990] pSelDsY[idx]=pY[x][-1] (375)

[0991] — Otherwise, the following applies:

[0992] - If sps_chroma_vertical_collocated_flag is equal to 1, the following applies:

[0993] If bCTUboundary is equal to FALSE, the following applies:

[0994] pSelDsY[idx]=(F3[1][0]×pY[SubWidthC×x][-1-SubHeightC]+

[0995] F3[0][1]×pY[SubWidthC×x-1][-SubHeightC]+

[0996] F3[1][1]×pY[SubWidthC×x][-SubHeightC]+(376)

[0997] F3[2][1]×pY[SubWidthC×x+1][-SubHeightC]+

[0998] F3[1][2]×pY[SubWidthC×x][1-SubHeightC]+4)>>3

[0999] — Otherwise (bCTUboundary is TRUE), the following applies:

[1000] pSelDsY[idx]=(F2[0]×pY[SubWidthC×x-1][-1]+

[1001] F2[1]×pY[SubWidthC×x][-1]+(377)

[1002] F2[2]×pY[SubWidthC×x+1][-1]+2)>>2

[1003] Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies:

[1004] If bCTUboundary is equal to FALSE, the following applies:

[1005] pSelDsY[idx]=(F4[0][1]×pY[SubWidthC x-1][-1]+

[1006] F4[0][2]×pY[SubWidthC×x-1][-2]+

[1007] F4[1][1]×pY[SubWidthC×x][-1]+(378)

[1008] F4[1][2]×pY[SubWidthC×x][-2]+

[1009] F4[2][1]×pY[SubWidthC×x+1][-1]+

[1010] F4[2][2]×pY[SubWidthC×x+1][-2]+4)>>3

[1011] — Otherwise (bCTUboundary is TRUE), the following applies:

[1012] pSelDsY[idx]=(F2[0]×pY[SubWidthC×x-1][-1]+

[1013] F2[1]×pY[SubWidthC×x][-1]+(379)

[1014] F2[2]×pY[SubWidthC×x+1][-1]+2)>>2

[1015] 6. When cntT+cntL is not equal to 0, the variables minY, maxY, minC, and maxC are derived as follows:

[1016] —When cntT+cntL is equal to 2, pSelComp[3] is set equal to pSelComp[0], pSelComp[2] is set equal to pSelComp[1], pSelComp[0] is set equal to pSelComp[1], pSelComp[1] is set equal to pSelComp[3], and Comp is replaced by DsY and C.

[1017] —The arrays minGrpIdx and maxGrpIdx are derived as follows:

[1018] minGrpIdx[0]=0 (380)

[1019] minGrpIdx[1]=2 (381)

[1020] maxGrpIdx[0]=1 (382)

[1021] maxGrpIdx[1]=3 (383)

[1022] —When pSelDsY[minGrpIdx[0]] is greater than pSelDsY[minGrpIdx[1]], minGrpIdx[0] and minGrpIdx[1] are swapped as follows:

[1023] (minGrpIdx[0], minGrpIdx[1])=Swap(minGrpIdx[0], minGrpIdx[1]) (384)

[1025] —When pSelDsY[maxGrpIdx[0]] is greater than pSelDsY[maxGrpIdx[1]], maxGrpIdx[0] and maxGrpIdx[1] are swapped as follows:

[1026] (maxGrpIdx[0], maxGrpIdx[1])=Swap(maxGrpIdx[0], maxGrpIdx[1]) (385)

[1028] —When pSelDsY[minGrpIdx[0]] is greater than pSelDsY[maxGrpIdx[1]], the arrays minGrpIdx and maxGrpIdx are swapped as follows:

[1029] (minGrpIdx, maxGrpIdx) = Swap (minGrpIdx, maxGrpIdx) (386)

[1030] —When pSelDsY[minGrpIdx[1]] is greater than pSelDsY[maxGrpIdx[0]], minGrpIdx[1] and maxGrpIdx[0] are swapped as follows:

[1031] (minGrpIdx[1], maxGrpIdx[0])=Swap(minGrpIdx[1], maxGrpIdx[0]) (387)

[1033] —The variables maxY, maxC, minY, and minC are derived as follows:

[1034] maxY=(pSelDsY[maxGrpIdx[0]]+pSelDsY[maxGrpIdx[1]]+1)>>1 (388)

[1036] maxC=(pSelC[maxGrpIdx[0]]+pSelC[maxGrpIdx[1]]+1)>>1 (389)

[1038] minY=(pSelDsY[minGrpIdx[0]]+pSelDsY[minGrpIdx[1]]+1)>>1 (390)

[1040] minC=(pSelC[minGrpIdx[0]]+pSelC[minGrpIdx[1]]+1)>>1 (391)

[1041] 7. The variables a, b, and k are derived as follows:

[1042] — If numSampL is equal to 0 and numSampT is equal to 0, then the following applies:

[1043] k=0 (392)

[1044] a=0 (393)

[1045] b=1<<(BitDepth-1) (394)

[1046] — Otherwise, the following applies:

[1047] diff=maxY-minY (395)

[1048] — If diff is not equal to 0, the following applies:

[1049] diffC=maxC-minC (396)

[1050] x=Floor(Log2(diff)) (397)

[1051] normDiff=((diff<<4)>>x)&15 (398)

[1052] x+=(normDiff!=0)? 1:0 (399)

[1053] y=Abs(diffC)>0? Floor(Log2(Abs(diffC)))+1:0 (400)

[1054] a=(diffC×(divSigTable[normDiff]|8)+2 y - 1 )>>y (401)

[1055] k=((3+xy)<1)? 1:3+xy (402)

[1056] a=((3+xy)<1)? Sign(a)×15:a (403)

[1057] b=minC-((a×minY)>>k) (404)

[1058] where divSigTable[] is specified as follows:

[1059] divSigTable[]={0, 7, 6, 5, 5, 4, 4, 3, 3, 2, 2, 1, 1, 1, 1, 0} (405)

[1061] — Otherwise (diff is equal to 0), the following applies:

[1062] k=0 (406)

[1063] a=0 (407)

[1064] b=minC (408)

[1065] 8. The predicted sample point predSample[x][y], where x = 0..nTbW-1 and y = 0..nTbH-1, is derived as follows:

[1066] predSamples[x][y]=Clip1(((pDsY[x][y]×a)>>k)+b) (409)

[1067] NOTE - This process uses sps_chroma_vertical_collocated_flag. However, to simplify the implementation, it does not use sps_chroma_horizontal_collocated_flag.

[1068] 5.6. Example 6

[1069] The working draft specified in JVET-Q2001-vE may be modified as follows. 8.4.5.2.13

[1071] The inputs to this process are:

[1072] —Intra prediction mode predModeIntra,

[1073] - the sample position of the upper left sample of the current transform block relative to the upper left sample of the current picture (xTbC, yTbC),

[1074] - variable nTbW specifying the transform block width,

[1075] — variable nTbH specifying the transform block height,

[1076] — variable cIdx specifying the color component of the current block,

[1077] - Chroma adjacent samples p[x][y], where x = -1, y = 0..2×nTbH-1, x = 0..2×nTbW-1, y = -1.

[1078] The output of this process is the predicted samples predSamples[x][y], where x = 0..nTbW-1, y = 0..nTbH-1.

[1079] The current brightness position (xTbY, yTbY) is derived as follows:

[1080] (xTbY, yTbY) = (xTbC<<(SubWidthC-1), yTbC<<(SubHeightC-1)) (351)

[1082] The variables availL, availT, and availTL are derived as follows:

[1083] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using as input the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY-1, yTbY), checkPredModeY set equal to false (FLASE), and cIdx, and assign the output to availL.

[1084] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY, yTbY-1), checkPredModeY set equal to false (FLASE), and cIdx as input, and assign the output to availT.

[1085] —The variable availTL is derived as follows:

[1086] availTL=availL&&availT (352)

[1087] The number of available top-right adjacent chroma samples numTopRight is derived as follows:

[1088] —The variable numTopRight is set to 0, and availTR is set to true (TRUE).

[1089] - When predModeIntra is equal to INTRA_T_CCLM, the following applies for x=nTbW..2×nTbW-1 until availTR is equal to FALSE or x is equal to 2×nTbW-1:

[1090] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using as input the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY+x, yTbY-1), checkPredModeY set equal to false (FLASE), and cIdx, and assign the output to availTR.

[1091] —When availTR is equal to true (TRUE), numTopRight is increased by 1.

[1092] The number of available lower left adjacent chroma samples numLeftBelow is derived as follows:

[1093] —The variable numLeftBelow is set to 0, and availLB is set to true (TRUE).

[1094] - When predModeIntra is equal to INTRA_L_CCLM, the following applies for y=nTbH..2×nTbH-1 until availLB is equal to FALSE or y is equal to 2×nTbH-1:

[1095] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY-1, yTbY+y), checkPredModeY set equal to false (FLASE), and cIdx as input, and assign the output to availLB.

[1096] —When availLB is equal to TRUE, numLeftBelow is increased by 1.

[1097] The number of available adjacent chroma samples numSampT at the top and upper right and the number of available adjacent chroma samples numSampL at the left and lower left are derived as follows:

[1098] If predModeIntra is equal to INTRA_LT_CCLM, the following applies:

[1099] numSampT=availT? nTbW:0 (353)

[1100] numSampL=availL? nTbH:0 (354)

[1101] — Otherwise, the following applies:

[1102] numSampT=(availT&&predModeIntra==INTRA_T_CCLM)?

[1103] (nTbW+Min(numTopRight,nTbH)):0 (355)

[1104] numSampL=(availL&&predModeIntra==INTRA_L_CCLM)? (nTbH+Min(numLeftBelow,nTbW)):0 (356)

[1105] The variable bCTUboundary is derived as follows:

[1106] bCTUboundary=(yTbY&(CtbSizeY-1)==0)? TRUE:FALSE (357)

[1107] The variable cntN and array pickPosN, where N is replaced by L and T, are derived as follows:

[1108] —The variable numIs4N is derived as follows:

[1109] numIs4N=((availT&&availL&&predModeIntra==INTRA_LT_CCLM)?0:1)(358)

[1110] —The variable startPosN is set equal to numSampN>>(2+numIs4N).

[1111] - The variable pickStepN is set equal to Max(1, numSampN>>(1+numIs4N)).

[1112] —If availN is equal to TRUE and predModeIntra is equal to INTRA_LT_CCLM or INTRA_N_CCLM, then the following assignments are made:

[1113] —cntN is set equal to Min(numSampN, (1+numIs4N)<<1).

[1114] - pickPosN[pos] is set equal to (startPosN+pos×pickStepN), where pos=0..cntN-1.

[1115] Otherwise, cntN is set equal to 0.

[1116] The predicted sample point predSample[x][y], where x = 0..nTbW-1 and y = 0..nTbH-1, is derived as follows:

[1117] — If numSampL and numSampT are both equal to 0, then the following applies:

[1118] predSamples[x][y]=1<<(BitDepth-1) (359)

[1119] — Otherwise, the following ordered steps apply:

[1120] 1. The co-located luma sample pY[x][y] where x=0..nTbW×SubWidthC-1, y=0..TbH×SubHeightC-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).

[1121] 2. The adjacent brightness samples pY[x][y] are derived as follows:

[1122] —When numSampL is greater than 0, the adjacent left luma sample pY[x][y] where x=-1..-3, y=0..SubHeightC×numSampL-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).

[1123] - When availT is equal to FALSE, the adjacent top luma sample pY[x][y] where x = -1..SubWidthC×numSampT-1, y = -1..-2 is set equal to luma sample pY[x][0].

[1124] - When availL is equal to FALSE, the adjacent left luma sample pY[x][y] where x = -1..-3, y = -1..SubHeightC×numSampL-1 is set equal to the luma sample pY[0][y].

[1125] —When numSampT is greater than 0, the adjacent top luma sample pY[x][y] where x=0..SubWidthC×numSampT-1, y=-1..-[[2]]3 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).

[1126] —When availTL is equal to true (TRUE), the adjacent upper left luma sample pY[x][y] where x=-1, y=-1, -2, -3 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).

[1127] 3. The downsampled co-located luminance sample pDsY[x][y], where x = 0..nTbW-1 and y = 0..nTbH-1, is derived as follows:

[1128] If SubWidthC and SubHeightC are both equal to 1, then the following applies:

[1129] —pDsY[x][y], where x=1..nTbW-1, y=1..nTbH-1 is derived as follows:

[1130] pDstY[x][y]=pY[x][y] (360)

[1131] — Otherwise, the following applies:

[1132] —The one-dimensional filter coefficient arrays F1 and F2 and the two-dimensional filter coefficient arrays F3 and F4 are specified as follows.

[1133] F1[0]=2,F1[1]=0 (361)

[1134] F2[0]=1,F2[1]=2,F2[2]=1 (362)

[1135] F3[i][j]=F4[i][j]=0, ​​where i=0..2, j=0..2 (363)

[1136] If SubWidthC and SubHeightC are both equal to 2, then the following applies:

[1137] F1[0]=1,F1[1]=1 (364)

[1138] F3[0][1]=1,F3[1][1]=4,F3[2][1]=1,F3[1][0]=1,F3[1][2]=1 (365)

[1139] F4[0][1]=1,F4[1][1]=2,F4[2][1]=1 (366)

[1140] F4[0][2]=1,F4[1][2]=2,F4[2][2]=1 (367)

[1141] — Otherwise, the following applies:

[1142] F3[1][1]=8 (368)

[1143] F4[0][1]=2, F4[1][1]=4, F4[2][1]=2, (369)

[1144] - If sps_chroma_vertical_collocated_flag is equal to 1, the following applies:

[1145] —pDsY[x][y], where x=0..nTbW-1, y=0..nTbH-1 is derived as follows:

[1146] pDsY[x][y]=(F3[1][0]×pY[SubWidthC×x][SubHeightC×y-1]+

[1147] F3[0][1]×pY[SubWidthC×x-1][SubHeightC×y]+

[1148] F3[1][1]×pY[SubWidthC×x][SubHeightC×y]+(370)

[1149] F3[2][1]×pY[SubWidthC×x+1][SubHeightC×y]+

[1150] F3[1][2]×pY[SubWidthC×x][SubHeightC×y+1]+4)>>3

[1151] Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies:

[1152] —pDsY[x][y], where x=0..nTbW-1, y=0..nTbH-1 is derived as follows:

[1153] pDsY[x][y]=(F4[0][1]×pY[SubWidthC×x-1][SubHeightC×y]+

[1154] F4[0][2]×pY[SubWidthC×x-1][SubHeightC×y+1]+

[1155] F4[1][1]×pY[SubWidthC×x][SubHeightC×y]+(371)

[1156] F4[1][2]×pY[SubWidthC×x][SubHeightC×y+1]+

[1157] F4[2][1]×pY[SubWidthC×x+1][SubHeightC×y]+

[1158] F4[2][2]×pY[SubWidthC×x+1][SubHeightC×y+1]+4)>>3

[1159] 4. When numSampL is greater than 0, the selected adjacent left chroma sample pSelC[idx] is set equal to p[-1][pickPosL[idx]], where idx = 0..cntL-1, and the selected downsampled adjacent left luma sample pSelDsY[idx], where idx = 0..cntL-1, is derived as follows:

[1160] —The variable y is set equal to pickPosL[idx].

[1161] If SubWidthC and SubHeightC are both equal to 1, then the following applies:

[1162] pSelDsY[idx]=pY[-1][y] (372)

[1163] — Otherwise, the following applies:

[1164] - If sps_chroma_vertical_collocated_flag is equal to 1, the following applies:

[1165] pSelDsY[idx]=(F3[1][0]×pY[-SubWidthC][SubHeightC×y-1]+

[1166] F3[0][1]×pY[-1-SubWidthC][SubHeightC×y]+

[1167] F3[1][1]×pY[-SubWidthC][SubHeightC×y]+(373)

[1168] F3[2][1]×pY[1-SubWidthC][SubHeightC×y]+

[1169] F3[1][2]×pY[-SubWidthC][SubHeightC×y+1]+4)>>3

[1170] Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies:

[1171] pSelDsY[idx]=(F4[0][1]×pY[-1-SubWidthC][SubHeightC×y]+

[1172] F4[0][2]×pY[-1-SubWidthC][SubHeightC×y+1]+

[1173] F4[1][1]×pY[-SubWidthC][SubHeightC×y]+(374)

[1174] F4[1][2]×pY[-SubWidthC][SubHeightC×y+1]+

[1175] F4[2][1]×pY[1-SubWidthC][SubHeightC×y]+

[1176] F4[2][2]×pY[1-SubWidthC][SubHeightC×y+1]+4)>>3

[1177] 5. When numSampT is greater than 0, the selected adjacent top chroma sample pSelC[idx] is set equal to p[pickPosT[idx-cntL]][-1], where idx=cntL..cntL+cntT-1, and the downsampled adjacent top luma sample pSelDsY[idx], where idx=0..cntL+cntT-1 is specified as follows:

[1178] —The variable x is set equal to pickPosT[idx-cntL].

[1179] If SubWidthC and SubHeightC are both equal to 1, then the following applies:

[1180] pSelDsY[idx]=pY[x][-1] (375)

[1181] — Otherwise, the following applies:

[1182] - If sps_chroma_vertical_collocated_flag is equal to 1, the following applies:

[1183] If bCTUboundary is equal to FALSE, the following applies:

[1184] pSelDsY[idx]=(F3[1][0]×pY[SubWidthC×x][-1-SubHeightC]+

[1185] F3[0][1]×pY[SubWidthC×x-1][-SubHeightC]+

[1186] F3[1][1]×pY[SubWidthC×x][-SubHeightC]+(376)

[1187] F3[2][1]×pY[SubWidthC×x+1][-SubHeightC]+

[1188] F3[1][2]×pY[SubWidthC×x][1-SubHeightC]+4)>>3

[1189] — Otherwise (bCTUboundary is TRUE), the following applies:

[1190] pSelDsY[idx]=(F2[0]×pY[SubWidthC×x-1][-1]+

[1191] F2[1]×pY[SubWidthC×x][-1]+(377)

[1192] F2[2]×pY[SubWidthC×x+1][-1]+2)>>2

[1193] Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies:

[1194] If bCTUboundary is equal to FALSE, the following applies:

[1195] pSelDsY[idx]=(F4[0][1]×pY[SubWidthC x-1][-1]+

[1196] F4[0][2]×pY[SubWidthC×x-1][-2]+

[1197] F4[1][1]×pY[SubWidthC×x][-1]+(378)

[1198] F4[1][2]×pY[SubWidthC×x][-2]+

[1199] F4[2][1]×pY[SubWidthC×x+1][-1]+

[1200] F4[2][2]×pY[SubWidthC×x+1][-2]+4)>>3

[1201] — Otherwise (bCTUboundary is TRUE), the following applies:

[1202] pSelDsY[idx]=(F2[0]×pY[SubWidthC×x-1][-1]+

[1203] F2[1]×pY[SubWidthC×x][-1]+(379)

[1204] F2[2]×pY[SubWidthC×x+1][-1]+2)>>2

[1205] 6. When cntT+cntL is not equal to 0, the variables minY, maxY, minC, and maxC are derived as follows:

[1206] —When cntT+cntL is equal to 2, pSelComp[3] is set equal to pSelComp[0], pSelComp[2] is set equal to pSelComp[1], pSelComp[0] is set equal to pSelComp[1], pSelComp[1] is set equal to pSelComp[3], and Comp is replaced by DsY and C.

[1207] —The arrays minGrpIdx and maxGrpIdx are derived as follows:

[1208] minGrpIdx[0]=0 (380)

[1209] minGrpIdx[1]=2 (381)

[1210] maxGrpIdx[0]=1 (382)

[1211] maxGrpIdx[1]=3 (383)

[1212] —When pSelDsY[minGrpIdx[0]] is greater than pSelDsY[minGrpIdx[1]], minGrpIdx[0] and minGrpIdx[1] are swapped as follows:

[1213] (minGrpIdx[0], minGrpIdx[1])=Swap(minGrpIdx[0], minGrpIdx[1]) (384)

[1215] —When pSelDsY[maxGrpIdx[0]] is greater than pSelDsY[maxGrpIdx[1]], maxGrpIdx[0] and maxGrpIdx[1] are swapped as follows:

[1216] (maxGrpIdx[0], maxGrpIdx[1])=Swap(maxGrpIdx[0], maxGrpIdx[1]) (385)

[1218] —When pSelDsY[minGrpIdx[0]] is greater than pSelDsY[maxGrpIdx[1]], the arrays minGrpIdx and maxGrpIdx are swapped as follows:

[1219] (minGrpIdx, maxGrpIdx) = Swap (minGrpIdx, maxGrpIdx) (386)

[1220] —When pSelDsY[minGrpIdx[1]] is greater than pSelDsY[maxGrpIdx[0]], minGrpIdx[1] and maxGrpIdx[0] are swapped as follows:

[1221] (minGrpIdx[1], maxGrpIdx[0])=Swap(minGrpIdx[1], maxGrpIdx[0]) (387)

[1223] —The variables maxY, maxC, minY, and minC are derived as follows:

[1224] maxY=(pSelDsY[maxGrpIdx[0]]+pSelDsY[maxGrpIdx[1]]+1)>>1 (388)

[1226] maxC=(pSelC[maxGrpIdx[0]]+pSelC[maxGrpIdx[1]]+1)>>1 (389)

[1228] minY=(pSelDsY[minGrpIdx[0]]+pSelDsY[minGrpIdx[1]]+1)>>1 (390)

[1230] minC=(pSelC[minGrpIdx[0]]+pSelC[minGrpIdx[1]]+1)>>1 (391)

[1231] 7. The variables a, b, and k are derived as follows:

[1232] — If numSampL is equal to 0 and numSampT is equal to 0, then the following applies:

[1233] k=0 (392)

[1234] a=0 (393)

[1235] b=1<<(BitDepth-1) (394)

[1236] — Otherwise, the following applies:

[1237] diff=maxY-minY (395)

[1238] — If diff is not equal to 0, the following applies:

[1239] diffC=maxC-minC (396)

[1240] x=Floor(Log2(diff)) (397)

[1241] normDiff=((diff<<4)>>x)&15 (398)

[1242] x+=(normDiff!=0)? 1:0 (399)

[1243] y=Abs(diffC)>0? Floor(Log2(Abs(diffC)))+1:0 (400)

[1244] a=(diffC×(divSigTable[normDiff]|8)+2 y - 1 )>>y (401)

[1245] k=((3+xy)<1)? 1:3+xy (402)

[1246] a=((3+xy)<1)? Sign(a)×15:a (403)

[1247] b=minC-((a×minY)>>k) (404)

[1248] where divSigTable[] is specified as follows:

[1249] divSigTable[]={0, 7, 6, 5, 5, 4, 4, 3, 3, 2, 2, 1, 1, 1, 1, 0} (405)

[1251] — Otherwise (diff is equal to 0), the following applies:

[1252] k=0 (406)

[1253] a=0 (407)

[1254] b=minC (408)

[1255] 8. The predicted sample point predSample[x][y], where x = 0..nTbW-1 and y = 0..nTbH-1, is derived as follows:

[1256] predSamples[x][y]=Clip1(((pDsY[x][y]×a)>>k)+b) (409)

[1257] NOTE - This process uses sps_chroma_vertical_collocated_flag. However, to simplify the implementation, it does not use sps_chroma_horizontal_collocated_flag.

[1258] 5.7. Example 7

[1259] The working draft specified in JVET-Q2001-vE may be modified as follows. 8.4.5.2.13

[1261] The inputs to this process are:

[1262] —Intra prediction mode predModeIntra,

[1263] - the sample position of the upper left sample of the current transform block relative to the upper left sample of the current picture (xTbC, yTbC),

[1264] - variable nTbW specifying the transform block width,

[1265] — variable nTbH specifying the transform block height,

[1266] — variable cIdx specifying the color component of the current block,

[1267] - Chroma neighboring samples p[x][y], where x=-1, y=0..2×nTbH-1 and x=0..2×nTbW-1, y=-1.

[1268] The output of this process is the predicted samples predSamples[x][y], where x = 0..nTbW-1, y = 0..nTbH-1.

[1269] The current brightness position (xTbY, yTbY) is derived as follows:

[1270] (xTbY, yTbY) = (xTbC<<(SubWidthC-1), yTbC<<(SubHeightC-1)) (351)

[1272] The variables availL, availT, and availTL are derived as follows:

[1273] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using as input the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY-1, yTbY), checkPredModeY set equal to false (FLASE), and cIdx, and assign the output to availL.

[1274] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY, yTbY-1), checkPredModeY set equal to false (FLASE), and cIdx as input, and assign the output to availT.

[1275] —The variable availTL is derived as follows:

[1276] availTL=availL&&availT (352)

[1277] The number of available top-right adjacent chroma samples numTopRight is derived as follows:

[1278] —The variable numTopRight is set to 0, and availTR is set to true (TRUE).

[1279] - When predModeIntra is equal to INTRA_T_CCLM, the following applies for x=nTbW..2×nTbW-1 until availTR is equal to FALSE or x is equal to 2×nTbW-1:

[1280] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using as input the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY+x, yTbY-1), checkPredModeY set equal to false (FLASE), and cIdx, and assign the output to availTR.

[1281] —When availTR is equal to true (TRUE), numTopRight is increased by 1.

[1282] The number of available lower left adjacent chroma samples numLeftBelow is derived as follows:

[1283] —The variable numLeftBelow is set to 0, and availLB is set to true (TRUE).

[1284] When predModeIntra is equal to INTRA_L_CCLM, the following applies for y=nTbH..2×nTbH-1 until availLB is equal to FALSE or y is equal to 2×nTbH-1:

[1285] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY-1, yTbY+y), checkPredModeY set equal to false (FLASE), and cIdx as input, and assign the output to availLB.

[1286] —When availLB is equal to TRUE, numLeftBelow is increased by 1.

[1287] The number of available adjacent chroma samples numSampT at the top and upper right and the number of available adjacent chroma samples numSampL at the left and lower left are derived as follows:

[1288] If predModeIntra is equal to INTRA_LT_CCLM, the following applies:

[1289] numSampT=availT? nTbW:0 (353)

[1290] numSampL=availL? nTbH:0 (354)

[1291] — Otherwise, the following applies:

[1292] numSampT=(availT&&predModeIntra==INTRA_T_CCLM)? (nTbW+Min(numTopRight,nTbH)):0 (355)

[1293] numSampL=(availL&&predModeIntra==INTRA_L_CCLM)? (nTbH+Min(numLeftBelow,nTbW)):0 (356)

[1294] The variable bCTUboundary is derived as follows:

[1295] bCTUboundary=(yTbY&(CtbSizeY-1)==0)? TRUE:FALSE (357)

[1296] The variable cntN and array pickPosN, where N is replaced by L and T, are derived as follows:

[1297] —The variable numIs4N is derived as follows:

[1298] numIs4N=((availT&&availL&&predModeIntra==INTRA_LT_CCLM)?0:1)(358)

[1299] —The variable startPosN is set equal to numSampN>>(2+numIs4N).

[1300] - The variable pickStepN is set equal to Max(1, numSampN>>(1+numIs4N)).

[1301] —If availN is equal to TRUE and predModeIntra is equal to INTRA_LT_CCLM or INTRA_N_CCLM, then the following assignments are made:

[1302] —cntN is set equal to Min(numSampN, (1+numIs4N)<<1).

[1303] - pickPosN[pos] is set equal to (startPosN+pos×pickStepN), where pos=0..cntN-1.

[1304] Otherwise, cntN is set equal to 0.

[1305] The predicted sample point predSample[x][y], where x = 0..nTbW-1 and y = 0..nTbH-1, is derived as follows:

[1306] — If numSampL and numSampT are both equal to 0, then the following applies:

[1307] predSamples[x][y]=1<<(BitDepth-1) (359)

[1308] — Otherwise, the following ordered steps apply:

[1309] 1. The co-located luma sample pY[x][y] where x=0..nTbW×SubWidthC-1, y=0..TbH×SubHeightC-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).

[1310] 2. The adjacent brightness samples pY[x][y] are derived as follows:

[1311] —When numSampL is greater than 0, the adjacent left luma sample pY[x][y] where x=-1..-3, y=0..SubHeightC×numSampL-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).

[1312] - When availT is equal to FALSE, the neighboring top luma sample pY[x][y] where x = -1..SubWidthC×numSampT-1, y = -1..[[-2]]-(2+sps_chroma_vertical_collocated_flag) is set equal to luma sample pY[x][0].

[1313] - When availL is equal to FALSE, the adjacent left luma sample pY[x][y] where x = -1..-3, y = -1..SubHeightC×numSampL-1 is set equal to the luma sample pY[0][y].

[1314] —When numSampT is greater than 0, the neighboring top luma sample pY[x][y] where x=0..SubWidthC×numSampT-1, y=-1..-(2+sps_chroma_vertical_collocated_flag)[[-2]] is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).

[1315] —When availTL is equal to true (TRUE), the adjacent upper left luma sample pY[x][y] where x=-1, y=-1, -2 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).

[1316] 3. The downsampled co-located luminance sample pDsY[x][y], where x = 0..nTbW-1 and y = 0..nTbH-1, is derived as follows:

[1317] If SubWidthC and SubHeightC are both equal to 1, then the following applies:

[1318] —pDsY[x][y], where x=1..nTbW-1, y=1..nTbH-1 is derived as follows:

[1319] pDstY[x][y]=pY[x][y] (360)

[1320] — Otherwise, the following applies:

[1321] —The one-dimensional filter coefficient arrays F1 and F2 and the two-dimensional filter coefficient arrays F3 and F4 are specified as follows.

[1322] F1[0]=2,F1[1]=0 (361)

[1323] F2[0]=1,F2[1]=2,F2[2]=1 (362)

[1324] F3[i][j]=F4[i][j]=0, ​​where i=0..2, j=0..2 (363)

[1325] If SubWidthC and SubHeightC are both equal to 2, then the following applies:

[1326] F1[0]=1,F1[1]=1 (364)

[1327] F3[0][1]=1,F3[1][1]=4,F3[2][1]=1,F3[1][0]=1,

[1328] F3[1][2]=1 (365)

[1329] F4[0][1]=1,F4[1][1]=2,F4[2][1]=1 (366)

[1330] F4[0][2]=1,F4[1][2]=2,F4[2][2]=1 (367)

[1331] — Otherwise, the following applies:

[1332] F3[1][1]=8 (368)

[1333] F4[0][1]=2, F4[1][1]=4, F4[2][1]=2, (369)

[1334] - If sps_chroma_vertical_collocated_flag is equal to 1, the following applies:

[1335] —pDsY[x][y], where x=0..nTbW-1, y=0..nTbH-1 is derived as follows:

[1336] pDsY[x][y]=(F3[1][0]×pY[SubWidthC×x][SubHeightC×y-1]+

[1337] F3[0][1]×pY[SubWidthC×x-1][SubHeightC×y]+

[1338] F3[1][1]×pY[SubWidthC×x][SubHeightC×y]+(370)

[1339] F3[2][1]×pY[SubWidthC×x+1][SubHeightC×y]+

[1340] F3[1][2]×pY[SubWidthC×x][SubHeightC×y+1]+4)>>3

[1341] Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies:

[1342] —pDsY[x][y], where x=0..nTbW-1, y=0..nTbH-1 is derived as follows:

[1343] pDsY[x][y]=(F4[0][1]×pY[SubWidthC×x-1][SubHeightC×y]+

[1344] F4[0][2]×pY[SubWidthC×x-1][SubHeightC×y+1]+

[1345] F4[1][1]×pY[SubWidthC×x][SubHeightC×y]+(371)

[1346] F4[1][2]×pY[SubWidthC×x][SubHeightC×y+1]+

[1347] F4[2][1]×pY[SubWidthC×x+1][SubHeightC×y]+

[1348] F4[2][2]×pY[SubWidthC×x+1][SubHeightC×y+1]+4)>>3

[1349] 4. When numSampL is greater than 0, the selected adjacent left chroma sample pSelC[idx] is set equal to p[-1][pickPosL[idx]], where idx = 0..cntL-1, and the selected downsampled adjacent left luma sample pSelDsY[idx], where idx = 0..cntL-1, is derived as follows:

[1350] —The variable y is set equal to pickPosL[idx].

[1351] If SubWidthC and SubHeightC are both equal to 1, then the following applies:

[1352] pSelDsY[idx]=pY[-1][y] (372)

[1353] — Otherwise, the following applies:

[1354] - If sps_chroma_vertical_collocated_flag is equal to 1, the following applies:

[1355] pSelDsY[idx]=(F3[1][0]×pY[-SubWidthC][SubHeightC×y-1]+

[1356] F3[0][1]×pY[-1-SubWidthC][SubHeightC×y]+

[1357] F3[1][1]×pY[-SubWidthC][SubHeightC×y]+(373)

[1358] F3[2][1]×pY[1-SubWidthC][SubHeightC×y]+

[1359] F3[1][2]×pY[-SubWidthC][SubHeightC×y+1]+4)>>3

[1360] Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies:

[1361] pSelDsY[idx]=(F4[0][1]×pY[-1-SubWidthC][SubHeightC×y]+

[1362] F4[0][2]×pY[-1-SubWidthC][SubHeightC×y+1]+

[1363] F4[1][1]×pY[-SubWidthC][SubHeightC×y]+(374)

[1364] F4[1][2]×pY[-SubWidthC][SubHeightC×y+1]+

[1365] F4[2][1]×pY[1-SubWidthC][SubHeightC×y]+

[1366] F4[2][2]×pY[1-SubWidthC][SubHeightC×y+1]+4)>>3

[1367] 5. When numSampT is greater than 0, the selected adjacent top chroma sample pSelC[idx] is set equal to p[pickPosT[idx-cntL]][-1], where idx=cntL..cntL+cntT-1, and the downsampled adjacent top luma sample pSelDsY[idx], where idx=0..cntL+cntT-1 is specified as follows:

[1368] —The variable x is set equal to pickPosT[idx-cntL].

[1369] If SubWidthC and SubHeightC are both equal to 1, then the following applies:

[1370] pSelDsY[idx]=pY[x][-1] (375)

[1371] — Otherwise, the following applies:

[1372] - If sps_chroma_vertical_collocated_flag is equal to 1, the following applies:

[1373] If bCTUboundary is equal to FALSE, the following applies:

[1374] pSelDsY[idx]=(F3[1][0]×pY[SubWidthC×x][-1-SubHeightC]+

[1375] F3[0][1]×pY[SubWidthC×x-1][-SubHeightC]+

[1376] F3[1][1]×pY[SubWidthC×x][-SubHeightC]+(376)

[1377] F3[2][1]×pY[SubWidthC×x+1][-SubHeightC]+

[1378] F3[1][2]×pY[SubWidthC×x][1-SubHeightC]+4)>>3

[1379] — Otherwise (bCTUboundary is TRUE), the following applies:

[1380] pSelDsY[idx]=(F2[0]×pY[SubWidthC×x-1][-1]+

[1381] F2[1]×pY[SubWidthC×x][-1]+(377)

[1382] F2[2]×pY[SubWidthC×x+1][-1]+2)>>2

[1383] Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies:

[1384] If bCTUboundary is equal to FALSE, the following applies:

[1385] pSelDsY[idx]=(F4[0][1]×pY[SubWidthC x-1][-1]+

[1386] F4[0][2]×pY[SubWidthC×x-1][-2]+

[1387] F4[1][1]×pY[SubWidthC×x][-1]+(378)

[1388] F4[1][2]×pY[SubWidthC×x][-2]+

[1389] F4[2][1]×pY[SubWidthC×x+1][-1]+

[1390] F4[2][2]×pY[SubWidthC×x+1][-2]+4)>>3

[1391] — Otherwise (bCTUboundary is TRUE), the following applies:

[1392] pSelDsY[idx]=(F2[0]×pY[SubWidthC×x-1][-1]+

[1393] F2[1]×pY[SubWidthC×x][-1]+(379)

[1394] F2[2]×pY[SubWidthC×x+1][-1]+2)>>2

[1395] 6. When cntT+cntL is not equal to 0, the variables minY, maxY, minC, and maxC are derived as follows:

[1396] —When cntT+cntL is equal to 2, pSelComp[3] is set equal to pSelComp[0], pSelComp[2] is set equal to pSelComp[1], pSelComp[0] is set equal to pSelComp[1], pSelComp[1] is set equal to pSelComp[3], and Comp is replaced by DsY and C.

[1397] —The arrays minGrpIdx and maxGrpIdx are derived as follows:

[1398] minGrpIdx[0]=0 (380)

[1399] minGrpIdx[1]=2 (381)

[1400] maxGrpIdx[0]=1 (382)

[1401] maxGrpIdx[1]=3 (383)

[1402] —When pSelDsY[minGrpIdx[0]] is greater than pSelDsY[minGrpIdx[1]], minGrpIdx[0] and minGrpIdx[1] are swapped as follows:

[1403] (minGrpIdx[0], minGrpIdx[1])=Swap(minGrpIdx[0], minGrpIdx[1]) (384)

[1405] —When pSelDsY[maxGrpIdx[0]] is greater than pSelDsY[maxGrpIdx[1]], maxGrpIdx[0] and maxGrpIdx[1] are swapped as follows:

[1406] (maxGrpIdx[0], maxGrpIdx[1])=Swap(maxGrpIdx[0], maxGrpIdx[1]) (385)

[1408] —When pSelDsY[minGrpIdx[0]] is greater than pSelDsY[maxGrpIdx[1]], the arrays minGrpIdx and maxGrpIdx are swapped as follows:

[1409] (minGrpIdx, maxGrpIdx) = Swap (minGrpIdx, maxGrpIdx) (386)

[1410] —When pSelDsY[minGrpIdx[1]] is greater than pSelDsY[maxGrpIdx[0]], minGrpIdx[1] and maxGrpIdx[0] are swapped as follows:

[1411] (minGrpIdx[1], maxGrpIdx[0])=Swap(minGrpIdx[1], maxGrpIdx[0]) (387)

[1413] —The variables maxY, maxC, minY, and minC are derived as follows:

[1414] maxY=(pSelDsY[maxGrpIdx[0]]+pSelDsY[maxGrpIdx[1]]+1)>>1 (388)

[1416] maxC=(pSelC[maxGrpIdx[0]]+pSelC[maxGrpIdx[1]]+1)>>1 (389)

[1418] minY=(pSelDsY[minGrpIdx[0]]+pSelDsY[minGrpIdx[1]]+1)>>1 (390)

[1420] minC=(pSelC[minGrpIdx[0]]+pSelC[minGrpIdx[1]]+1)>>1 (391)

[1421] 7. The variables a, b, and k are derived as follows:

[1422] — If numSampL is equal to 0 and numSampT is equal to 0, then the following applies:

[1423] k=0 (392)

[1424] a=0 (393)

[1425] b=1<<(BitDepth-1) (394)

[1426] — Otherwise, the following applies:

[1427] diff=maxY-minY (395)

[1428] — If diff is not equal to 0, the following applies:

[1429] diffC=maxC-minC (396)

[1430] x=Floor(Log2(diff)) (397)

[1431] normDiff=((diff<<4)>>x)&15 (398)

[1432] x+=(normDiff!=0)? 1:0 (399)

[1433] y=Abs(diffC)>0? Floor(Log2(Abs(diffC)))+1:0 (400)

[1434] a=(diffC×(divSigTable[normDiff]|8)+2 y - 1 )>>y (401)

[1435] k=((3+xy)<1)? 1:3+xy (402)

[1436] a=((3+xy)<1)? Sign(a)×15:a (403)

[1437] b=minC-((a×minY)>>k) (404)

[1438] where divSigTable[] is specified as follows:

[1439] divSigTable[]={0, 7, 6, 5, 5, 4, 4, 3, 3, 2, 2, 1, 1, 1, 1, 0} (405)

[1441] — Otherwise (diff is equal to 0), the following applies:

[1442] k=0 (406)

[1443] a=0 (407)

[1444] b=minC (408)

[1445] 8. The predicted sample point predSample[x][y], where x = 0..nTbW-1 and y = 0..nTbH-1, is derived as follows:

[1446] predSamples[x][y]=Clip1(((pDsY[x][y]×a)>>k)+b) (409)

[1448] NOTE - This process uses sps_chroma_vertical_collocated_flag. However, to simplify the implementation, it does not use sps_chroma_horizontal_collocated_flag.

[1449] 5.8. Example 8

[1450] The working draft specified in JVET-Q2001-vE may be modified as follows. 8.4.5.2.13

[1452] The inputs to this process are:

[1453] —Intra prediction mode predModeIntra,

[1454] - the sample position of the upper left sample of the current transform block relative to the upper left sample of the current picture (xTbC, yTbC),

[1455] - variable nTbW specifying the transform block width,

[1456] — variable nTbH specifying the transform block height,

[1457] — variable cIdx specifying the color component of the current block,

[1458] - Chroma adjacent sample points p[x][y], where x = -1, y = 0..2×nTbH-1, x = 0.2×nTbW-1, y = -1.

[1459] The output of this process is the predicted samples predSamples[x][y], where x = 0..nTbW-1, y = 0..nTbH-1.

[1460] The current brightness position (xTbY, yTbY) is derived as follows:

[1461] (xTbY, yTbY) = (xTbC<<(SubWidthC-1), yTbC<<(SubHeightC-1)) (351)

[1463] The variables availL, availT, and availTL are derived as follows:

[1464] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using as input the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY-1, yTbY), checkPredModeY set equal to false (FLASE), and cIdx, and assign the output to availL.

[1465] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY, yTbY-1), checkPredModeY set equal to false (FLASE), and cIdx as input, and assign the output to availT.

[1466] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY, yTbY-1), checkPredModeY set equal to false (FLASE), and cIdx as input, and assign the output to availTL.

[1467] [[—The variable availTL is derived as follows:

[1468] availTL=availL&&availT(352)]]

[1469] The number of available top-right adjacent chroma samples numTopRight is derived as follows:

[1470] —The variable numTopRight is set to 0, and availTR is set to true (TRUE).

[1471] - When predModeIntra is equal to INTRA_T_CCLM, the following applies for x=nTbW..2×nTbW-1 until availTR is equal to FALSE or x is equal to 2×nTbW-1:

[1472] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using as input the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY+x, yTbY-1), checkPredModeY set equal to false (FLASE), and cIdx, and assign the output to availTR.

[1473] —When availTR is equal to true (TRUE), numTopRight is increased by 1.

[1474] The number of available lower left adjacent chroma samples numLeftBelow is derived as follows:

[1475] —The variable numLeftBelow is set to 0, and availLB is set to true (TRUE).

[1476] When predModeIntra is equal to INTRA_L_CCLM, the following applies for y=nTbH..2×nTbH-1 until availLB is equal to FALSE or y is equal to 2×nTbH-1:

[1477] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY-1, yTbY+y), checkPredModeY set equal to false (FLASE), and cIdx as input, and assign the output to availLB.

[1478] —When availLB is equal to TRUE, numLeftBelow is increased by 1.

[1479] The number of available adjacent chroma samples numSampT at the top and upper right and the number of available adjacent chroma samples numSampL at the left and lower left are derived as follows:

[1480] If predModeIntra is equal to INTRA_LT_CCLM, the following applies:

[1481] numSampT=availT? nTbW:0 (353)

[1482] numSampL=availL? nTbH:0 (354)

[1483] — Otherwise, the following applies:

[1484] numSampT=(availT&&predModeIntra==INTRA_T_CCLM)?

[1485] (nTbW+Min(numTopRight,nTbH)):0 (355)

[1486] numSampL=(availL&&predModeIntra==INTRA_L_CCLM)? (nTbH+Min(numLeftBelow,nTbW)):0 (356)

[1487] The variable bCTUboundary is derived as follows:

[1488] bCTUboundary=(yTbY&(CtbSizeY-1)==0)? TRUE:FALSE (357)

[1489] The variable cntN and array pickPosN, where N is replaced by L and T, are derived as follows:

[1490] —The variable numIs4N is derived as follows:

[1491] numIs4N=((availT&&availL&&predModeIntra==INTRA_LT_CCLM)?0:1)(358)

[1492] —The variable startPosN is set equal to numSampN>>(2+numIs4N).

[1493] - The variable pickStepN is set equal to Max(1, numSampN>>(1+numIs4N)).

[1494] —If availN is equal to TRUE and predModeIntra is equal to INTRA_LT_CCLM or INTRA_N_CCLM, then the following assignments are made:

[1495] —cntN is set equal to Min(numSampN, (1+numIs4N)<<1).

[1496] - pickPosN[pos] is set equal to (startPosN+pos×pickStepN), where pos=0..cntN-1.

[1497] Otherwise, cntN is set equal to 0.

[1498] The predicted sample point predSample[x][y], where x = 0..nTbW-1 and y = 0..nTbH-1, is derived as follows:

[1499] — If numSampL and numSampT are both equal to 0, then the following applies:

[1500] predSamples[x][y]=1<<(BitDepth-1) (359)

[1501] — Otherwise, the following ordered steps apply:

[1502] 1. The co-located luma sample pY[x][y] where x=0..nTbW×SubWidthC-1, y=0..TbH×SubHeightC-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).

[1503] 2. The adjacent brightness samples pY[x][y] are derived as follows:

[1504] —When numSampL is greater than 0, the adjacent left luma sample pY[x][y] where x=-1..-3, y=0..SubHeightC×numSampL-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).

[1505] - When availT is equal to FALSE, the adjacent top luma sample pY[x][y] where x = -1..SubWidthC×numSampT-1, y = -1..-2 is set equal to luma sample pY[x][0].

[1506] - When availL is equal to FALSE, the adjacent left luma sample pY[x][y] where x = -1..-3, y = -1..SubHeightC×numSampL-1 is set equal to the luma sample pY[0][y].

[1507] When numSampT is greater than 0, the adjacent top luma sample pY[x][y] where x=0..SubWidthC×numSampT-1, y=-1..-2 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).

[1508] —[[When]] If availTL is equal to true (TRUE), the adjacent upper left luma sample pY[x][y] with x=-1,-2, y=-1,-2 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).

[1509] Otherwise, if availT is equal to true, then the adjacent top-left luma sample pY[x][y] where x=-1,-2, y=-1,-2 is set equal to the luma sample pY[0][y].

[1510] Otherwise, if availL is equal to true, then the adjacent top-left luma sample pY[x][y] where x=-1,-2, y=-1,-2 is set equal to luma sample pY[x][0].

[1511] 3. The downsampled co-located luminance sample pDsY[x][y], where x = 0..nTbW-1 and y = 0..nTbH-1, is derived as follows:

[1512] If SubWidthC and SubHeightC are both equal to 1, then the following applies:

[1513] —pDsY[x][y], where x=1..nTbW-1, y=1..nTbH-1 is derived as follows:

[1514] pDstY[x][y]=pY[x][y] (360)

[1515] — Otherwise, the following applies:

[1516] —The one-dimensional filter coefficient arrays F1 and F2 and the two-dimensional filter coefficient arrays F3 and F4 are specified as follows.

[1517] F1[0]=2,F1[1]=0 (361)

[1518] F2[0]=1,F2[1]=2,F2[2]=1 (362)

[1519] F3[i][j]=F4[i][j]=0, ​​where i=0..2, j=0..2 (363)

[1520] If SubWidthC and SubHeightC are both equal to 2, then the following applies:

[1521] F1[0]=1,F1[1]=1 (364)

[1522] F3[0][1]=1,F3[1][1]=4,F3[2][1]=1,F3[1][0]=1,F3[1][2]=1 (365)

[1523] F4[0][1]=1,F4[1][1]=2,F4[2][1]=1 (366)

[1524] F4[0][2]=1,F4[1][2]=2,F4[2][2]=1 (367)

[1525] — Otherwise, the following applies:

[1526] F3[1][1]=8 (368)

[1527] F4[0][1]=2, F4[1][1]=4, F4[2][1]=2, (369)

[1528] - If sps_chroma_vertical_collocated_flag is equal to 1, the following applies:

[1529] —pDsY[x][y], where x=0..nTbW-1, y=0..nTbH-1 is derived as follows:

[1530] pDsY[x][y]=(F3[1][0]×pY[SubWidthC×x][SubHeightC×y-1]+

[1531] F3[0][1]×pY[SubWidthC×x-1][SubHeightC×y]+

[1532] F3[1][1]×pY[SubWidthC×x][SubHeightC×y]+(370)

[1533] F3[2][1]×pY[SubWidthC×x+1][SubHeightC×y]+

[1534] F3[1][2]×pY[SubWidthC×x][SubHeightC×y+1]+4)>>3

[1535] Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies:

[1536] —pDsY[x][y], where x=0..nTbW-1, y=0..nTbH-1 is derived as follows:

[1537] pDsY[x][y]=(F4[0][1]×pY[SubWidthC×x-1][SubHeightC×y]+

[1538] F4[0][2]×pY[SubWidthC×x-1][SubHeightC×y+1]+

[1539] F4[1][1]×pY[SubWidthC×x][SubHeightC×y]+(371)

[1540] F4[1][2]×pY[SubWidthC×x][SubHeightC×y+1]+

[1541] F4[2][1]×pY[SubWidthC×x+1][SubHeightC×y]+

[1542] F4[2][2]×pY[SubWidthC×x+1][SubHeightC×y+1]+4)>>3

[1543] 4. When numSampL is greater than 0, the selected adjacent left chroma sample pSelC[idx] is set equal to p[-1][pickPosL[idx]], where idx = 0..cntL-1, and the selected downsampled adjacent left luma sample pSelDsY[idx], where idx = 0..cntL-1, is derived as follows:

[1544] —The variable y is set equal to pickPosL[idx].

[1545] If SubWidthC and SubHeightC are both equal to 1, then the following applies:

[1546] pSelDsY[idx]=pY[-1][y] (372)

[1547] — Otherwise, the following applies:

[1548] - If sps_chroma_vertical_collocated_flag is equal to 1, the following applies:

[1549] pSelDsY[idx]=(F3[1][0]×pY[-SubWidthC][SubHeightC×y-1]+

[1550] F3[0][1]×pY[-1-SubWidthC][SubHeightC×y]+

[1551] F3[1][1]×pY[-SubWidthC][SubHeightC×y]+(373)

[1552] F3[2][1]×pY[1-SubWidthC][SubHeightC×y]+

[1553] F3[1][2]×pY[-SubWidthC][SubHeightC×y+1]+4)>>3

[1554] Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies:

[1555] pSelDsY[idx]=(F4[0][1]×pY[-1-SubWidthC][SubHeightC×y]+

[1556] F4[0][2]×pY[-1-SubWidthC][SubHeightC×y+1]+

[1557] F4[1][1]×pY[-SubWidthC][SubHeightC×y]+(374)

[1558] F4[1][2]×pY[-SubWidthC][SubHeightC×y+1]+

[1559] F4[2][1]×pY[1-SubWidthC][SubHeightC×y]+

[1560] F4[2][2]×pY[1-SubWidthC][SubHeightC×y+1]+4)>>3

[1561] 5. When numSampT is greater than 0, the selected adjacent top chroma sample pSelC[idx] is set equal to p[pickPosT[idx-cntL]][-1], where idx=cntL..cntL+cntT-1, and the downsampled adjacent top luma sample pSelDsY[idx], where idx=0..cntL+cntT-1 is specified as follows:

[1562] —The variable x is set equal to pickPosT[idx-cntL].

[1563] If SubWidthC and SubHeightC are both equal to 1, then the following applies:

[1564] pSelDsY[idx]=pY[x][-1] (375)

[1565] — Otherwise, the following applies:

[1566] - If sps_chroma_vertical_collocated_flag is equal to 1, the following applies:

[1567] If bCTUboundary is equal to FALSE, the following applies:

[1568] pSelDsY[idx]=(F3[1][0]×pY[SubWidthC×x][-1-SubHeightC]+

[1569] F3[0][1]×pY[SubWidthC×x-1][-SubHeightC]+

[1570] F3[1][1]×pY[SubWidthC×x][-SubHeightC]+(376)

[1571] F3[2][1]×pY[SubWidthC×x+1][-SubHeightC]+

[1572] F3[1][2]×pY[SubWidthC×x][1-SubHeightC]+4)>>3

[1573] — Otherwise (bCTUboundary is TRUE), the following applies:

[1574] pSelDsY[idx]=(F2[0]×pY[SubWidthC×x-1][-1]+

[1575] F2[1]×pY[SubWidthC×x][-1]+(377)

[1576] F2[2]×pY[SubWidthC×x+1][-1]+2)>>2

[1577] Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies:

[1578] If bCTUboundary is equal to FALSE, the following applies:

[1579] pSelDsY[idx]=(F4[0][1]×pY[SubWidthC x-1][-1]+

[1580] F4[0][2]×pY[SubWidthC×x-1][-2]+

[1581] F4[1][1]×pY[SubWidthC×x][-1]+(378)

[1582] F4[1][2]×pY[SubWidthC×x][-2]+

[1583] F4[2][1]×pY[SubWidthC×x+1][-1]+

[1584] F4[2][2]×pY[SubWidthC×x+1][-2]+4)>>3

[1585] — Otherwise (bCTUboundary is TRUE), the following applies:

[1586] pSelDsY[idx]=(F2[0]×pY[SubWidthC×x-1][-1]+

[1587] F2[1]×pY[SubWidthC×x][-1]+(379)

[1588] F2[2]×pY[SubWidthC×x+1][-1]+2)>>2

[1589] 6. When cntT+cntL is not equal to 0, the variables minY, maxY, minC, and maxC are derived as follows:

[1590] —When cntT+cntL is equal to 2, pSelComp[3] is set equal to pSelComp[0], pSelComp[2] is set equal to pSelComp[1], pSelComp[0] is set equal to pSelComp[1], pSelComp[1] is set equal to pSelComp[3], and Comp is replaced by DsY and C.

[1591] —The arrays minGrpIdx and maxGrpIdx are derived as follows:

[1592] minGrpIdx[0]=0 (380)

[1593] minGrpIdx[1]=2 (381)

[1594] maxGrpIdx[0]=1 (382)

[1595] maxGrpIdx[1]=3 (383)

[1596] —When pSelDsY[minGrpIdx[0]] is greater than pSelDsY[minGrpIdx[1]], minGrpIdx[0] and minGrpIdx[1] are swapped as follows:

[1597] (minGrpIdx[0], minGrpIdx[1])=Swap(minGrpIdx[0], minGrpIdx[1]) (384)

[1599] —When pSelDsY[maxGrpIdx[0]] is greater than pSelDsY[maxGrpIdx[1]], maxGrpIdx[0] and maxGrpIdx[1] are swapped as follows:

[1600] (maxGrpIdx[0], maxGrpIdx[1])=Swap(maxGrpIdx[0], maxGrpIdx[1]) (385)

[1602] —When pSelDsY[minGrpIdx[0]] is greater than pSelDsY[maxGrpIdx[1]], the arrays minGrpIdx and maxGrpIdx are swapped as follows:

[1603] (minGrpIdx, maxGrpIdx) = Swap (minGrpIdx, maxGrpIdx) (386)

[1604] —When pSelDsY[minGrpIdx[1]] is greater than pSelDsY[maxGrpIdx[0]], minGrpIdx[1] and maxGrpIdx[0] are swapped as follows:

[1605] (minGrpIdx[1], maxGrpIdx[0])=Swap(minGrpIdx[1], maxGrpIdx[0]) (387)

[1607] —The variables maxY, maxC, minY, and minC are derived as follows:

[1608] maxY=(pSelDsY[maxGrpIdx[0]]+pSelDsY[maxGrpIdx[1]]+1)>>1 (388)

[1610] maxC=(pSelC[maxGrpIdx[0]]+pSelC[maxGrpIdx[1]]+1)>>1 (389)

[1612] minY=(pSelDsY[minGrpIdx[0]]+pSelDsY[minGrpIdx[1]]+1)>>1 (390)

[1614] minC=(pSelC[minGrpIdx[0]]+pSelC[minGrpIdx[1]]+1)>>1 (391)

[1615] 7. The variables a, b, and k are derived as follows:

[1616] — If numSampL is equal to 0 and numSampT is equal to 0, then the following applies:

[1617] k=0 (392)

[1618] a=0 (393)

[1619] b=1<<(BitDepth-1) (394)

[1620] — Otherwise, the following applies:

[1621] diff=maxY-minY (395)

[1622] — If diff is not equal to 0, the following applies:

[1623] diffC=maxC-minC (396)

[1624] x=Floor(Log2(diff)) (397)

[1625] normDiff=((diff<<4)>>x)&15 (398)

[1626] x+=(normDiff!=0)? 1:0 (399)

[1627] y=Abs(diffC)>0? Floor(Log2(Abs(diffC)))+1:0 (400)

[1628] a=(diffC×(divSigTable[normDiff]|8)+2 y - 1 )>>y (401)

[1629] k=((3+xy)<1)? 1:3+xy (402)

[1630] a=((3+xy)<1)? Sign(a)×15:a (403)

[1631] b=minC-((a×minY)>>k) (404)

[1632] where divSigTable[] is specified as follows:

[1633] divSigTable[]={0, 7, 6, 5, 5, 4, 4, 3, 3, 2, 2, 1, 1, 1, 1, 0} (405)

[1634] — Otherwise (diff is equal to 0), the following applies:

[1635] k=0 (406)

[1636] a=0 (407)

[1637] b=minC (408)

[1638] 8. The predicted sample point predSample[x][y], where x = 0..nTbW-1 and y = 0..nTbH-1, is derived as follows:

[1639] predSamples[x][y]=Clip1(((pDsY[x][y]×a)>>k)+b) (409)

[1640] NOTE - This process uses sps_chroma_vertical_collocated_flag. However, to simplify the implementation, it does not use sps_chroma_horizontal_collocated_flag.

[1641] 5.9. Example 9

[1642] The working draft specified in JVET-Q2001-vE may be modified as follows. 8.4.5.2.13

[1644] The inputs to this process are:

[1645] —Intra prediction mode predModeIntra,

[1646] - the sample position of the upper left sample of the current transform block relative to the upper left sample of the current picture (xTbC, yTbC),

[1647] - variable nTbW specifying the transform block width,

[1648] — variable nTbH specifying the transform block height,

[1649] — variable cIdx specifying the color component of the current block,

[1650] - Chroma adjacent sample points p[x][y], where x = -1, y = 0..2×nTbH-1, x = 0.2×nTbW-1, y = -1.

[1651] The output of this process is the predicted samples predSamples[x][y], where x = 0..nTbW-1, y = 0..nTbH-1.

[1652] The current brightness position (xTbY, yTbY) is derived as follows:

[1653] (xTbY, yTbY) = (xTbC<<(SubWidthC-1), yTbC<<(SubHeightC-1)) (351)

[1655] The variables availL, availT, and availTL are derived as follows:

[1656] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using as input the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY-1, yTbY), checkPredModeY set equal to false (FLASE), and cIdx, and assign the output to availL.

[1657] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY, yTbY-1), checkPredModeY set equal to false (FLASE), and cIdx as input, and assign the output to availT.

[1658] —The variable availTL is derived as follows:

[1659] availTL=availL&&availT (352)

[1660] The number of available top-right adjacent chroma samples numTopRight is derived as follows:

[1661] —The variable numTopRight is set to 0, and availTR is set to true (TRUE).

[1662] - When predModeIntra is equal to INTRA_T_CCLM, the following applies for x=nTbW..2×nTbW-1 until availTR is equal to FALSE or x is equal to 2×nTbW-1:

[1663] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using as input the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY+x, yTbY-1), checkPredModeY set equal to false (FLASE), and cIdx, and assign the output to availTR.

[1664] —When availTR is equal to true (TRUE), numTopRight is increased by 1.

[1665] The number of available lower left adjacent chroma samples numLeftBelow is derived as follows:

[1666] —The variable numLeftBelow is set to 0, and availLB is set to true (TRUE).

[1667] - When predModeIntra is equal to INTRA_L_CCLM, the following applies for y=nTbH..2×nTbH-1 until availLB is equal to FALSE or y is equal to 2×nTbH-1:

[1668] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY-1, yTbY+y), checkPredModeY set equal to false (FLASE), and cIdx as input, and assign the output to availLB.

[1669] —When availLB is equal to TRUE, numLeftBelow is increased by 1.

[1670] The number of available adjacent chroma samples numSampT at the top and upper right and the number of available adjacent chroma samples numSampL at the left and lower left are derived as follows:

[1671] If predModeIntra is equal to INTRA_LT_CCLM, the following applies:

[1672] numSampT=availT? nTbW:0 (353)

[1673] numSampL=availL? nTbH:0 (354)

[1674] — Otherwise, the following applies:

[1675] numSampT=(availT&&predModeIntra==INTRA_T_CCLM)? (nTbW+Min(numTopRight,nTbH)):0 (355)

[1676] numSampL=(availL&&predModeIntra==INTRA_L_CCLM)? (nTbH+Min(numLeftBelow,nTbW)):0 (356)

[1677] The variable bCTUboundary is derived as follows:

[1678] bCTUboundary=(yTbY&(CtbSizeY-1)==0)? TRUE:FALSE (357)

[1679] The variable cntN and array pickPosN, where N is replaced by L and T, are derived as follows:

[1680] —The variable numIs4N is derived as follows:

[1681] numIs4N=((availT&&availL&&predModeIntra==INTRA_LT_CCLM)?0:1)(358)

[1682] —The variable startPosN is set equal to numSampN>>(2+numIs4N).

[1683] - The variable pickStepN is set equal to Max(1, numSampN>>(1+numIs4N)).

[1684] —If availN is equal to TRUE and predModeIntra is equal to INTRA_LT_CCLM or INTRA_N_CCLM, then the following assignments are made:

[1685] —cntN is set equal to Min(numSampN, (1+numIs4N)<<1).

[1686] - pickPosN[pos] is set equal to (startPosN+pos×pickStepN), where pos=0..cntN-1.

[1687] Otherwise, cntN is set equal to 0.

[1688] The predicted sample point predSample[x][y], where x = 0..nTbW-1 and y = 0..nTbH-1, is derived as follows:

[1689] — If numSampL and numSampT are both equal to 0, then the following applies:

[1690] predSamples[x][y]=1<<(BitDepth-1) (359)

[1691] — Otherwise, the following ordered steps apply:

[1692] 1. The co-located luma sample pY[x][y] where x=0..nTbW×SubWidthC-1, y=0..TbH×SubHeightC-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).

[1693] 2. The adjacent brightness samples pY[x][y] are derived as follows:

[1694] —When numSampL is greater than 0, the adjacent left luma sample pY[x][y] where x=-1..-3, y=0..SubHeightC×numSampL-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).

[1695] - When availT is equal to FALSE, the adjacent top luma sample pY[x][y] where x = -1..SubWidthC×[[numSampT]]nTbW-1, y = -1..-2 is set equal to luma sample pY[x][0].

[1696] [[—When availL is equal to FALSE, the adjacent left luma sample pY[x][y] where x = -1..-3, y = -1..SubHeightC×numSampL-1 is set equal to the luma sample pY[0][y]. ]]

[1697] When numSampT is greater than 0, the adjacent top luma sample pY[x][y] where x=0..SubWidthC×numSampT-1, y=-1..-2 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).

[1698] - When availL is equal to FALSE, the adjacent left luma sample pY[x][y] where x = -1..-3, y = -1..SubHeightC×nTbH-1 is set equal to the luma sample pY[0][y].

[1699] —When availTL is equal to true (TRUE), the adjacent upper left luma sample pY[x][y] where x=-1, y=-1, -2 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).

[1700] 3. The downsampled co-located luminance sample pDsY[x][y], where x = 0..nTbW-1 and y = 0..nTbH-1, is derived as follows:

[1701] If SubWidthC and SubHeightC are both equal to 1, then the following applies:

[1702] —pDsY[x][y], where x=1..nTbW-1, y=1..nTbH-1 is derived as follows:

[1703] pDstY[x][y]=pY[x][y] (360)

[1704] — Otherwise, the following applies:

[1705] —The one-dimensional filter coefficient arrays F1 and F2 and the two-dimensional filter coefficient arrays F3 and F4 are specified as follows.

[1706] F1[0]=2,F1[1]=0 (361)

[1707] F2[0]=1,F2[1]=2,F2[2]=1 (362)

[1708] F3[i][j]=F4[i][j]=0, ​​where i=0..2, j=0..2 (363)

[1709] If SubWidthC and SubHeightC are both equal to 2, then the following applies:

[1710] F1[0]=1,F1[1]=1 (364)

[1711] F3[0][1]=1,F3[1][1]=4,F3[2][1]=1,F3[1][0]=1,F3[1][2]=1 (365)

[1712] F4[0][1]=1,F4[1][1]=2,F4[2][1]=1 (366)

[1713] F4[0][2]=1,F4[1][2]=2,F4[2][2]=1 (367)

[1714] — Otherwise, the following applies:

[1715] F3[1][1]=8 (368)

[1716] F4[0][1]=2, F4[1][1]=4, F4[2][1]=2, (369)

[1717] - If sps_chroma_vertical_collocated_flag is equal to 1, the following applies:

[1718] —pDsY[x][y], where x=0..nTbW-1, y=0..nTbH-1 is derived as follows:

[1719] pDsY[x][y]=(F3[1][0]×pY[SubWidthC×x][SubHeightC×y-1]+

[1720] F3[0][1]×pY[SubWidthC×x-1][SubHeightC×y]+

[1721] F3[1][1]×pY[SubWidthC×x][SubHeightC×y]+(370)

[1722] F3[2][1]×pY[SubWidthC×x+1][SubHeightC×y]+

[1723] F3[1][2]×pY[SubWidthC×x][SubHeightC×y+1]+4)>>3

[1724] Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies:

[1725] —pDsY[x][y], x=0..nTbW-1, y=0..nTbH-1 is derived as follows:

[1726] pDsY[x][y]=(F4[0][1]×pY[SubWidthC×x-1][SubHeightC×y]+

[1727] F4[0][2]×pY[SubWidthC×x-1][SubHeightC×y+1]+

[1728] F4[1][1]×pY[SubWidthC×x][SubHeightC×y]+(371)

[1729] F4[1][2]×pY[SubWidthC×x][SubHeightC×y+1]+

[1730] F4[2][1]×pY[SubWidthC×x+1][SubHeightC×y]+

[1731] F4[2][2]×pY[SubWidthC×x+1][SubHeightC×y+1]+4)>>3

[1732] 4. When numSampL is greater than 0, the selected adjacent left chroma sample pSelC[idx] is set equal to p[-1][pickPosL[idx]], where idx = 0..cntL-1, and the selected downsampled adjacent left luma sample pSelDsY[idx], where idx = 0..cntL-1, is derived as follows:

[1733] —The variable y is set equal to pickPosL[idx].

[1734] If SubWidthC and SubHeightC are both equal to 1, then the following applies:

[1735] pSelDsY[idx]=pY[-1][y] (372)

[1736] — Otherwise, the following applies:

[1737] - If sps_chroma_vertical_collocated_flag is equal to 1, the following applies:

[1738] pSelDsY[idx]=(F3[1][0]×pY[-SubWidthC][SubHeightC×y-1]+

[1739] F3[0][1]×pY[-1-SubWidthC][SubHeightC×y]+

[1740] F3[1][1]×pY[-SubWidthC][SubHeightC×y]+(373)

[1741] F3[2][1]×pY[1-SubWidthC][SubHeightC×y]+

[1742] F3[1][2]×pY[-SubWidthC][SubHeightC×y+1]+4)>>3

[1743] Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies:

[1744] pSelDsY[idx]=(F4[0][1]×pY[-1-SubWidthC][SubHeightC×y]+

[1745] F4[0][2]×pY[-1-SubWidthC][SubHeightC×y+1]+

[1746] F4[1][1]×pY[-SubWidthC][SubHeightC×y]+(374)

[1747] F4[1][2]×pY[-SubWidthC][SubHeightC×y+1]+

[1748] F4[2][1]×pY[1-SubWidthC][SubHeightC×y]+

[1749] F4[2][2]×pY[1-SubWidthC][SubHeightC×y+1]+4)>>3

[1750] 5. When numSampT is greater than 0, the selected adjacent top chroma sample pSelC[idx] is set equal to p[pickPosT[idx-cntL]][-1], where idx=cntL..cntL+cntT-1, and the downsampled adjacent top luma sample pSelDsY[idx], where idx=0..cntL+cntT-1 is specified as follows:

[1751] —The variable x is set equal to pickPosT[idx-cntL].

[1752] If SubWidthC and SubHeightC are both equal to 1, then the following applies:

[1753] pSelDsY[idx]=pY[x][-1] (375)

[1754] — Otherwise, the following applies:

[1755] - If sps_chroma_vertical_collocated_flag is equal to 1, the following applies:

[1756] If bCTUboundary is equal to FALSE, the following applies:

[1757] pSelDsY[idx]=(F3[1][0]×pY[SubWidthC×x][-1-SubHeightC]+

[1758] F3[0][1]×pY[SubWidthC×x-1][-SubHeightC]+

[1759] F3[1][1]×pY[SubWidthC×x][-SubHeightC]+(376)

[1760] F3[2][1]×pY[SubWidthC×x+1][-SubHeightC]+

[1761] F3[1][2]×pY[SubWidthC×x][1-SubHeightC]+4)>>3

[1762] — Otherwise (bCTUboundary is TRUE), the following applies:

[1763] pSelDsY[idx]=(F2[0]×pY[SubWidthC×x-1][-1]+

[1764] F2[1]×pY[SubWidthC×x][-1]+(377)

[1765] F2[2]×pY[SubWidthC×x+1][-1]+2)>>2

[1766] Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies:

[1767] If bCTUboundary is equal to FALSE, the following applies:

[1768] pSelDsY[idx]=(F4[0][1]×pY[SubWidthC x-1][-1]+

[1769] F4[0][2]×pY[SubWidthC×x-1][-2]+

[1770] F4[1][1]×pY[SubWidthC×x][-1]+(378)

[1771] F4[1][2]×pY[SubWidthC×x][-2]+

[1772] F4[2][1]×pY[SubWidthC×x+1][-1]+

[1773] F4[2][2]×pY[SubWidthC×x+1][-2]+4)>>3

[1774] — Otherwise (bCTUboundary is TRUE), the following applies:

[1775] pSelDsY[idx]=(F2[0]×pY[SubWidthC×x-1][-1]+

[1776] F2[1]×pY[SubWidthC×x][-1]+(379)

[1777] F2[2]×pY[SubWidthC×x+1][-1]+2)>>2

[1778] 6. When cntT+cntL is not equal to 0, the variables minY, maxY, minC, and maxC are derived as follows:

[1779] —When cntT+cntL is equal to 2, pSelComp[3] is set equal to pSelComp[0], pSelComp[2] is set equal to pSelComp[1], pSelComp[0] is set equal to pSelComp[1], pSelComp[1] is set equal to pSelComp[3], and Comp is replaced by DsY and C.

[1780] —The arrays minGrpIdx and maxGrpIdx are derived as follows:

[1781] minGrpIdx[0]=0 (380)

[1782] minGrpIdx[1]=2 (381)

[1783] maxGrpIdx[0]=1 (382)

[1784] maxGrpIdx[1]=3 (383)

[1785] —When pSelDsY[minGrpIdx[0]] is greater than pSelDsY[minGrpIdx[1]], minGrpIdx[0] and minGrpIdx[1] are swapped as follows:

[1786] (minGrpIdx[0], minGrpIdx[1])=Swap(minGrpIdx[0], minGrpIdx[1]) (384)

[1788] —When pSelDsY[maxGrpIdx[0]] is greater than pSelDsY[maxGrpIdx[1]], maxGrpIdx[0] and maxGrpIdx[1] are swapped as follows:

[1789] (maxGrpIdx[0], maxGrpIdx[1])=Swap(maxGrpIdx[0], maxGrpIdx[1]) (385)

[1791] —When pSelDsY[minGrpIdx[0]] is greater than pSelDsY[maxGrpIdx[1]], the arrays minGrpIdx and maxGrpIdx are swapped as follows:

[1792] (minGrpIdx, maxGrpIdx) = Swap (minGrpIdx, maxGrpIdx) (386)

[1793] —When pSelDsY[minGrpIdx[1]] is greater than pSelDsY[maxGrpIdx[0]], minGrpIdx[1] and maxGrpIdx[0] are swapped as follows:

[1794] (minGrpIdx[1], maxGrpIdx[0])=Swap(minGrpIdx[1], maxGrpIdx[0]) (387)

[1796] —The variables maxY, maxC, minY, and minC are derived as follows:

[1797] maxY=(pSelDsY[maxGrpIdx[0]]+pSelDsY[maxGrpIdx[1]]+1)>>1 (388)

[1799] maxC=(pSelC[maxGrpIdx[0]]+pSelC[maxGrpIdx[1]]+1)>>1(389)

[1800] minY=(pSelDsY[minGrpIdx[0]]+pSelDsY[minGrpIdx[1]]+1)>>1 (390)

[1802] minC=(pSelC[minGrpIdx[0]]+pSelC[minGrpIdx[1]]+1)>>1 (391)

[1803] 7. The variables a, b, and k are derived as follows:

[1804] — If numSampL is equal to 0 and numSampT is equal to 0, then the following applies:

[1805] k=0 (392)

[1806] a=0 (393)

[1807] b=1<<(BitDepth-1) (394)

[1808] — Otherwise, the following applies:

[1809] diff=maxY-minY (395)

[1810] — If diff is not equal to 0, the following applies:

[1811] diffC=maxC-minC (396)

[1812] x=Floor(Log2(diff)) (397)

[1813] normDiff=((diff<<4)>>x)&15 (398)

[1814] x+=(normDiff!=0)? 1:0 (399)

[1815] y=Abs(diffC)>0? Floor(Log2(Abs(diffC)))+1:0 (400)

[1816] a=(diffC×(divSigTable[normDiff]|8)+2 y - 1 )>>y (401)

[1817] k=((3+xy)<1)? 1:3+xy (402)

[1818] a=((3+xy)<1)? Sign(a)×15:a (403)

[1819] b=minC-((a×minY)>>k) (404)

[1820] where divSigTable[] is specified as follows:

[1821] divSigTable[]={0, 7, 6, 5, 5, 4, 4, 3, 3, 2, 2, 1, 1, 1, 1, 0} (405)

[1822] — Otherwise (diff is equal to 0), the following applies:

[1823] k=0 (406)

[1824] a=0 (407)

[1825] b=minC (408)

[1826] 8. The predicted sample point predSample[x][y], where x = 0..nTbW-1 and y = 0..nTbH-1, is derived as follows:

[1827] predSamples[x][y]=Clip1(((pDsY[x][y]×a)>>k)+b) (409)

[1828] NOTE - This process uses sps_chroma_vertical_collocated_flag. However, to simplify the implementation, it does not use sps_chroma_horizontal_collocated_flag.

[1829] 5.10. Example 10

[1830] The working draft specified in JVET-Q2001-vE may be modified as follows. 8.4.5.2.13

[1832] The inputs to this process are:

[1833] —Intra prediction mode predModeIntra,

[1834] - the sample position of the upper left sample of the current transform block relative to the upper left sample of the current picture (xTbC, yTbC),

[1835] - variable nTbW specifying the transform block width,

[1836] — variable nTbH specifying the transform block height,

[1837] — variable cIdx specifying the color component of the current block,

[1838] - Chroma neighboring samples p[x][y], where x = -1, y = 0..2×nTbH-1, and x = 0..2×nTbW-1, y = -1.

[1839] The output of this process is the predicted samples predSamples[x][y], where x = 0..nTbW-1, y = 0..nTbH-1.

[1840] The current brightness position (xTbY, yTbY) is derived as follows:

[1841] (xTbY, yTbY) = (xTbC<<(SubWidthC-1), yTbC<<(SubHeightC-1)) (351)

[1843] The variables availL, availT, and availTL are derived as follows:

[1844] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using as input the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY-1, yTbY), checkPredModeY set equal to false (FLASE), and cIdx, and assign the output to availL.

[1845] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY, yTbY-1), checkPredModeY set equal to false (FLASE), and cIdx as input, and assign the output to availT.

[1846] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY-1, yTbY-1), checkPredModeY set equal to false (FLASE), and cIdx as input, and assign the output to availTL.

[1847] [[—The variable availTL is derived as follows:

[1848] availTL=availL&&availT (352)]]

[1849] The number of available top-right adjacent chroma samples numTopRight is derived as follows:

[1850] —The variable numTopRight is set to 0, and availTR is set to true (TRUE).

[1851] - When predModeIntra is equal to INTRA_T_CCLM, the following applies for x=nTbW..2×nTbW-1 until availTR is equal to FALSE or x is equal to 2×nTbW-1:

[1852] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using as input the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY+x, yTbY-1), checkPredModeY set equal to false (FLASE), and cIdx, and assign the output to availTR.

[1853] —When availTR is equal to true (TRUE), numTopRight is increased by 1.

[1854] The number of available lower left adjacent chroma samples numLeftBelow is derived as follows:

[1855] —The variable numLeftBelow is set to 0, and availLB is set to true (TRUE).

[1856] When predModeIntra is equal to INTRA_L_CCLM, the following applies for y=nTbH..2×nTbH-1 until availLB is equal to FALSE or y is equal to 2×nTbH-1:

[1857] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY-1, yTbY+y), checkPredModeY set equal to false (FLASE), and cIdx as input, and assign the output to availLB.

[1858] —When availLB is equal to TRUE, numLeftBelow is increased by 1.

[1859] The number of available adjacent chroma samples numSampT at the top and upper right and the number of available adjacent chroma samples numSampL at the left and lower left are derived as follows:

[1860] If predModeIntra is equal to INTRA_LT_CCLM, the following applies:

[1861] numSampT=availT? nTbW:0 (353)

[1862] numSampL=availL? nTbH:0 (354)

[1863] — Otherwise, the following applies:

[1864] numSampT=(availT&&predModeIntra==INTRA_T_CCLM)? (nTbW+Min(numTopRight,nTbH)):0 (355)

[1865] numSampL=(availL&&predModeIntra==INTRA_L_CCLM)? (nTbH+Min(numLeftBelow,nTbW)):0 (356)

[1866] The variable bCTUboundary is derived as follows:

[1867] bCTUboundary=(yTbY&(CtbSizeY-1)==0)? TRUE:FALSE (357)

[1868] The variable cntN and array pickPosN, where N is replaced by L and T, are derived as follows:

[1869] —The variable numIs4N is derived as follows:

[1870] numIs4N=((availT&&availL&&predModeIntra==INTRA_LT_CCLM)?0:1)(358)

[1871] —The variable startPosN is set equal to numSampN>>(2+numIs4N).

[1872] - The variable pickStepN is set equal to Max(1, numSampN>>(1+numIs4N)).

[1873] —If availN is equal to TRUE and predModeIntra is equal to INTRA_LT_CCLM or INTRA_N_CCLM, then the following assignments are made:

[1874] —cntN is set equal to Min(numSampN, (1+numIs4N)<<1).

[1875] - pickPosN[pos] is set equal to (startPosN+pos×pickStepN), where pos=0..cntN-1.

[1876] Otherwise, cntN is set equal to 0.

[1877] The predicted sample point predSample[x][y], where x = 0..nTbW-1 and y = 0..nTbH-1, is derived as follows:

[1878] — If numSampL and numSampT are both equal to 0, then the following applies:

[1879] predSamples[x][y]=1<<(BitDepth-1) (359)

[1880] — Otherwise, the following ordered steps apply:

[1881] 1. The co-located luma sample pY[x][y] where x=0..nTbW×SubWidthC-1, y=0..TbH×SubHeightC-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).

[1882] 2. The adjacent brightness samples pY[x][y] are derived as follows:

[1883] —When numSampL is greater than 0, the adjacent left luma sample pY[x][y] where x=-1..-3, y=0..SubHeightC×numSampL-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).

[1884] [[—When availT is equal to FALSE, the adjacent top luma sample pY[x][y] where x = -1..SubWidthC×numSampT-1, y = -1..-2 is set equal to luma sample pY[x][0].

[1885] - When availL is equal to FALSE, the adjacent left luma sample pY[x][y] where x = -1..-3, y = -1..SubHeightC×numSampL-1 is set equal to the luma sample pY[0][y].

[1886] When numSampT is greater than 0, the adjacent top luma sample pY[x][y] where x=0..SubWidthC×numSampT-1, y=-1..-2 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).

[1887] —[[When]] If availTL is equal to true (TRUE), the adjacent upper left luma sample pY[x][y] with x=-1,-2, y=-1,-2 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).

[1888] Otherwise, if availT is equal to true, then the adjacent top-left luma sample pY[x][y] where x=-1,-2, y=-1,-2 is set equal to the luma sample pY[0][y].

[1889] Otherwise, if availL is equal to true, then the adjacent top-left luma sample pY[x][y] where x=-1,-2, y=-1,-2 is set equal to luma sample pY[x][0].

[1890] - When availT is equal to FALSE, the adjacent top luma sample pY[x][y] where x = 0..SubWidthC×nTbW-1, y = -1..-2 is set equal to luma sample pY[x][0].

[1891] - When availL is equal to FALSE, the adjacent left luma sample pY[x][y] where x=0..-3, y=-1..SubHeightC×nTbH-1 is set equal to the luma sample pY[0][y].

[1892] 3. The downsampled co-located luminance sample pDsY[x][y], where x = 0..nTbW-1 and y = 0..nTbH-1, is derived as follows:

[1893] If SubWidthC and SubHeightC are both equal to 1, then the following applies:

[1894] —pDsY[x][y], x=1..nTbW-1, y=1..nTbH-1 is derived as follows:

[1895] pDstY[x][y]=pY[x][y] (360)

[1896] — Otherwise, the following applies:

[1897] —The one-dimensional filter coefficient arrays F1 and F2 and the two-dimensional filter coefficient arrays F3 and F4 are specified as follows.

[1898] F1[0]=2,F1[1]=0 (361)

[1899] F2[0]=1,F2[1]=2,F2[2]=1 (362)

[1900] F3[i][j]=F4[i][j]=0, ​​where i=0..2, j=0..2 (363)

[1901] If SubWidthC and SubHeightC are both equal to 2, then the following applies:

[1902] F1[0]=1,F1[1]=1 (364)

[1903] F3[0][1]=1,F3[1][1]=4,F3[2][1]=1,F3[1][0]=1,F3[1][2]=1(365)

[1904] F4[0][1]=1,F4[1][1]=2,F4[2][1]=1 (366)

[1905] F4[0][2]=1,F4[1][2]=2,F4[2][2]=1 (367)

[1906] — Otherwise, the following applies:

[1907] F3[1][1]=8 (368)

[1908] F4[0][1]=2, F4[1][1]=4, F4[2][1]=2, (369)

[1909] - If sps_chroma_vertical_collocated_flag is equal to 1, the following applies:

[1910] —pDsY[x][y], where x=0..nTbW-1, y=0..nTbH-1 is derived as follows:

[1911] pDsY[x][y]=(F3[1][0]×pY[SubWidthC×x][SubHeightC×y-1]+

[1912] F3[0][1]×pY[SubWidthC×x-1][SubHeightC×y]+

[1913] F3[1][1]×pY[SubWidthC×x][SubHeightC×y]+(370)

[1914] F3[2][1]×pY[SubWidthC×x+1][SubHeightC×y]+

[1915] F3[1][2]×pY[SubWidthC×x][SubHeightC×y+1]+4)>>3

[1916] Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies:

[1917] —pDsY[x][y], where x=0..nTbW-1, y=0..nTbH-1 is derived as follows:

[1918] pDsY[x][y]=(F4[0][1]×pY[SubWidthC×x-1][SubHeightC×y]+

[1919] F4[0][2]×pY[SubWidthC×x-1][SubHeightC×y+1]+

[1920] F4[1][1]×pY[SubWidthC×x][SubHeightC×y]+(371)

[1921] F4[1][2]×pY[SubWidthC×x][SubHeightC×y+1]+

[1922] F4[2][1]×pY[SubWidthC×x+1][SubHeightC×y]+

[1923] F4[2][2]×pY[SubWidthC×x+1][SubHeightC×y+1]+4)>>3

[1924] 4. When numSampL is greater than 0, the selected adjacent left chroma sample pSelC[idx] is set equal to p[-1][pickPosL[idx]], where idx = 0..cntL-1, and the selected downsampled adjacent left luma sample pSelDsY[idx], where idx = 0..cntL-1, is derived as follows:

[1925] —The variable y is set equal to pickPosL[idx].

[1926] If SubWidthC and SubHeightC are both equal to 1, then the following applies:

[1927] pSelDsY[idx]=pY[-1][y] (372)

[1928] — Otherwise, the following applies:

[1929] - If sps_chroma_vertical_collocated_flag is equal to 1, the following applies:

[1930] pSelDsY[idx]=(F3[1][0]×pY[-SubWidthC][SubHeightC×y-1]+

[1931] F3[0][1]×pY[-1-SubWidthC][SubHeightC×y]+

[1932] F3[1][1]×pY[-SubWidthC][SubHeightC×y]+(373)

[1933] F3[2][1]×pY[1-SubWidthC][SubHeightC×y]+

[1934] F3[1][2]×pY[-SubWidthC][SubHeightC×y+1]+4)>>3

[1935] Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies:

[1936] pSelDsY[idx]=(F4[0][1]×pY[-1-SubWidthC][SubHeightC×y]+

[1937] F4[0][2]×pY[-1-SubWidthC][SubHeightC×y+1]+

[1938] F4[1][1]×pY[-SubWidthC][SubHeightC×y]+(374)

[1939] F4[1][2]×pY[-SubWidthC][SubHeightC×y+1]+

[1940] F4[2][1]×pY[1-SubWidthC][SubHeightC×y]+

[1941] F4[2][2]×pY[1-SubWidthC][SubHeightC×y+1]+4)>>3

[1942] 5. When numSampT is greater than 0, the selected adjacent top chroma sample pSelC[idx] is set equal to p[pickPosT[idx-cntL]][-1], where idx=cntL..cntL+cntT-1, and the downsampled adjacent top luma sample pSelDsY[idx], where idx=0..cntL+cntT-1 is specified as follows:

[1943] —The variable x is set equal to pickPosT[idx-cntL].

[1944] If SubWidthC and SubHeightC are both equal to 1, then the following applies:

[1945] pSelDsY[idx]=pY[x][-1] (375)

[1946] — Otherwise, the following applies:

[1947] - If sps_chroma_vertical_collocated_flag is equal to 1, the following applies:

[1948] If bCTUboundary is equal to FALSE, the following applies:

[1949] pSelDsY[idx]=(F3[1][0]×pY[SubWidthC×x][-1-SubHeightC]+

[1950] F3[0][1]×pY[SubWidthC×x-1][-SubHeightC]+

[1951] F3[1][1]×pY[SubWidthC×x][-SubHeightC]+(376)

[1952] F3[2][1]×pY[SubWidthC×x+1][-SubHeightC]+

[1953] F3[1][2]×pY[SubWidthC×x][1-SubHeightC]+4)>>3

[1954] — Otherwise (bCTUboundary is TRUE), the following applies:

[1955] pSelDsY[idx]=(F2[0]×pY[SubWidthC×x-1][-1]+

[1956] F2[1]×pY[SubWidthC×x][-1]+(377)

[1957] F2[2]×pY[SubWidthC×x+1][-1]+2)>>2

[1958] Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies:

[1959] If bCTUboundary is equal to FALSE, the following applies:

[1960] pSelDsY[idx]=(F4[0][1]×pY[SubWidthC x-1][-1]+

[1961] F4[0][2]×pY[SubWidthC×x-1][-2]+

[1962] F4[1][1]×pY[SubWidthC×x][-1]+(378)

[1963] F4[1][2]×pY[SubWidthC×x][-2]+

[1964] F4[2][1]×pY[SubWidthC×x+1][-1]+

[1965] F4[2][2]×pY[SubWidthC×x+1][-2]+4)>>3

[1966] — Otherwise (bCTUboundary is TRUE), the following applies:

[1967] pSelDsY[idx]=(F2[0]×pY[SubWidthC×x-1][-1]+

[1968] F2[1]×pY[SubWidthC×x][-1]+(379)

[1969] F2[2]×pY[SubWidthC×x+1][-1]+2)>>2

[1970] 6. When cntT+cntL is not equal to 0, the variables minY, maxY, minC, and maxC are derived as follows:

[1971] —When cntT+cntL is equal to 2, pSelComp[3] is set equal to pSelComp[0], pSelComp[2] is set equal to pSelComp[1], pSelComp[0] is set equal to pSelComp[1], pSelComp[1] is set equal to pSelComp[3], and Comp is replaced by DsY and C.

[1972] —The arrays minGrpIdx and maxGrpIdx are derived as follows:

[1973] minGrpIdx[0]=0 (380)

[1974] minGrpIdx[1]=2 (381)

[1975] maxGrpIdx[0]=1 (382)

[1976] maxGrpIdx[1]=3 (383)

[1977] —When pSelDsY[minGrpIdx[0]] is greater than pSelDsY[minGrpIdx[1]], minGrpIdx[0] and minGrpIdx[1] are swapped as follows:

[1978] (minGrpIdx[0], minGrpIdx[1])=Swap(minGrpIdx[0], minGrpIdx[1]) (384)

[1980] —When pSelDsY[maxGrpIdx[0]] is greater than pSelDsY[maxGrpIdx[1]], maxGrpIdx[0] and maxGrpIdx[1] are swapped as follows:

[1981] (maxGrpIdx[0], maxGrpIdx[1])=Swap(maxGrpIdx[0], maxGrpIdx[1]) (385)

[1983] —When pSelDsY[minGrpIdx[0]] is greater than pSelDsY[maxGrpIdx[1]], the arrays minGrpIdx and maxGrpIdx are swapped as follows:

[1984] (minGrpIdx, maxGrpIdx) = Swap (minGrpIdx, maxGrpIdx) (386)

[1985] —When pSelDsY[minGrpIdx[1]] is greater than pSelDsY[maxGrpIdx[0]], minGrpIdx[1] and maxGrpIdx[0] are swapped as follows:

[1986] (minGrpIdx[1], maxGrpIdx[0])=Swap(minGrpIdx[1], maxGrpIdx[0]) (387)

[1988] —The variables maxY, maxC, minY, and minC are derived as follows:

[1989] maxY=(pSelDsY[maxGrpIdx[0]]+pSelDsY[maxGrpIdx[1]]+1)>>1 (388)

[1991] maxC=(pSelC[maxGrpIdx[0]]+pSelC[maxGrpIdx[1]]+1)>>1 (389)

[1993] minY=(pSelDsY[minGrpIdx[0]]+pSelDsY[minGrpIdx[1]]+1)>>1 (390)

[1995] minC=(pSelC[minGrpIdx[0]]+pSelC[minGrpIdx[1]]+1)>>1 (391)

[1996] 7. The variables a, b, and k are derived as follows:

[1997] — If numSampL is equal to 0 and numSampT is equal to 0, then the following applies:

[1998] k=0 (392)

[1999] a=0 (393)

[2000] b=1<<(BitDepth-1) (394)

[2001] — Otherwise, the following applies:

[2002] diff=maxY-minY (395)

[2003] — If diff is not equal to 0, the following applies:

[2004] diffC=maxC-minC (396)

[2005] x=Floor(Log2(diff)) (397)

[2006] normDiff=((diff<<4)>>x)&15 (398)

[2007] x+=(normDiff!=0)? 1:0 (399)

[2008] y=Abs(diffC)>0? Floor(Log2(Abs(diffC)))+1:0 (400)

[2009] a=(diffC×(divSigTable[normDiff]|8)+2 y - 1 )>>y (401)

[2010] k=((3+xy)<1)? 1:3+xy (402)

[2011] a=((3+xy)<1)? Sign(a)×15:a (403)

[2012] b=minC-((a×minY)>>k) (404)

[2013] where divSigTable[] is specified as follows:

[2014] divSigTable[]={0, 7, 6, 5, 5, 4, 4, 3, 3, 2, 2, 1, 1, 1, 1, 0} (405)

[2015] — Otherwise (diff is equal to 0), the following applies:

[2016] k=0 (406)

[2017] a=0 (407)

[2018] b=minC (408)

[2019] 8. The predicted sample point predSample[x][y], where x = 0..nTbW-1 and y = 0..nTbH-1, is derived as follows:

[2020] predSamples[x][y]=Clip1(((pDsY[x][y]×a)>>k)+b) (409)

[2021] NOTE - This process uses sps_chroma_vertical_collocated_flag. However, to simplify the implementation, it does not use sps_chroma_horizontal_collocated_flag.

[2022] Example 11

[2023] The working draft specified in JVET-Q2001-vE may be modified as follows. 8.4.5.2.13

[2025] The inputs to this process are:

[2026] —Intra prediction mode predModeIntra,

[2027] - the sample position of the upper left sample of the current transform block relative to the upper left sample of the current picture (xTbC, yTbC),

[2028] - variable nTbW specifying the transform block width,

[2029] — variable nTbH specifying the transform block height,

[2030] — variable cIdx specifying the color component of the current block,

[2031] - Chroma neighboring samples p[x][y], where x = -1, y = 0..2×nTbH-1, and x = 0..2×nTbW-1, y = -1.

[2032] The output of this process is the predicted samples predSamples[x][y], where x = 0..nTbW-1, y = 0..nTbH-1.

[2033] The current brightness position (xTbY, yTbY) is derived as follows:

[2034] (xTbY, yTbY) = (xTbC<<(SubWidthC-1), yTbC<<(SubHeightC-1))(351)

[2035] The variables availL, availT, and availTL are derived as follows:

[2036] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using as input the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY-1, yTbY), checkPredModeY set equal to false (FLASE), and cIdx, and assign the output to availL.

[2037] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY, yTbY-1), checkPredModeY set equal to false (FLASE), and cIdx as input, and assign the output to availT.

[2038] [[—The variable availTL is derived as follows:

[2039] availTL=availL&&availT (352)]]

[2040] The number of available top-right adjacent chroma samples numTopRight is derived as follows:

[2041] —The variable numTopRight is set to 0, and availTR is set to true (TRUE).

[2042] - When predModeIntra is equal to INTRA_T_CCLM, the following applies for x=nTbW..2×nTbW-1 until availTR is equal to FALSE or x is equal to 2×nTbW-1:

[2043] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using as input the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY+x, yTbY-1), checkPredModeY set equal to false (FLASE), and cIdx, and assign the output to availTR.

[2044] —When availTR is equal to true (TRUE), numTopRight is increased by 1.

[2045] The number of available lower left adjacent chroma samples numLeftBelow is derived as follows:

[2046] —The variable numLeftBelow is set to 0, and availLB is set to true (TRUE).

[2047] When predModeIntra is equal to INTRA_L_CCLM, the following applies for y=nTbH..2×nTbH-1 until availLB is equal to FALSE or y is equal to 2×nTbH-1:

[2048] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY-1, yTbY+y), checkPredModeY set equal to false (FLASE), and cIdx as input, and assign the output to availLB.

[2049] —When availLB is equal to TRUE, numLeftBelow is increased by 1.

[2050] The number of available adjacent chroma samples numSampT at the top and upper right and the number of available adjacent chroma samples numSampL at the left and lower left are derived as follows:

[2051] If predModeIntra is equal to INTRA_LT_CCLM, the following applies:

[2052] numSampT=availT? nTbW:0 (353)

[2053] numSampL=availL? nTbH:0 (354)

[2054] — Otherwise, the following applies:

[2055] numSampT=(availT&&predModeIntra==INTRA_T_CCLM)? (nTbW+Min(numTopRight,nTbH)):0 (355)

[2056] numSampL=(availL&&predModeIntra==INTRA_L_CCLM)? (nTbH+Min(numLeftBelow,nTbW)):0 (356)

[2057] The variable bCTUboundary is derived as follows:

[2058] bCTUboundary=(yTbY&(CtbSizeY-1)==0)? TRUE:FALSE (357)

[2059] The variable cntN and array pickPosN, where N is replaced by L and T, are derived as follows:

[2060] —The variable numIs4N is derived as follows:

[2061] numIs4N=((availT&&availL&&predModeIntra==INTRA_LT_CCLM)?0:1)(358)

[2062] —The variable startPosN is set equal to numSampN>>(2+numIs4N).

[2063] - The variable pickStepN is set equal to Max(1, numSampN>>(1+numIs4N)).

[2064] —If availN is equal to TRUE and predModeIntra is equal to INTRA_LT_CCLM or INTRA_N_CCLM, then the following assignments are made:

[2065] —cntN is set equal to Min(numSampN, (1+numIs4N)<<1).

[2066] - pickPosN[pos] is set equal to (startPosN+pos×pickStepN), where pos=0..cntN-1.

[2067] Otherwise, cntN is set equal to 0.

[2068] The predicted sample point predSample[x][y], where x = 0..nTbW-1 and y = 0..nTbH-1, is derived as follows:

[2069] — If numSampL and numSampT are both equal to 0, then the following applies:

[2070] predSamples[x][y]=1<<(BitDepth-1) (359)

[2071] — Otherwise, the following ordered steps apply:

[2072] 1. The co-located luma sample pY[x][y] where x=0..nTbW×SubWidthC-1, y=0..TbH×SubHeightC-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).

[2073] 2. The adjacent brightness samples pY[x][y] are derived as follows:

[2074] —When numSampL is greater than 0, the adjacent left luma sample pY[x][y] where x=-1..-3, y=0..SubHeightC×numSampL-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).

[2075] - When availT is equal to FALSE, the adjacent top luma sample pY[x][y] where x = -1..SubWidthC×numSampT-1, y = -1..-2 is set equal to luma sample pY[x][0].

[2076] - When availL is equal to FALSE, the adjacent left luma sample pY[x][y] where x = -1..-3, y = -1..SubHeightC×numSampL-1 is set equal to the luma sample pY[0][y].

[2077] When numSampT is greater than 0, the adjacent top luma sample pY[x][y] where x=0..SubWidthC×numSampT-1, y=-1..-2 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).

[2078] [[—When availTL is equal to TRUE, the adjacent upper left luma sample pY[x][y] with x=-1, y=-1, -2 is set equal to the reconstructed luma sample at position (xTbY+x, yTbY+y) before the deblocking filtering process. ]]

[2079] - If availT is equal to true, then the adjacent upper left luma sample pY[x][y] with x=-1,-2, y=-1,-2 is set equal to the luma sample pY[0][y].

[2080] Otherwise, if availL is equal to true, then the adjacent upper left luma sample pY[x][y] with x=-1,-2, y=-1,-2 is set equal to the luma sample pY[x][0].

[2081] 3. The downsampled co-located luminance sample pDsY[x][y], where x = 0..nTbW-1 and y = 0..nTbH-1, is derived as follows:

[2082] If SubWidthC and SubHeightC are both equal to 1, then the following applies:

[2083] —pDsY[x][y], x=1..nTbW-1, y=1..nTbH-1 is derived as follows:

[2084] pDstY[x][y]=pY[x][y] (360)

[2085] — Otherwise, the following applies:

[2086] —The one-dimensional filter coefficient arrays F1 and F2 and the two-dimensional filter coefficient arrays F3 and F4 are specified as follows.

[2087] F1[0]=2,F1[1]=0 (361)

[2088] F2[0]=1,F2[1]=2,F2[2]=1 (362)

[2089] F3[i][j]=F4[i][j]=0, ​​where i=0..2, j=0..2 (363)

[2090] If SubWidthC and SubHeightC are both equal to 2, then the following applies:

[2091] F1[0]=1,F1[1]=1 (364)

[2092] F3[0][1]=1,F3[1][1]=4,F3[2][1]=1,F3[1][0]=1,F3[1][2]=1 (365)

[2093] F4[0][1]=1,F4[1][1]=2,F4[2][1]=1 (366)

[2094] F4[0][2]=1,F4[1][2]=2,F4[2][2]=1 (367)

[2095] — Otherwise, the following applies:

[2096] F3[1][1]=8 (368)

[2097] F4[0][1]=2, F4[1][1]=4, F4[2][1]=2, (369)

[2098] - If sps_chroma_vertical_collocated_flag is equal to 1, the following applies:

[2099] pDsY[x][y], where x = 0..nTbW-1, y = 0..nTbH-1 is derived as follows:

[2100] pDsY[x][y]=(F3[1][0]×pY[SubWidthC×x][SubHeightC×y-1]+

[2101] F3[0][1]×pY[SubWidthC×x-1][SubHeightC×y]+

[2102] F3[1][1]×pY[SubWidthC×x][SubHeightC×y]+(370)

[2103] F3[2][1]×pY[SubWidthC×x+1][SubHeightC×y]+

[2104] F3[1][2]×pY[SubWidthC×x][SubHeightC×y+1]+4)>>3

[2105] Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies:

[2106] pDsY[x][y], where x = 0..nTbW-1, y = 0..nTbH-1 is derived as follows:

[2107] pDsY[x][y]=(F4[0][1]×pY[SubWidthC×x-1][SubHeightC×y]+

[2108] F4[0][2]×pY[SubWidthC×x-1][SubHeightC×y+1]+

[2109] F4[1][1]×pY[SubWidthC×x][SubHeightC×y]+(371)

[2110] F4[1][2]×pY[SubWidthC×x][SubHeightC×y+1]+

[2111] F4[2][1]×pY[SubWidthC×x+1][SubHeightC×y]+

[2112] F4[2][2]×pY[SubWidthC×x+1][SubHeightC×y+1]+4)>>3

[2113] 4. When numSampL is greater than 0, the selected adjacent left chroma sample pSelC[idx] is set equal to p[-1][pickPosL[idx]], where idx = 0..cntL-1, and the selected downsampled adjacent left luma sample pSelDsY[idx], where idx = 0..cntL-1, is derived as follows:

[2114] —The variable y is set equal to pickPosL[idx].

[2115] If SubWidthC and SubHeightC are both equal to 1, then the following applies:

[2116] pSelDsY[idx]=pY[-1][y] (372)

[2117] — Otherwise, the following applies:

[2118] - If sps_chroma_vertical_collocated_flag is equal to 1, the following applies:

[2119] pSelDsY[idx]=(F3[1][0]×pY[-SubWidthC][SubHeightC×y-1]+

[2120] F3[0][1]×pY[-1-SubWidthC][SubHeightC×y]+

[2121] F3[1][1]×pY[-SubWidthC][SubHeightC×y]+(373)

[2122] F3[2][1]×pY[1-SubWidthC][SubHeightC×y]+

[2123] F3[1][2]×pY[-SubWidthC][SubHeightC×y+1]+4)>>3

[2124] Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies:

[2125] pSelDsY[idx]=(F4[0][1]×pY[-1-SubWidthC][SubHeightC×y]+

[2126] F4[0][2]×pY[-1-SubWidthC][SubHeightC×y+1]+

[2127] F4[1][1]×pY[-SubWidthC][SubHeightC×y]+(374)

[2128] F4[1][2]×pY[-SubWidthC][SubHeightC×y+1]+

[2129] F4[2][1]×pY[1-SubWidthC][SubHeightC×y]+

[2130] F4[2][2]×pY[1-SubWidthC][SubHeightC×y+1]+4)>>3

[2131] 5. When numSampT is greater than 0, the selected adjacent top chroma sample pSelC[idx] is set equal to p[pickPosT[idx-cntL]][-1], where idx=cntL..cntL+cntT-1, and the downsampled adjacent top luma sample pSelDsY[idx], where idx=0..cntL+cntT-1 is specified as follows:

[2132] —The variable x is set equal to pickPosT[idx-cntL].

[2133] If SubWidthC and SubHeightC are both equal to 1, then the following applies:

[2134] pSelDsY[idx]=pY[x][-1] (375)

[2135] — Otherwise, the following applies:

[2136] - If sps_chroma_vertical_collocated_flag is equal to 1, the following applies:

[2137] If bCTUboundary is equal to FALSE, the following applies:

[2138] pSelDsY[idx]=(F3[1][0]×pY[SubWidthC×x][-1-SubHeightC]+

[2139] F3[0][1]×pY[SubWidthC×x-1][-SubHeightC]+

[2140] F3[1][1]×pY[SubWidthC×x][-SubHeightC]+(376)

[2141] F3[2][1]×pY[SubWidthC×x+1][-SubHeightC]+

[2142] F3[1][2]×pY[SubWidthC×x][1-SubHeightC]+4)>>3

[2143] — Otherwise (bCTUboundary is TRUE), the following applies:

[2144] pSelDsY[idx]=(F2[0]×pY[SubWidthC×x-1][-1]+

[2145] F2[1]×pY[SubWidthC×x][-1]+(377)

[2146] F2[2]×pY[SubWidthC×x+1][-1]+2)>>2

[2147] Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies:

[2148] If bCTUboundary is equal to FALSE, the following applies:

[2149] pSelDsY[idx]=(F4[0][1]×pY[SubWidthC x-1][-1]+

[2150] F4[0][2]×pY[SubWidthC×x-1][-2]+

[2151] F4[1][1]×pY[SubWidthC×x][-1]+(378)

[2152] F4[1][2]×pY[SubWidthC×x][-2]+

[2153] F4[2][1]×pY[SubWidthC×x+1][-1]+

[2154] F4[2][2]×pY[SubWidthC×x+1][-2]+4)>>3

[2155] — Otherwise (bCTUboundary is TRUE), the following applies:

[2156] pSelDsY[idx]=(F2[0]×pY[SubWidthC×x-1][-1]+

[2157] F2[1]×pY[SubWidthC×x][-1]+(379)

[2158] F2[2]×pY[SubWidthC×x+1][-1]+2)>>2

[2159] 6. When cntT+cntL is not equal to 0, the variables minY, maxY, minC, and maxC are derived as follows:

[2160] —When cntT+cntL is equal to 2, pSelComp[3] is set equal to pSelComp[0], pSelComp[2] is set equal to pSelComp[1], pSelComp[0] is set equal to pSelComp[1], pSelComp[1] is set equal to pSelComp[3], and Comp is replaced by DsY and C.

[2161] —The arrays minGrpIdx and maxGrpIdx are derived as follows:

[2162] minGrpIdx[0]=0 (380)

[2163] minGrpIdx[1]=2 (381)

[2164] maxGrpIdx[0]=1 (382)

[2165] maxGrpIdx[1]=3 (383)

[2166] —When pSelDsY[minGrpIdx[0]] is greater than pSelDsY[minGrpIdx[1]], minGrpIdx[0] and minGrpIdx[1] are swapped as follows:

[2167] (minGrpIdx[0], minGrpIdx[1])=Swap(minGrpIdx[0], minGrpIdx[1]) (384)

[2169] —When pSelDsY[maxGrpIdx[0]] is greater than pSelDsY[maxGrpIdx[1]], maxGrpIdx[0] and maxGrpIdx[1] are swapped as follows:

[2170] (maxGrpIdx[0], maxGrpIdx[1])=Swap(maxGrpIdx[0], maxGrpIdx[1]) (385)

[2172] —When pSelDsY[minGrpIdx[0]] is greater than pSelDsY[maxGrpIdx[1]], the arrays minGrpIdx and maxGrpIdx are swapped as follows:

[2173] (minGrpIdx, maxGrpIdx) = Swap (minGrpIdx, maxGrpIdx) (386)

[2174] —When pSelDsY[minGrpIdx[1]] is greater than pSelDsY[maxGrpIdx[0]], minGrpIdx[1] and maxGrpIdx[0] are swapped as follows:

[2175] (minGrpIdx[1], maxGrpIdx[0])=Swap(minGrpIdx[1], maxGrpIdx[0]) (387)

[2177] —The variables maxY, maxC, minY, and minC are derived as follows:

[2178] maxY=(pSelDsY[maxGrpIdx[0]]+pSelDsY[maxGrpIdx[1]]+1)>>1 (388)

[2180] maxC=(pSelC[maxGrpIdx[0]]+pSelC[maxGrpIdx[1]]+1)>>1 (389)

[2182] minY=(pSelDsY[minGrpIdx[0]]+pSelDsY[minGrpIdx[1]]+1)>>1 (390)

[2184] minC=(pSelC[minGrpIdx[0]]+pSelC[minGrpIdx[1]]+1)>>1 (391)

[2185] 7. The variables a, b, and k are derived as follows:

[2186] — If numSampL is equal to 0 and numSampT is equal to 0, then the following applies:

[2187] k=0(392)

[2188] a=0(393)

[2189] b=1<<(BitDepth-1) (394)

[2190] — Otherwise, the following applies:

[2191] diff=maxY-minY (395)

[2192] — If diff is not equal to 0, the following applies:

[2193] diffC=maxC-minC (396)

[2194] x=Floor(Log2(diff)) (397)

[2195] normDiff=((diff<<4)>>x)&15 (398)

[2196] x+=(normDiff!=0)? 1:0 (399)

[2197] y=Abs(diffC)>0? Floor(Log2(Abs(diffC)))+1:0 (400)

[2198] a=(diffC×(divSigTable[normDiff]|8)+2 y - 1 )>>y (401)

[2199] k=((3+xy)<1)? 1:3+xy (402)

[2200] a=((3+xy)<1)? Sign(a)×15:a (403)

[2201] b=minC-((a×minY)>>k) (404)

[2202] where divSigTable[] is specified as follows:

[2203] divSigTable[]={0, 7, 6, 5, 5, 4, 4, 3, 3, 2, 2, 1, 1, 1, 1, 0} (405)

[2204] — Otherwise (diff is equal to 0), the following applies:

[2205] k=0 (406)

[2206] a=0 (407)

[2207] b=minC (408)

[2208] 8. The predicted sample point predSample[x][y], where x = 0..nTbW-1 and y = 0..nTbH-1, is derived as follows:

[2209] predSamples[x][y]=Clip1(((pDsY[x][y]×a)>>k)+b) (409)

[2210] NOTE - This process uses sps_chroma_vertical_collocated_flag. However, to simplify the implementation, it does not use sps_chroma_horizontal_collocated_flag.

[2211] 5.12. Example 12

[2212] The working draft specified in JVET-Q2001-vE may be modified as follows. 8.4.5.2.13

[2214] The inputs to this process are:

[2215] —Intra prediction mode predModeIntra,

[2216] - the sample position of the upper left sample of the current transform block relative to the upper left sample of the current picture (xTbC, yTbC),

[2217] - variable nTbW specifying the transform block width,

[2218] — variable nTbH specifying the transform block height,

[2219] — variable cIdx specifying the color component of the current block,

[2220] - Chroma neighboring samples p[x][y], where x = -1, y = 0..2×nTbH-1, and x = 0..2×nTbW-1, y = -1.

[2221] The output of this process is the predicted samples predSamples[x][y], where x = 0..nTbW-1, y = 0..nTbH-1.

[2222] The current brightness position (xTbY, yTbY) is derived as follows:

[2223] (xTbY, yTbY) = (xTbC<<(SubWidthC-1), yTbC<<(SubHeightC-1)) (351)

[2225] The variables availL, availT, and availTL are derived as follows:

[2226] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using as input the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY-1, yTbY), checkPredModeY set equal to false (FLASE), and cIdx, and assign the output to availL.

[2227] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY, yTbY-1), checkPredModeY set equal to false (FLASE), and cIdx as input, and assign the output to availT.

[2228] —The variable availTL is derived as follows:

[2229] availTL=availL&&availT (352)

[2230] The number of available top-right adjacent chroma samples numTopRight is derived as follows:

[2231] —The variable numTopRight is set to 0, and availTR is set to true (TRUE).

[2232] - When predModeIntra is equal to INTRA_T_CCLM, the following applies for x=nTbW..2×nTbW-1 until availTR is equal to FALSE or x is equal to 2×nTbW-1:

[2233] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using as input the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY+x, yTbY-1), checkPredModeY set equal to false (FLASE), and cIdx, and assign the output to availTR.

[2234] —When availTR is equal to true (TRUE), numTopRight is increased by 1.

[2235] The number of available lower left adjacent chroma samples numLeftBelow is derived as follows:

[2236] —The variable numLeftBelow is set to 0, and availLB is set to true (TRUE).

[2237] When predModeIntra is equal to INTRA_L_CCLM, the following applies for y=nTbH..2×nTbH-1 until availLB is equal to FALSE or y is equal to 2×nTbH-1:

[2238] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY-1, yTbY+y), checkPredModeY set equal to false (FLASE), and cIdx as input, and assign the output to availLB.

[2239] —When availLB is equal to TRUE, numLeftBelow is increased by 1.

[2240] The number of available adjacent chroma samples numSampT at the top and upper right and the number of available adjacent chroma samples numSampL at the left and lower left are derived as follows:

[2241] If predModeIntra is equal to INTRA_LT_CCLM, the following applies:

[2242] numSampT=availT? nTbW:0 (353)

[2243] numSampL=availL? nTbH:0 (354)

[2244] — Otherwise, the following applies:

[2245] numSampT=(availT&&predModeIntra==INTRA_T_CCLM)? (nTbW+Min(numTopRight,nTbH)):0 (355)

[2246] numSampL=(availL&&predModeIntra==INTRA_L_CCLM)?(nTbH+Min(numLeftBelow, nTbW)):0 (356) The variable bCTUboundary is derived as follows:

[2247] bCTUboundary=(yTbY&(CtbSizeY-1)==0)? TRUE:FALSE (357)

[2248] The variable cntN and array pickPosN, where N is replaced by L and T, are derived as follows:

[2249] —The variable numIs4N is derived as follows:

[2250] numIs4N=((availT&&availL&&predModeIntra==INTRA_LT_CCLM)?0:1)(358)

[2251] —The variable startPosN is set equal to numSampN>>(2+numIs4N).

[2252] - The variable pickStepN is set equal to Max(1, numSampN>>(1+numIs4N)).

[2253] —If availN is equal to TRUE and predModeIntra is equal to INTRA_LT_CCLM or INTRA_N_CCLM, then the following assignments are made:

[2254] —cntN is set equal to Min(numSampN, (1+numIs4N)<<1).

[2255] - pickPosN[pos] is set equal to (startPosN+pos×pickStepN), where pos=0..cntN-1.

[2256] Otherwise, cntN is set equal to 0.

[2257] The predicted sample point predSample[x][y], where x = 0..nTbW-1 and y = 0..nTbH-1, is derived as follows:

[2258] — If numSampL and numSampT are both equal to 0, then the following applies:

[2259] predSamples[x][y]=1<<(BitDepth-1) (359)

[2260] — Otherwise, the following ordered steps apply:

[2261] 1. The co-located luma sample pY[x][y] where x=0..nTbW×SubWidthC-1, y=0..TbH×SubHeightC-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).

[2262] 2. The adjacent brightness samples pY[x][y] are derived as follows:

[2263] —When numSampL is greater than 0, the adjacent left luma sample pY[x][y] where x=-1..-3, y=0..SubHeightC×numSampL-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).

[2264] - When availT is equal to FALSE, the adjacent top luma sample pY[x][y] where x = -1..SubWidthC×numSampT-1, y = -1..-2 is set equal to luma sample pY[x][0].

[2265] - When availL is equal to FALSE, the adjacent left luma sample pY[x][y] where x = -1..-3, y = -1..SubHeightC×numSampL-1 is set equal to the luma sample pY[0][y].

[2266] - When numSampT is greater than 0, where x = 0..SubWidthC×numSampT-1, y = -1..- The adjacent top luma sample pY[x][y] of 3 is set equal to the reconstructed luma sample before the deblocking filtering process at the position (xTbY+x, yTbY+y).

[2267] —When availTL is equal to true (TRUE), the adjacent upper left luma sample pY[x][y] where x=-1,-2, y=-1,-2 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).

[2268] 3. The downsampled co-located luminance sample pDsY[x][y], where x = 0..nTbW-1 and y = 0..nTbH-1, is derived as follows:

[2269] If SubWidthC and SubHeightC are both equal to 1, then the following applies:

[2270] —pDsY[x][y], x=1..nTbW-1, y=1..nTbH-1 is derived as follows:

[2271] pDstY[x][y]=pY[x][y] (360)

[2272] — Otherwise, the following applies:

[2273] —The one-dimensional filter coefficient arrays F1 and F2 and the two-dimensional filter coefficient arrays F3 and F4 are specified as follows.

[2274] F1[0]=2,F1[1]=0 (361)

[2275] F2[0]=1,F2[1]=2,F2[2]=1 (362)

[2276] F3[i][j]=F4[i][j]=0, ​​where i=0..2, j=0..2 (363)

[2277] If SubWidthC and SubHeightC are both equal to 2, then the following applies:

[2278] F1[0]=1,F1[1]=1 (364)

[2279] F3[0][1]=1,F3[1][1]=4,F3[2][1]=1,F3[1][0]=1,F3[1][2]=1 (365)

[2280] F4[0][1]=1,F4[1][1]=2,F4[2][1]=1 (366)

[2281] F4[0][2]=1,F4[1][2]=2,F4[2][2]=1 (367)

[2282] — Otherwise, the following applies:

[2283] F3[1][1]=8 (368)

[2284] F4[0][1]=2, F4[1][1]=4, F4[2][1]=2, (369)

[2285] - If sps_chroma_vertical_collocated_flag is equal to 1, the following applies:

[2286] —pDsY[x][y], where x=0..nTbW-1, y=0..nTbH-1 is derived as follows:

[2287] pDsY[x][y]=(F3[1][0]×pY[SubWidthC×x][SubHeightC×y-1]+

[2288] F3[0][1]×pY[SubWidthC×x-1][SubHeightC×y]+

[2289] F3[1][1]×pY[SubWidthC×x][SubHeightC×y]+(370)

[2290] F3[2][1]×pY[SubWidthC×x+1][SubHeightC×y]+

[2291] F3[1][2]×pY[SubWidthC×x][SubHeightC×y+1]+4)>>3

[2292] Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies:

[2293] —pDsY[x][y] where x=0..nTbW-1, y=0..nTbH-1 is derived as follows:

[2294] pDsY[x][y]=(F4[0][1]×pY[SubWidthC×x-1][SubHeightC×y]+

[2295] F4[0][2]×pY[SubWidthC×x-1][SubHeightC×y+1]+

[2296] F4[1][1]×pY[SubWidthC×x][SubHeightC×y]+(371)

[2297] F4[1][2]×pY[SubWidthC×x][SubHeightC×y+1]+

[2298] F4[2][1]×pY[SubWidthC×x+1][SubHeightC×y]+

[2299] F4[2][2]×pY[SubWidthC×x+1][SubHeightC×y+1]+4)>>3

[2300] 4. When numSampL is greater than 0, the selected adjacent left chroma sample pSelC[idx] is set equal to p[-1][pickPosL[idx]], where idx = 0..cntL-1, and the selected downsampled adjacent left luma sample pSelDsY[idx], where idx = 0..cntL-1, is derived as follows:

[2301] —The variable y is set equal to pickPosL[idx].

[2302] If SubWidthC and SubHeightC are both equal to 1, then the following applies:

[2303] pSelDsY[idx]=pY[-1][y] (372)

[2304] — Otherwise, the following applies:

[2305] - If sps_chroma_vertical_collocated_flag is equal to 1, the following applies:

[2306] pSelDsY[idx]=(F3[1][0]×pY[-SubWidthC][SubHeightC×y-1]+

[2307] F3[0][1]×pY[-1-SubWidthC][SubHeightC×y]+

[2308] F3[1][1]×pY[-SubWidthC][SubHeightC×y]+(373)

[2309] F3[2][1]×pY[1-SubWidthC][SubHeightC×y]+

[2310] F3[1][2]×pY[-SubWidthC][SubHeightC×y+1]+4)>>3

[2311] Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies:

[2312] pSelDsY[idx]=(F4[0][1]×pY[-1-SubWidthC][SubHeightC×y]+

[2313] F4[0][2]×pY[-1-SubWidthC][SubHeightC×y+1]+

[2314] F4[1][1]×pY[-SubWidthC][SubHeightC×y]+(374)

[2315] F4[1][2]×pY[-SubWidthC][SubHeightC×y+1]+

[2316] F4[2][1]×pY[1-SubWidthC][SubHeightC×y]+

[2317] F4[2][2]×pY[1-SubWidthC][SubHeightC×y+1]+4)>>3

[2318] 5. When numSampT is greater than 0, the selected adjacent top chroma sample pSelC[idx] is set equal to p[pickPosT[idx-cntL]][-1], where idx=cntL..cntL+cntT-1, and the downsampled adjacent top luma sample pSelDsY[idx], where idx=0..cntL+cntT-1 is specified as follows:

[2319] —The variable x is set equal to pickPosT[idx-cntL].

[2320] If SubWidthC and SubHeightC are both equal to 1, then the following applies:

[2321] pSelDsY[idx]=pY[x][-1] (375)

[2322] — Otherwise, the following applies:

[2323] - If sps_chroma_vertical_collocated_flag is equal to 1, the following applies:

[2324] If bCTUboundary is equal to FALSE, the following applies:

[2325] pSelDsY[idx]=(F3[1][0]×pY[SubWidthC×x][-1-SubHeightC]+

[2326] F3[0][1]×pY[SubWidthC×x-1][-SubHeightC]+

[2327] F3[1][1]×pY[SubWidthC×x][-SubHeightC]+(376)

[2328] F3[2][1]×pY[SubWidthC×x+1][-SubHeightC]+

[2329] F3[1][2]×pY[SubWidthC×x][1-SubHeightC]+4)>>3

[2330] — Otherwise (bCTUboundary is TRUE), the following applies:

[2331] pSelDsY[idx]=(F2[0]×pY[SubWidthC×x-1][-1]+

[2332] F2[1]×pY[SubWidthC×x][-1]+(377)

[2333] F2[2]×pY[SubWidthC×x+1][-1]+2)>>2

[2334] Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies:

[2335] If bCTUboundary is equal to FALSE, the following applies:

[2336] pSelDsY[idx]=(F4[0][1]×pY[SubWidthC x-1][-1]+

[2337] F4[0][2]×pY[SubWidthC×x-1][-2]+

[2338] F4[1][1]×pY[SubWidthC×x][-1]+(378)

[2339] F4[1][2]×pY[SubWidthC×x][-2]+

[2340] F4[2][1]×pY[SubWidthC×x+1][-1]+

[2341] F4[2][2]×pY[SubWidthC×x+1][-2]+4)>>3

[2342] — Otherwise (bCTUboundary is TRUE), the following applies:

[2343] pSelDsY[idx]=(F2[0]×pY[SubWidthC×x-1][-1]+

[2344] F2[1]×pY[SubWidthC×x][-1]+(379)

[2345] F2[2]×pY[SubWidthC×x+1][-1]+2)>>2

[2346] 6. When cntT+cntL is not equal to 0, the variables minY, maxY, minC, and maxC are derived as follows:

[2347] —When cntT+cntL is equal to 2, pSelComp[3] is set equal to pSelComp[0], pSelComp[2] is set equal to pSelComp[1], pSelComp[0] is set equal to pSelComp[1], pSelComp[1] is set equal to pSelComp[3], and Comp is replaced by DsY and C.

[2348] —The arrays minGrpIdx and maxGrpIdx are derived as follows:

[2349] minGrpIdx[0]=0 (380)

[2350] minGrpIdx[1]=2 (381)

[2351] maxGrpIdx[0]=1 (382)

[2352] maxGrpIdx[1]=3 (383)

[2353] —When pSelDsY[minGrpIdx[0]] is greater than pSelDsY[minGrpIdx[1]], minGrpIdx[0] and minGrpIdx[1] are swapped as follows:

[2354] (minGrpIdx[0], minGrpIdx[1])=Swap(minGrpIdx[0], minGrpIdx[1]) (384)

[2356] —When pSelDsY[maxGrpIdx[0]] is greater than pSelDsY[maxGrpIdx[1]], maxGrpIdx[0] and maxGrpIdx[1] are swapped as follows:

[2357] (maxGrpIdx[0], maxGrpIdx[1])=Swap(maxGrpIdx[0], maxGrpIdx[1]) (385)

[2359] —When pSelDsY[minGrpIdx[0]] is greater than pSelDsY[maxGrpIdx[1]], the arrays minGrpIdx and maxGrpIdx are swapped as follows:

[2360] (minGrpIdx, maxGrpIdx) = Swap (minGrpIdx, maxGrpIdx) (386)

[2361] —When pSelDsY[minGrpIdx[1]] is greater than pSelDsY[maxGrpIdx[0]], minGrpIdx[1] and maxGrpIdx[0] are swapped as follows:

[2362] (minGrpIdx[1], maxGrpIdx[0])=Swap(minGrpIdx[1], maxGrpIdx[0]) (387)

[2364] —The variables maxY, maxC, minY, and minC are derived as follows:

[2365] maxY=(pSelDsY[maxGrpIdx[0]]+pSelDsY[maxGrpIdx[1]]+1)>>1 (388)

[2367] maxC=(pSelC[maxGrpIdx[0]]+pSelC[maxGrpIdx[1]]+1)>>1 (389)

[2369] minY=(pSelDsY[minGrpIdx[0]]+pSelDsY[minGrpIdx[1]]+1)>>1 (390)

[2371] minC=(pSelC[minGrpIdx[0]]+pSelC[minGrpIdx[1]]+1)>>1 (391)

[2372] 7. The variables a, b, and k are derived as follows:

[2373] — If numSampL is equal to 0 and numSampT is equal to 0, then the following applies:

[2374] k=0 (392)

[2375] a=0 (393)

[2376] b=1<<(BitDepth-1) (394)

[2377] — Otherwise, the following applies:

[2378] diff=maxY-minY (395)

[2379] — If diff is not equal to 0, the following applies:

[2380] diffC=maxC-minC (396)

[2381] x=Floor(Log2(diff)) (397)

[2382] normDiff=((diff<<4)>>x)&15 (398)

[2383] x+=(normDiff!=0)? 1:0(399)y=Abs(diffC)>0? Floor(Log2(Abs(diffC)))+1:0 (400)

[2384] a=(diffC×(divSigTable[normDiff]|8)+2 y - 1 )>>y (401)

[2385] k=((3+xy)<1)? 1:3+xy (402)

[2386] a=((3+xy)<1)? Sign(a)×15:a (403)

[2387] b=minC-((a×minY)>>k) (404)

[2388] where divSigTable[] is specified as follows:

[2389] divSigTable[]={0, 7, 6, 5, 5, 4, 4, 3, 3, 2, 2, 1, 1, 1, 1, 0} (405)

[2390] — Otherwise (diff is equal to 0), the following applies:

[2391] k=0 (406)

[2392] a=0 (407)

[2393] b=minC (408)

[2394] 8. The predicted sample point p redSample[x][y], where x = 0..nTbW-1 and y = 0..nTbH-1, is derived as follows:

[2395] predSamples[x][y]=Clip1(((pDsY[x][y]×a)>>k)+b) (409)

[2396] NOTE - This process uses sps_chroma_vertical_collocated_flag. However, to simplify the implementation, it does not use sps_chroma_horizontal_collocated_flag.

[2397] 5.13. Example 13

[2398] The working draft specified in JVET-Q2001-vE may be modified as follows.

[2399] 8.4.5.2.13 Specification of INTRA_LT_CCLM, INTRA_L_CCLM and INTRA_T_CCLM intra prediction modes

[2400] The predicted sample point predSample[x][y], where x = 0..nTbW-1 and y = 0..nTbH-1, is derived as follows:

[2401] — If numSampL and numSampT are both equal to 0, then the following applies:

[2402] predSamples[x][y]=1<<(BitDepth-1) (359)

[2403] — Otherwise, the following ordered steps apply:

[2404] 1. The co-located luma sample pY[x][y] where x=0..nTbW×SubWidthC-1, y=0..TbH×SubHeightC-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).

[2405] 2. The adjacent brightness samples pY[x][y] are derived as follows:

[2406] —When numSampL is greater than 0, the adjacent left luma sample pY[x][y] where x=-1..-3, y=0..SubHeightC×numSampL-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).

[2407] - When availT is equal to FALSE, the adjacent top luma sample pY[x][y] where x = -[[1]]SubWidthC..SubWidthC×[[numSampT]]nTbW-1, y = -1..-2 is set equal to luma sample pY[x][0].

[2408] - When availL is equal to FALSE, the adjacent left luma sample pY[x][y] where x = -1..-3, y = -1..SubHeightC×numSampL-1 is set equal to the luma sample pY[0][y].

[2409] When numSampT is greater than 0, the adjacent top luma sample pY[x][y] where x=0..SubWidthC×numSampT-1, y=-1..-2 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).

[2410] —When availTL is equal to true (TRUE), the adjacent upper left luma sample pY[x][y] where x=-1, y=-1, -2 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).

[2411] 5.14. Example 14

[2412] The working draft specified in JVET-Q2001-vE may be modified as follows.

[2413] 8.4.5.2.13 Specification of INTRA_LT_CCLM, INTRA_L_CCLM and INTRA_T_CCLM intra prediction modes

[2414] The predicted sample point predSample[x][y], where x = 0..nTbW-1 and y = 0..nTbH-1, is derived as follows:

[2415] — If numSampL and numSampT are both equal to 0, then the following applies:

[2416] predSamples[x][y]=1<<(BitDepth-1) (359)

[2417] — Otherwise, the following ordered steps apply:

[2418] 1. The co-located luma sample pY[x][y] where x=0..nTbW×SubWidthC-1, y=0..TbH×SubHeightC-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).

[2419] 2. The adjacent brightness samples pY[x][y] are derived as follows:

[2420] —When numSampL is greater than 0, the adjacent left luma sample pY[x][y] where x=-1..-3, y=0..SubHeightC×numSampL-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).

[2421] - When availT is equal to FALSE and sps_chroma_vertical_collocated_flag is equal to 0, the neighboring top luma sample pY[x][y] where x = -[[1]]SubWidthC..SubWidthC×[[numSampT]]nTbW-1, y = -1..-2 is set equal to luma sample pY[x][0].

[2422] When availL is equal to FALSE, the adjacent left luma sample pY[x][y] where x=-1..-3, y=-1..SubHeightC×numSampL-1 is set equal to the luma sample pY[0][y].

[2423] When numSampT is greater than 0, the adjacent top luma sample pY[x][y] where x=0..SubWidthC×numSampT-1, y=-1..-2 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).

[2424] —When availTL is equal to true (TRUE), the adjacent upper left luma sample pY[x][y] where x=-1, y=-1, -2 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).

[2425] 5.15. Example 15

[2426] The working draft specified in JVET-Q2001-vE may be modified as follows.

[2427] 8.4.5.2.13 Specification of INTRA_LT_CCLM, INTRA_L_CCLM and INTRA_T_CCLM intra prediction modes

[2428] The predicted sample point predSample[x][y], where x = 0..nTbW-1 and y = 0..nTbH-1, is derived as follows:

[2429] — If numSampL and numSampT are both equal to 0, then the following applies:

[2430] predSamples[x][y]=1<<(BitDepth-1) (359)

[2431] — Otherwise, the following ordered steps apply:

[2432] 1. The co-located luma sample pY[x][y] where x=0..nTbW×SubWidthC-1, y=0..TbH×SubHeightC-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).

[2433] 2. The adjacent brightness samples pY[x][y] are derived as follows:

[2434] —When numSampL is greater than 0, the adjacent left luma sample pY[x][y] where x=-1..-3, y=0..SubHeightC×numSampL-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).

[2435] - When availT is equal to FALSE, the adjacent top luma sample pY[x][y] where x = -1..SubWidthC×numSampT-1, y = -1..-2 is set equal to luma sample pY[x][0].

[2436] - When availL is equal to FALSE, the adjacent left luma sample pY[x][y] where x = -1..-3, y = [[1]]SubHeightC..SubHeightC×[[numSampL]]nTbH-1 is set equal to the luma sample pY[0][y].

[2437] When numSampT is greater than 0, the adjacent top luma sample pY[x][y] where x=0..SubWidthC×numSampT-1, y=-1..-2 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).

[2438] —When availTL is equal to true (TRUE), the adjacent upper left luma sample pY[x][y] where x=-1, y=-1, -2 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).

[2439] 5.16. Example 16

[2440] The working draft specified in JVET-Q2001-vE may be modified as follows.

[2441] 8.4.5.2.13 Specification of INTRA_LT_CCLM, INTRA_L_CCLM and INTRA_T_CCLM intra prediction modes

[2442] The predicted sample point predSample[x][y], where x = 0..nTbW-1 and y = 0..nTbH-1, is derived as follows:

[2443] — If numSampL and numSampT are both equal to 0, then the following applies:

[2444] predSamples[x][y]=1<<(BitDepth-1) (359)

[2445] — Otherwise, the following ordered steps apply:

[2446] 1. The co-located luma sample pY[x][y] where x=0..nTbW×SubWidthC-1, y=0..TbH×SubHeightC-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).

[2447] 2. The adjacent brightness samples pY[x][y] are derived as follows:

[2448] —When numSampL is greater than 0, the adjacent left luma sample pY[x][y] where x=-1..-3, y=0..SubHeightC×numSampL-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).

[2449] - When availT is equal to FALSE, the adjacent top luma sample pY[x][y] where x = -1..SubWidthC×numSampT-1, y = -1..-2 is set equal to luma sample pY[x][0].

[2450] —[[When availL is equal to FALSE, the adjacent left luma sample pY[x][y] where x = -1..-3, y = -1..SubHeightC×numSampL-1 is set equal to the luma sample pY[0][y]. ]]

[2451] When numSampT is greater than 0, the adjacent top luma sample pY[x][y] where x=0..SubWidthC×numSampT-1, y=-1..-2 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).

[2452] - When availL is equal to FALSE, the adjacent left luma sample pY[x][y] where x = -1..-3, y = -SubHeightC..SubHeightC×nTbH-1 is set equal to the luma sample pY[0][y].

[2453] —When availTL is equal to true (TRUE), the adjacent upper left luma sample pY[x][y] where x=-1, y=-1, -2 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).

[2454] 5.17. Example 17

[2455] The working draft specified in JVET-Q2001-vE may be modified as follows.

[2456] 8.4.5.2.13 Specification of INTRA_LT_CCLM, INTRA_L_CCLM and INTRA_T_CCLM intra prediction modes

[2457] The inputs to this process are:

[2458] —Intra prediction mode predModeIntra,

[2459] - the sample position of the upper left sample of the current transform block relative to the upper left sample of the current picture (xTbC, yTbC),

[2460] - variable nTbW specifying the transform block width,

[2461] — variable nTbH specifying the transform block height,

[2462] — variable cIdx specifying the color component of the current block,

[2463] - Chroma neighboring samples p[x][y], where x = -1, y = 0..2×nTbH-1, and x = 0..2×nTbW-1, y = -1.

[2464] The output of this process is the predicted samples predSamples[x][y], where x = 0..nTbW-1, y = 0..nTbH-1.

[2465] The current brightness position (xTbY, yTbY) is derived as follows:

[2466] (xTbY, yTbY) = (xTbC<<(SubWidthC-1), yTbC<<(SubHeightC-1)) (351)

[2468] The variables availL, availT, and availTL are derived as follows:

[2469] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using as input the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY-1, yTbY), checkPredModeY set equal to false (FLASE), and cIdx, and assign the output to availL.

[2470] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY, yTbY-1), checkPredModeY set equal to false (FLASE), and cIdx as input, and assign the output to availT.

[2471] — If availTL equals true and availT equals true, then the following applies:

[2472] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY-1, yTbY-1), checkPredModeY set equal to false (FLASE), and cIdx as input, and assign the output to availTL.

[2473] — Otherwise, availTL is set equal to false.

[2474] [[-The variable availTL is derived as follows:

[2475] availTL=availL&&availT (352)]]

[2476] 5.18. Example 18

[2477] The working draft specified in JVET-Q2001-vE may be modified as follows.

[2478] 8.4.5.2.13 Specification of INTRA_LT_CCLM, INTRA_L_CCLM and INTRA_T_CCLM intra prediction modes

[2479] The predicted sample point predSample[x][y], where x = 0..nTbW-1 and y = 0..nTbH-1, is derived as follows:

[2480] — If numSampL and numSampT are both equal to 0, then the following applies:

[2481] predSamples[x][y]=1<<(BitDepth-1) (359)

[2482] — Otherwise, the following ordered steps apply:

[2483] 1. The co-located luma sample pY[x][y] where x=0..nTbW×SubWidthC-1, y=0..TbH×SubHeightC-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).

[2484] 2. The adjacent brightness samples pY[x][y] are derived as follows:

[2485] —When numSampL is greater than 0, the adjacent left luma sample pY[x][y] where x=-1..-3, y=0..SubHeightC×numSampL-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).

[2486] - When availT is equal to FALSE, the adjacent top luma sample pY[x][y] where x = -1..SubWidthC×numSampT-1, y = -1..-2 is set equal to luma sample pY[x][0].

[2487] - When availL is equal to FALSE, the adjacent left luma sample pY[x][y] where x = -1..-3, y = -1..SubHeightC×numSampL-1 is set equal to the luma sample pY[0][y].

[2488] When numSampT is greater than 0, the adjacent top luma sample pY[x][y] where x=0..SubWidthC×numSampT-1, y=-1..-2 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).

[2489] [[-When availTL is equal to TRUE, the adjacent top-left luma sample pY[x][y] where x=-1, y=-1, -2 is set equal to the reconstructed luma sample at position (xTbY+x, yTbY+y) before the deblocking filtering process. ]]

[2490] —If both availL and availT are equal to TRUE, then the following applies:

[2491] - If availTL is equal to TRUE, the adjacent top left luma sample pY[x][y] where x = -1, -2, y = -1, -2 is set equal to the reconstructed luma sample at position (xTbY+x, yTbY+y) before the deblocking filtering process.

[2492] Otherwise, the adjacent upper left luma sample pY[x][y] with x=-1,-2, y=-1,-2 is set equal to the luma sample pY[0][y].

[2493] 5.19. Example 19

[2494] The working draft specified in JVET-Q2001-vE may be modified as follows.

[2495] 8.4.5.2.13 Specification of INTRA_LT_CCLM, INTRA_L_CCLM and INTRA_T_CCLM intra prediction modes

[2496] The predicted sample point predSample[x][y], where x = 0..nTbW-1 and y = 0..nTbH-1, is derived as follows:

[2497] — If numSampL and numSampT are both equal to 0, then the following applies:

[2498] predSamples[x][y]=1<<(BitDepth-1) (359)

[2499] — Otherwise, the following ordered steps apply:

[2500] 1. The co-located luma sample pY[x][y] where x=0..nTbW×SubWidthC-1, y=0..TbH×SubHeightC-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).

[2501] 2. The adjacent brightness samples pY[x][y] are derived as follows:

[2502] —When numSampL is greater than 0, the adjacent left luma sample pY[x][y] where x=-1..-3, y=0..SubHeightC×numSampL-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).

[2503] - When availT is equal to FALSE, the adjacent top luma sample pY[x][y] where x = -1..SubWidthC×numSampT-1, y = -1..-2 is set equal to luma sample pY[x][0].

[2504] - When availL is equal to FALSE, the adjacent left luma sample pY[x][y] where x = -1..-3, y = -1..SubHeightC×numSampL-1 is set equal to the luma sample pY[0][y].

[2505] When numSampT is greater than 0, the adjacent top luma sample pY[x][y] where x=0..SubWidthC×numSampT-1, y=-1..-2 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).

[2506] [[-When availTL is equal to TRUE, the adjacent top-left luma sample pY[x][y] where x=-1, y=-1, -2 is set equal to the reconstructed luma sample at position (xTbY+x, yTbY+y) before the deblocking filtering process. ]]

[2507] —If both availL and availT are equal to TRUE, then the following applies:

[2508] - If availTL is equal to TRUE, the adjacent top left luma sample pY[x][y] where x = -1, -2, y = -1, -2 is set equal to the reconstructed luma sample at position (xTbY+x, yTbY+y) before the deblocking filtering process.

[2509] Otherwise, the adjacent upper left luma sample pY[x][y] with x=-1,-2, y=-1,-2 is set equal to the luma sample pY[x][0].

[2510] 5.20. Example 20

[2511] The working draft specified in JVET-Q2001-vE may be modified as follows.

[2512] 8.4.5.2.13 Specification of INTRA_LT_CCLM, INTRA_L_CCLM and INTRA_T_CCLM intra prediction modes

[2513] The inputs to this process are:

[2514] —Intra prediction mode predModeIntra,

[2515] - the sample position of the upper left sample of the current transform block relative to the upper left sample of the current picture (xTbC, yTbC),

[2516] - variable nTbW specifying the transform block width,

[2517] — variable nTbH specifying the transform block height,

[2518] — variable cIdx specifying the color component of the current block,

[2519] - Chroma neighboring samples p[x][y], where x = -1, y = 0..2×nTbH-1, and x = 0..2×nTbW-1, y = -1.

[2520] The output of this process is the predicted samples predSamples[x][y], where x = 0..nTbW-1, y = 0..nTbH-1.

[2521] The current brightness position (xTbY, yTbY) is derived as follows:

[2522] (xTbY, yTbY) = (xTbC<<(SubWidthC-1), yTbC<<(SubHeightC-1)) (351)

[2524] The variables availL, availT, and availTL are derived as follows:

[2525] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using as input the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY-1, yTbY), checkPredModeY set equal to false (FLASE), and cIdx, and assign the output to availL.

[2526] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY, yTbY-1), checkPredModeY set equal to false (FLASE), and cIdx as input, and assign the output to availT.

[2527] — If SubWidthC or SubHeightC is equal to 2, then the following applies:

[2528] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY-1, yTbY-1), checkPredModeY set equal to false (FLASE), and cIdx as input, and assign the output to availTL.

[2529] — Otherwise, availTL is set equal to false.

[2530] [[-The variable availTL is derived as follows:

[2531] availTL=availL&&availT (352)]]

[2532] …

[2533] The predicted sample point predSample[x][y], where x = 0..nTbW-1 and y = 0..nTbH-1, is derived as follows:

[2534] — If numSampL and numSampT are both equal to 0, then the following applies:

[2535] predSamples[x][y]=1<<(BitDepth-1) (359)

[2536] — Otherwise, the following ordered steps apply:

[2537] 1. The co-located luma sample pY[x][y] where x=0..nTbW×SubWidthC-1, y=0..TbH×SubHeightC-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).

[2538] 2. The adjacent brightness samples pY[x][y] are derived as follows:

[2539] —When numSampL is greater than 0, the adjacent left luma sample pY[x][y] where x=-1..-3, y=0..SubHeightC×numSampL-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).

[2540] - When availT is equal to FALSE, the adjacent top luma sample pY[x][y] where x = -1..SubWidthC×numSampT-1, y = -1..-2 is set equal to luma sample pY[x][0].

[2541] - When availL is equal to FALSE, the adjacent left luma sample pY[x][y] where x = -1..-3, y = -1..SubHeightC×numSampL-1 is set equal to the luma sample pY[0][y].

[2542] When numSampT is greater than 0, the adjacent top luma sample pY[x][y] where x=0..SubWidthC×numSampT-1, y=-1..-2 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).

[2543] —When availTL is equal to true (TRUE) and (SubWidthC or SubHeightC is equal to 2), the adjacent upper left luma sample pY[x][y] where x=-1, y=-1, -2 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).

[2544] 5.21. Example 21

[2545] The working draft specified in JVET-Q2001-vE may be modified as follows.

[2546] 8.4.5.2.13 Specification of INTRA_LT_CCLM, INTRA_L_CCLM and INTRA_T_CCLM intra prediction modes

[2547] The predicted sample point predSample[x][y], where x = 0..nTbW-1 and y = 0..nTbH-1, is derived as follows:

[2548] — If numSampL and numSampT are both equal to 0, then the following applies:

[2549] predSamples[x][y]=1<<(BitDepth-1) (359)

[2550] — Otherwise, the following ordered steps apply:

[2551] 1. The co-located luma sample pY[x][y] where x=0..nTbW×SubWidthC-1, y=0..TbH×SubHeightC-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).

[2552] 2. The adjacent brightness samples pY[x][y] are derived as follows:

[2553] —When numSampL is greater than 0, the adjacent left luma sample pY[x][y] where x=-1..-3, y=0..SubHeightC×numSampL-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).

[2554] - When availT is equal to FALSE and (SubWidthC or SubHeightC is equal to 2), the adjacent top luma sample pY[x][y] where x = -1..SubWidthC×numSampT-1, y = -1..-2 is set equal to luma sample pY[x][0].

[2555] - When availL is equal to FALSE and (SubWidthC or SubHeightC is equal to 2), the adjacent left luma sample pY[x][y] where x = -1..-3, y = -1..SubHeightC×numSampL-1 is set equal to the luma sample pY[0][y].

[2556] When numSampT is greater than 0, the adjacent top luma sample pY[x][y] where x=0..SubWidthC×numSampT-1, y=-1..-2 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).

[2557] —When availTL is equal to true (TRUE), the adjacent upper left luma sample pY[x][y] where x=-1, y=-1, -2 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).

[2558] 5.22. Example 22

[2559] The working draft specified in JVET-Q2001-vE may be modified as follows.

[2560] 8.4.5.2.13 Specification of INTRA_LT_CCLM, INTRA_L_CCLM and INTRA_T_CCLM intra prediction modes

[2561] The predicted sample point predSample[x][y], where x = 0..nTbW-1 and y = 0..nTbH-1, is derived as follows:

[2562] — If numSampL and numSampT are both equal to 0, then the following applies:

[2563] predSamples[x][y]=1<<(BitDepth-1) (359)

[2564] — Otherwise, the following ordered steps apply:

[2565] 1. The co-located luma sample pY[x][y] where x=0..nTbW×SubWidthC-1, y=0..TbH×SubHeightC-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).

[2566] 2. The adjacent brightness samples pY[x][y] are derived as follows:

[2567] —When numSampL is greater than 0, the adjacent left luma sample pY[x][y] where x=-1..-3, y=0..SubHeightC×numSampL-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).

[2568] - When availT is equal to FALSE, the adjacent top luma sample pY[x][y] where x = [[1]] 0..SubWidthC×numSampT-1, y = -1..-2 is set equal to luma sample pY[x][0].

[2569] - When availL is equal to FALSE, the adjacent left luma sample pY[x][y] where x = -1..-3, y = [[-1]] 0..SubHeightC×numSampL-1 is set equal to the luma sample pY[0][y].

[2570] When numSampT is greater than 0, the adjacent top luma sample pY[x][y] where x=0..SubWidthC×numSampT-1, y=-1..-2 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).

[2571] —When availTL is equal to true (TRUE), the adjacent upper left luma sample pY[x][y] where x=-1, y=-1, -2 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).

[2572] - If availT is equal to true, then the adjacent top left luma sample pY[x][y] where x = -1, -2, y = -1, -2 is set equal to luma sample pY[0][y].

[2573] Otherwise, if availL is equal to true, then the adjacent top-left luma sample pY[x][y] where x=-1,-2, y=-1,-2 is set equal to luma sample pY[x][0].

[2574] 5.23. Example 23

[2575] The working draft specified in JVET-Q2001-vE may be modified as follows.

[2576] 8.4.5.2.13 Specification of INTRA_LT_CCLM, INTRA_L_CCLM and INTRA_T_CCLM intra prediction modes

[2577] The inputs to this process are:

[2578] —Intra prediction mode predModeIntra,

[2579] - the sample position of the upper left sample of the current transform block relative to the upper left sample of the current picture (xTbC, yTbC),

[2580] - variable nTbW specifying the transform block width,

[2581] — variable nTbH specifying the transform block height,

[2582] — variable cIdx specifying the color component of the current block,

[2583] - Chroma neighboring samples p[x][y], where x = -1, y = 0..2×nTbH-1, and x = 0..2×nTbW-1, y = -1.

[2584] The output of this process is predSamples[x][y], where x = 0..nTbW-1, y = 0..nTbH-1.

[2585] The current luminance position (xTbY, yTbY) is derived as follows: (xTbY, yTbY) = (xTbC << (SubWidthC-1), yTbC << (SubHeightC-1)) (351)

[2587] The variables availL, availT, and availTL are derived as follows:

[2588] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using as input the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY-1, yTbY), checkPredModeY set equal to false (FLASE), and cIdx, and assign the output to availL.

[2589] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY, yTbY-1), checkPredModeY set equal to false (FLASE), and cIdx as input, and assign the output to availT.

[2590] — If availTL equals true and availT equals true, then the following applies:

[2591] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY-1, yTbY-1), checkPredModeY set equal to false (FLASE), and cIdx as input, and assign the output to availTL.

[2592] — Otherwise, availTL is set equal to false.

[2593] [[-The variable availTL is derived as follows:

[2594] availTL=availL&&availT (352)]]

[2595] …

[2596] The predicted sample point predSample[x][y], where x = 0..nTbW-1 and y = 0..nTbH-1, is derived as follows:

[2597] — If numSampL and numSampT are both equal to 0, then the following applies:

[2598] predSamples[x][y]=1<<(BitDepth-1) (359)

[2599] — Otherwise, the following ordered steps apply:

[2600] 1. The co-located luma sample pY[x][y] where x=0..nTbW×SubWidthC-1, y=0..TbH×SubHeightC-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).

[2601] 2. The adjacent brightness samples pY[x][y] are derived as follows:

[2602] —When numSampL is greater than 0, where x = -1..-3, y = 0..SubHeightC×

[2603] The adjacent left luma sample pY[x][y] of numSampL-1 is set equal to the reconstructed luma sample before the deblocking filtering process at the position (xTbY+x, yTbY+y).

[2604] - When availT is equal to FALSE, the adjacent top luma sample pY[x][y] where x = -1..SubWidthC×numSampT-1, y = -1..-2 is set equal to luma sample pY[x][0].

[2605] - When availL is equal to FALSE, the adjacent left luma sample pY[x][y] where x = -1..-3, y = -1..SubHeightC×numSampL-1 is set equal to the luma sample pY[0][y].

[2606] —When numSampT is greater than 0, the adjacent top luma sample pY[x][y] with x=0..SubWidthC×numSampT-1, y=-1..-2 is set equal to the reconstructed luma sample before the deblocking filtering process at the position (xTbY+x, yTbY+y).

[2607] [[-When availTL is equal to TRUE, the adjacent top-left luma sample pY[x][y] where x=-1, y=-1, -2 is set equal to the reconstructed luma sample at position (xTbY+x, yTbY+y) before the deblocking filtering process. ]]

[2608] —If both availL and availT are equal to TRUE, then the following applies:

[2609] - If availTL is equal to TRUE, the adjacent top left luma sample pY[x][y] where x = -1, -2, y = -1, -2 is set equal to the reconstructed luma sample at position (xTbY+x, yTbY+y) before the deblocking filtering process.

[2610] Otherwise, the adjacent top left luma sample pY[x][y] where x=-1,-2, y=-1,-2 is set equal to the luma sample pY[0][y].

[2611] 5.24. Example 24

[2612] The working draft specified in JVET-Q2001-vE may be modified as follows.

[2613] 8.4.5.2.13 Specification of INTRA_LT_CCLM, INTRA_L_CCLM and INTRA_T_CCLM intra prediction modes

[2614] The inputs to this process are:

[2615] —Intra prediction mode predModeIntra,

[2616] - the sample position of the upper left sample of the current transform block relative to the upper left sample of the current picture (xTbC, yTbC),

[2617] - variable nTbW specifying the transform block width,

[2618] — variable nTbH specifying the transform block height,

[2619] — variable cIdx specifying the color component of the current block,

[2620] - Chroma neighboring samples p[x][y], where x = -1, y = 0..2×nTbH-1, and x = 0..2×nTbW-1, y = -1.

[2621] The output of this process is predSamples[x][y], where x = 0..nTbW-1, y = 0..nTbH-1.

[2622] The current brightness position (xTbY, yTbY) is derived as follows:

[2623] (xTbY, yTbY) = (xTbC<<(SubWidthC-1), yTbC<<(SubHeightC-1)) (351)

[2625] The variables availL, availT, and availTL are derived as follows:

[2626] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using as input the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY-1, yTbY), checkPredModeY set equal to false (FLASE), and cIdx, and assign the output to availL.

[2627] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY, yTbY-1), checkPredModeY set equal to false (FLASE), and cIdx as input, and assign the output to availT.

[2628] — If availTL equals true and availT equals true, then the following applies:

[2629] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY-1, yTbY-1), checkPredModeY set equal to false (FLASE), and cIdx as input, and assign the output to availTL.

[2630] — Otherwise, availTL is set equal to false.

[2631] [[-The variable availTL is derived as follows:

[2632] availTL=availL&&availT (352)]]

[2633] …

[2634] The predicted sample point predSample[x][y], where x = 0..nTbW-1 and y = 0..nTbH-1, is derived as follows:

[2635] — If numSampL and numSampT are both equal to 0, then the following applies:

[2636] predSamples[x][y]=1<<(BitDepth-1) (359)

[2637] — Otherwise, the following ordered steps apply:

[2638] 1. The co-located luma sample pY[x][y] where x=0..nTbW×SubWidthC-1, y=0..TbH×SubHeightC-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).

[2639] 2. The adjacent brightness samples pY[x][y] are derived as follows:

[2640] —When numSampL is greater than 0, the adjacent left luma sample pY[x][y] where x=-1..-3, y=0..SubHeightC×numSampL-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).

[2641] - When availT is equal to FALSE, the adjacent top luma sample pY[x][y] where x = -1..SubWidthC×numSampT-1, y = -1..-2 is set equal to luma sample pY[x][0].

[2642] - When availL is equal to FALSE, the adjacent left luma sample pY[x][y] where x = -1..-3, y = -1..SubHeightC×numSampL-1 is set equal to the luma sample pY[0][y].

[2643] When numSampT is greater than 0, the adjacent top luma sample pY[x][y] where x=0..SubWidthC×numSampT-1, y=-1..-2 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).

[2644] [[-When availTL is equal to TRUE, the adjacent top-left luma sample pY[x][y] where x=-1, y=-1, -2 is set equal to the reconstructed luma sample at position (xTbY+x, yTbY+y) before the deblocking filtering process. ]]

[2645] —If both availL and availT are equal to TRUE, then the following applies:

[2646] - If availTL is equal to TRUE, the adjacent top left luma sample pY[x][y] where x = -1, -2, y = -1, -2 is set equal to the reconstructed luma sample at position (xTbY+x, yTbY+y) before the deblocking filtering process.

[2647] Otherwise, the adjacent top left luma sample pY[x][y] where x=-1,-2, y=-1,-2 is set equal to the luma sample pY[x][0].

[2648] 5.25. Example 25

[2649] The working draft specified in JVET-Q2001-vE may be modified as follows.

[2650] 8.4.5.2.13 Specification of INTRA_LT_CCLM, INTRA_L_CCLM and INTRA_T_CCLM intra prediction modes

[2651] The inputs to this process are:

[2652] —Intra prediction mode predModeIntra,

[2653] - the sample position of the upper left sample of the current transform block relative to the upper left sample of the current picture (xTbC, yTbC),

[2654] - variable nTbW specifying the transform block width,

[2655] — variable nTbH specifying the transform block height,

[2656] — variable cIdx specifying the color component of the current block,

[2657] - Chroma neighboring samples p[x][y], where x = -1, y = 0..2×nTbH-1, and x = 0..2×nTbW-1, y = -1.

[2658] The output of this process is predSamples[x][y], where x = 0..nTbW-1, y = 0..nTbH-1.

[2659] The current brightness position (xTbY, yTbY) is derived as follows:

[2660] (xTbY, yTbY) = (xTbC<<(SubWidthC-1), yTbC<<(SubHeightC-1)) (351)

[2662] The variables availL, availT, and availTL are derived as follows:

[2663] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using as input the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY-1, yTbY), checkPredModeY set equal to false (FLASE), and cIdx, and assign the output to availL.

[2664] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY, yTbY-1), checkPredModeY set equal to false (FLASE), and cIdx as input, and assign the output to availT.

[2665] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY-1, yTbY-1), checkPredModeY set equal to false (FLASE), and cIdx as input, and assign the output to availTL.

[2666] [[-The variable availTL is derived as follows:

[2667] availTL=availL&&availT (352)]]

[2668] …

[2669] The predicted sample point predSample[x][y], where x = 0..nTbW-1 and y = 0..nTbH-1, is derived as follows:

[2670] — If numSampL and numSampT are both equal to 0, then the following applies:

[2671] predSamples[x][y]=1<<(BitDepth-1) (359)

[2672] — Otherwise, the following ordered steps apply:

[2673] 1. The co-located luma sample pY[x][y] where x=0..nTbW×SubWidthC-1, y=0..TbH×SubHeightC-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).

[2674] 2. The adjacent brightness samples pY[x][y] are derived as follows:

[2675] —When numSampL is greater than 0, the adjacent left luma sample pY[x][y] where x=-1..-3, y=0..SubHeightC×numSampL-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).

[2676] - When availT is equal to FALSE, the adjacent top luma sample pY[x][y] where x = -1..SubWidthC×numSampT-1, y = -1..-2 is set equal to luma sample pY[x][0].

[2677] - When availL is equal to FALSE, the adjacent left luma sample pY[x][y] where x = -1..-3, y = -1..SubHeightC×numSampL-1 is set equal to the luma sample pY[0][y].

[2678] When numSampT is greater than 0, the adjacent top luma sample pY[x][y] where x=0..SubWidthC×numSampT-1, y=-1..-2 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).

[2679] [[-When availTL is equal to TRUE, the adjacent top-left luma sample pY[x][y] where x=-1, y=-1, -2 is set equal to the reconstructed luma sample at position (xTbY+x, yTbY+y) before the deblocking filtering process. ]]

[2680] —If both availL and availT are equal to TRUE, then the following applies:

[2681] - If availTL is equal to TRUE, the adjacent top left luma sample pY[x][y] where x = -1, -2, y = -1, -2 is set equal to the reconstructed luma sample at position (xTbY+x, yTbY+y) before the deblocking filtering process.

[2682] Otherwise, the adjacent top left luma sample pY[x][y] where x=-1,-2, y=-1,-2 is set equal to the luma sample pY[0][y].

[2683] 5.26. Example 26

[2684] The working draft specified in JVET-Q2001-vE may be modified as follows.

[2685] 8.4.5.2.13 Specification of INTRA_LT_CCLM, INTRA_L_CCLM and INTRA_T_CCLM intra prediction modes

[2686] The inputs to this process are:

[2687] —Intra prediction mode predModeIntra,

[2688] - the sample position of the upper left sample of the current transform block relative to the upper left sample of the current picture (xTbC, yTbC),

[2689] - variable nTbW specifying the transform block width,

[2690] — variable nTbH specifying the transform block height,

[2691] — variable cIdx specifying the color component of the current block,

[2692] - Chroma neighboring samples p[x][y], where x = -1, y = 0..2×nTbH-1, and x = 0..2×nTbW-1, y = -1.

[2693] The output of this process is predSamples[x][y], where x = 0..nTbW-1, y = 0..nTbH-1.

[2694] The current brightness position (xTbY, yTbY) is derived as follows:

[2695] (xTbY, yTbY) = (xTbC<<(SubWidthC-1), yTbC<<(SubHeightC-1)) (351)

[2697] The variables availL, availT, and availTL are derived as follows:

[2698] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using as input the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY-1, yTbY), checkPredModeY set equal to false (FLASE), and cIdx, and assign the output to availL.

[2699] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY, yTbY-1), checkPredModeY set equal to false (FLASE), and cIdx as input, and assign the output to availT.

[2700] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY-1, yTbY-1), checkPredModeY set equal to false (FLASE), and cIdx as input, and assign the output to availTL.

[2701] [[-The variable availTL is derived as follows:

[2702] availTL=availL&&availT (352)]]

[2703] …

[2704] The predicted sample point predSample[x][y], where x = 0..nTbW-1 and y = 0..nTbH-1, is derived as follows:

[2705] — If numSampL and numSampT are both equal to 0, then the following applies:

[2706] predSamples[x][y]=1<<(BitDepth-1) (359)

[2707] — Otherwise, the following ordered steps apply:

[2708] 1. The co-located luma sample pY[x][y] where x=0..nTbW×SubWidthC-1, y=0..TbH×SubHeightC-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).

[2709] 2. The adjacent brightness samples pY[x][y] are derived as follows:

[2710] —When numSampL is greater than 0, the adjacent left luma sample pY[x][y] where x=-1..-3, y=0..SubHeightC×numSampL-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).

[2711] - When availT is equal to FALSE, the adjacent top luma sample pY[x][y] where x = -1..SubWidthC×numSampT-1, y = -1..-2 is set equal to luma sample pY[x][0].

[2712] - When availL is equal to FALSE, the adjacent left luma sample pY[x][y] where x = -1..-3, y = -1..SubHeightC×numSampL-1 is set equal to the luma sample pY[0][y].

[2713] When numSampT is greater than 0, the adjacent top luma sample pY[x][y] where x=0..SubWidthC×numSampT-1, y=-1..-2 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).

[2714] [[-When availTL is equal to TRUE, the adjacent top-left luma sample pY[x][y] where x=-1, y=-1, -2 is set equal to the reconstructed luma sample at position (xTbY+x, yTbY+y) before the deblocking filtering process. ]]

[2715] —If both availL and availT are equal to TRUE, then the following applies:

[2716] If availTL is equal to TRUE, then the adjacent top-left luma sample pY[x][y] where x=-1,-2, y=-1,-2 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).

[2717] Otherwise, the adjacent top left luma sample pY[x][y] where x=-1,-2, y=-1,-2 is set equal to the luma sample pY[x][0].

[2718] 5.27. Example 27

[2719] The working draft specified in JVET-Q2001-vE may be modified as follows.

[2720] 8.4.5.2.13 Specification of INTRA_LT_CCLM, INTRA_L_CCLM and INTRA_T_CCLM intra prediction modes

[2721] The predicted sample point predSample[x][y], where x = 0..nTbW-1 and y = 0..nTbH-1, is derived as follows:

[2722] — If numSampL and numSampT are both equal to 0, then the following applies:

[2723] predSamples[x][y]=1<<(BitDepth-1) (359)

[2724] — Otherwise, the following ordered steps apply:

[2725] 1. The co-located luma sample pY[x][y] where x=0..nTbW×SubWidthC-1, y=0..TbH×SubHeightC-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).

[2726] 2. The adjacent brightness samples pY[x][y] are derived as follows:

[2727] —When numSampL is greater than 0, the adjacent left luma sample pY[x][y] where x=-1..-3, y=0..SubHeightC×numSampL-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).

[2728] - When availT is equal to FALSE, the adjacent top luma sample pY[x][y] where x = -1..SubWidthC×numSampT-1, y = -1..-2 is set equal to luma sample pY[x][0].

[2729] - When availL is equal to FALSE, the adjacent left luma sample pY[x][y] where x = -1..-3, y = -1..SubHeightC×numSampL-1 is set equal to the luma sample pY[0][y].

[2730] When numSampT is greater than 0, the adjacent top luma sample pY[x][y] where x=0..SubWidthC×numSampT-1, y=-1..-2 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).

[2731] —When availTL is equal to true (TRUE), the adjacent upper left luma sample pY[x][y] where x=-1, y=-1, -2 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).

[2732] 3. The downsampled co-located luminance sample pDsY[x][y], where x = 0..nTbW-1 and y = 0..nTbH-1, is derived as follows:

[2733] If SubWidthC and SubHeightC are both equal to 1, then the following applies:

[2734] —pDsY[x][y], where x=1..nTbW-1, y=1..nTbH-1 is derived as follows:

[2735] pDstY[x][y]=pY[x][y] (360)

[2736] — Otherwise, the following applies:

[2737] —The one-dimensional filter coefficient arrays F1 and F2 and the two-dimensional filter coefficient arrays F3 and F4 are specified as follows.

[2738] F1[0]=2,F1[1]=0 (361)

[2739] F2[0]=1,F2[1]=2,F2[2]=1 (362)

[2740] F3[i][j]=F4[i][j]=0,with i=0..2,j=0..2 (363)

[2741] If SubWidthC and SubHeightC are both equal to 2, then the following applies:

[2742] F1[0]=1,F1[1]=1 (364)

[2743] F3[0][1]=1,F3[1][1]=4,F3[2][1]=1,F3[1][0]=1,F3[1][2]=1 (365)

[2744] F4[0][1]=1,F4[1][1]=2,F4[2][1]=1 (366)

[2745] F4[0][2]=1,F4[1][2]=2,F4[2][2]=1 (367)

[2746] — Otherwise, the following applies:

[2747] F3[0][1]=2, F3[1][1]=[[8]]4, F3[2][1]=2, (368)

[2748] F4[0][1]=2, F4[1][1]=4, F4[2][1]=2, (369)

[2749] - If sps_chroma_vertical_collocated_flag is equal to 1, the following applies:

[2750] —pDsY[x][y], where x=0..nTbW-1, y=0..nTbH-1 is derived as follows:

[2751] pDsY[x][y]=(F3[1][0]×pY[SubWidthC×x][SubHeightC×y-1]+

[2752] F3[0][1]×pY[SubWidthC×x-1][SubHeightC×y]+

[2753] F3[1][1]×pY[SubWidthC×x][SubHeightC×y]+(370)

[2754] F3[2][1]×pY[SubWidthC×x+1][SubHeightC×y]+

[2755] F3[1][2]×pY[SubWidthC×x][SubHeightC×y+1]+4)>>3

[2756] Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies:

[2757] —pDsY[x][y], x=0..nTbW-1, y=0..nTbH-1 is derived as follows:

[2758] pDsY[x][y]=(F4[0][1]×pY[SubWidthC×x-1][SubHeightC×y]+

[2759] F4[0][2]×pY[SubWidthC×x-1][SubHeightC×y+1]+

[2760] F4[1][1]×pY[SubWidthC×x][SubHeightC×y]+(371)

[2761] F4[1][2]×pY[SubWidthC×x][SubHeightC×y+1]+

[2762] F4[2][1]×pY[SubWidthC×x+1][SubHeightC×y]+

[2763] F4[2][2]×pY[SubWidthC×x+1][SubHeightC×y+1]+4)>>3

[2764] 5.28. Example 28

[2765] The working draft specified in JVET-Q2001-vE may be modified as follows.

[2766] 8.4.5.2.13 Specification of INTRA_LT_CCLM, INTRA_L_CCLM and INTRA_T_CCLM intra prediction modes

[2767] The inputs to this process are:

[2768] —Intra prediction mode predModeIntra,

[2769] - the sample position of the upper left sample of the current transform block relative to the upper left sample of the current picture (xTbC, yTbC),

[2770] - variable nTbW specifying the transform block width,

[2771] — variable nTbH specifying the transform block height,

[2772] — variable cIdx specifying the color component of the current block,

[2773] - Chroma neighboring samples p[x][y], where x = -1, y = 0..2×nTbH-1, and x = 0..2×nTbW-1, y = -1.

[2774] The output of this process is predSamples[x][y], where x = 0..nTbW-1, y = 0..nTbH-1.

[2775] The current brightness position (xTbY, yTbY) is derived as follows:

[2776] (xTbY, yTbY) = (xTbC<<(SubWidthC-1), yTbC<<(SubHeightC-1)) (351)

[2778] The variables availL, availT, and availTL are derived as follows:

[2779] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using as input the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY-1, yTbY), checkPredModeY set equal to false (FLASE), and cIdx, and assign the output to availL.

[2780] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY, yTbY-1), checkPredModeY set equal to false (FLASE), and cIdx as input, and assign the output to availT.

[2781] —The variable availTL is derived as follows:

[2782] availTL=availL&&availT (352)

[2783] The number of available top-right adjacent chroma samples numTopRight is derived as follows:

[2784] —The variable numTopRight is set to 0, and availTR is set to true (TRUE).

[2785] - When predModeIntra is equal to INTRA_T_CCLM, the following applies for x=nTbW..2×nTbW-1 until availTR is equal to FALSE or x is equal to 2×nTbW-1:

[2786] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using as input the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY+x, yTbY-1), checkPredModeY set equal to false (FLASE), and cIdx, and assign the output to availTR.

[2787] —When availTR is equal to true (TRUE), numTopRight is increased by 1.

[2788] The number of available lower left adjacent chroma samples numLeftBelow is derived as follows:

[2789] —The variable numLeftBelow is set to 0, and availLB is set to true (TRUE).

[2790] When predModeIntra is equal to INTRA_L_CCLM, the following applies for y=nTbH..2×nTbH-1 until availLB is equal to FALSE or y is equal to 2×nTbH-1:

[2791] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY-1, yTbY+y), checkPredModeY set equal to false (FLASE), and cIdx as input, and assign the output to availLB.

[2792] —When availLB is equal to TRUE, numLeftBelow is increased by 1.

[2793] The number of available adjacent chroma samples numSampT at the top and upper right and the number of available adjacent chroma samples numSampL at the left and lower left are derived as follows:

[2794] If predModeIntra is equal to INTRA_LT_CCLM, the following applies:

[2795] numSampT=availT? nTbW:0 (353)

[2796] numSampL=availL? nTbH:0 (354)

[2797] — Otherwise, the following applies:

[2798] numSampT=(availT&&predModeIntra==INTRA_T_CCLM)? (nTbW+Min(numTopRight,nTbH)):0 (355)

[2799] numSampL=(availL&&predModeIntra==INTRA_L_CCLM)? (nTbH+Min(numLeftBelow,nTbW)):0 (356)

[2800] The variable bCTUboundary is derived as follows:

[2801] bCTUboundary=(yTbY&(CtbSizeY-1)==0)? TRUE:FALSE (357)

[2802] The variable cntN and array pickPosN, where N is replaced by L and T, are derived as follows:

[2803] —The variable numIs4N is derived as follows:

[2804] numIs4N=((availT&&availL&&predModeIntra==INTRA_LT_CCLM)?0:1)(358)

[2805] —The variable startPosN is set equal to numSampN>>(2+numIs4N).

[2806] - The variable pickStepN is set equal to Max(1, numSampN>>(1+numIs4N)).

[2807] —If availN is equal to TRUE and predModeIntra is equal to INTRA_LT_CCLM or INTRA_N_CCLM, then the following assignments are made:

[2808] —cntN is set equal to Min(numSampN, (1+numIs4N)<<1).

[2809] - pickPosN[pos] is set equal to (startPosN+pos×pickStepN), where pos=0..cntN-1.

[2810] Otherwise, cntN is set equal to 0.

[2811] The variable bVerticalCollocated is set equal to 0.

[2812] The predicted sample point predSample[x][y], where x = 0..nTbW-1 and y = 0..nTbH-1, is derived as follows:

[2813] — If numSampL and numSampT are both equal to 0, then the following applies:

[2814] predSamples[x][y]=1<<(BitDepth-1) (359)

[2815] — Otherwise, the following ordered steps apply:

[2816] 1. The co-located luma sample pY[x][y] where x=0..nTbW×SubWidthC-1, y=0..TbH×SubHeightC-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).

[2817] 2. The adjacent brightness samples pY[x][y] are derived as follows:

[2818] —When numSampL is greater than 0, the adjacent left luma sample pY[x][y] where x=-1..-3, y=0..SubHeightC×numSampL-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).

[2819] - When availT is equal to FALSE, the adjacent top luma sample pY[x][y] where x = -1..SubWidthC×numSampT-1, y = -1..-2 is set equal to luma sample pY[x][0].

[2820] - When availL is equal to FALSE, the adjacent left luma sample pY[x][y] where x = -1..-3, y = -1..SubHeightC×numSampL-1 is set equal to the luma sample pY[0][y].

[2821] When numSampT is greater than 0, the adjacent top luma sample pY[x][y] where x=0..SubWidthC×numSampT-1, y=-1..-2 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).

[2822] —When availTL is equal to true (TRUE), the adjacent upper left luma sample pY[x][y] where x=-1, y=-1, -2 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).

[2823] 3. The downsampled co-located luminance sample pDsY[x][y], where x = 0..nTbW-1 and y = 0..nTbH-1, is derived as follows:

[2824] If SubWidthC and SubHeightC are both equal to 1, then the following applies:

[2825] pDsY[x][y], where x=1..nTbW-1, y=1..nTbH-1 is derived as follows:

[2826] pDstY[x][y]=pY[x][y] (360)

[2827] — Otherwise, the following applies:

[2828] —The one-dimensional filter coefficient arrays F1 and F2 and the two-dimensional filter coefficient arrays F3 and F4 are specified as follows.

[2829] F1[0]=2,F1[1]=0 (361)

[2830] F2[0]=1,F2[1]=2,F2[2]=1 (362)

[2831] F3[i][j]=F4[i][j]=0,with i=0..2,j=0..2 (363)

[2832] If SubWidthC and SubHeightC are both equal to 2, then the following applies:

[2833] F1[0]=1,F1[1]=1 (364)

[2834] F3[0][1]=1,F3[1][1]=4,F3[2][1]=1,F3[1][0]=1,F3[1][2]=1 (365)

[2835] F4[0][1]=1,F4[1][1]=2,F4[2][1]=1 (366)

[2836] F4[0][2]=1,F4[1][2]=2,F4[2][2]=1 (367)

[2837] bVerticalCollocated=sps_chroma_vertical_collocated_flag

[2838] — Otherwise, the following applies:

[2839] F3[1][1]=8 (368)

[2840] F4[0][1]=2, F4[1][1]=4, F4[2][1]=2, (369)

[2841] bVerticalCollocated=0

[2842] - If [[sps_chroma_vertical_collocated_flag]]bVerticalCollocated is equal to 1, the following applies:

[2843] —pDsY[x][y], where x=0..nTbW-1, y=0..nTbH-1 is derived as follows:

[2844] pDsY[x][y]=(F3[1][0]×pY[SubWidthC×x][SubHeightC×y-1]+

[2845] F3[0][1]×pY[SubWidthC×x-1][SubHeightC×y]+

[2846] F3[1][1]×pY[SubWidthC×x][SubHeightC×y]+(370)

[2847] F3[2][1]×pY[SubWidthC×x+1][SubHeightC×y]+

[2848] F3[1][2]×pY[SubWidthC×x][SubHeightC×y+1]+4)>>3

[2849] Otherwise ([[sps_chroma_vertical_collocated_flag]]bVerticalCollocated is equal to 0), the following applies:

[2850] —pDsY[x][y], x=0..nTbW-1, y=0..nTbH-1 is derived as follows:

[2851] pDsY[x][y]=(F4[0][1]×pY[SubWidthC×x-1][SubHeightC×y]+

[2852] F4[0][2]×pY[SubWidthC×x-1][SubHeightC×y+1]+

[2853] F4[1][1]×pY[SubWidthC×x][SubHeightC×y]+(371)

[2854] F4[1][2]×pY[SubWidthC×x][SubHeightC×y+1]+

[2855] F4[2][1]×pY[SubWidthC×x+1][SubHeightC×y]+

[2856] F4[2][2]×pY[SubWidthC×x+1][SubHeightC×y+1]+4)>>3

[2857] 4. When numSampL is greater than 0, the selected adjacent left chroma sample pSelC[idx] is set equal to p[-1][pickPosL[idx]], where idx = 0..cntL-1, and the selected downsampled adjacent left luma sample pSelDsY[idx], where idx = 0..cntL-1, is derived as follows:

[2858] —The variable y is set equal to pickPosL[idx].

[2859] If SubWidthC and SubHeightC are both equal to 1, then the following applies:

[2860] pSelDsY[idx]=pY[-1][y] (372)

[2861] — Otherwise, the following applies:

[2862] - If [[sps_chroma_vertical_collocated_flag]]bVerticalCollocated is equal to 1, the following applies:

[2863] pSelDsY[idx]=(F3[1][0]×pY[-SubWidthC][SubHeightC×y-1]+

[2864] F3[0][1]×pY[-1-SubWidthC][SubHeightC×y]+

[2865] F3[1][1]×pY[-SubWidthC][SubHeightC×y]+(373)

[2866] F3[2][1]×pY[1-SubWidthC][SubHeightC×y]+

[2867] F3[1][2]×pY[-SubWidthC][SubHeightC×y+1]+4)>>3

[2868] Otherwise ([[sps_chroma_vertical_collocated_flag]]bVerticalCollocated is equal to 0), the following applies:

[2869] pSelDsY[idx]=(F4[0][1]×pY[-1-SubWidthC][SubHeightC×y]+

[2870] F4[0][2]×pY[-1-SubWidthC][SubHeightC×y+1]+

[2871] F4[1][1]×pY[-SubWidthC][SubHeightC×y]+(374)

[2872] F4[1][2]×pY[-SubWidthC][SubHeightC×y+1]+

[2873] F4[2][1]×pY[1-SubWidthC][SubHeightC×y]+

[2874] F4[2][2]×pY[1-SubWidthC][SubHeightC×y+1]+4)>>3

[2875] 5. When numSampT is greater than 0, the selected adjacent top chroma sample pSelC[idx] is set equal to p[pickPosT[idx-cntL]][-1], where idx=cntL..cntL+cntT-1, and the downsampled adjacent top luma sample pSelDsY[idx], where idx=[[0]]cntL..cntL+cntT-1, is specified as follows:

[2876] —The variable x is set equal to pickPosT[idx-cntL].

[2877] If SubWidthC and SubHeightC are both equal to 1, then the following applies:

[2878] pSelDsY[idx]=pY[x][-1] (375)

[2879] — Otherwise, the following applies:

[2880] - If [[sps_chroma_vertical_collocated_flag]]bVerticalCollocated is equal to 1, the following applies:

[2881] If bCTUboundary is equal to FALSE, the following applies:

[2882] pSelDsY[idx]=(F3[1][0]×pY[SubWidthC×x][-1-SubHeight C]+

[2883] F3[0][1]×pY[SubWidthC×x-1][-SubHeightC]+

[2884] F3[1][1]×pY[SubWidthC×x][-SubHeightC]+(376)

[2885] F3[2][1]×pY[SubWidthC×x+1][-SubHeightC]+

[2886] F3[1][2]×pY[SubWidthC×x][1-SubHeightC]+4)>>3

[2887] — Otherwise (bCTUboundary is TRUE), the following applies:

[2888] pSelDsY[idx]=(F2[0]×pY[SubWidthC×x-1][-1]+

[2889] F2[1]×pY[SubWidthC×x][-1]+(377)

[2890] F2[2]×pY[SubWidthC×x+1][-1]+2)>>2

[2891] Otherwise ([[sps_chroma_vertical_collocated_flag]]bVerticalCollocated is equal to 0), the following applies:

[2892] If bCTUboundary is equal to FALSE, the following applies:

[2893] pSelDsY[idx]=(F4[0][1]×pY[SubWidthC x-1][-1]+

[2894] F4[0][2]×pY[SubWidthC×x-1][-2]+

[2895] F4[1][1]×pY[SubWidthC×x][-1]+(378)

[2896] F4[1][2]×pY[SubWidthC×x][-2]+

[2897] F4[2][1]×pY[SubWidthC×x+1][-1]+

[2898] F4[2][2]×pY[SubWidthC×x+1][-2]+4)>>3

[2899] — Otherwise (bCTUboundary is TRUE), the following applies:

[2900] pSelDsY[idx]=(F2[0]×pY[SubWidthC×x-1][-1]+

[2901] F2[1]×pY[SubWidthC×x][-1]+(379)

[2902] F2[2]×pY[SubWidthC×x+1][-1]+2)>>2

[2903] 6. When cntT+cntL is not equal to 0, the variables minY, maxY, minC, and maxC are derived as follows:

[2904] —When cntT+cntL is equal to 2, pSelComp[3] is set equal to pSelComp[0], pSelComp[2] is set equal to pSelComp[1], pSelComp[0] is set equal to pSelComp[1], pSelComp[1] is set equal to pSelComp[3], and Comp is replaced by DsY and C.

[2905] —The arrays minGrpIdx and maxGrpIdx are derived as follows:

[2906] minGrpIdx[0]=0 (380)

[2907] minGrpIdx[1]=2 (381)

[2908] maxGrpIdx[0]=1 (382)

[2909] maxGrpIdx[1]=3 (383)

[2910] —When pSelDsY[minGrpIdx[0]] is greater than pSelDsY[minGrpIdx[1]], minGrpIdx[0] and minGrpIdx[1] are swapped as follows:

[2911] (minGrpIdx[0], minGrpIdx[1])=Swap(minGrpIdx[0], minGrpIdx[1]) (384)

[2913] —When pSelDsY[maxGrpIdx[0]] is greater than pSelDsY[maxGrpIdx[1]], maxGrpIdx[0] and maxGrpIdx[1] are swapped as follows:

[2914] (maxGrpIdx[0], maxGrpIdx[1])=Swap(maxGrpIdx[0], maxGrpIdx[1]) (385)

[2916] —When pSelDsY[minGrpIdx[0]] is greater than pSelDsY[maxGrpIdx[1]], the arrays minGrpIdx and maxGrpIdx are swapped as follows:

[2917] (minGrpIdx, maxGrpIdx) = Swap (minGrpIdx, maxGrpIdx) (386)

[2918] —When pSelDsY[minGrpIdx[1]] is greater than pSelDsY[maxGrpIdx[0]], minGrpIdx[1] and maxGrpIdx[0] are swapped as follows:

[2919] (minGrpIdx[1], maxGrpIdx[0])=Swap(minGrpIdx[1], maxGrpIdx[0]) (387)

[2921] —The variables maxY, maxC, minY, and minC are derived as follows:

[2922] maxY=(pSelDsY[maxGrpIdx[0]]+pSelDsY[maxGrpIdx[1]]+1)>>1 (388)

[2924] maxC=(pSelC[maxGrpIdx[0]]+pSelC[maxGrpIdx[1]]+1)>>1 (389)

[2926] minY=(pSelDsY[minGrpIdx[0]]+pSelDsY[minGrpIdx[1]]+1)>>1 (390)

[2928] minC=(pSelC[minGrpIdx[0]]+pSelC[minGrpIdx[1]]+1)>>1 (391)

[2929] 7. The variables a, b, and k are derived as follows:

[2930] — If numSampL is equal to 0 and numSampT is equal to 0, then the following applies:

[2931] k=0 (392)

[2932] a=0 (393)

[2933] b=1<<(BitDepth-1) (394)

[2934] — Otherwise, the following applies:

[2935] diff=maxY-minY (395)

[2936] — If diff is not equal to 0, the following applies:

[2937] diffC=maxC-minC (396)

[2938] x=Floor(Log2(diff)) (397)

[2939] normDiff=((diff<<4)>>x)&15 (398)

[2940] x+=(normDiff!=0)? 1:0 (399)

[2941] y=Abs(diffC)>0? Floor(Log2(Abs(diffC)))+1:0 (400)

[2942] a=(diffC×(divSigTable[normDiff]|8)+2 y - 1 )>>y (401)

[2943] k=((3+xy)<1)? 1:3+xy (402)

[2944] a=((3+xy)<1)? Sign(a)×15:a (403)

[2945] b=minC-((a×minY)>>k) (404)

[2946] where divSigTable[] is specified as follows:

[2947] divSigTable[]={0, 7, 6, 5, 5, 4, 4, 3, 3, 2, 2, 1, 1, 1, 1, 0} (405)

[2948] — Otherwise (diff is equal to 0), the following applies:

[2949] k=0 (406)

[2950] a=0 (407)

[2951] b=minC (408)

[2952] 8. The predicted sample point predSample[x][y], x=0..nTbW-1, y=0..nTbH-1 is derived as follows:

[2953] predSamples[x][y]=Clip1(((pDsY[x][y]×a)>>k)+b) (409)

[2954] NOTE - This process uses sps_chroma_vertical_collocated_flag. However, to simplify the implementation, it does not ...

Claims

1. A method for processing video data, comprising: For conversion between a video including a video unit and a bitstream of the video, determining a codec tool for the video unit according to a rule; as well as performing said converting in accordance with said determining, wherein the video unit is a chroma block, and the rule further specifies that when a cross component linear model (CCLM) prediction mode is applied to the video unit, parameters of the CCLM are determined based on neighboring chroma samples of the video unit and a first variable representing neighboring luma samples corresponding to a first luma block of the video unit, and wherein when the value of the second variable indicates that the neighboring block is available, the first variable is set equal to the neighboring luma sample of the first luma block, and when the value of the second variable indicates that the neighboring block is unavailable, the first variable is set equal to the valid sample, wherein, when the value of the second variable indicates that the neighboring block is available, the first variable represented as pY[x][y] is set equal to the reconstructed adjacent left luminance sample before the deblocking filtering process at the position (xTbY+x, yTbY+y), x is in the range of [-1, -3], and the maximum value of y is equal to SubHeightC*Max(numSampL, nTbH)-1, Wherein, (xTbY, yTbY) represents the upper left position of the first luminance block, x and y are integers, nTbH represents the height of the video unit, SubHeightC is a height scaling factor obtained according to the chroma format of the first video picture, and numSampL represents the number of adjacent chroma samples available in the CCLM prediction mode.

2. The method according to claim 1, wherein: The video unit corresponds to a sequence, a picture, a slice, a slice, a block, or a sub-picture.

3. The method according to claim 1, wherein: A syntax element indicating whether a transform is applied to the video unit is included in the bitstream, and when a value of the syntax element is equal to 0, a transform skip mode is enabled for the video unit.

4. The method according to claim 1, wherein: In a case where the CCLM prediction mode is the first CCLM prediction mode, when the value of the second variable indicates that the neighboring block is available, numSampL is equal to the height of the video unit, Wherein, when the CCLM prediction mode is the second CCLM prediction mode, numSampL is equal to nTbH+Min(numLeftBelow,nTbW), where nTbW represents the width of the video unit, and numLeftBelow represents the number of available lower-left adjacent chroma samples.

5. The method according to claim 1, wherein: When the value of the second variable indicates that the neighboring block is not available, the first variable denoted as pY[x][y], where x=-1, y=-1..SubHeightC*numSampL-1, is set equal to the reconstructed luma sample pY[0][y].

6. The method according to claim 1, wherein: When the value of the second variable indicates that the neighboring block is available, the first variable denoted as pY[x][y] is set equal to the reconstructed adjacent upper luma sample before the deblocking filtering process at the position (xTbY+x, yTbY+y), and the maximum value of x is equal to SubWidthC*Max(numSampT,nTbW)-1, Wherein (xTbY, yTbY) represents the upper left position of the first luminance block, x and y are integers, nTbW represents the width of the video unit, SubWidthC is a width scaling factor obtained according to the chroma format of the first video picture, and numSampT represents the number of top adjacent chroma samples available or top and upper right adjacent chroma samples available in the CCLM prediction mode.

7. The method according to claim 6, wherein: In a case where the CCLM prediction mode is the first CCLM prediction mode, when the value of the second variable indicates that the neighboring block is available, numSampT is equal to the width of the video unit, Wherein, when the CCLM prediction mode is the third CCLM prediction mode, numSampT is equal to nTbW+Min(numTopRight,nTbH), where nTbH represents the height of the video unit, and numTopRight represents the number of available top-right adjacent chroma samples.

8. The method according to claim 6 or 7, wherein: When the value of the second variable indicates that the neighboring block is not available, the first variable denoted as pY[x][y], where x=-1..SubWidthC*numSampT-1, y=-1..-2, is set equal to the reconstructed luma sample pY[x][0].

9. The method of any one of claims 1-8, wherein the converting comprises encoding the video into the bitstream.

10. The method of any one of claims 1-8, wherein the converting comprises decoding the video from the bitstream.

11. An apparatus for processing video data, comprising a processor and a non-transitory memory having instructions thereon, wherein the instructions, when executed by the processor, cause the processor to: For conversion between a video including a video unit and a bitstream of the video, determining a codec tool for the video unit according to a rule; and performing said converting in accordance with said determining, in, The video unit is a chroma block, and the rule further specifies that when a cross component linear model (CCLM) prediction mode is applied to the video unit, parameters of the CCLM are determined based on neighboring chroma samples of the video unit and a first variable representing neighboring luma samples corresponding to a first luma block of the video unit, and wherein when the value of the second variable indicates that the neighboring block is available, the first variable is set equal to the neighboring luma sample of the first luma block, and when the value of the second variable indicates that the neighboring block is unavailable, the first variable is set equal to the valid sample, wherein, when the value of the second variable indicates that the neighboring block is available, the first variable represented as pY[x][y] is set equal to the reconstructed adjacent left luminance sample before the deblocking filtering process at the position (xTbY+x, yTbY+y), x is in the range of [-1, -3], and the maximum value of y is equal to SubHeightC*Max(numSampL, nTbH)-1, Wherein, (xTbY, yTbY) represents the upper left position of the first luminance block, x and y are integers, nTbH represents the height of the video unit, SubHeightC is a height scaling factor obtained according to the chroma format of the first video picture, and numSampL represents the number of adjacent chroma samples available in the CCLM prediction mode.

12. The device according to claim 11, wherein: The video unit corresponds to a sequence, a picture, a slice, a slice, a block, or a sub-picture.

13. The device according to claim 11, wherein: A syntax element indicating whether a transform is applied to the video unit is included in the bitstream, and when a value of the syntax element is equal to 0, a transform skip mode is enabled for the video unit.

14. The device according to claim 11, wherein: In a case where the CCLM prediction mode is the first CCLM prediction mode, when the value of the second variable indicates that the neighboring block is available, numSampL is equal to the height of the video unit, Wherein, when the CCLM prediction mode is the second CCLM prediction mode, numSampL is equal to nTbH+Min(numLeftBelow,nTbW), where nTbW represents the width of the video unit, and numLeftBelow represents the number of available lower-left adjacent chroma samples.

15. A non-transitory computer-readable storage medium storing instructions that cause a processor to: For conversion between a video including a video unit and a bitstream of the video, determining a codec tool for the video unit according to a rule; and performing said converting in accordance with said determining, in, The video unit is a chroma block, and the rule further specifies that when a cross component linear model (CCLM) prediction mode is applied to the video unit, parameters of the CCLM are determined based on neighboring chroma samples of the video unit and a first variable representing neighboring luma samples corresponding to a first luma block of the video unit, and wherein when the value of the second variable indicates that the neighboring block is available, the first variable is set equal to the neighboring luma sample of the first luma block, and when the value of the second variable indicates that the neighboring block is unavailable, the first variable is set equal to the valid sample, wherein, when the value of the second variable indicates that the neighboring block is available, the first variable represented as pY[x][y] is set equal to the reconstructed adjacent left luminance sample before the deblocking filtering process at the position (xTbY+x, yTbY+y), x is in the range of [-1, -3], and the maximum value of y is equal to SubHeightC*Max(numSampL, nTbH)-1, Wherein, (xTbY, yTbY) represents the upper left position of the first luminance block, x and y are integers, nTbH represents the height of the video unit, SubHeightC is a height scaling factor obtained according to the chroma format of the first video picture, and numSampL represents the number of adjacent chroma samples available in the CCLM prediction mode.

16. A non-transitory computer-readable recording medium storing a bit stream of a video generated by a method performed by a video processing device, wherein the method comprises: determining, according to a rule, a codec tool for a video unit included in the video; as well as generating the bitstream according to the determination, wherein the video unit is a chroma block, and the rule further specifies that when a cross component linear model (CCLM) prediction mode is applied to the video unit, parameters of the CCLM are determined based on neighboring chroma samples of the video unit and a first variable representing neighboring luma samples corresponding to a first luma block of the video unit, and wherein when the value of the second variable indicates that the neighboring block is available, the first variable is set equal to the neighboring luma sample of the first luma block, and when the value of the second variable indicates that the neighboring block is unavailable, the first variable is set equal to the valid sample, wherein, when the value of the second variable indicates that the neighboring block is available, the first variable represented as pY[x][y] is set equal to the reconstructed adjacent left luminance sample before the deblocking filtering process at the position (xTbY+x, yTbY+y), x is in the range of [-1, -3], and the maximum value of y is equal to SubHeightC*Max(numSampL, nTbH)-1, Wherein, (xTbY, yTbY) represents the upper left position of the first luminance block, x and y are integers, nTbH represents the height of the video unit, SubHeightC is a height scaling factor obtained according to the chroma format of the first video picture, and numSampL represents the number of adjacent chroma samples available in the CCLM prediction mode.

17. A method for storing a bitstream of a video, comprising: determining, according to a rule, a codec tool for a video unit included in the video; generating the bitstream based on the determination; as well as storing the bitstream in a non-transitory computer-readable recording medium, wherein the video unit is a chroma block, and the rule further specifies that when a cross component linear model (CCLM) prediction mode is applied to the video unit, parameters of the CCLM are determined based on neighboring chroma samples of the video unit and a first variable representing neighboring luma samples corresponding to a first luma block of the video unit, and wherein when the value of the second variable indicates that the neighboring block is available, the first variable is set equal to the neighboring luma sample of the first luma block, and when the value of the second variable indicates that the neighboring block is unavailable, the first variable is set equal to the valid sample, wherein, when the value of the second variable indicates that the neighboring block is available, the first variable represented as pY[x][y] is set equal to the reconstructed adjacent left luminance sample before the deblocking filtering process at the position (xTbY+x, yTbY+y), x is in the range of [-1, -3], and the maximum value of y is equal to SubHeightC*Max(numSampL, nTbH)-1, Wherein, (xTbY, yTbY) represents the upper left position of the first luminance block, x and y are integers, nTbH represents the height of the video unit, SubHeightC is a height scaling factor obtained according to the chroma format of the first video picture, and numSampL represents the number of adjacent chroma samples available in the CCLM prediction mode.

18. A video processing device, comprising a processor configured to implement the method according to any one of claims 5 to 10.

19. A method of storing a bitstream of a video, comprising the method of any one of claims 2 to 10, and further comprising storing the bitstream to a non-transitory computer-readable recording medium.

20. A computer readable medium storing program code, which, when executed, causes a processor to implement the method of any one of claims 2-10.

21. A video processing apparatus for storing a bitstream representation, wherein the video processing apparatus is configured to implement the method of any one of claims 2-10.

Citation Information

Patent Citations

  • Down-sampling in cross-component linear modeling

    CN110896478A

  • Single-row cross component linear model prediction mode

    CN110896479A