Syntax for signaling cross-component video coding

Cross-component linear model prediction optimizes chroma prediction in video coding by deriving parameters for chroma-luma conversions, addressing bandwidth and complexity issues in high-resolution formats, aligning with VVC standards.

JP7797460B2Active Publication Date: 2026-01-13DOUYIN VISION CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
JP2023204677
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Priority Date
2020-04-18
Filing Date
2023-12-04
Publication Date
2026-01-13
Estimated Expiration
2041-04-19

AI Technical Summary

Technical Problem

Existing video coding standards face challenges in efficiently handling chroma subsampling and intra-prediction modes, particularly in high-resolution video formats like 4:4:4, leading to increased bandwidth demands and computational complexity.

Method used

Implementing cross-component linear model prediction (CCLM) for chroma blocks using downsampling filters to generate aligned neighborhoods and derive parameters for conversion between chroma and luma blocks, along with rules for determining valid coding tools and slice types to optimize video encoding and decoding processes.

Benefits of technology

Enhances video quality and reduces bandwidth requirements by improving chroma prediction accuracy and reducing computational complexity, aligning with future video coding standards like Versatile Video Coding (VVC).

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007797460000069
    Figure 0007797460000069
  • Figure 0007797460000070
    Figure 0007797460000070
  • Figure 0007797460000071
    Figure 0007797460000071
Patent Text Reader

Abstract

To provide a method of video processing which performs coding or decoding by using cross-component linear model prediction, and a video processing apparatus.SOLUTION: The method of video processing includes determining, for a conversion between a video block of a video and a bitstream of the video, a parameter of a cross-component linear model (CCLM) for the video block according to a rule, and performing the conversion based on the determining. The rule specifies to use a variable representing a neighbouring luminance sample in the determining of the parameter of the CCLM only in a case that the variable has a certain value.SELECTED DRAWING: Figure 18
Need to check novelty before this filing date? Find Prior Art

Description

[Technical Field]

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS Book This application claims priority to and benefit of International Patent Application No. PCT / CN2020 / 085484, filed April 18, 2020. main stretch This is a divisional application of Japanese Patent Application No. 2022-563091 based on International Patent Application No. PCT / CN2021 / 087999 filed on April 19, 2021. The entire disclosure of the above application is three By lighting Here It is cited.

[0002] TECHNICAL FIELD This specification relates to video and image coding technology. [Background technology]

[0003] Digital video accounts for the largest bandwidth usage on the Internet and other digital communications networks, and the bandwidth demands for digital video use are expected to continue to grow as the number of connected user devices capable of receiving and displaying video increases. Summary of the Invention

[0004] The disclosed techniques may be used by embodiments of a video or image decoder or encoder to encode or decode using cross-component linear model prediction.

[0005] In one exemplary aspect, a method for processing video is disclosed that includes deriving parameters of a cross-component linear model for conversion between chroma blocks of the video and a coded representation of the video by using a downsampling filter to generate top luma samples of a downsampled, aligned neighborhood from N positive integer neighboring lines above the aligned luma block, and performing the conversion using a predicted chroma block generated using the cross-component linear model.

[0006] In another exemplary aspect, a method for processing video is disclosed, the method including: determining parameters of a cross-component linear model of the video block according to a rule for conversion between a video block of the video having a 4:2:2 color format and a bitstream of the video; 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 the rule specifies that the parameters are determined independently of a value of the syntax element.

[0007] In another exemplary aspect, a method for processing video is disclosed that includes performing a conversion between the video and a video bitstream according to rules, where the format rules specify that a field indicating whether chroma sample locations are vertically shifted relative to corresponding luma sample locations due to the video having a 4:2:2 or 4:4:4 color format is set to a default value.

[0008] In another exemplary aspect, a method for processing video is disclosed, the method including determining parameters of a Cross Component Linear Model (CCLM) of a video block according to a rule for conversion between a video block of the video and a bitstream of the video, and performing the conversion based on the determination, the rule specifying that a variable representing a neighboring luma sample is used in determining the parameters of the CCLM only if the variable has a specific value.

[0009] In another exemplary aspect, a method for processing video is disclosed, the method including: determining whether a first coding tool is valid for a video unit according to a rule for conversion between video constituting the video unit and a video bitstream, the rule specifying that the first coding tool and a second coding tool are mutually exclusively valid, and the first coding tool or the second coding tool comprises a code data hiding tool; and performing the conversion according to the determination.

[0010] In another exemplary aspect, a method for processing video is disclosed, the method including: determining whether a first coding tool is valid for a video unit according to rules for conversion between video constituting the video unit and a video bitstream, the rules specifying that the first coding tool and a second coding tool are mutually exclusively valid, and the first coding tool or the second coding tool includes a dependent quantization tool; and performing the conversion according to the determination.

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

[0012] In another exemplary aspect, a method for processing video is disclosed, the method including performing a conversion between a video including one or more pictures including one or more slices and a video bitstream according to a rule, wherein the rule specifies that a number of allowed filters in an Adaptation Parameter Set (APS) or the number of APSs depends on coded information of the video.

[0013] In another exemplary aspect, the above-described methods may be implemented by a video encoder device including a processor.

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

[0015] These and other aspects are further described herein. [Brief explanation of the drawings]

[0016] [Figure 1A] FIG. 1A shows the nominal vertical and horizontal positions of 4:2:2 luma and chroma samples in a picture. [Figure 1B] FIG. 1B shows an example of a video encoder. [Figure 2] FIG. 2 shows an example of 67 intra-prediction modes. [Figure 3] FIG. 3 shows an example of horizontal and vertical traverse scanning. [Figure 4] FIG. 4 shows an example of the sample positions used to derive α and β. [Figure 5] FIG. 5 shows an example of dividing a block of 4×8 samples into two independent decodable regions. [Figure 6] FIG. 6 shows an exemplary order for processing rows of pixels to maximize throughput for a 4×N block with a vertical predictor. [Figure 7] FIG. 7 shows an example of LFNST (Low-Frequency Non-Separable Transform) processing. [Figure 8] FIG. 8 shows an example of neighboring chroma samples and downsampled neighboring luma samples used to derive CCLM parameters for 4:2:2 video. [Figure 9] FIG. 9 shows an example of a video processing device. [Figure 10] FIG. 10 shows a block diagram of an exemplary video encoder. [Figure 11] FIG. 11 is a flowchart illustrating an example of a video processing method. [Figure 12] FIG. 12 is a block diagram illustrating an example of a video processing system. [Figure 13] FIG. 13 shows an example of the samples in the current block and the top left sample used. [Figure 14] FIG. 14 is a block diagram illustrating an exemplary video coding system. [Figure 15]FIG. 15 is a block diagram illustrating an encoder in accordance with some embodiments of the disclosed techniques. [Figure 16] FIG. 16 is a block diagram illustrating a decoder in accordance with some embodiments of the disclosed techniques. [Figure 17A] FIG. 17A is a flowchart of an exemplary method of video processing according to some implementations of the disclosed technology. [Figure 17B] FIG. 17B is a flowchart of an exemplary method of video processing according to some implementations of the disclosed technology. [Figure 18] FIG. 18 is a flowchart of an exemplary method of video processing according to some implementations of the disclosed technology. [Figure 19A] FIG. 19A is a flowchart of an exemplary method of video processing according to some implementations of the disclosed technology. [Figure 19B] FIG. 19B is a flowchart of an exemplary method of video processing according to some implementations of the disclosed technology. [Figure 19C] FIG. 19C is a flowchart of an exemplary method of video processing according to some implementations of the disclosed technology. [Figure 19D] FIG. 19D is a flowchart of an exemplary method of video processing according to some implementations of the disclosed technology. DETAILED DESCRIPTION OF THE INVENTION

[0017] This specification provides various techniques that can be used by a decoder of an image or video bitstream to improve the quality of decompressed or decoded digital video or images. For simplicity, the term "video" is used herein to include both a series of pictures (conventionally called video) and individual images. Furthermore, a video encoder may implement these techniques during the encoding process to reconstruct decoded frames for use in further encoding.

[0018] Section headings are used herein for ease of understanding and are not intended to limit embodiments disclosed in one section to only that section, and thus embodiments in one section may be combined with embodiments in other sections.

[0019] 1. Brief Overview The present invention relates to video coding techniques. Specifically, the present invention relates to cross-component linear model prediction and other coding tools in image / video coding. The present invention may be applied to existing video coding standards such as HEVC or to finalize standards (Versatile Video Coding). The present invention may also be applied to future video coding standards or video codecs.

[0020] 2. Background Video coding standards have evolved primarily through the development of well-known ITU-T and ISO / IEC standards. ITU-T developed H.261 and H.263, while ISO / IEC developed MPEG-1 and MPEG-4 Visual. The two organizations jointly developed H.262 / MPEG-2 Video, H.264 / MPEG-4 AVC (Advanced Video Coding), and H.265 / HEVC. Since H.262, video coding standards have been based on hybrid video coding architectures that utilize temporal prediction and transform coding. To explore future video coding 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 Joint Exploration Mode (JEM). In April 2018, the Joint Video Expert Team (JVET) was established between VCEG (Q6 / 16) and ISO / IEC JTC1 SC29 / WG11 (MPEG), and is working on formulating the VVC standard with the goal of reducing the bitrate by 50% compared to HEVC.

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

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

[0023] The latest reference software for VVC, called VTM, can be found at:

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

[0025] Color Space and Saturation Subsampling A color space, also known as a color model (or color system), is an abstract mathematical model that simply describes a range of colors as a tuple of numbers, typically three or four values ​​or color components (e.g., RGB). Essentially, a color space is a refinement of a coordinate system and a subspace.

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

[0027] 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 color image pipeline video and digital photography systems. Y' is the luma component, and CB and CR are the blue-difference and red-difference chroma components. Y' (primed) distinguishes it from Y, which is luma, by implying that light intensity is coded nonlinearly based on gamma-corrected RGB primaries.

[0028] Chroma subsampling is a method of encoding images by implementing chroma information at a lower resolution than luma information, taking advantage of the fact that the human visual system perceives color differences less well than luma.

[0029] 2.1.1. 4:4:4 Each of the three Y'CbCr components has the same sample rate, so there is no chroma subsampling. This method is sometimes used in high-end film scanners and in post-production film editing.

[0030] 2.1.2. 4:2:2 The two chroma components are sampled at half the luma sample rate, halving the horizontal chroma resolution and leaving the vertical chroma resolution unchanged. This reduces the bandwidth of the uncompressed video signal by a factor of three with little or no visible difference. An example of the nominal vertical and horizontal positions of the 4:2:2 color format is shown, for example, in Figure 1A of the VVC Working Draft.

[0031] 2.1.3. 4:2:0 In 4:2:0, horizontal sampling is doubled compared to 4:1:1, but the vertical resolution is halved because the scheme samples the Cb and Cr channels only on each alternate line. Thus, the data rate is the same. Cb and Cr are each subsampled by a factor of two both horizontally and vertically. There are three variants of the 4:2:0 scheme, with different horizontal and vertical positions: ● In MPEG-2, Cb and Cr are cosited horizontally. Cb and Cr are located between pixels vertically (located between the lattices). In JPEG / JFIF, H.261, and MPEG-1, Cb and Cr are located between the middle grid of alternating luminance samples. ● In 4:2:0 DV, Cb and Cr are co-sited horizontally. Vertically, they are alternately co-sited.

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

[0033] [Table 1]

[0034] 2.2. Typical video codec coding flow FIG. 1B shows an example of a VVC encoder block diagram, including three in-loop filtering blocks: a deblocking filter (DF), a sample adaptive offset (SAO), and an ALF. Unlike the DF, which uses a predefined filter, the SAO and ALF utilize the original samples of the current picture and reduce the mean square error between the original and reconstructed samples by adding an offset and applying a finite impulse response (FIR) filter, respectively, using coded-side information to signal the offset and filter coefficients. The ALF is located at the final processing stage of each picture and can be considered a tool that attempts to capture and correct artifacts generated by previous stages.

[0035] 2.3. Intra-mode coding with 67 intra-prediction modes To capture any edge direction represented in natural video, the number of directional intra modes, as used in HEVC, is expanded from 33 to 65. The additional directional modes are indicated by the red dotted arrows in Figure 2, while the planar and DC modes remain the same. These denser directional intra prediction modes apply to all block sizes and to both luma and chroma intra prediction.

[0036] The conventional angular intra-prediction direction is specified from 45 degrees to -135 degrees clockwise, as shown in Figure 2. In VTM, some conventional angular intra-prediction modes are adaptively replaced with wide-angle intra-prediction modes for non-square blocks. The replaced modes are signaled using the original method and, after parsing, are remapped to the wide-angle mode index. The total number of intra-prediction modes remains unchanged, i.e., 67, and the intra-mode coding remains unchanged.

[0037] In HEVC, all intra-coded blocks have a square shape, and the length of each of their sides is a power of two. Thus, no division operations are required to generate an intra predictor using DC mode. In VVC, blocks may have rectangular shapes in the general case, which requires the use of division operations for each block. To avoid division operations for DC prediction, only the long sides are used to calculate the average of non-square blocks. Figure 2 shows examples of 67 intra-prediction modes.

[0038] 2.4. Inter Prediction For each inter-predicted CU, motion parameters consisting of a motion vector, a reference picture index, and a reference picture list usage index, as well as additional information required for the new coding features of VVC, are used to generate inter-predicted samples. The motion parameters may be signaled explicitly or implicitly. When a CU is coded in skip mode, it is associated with one PU and has no significant residual coefficients, coded motion vector deltas, or reference picture indexes. A merge mode is defined, which obtains motion parameters for the current CU, including spatial and temporal candidates and the additional schedule introduced in VVC, from neighboring CUs. The merge mode can be applied to any inter-predicted CU, not just skip mode. An alternative to the merge mode is to explicitly transmit motion parameters, whereby the motion vector, the reference picture index corresponding to each reference picture list and reference picture list usage flag, and other necessary information are explicitly signaled for each CU.

[0039] 2.5. IBC (Intra Block Copy) IBC (Intra Block Copy) is a tool adopted in the HEVC extension of SCC. It is known to significantly improve coding efficiency for screen content material. Since IBC mode is implemented as a block-level coding mode, Block Matching (BM) is performed in the encoder to find the optimal block vector (or motion vector) for each CU. Here, the block vector is used to indicate the displacement from the current block to a reference block already reconstructed within the current picture. The luma block vectors of IBC-coded CUs are integer-precision. The chroma block vectors are also rounded to integer precision. When combined with AMVR, IBC mode can switch between 1-pixel and 4-pixel motion vector precision. IBC-coded CUs are treated as a third prediction mode other than intra or inter prediction modes. IBC mode is applicable to CUs whose width and height are both 64 luma samples or less.

[0040] On the encoder side, hash-based motion estimation is performed for IBC. The encoder performs an RD check on blocks with width or height less than or equal to 16 luma samples. In 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 block-matching-based local search is performed.

[0041] In a hash-based search, the hash key matching (32-bit CRC) between the current block and the reference block is expanded to all allowed block sizes. The calculation of hash keys for all positions in the current picture is based on 4x4 sub-blocks. If the size of the current block is larger, if all hash keys of all 4x4 sub-blocks match the hash key of the corresponding reference position, the hash key is determined to match that of the reference block. If the hash keys of multiple reference blocks are found to match the hash key of the current block, the block vector cost of each matching reference block is calculated and the one with the minimum cost is selected. In a block matching search, the search range is set to cover both the previous CTU and the current CTU. At the CU level, IBC mode is signaled by a flag and can be signaled as IBC AMVP mode or IBC skip / merge mode as follows:

[0042] IBC Skip / Merge Mode: The merge candidate index is used to indicate which block vector in the list from neighboring candidate IBC coded blocks to use to predict the current block. The merge list consists of spatial candidates, HMVP candidates, and pairwise candidates.

[0043] - IBC AMVP mode: Block vector differences are coded similarly to 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 coded). If either neighbor is not available, a default block vector is used as the predictor. A flag is signaled to indicate the block vector predictor index.

[0044] 2.6. Palette Mode For palette mode signaling, the palette mode is coded as the prediction mode for the coding unit, i.e., the prediction mode for the coding unit may be MODE_INTRA, MODE_INTER, MODE_IBC, or MODE_PLT. When palette mode is used, pixel values ​​in a CU are represented by a small set of representative color values. The set is called a palette. For pixels with values ​​close to the colors in the palette, a palette index is signaled. For pixels with values ​​outside the palette, the pixel is represented by an escape symbol and the quantized pixel value is signaled directly.

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

[0046] For coding the palette table, a palette predictor is maintained. The predictor is initialized at the beginning of each slice, 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 transmitted using run-length coding of zeros. After this, the number of new palette entries is signaled using an Exponential-Golomb code of order 0. Finally, the component values ​​for the new palette entries are signaled. After encoding the current CU, the palette predictor is updated using the current palette, and entries from the previous palette predictor that are not reused in the current palette are added to the end of the new palette predictor until the maximum allowed size is reached (palette stuffing).

[0047] To code a palette index map, the indices are coded using horizontal and vertical transverse scans as shown in Figure 3. The palette_transpose_flag is used to explicitly signal the scan order in the bitstream.

[0048] FIG. 3 shows an example of horizontal and vertical traverse scanning.

[0049] The palette index is coded using the two main palette sample modes ("INDEX" and "COPY_ABOVE"). The mode is signaled using the top row excluded flag if horizontal scanning is used, or the first column excluded flag if vertical scanning is used or if the previous mode was "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 run value is signaled that specifies the number of pixels to be coded using the same mode.

[0050] The coding order for the index map is as follows: First, the number of index values ​​for the CU is signaled. Following this, truncated binary coding is used to signal the actual index value for the entire CU. In bypass mode, both the number of indices and the index value are coded, which groups index-related bypass bins. Next, the palette mode (INDEX or COPY_ABOVE) and run are signaled in an interleaved manner. Finally, the component escape values ​​corresponding to the escape samples for the entire CU are grouped and coded in bypass mode. After signaling the index value, an additional syntax element, last_run_type_flag, is signaled. This syntax element, in conjunction with the number of indices, eliminates the need to signal the run value corresponding to the last run in the block.

[0051] In VTM, a dual tree is enabled for I-slices, which separates the division of coding units for luma and chroma. Therefore, in this proposal, palettes are applied separately to luma (Y component) and chroma (Cb, Cr components). When the dual tree is disabled, a palette is applied jointly to the Y, Cb, Cr components, similar to the HEVC palette.

[0052] 2.7. Cross-component linear model prediction In VVC, a CCLM (Cross-Component Linear Model) prediction mode is used, in which a linear model is used to predict chroma samples based on reconstructed luma samples of the same CU as follows:

[0053]

number

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

[0055] FIG. 4 illustrates the positions of the left and top samples and the samples of the current block involved in the LM mode.

[0056] FIG. 4 shows an example of the sample positions used to derive α and β.

[0057] In addition to being able to use the top and left templates to jointly calculate the linear model coefficients in LM mode, they can also be used alternatively in two other LM modes called LM_A and LM_L modes. In LM_A mode, only the top template is used to calculate the linear model coefficients. To obtain more samples, the top template is extended to (W+H). In LM_L mode, only the left template is used to calculate the linear model coefficients. To obtain more samples, the left template is extended to (H+W). For non-square blocks, the top template is extended to W+W and the left template is extended to H+H.

[0058] The CCLM parameters (α and β) are derived using at most four neighboring chroma samples and their corresponding downsampled luma samples. If the current chroma block dimensions are W × H, then W' and H' are set as follows: -When LM mode is applied, W'=W, H'=H -When LM-A mode is applied, W'=W+H -When LM-L mode is applied, H'=H+W

[0059] The top neighbor positions are denoted as S[0,-1]…S[W'-1,-1], and the left neighbor positions are denoted as S[-1,0]…S[-1,H'-1]. Next, select four samples as follows: -When LM mode is applied and both upper and left neighboring samples are available, then S[W' / 4,-1], S[3W' / 4,-1], S[-1,H' / 4], S[-1,3H' / 4]. -If LM-A mode is applied or only upper neighboring samples are available, then S[W' / 8,-1], S[3W' / 8,-1], S[5W' / 8,-1], S[7W' / 8,-1]. If -LM-L mode is applied or only left neighboring samples are available, then S[-1,H' / 8], S[-1,3H' / 8], S[-1,5H' / 8], S[-1,7H' / 8].

[0060] The four neighboring luminance samples at the selected location are downsampled and compared four times 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 B Their corresponding saturation sample values ​​are found as y 0 A ,y 1 A ,y 0 B ,y 1 B And, x A ,x B ,y A ,y B is derived as follows:

[0061]

number

[0062] Finally, the linear model parameters α and β are calculated according to the following equations:

[0063]

number

[0064]

number

[0065] The division operations for calculating the parameters are implemented using lookup tables. To reduce the memory required to store the tables, the diff value (the difference between the maximum and minimum values) and the parameter α are expressed in exponential notation. For example, diff is approximated with a 4-bit significant part and an exponent. As a result, the table for 1 / diff is converted to 16 elements for 16 mantissa values ​​as follows: DivTable[]={0,7,6,5,5,4,4,3,3,2,2,1,1,1,1,0} (2-5)

[0066] This has the advantage of reducing the computational complexity as well as reducing the memory size required to store the required tables.

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

[0068]

number

[0069]

number

[0070] Note that if the upper reference line is at a CTU boundary, only one luma line (a typical line buffer in intra prediction) is used to generate the downsampled luma samples.

[0071] This parameter calculation is done as part of the decoding process, and not just as an encoder search operation, and as a result no syntax is used to communicate the α and β values ​​to the decoder.

[0072] For chroma intra-mode coding, a total of eight intra modes are allowed for chroma intra-mode coding. These modes include five traditional intra modes and six cross-component linear model modes (LM, LM_A, and LM_L). The chroma mode signaling and derivation process is shown in Table 2-2. Chroma mode coding directly depends on the intra prediction mode of the corresponding luma block. In an I slice, because the separation of the block partition structure for luma and chroma components is enabled, one chroma block may correspond to multiple luma blocks. Therefore, for chroma DM mode, the intra prediction mode of the corresponding luma block, including the center position of the current chroma block, is directly inherited.

[0073] Table 2-2 Deriving chroma prediction mode from luma mode when cclm_ is enabled

[0074] [Table 2]

[0075] JVET-Q2001-vE specification of the INTRA_LT_CCLM, INTRA_L_CCLM, and INTRA_T_CCLM intra prediction modes

[0076] 8.4.5.2.13 The inputs to this process are: - intra prediction mode predModeIntra, - sample position (xTbC, yTbC) of the top left sample of the current transform block relative to the top left sample of the current picture, - the variable nTbW that defines the width of the transformation block, - variable nTbH, which defines the height of the transformation block; - a variable cIdx that defines the color component of the current block, - saturation neighborhood samples p[x][y] where x=-1, y=0..2*nTbH-1 and x=0..2*nTbW-1, y=-1

[0077] The output of this process is the predicted samples preSamples[x][y], where x=0..nTbW-1, y=0..nTbH-1. The current luminance position (xTbY, yTbY) is derived as follows: (xTbY,yTbY)=(xTbC<<(SubWidthC-1),yTbC<<(SubHeightC-1)) (351) The variables availL, availT and availTL are derived as follows: The derivation process for neighborhood block availability specified in Section 6.4.4 starts with the current luminance position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighborhood luminance position (xTbY-1, yTbY), checkPredModeY set equal to FALSE, and cIdx as inputs, and assigns the output to availL. The derivation process for neighborhood block availability specified in Section 6.4.4 starts with the current luminance position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighborhood luminance position (xTbY, yTbY-1), checkPredModeY set equal to FALSE, and cIdx as inputs, and assigns the output to availT. The variable availTL is derived as follows: availTL=availL&&availT (352) - The number of available top right neighbor chroma samples, numTopRight, is derived as follows: The variable numTopRight is set equal to 0 and availTR is set equal to TRUE. -If preModeIntra 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: The derivation process for neighborhood block availability specified in Section 6.4.4 starts with the current luminance position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighborhood luminance position (xTbY+x, yTbY-1), checkPredModeY set equal to FALSE, and cIdx as inputs, and assigns the output to availTR. If -availTR is equal to TRUE, numTopRight is increased by one. - The number of available bottom-left neighbor chroma samples, numLeftBelow, is derived as follows: The variable numLeftBelow is set equal to 0 and availLB is set equal to TRUE. -If preModeIntra 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: The derivation process for neighborhood block availability specified in Section 6.4.4 is invoked with the current luminance position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighborhood luminance position (xTbY-1, yTbY+y), checkPredModeY set equal to FALSE, and cIdx as inputs, and assigns the output to availLB. If -availLB is equal to TRUE, numLeftBelow is increased by one.

[0078] The number of available neighboring chroma samples in the top and top-right numSampT and the number of available neighboring chroma samples in the left and bottom-left numSampL are derived as follows: If -predModeIntra is equal to INTRA_LT_CCLM, the following applies: numSampT=availT?nTbW:0 (353) numSampL=availL?nTbH:0 (354) - Otherwise, the following applies: numSampT=(availT&&predModeIntra==INTRA_T_CCLM)?(nTbW+Min(numTopRight,nTbH)):0 (355) numSampL=(availL&&predModeIntra==INTRA_L_CCLM)?(nTbH+Min(numLeftBelow,nTbW)):0 (356)

[0079] The variable bCTUboundary is derived as follows: bCTUboundary=(yTbY&(CtbSizeY-1)==0)?TRUE:FALSE. (357) The variable cntN and the array pickPosN, in which N is replaced with L and T, are derived as follows: The variable numIs4N is derived as follows: numIs4N=((availT&&availL&&predModeIntra==INTRA_LT_CCLM)?0:1) (358) The variable startPosN is set equal to numSampN>>(2+numIs4N). The variable pickStepN is set equal to Max(1,numSampN>>(1+numIs4N)). If -availN is equal to TRUE and preModeIntra is equal to INTRA_LT_CCLM or INTRA_N_CCLM, the following allocations are made: -cntN is set equal to Min(numSampN, (1+numIs4N)<<1). -pickPosN[pos] is set equal to (startPosN+pos*pospickStepN), where pos=0..cntN-1. Otherwise, cntN is set equal to 0. The predicted samples predSamples[x][y], where x=0..nTbW-1 and y=0..nTbH-1, are derived as follows: If both -numSampL and numSampT are equal to 0, the following applies: predSamples[x][y]=1<<(BitDepth-1) (359)

[0080] - Otherwise, the following ordered steps apply: 1. The co-located luma sample pY[x][y], where x=0..nTbW*SubWidthC-1, y=0..nTbH*SubHeightC-1, is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y). 2. The neighboring luminance samples pY[x][y] are derived as follows: If -numSampL is greater than 0, the neighboring left luma sample pY[x][y], where x=-1..-3, y=0..SubHeightC*numSampL-1, is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y). If -availT is equal to FALSE, the top-most luminance sample pY[x][y] in the neighborhood with x=-1..SubWidthC*numSampT-1, y=-1..-2 is set equal to the luminance sample pY[x][0]. If -availL is equal to FALSE, the left luma sample pY[x][y] in the neighborhood where x=-1..-3, y=-1..SubHeightC*numSampL-1 is set equal to luma sample pY[0][y]. If -numSampT is greater than 0, the top-most luma sample pY[x][y] in the neighborhood with x=0..SubWidthC*numSampT-1, y=-1,-2 is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y). If -availTL is equal to TRUE, the top-left neighboring luma sample pY[x][y] at x=-1, y=-1,-2 is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y).

[0081] 3. The downsampled and arranged luminance samples pDsY[x][y] when x=0..nTbW-1 and y=0..nTbH-1 are derived as follows: -If both SubWidthC and SubHeightC are equal to 1, the following applies: pDsY[x][y] where x=1..nTbW-1 and y=1..nTbH-1 is derived as follows: pDstY[x][y]=pY[x][y] (360) - Otherwise, the following applies: The one-dimensional filter coefficient arrays F1 and F2 and the two-dimensional filter coefficient arrays F3 and F4 are defined as follows: F1[0]=2,F1[1]=0 (361) F2[0]=1,F2[1]=2,F2[2]=1 (362) F3[i][j]=F4[i][j]=0,i=0..2,j=0..2 (363) -If both SubWidthC and SubHeightC are equal to 2, the following applies: F1[0]=1,F1[1]=1 (364) F3[0][1]=1,F3[1][1]=4,F3[2][1]=1,F3[1][0]=1,F3[1][2]=1 (365) F4[0][1]=1,F4[1][1]=2,F4[2][1]=1 (366) F4[0][2]=1,F4[1][2]=2,F4[2][2]=1 (367) - Otherwise, the following applies: F3[1][1]=8 (368) F4[0][1]=2,F4[1][1]=4,F4[2][1]=2, (369) If -sps_chroma_vertical_collocated_flag is equal to 1, the following applies: pDsY[x][y] where -x=0..nTbW-1 and y=0..nTbH-1 is derived as follows: pDsY[x][y]=(F3[1][0]*pY[SubWidthC*x][SubHeightC*y-1]+ F3[0][1]*pY[SubWidthC*x-1][SubHeightC*y]+ F3[1][1]*pY[SubWidthC*x][SubHeightC*y]+ F3[2][1]*pY[SubWidthC*x+1][SubHeightC*y]+ F3[1][2]*pY[SubWidthC*x][SubHeightC*y+1]+4)>>3 (370) - Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies: pDsY[x][y] where -x=0..nTbW-1 and y=0..nTbH-1 is derived as follows: pDsY[x][y]=(F4[0][1]*pY[SubWidthC*x-1][SubHeightC*y]+ F4[0][2]*pY[SubWidthC*x-1][SubHeightC*y+1]+ F4[1][1]*pY[SubWidthC*x][SubHeightC*y]+ F4[1][2]*pY[SubWidthC*x][SubHeightC*y+1]+ F4[2][1]*pY[SubWidthC*x+1][SubHeightC*y]+ F4[2][2]*pY[SubWidthC*x+1][SubHeightC*y+1]+4)>>3 (371)

[0082] 4. If numSampL is greater than 0, the selected neighboring left chroma sample pSelC[idx] is set equal to p[-1][pickPosL[idx]], idx=0..cntL-1, and the selected downsampled neighboring left luma sample pSelDsY[idx], idx=0..cntL-1, is derived as follows: The variable y is set equal to pickPosL[idx]. -If both SubWidthC and SubHeightC are equal to 1, the following applies: pSelDsY[idx]=pY[-1][y] (372) - Otherwise, the following applies: If -sps_chroma_vertical_collocated_flag is equal to 1, the following applies: pSelDsY[idx]=(F3[1][0]*pY[-SubWidthC][SubHeightC*y-1]+ F3[0][1]*pY[-1-SubWidthC][SubHeightC*y]+ F3[1][1]*pY[-SubWidthC][SubHeightC*y]+ F3[2][1]*pY[1-SubWidthC][SubHeightC*y]+ F3[1][2]*pY[-SubWidthC][SubHeightC*y+1]+4)>>3 (373) - Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies: pSelDsY[idx]=(F4[0][1]*pY[-1-SubWidthC][SubHeightC*y]+ F4[0][2]*pY[-1-SubWidthC][SubHeightC*y+1]+ F4[1][1]*pY[-SubWidthC][SubHeightC*y]+ F4[1][2]*pY[-SubWidthC][SubHeightC*y+1]+ F4[2][1]*pY[1-SubWidthC][SubHeightC*y]+ F4[2][2]*pY[1-SubWidthC][SubHeightC*y+1]+4)>>3 (374)

[0083] 5. If numSampT is greater than 0, the top chroma sample of the selected neighborhood, pSelC[idx], is set equal to p[pickPost[idx-cntL][-1], where idx=cntL..cntL+cntT-1], and the top luma sample of the downsampled neighborhood, pSelDsY[idx], for idx=0..cntL+cntT-1, is defined as follows: - The variable x is set equal to pickPost[idx-cntL]. -If both SubWidthC and SubHeightC are equal to 1, the following applies: pSelDsY[idx]=pY[x][-1] (375) - Otherwise, the following applies: If -sps_chroma_vertical_collocated_flag is equal to 1, the following applies: If -bCTUboundary is equal to FALSE, the following applies: pSelDsY[idx]=(F3[1][0]*pY[SubWidthC*x][-1-SubHeightC]+ F3[0][1]*pY[SubWidthC*x-1][-SubHeightC]+ F3[1][1]*pY[SubWidthC*x][-SubHeightC]+ F3[2][1]*pY[SubWidthC*x+1][-SubHeightC]+ F3[1][2]*pY[SubWidthC*x][1-SubHeightC]+4)>>3 (376) Otherwise (bCTUboundary is equal to TRUE), the following applies: pSelDsY[idx]=(F2[0]*pY[SubWidthC*x-1][-1]+ F2[1]*pY[SubWidthC*x][-1]+ F2[2]*pY[SubWidthC*x+1][-1]+2)>>2 (377) - Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies: If -bCTUboundary is equal to FALSE, the following applies: pSelDsY[idx]=(F4[0][1]*pY[SubWidthCx-1][-1]+ F4[0][2]*pY[SubWidthC*x-1][-2]+ F4[1][1]*pY[SubWidthC*x][-1]+ F4[1][2]*pY[SubWidthC*x][-2]+ F4[2][1]*pY[SubWidthC*x+1][-1]+ F4[2][2]*pY[SubWidthC*x+1][-2]+4)>>3 (378) Otherwise (bCTUboundary is equal to TRUE), the following applies: pSelDsY[idx]=(F2[0]*pY[SubWidthC*x-1][-1]+ F2[1]*pY[SubWidthC*x][-1]+ F2[2]*pY[SubWidthC*x+1][-1]+2)>>2 (379)

[0084] 6. If cntT+cntL is not equal to 0, then the variables minY, maxY, minC, and maxC are derived as follows: If -cntT+cntL is equal to 2, then with Comp substituted for DsY and C, pSelComp[3] is set equal to pSelComp[0], pSelComp[2] is set equal to pSelComp[1], pSelComp[0] is set equal to pSelComp[1], and pSelComp[1] is set equal to pSelComp[3]. The arrays minGrpIdx and maxGrpIdx are derived as follows: minGrpIdx[0]=0 (380) minGrpIdx[1]=2 (381) maxGrpIdx[0]=1 (382) maxGrpIdx[1]=3 (383) -If pSelDsY[minGrpIdx[0]] is greater than pSelDsY[minGrpIdx[1]], minGrpIdx[0] and minGrpIdx[1] are swapped as follows: (minGrpIdx[0],minGrpIdx[1])=Swap(minGrpIdx[0],minGrpIdx[1]) (384) - If pSelDsY[maxGrpIdx[0]] is greater than pSelDsY[maxGrpIdx[1]], maxGrpIdx[0] and maxGrpIdx[1] are swapped as follows: (maxGrpIdx[0],maxGrpIdx[1])=Swap(maxGrpIdx[0],maxGrpIdx[1]) (385) - If pSelDsY[minGrpIdx[0]] is greater than pSelDsY[maxGrpIdx[1]], the arrays minGrpIdx and maxGrpIdx are swapped as follows: (minGrpIdx,maxGrpIdx)=Swap(minGrpIdx,maxGrpIdx) (386) - If pSelDsY[minGrpIdx[1]] is greater than pSelDsY[maxGrpIdx[0]], minGrpIdx[1] and maxGrpIdx[0] are swapped as follows: (minGrpIdx[1],maxGrpIdx[0])=Swap(minGrpIdx[1],maxGrpIdx[0]) (387) The variables maxY, maxC, minY and minC are derived as follows: maxY=(pSelDsY[maxGrpIdx[0]]+pSelDsY[maxGrpIdx[1]]+1)>>1 (388) maxC=(pSelC[maxGrpIdx[0]]+pSelC[maxGrpIdx[1]]+1)>>1 (389) minY=(pSelDsY[minGrpIdx[0]]+pSelDsY[minGrpIdx[1]]+1)>>1 (390) minC=(pSelC[minGrpIdx[0]]+pSelC[minGrpIdx[1]]+1)>>1 (391)

[0085] 7. The variables a, b, and k are derived as follows: -If numSampL is equal to 0 and numSampT is equal to 0, the following applies: k=0 (392) a=0 (393) b=1<<(BitDepth-1) (394) - Otherwise, the following applies: diff=maxY-minY (395) If -diff is not equal to 0, the following applies: diffC=maxC-minC (396) x=Floor(Log2(diff)) (397) normDiff=((diff<<4)>>x)&15 (398) x+=(normDiff!=0)?1:0 (399) y=Abs(diffC)>0?Floor(Log2(Abs(diffC)))+1:0 (400) a=(diffC*(divSigTable[normDiff]|8)+2 y-1)>>y (401) k=((3+xy)<1)?1:3+xy (402) a=((3+xy)<1)?Sign(a)*15:a (403) b=minC-((a*minY)>>k) (404) Here, divSigTable[] is defined as follows: divSigTable[]={0,7,6,5,5,4,4,3,3,2,2,1,1,1,1,0} (405) - Otherwise (diff is equal to 0), the following applies: k=0 (406) a=0 (407) b=minC (408)

[0086] 8. The predicted samples predSamples[x][y], where x=0..nTbW-1 and y=0..nTbH-1, are derived as follows: predSamples[x][y]=Clip1(((pDsY[x][y]*a)>>k)+b) (409) Note - This process uses sps_chroma_vertical_collocated_flag, but for simplicity of implementation, does not use sps_chroma_horizontal_collocated_flag.

[0087] 2.8. BDPCM (Block Differential Pulse-Code Modulation) Coding In JVET-M0057, BDPCM is proposed. Due to the shape of the horizontal (or vertical) predictor, which uses the pixel to the left (A) (or above (B)) to predict the current pixel, the most throughput-efficient way to process a block is to process all pixels in one column (or line) in parallel and process these columns (or lines) sequentially. To improve throughput, we introduce the following process: if the predictor selected for this block is vertical, we divide a block of width 4 into two by the horizontal frontier; if the predictor selected for this block is horizontal, we divide a block of height 4 into two by the vertical frontier.

[0088] When dividing a block, it is not allowed to calculate a prediction for a sample from one region using pixels from another region; if this situation occurs, the predicted pixel is replaced by a reference pixel in the prediction direction. This is illustrated in Figure 5 for different positions of the current pixel X in a 4x8 block predicted vertically.

[0089] FIG. 5 shows an example of dividing a block of 4×8 samples into two independent decodable regions.

[0090] Thanks to this property, a 4x4 block can be processed in two cycles, and a 4x8 or 8x4 block may be processed in four cycles, as shown in Figure 6.

[0091] FIG. 6 shows an exemplary order for processing rows of pixels to maximize throughput for a 4×N block with a vertical predictor.

[0092] Table 2-3 summarizes the number of cycles required to process a block depending on its size. Note that for any block where both dimensions are 8 or more, it is trivial to say that more than 8 pixels can be processed per cycle.

[0093] Table 2-3 Worst-case throughput for blocks of size 4xN, Nx4

[0094] [Table 3]

[0095] 2.9. Quantized Residual Domain BDPCM In JVET-N0413, quantized residual domain BDPCM (hereinafter referred to as RBDPCM) is proposed. Intra prediction, similar to intra prediction, predicts the entire block by copying samples in the prediction direction (horizontal or vertical prediction). The residual is quantized, and the delta between the quantized residual and its predictor (horizontal or vertical) quantized value is coded.

[0096] For a block of size M (rows) × N (columns), r i,j , 0≦i≦M-1, 0≦j≦N-1 are the prediction residuals after intra prediction using unfiltered samples from the boundary samples of the upper or left block in the horizontal direction (copying the pixel values ​​of the left neighbor for each line in the prediction block) or vertical direction (copying the pixel values ​​of the upper neighbor for each line in the prediction block). i , j ), 0≦i≦M-1, 0≦j≦N-1 are the residuals r i , j where the residual is the difference between the original block and the predicted block values. Block DPCM is then applied to the quantized residual samples, resulting in the element r ~ i , j A modified M×N array R with ~ When vertical BDPCM is signaled, we get:

[0097]

number

[0098] For horizontal prediction, a similar rule applies, and the residual quantized samples are Therefore, it is obtained.

[0099]

number

[0100] The residual quantized sample r ~ i,j is sent to the decoder.

[0101] At the decoder side, the above calculation is reversed to obtain Q(r i,j ), 0≦i≦M-1, 0≦j≦N Generates -1. For vertical prediction,

[0102]

number

[0103] In the horizontal direction,

[0104]

number

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

[0106] The main advantage of this scheme is that the inverse DPCM can be done on the fly while parsing the coefficients, only requiring the addition of a predictor while parsing the coefficients, or it can be done after parsing.

[0107] In quantized residual domain BDPCM, transform skip is always used.

[0108] 2.10. MTS (Multiple Transform Set) in VVC The VTM enables large block size transforms up to 64x64, which is primarily useful for high-resolution video, e.g., 1080p and 4K sequences. For transform blocks with a size (width or height, or both width and height) of 64, high-frequency transform coefficients are zeroed out and only lower-frequency coefficients are retained. For example, for an MxN transform block, where M is the block width and N is the block height, if M is 64, only the left 32 columns of transform coefficients are retained. Similarly, if N is 64, only the top 32 rows of transform coefficients are retained. When using transform skip mode for large blocks, the entire block is used without zeroing values. The VTM also supports a configurable maximum transform size in SPS, allowing encoders the flexibility to select transform sizes up to 16, 32, or 64 based on the needs of a particular implementation.

[0109] In addition to the DCT-II used in HEVC, the Multiple Transform Selection (MTS) scheme is used for residual coding of both inter-coded and intra-coded blocks. It uses multiple transforms selected from DCT8 / DST7. The newly introduced transform matrices are DST-VII and DCT-VIII. The selected DST / DCT basic functions are listed in Table 2-4 below.

[0110] Table 2-4 Transform-based functions for DCT-II / VIII and DSTVII for N-point input

[0111] [Table 4]

[0112] To maintain the orthogonality of the transform matrices, they are quantized more precisely than in HEVC: after horizontal and vertical transforms, all coefficients have 10 bits to keep the intermediate values ​​of the transform coefficients within the 16-bit range.

[0113] To control the MTS scheme, separate enable flags are defined for intra and inter at the SPS level. When MTS is enabled in the SPS, a CU level flag is signaled to indicate whether MTS is applied, where MTS is only applied to luma. The MTS CU level flag is signaled when the following conditions are met: -Width and height are both 32 or less, -CBF flag equals 1.

[0114] If the MTS CU flag is equal to zero, DCT2 is applied in both directions. However, if the MTS CU flag is equal to one, two other flags are additionally signaled to indicate the horizontal and vertical transform type, respectively. The transform mapping table is signaled as shown in Table 2-5. A unified transform selection for ISP and implicit MTS is used by removing 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 on, only DST7 is used for both the horizontal and vertical transform cores. When converting matrix precision, an 8-bit primary transform core is used. Therefore, all transform cores used in HEVC are kept the same, such as 4-point DCT-2 and DST-7, 8-point, 16-point, and 32-point DCT-2, etc. Other transform cores, such as the 64-point DCT-2, 4-point DCT-8, 8-point, 16-point, and 32-point DST-7 and DCT-8, also use an 8-bit primary transform core.

[0115] Table 2-5 Mapping Table Conversions and Signaling

[0116] [Table 5]

[0117] To reduce the complexity of large sizes of DST-7 and DCT-8, the high frequency transform coefficients are zeroed for DST-7 and DCT-8 blocks whose size (width or height, or both width and height) is equal to 32. Only the coefficients in the 16x16 lower frequency region are retained.

[0118] As in HEVC, the residual of a block may be coded in transform skip mode. To avoid syntax coding redundancy, the transform skip flag is not signaled if the CU-level MTS_CU_flag is not equal to zero. The block size restriction for transform skip is the same as for MTS in JEM4: if the width and height of a block are both 32 or less, it indicates that transform skip is applicable to the CU. Note that if LFNST or MIP is activated for the current CU, the implicit MTS transform is set to DCT2. Also, if MTS is enabled for inter-coded blocks, implicit MTS can still be enabled.

[0119] 2.11. LFNST(Low-Frequency Non-Separable Transform) In VVC, as shown in Figure 7, a low-frequency non-separable transform (LFNST), also known as a contraction secondary transform, is applied between the forward primary transform and quantization (encoder side) and between the inverse quantization and the inverse primary transform (decoder side). In the LFNST, a 4x4 non-separable transform or an 8x8 non-separable transform is applied according to the block size. For example, a 4x4 LFNST is applied to small blocks (i.e., min(width, height)<8), and an 8x8 LFNST is applied to larger blocks (i.e., min(width, height)>4).

[0120] FIG. 7 shows an example of LFNST (Low-Frequency Non-Separable Transform) processing.

[0121] The application of the non-separable transform used in LFNST is explained below using the input as an example. To apply 4x4 LFNST, we take a 4x4 input block X

[0122]

number

[0123] But first, the vector X → It is expressed as:

[0124]

number

[0125] Non-separable transformations are

[0126]

number

[0127] where F → denotes the transform coefficient vector, and T is the 16x16 transform matrix. The 16x1 coefficient vector is then reorganized into 4x4 blocks using the scan order of the block (horizontal, vertical, diagonal). Coefficients with smaller indices are arranged in the 4x4 coefficient block with smaller scan indices.

[0128] 2.11.1. Narrowing Non-separable Transformations The Low-Frequency Non-Separable Transform (LFNST) is based on the direct matrix multiplication algorithm to apply the non-separable transform, whereby it is implemented in a single pass without multiple repetitions. However, in order to minimize the computational complexity and the memory space for storing the transform coefficients, it is necessary to reduce the dimension of the non-separable transform matrix. Therefore, in LFNST, the reduced non-separable transform (or RST) method is used. The main idea of the reduced non-separable transform is to map an N-dimensional vector (where N is usually equal to 64 for an 8×8 NSST) to an R-dimensional vector in a different space, and N / R (R < N) is the reduction ratio. Thus, instead of an N×N matrix, the RST matrix becomes an R×N matrix as follows.

[0129]

Number

[0130] Let the rows of the transform R be a basis of R in N-dimensional space. The inverse transform matrix for RT is the transpose of its forward transform. For the 8x8 LFNST, a 4x reduction factor is applied, reducing the traditional 8x8 non-separable transform matrix size of 64x64 direct matrices to 16x48 direct matrices. That is, at the decoder side, a 48x16 inverse RST matrix is ​​used to generate the core (primary) transform coefficients in the upper-left 8x8 region. If a 16x48 matrix is ​​applied instead of a 16x64 matrix with the same transform set configuration, each matrix takes in 48 input data from three 4x4 blocks in the upper-left 8x8 block, excluding the lower-right 4x4 block. The reduced dimensions reduce the memory usage for storing all LFNST matrices from 10KB to 8KB, resulting in a reasonable performance degradation. To reduce complexity, LFNST is restricted to be applicable only when all coefficients outside the first coefficient subgroup are insignificant. Therefore, when LFNST is applied, all leading-only transform coefficients must be zero. This allows for adjustment of the LFNST index signaling at the previous significant position, thus avoiding the extra coefficient scan in the current LFNST design, which is required to check significant coefficients only at specific positions. The worst-case handling of LFNST (in terms of multiplications per pixel) limits non-separable transforms for 4x4 and 8x8 blocks to 8x16 and 8x48 transforms, respectively. In such cases, when LFNST is applied, the previous significant scan position must be less than 8, and less than 16 for other sizes. For blocks with shapes of 4xN, Nx4, and N>8, the proposed restriction means that LFNST is applied only once, and only in the top-left 4x4 region. Because all leading-only coefficients are zero when LFNST is applied, the number of operations required for the primary transform is reduced in such cases. From the encoder's perspective, coefficient quantization becomes significantly simpler when testing LFNST transforms. The first 16 coefficients (in scan order) must undergo maximum distortion-optimized quantization, with the remaining coefficients forced to zero.

[0131] 2.11.2. LFNST Conversion Selection There are four transform sets in total, with two non-separable transform matrices (kernels) per transform set used in LFNST. The mapping from intra prediction modes to transform sets is pre-defined, 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), select transform set 0 for the current chroma block. For each transform set, the selected non-separable secondary transform candidate is further defined by an explicitly signaled LFNST index. The index is signaled in the bitstream once per intra CU after the transform coefficients.

[0132] Table 2-6 Conversion Selection Table

[0133] [Table 6]

[0134] 2.11.3. LFNST Index Signaling and Interaction with Other Tools Because LFNST is restricted to be applicable only when all coefficients outside the first coefficient subgroup are non-significant, LFNST index coding depends on the position of the last significant coefficient. Also, the LFNST index is context coded, but it is independent of the intra prediction mode; only the first bin is context coded. Furthermore, LFNST is applied in both intra- and inter-slices, and for both luma and chroma. When dual trees are enabled, LFNST indexes for luma and chroma are signaled separately. For inter-slices (when dual trees are disabled), a single LFNST index is signaled and used for both luma and chroma.

[0135] When ISP mode is selected, LFNST is disabled and the RST index is not signaled because the performance improvement is marginal even if RST is applied to all feasible partition blocks. Furthermore, disabling RST for ISP predicted residuals may reduce coding complexity. When MIP mode is selected, LFNST is also disabled and the index is not signaled.

[0136] Due to the existing maximum transform size limitation (64x64), considering that CUs larger than 64x64 are implicitly split (TU tiling), LFNST index lookup can increase data buffering by a factor of four for a certain number of stages in the decoding pipeline. Therefore, the maximum size allowed for LFNST is limited to 64x64. Note that LFNST is only enabled for DCT2.

[0137] 2.12. Transform skip for saturation In VVC, chroma TS (Transform Skip) is introduced. The motivation is to unify TS and MTS signaling between luma and chroma by relocating transform_skip_flag and mts_idx to the residual_coding part. One context model is added for chroma TS. For mts_idx, neither the context model nor the binarization is changed. Furthermore, TS residual coding is also applied when using chroma TS.

[0138] Semantics transform_skip_flag[x0][y0][cIdx] specifies whether to apply a transform to the associated transform block. The array index x0,y0 specifies the position (x0,y0) of the top-left luma sample of the considered transform block relative to the top-left luma sample of the picture. When transformation_skip_flag[x0][y0][cIdx] is equal to 1, it specifies that no transform is applied to the current transform block. The array index cIdx specifies the indicator for the color component: equal to 0 for luma, 1 for Cb, and 2 for Cr. transform_skip_flag[x0][y0][cIdx] equal to t0 specifies that the decision whether to apply a transform to the current transform block depends on other syntax elements. If transform_skip_flag[x0][y0][cIdx] is not present, it is inferred to be equal to 0.

[0139] 2.13. BDPCM for chroma In addition to chroma TS support, BDPCM is added to the chroma component. If sps_bdpcm_enable_flag is 1, an additional syntax element sps_bdpcm_chroma_enable_flag is added to SPS. The flag indicates the following behavior, as shown in Table 2-7:

[0140] Table 2-7 sps flags for luma and chroma BDPCM

[0141] [Table 7]

[0142] If BDPCM is available for luma only, the current behavior remains unchanged. If BDPCM is also available for chroma, then bdpcm_chroma_flag is sent for each chroma block, indicating whether BDPCM is used in the chroma block. If on, BDPCM is used for both chroma components, and an additional bdpcm_dir_chroma flag is coded to indicate the prediction direction used for both chroma components.

[0143] The deblocking filter is deactivated at the boundary between two Block-DPCM blocks, since neither block uses the transform stage that typically causes blocking artifacts. This deactivation is performed independently for the luma and chroma components.

[0144] 3. Examples of technical problems that the disclosed solution aims to solve The current design of linear parameter derivation in CCLM and TS has the following problems: 1. For non-4:4:4 color formats, the derivation of linear parameters in CCLM involves the neighboring chroma samples and the neighboring downsampled luma samples. As shown in Figure 8, in the current VVC, if the nearest line is not on a CTU boundary, the second line above the current block for 4:2:2 video is used to derive the neighboring downsampled luma sample. However, for 4:2:2 video, the vertical resolution does not change. Therefore, there is a phase shift between the neighboring downsampled luma sample and the neighboring chroma sample.

[0145] FIG. 8 shows an example of neighboring chroma samples and downsampled neighboring luma samples used to derive CCLM parameters for 4:2:2 video. 2. In the current VVC, the same maximum block size is used in the condition check for signaling the luma transform skip flag and the chroma transform skip flag. Such a design does not consider the color format and is undesirable. a. Similar issues exist for luma BDPCM flag signaling and chroma BDPCM flag signaling, and the same maximum block size is used for the condition check.

[0146] 3. In VVC specified in JVET-Q2001-vE, the left neighbor sample is put into the selected neighbor sample list before the above neighbor sample. However, it may be better to put the above neighbor sample before the left neighbor sample. 4. In VVC specified in JVET-Q2001-vE, two rows of neighboring luma samples are allocated. However, if sps_chroma_vertical_collocated_flag is equal to 1, three rows of neighboring luma samples are required.

[0147] 5. In VVC as specified in JVET-Q2001-vE, if the left neighbor luma sample is not available, the leftmost sample of the current block is used to pad the left neighbor luma sample, and the top-most neighbor luma sample is used to pad the top-left neighbor luma sample. However, the top-most neighbor luma sample is not derived. For example, as described in JVET-Q2001-vE: If -availL is equal to FALSE, the neighboring left luminance sample pY[x][y] with x=-1..-3, y=-1..SubHeightC*numSampL-1 is set equal to luminance sample pY[0][y]. If -numSampT is greater than 0, the top-most luma sample pY[x][y] in the neighborhood x=0..SubWidthC*numSampT-1, y=-1,-2 is set equal to the reconstructed luma sample before deblocking filtering at location (xTbY+x, yTbY+y).

[0148] 6. In VVC specified in JVET-Q2001-vE, the top (or / and left) neighbor luma sample is incorrectly derived if it is unavailable. For example, in JVET-Q2001-vE, "if availT is equal to FALSE, the top-neighbor luma sample pY[x][y] in the neighborhood where x=-1..SubWidthC*numSampT-1, y=-1..-2 is set equal to luma sample pY[x][0]" is used to derive the top-neighbor luma sample if it is unavailable. However, if the top-neighbor luma sample is unavailable, numSampT is set equal to 0. 7. In current VVC, the top-left neighboring luma sample is used to derive CCLM parameters if the top- and left-neighboring luma samples are available, but the top-left neighboring luma sample is not available if it is in a different slice, e.g., in the case of a raster slice.

[0149] 4. Listing of embodiments and techniques The following should be considered examples to illustrate the general concept. These items should not be construed in a narrow sense. Furthermore, these items can be combined in any way.

[0150] In this document, the term "CCLM" refers to a coding tool that utilizes cross-color component information to predict samples / residuals for a current color component or to derive a reconstruction of samples in the current color component. The present invention is not limited to the CCLM technique described in VVC.

[0151] Derivation of linear parameters in CCLM 1. When deriving CCLM parameters for a chroma block, one or more neighboring lines above the aligned luma block may be used to derive the top luma sample of the downsampled aligned neighborhood. a. In one example, if the current chroma block is not at the topmost CTU boundary, the closest line above the aligned luma block may be used to derive the downsampled top aligned luma sample instead of the second line above. i. In one example, one and the same downsampling filter may be used to derive the top luminance sample of the downsampled neighborhood and the left luminance sample of the downsampled neighborhood. 1) For example, a filter

[0121] may be used. More specifically, pDsY[x]=(pY[2*x-1][-1]+2*pY[2*x][-1]+pY[2*x+1][-1]+2)>>2, where pY[2*x][-1], pY[2*x-1][-1], pY[2*x+1][-1] are luminance samples from the nearest neighbor line above, and pDstY[x] denotes the topmost luminance sample in the downsampled neighborhood. ii. In one example, different downsampling filters (e.g., different filter taps / different filter coefficients) may be used to derive the top luma sample of the downsampled neighborhood and the left luma sample of the downsampled neighborhood. iii. In one example, one and the same downsampling filter may be used to derive the top luma sample of a downsampled neighborhood regardless of the location of the chroma block (e.g., the chroma block may or may not be on the upper CTU boundary). iv. In one example, the above method may only be applied to images / videos in 4:2:2 format.

[0152] b. In one example, if the current chroma block is not at the topmost CTU boundary, the upper neighboring luma samples, including the nearest upper line of the placed luma block, excluding the second upper line, may be downsampled and used to derive the placed upper luma sample. c. In one example, the derivation of the top luminance sample in a downsampled neighborhood may depend on samples located on multiple lines. i. In one example, it may depend on both the second closest line and the closest line above the placed luminance block. ii. In one example, the top luminance samples of the downsampled neighbors may be derived using one and the same downsampling filter for different color formats (eg, 4:2:0 and 4:2:2). 1) In one example, a 6-tap filter (eg, [1 2 1;1 2 1]) may be utilized. a) In one example, the top luminance sample in the downsampled neighborhood may be derived as pDsY[x]=(pY[2*x-1][-2]+2*pY[2*x][-2]+pY[2*x+1][-2]+pY[2*x-1][-1]+2*pY[2*x][-1]+pY[2*x+1][-1]+4)>>3, where pY is the corresponding luminance sample and pDstY[x] represents the top luminance sample in the downsampled neighborhood. b) Additionally, alternatively, the above method may be applied when sps_cclm_colocated_chroma_flag is equal to 0. 2) In one example, a 5-tap filter (eg, [0 1 0;1 4 1;0 1 0]) may be utilized. a) In one example, the top luminance sample in the downsampled neighborhood may be derived as pDsY[x]=(pY[2*x][-2]+pY[2*x-1][-1]+4*pY[2*x][-1]+pY[2*x+1][-1]+pY[2*x][0]+4)>>3, where pY is the corresponding luminance sample and pDstY[x] represents the top luminance sample in the downsampled neighborhood. b) Additionally, alternatively, the above method may be applied when sps_cclm_colocated_chroma_flag is equal to 0. iii. In one example, the above method may only be applied to images / videos in 4:2:2 format. Maximum block size for transform skip-coded blocks (e.g., transform_skip_flag equal to 1, or BDPCM or other modes that bypass the transform process / use the identity transform).

[0153] 2. The maximum block size of a transform skip coded block may depend on the color component, where MaxTsSizeY and MaxTsSizeC are the maximum block sizes of a transform skip coded block for luma and chroma, respectively. In one example, the maximum block size for the luma and chroma components may be different. b. In one example, the maximum block sizes for the two chroma components may be different. c. In one example, the maximum block size for luma and chroma components, or for each color component, may be signaled separately. i. In one example, MaxTsSizeC / MaxTsSizeY may be signaled at the sequence level / picture level / slice level / tile group level, e.g., in the sequence header / picture header / SPS / VPS / DPS / PPS / APS / slice header / tile group header. ii. In one example, MaxTsSizeY may be conditionally signaled, for example, according to whether transform skip is enabled or not, or whether / BDPCM is enabled or not. iii. In one example, MaxTsSizeC may be conditionally signaled according to, for example, color format / convert skip enabled or not / BDPCM enabled or not. iv. Alternatively, predictive coding of the largest block size between the luma and chroma components may be used. d. In one example, MaxTsSizeC may depend on MaxTsSizeY. i. In one example, MaxTsSizeC may be set equal to MaxTsSizeY. ii. In one example, MaxTsSizeC may be set equal to MaxTsSizeY / N (where N is an integer), for example, N=2. e. In one example, MaxTsSizeC may be set according to the chroma subsampling ratio. i. In one example, MaxTsSizeC is set equal to MaxTsSizeY>>SubWidthC, where SubWidthC is defined in Table 2-1. ii. In one example, MaxTsSizeC is set equal to MaxTsSizeY>SubHeightC, where SubHeightC is defined in Table 2-1. iii. In one example, MaxTsSizeC is set equal to MaxTsSizeY>>max(SubWidthC, SubHeightC). iv. In one example, MaxTsSizeC is set equal to MaxTsSizeY>>min(SubWidthC, SubHeightC).

[0154] 3. The width and height of the maximum allowable block size for transform-coded blocks may be defined differently. In one example, the width and height of the maximum allowed block size may be signaled separately. b. In one example, the maximum allowed block size width and height for chroma transform coded blocks may be denoted as MaxTsSizeWC and MaxTsSizeHC, respectively. MaxTsSizeWC may be set equal to MaxTsSizeY>>SubWidthC, and MaxTsSizeHC may be set equal to MaxTsSizeY>>SubHeightC. i. In one example, MaxTsSizeY is as defined in bullet 2.

[0155] 4. Whether to signal a transform skip flag for a chroma block (e.g., transform_skip_flag[x0][y0][1] and / or transform_skip_flag[x0][y0][2]) may depend on the maximum allowed size of a chroma transform skip coded block. In one example, the chroma transform skip flag may be conditionally signaled according to the following conditions: i. In one example, the conditions are: 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. 1) In one example, MaxTsSizeC can be defined in the same way as that of bullets 2-3. ii. In one example, the conditions are: tbW is less than or equal to MaxTsSizeWC; tbH is less than or equal to MaxTsSizeHC; tbW and tbH are the width and height of the current chroma block; and MaxTsSizeWC and MaxTsSizeHC represent the width and height of the maximum allowed block size for chroma transform skip coded blocks, respectively. 1) In one example, MaxTsSizeWC and / or MaxTsSizeHC can be defined similarly to that in bullet 3. b. In one example, the above method may be applicable to coding of chroma BDPCM flags (eg, intra_bdpcm_chroma_flag) by replacing "transform skip" with "BDPCM".

[0156] 5. Instead of coding two TS flags for the two saturation color components, it is proposed to use one syntax to indicate the use of TS for the two saturation color components. a. In one example, instead of coding transform_skip_flag[x0][y0][1] and / or transform_skip_flag[x0][y0][2], a single syntax element (eg, TS_chroma_flag) may be coded. i. In one example, the value of a single syntax element is a binary value. 1) Alternatively, the two chroma component blocks share the same TS mode on / off control according to a single syntax element. a) In one example, a single syntax element value equal to 0 indicates that the TS is disabled for both. b) In one example, a single syntax element value equal to 0 indicates that the TS is enabled for both. 2) 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). a) In one example, a value of a single syntax element equal to 0 indicates that TS is disabled for both syntax elements, and a value of a single syntax element equal to 0 indicates that TS is enabled for at least one of the two saturation components. b) A second syntax element may be used to indicate whether the TS applies to either one of the two saturation components and / or whether the TS applies to both. ii. In one example, the value of the single syntax element is a non-binary value. 1) In one example, a single syntax element value equal to K0 indicates that the TS is disabled for both. 2) In one example, a single syntax element value equal to K1 indicates that TS is enabled for the first saturation color component and TS is disabled for the second color component. 3) In one example, a value of a single syntax element equal to K2 indicates that TS is disabled for the first saturation color component and TS is enabled for the second color component. 4) In one example, a single syntax element value equal to K3 indicates that the TS is valid for both. 5) In one example, a single syntax element may be coded using a fixed-length, unary, truncated unary, k-th exponential EG binarization method. iii. In one example, the single syntax element and / or the second syntax element may be context coded or bypass coded.

[0157] General requirements 6. Whether and / or how to apply the above disclosed methods may be signaled at the sequence level / picture level / slice level / tile group level, for example in the sequence header / picture header / SPS / VPS / DPS / PPS / APS / slice header / tile group header.

[0158] 7. Whether and / or how to apply the above disclosed methods may depend on coded information such as color format, single / dual tree split, etc.

[0159] Additional CCLM requirements 8. In the CCLM parameter derivation process, the upper neighboring sample is placed in the selected neighboring sample list before the left neighboring sample, and the selected neighboring sample list is used to derive the CCLM parameters (for example, using a four-point derivation method in which the two larger values ​​are averaged, the two smaller values ​​are averaged, and the two average values ​​are used to derive linear parameters). An example is shown in embodiment 5.

[0160] 9. In the CCLM parameter derivation process, when obtaining the downsampled upper neighbor luma sample indicated by pSelDsY[idx], the index value idx must be in the range of cntL to cntL+cntT-1, where cntL and cntT are the number of left neighbor chroma samples and upper neighbor chroma samples used in the CCLM parameter derivation, respectively. An example is shown in embodiment 5. b. Alternatively, and additionally, place the sample from the left neighbor in the list of selected neighbor samples before the sample from the neighbor above.

[0161] 10. In the CCLM parameter derivation process, the top three rows of neighboring luminance samples are assigned. An example is shown in embodiment 6.

[0162] 11. In the CCLM parameter derivation process, the T1 row and T2 column of the upper left neighboring luminance sample are assigned. In one example, T1 = 2 and T2 = 2. An example is shown in embodiment 12. b. In one example, T1=3 and T2=3.

[0163] 12. In the CCLM parameter derivation process, the number of rows of neighboring luma samples assigned above may depend on a variable or syntax element that indicates 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. In one example, if sps_chroma_vertical_collocated_flag is equal to 1, then three rows of neighboring luma samples above are allocated. Otherwise, two rows of neighboring luma samples above are allocated. An example is shown in embodiment 7.

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

[0165] 14. In the CCLM parameter derivation process, whether and / or how to pad the top-left neighboring samples may depend on the availability of at least one top-left neighboring sample instead of the availability of left neighboring samples and / or top neighboring samples. 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. i. Also, the top slice may be a rectangular slice or a non-rectangular slice. b. In one example, if the upper-left neighboring sample and at least one of the samples of the current block are in different slices, the upper-left neighboring sample is padded. c. In one example, if the availability of at least one top-left neighboring sample is false, the top-left neighboring sample is padded.

[0166] 15. In the CCLM parameter derivation process, the top-left neighboring luminance samples may not be used if they are "unavailable". a. In one example, a neighboring sample is “unavailable” if it is outside the current picture, or the current subpicture, or the current tile, or the current slice, or the current brick, or the current CTU, or the current processing unit, or any other current video unit. i. In one example, for the non-rectangular slice shown in Figure 13, the top-left neighboring luma sample is "unavailable" and is in a different slice than the current block. b. In one example, whether to use the top-left neighboring luma samples in the CCLM process may depend on whether they are in the same picture / subpicture / tile / slice / brick / CTU / processing unit / other video unit as the current block. i. In one example, the top-left neighboring luminance sample may not be used in the processing of CCLM if it is in a different raster slice than the current block. 1) An example is shown in embodiment 10. ii. In one example, the top-left neighboring luma sample may not be used in the CCLM process even though it is in the same picture / subpicture / tile / slice / brick / CTU / processing unit / other video unit as the current block.

[0167] c. In the CCLM parameter derivation process, if the top-left neighboring luma sample is "unavailable", iterative padding may be used to generate the top-left neighboring luma sample. Denote the top-left sample position of the current block by (x,y). Denote the reconstructed luma sample before deblocking filtering by pY[i][j]. Denote the padded top-left luma sample by pD[m][n], where m = x-1..xM, n = y-1..yN, where M and N are integers such as 1. i. In one example, if left and / or top neighboring chroma samples are available, a repeat padding method may be used. ii. In one example, if a top-most neighboring luma sample is available, the top-left neighboring luma sample may be padded from the top-most neighboring luma sample. 2) In one example, pD[m][n]=pY[x][n]. iii. In one example, the top-left neighboring luma sample may be padded from the left neighboring luma sample if the left neighboring luma sample is available. 3) In one example, pD[m][n]=pY[m][y]. iv. In one example, if a top-neighboring luma sample is available and a left-neighboring luma sample is available, the top-left-neighboring luma sample may be padded from the top-neighboring luma sample. 4) In one example, pD[m][n]=pY[x][n]. v. Alternatively, if a top-most neighboring luma sample is available and a left-neighboring luma sample is available, the top-left neighboring luma sample may be padded from the left-neighboring luma sample. 5) In one example, pD[m][n] = pY[m][y]. vi. In one example, M=2, N=2, or M=3, N=3.

[0168] d. Alternatively, if the top-left neighboring luminance samples are "unavailable", they may be replaced with a predefined value. i. In one example, this predefined value may be equal to a constant value (e.g., 128). ii. In one example, the predefined value may be derived using the left and / or top-most neighboring luminance samples. 6) In one example, the predefined value may be equal to the average value of the left and / or top-most neighboring luminance samples. 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.

[0169] e. Alternatively, even if a top-left neighboring luminance sample is "available," the padding method described above in bullet 14.c and predefined values ​​in bullet 14.d may be used to replace the available top-left neighboring luminance sample. i. An example is shown in embodiment 11. 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 and / or whether the top neighboring luma sample is available. i. In one example, the availability of the top-left neighbor luma sample is checked only if both the top-left neighbor luma sample and the above neighbor luma sample are available. An example is shown in embodiment 17.

[0170] g. In one example, how the top-left neighboring luma sample is used and / or padded may depend on the availability of the top-left and / or left and / or top-most neighboring luma sample. i. In one example, the top-left neighboring luminance sample may be used only if the top-left neighboring luminance sample is available. ii. In one example, the top-left neighboring luminance sample may be used only if top-left, left, and top neighboring luminance samples are available. An example is shown in embodiment 18. iii. In one example, if left and / or top neighboring luma samples are available, the top-left neighboring luma sample may be padded. 1) In one example, the top-left neighboring luma sample may be padded only if the left or top neighboring luma sample is available and the top-left neighboring luma sample is not available. 2) In one example, the top-left neighboring luma sample may be padded only if the left or top neighboring luma sample is available and the top-left neighboring luma sample is not available. 3) In one example, the top-left neighboring luma sample may be padded with the neighboring luma sample above. The top-left neighboring luma sample pY[x][y] with x=-1,-2, y=-1,-2 is set equal to luma sample pY[0][y]. An example is shown in embodiment 18. 4) In one example, the top-left neighboring luma sample may be padded with the neighboring luma sample above. The top-left neighboring luma sample pY[x][y] with x=-1,-2, y=-1,-2 is set equal to luma sample pY[x][0]. An example is shown in embodiment 19. 5) In one example, the top-left neighboring luma sample may be padded with the neighboring luma samples above and to the left.

[0171] h. In one example, whether to check the availability of a top-left neighboring luma sample, and / or whether to use a top-left neighboring luma sample, and / or whether to pad a top-left neighboring luma sample may depend on the chroma color format. i. In one example, when a 4:4:4 color format is used, there is no need to check the availability of the top-left neighbor luma sample, and / or there is no need to use the top-left neighbor luma sample, and / or there is no need to pad the top-left neighbor luma sample. An example is shown in embodiment 20. i. In one example, whether to pad the top-left neighboring luma sample and / or which sample needs to be padded may depend on a variable or syntax element that indicates a chroma sample position that is not vertically shifted relative to the corresponding luma sample position, e.g., sps_chroma_vertical_collocated_flag in JVET-Q2001-vE. i. In one example, if sps_chroma_vertical_collocated_flag is equal to 1, then the top-left neighboring sample is padded. Otherwise, the top-left neighboring sample is not padded. An example is shown in embodiment 14.

[0172] 16. During the CCLM process, if the top-most (or / and left-most) neighboring luma sample is not available, it is proposed to use the top-most (or / and left-most) sample of the current block to derive the top-most (or / and left-most) neighboring luma sample, and then use the available left-most (and / or top-most) neighboring luma sample to derive the top-left neighboring sample. a. In one example, if no upper neighboring luma sample is available, the top-most and left-most neighboring luma samples of the current block may be used to derive the top-most and top-left neighboring luma samples. i. In one example, the top neighbor luma sample pY[x][y], where x=0..SubWidthC*nTbW-1, y=-1..-2, is set equal to luma sample pY[x][0], and the top-left neighbor luma sample pY[x][y], where x=-1, y=-1..-2, is set equal to 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. ii. In one example, the top neighbor 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 neighbor 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 shown in embodiment 13. 1) In one example, M and N are integers, such as M=2 and N=3. 2) In one example, M may depend on the saturation color format, such as M=SubWidthC as defined in 2.1. 3) In one example, up to T top-left neighboring luma samples may be padded, where T is an integer such as 1. a) In one example, pY[-M][-1]=pY[-M][0], where M=1 or M=SubWidthC.

[0173] b. In one example, if no left neighboring luma sample is available, the leftmost and topmost neighboring luma samples of the current block may be used to derive the left and top-left neighboring luma samples. i. In one example, the left neighbor luma sample pY[x][y], where x=0..-3, y=-1..SubHeightC*nTbH-1, is set equal to luma sample pY[0][y], and the top-left neighbor luma sample pY[x][y], where x=0..-3, y=-1, is set equal to 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. ii. In one example, the left neighboring luma sample pY[x][y], where x=-1..-M, y=0..SubHeightC*nTbH-1, is set equal to luma sample pY[0][y]. And the top-left neighboring luma sample pY[x][y], where x=-1..-M, y=-1..-N, is set equal to 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 shown in embodiment 15. 1) In one example, M and N are integers, such as M=1 and N=3. 2) In one example, N may depend on the saturation color format, such as N=SubHeightC as defined in 2.1. 3) In one example, up to T top-left neighboring luma samples may be padded, where T is an integer such as 1. a) In one example, pY[-1][-N]=pY[0][-N], where N=1 or N=SubHeightC. b) Or, T is equal to 2. pY[-1][-1]=pY[0][-1], pY[-1][-2]=pY[0][-2]. iii. In one example, the top-left luminance neighboring sample may be padded after the derivation of the top-most neighboring luminance sample. An example is shown in embodiment 16.

[0174] c. In one example, the top-left neighboring luminance sample derived in bullet 13 may be used during the padding process of the top (or / and left) neighboring luminance sample. d. In one example, whether the top (or left) neighboring luma (or chroma) sample is padded and / or which neighboring samples need to be padded may depend on the chroma color format. In one example, when a 4:4:4 color format is used, there is no need to pad the top (or / and left) neighboring luma samples. An example is shown in embodiment 21. e. In one example, when padding the top (or / and left) neighboring luminance sample, the top-left neighboring luminance sample is padded using a method such as 15.c. in 15. An example is shown in embodiment 22.

[0175] 17. In the CCLM prediction process, padding of the top neighboring sample, the left neighboring sample, and the top-left neighboring sample may be performed in a fixed order. The neighboring samples may be luma samples or chroma samples. For example, the order may be padding of the top neighboring sample, padding of the left neighboring sample, and padding of the top-left neighboring sample. b. For example, the order may be padding of the left neighbor, padding of the top neighbor sample, and padding of the top-left neighbor sample. c. For example, the order may be padding of the top left neighbor, padding of the top neighbor sample, and padding of the left neighbor sample. d. For example, the order may be padding of the top-left neighbor, padding of the left neighbor sample, and padding of the top-most neighbor sample.

[0176] 18. The downsampling process in CCLM for 4:2:2 color format video may be decoupled from the syntax element or variable (such as sps_chroma_vertical_collocated_flag in JVET-Q2001-vE) that indicates whether chroma sample positions are vertically shifted relative to the corresponding luma sample positions. a. In one example, the downsampling process may refer to downsampling the neighboring luma samples above, and / or downsampling the neighboring luma samples to the left, and / or downsampling the samples in the current luma block. b. In one example, 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]) may be used during downsampling in CCLM for 4:2:2 color format video, regardless of whether sps_chroma_vertical_collocated_flag is equal to 1 or 0. Examples are shown in embodiments 27 and 28.

[0177] 19. In one example, a variable or syntax element indicating whether 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 as a default value, such as 0 or 1, for 4:2:2 and / or 4:4:4 color formats. a. If sps_chroma_vertical_collocated_flag is not present, it may be inferred to be equal to 1. b. If sps_chroma_vertical_collocated_flag is not present, it may be inferred to be equal to 0.

[0178] 20. A variable representing a neighboring luminance sample can be used in CCLM processing only if it is set equal to a valid value. An example is shown in embodiment 29 and embodiment 30. a. In one example, a variable representing the luma sample above the neighborhood may be set equal to the reconstructed luma sample before deblocking filtering. i. In one example, if the neighboring luma sample is available (e.g., in JVET-Q2001-vE, availT is equal to true), a variable representing the neighboring luma sample, denoted pY[x][y], is set equal to the reconstructed luma sample before deblocking filtering at the position where (xTbY, yTbY) represents the top-left position of the current block. 1) In one example, x and y may be in the range x=0..SubWidthC*max(numSampT,nTbW)-1, y=-1,-2, where nTbW denotes the width of the current block, SubWidthC is defined in 2.1, and numSampT denotes the number of available neighboring chroma samples above and to the right, as defined in JVET-Q2001-vE. b. In one example, a variable representing the left neighboring luma sample may be set equal to the reconstructed luma sample before deblocking filtering. i. In one example, if the neighboring left luma sample is available (e.g., in JVET-Q2001-vE, availT is equal to true), a variable representing the neighboring left luma sample, denoted pY[x][y], is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y), where (xTbY, yTbY) represents the top-left position of the current block. 1) In one example, x and y may be in the range of x=-1..-3, y=0..SubHeightC*max(numSampL,nTbH)-1, where nTbH is the width of the current block, and SubHeightC is defined as 2.1, and numSampL indicates the number of nearby chroma samples available on the left and bottom left, as defined in JVET-Q2001-vE.

[0179] 21. The slice type of a slice may depend on the reference picture entry of the slice. a. In one example, if the number of reference picture entries in list 0 is equal to 0 and the number of reference picture entries in list 1 is equal to 0, the slice type must be an I-slice. i. In one example, in this case, no slice type is signaled. b. In one example, if the number of reference picture entries in list 0 is greater than 0 and the number of reference picture entries in list 1 is equal to 0, the slice type must be a P-slice. i. Alternatively, if the number of reference picture entries in list 0 is greater than 0 and the number of reference picture entries in list 1 is equal to 0, the slice type cannot be a B-slice. ii. In one example, in this case, the slice type is not signaled. c. The reference picture entries for a slice may be signaled or inferred before the slice type is signaled or inferred. i. The reference picture entries for a slice may be signaled in the picture header associated with the picture.

[0180] 22. The total number of filters allowed in an APS or the total number of APSs may be limited based on coded information such as the number of sub-pictures. a. The total number of allowed filters for an APS may include the total number of ALFs (luminance / chroma ALF and CC-ALF in the APS) of all APS NAL units that have a PU. b. The total number of allowed filters in an APS may include the total number of adaptive loop filter classes for the luma component (or luma ALF filters), the total number of alternative filters for the chroma component (chroma ALF filters), and / or the total number of chroma component filters in all APS NAL units with PUs. c. APS is ALF APS / scaled list APS / LMCS APS. d. The method of signaling the APS ID and / or the number of APSs used in a video unit is subject to a limited number.

[0181] 23. Conforming bitstreams shall follow the rule that if BDPCM is enabled for a video unit (sequence / picture / slice / tile / brick / subpicture, etc.), code data hiding shall be disabled. a. Alternatively, a conforming bitstream shall follow the rule that if code data hiding is enabled for a video unit (sequence / picture / slice / tile / brick / subpicture, etc.), BDPCM is disabled.

[0182] 24. Conforming bitstreams shall follow the rule that for a video unit (sequence / picture / slice / tile / brick / subpicture, etc.), if a transform skip / coding tool that applies only the identity transform is in effect, then code data hiding shall be disabled. a. Alternatively, the adaptive bitstream shall follow the rule that when code data hiding is enabled for a video unit (sequence / picture / slice / tile / brick / subpicture, etc.), transform skipping / coding tools that apply only identity transforms shall be disabled.

[0183] 25. Conforming bitstreams shall follow the rule that if BDPCM is enabled for a video unit (sequence / picture / slice / tile / brick / subpicture, etc.), DQ (Dependent Quantization) shall be disabled. a. Alternatively, a conforming bitstream shall follow the rule that if DQ is enabled for a video unit (sequence / picture / slice / tile / brick / subpicture, etc.), BDPCM is disabled.

[0184] 26. Conforming bitstreams shall follow the rule that for a video unit (sequence / picture / slice / tile / brick / subpicture, etc.), if a transform skip / coding tool that applies only the identity transform is enabled, then DQ (Dependent Quantization) shall be disabled. a. Alternatively, a conforming bitstream shall follow the rule that if DQ is enabled for a video unit (sequence / picture / slice / tile / brick / subpicture, etc.), then transform skipping / coding tools that apply only the identity transform shall be disabled.

[0185] 5. Implementation This section presents exemplary embodiments and how the current VVC standard can be modified to account for these embodiments. Changes to the VVC specification are highlighted in bold and italic text. Deleted text is marked in double brackets (e.g., [[a]] means the letter "a" is deleted).

[0186] 5.1. Embodiment 1 The working draft specified in JVET-P2001-v9 can be modified as follows:

[0187] 8.4.5.2.13 INTRA_LT_CCLM, INTRA_L_CCLM, and INTRA_T_CCLM Intra Prediction Mode Specifications …

[0188] 3. The downsampled and arranged luminance samples pDsY[x][y] when x=0..nTbW-1 and y=0..nTbH-1 are derived as follows: -If both SubWidthC and SubHeightC are equal to 1, the following applies: - pDsY[x][y] where x=1..nTbW-1, y=1..nTbH-1 is derived as follows: pDstY[x][y]=pY[x][y] (8-159) - Otherwise, the following applies: The one-dimensional filter coefficient arrays F1 and F2 and the two-dimensional filter coefficient arrays F3 and F4 are defined as follows: F1[i]=1,i=0..1 (8-160) F2[0]=1,F2[1]=2,F2[2]=1 (8-161) F3[i][j]=F4[i][j]=0,i=0..2,j=0..2 (8-162) -If both SubWidthC and SubHeightC are equal to 2, the following applies: F1[0]=1,F1[1]=1 (8-163) F3[0][1]=1,F3[1][1]=4,F3[2][1]=1,F3[1][0]=1,F3[1][2]=1 (8-164) F4[0][1]=1,F4[1][1]=2,F4[2][1]=1 (8-165) F4[0][2]=1,F4[1][2]=2,F4[2][2]=1 (8-166) - Otherwise, the following applies: F1[0]=2,F1[1]=0 (8-167) F3[1][1]=8 (8-168) F4[0][1]=2,F4[1][1]=4,F4[2][1]=2 (8-169) …

[0189] 5. If numSampT is greater than 0, the top chroma sample of the selected neighborhood, pSelC[idx], is set equal to p[pickPost[idx-cntL][-1], where idx=cntL..cntL+cntT-1], and the top luma sample of the downsampled neighborhood, pSelDsY[idx], for idx=0..cntL+cntT-1, is defined as follows: … - Otherwise (sps_cclm_colocated_chroma_flag is equal to 0), the following applies: If -x is greater than 0, the following applies: If -bCTUboundary is equal to FALSE, the following applies: pSelDsY[idx]=(F4[0][1]*pY[SubWidthC*x-1][[[-2]]-1]+ F4[0][2]*pY[SubWidthC*x-1][[[-1]]-2]+ F4[1][1]*pY[SubWidthC*x][[[-2]]-1]+ F4[1][2]*pY[SubWidthC*x][[[-1]]-2]+ F4[2][1]*pY[SubWidthC*x+1][[[-2]]-1]+ F4[2][2]*pY[SubWidthC*x+1][[[-1]]-2]+4)>>3 (8-193) Otherwise (bCTUboundary is equal to TRUE), the following applies: pSelDsY[idx]=(F2[0]*pY[SubWidthC*x-1][-1]+ F2[1]*pY[SubWidthC*x][-1]+ F2[2]*pY[SubWidthC*x+1][-1]+2)>>2 (8-194) - Otherwise (x is equal to 0), the following applies: If -availTL is equal to TRUE and bCTUboundary is equal to FALSE, the following applies: 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]+F4[2][1]*pY[1][[[-2]]-1]+F4[2][2]*pY[1][[[-1]]-2]+4)>>3 (8-195) Otherwise, if availTL is equal to TRUE and bCTUboundary is equal to TRUE, the following applies: pSelDsY[idx]=(F2[0]*pY[-1][-1]+F2[1]*pY[0][-1]+ F2[2]*pY[1][-1]+2)>>2 (8-196) Otherwise, if availTL is equal to FALSE and bCTUboundary is equal to FALSE, the following applies: pSelDsY[idx]=(F1[1]*pY[0][-2]+F1[0]*pY[0][-1]+1)>>1 (8-197) Otherwise (availTL is equal to FALSE and bCTUboundary is equal to TRUE), the following applies: pSelDsY[idx]=pY[0][-1] (8-198) …

[0190] 5.2. Embodiment 2 In this embodiment, an example of chroma transform skip flag coding according to the maximum allowable transform skip coded block size is shown. The working draft specified in JVET-P2001-v9 can be modified as follows:

[0191] 7.3.9.10 Transformation Unit Syntax …

[0192] [Table 8]

[0193]

[0194] 5.3. Embodiment 3 In this embodiment, an example of chroma transform skip flag coding according to the maximum allowable transform skip coded block size is shown. The working draft specified in JVET-P2001-v9 can be modified as follows:

[0195] 7.3.9.5 Coding Unit Syntax …

[0196] [Table 9]

[0197]

[0198] 5.4. Embodiment 4 The working draft specified in JVET-Q2001-vE can be modified as follows:

[0199] 8.4.5.2.13 The inputs to this process are: - intra prediction mode predModeIntra, - sample position (xTbC, yTbC) of the top left sample of the current transform block relative to the top left sample of the current picture, - the variable nTbW that defines the width of the transformation block, - variable nTbH, which defines the height of the transformation block; - a variable cIdx that defines the color component of the current block, - Let x=-1, y=0..2*nTbH-1 and x=0..2*nTbW-1, y=-1, and let p[x][y] be the saturation neighborhood sample.

[0200] The output of this process is the predicted samples preSamples[x][y], where x=0..nTbW-1, y=0..nTbH-1. The current luminance position (xTbY, yTbY) is derived as follows: (xTbY,yTbY)=(xTbC<<(SubWidthC-1),yTbC<<(SubHeightC-1)) (351) The variables availL, availT and availTL are derived as follows: The derivation process for neighborhood block availability specified in Section 6.4.4 starts with the current luminance position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighborhood luminance position (xTbY-1, yTbY), checkPredModeY set equal to FALSE, and cIdx as inputs, and assigns the output to availL. The derivation process for neighborhood block availability specified in Section 6.4.4 starts with the current luminance position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighborhood luminance position (xTbY, yTbY-1), checkPredModeY set equal to FALSE, and cIdx as inputs, and assigns the output to availT.

[0201] The variable availTL is derived as follows: availTL=availL&&availT (352) - The number of available top right neighbor chroma samples, numTopRight, is derived as follows: The variable numTopRight is set equal to 0 and availTR is set equal to TRUE. -If preModeIntra 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: The derivation process for neighborhood block availability specified in Section 6.4.4 starts with the current luminance position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighborhood luminance position (xTbY+x, yTbY-1), checkPredModeY set equal to FALSE, and cIdx as inputs, and assigns the output to availTR. If -availTR is equal to TRUE, numTopRight is increased by one. - The number of available bottom-left neighbor chroma samples, numLeftBelow, is derived as follows: The variable numLeftBelow is set equal to 0 and availLB is set equal to TRUE. -If preModeIntra 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: The derivation process for neighborhood block availability specified in Section 6.4.4 is invoked with the current luminance position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighborhood luminance position (xTbY-1, yTbY+y), checkPredModeY set equal to FALSE, and cIdx as inputs, and assigns the output to availLB. If -availLB is equal to TRUE, numLeftBelow is increased by one.

[0202] The number of available neighboring chroma samples in the top and top-right numSampT and the number of available neighboring chroma samples in the left and bottom-left numSampL are derived as follows: If -predModeIntra is equal to INTRA_LT_CCLM, the following applies: numSampT=availT?nTbW:0 (353) numSampL=availL?nTbH:0 (354) - Otherwise, the following applies: numSampT=(availT&&predModeIntra==INTRA_T_CCLM)?(nTbW+Min(numTopRight,nTbH)):0 (355) numSampL=(availL&&predModeIntra==INTRA_L_CCLM)?(nTbH+Min(numLeftBelow,nTbW)):0 (356)

[0203] The variable bCTUboundary is derived as follows: bCTUboundary=(yTbY&(CtbSizeY-1)==0)?TRUE:FALSE (357) The variable cntN and the array pickPosN, in which N is replaced with L and T, are derived as follows: The variable numIs4N is derived as follows: numIs4N=((availT&&availL&&predModeIntra==INTRA_LT_CCLM)?0:1) (358) The variable startPosN is set equal to numSampN>(2+numIs4N). The variable pickStepN is set equal to Max(1,numSampN>(1+numIs4N)). If -availN is equal to TRUE and preModeIntra is equal to INTRA_LT_CCLM or INTRA_N_CCLM, the following allocation occurs: -cntN is set equal to Min(numSampN, (1+numIs4N)<<1). -pospickPosN[pos] is set equal to (startPosN+pos*pospickStepN), where pos=0..cntN-1. Otherwise, cntN is set equal to 0.

[0204] The predicted samples predSamples[x][y], where x=0..nTbW-1 and y=0..nTbH-1, are derived as follows: If both -numSampL and numSampT are equal to 0, the following applies: predSamples[x][y]=1<<(BitDepth-1) (359) - Otherwise, the following ordered steps apply: 1. The co-located luma sample pY[x][y], where x=0..nTbW*SubWidthC-1, y=0..nTbH*SubHeightC-1, is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y). 2. The neighboring luminance samples pY[x][y] are derived as follows: If -numSampL is greater than 0, the nearby left luma sample pY[x][y] for x=-1..-3, y=0..SubHeightC*numSampL-1 is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y). If -availT is equal to FALSE, the top-most luminance sample pY[x][y] in the neighborhood with x=-1..SubWidthC*numSampT-1, y=-1..-2 is set equal to the luminance sample pY[x][0]. If -availL is equal to FALSE, the left luminance sample pY[x][y] in the neighborhood with x=-1..-3, y=-1..SubHeightC*numSampL-1 is set equal to luminance sample pY[0][y]. If -numSampT is greater than 0, the top-most luma sample pY[x][y] in the neighborhood with x=0..SubWidthC*numSampT-1, y=-1,-2 is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y). If -availTL is equal to TRUE, the top-left neighboring luma sample pY[x][y] at x=-1, y=-1,-2 is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y).

[0205] 3. The downsampled and arranged luminance samples pDsY[x][y] when x=0..nTbW-1, y=0..nTbH-1 are derived as follows: -If both SubWidthC and SubHeightC are equal to 1, the following applies: pDsY[x][y] where x=1..nTbW-1 and y=1..nTbH-1 is derived as follows: pDstY[x][y]=pY[x][y] (360) - Otherwise, the following applies: The one-dimensional filter coefficient arrays F1 and F2 and the two-dimensional filter coefficient arrays F3 and F4 are defined as follows: F1[0]=2,F1[1]=0 (361) F2[0]=1,F2[1]=2,F2[2]=1 (362) F3[i][j]=F4[i][j]=0,i=0..2,j=0..2 (363) -If both SubWidthC and SubHeightC are equal to 2, the following applies: F1[0]=1,F1[1]=1 (364) F3[0][1]=1,F3[1][1]=4,F3[2][1]=1,F3[1][0]=1,F3[1][2]=1 (365) F4[0][1]=1,F4[1][1]=2,F4[2][1]=1 (366) F4[0][2]=1,F4[1][2]=2,F4[2][2]=1 (367) - Otherwise, the following applies: F3[1][1]=8 (368) F4[0][1]=2,F4[1][1]=4,F4[2][1]=2 (369)

[0206] If -sps_chroma_vertical_collocated_flag is equal to 1, the following applies: pDsY[x][y] where x=1..nTbW-1 and y=1..nTbH-1 is derived as follows: pDsY[x][y]=(F3[1][0]*pY[SubWidthC*x][SubHeightC*y-1]+ F3[0][1]*pY[SubWidthC*x-1][SubHeightC*y]+ F3[1][1]*pY[SubWidthC*x][SubHeightC*y]+ F3[2][1]*pY[SubWidthC*x+1][SubHeightC*y]+ F3[1][2]*pY[SubWidthC*x][SubHeightC*y+1]+4)>>3 (370) - Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies: pDsY[x][y] where x=1..nTbW-1 and y=1..nTbH-1 is derived as follows: pDsY[x][y]=(F4[0][1]*pY[SubWidthC*x-1][SubHeightC*y]+ F4[0][2]*pY[SubWidthC*x-1][SubHeightC*y+1]+ F4[1][1]*pY[SubWidthC*x][SubHeightC*y]+ F4[1][2]*pY[SubWidthC*x][SubHeightC*y+1]+ F4[2][1]*pY[SubWidthC*x+1][SubHeightC*y]+ F4[2][2]*pY[SubWidthC*x+1][SubHeightC*y+1]+4)>>3 (371)

[0207] 4. If numSampL is greater than 0, the selected neighboring left chroma sample pSelC[idx] is set equal to p[-1][pickPosL[idx]] for idx=0..cntL-1, and the selected downsampled neighboring left luma sample pSelDsY[idx] for idx=0..cntL-1 is derived as follows: The variable y is set equal to pickPosL[idx]. -If both SubWidthC and SubHeightC are equal to 1, the following applies: pSelDsY[idx]=pY[-1][y] (372) - Otherwise, the following applies: If -sps_chroma_vertical_collocated_flag is equal to 1, the following applies: pSelDsY[idx]=(F3[1][0]*pY[-SubWidthC][SubHeightC*y-1]+ F3[0][1]*pY[-1-SubWidthC][SubHeightC*y]+ F3[1][1]*pY[-SubWidthC][SubHeightC*y]+ F3[2][1]*pY[1-SubWidthC][SubHeightC*y]+ F3[1][2]*pY[-SubWidthC][SubHeightC*y+1]+4)>>3 (373) - Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies: pSelDsY[idx]=(F4[0][1]*pY[-1-SubWidthC][SubHeightC*y]+ F4[0][2]*pY[-1-SubWidthC][SubHeightC*y+1]+ F4[1][1]*pY[-SubWidthC][SubHeightC*y]+ F4[1][2]*pY[-SubWidthC][SubHeightC*y+1]+ F4[2][1]*pY[1-SubWidthC][SubHeightC*y]+ F4[2][2]*pY[1-SubWidthC][SubHeightC*y+1]+4)>>3 (374)

[0208] 5. If numSampT is greater than 0, the top chroma sample of the selected neighborhood pSelC[idx] is set equal to p[pickPost[idx-cntL][-1], where idx=cntL..cntL+cntT-1], and the top luma sample of the downsampled neighborhood pSelDsY[idx], where idx=0..cntL+cntT-1, is defined as follows: - The variable x is set equal to pickPost[idx-cntL]. -If both SubWidthC and SubHeightC are equal to 1, the following applies: pSelDsY[idx]=pY[x][-1] (375) - Otherwise, the following applies: If -sps_chroma_vertical_collocated_flag is equal to 1, the following applies: If -bCTUboundary is equal to FALSE, the following applies: pSelDsY[idx]=(F3[1][0]*pY[SubWidthC*x][-1-SubHeightC]+ F3[0][1]*pY[SubWidthC*x-1][-SubHeightC]+ F3[1][1]*pY[SubWidthC*x][-SubHeightC]+ F3[2][1]*pY[SubWidthC*x+1][-SubHeightC]+ F3[1][2]*pY[SubWidthC*x][1-SubHeightC]+4)>>3 (376) Otherwise (bCTUboundary is equal to TRUE), the following applies: pSelDsY[idx]=(F2[0]*pY[SubWidthC*x-1][-1]+ F2[1]*pY[SubWidthC*x][-1]+ F2[2]*pY[SubWidthC*x+1][-1]+2)>>2 (377) - Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies: If -bCTUboundary is equal to FALSE, the following applies: pSelDsY[idx]=(F4[0][1]*pY[SubWidthCx-1][-1]+ F4[0][2]*pY[SubWidthC*x-1][-2]+ F4[1][1]*pY[SubWidthC*x][-1]+ F4[1][2]*pY[SubWidthC*x][-2]+ F4[2][1]*pY[SubWidthC*x+1][-1]+ F4[2][2]*pY[SubWidthC*x+1][-2]+4)>>3 (378) Otherwise (bCTUboundary is equal to TRUE), the following applies: pSelDsY[idx]=(F2[0]*pY[SubWidthC*x-1][-1]+ F2[1]*pY[SubWidthC*x][-1]+ F2[2]*pY[SubWidthC*x+1][-1]+2)>>2 (379)]]

[0209] [ka]

[0210] [ka]

[0211] [ka]

[0212] [ka]

[0213] 6. If cntT + cntL is not equal to 0, then the variables minY, maxY, minC, and maxC are derived as follows: If -cntT+cntL is equal to 2, then with Comp substituted for DsY and C, pSelComp[3] is set equal to pSelComp[0], pSelComp[2] is set equal to pSelComp[1], pSelComp[0] is set equal to pSelComp[1], and pSelComp[1] is set equal to pSelComp[3]. The arrays minGrpIdx and maxGrpIdx are derived as follows: minGrpIdx[0]=0 (380) minGrpIdx[1]=2 (381) maxGrpIdx[0]=1 (382) maxGrpIdx[1]=3 (383) -If pSelDsY[minGrpIdx[0]] is greater than pSelDsY[minGrpIdx[1]], minGrpIdx[0] and minGrpIdx[1] are swapped as follows: (minGrpIdx[0],minGrpIdx[1])=Swap(minGrpIdx[0],minGrpIdx[1]) (384) - If pSelDsY[maxGrpIdx[0]] is greater than pSelDsY[maxGrpIdx[1]], maxGrpIdx[0] and maxGrpIdx[1] are swapped as follows: (maxGrpIdx[0],maxGrpIdx[1])=Swap(maxGrpIdx[0],maxGrpIdx[1]) (385) - If pSelDsY[minGrpIdx[0]] is greater than pSelDsY[maxGrpIdx[1]], the arrays minGrpIdx and maxGrpIdx are swapped as follows: (minGrpIdx,maxGrpIdx)=Swap(minGrpIdx,maxGrpIdx) (386) - If pSelDsY[minGrpIdx[1]] is greater than pSelDsY[maxGrpIdx[0]], minGrpIdx[1] and maxGrpIdx[0] are swapped as follows: (minGrpIdx[1],maxGrpIdx[0])=Swap(minGrpIdx[1],maxGrpIdx[0]) (387) The variables maxY, maxC, minY and minC are derived as follows: maxY=(pSelDsY[maxGrpIdx[0]]+pSelDsY[maxGrpIdx[1]]+1)>>1 (388) maxC=(pSelC[maxGrpIdx[0]]+pSelC[maxGrpIdx[1]]+1)>>1 (389) minY=(pSelDsY[minGrpIdx[0]]+pSelDsY[minGrpIdx[1]]+1)>>1 (390) minC=(pSelC[minGrpIdx[0]]+pSelC[minGrpIdx[1]]+1)>>1 (391)

[0214] 7. The variables a, b, and k are derived as follows: If -numSampL is equal to 0 and numSampT is equal to 0, the following applies: k=0 (392) a=0 (393) b=1<<(BitDepth-1) (394) - Otherwise, the following applies: diff=maxY-minY (395) If -diff is not equal to 0, the following applies: diffC=maxC-minC (396) x=Floor(Log2(diff)) (397) normDiff=((diff<<4)>>x)&15 (398) x+=(normDiff!=0)?1:0 (399) y=Abs(diffC)>0?Floor(Log2(Abs(diffC)))+1:0 (400) a=(diffC*(divSigTable[normDiff]|8)+2 y-1 )>>y (401) k=((3+xy)<1)?1:3+xy (402) a=((3+xy)<1)? Sign(a)*15:a (403) b=minC-((a*minY)>>k) (404) Here, divSigTable[] is defined as follows: divSigTable[]={0,7,6,5,5,4,4,3,3,2,2,1,1,1,1,0} (405) - Otherwise (diff is equal to 0), the following applies: k=0 (406) a=0 (407) b=minC (408)

[0215] 8. The predicted samples predSamples[x][y], where x=0..nTbW-1 and y=0..nTbH-1, are derived as follows: predSamples[x][y]=Clip1(((pDsY[x][y]*a)>>k)+b) (409) Note - This process uses sps_chroma_vertical_collocated_flag, but for simplicity of implementation, does not use sps_chroma_horizontal_collocated_flag.

[0216] 5.5. Embodiment 5 The working draft specified in JVET-Q2001-vE can be modified as follows:

[0217] 8.4.5.2.13 The inputs to this process are: - intra prediction mode predModeIntra, - sample position (xTbC, yTbC) of the top left sample of the current transform block relative to the top left sample of the current picture, - the variable nTbW that defines the width of the transformation block, - variable nTbH, which defines the height of the transformation block; - a variable cIdx that defines the color component of the current block, - Let x=-1, y=0..2*nTbH-1 and x=0..2*nTbW-1, y=-1, and let p[x][y] be the saturation neighborhood sample.

[0218] The output of this process is the predicted samples preSamples[x][y], where x=0..nTbW-1, y=0..nTbH-1. The current luminance position (xTbY, yTbY) is derived as follows: (xTbY,yTbY)=(xTbC<<(SubWidthC-1),yTbC<<(SubHeightC-1)) (351) The variables availL, availT and availTL are derived as follows: The derivation process for neighborhood block availability specified in Section 6.4.4 starts with the current luminance position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighborhood luminance position (xTbY-1, yTbY), checkPredModeY set equal to FALSE, and cIdx as inputs, and assigns the output to availL. The derivation process for neighborhood block availability specified in Section 6.4.4 starts with the current luminance position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighborhood luminance position (xTbY, yTbY-1), checkPredModeY set equal to FALSE, and cIdx as inputs, and assigns the output to availT.

[0219] The variable availTL is derived as follows: availTL=availL&&availT (352) - The number of available top right neighbor chroma samples, numTopRight, is derived as follows: The variable numTopRight is set equal to 0 and availTR is set equal to TRUE. -If preModeIntra 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: The derivation process for neighborhood block availability specified in Section 6.4.4 starts with the current luminance position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighborhood luminance position (xTbY+x, yTbY-1), checkPredModeY set equal to FALSE, and cIdx as inputs, and assigns the output to availTR. If -availTR is equal to TRUE, numTopRight is increased by one. - The number of available bottom-left neighbor chroma samples, numLeftBelow, is derived as follows: The variable numLeftBelow is set equal to 0 and availLB is set equal to TRUE. -If preModeIntra 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: The derivation process for neighborhood block availability specified in Section 6.4.4 is invoked with the current luminance position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighborhood luminance position (xTbY-1, yTbY+y), checkPredModeY set equal to FALSE, and cIdx as inputs, and assigns the output to availLB. If -availLB is equal to TRUE, numLeftBelow is increased by one.

[0220] The number of available neighboring chroma samples in the top and top-right numSampT and the number of available neighboring chroma samples in the left and bottom-left numSampL are derived as follows: If -predModeIntra is equal to INTRA_LT_CCLM, the following applies: numSampT=availT?nTbW:0 (353) numSampL=availL?nTbH:0 (354) - Otherwise, the following applies: numSampT=(availT&&predModeIntra==INTRA_T_CCLM)?(nTbW+Min(numTopRight,nTbH)):0 (355) numSampL=(availL&&predModeIntra==INTRA_L_CCLM)?(nTbH+Min(numLeftBelow,nTbW)):0 (356)

[0221] The variable bCTUboundary is derived as follows: bCTUboundary=(yTbY&(CtbSizeY-1)==0)?TRUE:FALSE (357) The variable cntN and the array pickPosN, in which N is replaced with L and T, are derived as follows: The variable numIs4N is derived as follows: numIs4N=((availT&&availL&&predModeIntra==INTRA_LT_CCLM)?0:1) (358) The variable startPosN is set equal to numSampN>(2+numIs4N). The variable pickStepN is set equal to Max(1,numSampN>(1+numIs4N)). If -availN is equal to TRUE and preModeIntra is equal to INTRA_LT_CCLM or INTRA_N_CCLM, the following allocation occurs: -cntN is set equal to Min(numSampN, (1+numIs4N)<<1). -pospickPosN[pos] is set equal to (startPosN+pos*pospickStepN), where pos=0..cntN-1. Otherwise, cntN is set equal to 0.

[0222] The predicted samples predSamples[x][y], where x=0..nTbW-1 and y=0..nTbH-1, are derived as follows: If both -numSampL and numSampT are equal to 0, the following applies: predSamples[x][y]=1<<(BitDepth-1) (359) - Otherwise, the following ordered steps apply: 1. The co-located luma sample pY[x][y], where x=0..nTbW*SubWidthC-1, y=0..nTbH*SubHeightC-1, is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y). 2. The neighboring luminance samples pY[x][y] are derived as follows: If -numSampL is greater than 0, the nearby left luma sample pY[x][y] for x=-1..-3, y=0..SubHeightC*numSampL-1 is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y). If -availT is equal to FALSE, the top-most luminance sample pY[x][y] in the neighborhood with x=-1..SubWidthC*numSampT-1, y=-1..-2 is set equal to the luminance sample pY[x][0]. If -availL is equal to FALSE, the left luminance sample pY[x][y] in the neighborhood with x=-1..-3, y=-1..SubHeightC*numSampL-1 is set equal to luminance sample pY[0][y]. If -numSampT is greater than 0, the top-most luma sample pY[x][y] in the neighborhood with x=0..SubWidthC*numSampT-1, y=-1,-2 is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y). If -availTL is equal to TRUE, the top-left neighboring luma sample pY[x][y] at x=-1, y=-1,-2 is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y).

[0223] 3. The downsampled and arranged luminance samples pDsY[x][y] when x=0..nTbW-1 and y=0..nTbH-1 are derived as follows: -If both SubWidthC and SubHeightC are equal to 1, the following applies: pDsY[x][y] where x=1..nTbW-1 and y=1..nTbH-1 is derived as follows: pDstY[x][y]=pY[x][y] (360) - Otherwise, the following applies: The one-dimensional filter coefficient arrays F1 and F2 and the two-dimensional filter coefficient arrays F3 and F4 are defined as follows: F1[0]=2,F1[1]=0 (361) F2[0]=1,F2[1]=2,F2[2]=1 (362) F3[i][j]=F4[i][j]=0,i=0..2,j=0..2 (363) -If both SubWidthC and SubHeightC are equal to 2, the following applies: F1[0]=1,F1[1]=1 (364) F3[0][1]=1,F3[1][1]=4,F3[2][1]=1,F3[1][0]=1,F3[1][2]=1 (365) F4[0][1]=1,F4[1][1]=2,F4[2][1]=1 (366) F4[0][2]=1,F4[1][2]=2,F4[2][2]=1 (367)

[0224] - Otherwise, the following applies: F3[1][1]=8 (368) F4[0][1]=2,F4[1][1]=4,F4[2][1]=2 (369) If -sps_chroma_vertical_collocated_flag is equal to 1, the following applies: pDsY[x][y] where x=1..nTbW-1 and y=1..nTbH-1 is derived as follows: pDsY[x][y]=(F3[1][0]*pY[SubWidthC*x][SubHeightC*y-1]+ F3[0][1]*pY[SubWidthC*x-1][SubHeightC*y]+ F3[1][1]*pY[SubWidthC*x][SubHeightC*y]+ F3[2][1]*pY[SubWidthC*x+1][SubHeightC*y]+ F3[1][2]*pY[SubWidthC*x][SubHeightC*y+1]+4)>>3 (370) - Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies: pDsY[x][y] where x=1..nTbW-1 and y=1..nTbH-1 is derived as follows: pDsY[x][y]=(F4[0][1]*pY[SubWidthC*x-1][SubHeightC*y]+ F4[0][2]*pY[SubWidthC*x-1][SubHeightC*y+1]+ F4[1][1]*pY[SubWidthC*x][SubHeightC*y]+ F4[1][2]*pY[SubWidthC*x][SubHeightC*y+1]+ F4[2][1]*pY[SubWidthC*x+1][SubHeightC*y]+ F4[2][2]*pY[SubWidthC*x+1][SubHeightC*y+1]+4)>>3 (371)

[0225] 4. If numSampL is greater than 0, the selected neighboring left chroma sample pSelC[idx] is set equal to p[-1][pickPosL[idx]], idx=0..cntL-1, and the selected downsampled neighboring left luma sample pSelDsY[idx], idx=0..cntL-1, is derived as follows: The variable y is set equal to pickPosL[idx]. -If both SubWidthC and SubHeightC are equal to 1, the following applies: pSelDsY[idx]=pY[-1][y] (372) - Otherwise, the following applies: If -sps_chroma_vertical_collocated_flag is equal to 1, the following applies: pSelDsY[idx]=(F3[1][0]*pY[-SubWidthC][SubHeightC*y-1]+ F3[0][1]*pY[-1-SubWidthC][SubHeightC*y]+ F3[1][1]*pY[-SubWidthC][SubHeightC*y]+ F3[2][1]*pY[1-SubWidthC][SubHeightC*y]+ F3[1][2]*pY[-SubWidthC][SubHeightC*y+1]+4)>>3 (373) - Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies: pSelDsY[idx]=(F4[0][1]*pY[-1-SubWidthC][SubHeightC*y]+ F4[0][2]*pY[-1-SubWidthC][SubHeightC*y+1]+ F4[1][1]*pY[-SubWidthC][SubHeightC*y]+ F4[1][2]*pY[-SubWidthC][SubHeightC*y+1]+ F4[2][1]*pY[1-SubWidthC][SubHeightC*y]+ F4[2][2]*pY[1-SubWidthC][SubHeightC*y+1]+4)>>3 (374)

[0226] 5. If numSampT is greater than 0, the top chroma sample pSelC[idx] of the selected neighborhood is set equal to p[pickPost[idx-cntL][-1], where idx=cntL..cntL+cntT-1, and the top luma sample pSelDsY[idx] of the downsampled neighborhood, where idx=[[0]]cntL..cntL+cntT-1, is defined as follows: - The variable x is set equal to pickPost[idx-cntL]. -If both SubWidthC and SubHeightC are equal to 1, the following applies: pSelDsY[idx]=pY[x][-1] (375) - Otherwise, the following applies: If -sps_chroma_vertical_collocated_flag is equal to 1, the following applies: If -bCTUboundary is equal to FALSE, the following applies: pSelDsY[idx]=(F3[1][0]*pY[SubWidthC*x][-1-SubHeightC]+ F3[0][1]*pY[SubWidthC*x-1][-SubHeightC]+ F3[1][1]*pY[SubWidthC*x][-SubHeightC]+ F3[2][1]*pY[SubWidthC*x+1][-SubHeightC]+ F3[1][2]*pY[SubWidthC*x][1-SubHeightC]+4)>>3 (376) Otherwise (bCTUboundary is equal to TRUE), the following applies: pSelDsY[idx]=(F2[0]*pY[SubWidthC*x-1][-1]+ F2[1]*pY[SubWidthC*x][-1]+ F2[2]*pY[SubWidthC*x+1][-1]+2)>>2 (377)

[0227] - Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies: If -bCTUboundary is equal to FALSE, the following applies: pSelDsY[idx]=(F4[0][1]*pY[SubWidthCx-1][-1]+ F4[0][2]*pY[SubWidthC*x-1][-2]+ F4[1][1]*pY[SubWidthC*x][-1]+ F4[1][2]*pY[SubWidthC*x][-2]+ F4[2][1]*pY[SubWidthC*x+1][-1]+ F4[2][2]*pY[SubWidthC*x+1][-2]+4)>>3 (378) Otherwise (bCTUboundary is equal to TRUE), the following applies: pSelDsY[idx]=(F2[0]*pY[SubWidthC*x-1][-1]+ F2[1]*pY[SubWidthC*x][-1]+ F2[2]*pY[SubWidthC*x+1][-1]+2)>>2 (379)

[0228] 6. If cntT+cntL is not equal to 0, then the variables minY, maxY, minC, and maxC are derived as follows: If -cntT+cntL is equal to 2, then with Comp substituted for DsY and C, pSelComp[3] is set equal to pSelComp[0], pSelComp[2] is set equal to pSelComp[1], pSelComp[0] is set equal to pSelComp[1], and pSelComp[1] is set equal to pSelComp[3]. The arrays minGrpIdx and maxGrpIdx are derived as follows: minGrpIdx[0]=0 (380) minGrpIdx[1]=2 (381) maxGrpIdx[0]=1 (382) maxGrpIdx[1]=3 (383) - If pSelDsY[minGrpIdx[0]] is greater than pSelDsY[minGrpIdx[1], minGrpIdx[0] and minGrpIdx[1] are swapped as follows: (minGrpIdx[0],minGrpIdx[1])=Swap(minGrpIdx[0],minGrpIdx[1]) (384) - If pSelDsY[maxGrpIdx[0]] is greater than pSelDsY[maxGrpIdx[1], maxGrpIdx[0] and maxGrpIdx[1] are swapped as follows: (maxGrpIdx[0],maxGrpIdx[1])=Swap(maxGrpIdx[0],maxGrpIdx[1]) (385) - If pSelDsY[minGrpIdx[0]] is greater than pSelDsY[maxGrpIdx[1], the arrays minGrpIdx and maxGrpIdx are swapped as follows: (minGrpIdx,maxGrpIdx)=Swap(minGrpIdx,maxGrpIdx) (386) - If pSelDsY[minGrpIdx[1]] is greater than pSelDsY[maxGrpIdx[0], minGrpIdx[1] and maxGrpIdx[0] are swapped as follows: (minGrpIdx[1],maxGrpIdx[0])=Swap(minGrpIdx[1],maxGrpIdx[0]) (387) The variables maxY, maxC, minY and minC are derived as follows: maxY=(pSelDsY[maxGrpIdx[0]]+pSelDsY[maxGrpIdx[1]]+1)>>1 (388) maxC=(pSelC[maxGrpIdx[0]]+pSelC[maxGrpIdx[1]]+1)>>1 (389) minY=(pSelDsY[minGrpIdx[0]]+pSelDsY[minGrpIdx[1]]+1)>>1 (390) minC=(pSelC[minGrpIdx[0]]+pSelC[minGrpIdx[1]]+1)>>1 (391)

[0229] 7. The variables a, b, and k are derived as follows: If -numSampL is equal to 0 and numSampT is equal to 0, the following applies: k=0 (392) a=0 (393) b=1<<(BitDepth-1) (394) - Otherwise, the following applies: diff=maxY-minY (395) If -diff is not equal to 0, the following applies: diffC=maxC-minC (396) x=Floor(Log2(diff)) (397) normDiff=((diff<<4)>>x)&15 (398) x+=(normDiff!=0)?1:0 (399) y=Abs(diffC)>0?Floor(Log2(Abs(diffC)))+1:0 (400) a=(diffC*(divSigTable[normDiff]|8)+2 y-1 )>>y (401) k=((3+xy)<1)?1:3+xy (402) a=((3+xy)<1)?Sign(a)*15:a (403) b=minC-((a*minY)>>k) (404) Here, divSigTable[] is defined as follows: divSigTable[]={0,7,6,5,5,4,4,3,3,2,2,1,1,1,1,0} (405) - Otherwise (diff is equal to 0), the following applies: k=0 (406) a=0 (407) b=minC (408)

[0230] 8. The predicted samples predSamples[x][y], where x=0..nTbW-1 and y=0..nTbH-1, are derived as follows: predSamples[x][y]=Clip1(((pDsY[x][y]*a)>>k)+b) (409) Note - This process uses sps_chroma_vertical_collocated_flag, but for simplicity of implementation, does not use sps_chroma_horizontal_collocated_flag.

[0231] 5.6. Embodiment 6 The working draft specified in JVET-Q2001-vE can be modified as follows:

[0232] 8.4.5.2.13 The inputs to this process are: - intra prediction mode predModeIntra, - sample position (xTbC, yTbC) of the top left sample of the current transform block relative to the top left sample of the current picture, - the variable nTbW that defines the width of the transformation block, - variable nTbH, which defines the height of the transformation block; - a variable cIdx that defines the color component of the current block, - Let x=-1, y=0..2*nTbH-1 and x=0..2*nTbW-1, y=-1, and let p[x][y] be the saturation neighborhood sample. The output of this process is the predicted samples preSamples[x][y], where x=0..nTbW-1, y=0..nTbH-1. The current luminance position (xTbY, yTbY) is derived as follows: (xTbY,yTbY)=(xTbC<<(SubWidthC-1),yTbC<<(SubHeightC-1)) (351)

[0233] The variables availL, availT and availTL are derived as follows: The derivation process for neighborhood block availability specified in Section 6.4.4 starts with the current luminance position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighborhood luminance position (xTbY-1, yTbY), checkPredModeY set equal to FALSE, and cIdx as inputs, and assigns the output to availL. The derivation process for neighborhood block availability specified in Section 6.4.4 starts with the current luminance position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighborhood luminance position (xTbY, yTbY-1), checkPredModeY set equal to FALSE, and cIdx as inputs, and assigns the output to availT.

[0234] The variable availTL is derived as follows: availTL=availL&&availT (352) - The number of available top right neighbor chroma samples, numTopRight, is derived as follows: The variable numTopRight is set equal to 0 and availTR is set equal to TRUE. -If preModeIntra 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: The derivation process for neighborhood block availability specified in Section 6.4.4 starts with the current luminance position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighborhood luminance position (xTbY+x, yTbY-1), checkPredModeY set equal to FALSE, and cIdx as inputs, and assigns the output to availTR. If -availTR is equal to TRUE, numTopRight is increased by one.

[0235] - The number of available bottom-left neighbor chroma samples, numLeftBelow, is derived as follows: The variable numLeftBelow is set equal to 0 and availLB is set equal to TRUE. -If preModeIntra 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: The derivation process for neighborhood block availability specified in Section 6.4.4 is invoked with the current luminance position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighborhood luminance position (xTbY-1, yTbY+y), checkPredModeY set equal to FALSE, and cIdx as inputs, and assigns the output to availLB. If -availLB is equal to TRUE, numLeftBelow is increased by one.

[0236] The number of available neighboring chroma samples in the top and top-right numSampT and the number of available neighboring chroma samples in the left and bottom-left numSampL are derived as follows: If -predModeIntra is equal to INTRA_LT_CCLM, the following applies: numSampT=availT?nTbW:0 (353) numSampL=availL?nTbH:0 (354) - Otherwise, the following applies: numSampT=(availT&&predModeIntra==INTRA_T_CCLM)?(nTbW+Min(numTopRight,nTbH)):0 (355) numSampL=(availL&&predModeIntra==INTRA_L_CCLM)?(nTbH+Min(numLeftBelow,nTbW)):0 (356)

[0237] The variable bCTUboundary is derived as follows: bCTUboundary=(yTbY&(CtbSizeY-1)==0)?TRUE:FALSE (357) The variable cntN and the array pickPosN, in which N is replaced with L and T, are derived as follows: The variable numIs4N is derived as follows: numIs4N=((availT&&availL&&predModeIntra==INTRA_LT_CCLM)?0:1) (358) The variable startPosN is set equal to numSampN>(2+numIs4N). The variable pickStepN is set equal to Max(1,numSampN>(1+numIs4N)). If -availN is equal to TRUE and preModeIntra is equal to INTRA_LT_CCLM or INTRA_N_CCLM, the following allocation occurs: -cntN is set equal to Min(numSampN, (1+numIs4N)<<1). -pospickPosN[pos] is set equal to (startPosN+pos*pospickStepN), where pos=0..cntN-1. Otherwise, cntN is set equal to 0.

[0238] The predicted samples predSamples[x][y], where x=0..nTbW-1 and y=0..nTbH-1, are derived as follows: If both -numSampL and numSampT are equal to 0, the following applies: predSamples[x][y]=1<<(BitDepth-1) (359) - Otherwise, the following ordered steps apply: 1. The co-located luma sample pY[x][y], where x=0..nTbW*SubWidthC-1, y=0..nTbH*SubHeightC-1, is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y).

[0239] 2. The neighboring luminance samples pY[x][y] are derived as follows: If -numSampL is greater than 0, the nearby left luma sample pY[x][y] for x=-1..-3, y=0..SubHeightC*numSampL-1 is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y). If -availT is equal to FALSE, the top-most luminance sample pY[x][y] in the neighborhood where x=-1..SubWidthC*numSampT-1, y=-1..-2 is set equal to the luminance sample pY[x][0]. If -availL is equal to FALSE, the left luminance sample pY[x][y] in the neighborhood with x=-1..-3, y=-1..SubHeightC*numSampL-1 is set equal to luminance sample pY[0][y]. If -numSampT is greater than 0, the luma sample pY[x][y] above the neighborhood where x=0..SubWidthC*numSampT-1, y=-1,-[[2]]3 is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y). If -availTL is equal to TRUE, the top-left neighboring luma sample pY[x][y] at x=-1, y=-1,-2,-3 is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y).

[0240] 3. The downsampled and arranged luminance samples pDsY[x][y] when x=0..nTbW-1 and y=0..nTbH-1 are derived as follows: -If both SubWidthC and SubHeightC are equal to 1, the following applies: pDsY[x][y] where x=1..nTbW-1 and y=1..nTbH-1 is derived as follows: pDstY[x][y]=pY[x][y] (360) - Otherwise, the following applies: The one-dimensional filter coefficient arrays F1 and F2 and the two-dimensional filter coefficient arrays F3 and F4 are defined as follows: F1[0]=2,F1[1]=0 (361) F2[0]=1,F2[1]=2,F2[2]=1 (362) F3[i][j]=F4[i][j]=0,i=0..2,j=0..2 (363) -If both SubWidthC and SubHeightC are equal to 2, the following applies: F1[0]=1,F1[1]=1 (364) F3[0][1]=1,F3[1][1]=4,F3[2][1]=1,F3[1][0]=1,F3[1][2]=1 (365) F4[0][1]=1,F4[1][1]=2,F4[2][1]=1 (366) F4[0][2]=1,F4[1][2]=2,F4[2][2]=1 (367)

[0241] - Otherwise, the following applies: F3[1][1]=8 (368) F4[0][1]=2,F4[1][1]=4,F4[2][1]=2 (369) If -sps_chroma_vertical_collocated_flag is equal to 1, the following applies: pDsY[x][y] where x=1..nTbW-1 and y=1..nTbH-1 is derived as follows: pDsY[x][y]=(F3[1][0]*pY[SubWidthC*x][SubHeightC*y-1]+ F3[0][1]*pY[SubWidthC*x-1][SubHeightC*y]+ F3[1][1]*pY[SubWidthC*x][SubHeightC*y]+ F3[2][1]*pY[SubWidthC*x+1][SubHeightC*y]+ F3[1][2]*pY[SubWidthC*x][SubHeightC*y+1]+4)>>3 (370)

[0242] - Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies: pDsY[x][y] where x=1..nTbW-1 and y=1..nTbH-1 is derived as follows: pDsY[x][y]=(F4[0][1]*pY[SubWidthC*x-1][SubHeightC*y]+ F4[0][2]*pY[SubWidthC*x-1][SubHeightC*y+1]+ F4[1][1]*pY[SubWidthC*x][SubHeightC*y]+ F4[1][2]*pY[SubWidthC*x][SubHeightC*y+1]+ F4[2][1]*pY[SubWidthC*x+1][SubHeightC*y]+ F4[2][2]*pY[SubWidthC*x+1][SubHeightC*y+1]+4)>>3 (371)

[0243] 4. If numSampL is greater than 0, the selected neighboring left chroma sample pSelC[idx] is set equal to p[-1][pickPosL[idx]], idx=0..cntL-1, and the selected downsampled neighboring left luma sample pSelDsY[idx], idx=0..cntL-1, is derived as follows: The variable y is set equal to pickPosL[idx]. -If both SubWidthC and SubHeightC are equal to 1, the following applies: pSelDsY[idx]=pY[-1][y] (372) - Otherwise, the following applies: If -sps_chroma_vertical_collocated_flag is equal to 1, the following applies: pSelDsY[idx]=(F3[1][0]*pY[-SubWidthC][SubHeightC*y-1]+ F3[0][1]*pY[-1-SubWidthC][SubHeightC*y]+ F3[1][1]*pY[-SubWidthC][SubHeightC*y]+ F3[2][1]*pY[1-SubWidthC][SubHeightC*y]+ F3[1][2]*pY[-SubWidthC][SubHeightC*y+1]+4)>>3 (373)

[0244] - Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies: pSelDsY[idx]=(F4[0][1]*pY[-1-SubWidthC][SubHeightC*y]+ F4[0][2]*pY[-1-SubWidthC][SubHeightC*y+1]+ F4[1][1]*pY[-SubWidthC][SubHeightC*y]+ F4[1][2]*pY[-SubWidthC][SubHeightC*y+1]+ F4[2][1]*pY[1-SubWidthC][SubHeightC*y]+ F4[2][2]*pY[1-SubWidthC][SubHeightC*y+1]+4)>>3 (374)

[0245] 5. If numSampT is greater than 0, the top chroma sample of the selected neighborhood, pSelC[idx], is set equal to p[pickPost[idx-cntL][-1], where idx=cntL..cntL+cntT-1, and the top luma sample of the downsampled neighborhood, pSelDsY[idx], where idx=0..cntL+cntT-1, is defined as follows: - The variable x is set equal to pickPost[idx-cntL]. -If both SubWidthC and SubHeightC are equal to 1, the following applies: pSelDsY[idx]=pY[x][-1] (375) - Otherwise, the following applies: If -sps_chroma_vertical_collocated_flag is equal to 1, the following applies: If -bCTUboundary is equal to FALSE, the following applies: pSelDsY[idx]=(F3[1][0]*pY[SubWidthC*x][-1-SubHeightC]+ F3[0][1]*pY[SubWidthC*x-1][-SubHeightC]+ F3[1][1]*pY[SubWidthC*x][-SubHeightC]+ F3[2][1]*pY[SubWidthC*x+1][-SubHeightC]+ F3[1][2]*pY[SubWidthC*x][1-SubHeightC]+4)>>3 (376) - Otherwise (bCTUboundary is equal to TRUE), applies. pSelDsY[idx]=(F2[0]*pY[SubWidthC*x-1][-1]+ F2[1]*pY[SubWidthC*x][-1]+ F2[2]*pY[SubWidthC*x+1][-1]+2)>>2 (377)

[0246] - Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies: If -bCTUboundary is equal to FALSE, the following applies: pSelDsY[idx]=(F4[0][1]*pY[SubWidthCx-1][-1]+ F4[0][2]*pY[SubWidthC*x-1][-2]+ F4[1][1]*pY[SubWidthC*x][-1]+ F4[1][2]*pY[SubWidthC*x][-2]+ F4[2][1]*pY[SubWidthC*x+1][-1]+ F4[2][2]*pY[SubWidthC*x+1][-2]+4)>>3 (378) Otherwise (bCTUboundary is equal to TRUE), the following applies: pSelDsY[idx]=(F2[0]*pY[SubWidthC*x-1][-1]+ F2[1]*pY[SubWidthC*x][-1]+ F2[2]*pY[SubWidthC*x+1][-1]+2)>>2 (379)

[0247] 6. If cntT+cntL is not equal to 0, then the variables minY, maxY, minC, and maxC are derived as follows: If -cntT+cntL is equal to 2, then with Comp substituted for DsY and C, pSelComp[3] is set equal to pSelComp[0], pSelComp[2] is set equal to pSelComp[1], pSelComp[0] is set equal to pSelComp[1], and pSelComp[1] is set equal to pSelComp[3]. The arrays minGrpIdx and maxGrpIdx are derived as follows: minGrpIdx[0]=0 (380) minGrpIdx[1]=2 (381) maxGrpIdx[0]=1 (382) maxGrpIdx[1]=3 (383) -If pSelDsY[minGrpIdx[0]] is greater than pSelDsY[minGrpIdx[1]], minGrpIdx[0] and minGrpIdx[1] are swapped as follows: (minGrpIdx[0],minGrpIdx[1])=Swap(minGrpIdx[0],minGrpIdx[1]) (384) - If pSelDsY[maxGrpIdx[0]] is greater than pSelDsY[maxGrpIdx[1]], maxGrpIdx[0] and maxGrpIdx[1] are swapped as follows: (maxGrpIdx[0],maxGrpIdx[1])=Swap(maxGrpIdx[0],maxGrpIdx[1]) (385) - If pSelDsY[minGrpIdx[0]] is greater than pSelDsY[maxGrpIdx[1]], the arrays minGrpIdx and maxGrpIdx are swapped as follows: (minGrpIdx,maxGrpIdx)=Swap(minGrpIdx,maxGrpIdx) (386) - If pSelDsY[minGrpIdx[1]] is greater than pSelDsY[maxGrpIdx[0]], minGrpIdx[1] and maxGrpIdx[0] are swapped as follows: (minGrpIdx[1],maxGrpIdx[0])=Swap(minGrpIdx[1],maxGrpIdx[0]) (387) The variables maxY, maxC, minY and minC are derived as follows: maxY=(pSelDsY[maxGrpIdx[0]]+pSelDsY[maxGrpIdx[1]]+1)>>1 (388) maxC=(pSelC[maxGrpIdx[0]]+pSelC[maxGrpIdx[1]]+1)>>1 (389) minY=(pSelDsY[minGrpIdx[0]]+pSelDsY[minGrpIdx[1]]+1)>>1 (390) minC=(pSelC[minGrpIdx[0]]+pSelC[minGrpIdx[1]]+1)>>1 (391)

[0248] 7. The variables a, b, and k are derived as follows: If -numSampL is equal to 0 and numSampT is equal to 0, the following applies: k=0 (392) a=0 (393) b=1<<(BitDepth-1) (394) - Otherwise, the following applies: diff=maxY-minY (395) If -diff is not equal to 0, the following applies: diffC=maxC-minC (396) x=Floor(Log2(diff)) (397) normDiff=((diff<<4)>>x)&15 (398) x+=(normDiff!=0)?1:0 (399) y=Abs(diffC)>0?Floor(Log2(Abs(diffC)))+1:0 (400) a=(diffC*(divSigTable[normDiff]|8)+2 y-1 )>>y (401) k=((3+xy)<1)?1:3+xy (402) a=((3+xy)<1)?Sign(a)*15:a (403) b=minC-((a*minY)>>k) (404) Here, divSigTable[] is defined as follows: divSigTable[]={0,7,6,5,5,4,4,3,3,2,2,1,1,1,1,0} (405) - Otherwise (diff is equal to 0), the following applies: k=0 (406) a=0 (407) b=minC (408)

[0249] 8. The predicted samples predSamples[x][y], where x=0..nTbW-1 and y=0..nTbH-1, are derived as follows: predSamples[x][y]=Clip1(((pDsY[x][y]*a)>>k)+b) (409) NOTE: This process uses sps_chroma_vertical_collocated_flag, but for simplicity of implementation, does not use sps_chroma_horizontal_collocated_flag.

[0250] 5.7. Embodiment 7 The working draft specified in JVET-Q2001-vE can be modified as follows:

[0251] 8.4.5.2.13 The inputs to this process are: - intra prediction mode predModeIntra, - sample position (xTbC, yTbC) of the top left sample of the current transform block relative to the top left sample of the current picture, - the variable nTbW that defines the width of the transformation block, - variable nTbH, which defines the height of the transformation block; - a variable cIdx that defines the color component of the current block, - Let x=-1, y=0..2*nTbH-1 and x=0..2*nTbW-1, y=-1, and let p[x][y] be the saturation neighborhood sample.

[0252] The output of this process is the predicted samples preSamples[x][y], where x=0..nTbW-1, y=0..nTbH-1. The current luminance position (xTbY, yTbY) is derived as follows: (xTbY,yTbY)=(xTbC<<(SubWidthC-1),yTbC<<(SubHeightC-1)) (351)

[0253] The variables availL, availT and availTL are derived as follows: The derivation process for neighborhood block availability specified in Section 6.4.4 starts with the current luminance position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighborhood luminance position (xTbY-1, yTbY), checkPredModeY set equal to FALSE, and cIdx as inputs, and assigns the output to availL. The derivation process for neighborhood block availability specified in Section 6.4.4 starts with the current luminance position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighborhood luminance position (xTbY, yTbY-1), checkPredModeY set equal to FALSE, and cIdx as inputs, and assigns the output to availT.

[0254] The variable availTL is derived as follows: availTL=availL&&availT (352) The number of available chroma samples in the top right neighborhood, numTopRight, is derived as follows: The variable numTopRight is set equal to 0 and availTR is set equal to TRUE. -If preModeIntra 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: The derivation process for neighborhood block availability specified in Section 6.4.4 starts with the current luminance position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighborhood luminance position (xTbY+x, yTbY-1), checkPredModeY set equal to FALSE, and cIdx as inputs, and assigns the output to availTR. If -availTR is equal to TRUE, numTopRight is increased by one.

[0255] - The number of available bottom-left neighbor chroma samples, numLeftBelow, is derived as follows: The variable numLeftBelow is set equal to 0 and availLB is set equal to TRUE. -If preModeIntra 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: The derivation process for neighborhood block availability specified in Section 6.4.4 is invoked with the current luminance position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighborhood luminance position (xTbY-1, yTbY+y), checkPredModeY set equal to FALSE, and cIdx as inputs, and assigns the output to availLB. If -availLB is equal to TRUE, numLeftBelow is increased by one.

[0256] The number of available neighboring chroma samples in the top and top-right numSampT and the number of available neighboring chroma samples in the left and bottom-left numSampL are derived as follows: If -predModeIntra is equal to INTRA_LT_CCLM, the following applies: numSampT=availT?nTbW:0 (353) numSampL=availL?nTbH:0 (354) - Otherwise, the following applies: numSampT=(availT&&predModeIntra==INTRA_T_CCLM)?(nTbW+Min(numTopRight,nTbH)):0 (355) numSampL=(availL&&predModeIntra==INTRA_L_CCLM)?(nTbH+Min(numLeftBelow,nTbW)):0 (356)

[0257] The variable bCTUboundary is derived as follows: bCTUboundary=(yTbY&(CtbSizeY-1)==0)?TRUE:FALSE (357) The variable cntN and the array pickPosN, with N replaced by L and T, are derived as follows: The variable numIs4N is derived as follows: numIs4N=((availT&&availL&&predModeIntra==INTRA_LT_CCLM)?0:1) (358) The variable startPosN is set equal to numSampN>(2+numIs4N). The variable pickStepN is set equal to Max(1,numSampN>(1+numIs4N)). If -availN is equal to TRUE and preModeIntra is equal to INTRA_LT_CCLM or INTRA_N_CCLM, the following allocation occurs: -cntN is set equal to Min(numSampN, (1+numIs4N)<<1). -pickPosN[pos] is set equal to (startPosN+pos*pospickStepN), where pos=0..cntN-1. Otherwise, cntN is set equal to 0. The predicted samples predSamples[x][y], where x=0..nTbW-1 and y=0..nTbH-1, are derived as follows: If both -numSampL and numSampT are equal to 0, the following applies: predSamples[x][y]=1<<(BitDepth-1) (359)

[0258] - Otherwise, the following ordered steps apply: 1. The co-located luma sample pY[x][y], where x=0..nTbW*SubWidthC-1, y=0..nTbH*SubHeightC-1, is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y).

[0259] [ka]

[0260] 3. The downsampled and arranged luminance samples pDsY[x][y] when x=0..nTbW-1 and y=0..nTbH-1 are derived as follows: -If both SubWidthC and SubHeightC are equal to 1, the following applies: pDsY[x][y] where x=1..nTbW-1 and y=1..nTbH-1 is derived as follows: pDstY[x][y]=pY[x][y] (360) - Otherwise, the following applies: The one-dimensional filter coefficient arrays F1 and F2 and the two-dimensional filter coefficient arrays F3 and F4 are defined as follows: F1[0]=2,F1[1]=0 (361) F2[0]=1,F2[1]=2,F2[2]=1 (362) F3[i][j]=F4[i][j]=0,i=0..2,j=0..2 (363) -If both SubWidthC and SubHeightC are equal to 2, the following applies: F1[0]=1,F1[1]=1 (364) F3[0][1]=1,F3[1][1]=4,F3[2][1]=1,F3[1][0]=1,F3[1][2]=1 (365) F4[0][1]=1,F4[1][1]=2,F4[2][1]=1 (366) F4[0][2]=1,F4[1][2]=2,F4[2][2]=1 (367) - Otherwise, the following applies: F3[1][1]=8 (368) F4[0][1]=2,F4[1][1]=4,F4[2][1]=2 (369) If -sps_chroma_vertical_collocated_flag is equal to 1, the following applies: pDsY[x][y] where x=1..nTbW-1 and y=1..nTbH-1 is derived as follows: pDsY[x][y]=(F3[1][0]*pY[SubWidthC*x][SubHeightC*y-1]+ F3[0][1]*pY[SubWidthC*x-1][SubHeightC*y]+ F3[1][1]*pY[SubWidthC*x][SubHeightC*y]+ F3[2][1]*pY[SubWidthC*x+1][SubHeightC*y]+ F3[1][2]*pY[SubWidthC*x][SubHeightC*y+1]+4)>>3 (370) - Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies: pDsY[x][y] where x=1..nTbW-1 and y=1..nTbH-1 is derived as follows: pDsY[x][y]=(F4[0][1]*pY[SubWidthC*x-1][SubHeightC*y]+ F4[0][2]*pY[SubWidthC*x-1][SubHeightC*y+1]+ F4[1][1]*pY[SubWidthC*x][SubHeightC*y]+ F4[1][2]*pY[SubWidthC*x][SubHeightC*y+1]+ F4[2][1]*pY[SubWidthC*x+1][SubHeightC*y]+ F4[2][2]*pY[SubWidthC*x+1][SubHeightC*y+1]+4)>>3 (371)

[0261] 4. If numSampL is greater than 0, the selected neighboring left chroma sample pSelC[idx] is set equal to p[-1][pickPosL[idx]], idx=0..cntL-1, and the selected downsampled neighboring left luma sample pSelDsY[idx], idx=0..cntL-1, is derived as follows: The variable y is set equal to pickPosL[idx]. -If both SubWidthC and SubHeightC are equal to 1, the following applies: pSelDsY[idx]=pY[-1][y] (372) - Otherwise, the following applies: If -sps_chroma_vertical_collocated_flag is equal to 1, the following applies: pSelDsY[idx]=(F3[1][0]*pY[-SubWidthC][SubHeightC*y-1]+ F3[0][1]*pY[-1-SubWidthC][SubHeightC*y]+ F3[1][1]*pY[-SubWidthC][SubHeightC*y]+ F3[2][1]*pY[1-SubWidthC][SubHeightC*y]+ F3[1][2]*pY[-SubWidthC][SubHeightC*y+1]+4)>>3 (373) - Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies: pSelDsY[idx]=(F4[0][1]*pY[-1-SubWidthC][SubHeightC*y]+ F4[0][2]*pY[-1-SubWidthC][SubHeightC*y+1]+ F4[1][1]*pY[-SubWidthC][SubHeightC*y]+ F4[1][2]*pY[-SubWidthC][SubHeightC*y+1]+ F4[2][1]*pY[1-SubWidthC][SubHeightC*y]+ F4[2][2]*pY[1-SubWidthC][SubHeightC*y+1]+4)>>3 (374)

[0262] 5. If numSampT is greater than 0, the top chroma sample of the selected neighborhood, pSelC[idx], is set equal to p[pickPost[idx-cntL][-1], where idx=cntL..cntL+cntT-1, and the top luma sample of the downsampled neighborhood, pSelDsY[idx], where idx=0..cntL+cntT-1, is defined as follows: - The variable x is set equal to pickPost[idx-cntL]. -If both SubWidthC and SubHeightC are equal to 1, the following applies: pSelDsY[idx]=pY[x][-1] (375) - Otherwise, the following applies: If -sps_chroma_vertical_collocated_flag is equal to 1, the following applies: If -bCTUboundary is equal to FALSE, the following applies: pSelDsY[idx]=(F3[1][0]*pY[SubWidthC*x][-1-SubHeightC]+ F3[0][1]*pY[SubWidthC*x-1][-SubHeightC]+ F3[1][1]*pY[SubWidthC*x][-SubHeightC]+ F3[2][1]*pY[SubWidthC*x+1][-SubHeightC]+ F3[1][2]*pY[SubWidthC*x][1-SubHeightC]+4)>>3 (376) Otherwise (bCTUboundary is equal to TRUE), the following applies: pSelDsY[idx]=(F2[0]*pY[SubWidthC*x-1][-1]+ F2[1]*pY[SubWidthC*x][-1]+ F2[2]*pY[SubWidthC*x+1][-1]+2)>>2 (377)

[0263] - Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies: If -bCTUboundary is equal to FALSE, the following applies: pSelDsY[idx]=(F4[0][1]*pY[SubWidthCx-1][-1]+ F4[0][2]*pY[SubWidthC*x-1][-2]+ F4[1][1]*pY[SubWidthC*x][-1]+ F4[1][2]*pY[SubWidthC*x][-2]+ F4[2][1]*pY[SubWidthC*x+1][-1]+ F4[2][2]*pY[SubWidthC*x+1][-2]+4)>>3 (378) Otherwise (bCTUboundary is equal to TRUE), the following applies: pSelDsY[idx]=(F2[0]*pY[SubWidthC*x-1][-1]+ F2[1]*pY[SubWidthC*x][-1]+ F2[2]*pY[SubWidthC*x+1][-1]+2)>>2 (379)

[0264] 6. If cntT+cntL is not equal to 0, the variables minY, maxY, minC, and maxC are derived as follows: If -cntT+cntL is equal to 2, then with Comp substituted for DsY and C, pSelComp[3] is set equal to pSelComp[0], pSelComp[2] is set equal to pSelComp[1], pSelComp[0] is set equal to pSelComp[1], and pSelComp[1] is set equal to pSelComp[3]. The arrays minGrpIdx and maxGrpIdx are derived as follows: minGrpIdx[0]=0 (380) minGrpIdx[1]=2 (381) maxGrpIdx[0]=1 (382) maxGrpIdx[1]=3 (383)

[0265] - If pSelDsY[minGrpIdx[0]] is greater than pSelDsY[minGrpIdx[1], minGrpIdx[0] and minGrpIdx[1] are swapped as follows: (minGrpIdx[0],minGrpIdx[1])=Swap(minGrpIdx[0],minGrpIdx[1]) (384) - If pSelDsY[maxGrpIdx[0]] is greater than pSelDsY[maxGrpIdx[1], maxGrpIdx[0] and maxGrpIdx[1] are swapped as follows: (maxGrpIdx[0],maxGrpIdx[1])=Swap(maxGrpIdx[0],maxGrpIdx[1]) (385) - If pSelDsY[minGrpIdx[0]] is greater than pSelDsY[maxGrpIdx[1], the arrays minGrpIdx and maxGrpIdx are swapped as follows: (minGrpIdx,maxGrpIdx)=Swap(minGrpIdx,maxGrpIdx) (386)

[0266] - If pSelDsY[minGrpIdx[1]] is greater than pSelDsY[maxGrpIdx[0], minGrpIdx[1] and maxGrpIdx[0] are swapped as follows: (minGrpIdx[1],maxGrpIdx[0])=Swap(minGrpIdx[1],maxGrpIdx[0]) (387) The variables maxY, maxC, minY and minC are derived as follows: maxY=(pSelDsY[maxGrpIdx[0]]+pSelDsY[maxGrpIdx[1]]+1)>>1 (388) maxC=(pSelC[maxGrpIdx[0]]+pSelC[maxGrpIdx[1]]+1)>>1 (389) minY=(pSelDsY[minGrpIdx[0]]+pSelDsY[minGrpIdx[1]]+1)>>1 (390) minC=(pSelC[minGrpIdx[0]]+pSelC[minGrpIdx[1]]+1)>>1 (391)

[0267] 7. The variables a, b, and k are derived as follows: If -numSampL is equal to 0 and numSampT is equal to 0, the following applies: k=0 (392) a=0 (393) b=1<<(BitDepth-1) (394) - Otherwise, the following applies: diff=maxY-minY (395) If -diff is not equal to 0, the following applies: diffC=maxC-minC (396) x=Floor(Log2(diff)) (397) normDiff=((diff<<4)>>x)&15 (398) x+=(normDiff!=0)?1:0 (399) y=Abs(diffC)>0?Floor(Log2(Abs(diffC)))+1:0 (400) a=(diffC*(divSigTable[normDiff]|8)+2 y-1 )>>y (401) k=((3+xy)<1)?1:3+xy (402) a=((3+xy)<1)?Sign(a)*15:a (403) b=minC-((a*minY)>>k) (404) Here, divSigTable[] is defined as follows: divSigTable[]={0,7,6,5,5,4,4,3,3,2,2,1,1,1,1,0} (405) - Otherwise (diff is equal to 0), the following applies: k=0 (406) a=0 (407) b=minC (408)

[0268] 8. The predicted samples predSamples[x][y], where x=0..nTbW-1 and y=0..nTbH-1, are derived as follows: predSamples[x][y]=Clip1(((pDsY[x][y]*a)>>k)+b) (409) NOTE: This process uses sps_chroma_vertical_collocated_flag, but for simplicity of implementation, does not use sps_chroma_horizontal_collocated_flag.

[0269] 5.8. Embodiment 8 The working draft specified in JVET-Q2001-vE can be modified as follows:

[0270] 8.4.5.2.13 The inputs to this process are: - intra prediction mode predModeIntra, - sample position (xTbC, yTbC) of the top left sample of the current transform block relative to the top left sample of the current picture, - the variable nTbW that defines the width of the transformation block, - variable nTbH, which defines the height of the transformation block; - a variable cIdx that defines the color component of the current block, - Chroma neighborhood samples p[x][y] where x=-1,y=0..2*nTbH-1 and x=0..2*nTbW-1,y=-1.

[0271] The output of this process is the predicted samples preSamples[x][y], where x=0..nTbW-1, y=0..nTbH-1. The current luminance position (xTbY, yTbY) is derived as follows: (xTbY,yTbY)=(xTbC<<(SubWidthC-1),yTbC<<(SubHeightC-1)) (351)

[0272] [ka]

[0273] The number of available chroma samples in the top right neighborhood, numTopRight, is derived as follows: The variable numTopRight is set equal to 0 and availTR is set equal to TRUE. -If preModeIntra 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: The derivation process for neighborhood block availability specified in Section 6.4.4 starts with the current luminance position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighborhood luminance position (xTbY+x, yTbY-1), checkPredModeY set equal to FALSE, and cIdx as inputs, and assigns the output to availTR. If -availTR is equal to TRUE, numTopRight is increased by one. - The number of available bottom-left neighbor chroma samples, numLeftBelow, is derived as follows: The variable numLeftBelow is set equal to 0 and availLB is set equal to TRUE. -If preModeIntra 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: The derivation process for neighborhood block availability specified in Section 6.4.4 is invoked with the current luminance position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighborhood luminance position (xTbY-1, yTbY+y), checkPredModeY set equal to FALSE, and cIdx as inputs, and assigns the output to availLB. If -availLB is equal to TRUE, numLeftBelow is increased by one.

[0274] The number of available neighboring chroma samples in the top and top-right numSampT and the number of available neighboring chroma samples in the left and bottom-left numSampL are derived as follows: If -predModeIntra is equal to INTRA_LT_CCLM, the following applies: numSampT=availT?nTbW:0 (353) numSampL=availL?nTbH:0 (354) - Otherwise, the following applies: numSampT=(availT&&predModeIntra==INTRA_T_CCLM)?(nTbW+Min(numTopRight,nTbH)):0 (355) numSampL=(availL&&predModeIntra==INTRA_L_CCLM)?(nTbH+Min(numLeftBelow,nTbW)):0 (356)

[0275] The variable bCTUboundary is derived as follows: bCTUboundary=(yTbY&(CtbSizeY-1)==0)?TRUE:FALSE (357) The variable cntN and the array pickPosN, with N replaced by L and T, are derived as follows: The variable numIs4N is derived as follows: numIs4N=((availT&&availL&&predModeIntra==INTRA_LT_CCLM)?0:1) (358) The variable startPosN is set equal to numSampN>(2+numIs4N). The variable pickStepN is set equal to Max(1,numSampN>(1+numIs4N)). If -availN is equal to TRUE and preModeIntra is equal to INTRA_LT_CCLM or INTRA_N_CCLM, the following allocation occurs: -cntN is set equal to Min(numSampN, (1+numIs4N)<<1). -pospickPosN[pos] is set equal to (startPosN+pos*pospickStepN), where pos=0..cntN-1. Otherwise, cntN is set equal to 0. The predicted samples predSamples[x][y], where x=0..nTbW-1 and y=0..nTbH-1, are derived as follows: If both -numSampL and numSampT are equal to 0, the following applies: predSamples[x][y]=1<<(BitDepth-1) (359)

[0276] - Otherwise, the following ordered steps apply: 1. The co-located luma sample pY[x][y], where x=0..nTbW*SubWidthC-1, y=0..nTbH*SubHeightC-1, is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y).

[0277] [ka]

[0278] 3. The downsampled and arranged luminance samples pDsY[x][y] when x=0..nTbW-1 and y=0..nTbH-1 are derived as follows: -If both SubWidthC and SubHeightC are equal to 1, the following applies: pDsY[x][y] where x=1..nTbW-1 and y=1..nTbH-1 is derived as follows: pDstY[x][y]=pY[x][y] (360) - Otherwise, the following applies: The one-dimensional filter coefficient arrays F1 and F2 and the two-dimensional filter coefficient arrays F3 and F4 are defined as follows: F1[0]=2,F1[1]=0 (361) F2[0]=1,F2[1]=2,F2[2]=1 (362) F3[i][j]=F4[i][j]=0,i=0..2,j=0..2 (363) -If both SubWidthC and SubHeightC are equal to 2, the following applies: F1[0]=1,F1[1]=1 (364) F3[0][1]=1,F3[1][1]=4,F3[2][1]=1,F3[1][0]=1,F3[1][2]=1 (365) F4[0][1]=1,F4[1][1]=2,F4[2][1]=1 (366) F4[0][2]=1,F4[1][2]=2,F4[2][2]=1 (367) - Otherwise, the following applies: F3[1][1]=8 (368) F4[0][1]=2,F4[1][1]=4,F4[2][1]=2 (369)

[0279] If -sps_chroma_vertical_collocated_flag is equal to 1, the following applies: pDsY[x][y] where x=1..nTbW-1 and y=1..nTbH-1 is derived as follows: pDsY[x][y]=(F3[1][0]*pY[SubWidthC*x][SubHeightC*y-1]+ F3[0][1]*pY[SubWidthC*x-1][SubHeightC*y]+ F3[1][1]*pY[SubWidthC*x][SubHeightC*y]+ F3[2][1]*pY[SubWidthC*x+1][SubHeightC*y]+ F3[1][2]*pY[SubWidthC*x][SubHeightC*y+1]+4)>>3 (370) - Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies: pDsY[x][y] where x=1..nTbW-1 and y=1..nTbH-1 is derived as follows: pDsY[x][y]=(F4[0][1]*pY[SubWidthC*x-1][SubHeightC*y]+ F4[0][2]*pY[SubWidthC*x-1][SubHeightC*y+1]+ F4[1][1]*pY[SubWidthC*x][SubHeightC*y]+ F4[1][2]*pY[SubWidthC*x][SubHeightC*y+1]+ F4[2][1]*pY[SubWidthC*x+1][SubHeightC*y]+ F4[2][2]*pY[SubWidthC*x+1][SubHeightC*y+1]+4)>>3 (371)

[0280] 4. If numSampL is greater than 0, the selected neighboring left chroma sample pSelC[idx] is set equal to p[-1][pickPosL[idx]], idx=0..cntL-1, and the selected downsampled neighboring left luma sample pSelDsY[idx], idx=0..cntL-1, is derived as follows: The variable y is set equal to pickPosL[idx]. -If both SubWidthC and SubHeightC are equal to 1, the following applies: pSelDsY[idx]=pY[-1][y] (372) - Otherwise, the following applies: If -sps_chroma_vertical_collocated_flag is equal to 1, the following applies: pSelDsY[idx]=(F3[1][0]*pY[-SubWidthC][SubHeightC*y-1]+ F3[0][1]*pY[-1-SubWidthC][SubHeightC*y]+ F3[1][1]*pY[-SubWidthC][SubHeightC*y]+ F3[2][1]*pY[1-SubWidthC][SubHeightC*y]+ F3[1][2]*pY[-SubWidthC][SubHeightC*y+1]+4)>>3 (373) - Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies: pSelDsY[idx]=(F4[0][1]*pY[-1-SubWidthC][SubHeightC*y]+ F4[0][2]*pY[-1-SubWidthC][SubHeightC*y+1]+ F4[1][1]*pY[-SubWidthC][SubHeightC*y]+ F4[1][2]*pY[-SubWidthC][SubHeightC*y+1]+ F4[2][1]*pY[1-SubWidthC][SubHeightC*y]+ F4[2][2]*pY[1-SubWidthC][SubHeightC*y+1]+4)>>3 (374)

[0281] 5. If numSampT is greater than 0, the top chroma sample of the selected neighborhood, pSelC[idx], is set equal to p[pickPost[idx-cntL][-1], where idx=cntL..cntL+cntT-1, and the top luma sample of the downsampled neighborhood, pSelDsY[idx], where idx=0..cntL+cntT-1, is defined as follows: - The variable x is set equal to pickPost[idx-cntL]. -If both SubWidthC and SubHeightC are equal to 1, the following applies: pSelDsY[idx]=pY[x][-1] (375) - Otherwise, the following applies: If -sps_chroma_vertical_collocated_flag is equal to 1, the following applies: If -bCTUboundary is equal to FALSE, the following applies: pSelDsY[idx]=(F3[1][0]*pY[SubWidthC*x][-1-SubHeightC]+ F3[0][1]*pY[SubWidthC*x-1][-SubHeightC]+ F3[1][1]*pY[SubWidthC*x][-SubHeightC]+ F3[2][1]*pY[SubWidthC*x+1][-SubHeightC]+ F3[1][2]*pY[SubWidthC*x][1-SubHeightC]+4)>>3 (376) Otherwise (bCTUboundary is equal to TRUE), the following applies: pSelDsY[idx]=(F2[0]*pY[SubWidthC*x-1][-1]+ F2[1]*pY[SubWidthC*x][-1]+ F2[2]*pY[SubWidthC*x+1][-1]+2)>>2 (377)

[0282] - Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies: If -bCTUboundary is equal to FALSE, the following applies: pSelDsY[idx]=(F4[0][1]*pY[SubWidthCx-1][-1]+ F4[0][2]*pY[SubWidthC*x-1][-2]+ F4[1][1]*pY[SubWidthC*x][-1]+ F4[1][2]*pY[SubWidthC*x][-2]+ F4[2][1]*pY[SubWidthC*x+1][-1]+ F4[2][2]*pY[SubWidthC*x+1][-2]+4)>>3 (378) Otherwise (bCTUboundary is equal to TRUE), the following applies: pSelDsY[idx]=(F2[0]*pY[SubWidthC*x-1][-1]+ F2[1]*pY[SubWidthC*x][-1]+ F2[2]*pY[SubWidthC*x+1][-1]+2)>>2 (379)

[0283] 6. If cntT+cntL is not equal to 0, then the variables minY, maxY, minC, and maxC are derived as follows: If -cntT+cntL is equal to 2, then with Comp substituted for DsY and C, pSelComp[3] is set equal to pSelComp[0], pSelComp[2] is set equal to pSelComp[1], pSelComp[0] is set equal to pSelComp[1], and pSelComp[1] is set equal to pSelComp[3]. The arrays minGrpIdx and maxGrpIdx are derived as follows: minGrpIdx[0]=0 (380) minGrpIdx[1]=2 (381) maxGrpIdx[0]=1 (382) maxGrpIdx[1]=3 (383) -If pSelDsY[minGrpIdx[0]] is greater than pSelDsY[minGrpIdx[1]], minGrpIdx[0] and minGrpIdx[1] are swapped as follows: (minGrpIdx[0],minGrpIdx[1])=Swap(minGrpIdx[0],minGrpIdx[1]) (384)

[0284] - If pSelDsY[maxGrpIdx[0]] is greater than pSelDsY[maxGrpIdx[1]], maxGrpIdx[0] and maxGrpIdx[1] are swapped as follows: (maxGrpIdx[0],maxGrpIdx[1])=Swap(maxGrpIdx[0],maxGrpIdx[1]) (385) - If pSelDsY[minGrpIdx[0]] is greater than pSelDsY[maxGrpIdx[1]], the arrays minGrpIdx and maxGrpIdx are swapped as follows: (minGrpIdx,maxGrpIdx)=Swap(minGrpIdx,maxGrpIdx) (386) - If pSelDsY[minGrpIdx[1]] is greater than pSelDsY[maxGrpIdx[0]], minGrpIdx[1] and maxGrpIdx[0] are swapped as follows: (minGrpIdx[1],maxGrpIdx[0])=Swap(minGrpIdx[1],maxGrpIdx[0]) (387) The variables maxY, maxC, minY and minC are derived as follows: maxY=(pSelDsY[maxGrpIdx[0]]+pSelDsY[maxGrpIdx[1]]+1)>>1 (388) maxC=(pSelC[maxGrpIdx[0]]+pSelC[maxGrpIdx[1]]+1)>>1 (389) minY=(pSelDsY[minGrpIdx[0]]+pSelDsY[minGrpIdx[1]]+1)>>1 (390) minC=(pSelC[minGrpIdx[0]]+pSelC[minGrpIdx[1]]+1)>>1 (391)

[0285] 7. The variables a, b, and k are derived as follows: If -numSampL is equal to 0 and numSampT is equal to 0, the following applies: k=0 (392) a=0 (393) b=1<<(BitDepth-1) (394) - Otherwise, the following applies: diff=maxY-minY (395) If -diff is not equal to 0, the following applies: diffC=maxC-minC (396) x=Floor(Log2(diff)) (397) normDiff=((diff<<4)>>x)&15 (398) x+=(normDiff!=0)?1:0 (399) y=Abs(diffC)>0?Floor(Log2(Abs(diffC)))+1:0 (400) a=(diffC*(divSigTable[normDiff]|8)+2 y-1 )>>y (401) k=((3+xy)<1)?1:3+xy (402) a=((3+xy)<1)?Sign(a)*15:a (403) b=minC-((a*minY)>>k) (404) Here, divSigTable[] is defined as follows: divSigTable[]={0,7,6,5,5,4,4,3,3,2,2,1,1,1,1,0} (405) - Otherwise (diff is equal to 0), the following applies: k=0 (406) a=0 (407) b=minC (408)

[0286] 8. The predicted samples predSamples[x][y], where x=0..nTbW-1 and y=0..nTbH-1, are derived as follows: predSamples[x][y]=Clip1(((pDsY[x][y]*a)>>k)+b) (409) NOTE: This process uses sps_chroma_vertical_collocated_flag, but for simplicity of implementation, does not use sps_chroma_horizontal_collocated_flag.

[0287] 5.9. Embodiment 9 The working draft specified in JVET-Q2001-vE can be modified as follows:

[0288] 8.4.5.2.13 The inputs to this process are: - intra prediction mode predModeIntra, - sample position (xTbC, yTbC) of the top left sample of the current transform block relative to the top left sample of the current picture, - the variable nTbW that defines the width of the transformation block, - variable nTbH, which defines the height of the transformation block; - a variable cIdx that defines the color component of the current block, -Let x=-1, y=0..2*nTbH-1 and x=0..2*nTbW-1, y=-1, and let p[x][y] be the saturation neighborhood sample.

[0289] The output of this process is the predicted samples preSamples[x][y], where x=0..nTbW-1, y=0..nTbH-1. The current luminance position (xTbY, yTbY) is derived as follows: (xTbY,yTbY)=(xTbC<<(SubWidthC-1),yTbC<<(SubHeightC-1)) (351) The variables availL, availT and availTL are derived as follows: The derivation process for neighborhood block availability specified in Section 6.4.4 starts with the current luminance position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighborhood luminance position (xTbY-1, yTbY), checkPredModeY set equal to FALSE, and cIdx as inputs, and assigns the output to availL. The derivation process for neighborhood block availability specified in Section 6.4.4 starts with the current luminance position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighborhood luminance position (xTbY, yTbY-1), checkPredModeY set equal to FALSE, and cIdx as inputs, and assigns the output to availT.

[0290] The variable availTL is derived as follows: availTL=availL&&availT (352) The number of available chroma samples in the top right neighborhood, numTopRight, is derived as follows: The variable numTopRight is set equal to 0 and availTR is set equal to TRUE. -If preModeIntra 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: The derivation process for neighborhood block availability specified in Section 6.4.4 starts with the current luminance position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighborhood luminance position (xTbY+x, yTbY-1), checkPredModeY set equal to FALSE, and cIdx as inputs, and assigns the output to availTR. If -availTR is equal to TRUE, numTopRight is increased by one. - The number of available bottom-left neighbor chroma samples, numLeftBelow, is derived as follows: The variable numLeftBelow is set equal to 0 and availLB is set equal to TRUE. -If preModeIntra 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: The derivation process for neighborhood block availability specified in Section 6.4.4 is invoked with the current luminance position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighborhood luminance position (xTbY-1, yTbY+y), checkPredModeY set equal to FALSE, and cIdx as inputs, and assigns the output to availLB. If -availLB is equal to TRUE, numLeftBelow is increased by one.

[0291] The number of available neighboring chroma samples in the top and top-right numSampT and the number of available neighboring chroma samples in the left and bottom-left numSampL are derived as follows: If -predModeIntra is equal to INTRA_LT_CCLM, the following applies: numSampT=availT?nTbW:0 (353) numSampL=availL?nTbH:0 (354) - Otherwise, the following applies: numSampT=(availT&&predModeIntra==INTRA_T_CCLM)?(nTbW+Min(numTopRight,nTbH)):0 (355) numSampL=(availL&&predModeIntra==INTRA_L_CCLM)?(nTbH+Min(numLeftBelow,nTbW)):0 (356)

[0292] The variable bCTUboundary is derived as follows: bCTUboundary=(yTbY&(CtbSizeY-1)==0)?TRUE:FALSE (357) The variable cntN and the array pickPosN, with N replaced by L and T, are derived as follows: The variable numIs4N is derived as follows: numIs4N=((availT&&availL&&predModeIntra==INTRA_LT_CCLM)?0:1) (358) The variable startPosN is set equal to numSampN>(2+numIs4N). The variable pickStepN is set equal to Max(1,numSampN>(1+numIs4N)). If -availN is equal to TRUE and preModeIntra is equal to INTRA_LT_CCLM or INTRA_N_CCLM, the following allocation occurs: -cntN is set equal to Min(numSampN, (1+numIs4N)<<1). -pospickPosN[pos] is set equal to (startPosN+pos*pospickStepN), where pos=0..cntN-1. Otherwise, cntN is set equal to 0.

[0293] The predicted samples predSamples[x][y], where x=0..nTbW-1 and y=0..nTbH-1, are derived as follows: If both -numSampL and numSampT are equal to 0, the following applies: predSamples[x][y]=1<<(BitDepth-1) (359) - Otherwise, the following ordered steps apply: 1. The co-located luma sample pY[x][y], where x=0..nTbW*SubWidthC-1, y=0..nTbH*SubHeightC-1, is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y).

[0294] [ka]

[0295] 3. The downsampled and arranged luminance samples pDsY[x][y], where x=0..nTbW-1 and y=0..nTbH-1, are derived as follows: -If both SubWidthC and SubHeightC are equal to 1, the following applies: - pDsY[x][y] where x=1..nTbW-1, y=1..nTbH-1 is derived as follows: pDstY[x][y]=pY[x][y] (360) - Otherwise, the following applies: The one-dimensional filter coefficient arrays F1 and F2 and the two-dimensional filter coefficient arrays F3 and F4 are defined as follows: F1[0]=2,F1[1]=0 (361) F2[0]=1,F2[1]=2,F2[2]=1 (362) F3[i][j]=F4[i][j]=0,i=0..2,j=0..2 (363) -If both SubWidthC and SubHeightC are equal to 2, the following applies: F1[0]=1,F1[1]=1 (364) F3[0][1]=1,F3[1][1]=4,F3[2][1]=1,F3[1][0]=1,F3[1][2]=1 (365) F4[0][1]=1,F4[1][1]=2,F4[2][1]=1 (366) F4[0][2]=1,F4[1][2]=2,F4[2][2]=1 (367) - Otherwise, the following applies: F3[1][1]=8 (368) F4[0][1]=2,F4[1][1]=4,F4[2][1]=2, (369)

[0296] If -sps_chroma_vertical_collocated_flag is equal to 1, the following applies: pDsY[x][y] where x=1..nTbW-1 and y=1..nTbH-1 is derived as follows: pDsY[x][y]=(F3[1][0]*pY[SubWidthC*x][SubHeightC*y-1]+ F3[0][1]*pY[SubWidthC*x-1][SubHeightC*y]+ F3[1][1]*pY[SubWidthC*x][SubHeightC*y]+ F3[2][1]*pY[SubWidthC*x+1][SubHeightC*y]+ F3[1][2]*pY[SubWidthC*x][SubHeightC*y+1]+4)>>3 (370) - Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies: pDsY[x][y] where x=1..nTbW-1 and y=1..nTbH-1 is derived as follows: pDsY[x][y]=(F4[0][1]*pY[SubWidthC*x-1][SubHeightC*y]+ F4[0][2]*pY[SubWidthC*x-1][SubHeightC*y+1]+ F4[1][1]*pY[SubWidthC*x][SubHeightC*y]+ F4[1][2]*pY[SubWidthC*x][SubHeightC*y+1]+ F4[2][1]*pY[SubWidthC*x+1][SubHeightC*y]+ F4[2][2]*pY[SubWidthC*x+1][SubHeightC*y+1]+4)>>3 (371)

[0297] 4. If numSampL is greater than 0, the selected neighboring left chroma sample pSelC[idx] is set equal to p[-1][pickPosL[idx]], idx=0..cntL-1, and the selected downsampled neighboring left luma sample pSelDsY[idx], idx=0..cntL-1, is derived as follows: The variable y is set equal to pickPosL[idx]. -If both SubWidthC and SubHeightC are equal to 1, the following applies: pSelDsY[idx]=pY[-1][y] (372) - Otherwise, the following applies: If -sps_chroma_vertical_collocated_flag is equal to 1, the following applies: pSelDsY[idx]=(F3[1][0]*pY[-SubWidthC][SubHeightC*y-1]+ F3[0][1]*pY[-1-SubWidthC][SubHeightC*y]+ F3[1][1]*pY[-SubWidthC][SubHeightC*y]+ F3[2][1]*pY[1-SubWidthC][SubHeightC*y]+ F3[1][2]*pY[-SubWidthC][SubHeightC*y+1]+4)>>3 (373)

[0298] - Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies: pSelDsY[idx]=(F4[0][1]*pY[-1-SubWidthC][SubHeightC*y]+ F4[0][2]*pY[-1-SubWidthC][SubHeightC*y+1]+ F4[1][1]*pY[-SubWidthC][SubHeightC*y]+ F4[1][2]*pY[-SubWidthC][SubHeightC*y+1]+ F4[2][1]*pY[1-SubWidthC][SubHeightC*y]+ F4[2][2]*pY[1-SubWidthC][SubHeightC*y+1]+4)>>3 (374)

[0299] 5. If numSampT is greater than 0, the top chroma sample of the selected neighborhood, pSelC[idx], is set equal to p[pickPost[idx-cntL][-1], where idx=cntL..cntL+cntT-1, and the top luma sample of the downsampled neighborhood, pSelDsY[idx], where idx=0..cntL+cntT-1, is defined as follows: - The variable x is set equal to pickPost[idx-cntL]. -If both SubWidthC and SubHeightC are equal to 1, the following applies: pSelDsY[idx]=pY[x][-1] (375) - Otherwise, the following applies: If -sps_chroma_vertical_collocated_flag is equal to 1, the following applies: If -bCTUboundary is equal to FALSE, the following applies: pSelDsY[idx]=(F3[1][0]*pY[SubWidthC*x][-1-SubHeightC]+ F3[0][1]*pY[SubWidthC*x-1][-SubHeightC]+ F3[1][1]*pY[SubWidthC*x][-SubHeightC]+ F3[2][1]*pY[SubWidthC*x+1][-SubHeightC]+ F3[1][2]*pY[SubWidthC*x][1-SubHeightC]+4)>>3 (376)

[0300] Otherwise (bCTUboundary is equal to TRUE), the following applies: pSelDsY[idx]=(F2[0]*pY[SubWidthC*x-1][-1]+ F2[1]*pY[SubWidthC*x][-1]+ F2[2]*pY[SubWidthC*x+1][-1]+2)>>2 (377) - Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies: If -bCTUboundary is equal to FALSE, the following applies: pSelDsY[idx]=(F4[0][1]*pY[SubWidthCx-1][-1]+ F4[0][2]*pY[SubWidthC*x-1][-2]+ F4[1][1]*pY[SubWidthC*x][-1]+ F4[1][2]*pY[SubWidthC*x][-2]+ F4[2][1]*pY[SubWidthC*x+1][-1]+ F4[2][2]*pY[SubWidthC*x+1][-2]+4)>>3 (378) Otherwise (bCTUboundary is equal to TRUE), the following applies: pSelDsY[idx]=(F2[0]*pY[SubWidthC*x-1][-1]+ F2[1]*pY[SubWidthC*x][-1]+ F2[2]*pY[SubWidthC*x+1][-1]+2)>>2 (379)

[0301] 6. If cntT+cntL is not equal to 0, then the variables minY, maxY, minC, and maxC are derived as follows: If -cntT+cntL is equal to 2, then with Comp substituted for DsY and C, pSelComp[3] is set equal to pSelComp[0], pSelComp[2] is set equal to pSelComp[1], pSelComp[0] is set equal to pSelComp[1], and pSelComp[1] is set equal to pSelComp[3]. The arrays minGrpIdx and maxGrpIdx are derived as follows: minGrpIdx[0]=0 (380) minGrpIdx[1]=2 (381) maxGrpIdx[0]=1 (382) maxGrpIdx[1]=3 (383) -If pSelDsY[minGrpIdx[0]] is greater than pSelDsY[minGrpIdx[1]], minGrpIdx[0] and minGrpIdx[1] are swapped as follows: (minGrpIdx[0],minGrpIdx[1])=Swap(minGrpIdx[0],minGrpIdx[1]) (384) - If pSelDsY[maxGrpIdx[0]] is greater than pSelDsY[maxGrpIdx[1]], maxGrpIdx[0] and maxGrpIdx[1] are swapped as follows: (maxGrpIdx[0],maxGrpIdx[1])=Swap(maxGrpIdx[0],maxGrpIdx[1]) (385) - If pSelDsY[minGrpIdx[0]] is greater than pSelDsY[maxGrpIdx[1]], the arrays minGrpIdx and maxGrpIdx are swapped as follows: (minGrpIdx,maxGrpIdx)=Swap(minGrpIdx,maxGrpIdx) (386) - If pSelDsY[minGrpIdx[1]] is greater than pSelDsY[maxGrpIdx[0]], minGrpIdx[1] and maxGrpIdx[0] are swapped as follows: (minGrpIdx[1],maxGrpIdx[0])=Swap(minGrpIdx[1],maxGrpIdx[0]) (387) The variables maxY, maxC, minY and minC are derived as follows: maxY=(pSelDsY[maxGrpIdx[0]]+pSelDsY[maxGrpIdx[1]]+1)>>1 (388) maxC=(pSelC[maxGrpIdx[0]]+pSelC[maxGrpIdx[1]]+1)>>1 (389) minY=(pSelDsY[minGrpIdx[0]]+pSelDsY[minGrpIdx[1]]+1)>>1 (390) minC=(pSelC[minGrpIdx[0]]+pSelC[minGrpIdx[1]]+1)>>1 (391)

[0302] 7. The variables a, b, and k are derived as follows: If -numSampL is equal to 0 and numSampT is equal to 0, the following applies: k=0 (392) a=0 (393) b=1<<(BitDepth-1) (394) - Otherwise, the following applies: diff=maxY-minY (395) If -diff is not equal to 0, the following applies: diffC=maxC-minC (396) x=Floor(Log2(diff)) (397) normDiff=((diff<<4)>>x)&15 (398) x+=(normDiff!=0)?1:0 (399) y=Abs(diffC)>0?Floor(Log2(Abs(diffC)))+1:0 (400) a=(diffC*(divSigTable[normDiff]|8)+2 y-1 )>>y (401) k=((3+xy)<1)?1:3+xy (402) a=((3+xy)<1)?Sign(a)*15:a (403) b=minC-((a*minY)>>k) (404) Here, divSigTable[] is defined as follows: divSigTable[]={0,7,6,5,5,4,4,3,3,2,2,1,1,1,1,0} (405) - Otherwise (diff is equal to 0), the following applies: k=0 (406) a=0 (407) b=minC (408)

[0303] 8. The predicted samples predSamples[x][y], where x=0..nTbW-1 and y=0..nTbH-1, are derived as follows: predSamples[x][y]=Clip1(((pDsY[x][y]*a)>>k)+b) (409) NOTE: This process uses sps_chroma_vertical_collocated_flag, but for simplicity of implementation, does not use sps_chroma_horizontal_collocated_flag.

[0304] 5.10. Embodiment 10 The working draft specified in JVET-Q2001-vE can be modified as follows:

[0305] 8.4.5.2.13 The inputs to this process are: - intra prediction mode predModeIntra, - sample position (xTbC, yTbC) of the top left sample of the current transform block relative to the top left sample of the current picture, - the variable nTbW that defines the width of the transformation block, - variable nTbH, which defines the height of the transformation block; - a variable cIdx that defines the color component of the current block, -Let x=-1, y=0..2*nTbH-1 and x=0..2*nTbW-1, y=-1, and let p[x][y] be the saturation neighborhood sample. The output of this process is the predicted samples preSamples[x][y], where x=0..nTbW-1, y=0..nTbH-1.

[0306] [ka]

[0307] The number of available chroma samples in the top right neighborhood, numTopRight, is derived as follows: The variable numTopRight is set equal to 0 and availTR is set equal to TRUE. -If preModeIntra 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: The derivation process for neighborhood block availability specified in Section 6.4.4 starts with the current luminance position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighborhood luminance position (xTbY+x, yTbY-1), checkPredModeY set equal to FALSE, and cIdx as inputs, and assigns the output to availTR. If -availTR is equal to TRUE, numTopRight is increased by one.

[0308] - The number of available bottom-left neighbor chroma samples, numLeftBelow, is derived as follows: The variable numLeftBelow is set equal to 0 and availLB is set equal to TRUE. -If preModeIntra 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: The derivation process for neighborhood block availability specified in Section 6.4.4 is invoked with the current luminance position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighborhood luminance position (xTbY-1, yTbY+y), checkPredModeY set equal to FALSE, and cIdx as inputs, and assigns the output to availLB. If -availLB is equal to TRUE, numLeftBelow is increased by one.

[0309] The number of available neighboring chroma samples in the top and top-right numSampT and the number of available neighboring chroma samples in the left and bottom-left numSampL are derived as follows: If -predModeIntra is equal to INTRA_LT_CCLM, the following applies: numSampT=availT?nTbW:0 (353) numSampL=availL?nTbH:0 (354) - Otherwise, the following applies: numSampT=(availT&&predModeIntra==INTRA_T_CCLM)?(nTbW+Min(numTopRight,nTbH)):0 (355) numSampL=(availL&&predModeIntra==INTRA_L_CCLM)?(nTbH+Min(numLeftBelow,nTbW)):0 (356)

[0310] The variable bCTUboundary is derived as follows: bCTUboundary=(yTbY&(CtbSizeY-1)==0)?TRUE:FALSE (357) The variable cntN and the array pickPosN, with N replaced by L and T, are derived as follows: The variable numIs4N is derived as follows: numIs4N=((availT&&availL&&predModeIntra==INTRA_LT_CCLM)?0:1) (358) The variable startPosN is set equal to numSampN>(2+numIs4N). The variable pickStepN is set equal to Max(1,numSampN>(1+numIs4N)). If -availN is equal to TRUE and preModeIntra is equal to INTRA_LT_CCLM or INTRA_N_CCLM, the following allocation occurs: -cntN is set equal to Min(numSampN, (1+numIs4N)<<1). -pospickPosN[pos] is set equal to (startPosN+pos*pospickStepN), where pos=0..cntN-1. Otherwise, cntN is set equal to 0.

[0311] The predicted samples predSamples[x][y], where x=0..nTbW-1 and y=0..nTbH-1, are derived as follows: If both -numSampL and numSampT are equal to 0, the following applies: predSamples[x][y]=1<<(BitDepth-1) (359) - Otherwise, the following ordered steps apply: 1. The co-located luma sample pY[x][y], where x=0..nTbW*SubWidthC-1, y=0..nTbH*SubHeightC-1, is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y).

[0312] [ka]

[0313] 3. The downsampled and arranged luminance samples pDsY[x][y], where x=0..nTbW-1 and y=0..nTbH-1, are derived as follows: -If both SubWidthC and SubHeightC are equal to 1, the following applies: pDsY[x][y] where x=1..nTbW-1 and y=1..nTbH-1 is derived as follows: pDstY[x][y]=pY[x][y] (360) - Otherwise, the following applies: The one-dimensional filter coefficient arrays F1 and F2 and the two-dimensional filter coefficient arrays F3 and F4 are defined as follows: F1[0]=2,F1[1]=0 (361) F2[0]=1,F2[1]=2,F2[2]=1 (362) F3[i][j]=F4[i][j]=0,i=0..2,j=0..2 (363) -If both SubWidthC and SubHeightC are equal to 2, the following applies: F1[0]=1,F1[1]=1 (364) F3[0][1]=1,F3[1][1]=4,F3[2][1]=1,F3[1][0]=1,F3[1][2]=1 (365) F4[0][1]=1,F4[1][1]=2,F4[2][1]=1 (366) F4[0][2]=1,F4[1][2]=2,F4[2][2]=1 (367) - Otherwise, the following applies: F3[1][1]=8 (368) F4[0][1]=2,F4[1][1]=4,F4[2][1]=2 (369)

[0314] If -sps_chroma_vertical_collocated_flag is equal to 1, the following applies: pDsY[x][y] where x=1..nTbW-1 and y=1..nTbH-1 is derived as follows: pDsY[x][y]=(F3[1][0]*pY[SubWidthC*x][SubHeightC*y-1]+ F3[0][1]*pY[SubWidthC*x-1][SubHeightC*y]+ F3[1][1]*pY[SubWidthC*x][SubHeightC*y]+ F3[2][1]* pY[SubWidthC*x+1][SubHeightC*y]+ F3[1][2]*pY[SubWidthC*x][SubHeightC*y+1]+4)>>3 (370) - Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies: pDsY[x][y] where x=1..nTbW-1 and y=1..nTbH-1 is derived as follows: pDsY[x][y]=(F4[0][1]*pY[SubWidthC*x-1][SubHeightC*y]+ F4[0][2]*pY[SubWidthC*x-1][SubHeightC*y+1]+ F4[1][1]*pY[SubWidthC*x][SubHeightC*y]+ F4[1][2]*pY[SubWidthC*x][SubHeightC*y+1]+ F4[2][1]*pY[SubWidthC*x+1][SubHeightC*y]+ F4[2][2]*pY[SubWidthC*x+1][SubHeightC*y+1]+4)>>3 (371)

[0315] 4. If numSampL is greater than 0, the selected neighboring left chroma sample pSelC[idx] is set equal to p[-1][pickPosL[idx]], idx=0..cntL-1, and the selected downsampled neighboring left luma sample pSelDsY[idx], idx=0..cntL-1, is derived as follows: The variable y is set equal to pickPosL[idx]. -If both SubWidthC and SubHeightC are equal to 1, the following applies: pSelDsY[idx]=pY[-1][y] (372) - Otherwise, the following applies: If -sps_chroma_vertical_collocated_flag is equal to 1, the following applies: pSelDsY[idx]=(F3[1][0]*pY[-SubWidthC][SubHeightC*y-1]+ F3[0][1]*pY[-1-SubWidthC][SubHeightC*y]+ F3[1][1]*pY[-SubWidthC][SubHeightC*y]+ F3[2][1]*pY[1-SubWidthC][SubHeightC*y]+ F3[1][2]*pY[-SubWidthC][SubHeightC*y+1]+4)>>3 (373) - Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies: pSelDsY[idx]=(F4[0][1]*pY[-1-SubWidthC][SubHeightC*y]+ F4[0][2]*pY[-1-SubWidthC][SubHeightC*y+1]+ F4[1][1]*pY[-SubWidthC][SubHeightC*y]+ F4[1][2]*pY[-SubWidthC][SubHeightC*y+1]+ F4[2][1]*pY[1-SubWidthC][SubHeightC*y]+ F4[2][2]*pY[1-SubWidthC][SubHeightC*y+1]+4)>>3 (374)

[0316] 5. If numSampT is greater than 0, the top chroma sample of the selected neighborhood, pSelC[idx], is set equal to p[pickPost[idx-cntL][-1], where idx=cntL..cntL+cntT-1, and the top luma sample of the downsampled neighborhood, pSelDsY[idx], where idx=0..cntL+cntT-1, is defined as follows: - The variable x is set equal to pickPost[idx-cntL]. -If both SubWidthC and SubHeightC are equal to 1, the following applies: pSelDsY[idx]=pY[x][-1] (375) - Otherwise, the following applies: If -sps_chroma_vertical_collocated_flag is equal to 1, the following applies: If -bCTUboundary is equal to FALSE, the following applies: pSelDsY[idx]=(F3[1][0]*pY[SubWidthC*x][-1-SubHeightC]+ F3[0][1]*pY[SubWidthC*x-1][-SubHeightC]+ F3[1][1]*pY[SubWidthC*x][-SubHeightC]+ F3[2][1]*pY[SubWidthC*x+1][-SubHeightC]+ F3[1][2]*pY[SubWidthC*x][1-SubHeightC]+4)>>3 (376) Otherwise (bCTUboundary is equal to TRUE), the following applies: pSelDsY[idx]=(F2[0]*pY[SubWidthC*x-1][-1]+ F2[1]*pY[SubWidthC*x][-1]+ F2[2]*pY[SubWidthC*x+1][-1]+2)>>2 (377)

[0317] - Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies: If -bCTUboundary is equal to FALSE, the following applies: pSelDsY[idx]=(F4[0][1]*pY[SubWidthCx-1][-1]+ F4[0][2]*pY[SubWidthC*x-1][-2]+ F4[1][1]*pY[SubWidthC*x][-1]+ F4[1][2]*pY[SubWidthC*x][-2]+ F4[2][1]*pY[SubWidthC*x+1][-1]+ F4[2][2]*pY[SubWidthC*x+1][-2]+4)>>3 (378) Otherwise (bCTUboundary is equal to TRUE), the following applies: pSelDsY[idx]=(F2[0]*pY[SubWidthC*x-1][-1]+ F2[1]*pY[SubWidthC*x][-1]+ F2[2]*pY[SubWidthC*x+1][-1]+2)>>2 (379)

[0318] 6. If cntT+cntL is not equal to 0, the variables minY, maxY, minC, and maxC are derived as follows: If -cntT+cntL is equal to 2, then with Comp substituted for DsY and C, pSelComp[3] is set equal to pSelComp[0], pSelComp[2] is set equal to pSelComp[1], pSelComp[0] is set equal to pSelComp[1], and pSelComp[1] is set equal to pSelComp[3]. The arrays minGrpIdx and maxGrpIdx are derived as follows: minGrpIdx[0]=0 (380) minGrpIdx[1]=2 (381) maxGrpIdx[0]=1 (382) maxGrpIdx[1]=3 (383)

[0319] -If pSelDsY[minGrpIdx[0]] is greater than pSelDsY[minGrpIdx[1]], minGrpIdx[0] and minGrpIdx[1] are swapped as follows: (minGrpIdx[0],minGrpIdx[1])=Swap(minGrpIdx[0],minGrpIdx[1]) (384) - If pSelDsY[maxGrpIdx[0]] is greater than pSelDsY[maxGrpIdx[1]], maxGrpIdx[0] and maxGrpIdx[1] are swapped as follows: (maxGrpIdx[0],maxGrpIdx[1])=Swap(maxGrpIdx[0],maxGrpIdx[1]) (385) - If pSelDsY[minGrpIdx[0]] is greater than pSelDsY[maxGrpIdx[1]], the arrays minGrpIdx and maxGrpIdx are swapped as follows: (minGrpIdx,maxGrpIdx)=Swap(minGrpIdx,maxGrpIdx) (386) - If pSelDsY[minGrpIdx[1]] is greater than pSelDsY[maxGrpIdx[0]], minGrpIdx[1] and maxGrpIdx[0] are swapped as follows: (minGrpIdx[1],maxGrpIdx[0])=Swap(minGrpIdx[1],maxGrpIdx[0]) (387) The variables maxY, maxC, minY and minC are derived as follows: maxY=(pSelDsY[maxGrpIdx[0]]+pSelDsY[maxGrpIdx[1]]+1)>>1 (388) maxC=(pSelC[maxGrpIdx[0]]+pSelC[maxGrpIdx[1]]+1)>>1 (389) minY=(pSelDsY[minGrpIdx[0]]+pSelDsY[minGrpIdx[1]]+1)>>1 (390) minC=(pSelC[minGrpIdx[0]]+pSelC[minGrpIdx[1]]+1)>>1 (391)

[0320] 7. The variables a, b, and k are derived as follows: If -numSampL is equal to 0 and numSampT is equal to 0, the following applies: k=0 (392) a=0 (393) b=1<<(BitDepth-1) (394) - Otherwise, the following applies: diff=maxY-minY (395) If -diff is not equal to 0, the following applies: diffC=maxC-minC (396) x=Floor(Log2(diff)) (397) normDiff=((diff<<4)>>x)&15 (398) x+=(normDiff!=0)?1:0 (399) y=Abs(diffC)>0?Floor(Log2(Abs(diffC)))+1:0 (400) a=(diffC*(divSigTable[normDiff]|8)+2 y-1 )>>y (401) k=((3+xy)<1)?1:3+xy (402) a=((3+xy)<1)?Sign(a)*15:a (403) b=minC-((a*minY)>>k) (404) Here, divSigTable[] is defined as follows: divSigTable[]={0,7,6,5,5,4,4,3,3,2,2,1,1,1,1,0} (405) - Otherwise (diff is equal to 0), the following applies: k=0 (406) a=0 (407) b=minC (408)

[0321] 8. The predicted samples predSamples[x][y], where x=0..nTbW-1 and y=0..nTbH-1, are derived as follows: predSamples[x][y]=Clip1(((pDsY[x][y]*a)>>k)+b) (409) NOTE: This process uses sps_chroma_vertical_collocated_flag, but for simplicity of implementation, does not use sps_chroma_horizontal_collocated_flag.

[0322] 5.11. Embodiment 11 The working draft specified in JVET-Q2001-vE can be modified as follows:

[0323] 8.4.5.2.13 The inputs to this process are: - intra prediction mode predModeIntra, - sample position (xTbC, yTbC) of the top left sample of the current transform block relative to the top left sample of the current picture, - the variable nTbW that defines the width of the transformation block, - variable nTbH, which defines the height of the transformation block; - a variable cIdx that defines the color component of the current block, - Let x=-1, y=0..2*nTbH-1 and x=0..2*nTbW-1, y=-1, and let p[x][y] be the saturation neighborhood sample. The output of this process is the predicted samples preSamples[x][y], where x=0..nTbW-1, y=0..nTbH-1.

[0324] The current luminance position (xTbY, yTbY) is derived as follows: (xTbY,yTbY)=(xTbC<<(SubWidthC-1),yTbC<<(SubHeightC-1)) (351) The variables availL, availT and availTL are derived as follows: The derivation process for neighborhood block availability specified in Section 6.4.4 starts with the current luminance position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighborhood luminance position (xTbY-1, yTbY), checkPredModeY set equal to FALSE, and cIdx as inputs, and assigns the output to availL. The derivation process for neighborhood block availability specified in Section 6.4.4 starts with the current luminance position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighborhood luminance position (xTbY, yTbY-1), checkPredModeY set equal to FALSE, and cIdx as inputs, and assigns the output to availT.

[0325] [[-The variable availTL is derived as follows: availTL=availL&&availT (352)]] The number of available chroma samples in the top right neighborhood, numTopRight, is derived as follows: The variable numTopRight is set equal to 0 and availTR is set equal to TRUE. -If preModeIntra 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: The derivation process for neighborhood block availability specified in Section 6.4.4 consists of the current luminance position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighborhood luminance position (xTbY+x, yTbY-1), and checkPr set equal to FALSE. It starts with edModeY and cIdx as inputs and assigns the output to availTR. If -availTR is equal to TRUE, numTopRight is increased by one. - The number of available bottom-left neighbor chroma samples, numLeftBelow, is derived as follows: The variable numLeftBelow is set equal to 0 and availLB is set equal to TRUE. -If preModeIntra 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: The derivation process for neighborhood block availability specified in Section 6.4.4 is invoked with the current luminance position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighborhood luminance position (xTbY-1, yTbY+y), checkPredModeY set equal to FALSE, and cIdx as inputs, and assigns the output to availLB. If -availLB is equal to TRUE, numLeftBelow is increased by one.

[0326] The number of available neighboring chroma samples in the top and top-right numSampT and the number of available neighboring chroma samples in the left and bottom-left numSampL are derived as follows: If -predModeIntra is equal to INTRA_LT_CCLM, the following applies: numSampT=availT?nTbW:0 (353) numSampL=availL?nTbH:0 (354) - Otherwise, the following applies: numSampT=(availT&&predModeIntra==INTRA_T_CCLM)?(nTbW+Min(numTopRight,nTbH)):0 (355) numSampL=(availL&&predModeIntra==INTRA_L_CCLM)?(nTbH+Min(numLeftBelow,nTbW)):0 (356)

[0327] The variable bCTUboundary is derived as follows: bCTUboundary=(yTbY&(CtbSizeY-1)==0)?TRUE:FALSE (357) The variable cntN and the array pickPosN, with N replaced by L and T, are derived as follows: The variable numIs4N is derived as follows: numIs4N=((availT&&availL&&predModeIntra==INTRA_LT_CCLM)?0:1) (358) The variable startPosN is set equal to numSampN>(2+numIs4N). The variable pickStepN is set equal to Max(1,numSampN>(1+numIs4N)). If -availN is equal to TRUE and preModeIntra is equal to INTRA_LT_CCLM or INTRA_N_CCLM, the following allocation occurs: -cntN is set equal to Min(numSampN, (1+numIs4N)<<1). -pospickPosN[pos] is set equal to (startPosN+pos*pospickStepN), where pos=0..cntN-1. Otherwise, cntN is set equal to 0. The predicted samples predSamples[x][y], where x=0..nTbW-1 and y=0..nTbH-1, are derived as follows: If both -numSampL and numSampT are equal to 0, the following applies: predSamples[x][y]=1<<(BitDepth-1) (359)

[0328] - Otherwise, the following ordered steps apply: 1. The co-located luma sample pY[x][y], where x=0..nTbW*SubWidthC-1, y=0..nTbH*SubHeightC-1, is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y).

[0329] [ka]

[0330] 3. The downsampled and arranged luminance samples pDsY[x][y], where x=0..nTbW-1 and y=0..nTbH-1, are derived as follows: -If both SubWidthC and SubHeightC are equal to 1, the following applies: - pDsY[x][y] where x=1..nTbW-1, y=1..nTbH-1 is derived as follows: pDstY[x][y]=pY[x][y] (360) - Otherwise, the following applies: The one-dimensional filter coefficient arrays F1 and F2 and the two-dimensional filter coefficient arrays F3 and F4 are defined as follows: F1[0]=2,F1[1]=0 (361) F2[0]=1,F2[1]=2,F2[2]=1 (362) F3[i][j]=F4[i][j]=0,i=0..2,j=0..2 (363) -If both SubWidthC and SubHeightC are equal to 2, the following applies: F1[0]=1,F1[1]=1 (364) F3[0][1]=1,F3[1][1]=4,F3[2][1]=1,F3[1][0]=1,F3[1][2]=1 (365) F4[0][1]=1,F4[1][1]=2,F4[2][1]=1 (366) F4[0][2]=1,F4[1][2]=2,F4[2][2]=1 (367) - Otherwise, the following applies: F3[1][1]=8 (368) F4[0][1]=2,F4[1][1]=4,F4[2][1]=2 (369)

[0331] If -sps_chroma_vertical_collocated_flag is equal to 1, the following applies: pDsY[x][y] where x=1..nTbW-1 and y=1..nTbH-1 is derived as follows: pDsY[x][y]=(F3[1][0]*pY[SubWidthC*x][SubHeightC*y-1]+ F3[0][1]*pY[SubWidthC*x-1][SubHeightC*y]+ F3[1][1]*pY[SubWidthC*x][SubHeightC*y]+ F3[2][1]*pY[SubWidthC*x+1][SubHeightC*y]+ F3[1][2]*pY[SubWidthC*x][SubHeightC*y+1]+4)>>3 (370) - Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies: pDsY[x][y] where x=1..nTbW-1 and y=1..nTbH-1 is derived as follows: pDsY[x][y]=(F4[0][1]*pY[SubWidthC*x-1][SubHeightC*y]+ F4[0][2]*pY[SubWidthC*x-1][SubHeightC*y+1]+ F4[1][1]*pY[SubWidthC*x][SubHeightC*y]+ F4[1][2]*pY[SubWidthC*x][SubHeightC*y+1]+ F4[2][1]*pY[SubWidthC*x+1][SubHeightC*y]+ F4[2][2]*pY[SubWidthC*x+1][SubHeightC*y+1]+4)>>3 (371)

[0332] 4. If numSampL is greater than 0, the selected neighboring left chroma sample pSelC[idx] is set equal to p[-1][pickPosL[idx]], idx=0..cntL-1, and the selected downsampled neighboring left luma sample pSelDsY[idx], idx=0..cntL-1, is derived as follows: The variable y is set equal to pickPosL[idx]. -If both SubWidthC and SubHeightC are equal to 1, the following applies: pSelDsY[idx]=pY[-1][y] (372) - Otherwise, the following applies: If -sps_chroma_vertical_collocated_flag is equal to 1, the following applies: pSelDsY[idx]=(F3[1][0]*pY[-SubWidthC][SubHeightC*y-1]+ F3[0][1]*pY[-1-SubWidthC][SubHeightC*y]+ F3[1][1]*pY[-SubWidthC][SubHeightC*y]+ F3[2][1]*pY[1-SubWidthC][SubHeightC*y]+ F3[1][2]*pY[-SubWidthC][SubHeightC*y+1]+4)>>3 (373)

[0333] - Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies: pSelDsY[idx]=(F4[0][1]*pY[-1-SubWidthC][SubHeightC*y]+ F4[0][2]*pY[-1-SubWidthC][SubHeightC*y+1]+ F4[1][1]*pY[-SubWidthC][SubHeightC*y]+ F4[1][2]*pY[-SubWidthC][SubHeightC*y+1]+ F4[2][1]*pY[1-SubWidthC][SubHeightC*y]+ F4[2][2]*pY[1-SubWidthC][SubHeightC*y+1]+4)>>3 (374)

[0334] 5. If numSampT is greater than 0, the top chroma sample of the selected neighborhood, pSelC[idx], is set equal to p[pickPost[idx-cntL][-1], where idx=cntL..cntL+cntT-1, and the top luma sample of the downsampled neighborhood, pSelDsY[idx], where idx=0..cntL+cntT-1, is defined as follows: - The variable x is set equal to pickPost[idx-cntL]. -If both SubWidthC and SubHeightC are equal to 1, the following applies: pSelDsY[idx]=pY[x][-1] (375) - Otherwise, the following applies: If -sps_chroma_vertical_collocated_flag is equal to 1, the following applies: If -bCTUboundary is equal to FALSE, the following applies: pSelDsY[idx]=(F3[1][0]*pY[SubWidthC*x][-1-SubHeightC]+ F3[0][1]*pY[SubWidthC*x-1][-SubHeightC]+ F3[1][1]*pY[SubWidthC*x][-SubHeightC]+ F3[2][1]*pY[SubWidthC*x+1][-SubHeightC]+ F3[1][2]*pY[SubWidthC*x][1-SubHeightC]+4)>>3 (376) Otherwise (bCTUboundary is equal to TRUE), the following applies: pSelDsY[idx]=(F2[0]*pY[SubWidthC*x-1][-1]+ F2[1]*pY[SubWidthC*x][-1]+ F2[2]*pY[SubWidthC*x+1][-1]+2)>>2 (377)

[0335] - Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies: If -bCTUboundary is equal to FALSE, the following applies: pSelDsY[idx]=(F4[0][1]*pY[SubWidthCx-1][-1]+ F4[0][2]*pY[SubWidthC*x-1][-2]+ F4[1][1]*pY[SubWidthC*x][-1]+ F4[1][2]*pY[SubWidthC*x][-2]+ F4[2][1]*pY[SubWidthC*x+1][-1]+ F4[2][2]*pY[SubWidthC*x+1][-2]+4)>>3 (378) Otherwise (bCTUboundary is equal to TRUE), the following applies: pSelDsY[idx]=(F2[0]*pY[SubWidthC*x-1][-1]+ F2[1]*pY[SubWidthC*x][-1]+ F2[2]*pY[SubWidthC*x+1][-1]+2)>>2 (379)

[0336] 6. If cntT+cntL is not equal to 0, then the variables minY, maxY, minC and maxC are derived as follows: If -cntT+cntL is equal to 2, Comp is replaced by DsY and C. In, pSelComp[3] is set equal to pSelComp[0], pSelComp[2] is set equal to pSelComp[1], pSelComp[0] is set equal to pSelComp[1], and pSelComp[1] is set equal to pSelComp[3]. The arrays minGrpIdx and maxGrpIdx are derived as follows: minGrpIdx[0]=0 (380) minGrpIdx[1]=2 (381) maxGrpIdx[0]=1 (382) maxGrpIdx[1]=3 (383)

[0337] -If pSelDsY[minGrpIdx[0]] is greater than pSelDsY[minGrpIdx[1]], minGrpIdx[0] and minGrpIdx[1] are swapped as follows: (minGrpIdx[0],minGrpIdx[1])=Swap(minGrpIdx[0],minGrpIdx[1]) (384) - If pSelDsY[maxGrpIdx[0]] is greater than pSelDsY[maxGrpIdx[1]], maxGrpIdx[0] and maxGrpIdx[1] are swapped as follows: (maxGrpIdx[0],maxGrpIdx[1])=Swap(maxGrpIdx[0],maxGrpIdx[1]) (385) - If pSelDsY[minGrpIdx[0]] is greater than pSelDsY[maxGrpIdx[1]], the arrays minGrpIdx and maxGrpIdx are swapped as follows: (minGrpIdx,maxGrpIdx)=Swap(minGrpIdx,maxGrpIdx) (386) - If pSelDsY[minGrpIdx[1]] is greater than pSelDsY[maxGrpIdx[0]], minGrpIdx[1] and maxGrpIdx[0] are swapped as follows: (minGrpIdx[1],maxGrpIdx[0])=Swap(minGrpIdx[1],maxGrpIdx[0]) (387) The variables maxY, maxC, minY and minC are derived as follows: maxY=(pSelDsY[maxGrpIdx[0]]+pSelDsY[maxGrpIdx[1]]+1)>>1 (388) maxC=(pSelC[maxGrpIdx[0]]+pSelC[maxGrpIdx[1]]+1)>>1 (389) minY=(pSelDsY[minGrpIdx[0]]+pSelDsY[minGrpIdx[1]]+1)>>1 (390) minC=(pSelC[minGrpIdx[0]]+pSelC[minGrpIdx[1]]+1)>>1 (391)

[0338] 7. The variables a, b, and k are derived as follows: If -numSampL is equal to 0 and numSampT is equal to 0, the following applies: k=0 (392) a=0 (393) b=1<<(BitDepth-1) (394) - Otherwise, the following applies: diff=maxY-minY (395) If -diff is not equal to 0, the following applies: diffC=maxC-minC (396) x=Floor(Log2(diff)) (397) normDiff=((diff<<4)>>x)&15 (398) x+=(normDiff!=0)?1:0 (399) y=Abs(diffC)>0?Floor(Log2(Abs(diffC)))+1:0 (400) a=(diffC*(divSigTable[normDiff]|8)+2 y -1 )>>y (401) k=((3+xy)<1)?1:3+xy (402) a=((3+xy)<1)?Sign(a)*15:a (403) b=minC-((a*minY)>>k) (404) Here, divSigTable[] is defined as follows: divSigTable[]={0,7,6,5,5,4,4,3,3,2,2,1,1,1,1,0} (405) - Otherwise (diff is equal to 0), the following applies: k=0 (406) a=0 (407) b=minC (408)

[0339] 8. The predicted samples predSamples[x][y], where x=0..nTbW-1 and y=0..nTbH-1, are derived as follows: predSamples[x][y]=Clip1(((pDsY[x][y]*a)>>k)+b) (409) NOTE: This process uses sps_chroma_vertical_collocated_flag, but for simplicity of implementation, does not use sps_chroma_horizontal_collocated_flag.

[0340] 5.12. Embodiment 12 The working draft specified in JVET-Q2001-vE can be modified as follows:

[0341] 8.4.5.2.13 The inputs to this process are: - intra prediction mode predModeIntra, - sample position (xTbC, yTbC) of the top left sample of the current transform block relative to the top left sample of the current picture, - the variable nTbW that defines the width of the transformation block, - variable nTbH, which defines the height of the transformation block; - a variable cIdx that defines the color component of the current block, - Let x=-1, y=0..2*nTbH-1 and x=0..2*nTbW-1, y=-1, and let p[x][y] be the saturation neighborhood sample. The output of this process is the predicted samples preSamples[x][y], where x=0..nTbW-1, y=0..nTbH-1. The current luminance position (xTbY, yTbY) is derived as follows: (xTbY,yTbY)=(xTbC<<(SubWidthC-1),yTbC<<(SubHeightC-1)) (351)

[0342] The variables availL, availT and availTL are derived as follows: The derivation process for neighborhood block availability specified in Section 6.4.4 starts with the current luminance position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighborhood luminance position (xTbY-1, yTbY), checkPredModeY set equal to FALSE, and cIdx as inputs, and assigns the output to availL. The derivation process for neighborhood block availability specified in Section 6.4.4 starts with the current luminance position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighborhood luminance position (xTbY, yTbY-1), checkPredModeY set equal to FALSE, and cIdx as inputs, and assigns the output to availT.

[0343] The variable availTL is derived as follows: availTL=availL&&availT (352) The number of available chroma samples in the top right neighborhood, numTopRight, is derived as follows: The variable numTopRight is set equal to 0 and availTR is set equal to TRUE. -If preModeIntra 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: The derivation process for neighborhood block availability specified in Section 6.4.4 starts with the current luminance position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighborhood luminance position (xTbY+x, yTbY-1), checkPredModeY set equal to FALSE, and cIdx as inputs, and assigns the output to availTR. If -availTR is equal to TRUE, numTopRight is increased by one.

[0344] - The number of available bottom-left neighbor chroma samples, numLeftBelow, is derived as follows: The variable numLeftBelow is set equal to 0 and availLB is set equal to TRUE. -If preModeIntra 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: The derivation process for neighborhood block availability specified in Section 6.4.4 is invoked with the current luminance position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighborhood luminance position (xTbY-1, yTbY+y), checkPredModeY set equal to FALSE, and cIdx as inputs, and assigns the output to availLB. If -availLB is equal to TRUE, numLeftBelow is increased by one.

[0345] The number of available neighboring chroma samples in the top and top-right numSampT and the number of available neighboring chroma samples in the left and bottom-left numSampL are derived as follows: If -predModeIntra is equal to INTRA_LT_CCLM, the following applies: numSampT=availT?nTbW:0 (353) numSampL=availL?nTbH:0 (354) - Otherwise, the following applies: numSampT=(availT&&predModeIntra==INTRA_T_CCLM)?(nTbW+Min(numTopRight,nTbH)):0 (355) numSampL=(availL&&predModeIntra==INTRA_L_CCLM)?(nTbH+Min(numLeftBelow,nTbW)):0 (356)

[0346] The variable bCTUboundary is derived as follows: bCTUboundary=(yTbY&(CtbSizeY-1)==0)?TRUE:FALSE (357) The variable cntN and the array pickPosN, with N replaced by L and T, are derived as follows: The variable numIs4N is derived as follows: numIs4N=((availT&&availL&&predModeIntra==INTRA_LT_CCLM)?0:1) (358) The variable startPosN is set equal to numSampN>(2+numIs4N). The variable pickStepN is set equal to Max(1,numSampN>(1+numIs4N)). If -availN is equal to TRUE and preModeIntra is equal to INTRA_LT_CCLM or INTRA_N_CCLM, the following allocation occurs: -cntN is set equal to Min(numSampN, (1+numIs4N)<<1). -pospickPosN[pos] is set equal to (startPosN+pos*pospickStepN), where pos=0..cntN-1. Otherwise, cntN is set equal to 0.

[0347] The predicted samples predSamples[x][y], where x=0..nTbW-1 and y=0..nTbH-1, are derived as follows: If both -numSampL and numSampT are equal to 0, the following applies: predSamples[x][y]=1<<(BitDepth-1) (359) - Otherwise, the following ordered steps apply: 1. The co-located luma sample pY[x][y], where x=0..nTbW*SubWidthC-1, y=0..nTbH*SubHeightC-1, is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y).

[0348] 2. The neighboring luminance samples pY[x][y] are derived as follows: If -numSampL is greater than 0, the nearby left luma sample pY[x][y] for x=-1..-3, y=0..SubHeightC*numSampL-1 is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y). If -availT is equal to FALSE, the top-most luminance sample pY[x][y] in the neighborhood with x=-1..SubWidthC*numSampT-1, y=-1..-2 is set equal to the luminance sample pY[x][0]. If -availL is equal to FALSE, the left luminance sample pY[x][y] in the neighborhood with x=-1..-3, y=-1..SubHeightC*numSampL-1 is set equal to luminance sample pY[0][y]. If -numSampT is greater than 0, the top-most luma sample pY[x][y] in the neighborhood x=0..SubWidthC*numSampT-1, y=-1,-2,-3 is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y). If -availTL is equal to TRUE, the top-left nearby luma sample pY[x][y] at x=-1,-2, y=-1,-2 is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y).

[0349] 3. The downsampled and arranged luminance samples pDsY[x][y], where x=0..nTbW-1 and y=0..nTbH-1, are derived as follows: -If both SubWidthC and SubHeightC are equal to 1, the following applies: pDsY[x][y] where x=1..nTbW-1 and y=1..nTbH-1 is derived as follows: pDstY[x][y]=pY[x][y] (360) - Otherwise, the following applies: The one-dimensional filter coefficient arrays F1 and F2 and the two-dimensional filter coefficient arrays F3 and F4 are defined as follows: F1[0]=2,F1[1]=0 (361) F2[0]=1,F2[1]=2,F2[2]=1 (362) F3[i][j]=F4[i][j]=0,i=0..2,j=0..2 (363) -If both SubWidthC and SubHeightC are equal to 2, the following applies: F1[0]=1,F1[1]=1 (364) F3[0][1]=1,F3[1][1]=4,F3[2][1]=1,F3[1][0]=1,F3[1][2]=1 (365) F4[0][1]=1,F4[1][1]=2,F4[2][1]=1 (366) F4[0][2]=1,F4[1][2]=2,F4[2][2]=1 (367) - Otherwise, the following applies: F3[1][1]=8 (368) F4[0][1]=2,F4[1][1]=4,F4[2][1]=2 (369)

[0350] If -sps_chroma_vertical_collocated_flag is equal to 1, the following applies: pDsY[x][y] where x=1..nTbW-1 and y=1..nTbH-1 is derived as follows: pDsY[x][y]=(F3[1][0]*pY[SubWidthC*x][SubHeightC*y-1]+ F3[0][1]*pY[SubWidthC*x-1][SubHeightC*y]+ F3[1][1]*pY[SubWidthC*x][SubHeightC*y]+ F3[2][1]*pY[SubWidthC*x+1][SubHeightC*y]+ F3[1][2]*pY[SubWidthC*x][SubHeightC*y+1]+4)>>3 (370)

[0351] - Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies: pDsY[x][y] where x=1..nTbW-1 and y=1..nTbH-1 is derived as follows: pDsY[x][y]=(F4[0][1]*pY[SubWidthC*x-1][SubHeightC*y]+ F4[0][2]*pY[SubWidthC*x-1][SubHeightC*y+1]+ F4[1][1]*pY[SubWidthC*x][SubHeightC*y]+ F4[1][2]*pY[SubWidthC*x][SubHeightC*y+1]+ F4[2][1]*pY[SubWidthC*x+1][SubHeightC*y]+ F4[2][2]*pY[SubWidthC*x+1][SubHeightC*y+1]+4)>>3 (371)

[0352] 4. If numSampL is greater than 0, the selected neighboring left chroma sample pSelC[idx] is set equal to p[-1][pickPosL[idx]], idx=0..cntL-1, and the selected downsampled neighboring left luma sample pSelDsY[idx], idx=0..cntL-1, is derived as follows: The variable y is set equal to pickPosL[idx]. -If both SubWidthC and SubHeightC are equal to 1, the following applies: pSelDsY[idx]= pY[-1][y] (372) - Otherwise, the following applies: If -sps_chroma_vertical_collocated_flag is equal to 1, the following applies: pSelDsY[idx]=(F3[1][0]*pY[-SubWidthC][SubHeightC*y-1]+ F3[0][1]*pY[-1-SubWidthC][SubHeightC*y]+ F3[1][1]*pY[-SubWidthC][SubHeightC*y]+ F3[2][1]*pY[1-SubWidthC][SubHeightC*y]+ F3[1][2]*pY[-SubWidthC][SubHeightC*y+1]+4)>>3 (373)

[0353] - Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies: pSelDsY[idx]=(F4[0][1]*pY[-1-SubWidthC][SubHeightC*y]+ F4[0][2]*pY[-1-SubWidthC][SubHeightC*y+1]+ F4[1][1]*pY[-SubWidthC][SubHeightC*y]+ F4[1][2]*pY[-SubWidthC][SubHeightC*y+1]+ F4[2][1]*pY[1-SubWidthC][SubHeightC*y]+ F4[2][2]*pY[1-SubWidthC][SubHeightC*y+1]+4)>>3 (374)

[0354] 5. If numSampT is greater than 0, the top chroma sample of the selected neighborhood, pSelC[idx], is set equal to p[pickPost[idx-cntL][-1], where idx=cntL..cntL+cntT-1, and the top luma sample of the downsampled neighborhood, pSelDsY[idx], where idx=0..cntL+cntT-1, is defined as follows: - The variable x is set equal to pickPost[idx-cntL]. -If both SubWidthC and SubHeightC are equal to 1, the following applies: pSelDsY[idx]=pY[x][-1] (375) - Otherwise, the following applies: If -sps_chroma_vertical_collocated_flag is equal to 1, the following applies: If -bCTUboundary is equal to FALSE, the following applies: pSelDsY[idx]=(F3[1][0]*pY[SubWidthC*x][-1-SubHeightC]+ F3[0][1]*pY[SubWidthC*x-1][-SubHeightC]+ F3[1][1]*pY[SubWidthC*x][-SubHeightC]+ F3[2][1]*pY[SubWidthC*x+1][-SubHeightC]+ F3[1][2]*pY[SubWidthC*x][1-SubHeightC]+4)>>3 (376)

[0355] Otherwise (bCTUboundary is equal to TRUE), the following applies: pSelDsY[idx]=(F2[0]*pY[SubWidthC*x-1][-1]+ F2[1]*pY[SubWidthC*x][-1]+ F2[2]*pY[SubWidthC*x+1][-1]+2)>>2 (377) - Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies: If -bCTUboundary is equal to FALSE, the following applies: pSelDsY[idx]=(F4[0][1]*pY[SubWidthCx-1][-1]+ F4[0][2]*pY[SubWidthC*x-1][-2]+ F4[1][1]*pY[SubWidthC*x][-1]+ F4[1][2]*pY[SubWidthC*x][-2]+ F4[2][1]*pY[SubWidthC*x+1][-1]+ F4[2][2]*pY[SubWidthC*x+1][-2]+4)>>3 (378) Otherwise (bCTUboundary is equal to TRUE), the following applies: pSelDsY[idx]=(F2[0]*pY[SubWidthC*x-1][-1]+ F2[1]*pY[SubWidthC*x][-1]+ F2[2]*pY[SubWidthC*x+1][-1]+2)>>2 (379)

[0356] 6. If cntT+cntL is not equal to 0, then the variables minY, maxY, minC, and maxC are derived as follows: If -cntT+cntL is equal to 2, then with Comp substituted for DsY and C, pSelComp[3] is set equal to pSelComp[0], pSelComp[2] is set equal to pSelComp[1], pSelComp[0] is set equal to pSelComp[1], and pSelComp[1] is set equal to pSelComp[3]. The arrays minGrpIdx and maxGrpIdx are derived as follows: minGrpIdx[0]=0 (380) minGrpIdx[1]=2 (381) maxGrpIdx[0]=1 (382) maxGrpIdx[1]=3 (383)

[0357] -If pSelDsY[minGrpIdx[0]] is greater than pSelDsY[minGrpIdx[1]], minGrpIdx[0] and minGrpIdx[1] are swapped as follows: (minGrpIdx[0],minGrpIdx[1])=Swap(minGrpIdx[0],minGrpIdx[1]) (384) - If pSelDsY[maxGrpIdx[0]] is greater than pSelDsY[maxGrpIdx[1]], maxGrpIdx[0] and maxGrpIdx[1] are swapped as follows: (maxGrpIdx[0],maxGrpIdx[1])=Swap(maxGrpIdx[0],maxGrpIdx[1]) (385) - If pSelDsY[minGrpIdx[0]] is greater than pSelDsY[maxGrpIdx[1]], the arrays minGrpIdx and maxGrpIdx are swapped as follows: (minGrpIdx,maxGrpIdx)=Swap(minGrpIdx,maxGrpIdx) (386) - If pSelDsY[minGrpIdx[1]] is greater than pSelDsY[maxGrpIdx[0]], minGrpIdx[1] and maxGrpIdx[0] are swapped as follows: (minGrpIdx[1],maxGrpIdx[0])=Swap(minGrpIdx[1],maxGrpIdx[0]) (387) The variables maxY, maxC, minY and minC are derived as follows: maxY=(pSelDsY[maxGrpIdx[0]]+pSelDsY[maxGrpIdx[1]]+1)>>1 (388) maxC=(pSelC[maxGrpIdx[0]]+pSelC[maxGrpIdx[1]]+1)>>1 (389) minY=(pSelDsY[minGrpIdx[0]]+pSelDsY[minGrpIdx[1]]+1)>>1 (390) minC=(pSelC[minGrpIdx[0]]+pSelC[minGrpIdx[1]]+1)>>1 (391)

[0358] 7. The variables a, b, and k are derived as follows: If -numSampL is equal to 0 and numSampT is equal to 0, the following applies: k=0 (392) a=0 (393) b=1<<(BitDepth-1) (394) - Otherwise, the following applies: diff=maxY-minY (395) If -diff is not equal to 0, the following applies: diffC=maxC-minC (396) x=Floor(Log2(diff)) (397) normDiff=((diff<<4)>>x)&15 (398) x+=(normDiff!=0)?1:0 (399) y=Abs(diffC)>0?Floor(Log2(Abs(diffC)))+1:0 (400) a=(diffC*(divSigTable[normDiff]|8)+2 y-1 )>>y (401) k=((3+xy)<1)?1:3+xy (402) a=((3+xy)<1)?Sign(a)*15:a (403) b=minC-((a*minY)>>k) (404) Here, divSigTable[] is defined as follows: divSigTable[]={0,7,6,5,5,4,4,3,3,2,2,1,1,1,1,0} (405) - Otherwise (diff is equal to 0), the following applies: k=0 (406) a=0 (407) b=minC (408)

[0359] 8. The predicted samples predSamples[x][y], where x=0..nTbW-1 and y=0..nTbH-1, are derived as follows: predSamples[x][y]=Clip1(((pDsY[x][y]*a)>>k)+b) (409) NOTE: This process uses sps_chroma_vertical_collocated_flag, but for simplicity of implementation, does not use sps_chroma_horizontal_collocated_flag.

[0360] 5.13. Embodiment 13 The working draft specified in JVET-Q2001-vE can be modified as follows:

[0361] 8.4.5.2.13 INTRA_LT_CCLM, INTRA_L_CCLM, and INTRA_T_CCLM Intra Prediction Mode Specifications The predicted samples predSamples[x][y], where x=0..nTbW-1 and y=0..nTbH-1, are derived as follows: If both -numSampL and numSampT are equal to 0, the following applies: predSamples[x][y]=1<<(BitDepth-1) (359)

[0362] - Otherwise, the following ordered steps apply: 1. The co-located luma sample pY[x][y], where x=0..nTbW*SubWidthC-1, y=0..nTbH*SubHeightC-1, is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y).

[0363] [ka]

[0364] 5.14. Embodiment 14 The working draft specified in JVET-Q2001-vE can be modified as follows:

[0365] 8.4.5.2.13 INTRA_LT_CCLM, INTRA_L_CCLM, and INTRA_T_CCLM Intra Prediction Mode Specifications The predicted samples predSamples[x][y], where x=0..nTbW-1 and y=0..nTbH-1, are derived as follows: If both -numSampL and numSampT are equal to 0, the following applies: predSamples[x][y]=1<<(BitDepth-1) (359)

[0366] - Otherwise, the following ordered steps apply: 1. The co-located luma sample pY[x][y], where x=0..nTbW*SubWidthC-1, y=0..nTbH*SubHeightC-1, is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y).

[0367] [ka]

[0368] 5.15. Embodiment 15 The working draft specified in JVET-Q2001-vE can be modified as follows:

[0369] 8.4.5.2.13 INTRA_LT_CCLM, INTRA_L_CCLM, and INTRA_T_CCLM Intra Prediction Mode Specifications The predicted samples predSamples[x][y], where x=0..nTbW-1 and y=0..nTbH-1, are derived as follows: If both -numSampL and numSampT are equal to 0, the following applies: predSamples[x][y]=1<<(BitDepth-1) (359)

[0370] - Otherwise, the following ordered steps apply: 1. The co-located luma sample pY[x][y], where x=0..nTbW*SubWidthC-1, y=0..nTbH*SubHeightC-1, is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y).

[0371] [ka]

[0372] 5.16. Embodiment 16 The working draft specified in JVET-Q2001-vE can be modified as follows:

[0373] 8.4.5.2.13 INTRA_LT_CCLM, INTRA_L_CCLM, and INTRA_T_CCLM Intra Prediction Mode Specifications The predicted samples predSamples[x][y], where x=0..nTbW-1, y=0..nTbH-1, are derived as follows: If both -numSampL and numSampT are equal to 0, the following applies: predSamples[x][y]=1<<(BitDepth-1) (359)

[0374] - Otherwise, the following ordered steps apply: 1. The co-located luma sample pY[x][y], where x=0..nTbW*SubWidthC-1, y=0..nTbH*SubHeightC-1, is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y).

[0375] [ka]

[0376] 5.17. Embodiment 17 The working draft specified in JVET-Q2001-vE can be modified as follows:

[0377] 8.4.5.2.13 INTRA_LT_CCLM, INTRA_L_CCLM, and INTRA_T_CCLM Intra Prediction Mode Specifications The inputs to this process are: - intra prediction mode predModeIntra, - sample position (xTbC, yTbC) of the top left sample of the current transform block relative to the top left sample of the current picture, - the variable nTbW that defines the width of the transformation block, - variable nTbH, which defines the height of the transformation block; - a variable cIdx that defines the color component of the current block, - Let x=-1, y=0..2*nTbH-1 and x=0..2*nTbW-1, y=-1, and let p[x][y] be the saturation neighborhood sample. The output of this process is the predicted samples preSamples[x][y], where x=0..nTbW-1, y=0..nTbH-1.

[0378] [ka]

[0379] 5.18. Embodiment 18 The working draft specified in JVET-Q2001-vE can be modified as follows:

[0380] 8.4.5.2.13 INTRA_LT_CCLM, INTRA_L_CCLM, and INTRA_T_CCLM Intra Prediction Mode Specifications The predicted samples predSamples[x][y], where x=0..nTbW-1 and y=0..nTbH-1, are derived as follows: If both -numSampL and numSampT are equal to 0, the following applies: predSamples[x][y]=1<<(BitDepth-1) (359)

[0381] - Otherwise, the following ordered steps apply: 1. The co-located luma sample pY[x][y], where x=0..nTbW*SubWidthC-1, y=0..nTbH*SubHeightC-1, is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y).

[0382] [ka]

[0383] 5.19. Embodiment 19 The working draft specified in JVET-Q2001-vE can be modified as follows:

[0384] 8.4.5.2.13 INTRA_LT_CCLM, INTRA_L_CCLM, and INTRA_T_CCLM Intra Prediction Mode Specifications The predicted samples predSamples[x][y], where x=0..nTbW-1 and y=0..nTbH-1, are derived as follows: If both -numSampL and numSampT are equal to 0, the following applies: predSamples[x][y]=1<<(BitDepth-1) (359) - Otherwise, the following ordered steps apply: 1. The co-located luma sample pY[x][y], where x=0..nTbW*SubWidthC-1, y=0..nTbH*SubHeightC-1, is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y).

[0385] [ka]

[0386] 5.20. Embodiment 20 The working draft specified in JVET-Q2001-vE can be modified as follows:

[0387] 8.4.5.2.13 INTRA_LT_CCLM, INTRA_L_CCLM, and INTRA_T_CCLM Intra Prediction Mode Specifications The inputs to this process are: - intra prediction mode predModeIntra, - sample position (xTbC, yTbC) of the top left sample of the current transform block relative to the top left sample of the current picture, - the variable nTbW that defines the width of the transformation block, - variable nTbH, which defines the height of the transformation block; - a variable cIdx that defines the color component of the current block, - Let x=-1, y=0..2*nTbH-1 and x=0..2*nTbW-1, y=-1, and let p[x][y] be the saturation neighborhood sample. The output of this process is the predicted samples preSamples[x][y], where x=0..nTbW-1, y=0..nTbH-1. The current luminance position (xTbY, yTbY) is derived as follows: (xTbY,yTbY)=(xTbC<<(SubWidthC-1),yTbC<<(SubHeightC-1)) (351)

[0388] [ka]

[0389] The predicted samples predSamples[x][y], where x=0..nTbW-1 and y=0..nTbH-1, are derived as follows: If both -numSampL and numSampT are equal to 0, the following applies: predSamples[x][y]=1<<(BitDepth-1) (359) - Otherwise, the following ordered steps apply: 1. The co-located luma sample pY[x][y], where x=0..nTbW*SubWidthC-1, y=0..nTbH*SubHeightC-1, is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y).

[0390] [ka]

[0391] 5.21. Embodiment 21 The working draft specified in JVET-Q2001-vE can be modified as follows:

[0392] 8.4.5.2.13 INTRA_LT_CCLM, INTRA_L_CCLM, and INTRA_T_CCLM Intra Prediction Mode Specifications The predicted samples predSamples[x][y], where x=0..nTbW-1 and y=0..nTbH-1, are derived as follows: If both -numSampL and numSampT are equal to 0, the following applies: predSamples[x][y]=1<<(BitDepth-1) (359)

[0393] - Otherwise, the following ordered steps apply: 1. The co-located luma sample pY[x][y], where x=0..nTbW*SubWidthC-1, y=0..nTbH*SubHeightC-1, is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y).

[0394] [ka]

[0395] 5.22. Embodiment 22 The working draft specified in JVET-Q2001-vE can be modified as follows:

[0396] 8.4.5.2.13 INTRA_LT_CCLM, INTRA_L_CCLM, and INTRA_T_CCLM Intra Prediction Mode Specifications The predicted samples predSamples[x][y], where x=0..nTbW-1 and y=0..nTbH-1, are derived as follows: If both -numSampL and numSampT are equal to 0, the following applies: predSamples[x][y]=1<<(BitDepth-1) (359) - Otherwise, the following ordered steps apply: 1. The co-located luma sample pY[x][y], where x=0..nTbW*SubWidthC-1, y=0..nTbH*SubHeightC-1, is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y).

[0397] [ka]

[0398] 5.23. Embodiment 23 The working draft specified in JVET-Q2001-vE can be modified as follows:

[0399] 8.4.5.2.13 INTRA_LT_CCLM, INTRA_L_CCLM, and INTRA_T_CCLM Intra Prediction Mode Specifications The inputs to this process are: - intra prediction mode predModeIntra, - sample position (xTbC, yTbC) of the top left sample of the current transform block relative to the top left sample of the current picture, - the variable nTbW that defines the width of the transformation block, - variable nTbH, which defines the height of the transformation block; - a variable cIdx that defines the color component of the current block, - Let x=-1, y=0..2*nTbH-1 and x=0..2*nTbW-1, y=-1, and let p[x][y] be the saturation neighborhood sample. The output of this process is the predicted samples preSamples[x][y], where x=0..nTbW-1, y=0..nTbH-1. The current luminance position (xTbY, yTbY) is derived as follows: (xTbY,yTbY)=(xTbC<<(SubWidthC-1),yTbC<<(SubHeightC-1)) (351)

[0400] [ka]

[0401] The predicted samples predSamples[x][y], where x=0..nTbW-1 and y=0..nTbH-1, are derived as follows: If both -numSampL and numSampT are equal to 0, the following applies: predSamples[x][y]=1<<(BitDepth-1) (359) - Otherwise, the following ordered steps apply: 1. The co-located luma sample pY[x][y], where x=0..nTbW*SubWidthC-1, y=0..nTbH*SubHeightC-1, is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y).

[0402] [ka]

[0403] 5.24. Embodiment 24 The working draft specified in JVET-Q2001-vE can be modified as follows:

[0404] 8.4.5.2.13 INTRA_LT_CCLM, INTRA_L_CCLM, and INTRA_T_CCLM Intra Prediction Mode Specifications The inputs to this process are: - intra prediction mode predModeIntra, - sample position (xTbC, yTbC) of the top left sample of the current transform block relative to the top left sample of the current picture, - the variable nTbW that defines the width of the transformation block, - variable nTbH, which defines the height of the transformation block; - a variable cIdx that defines the color component of the current block, - Let x=-1, y=0..2*nTbH-1 and x=0..2*nTbW-1, y=-1, and let p[x][y] be the saturation neighborhood sample. The output of this process is the predicted samples preSamples[x][y], where x=0..nTbW-1, y=0..nTbH-1. The current luminance position (xTbY, yTbY) is derived as follows: (xTbY,yTbY)=(xTbC<<(SubWidthC-1),yTbC<<(SubHeightC-1)) (351)

[0405] [ka]

[0406] The predicted samples predSamples[x][y], where x=0..nTbW-1 and y=0..nTbH-1, are derived as follows: If both -numSampL and numSampT are equal to 0, the following applies: predSamples[x][y]=1<<(BitDepth-1) (359) - Otherwise, the following ordered steps apply: 1. The co-located luma sample pY[x][y], where x=0..nTbW*SubWidthC-1, y=0..nTbH*SubHeightC-1, is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y).

[0407] [ka]

[0408] 5.25. Embodiment 25 The working draft specified in JVET-Q2001-vE can be modified as follows:

[0409] 8.4.5.2.13 INTRA_LT_CCLM, INTRA_L_CCLM, and INTRA_T_CCLM Intra Prediction Mode Specifications The inputs to this process are: - intra prediction mode predModeIntra, - sample position (xTbC, yTbC) of the top left sample of the current transform block relative to the top left sample of the current picture, - the variable nTbW that defines the width of the transformation block, - variable nTbH, which defines the height of the transformation block; - a variable cIdx that defines the color component of the current block, - Chroma neighborhood samples p[x][y] where x=-1, y=0..2*nTbH-1 and x=0..2*nTbW-1, y=-1. The output of this process is the predicted samples preSamples[x][y], where x=0..nTbW-1, y=0..nTbH-1. The current luminance position (xTbY, yTbY) is derived as follows: (xTbY,yTbY)=(xTbC<<(SubWidthC-1),yTbC<<(SubHeightC-1)) (351)

[0410] [ka]

[0411] The predicted samples predSamples[x][y], where x=0..nTbW-1 and y=0..nTbH-1, are derived as follows: If both -numSampL and numSampT are equal to 0, the following applies: predSamples[x][y]=1<<(BitDepth-1) (359) - Otherwise, the following ordered steps apply: 1. The co-located luma sample pY[x][y], where x=0..nTbW*SubWidthC-1, y=0..nTbH*SubHeightC-1, is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y).

[0412] [ka]

[0413] 5.26. Embodiment 26 The working draft specified in JVET-Q2001-vE can be modified as follows:

[0414] 8.4.5.2.13 INTRA_LT_CCLM, INTRA_L_CCLM, and INTRA_T_CCLM Intra Prediction Mode Specifications The inputs to this process are: - intra prediction mode predModeIntra, - sample position (xTbC, yTbC) of the top left sample of the current transform block relative to the top left sample of the current picture, - the variable nTbW that defines the width of the transformation block, - variable nTbH, which defines the height of the transformation block; - a variable cIdx that defines the color component of the current block, - Let x=-1, y=0..2*nTbH-1 and x=0..2*nTbW-1, y=-1, and let p[x][y] be the saturation neighborhood sample. The output of this process is the predicted samples preSamples[x][y], where x=0..nTbW-1, y=0..nTbH-1. The current luminance position (xTbY, yTbY) is derived as follows: (xTbY,yTbY)=(xTbC<<(SubWidthC-1),yTbC<<(SubHeightC-1)) (351)

[0415] [ka]

[0416] The predicted samples predSamples[x][y], where x=0..nTbW-1 and y=0..nTbH-1, are derived as follows: If both -numSampL and numSampT are equal to 0, the following applies: predSamples[x][y]=1<<(BitDepth-1) (359) - Otherwise, the following ordered steps apply: 1. The co-located luma sample pY[x][y], where x=0..nTbW*SubWidthC-1, y=0..nTbH*SubHeightC-1, is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y).

[0417] [ka]

[0418] 5.27. Embodiment 27 The working draft specified in JVET-Q2001-vE can be modified as follows:

[0419] 8.4.5.2.13 INTRA_LT_CCLM, INTRA_L_CCLM, and INTRA_T_CCLM Intra Prediction Mode Specifications The predicted samples predSamples[x][y], where x=0..nTbW-1 and y=0..nTbH-1, are derived as follows: If both -numSampL and numSampT are equal to 0, the following applies: predSamples[x][y]=1<<(BitDepth-1) (359) - Otherwise, the following ordered steps apply: 1. The co-located luma sample pY[x][y], where x=0..nTbW*SubWidthC-1, y=0..nTbH*SubHeightC-1, is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y).

[0420] 2. The neighboring luminance samples pY[x][y] are derived as follows: If -numSampL is greater than 0, the left luminance sample pY[x][y] in the neighborhood x=-1..-3, y=0..SubHeightC*numSampL-1 is the undeblocked reconstruction at position (xTbY+x, yTbY+y). The pixel value is set equal to the input luminance sample. If -availT is equal to FALSE, the top-most luminance sample pY[x][y] in the neighborhood with x=-1..SubWidthC*numSampT-1, y=-1..-2 is set equal to the luminance sample pY[x][0]. If -availL is equal to FALSE, the left luminance sample pY[x][y] in the neighborhood with x=-1..-3, y=-1..SubHeightC*numSampL-1 is set equal to luminance sample pY[0][y]. If -numSampT is greater than 0, the top-most luma sample pY[x][y] in the neighborhood with x=0..SubWidthC*numSampT-1, y=-1,-2 is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y). If -availTL is equal to TRUE, the top-left neighboring luma sample pY[x][y] at x=-1, y=-1,-2 is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y).

[0421] 3. The downsampled and arranged luminance samples pDsY[x][y], where x=0..nTbW-1 and y=0..nTbH-1, are derived as follows: -If both SubWidthC and SubHeightC are equal to 1, the following applies: pDsY[x][y] where x=1..nTbW-1 and y=1..nTbH-1 is derived as follows: pDstY[x][y]=pY[x][y] (360)

[0422] [ka]

[0423] If -sps_chroma_vertical_collocated_flag is equal to 1, the following applies: pDsY[x][y] where x=1..nTbW-1 and y=1..nTbH-1 is derived as follows: pDsY[x][y]=(F3[1][0]*pY[SubWidthC*x][SubHeightC*y-1]+ F3[0][1]*pY[SubWidthC*x-1][SubHeightC*y]+ F3[1][1]*pY[SubWidthC*x][SubHeightC*y]+ F3[2][1]*pY[SubWidthC*x+1][SubHeightC*y]+ F3[1][2]*pY[SubWidthC*x][SubHeightC*y+1]+4)>>3 (370) - Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies: pDsY[x][y] where x=1..nTbW-1 and y=1..nTbH-1 is derived as follows: pDsY[x][y]=(F4[0][1]*pY[SubWidthC*x-1][SubHeightC*y]+ F4[0][2]*pY[SubWidthC*x-1][SubHeightC*y+1]+ F4[1][1]*pY[SubWidthC*x][SubHeightC*y]+ F4[1][2]*pY[SubWidthC*x][SubHeightC*y+1]+ F4[2][1]*pY[SubWidthC*x+1][SubHeightC*y]+ F4[2][2]*pY[SubWidthC*x+1][SubHeightC*y+1]+4)>>3 (371)

[0424] 5.28. Embodiment 28 The working draft specified in JVET-Q2001-vE can be modified as follows:

[0425] 8.4.5.2.13 INTRA_LT_CCLM, INTRA_L_CCLM, and INTRA_T_CCLM Intra Prediction Mode Specifications The inputs to this process are: - intra prediction mode predModeIntra, - sample position (xTbC, yTbC) of the top left sample of the current transform block relative to the top left sample of the current picture, - the variable nTbW that defines the width of the transformation block, - variable nTbH, which defines the height of the transformation block; - a variable cIdx that defines the color component of the current block, - Let x=-1, y=0..2*nTbH-1 and x=0..2*nTbW-1, y=-1, and let p[x][y] be the saturation neighborhood sample. The output of this process is the predicted samples preSamples[x][y], where x=0..nTbW-1, y=0..nTbH-1.

[0426] The current luminance position (xTbY, yTbY) is derived as follows: (xTbY,yTbY)=(xTbC<<(SubWidthC-1),yTbC<<(SubHeightC-1)) (351) The variables availL, availT and availTL are derived as follows: The derivation process for neighborhood block availability specified in Section 6.4.4 starts with the current luminance position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighborhood luminance position (xTbY-1, yTbY), checkPredModeY set equal to FALSE, and cIdx as inputs, and assigns the output to availL. The derivation process for neighborhood block availability specified in Section 6.4.4 starts with the current luminance position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighborhood luminance position (xTbY, yTbY-1), checkPredModeY set equal to FALSE, and cIdx as inputs, and assigns the output to availT.

[0427] The variable availTL is derived as follows: availTL=availL&&availT (352) The number of available chroma samples in the top right neighborhood, numTopRight, is derived as follows: The variable numTopRight is set equal to 0 and availTR is set equal to TRUE. -If preModeIntra 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: The derivation process for neighborhood block availability specified in Section 6.4.4 starts with the current luminance position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighborhood luminance position (xTbY+x, yTbY-1), checkPredModeY set equal to FALSE, and cIdx as inputs, and assigns the output to availTR. If -availTR is equal to TRUE, numTopRight is increased by one.

[0428] - The number of available bottom-left neighbor chroma samples, numLeftBelow, is derived as follows: The variable numLeftBelow is set equal to 0 and availLB is set equal to TRUE. -If preModeIntra 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: The derivation process for neighborhood block availability specified in Section 6.4.4 is invoked with the current luminance position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighborhood luminance position (xTbY-1, yTbY+y), checkPredModeY set equal to FALSE, and cIdx as inputs, and assigns the output to availLB. If -availLB is equal to TRUE, numLeftBelow is increased by one.

[0429] The number of available neighboring chroma samples in the top and top-right numSampT and the number of available neighboring chroma samples in the left and bottom-left numSampL are derived as follows: If -predModeIntra is equal to INTRA_LT_CCLM, the following applies: numSampT=availT?nTbW:0 (353) numSampL=availL?nTbH:0 (354) - Otherwise, the following applies: numSampT=(availT&&predModeIntra==INTRA_T_CCLM)?(nTbW+Min(numTopRight,nTbH)):0 (355) numSampL=(availL&&predModeIntra==INTRA_L_CCLM)?(nTbH+Min(numLeftBelow,nTbW)):0 (356)

[0430] The variable bCTUboundary is derived as follows: bCTUboundary=(yTbY&(CtbSizeY-1)==0)?TRUE:FALSE (357) The variable cntN and the array pickPosN, with N replaced by L and T, are derived as follows: The variable numIs4N is derived as follows: numIs4N=((availT&&availL&&predModeIntra==INTRA_LT_CCLM)?0:1) (358) The variable startPosN is set equal to numSampN>(2+numIs4N). The variable pickStepN is set equal to Max(1,numSampN>(1+numIs4N)). If -availN is equal to TRUE and preModeIntra is equal to INTRA_LT_CCLM or INTRA_N_CCLM, the following allocation occurs: -cntN is set equal to Min(numSampN, (1+numIs4N)<<1). -pospickPosN[pos] is set equal to (startPosN+pos*pospickStepN), where pos=0..cntN-1. Otherwise, cntN is set equal to 0.

[0431] [ka]

[0432] The predicted samples predSamples[x][y], where x=0..nTbW-1 and y=0..nTbH-1, are derived as follows: If both -numSampL and numSampT are equal to 0, the following applies: predSamples[x][y]=1<<(BitDepth-1) (359) - Otherwise, the following ordered steps apply: 1. The co-located luma sample pY[x][y], where x=0..nTbW*SubWidthC-1, y=0..nTbH*SubHeightC-1, is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y).

[0433] 2. The neighboring luminance samples pY[x][y] are derived as follows: If -numSampL is greater than 0, the nearby left luma sample pY[x][y] for x=-1..-3, y=0..SubHeightC*numSampL-1 is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y). If -availT is equal to FALSE, the top-most luminance sample pY[x][y] in the neighborhood with x=-1..SubWidthC*numSampT-1, y=-1..-2 is set equal to the luminance sample pY[x][0]. If -availL is equal to FALSE, the left luminance sample pY[x][y] in the neighborhood with x=-1..-3, y=-1..SubHeightC*numSampL-1 is set equal to luminance sample pY[0][y]. If -numSampT is greater than 0, the top-most luma sample pY[x][y] in the neighborhood with x=0..SubWidthC*numSampT-1, y=-1,-2 is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y). If -availTL is equal to TRUE, the top-left neighboring luma sample pY[x][y] at x=-1, y=-1,-2 is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y).

[0434] 3. The downsampled and arranged luminance samples pDsY[x][y], where x=0..nTbW-1 and y=0..nTbH-1, are derived as follows: -If both SubWidthC and SubHeightC are equal to 1, the following applies: pDsY[x][y] where x=1..nTbW-1 and y=1..nTbH-1 is derived as follows: pDstY[x][y]=pY[x][y] (360)

[0435] [ka]

[0436] [ka]

[0437] 4. If numSampL is greater than 0, the selected neighboring left chroma sample pSelC[idx] is set equal to p[-1][pickPosL[idx]], idx=0..cntL-1, and the selected downsampled neighboring left luma sample pSelDsY[idx], idx=0..cntL-1, is derived as follows: The variable y is set equal to pickPosL[idx]. -If both SubWidthC and SubHeightC are equal to 1, the following applies: pSelDsY[idx]=pY[-1][y] (372)

[0438] [ka]

[0439] 5. If numSampT is greater than 0, the top chroma sample pSelC[idx] of the selected neighborhood is set equal to p[pickPost[idx-cntL][-1], where idx=cntL..cntL+cntT-1, and the top luma sample pSelDsY[idx] of the downsampled neighborhood, where [[0]]cntL..cntL+cntT-1, is defined as follows: - The variable x is set equal to pickPost[idx-cntL]. -If both SubWidthC and SubHeightC are equal to 1, the following applies: pSelDsY[idx]=pY[x][-1] (375)

[0440] [ka]

[0441] Otherwise (bCTUboundary is equal to TRUE), the following applies: pSelDsY[idx]=(F2[0]*pY[SubWidthC*x-1][-1]+ F2[1]*pY[SubWidthC*x][-1]+ F2[2]*pY[SubWidthC*x+1][-1]+2)>>2 (377)

[0442] [ka]

[0443] 6. If cntT+cntL is not equal to 0, then the variables minY, maxY, minC, and maxC are derived as follows: If -cntT+cntL is equal to 2, then with Comp substituted for DsY and C, pSelComp[3] is set equal to pSelComp[0], pSelComp[2] is set equal to pSelComp[1], pSelComp[0] is set equal to pSelComp[1], and pSelComp[1] is set equal to pSelComp[3]. The arrays minGrpIdx and maxGrpIdx are derived as follows: minGrpIdx[0]=0 (380) minGrpIdx[1]=2 (381) maxGrpIdx[0]=1 (382) maxGrpIdx[1]=3 (383)

[0444] -If pSelDsY[minGrpIdx[0]] is greater than pSelDsY[minGrpIdx[1]], minGrpIdx[0] and minGrpIdx[1] are swapped as follows: (minGrpIdx[0],minGrpIdx[1])=Swap(minGrpIdx[0],minGrpIdx[1]) (384) - If pSelDsY[maxGrpIdx[0]] is greater than pSelDsY[maxGrpIdx[1]], maxGrpIdx[0] and maxGrpIdx[1] are swapped as follows: (maxGrpIdx[0],maxGrpIdx[1])=Swap(maxGrpIdx[0],maxGrpIdx[1]) (385) - If pSelDsY[minGrpIdx[0]] is greater than pSelDsY[maxGrpIdx[1]], the arrays minGrpIdx and maxGrpIdx are swapped as follows: (minGrpIdx,maxGrpIdx)=Swap(minGrpIdx,maxGrpIdx) (386) - If pSelDsY[minGrpIdx[1]] is greater than pSelDsY[maxGrpIdx[0]], minGrpIdx[1] and maxGrpIdx[0] are swapped as follows: (minGrpIdx[1],maxGrpIdx[0])=Swap(minGrpIdx[1],maxGrpIdx[0]) (387) The variables maxY, maxC, minY and minC are derived as follows: maxY=(pSelDsY[maxGrpIdx[0]]+pSelDsY[maxGrpIdx[1]]+1)>>1 (388) maxC=(pSelC[maxGrpIdx[0]]+pSelC[maxGrpIdx[1]]+1)>>1 (389) minY=(pSelDsY[minGrpIdx[0]]+pSelDsY[minGrpIdx[1]]+1)>>1 (390) minC=(pSelC[minGrpIdx[0]]+pSelC[minGrpIdx[1]]+1)>>1 (391)

[0445] 7. The variables a, b, and k are derived as follows: If -numSampL is equal to 0 and numSampT is equal to 0, the following applies: k=0 (392) a=0 (393) b=1<<(BitDepth-1) (394) - Otherwise, the following applies: diff=maxY-minY (395) If -diff is not equal to 0, the following applies: diffC=maxC-minC (396) x=Floor(Log2(diff)) (397) normDiff=((diff<<4)>>x)&15 (398) x+=(normDiff!=0)?1:0 (399) y=Abs(diffC)>0?Floor(Log2(Abs(diffC)))+1:0 (400) a=(diffC*(divSigTable[normDiff]|8)+2 y-1 )>>y (401) k=((3+xy)<1)?1:3+xy (402) a=((3+xy)<1)?Sign(a)*15:a (403) b=minC-((a*minY)>>k) (404) Here, divSigTable[] is defined as follows: divSigTable[]={0,7,6,5,5,4,4,3,3,2,2,1,1,1,1,0} (405) - Otherwise (diff is equal to 0), the following applies: k=0 (406) a=0 (407) b=minC (408)

[0446] 8. The predicted samples predSamples[x][y], where x=0..nTbW-1 and y=0..nTbH-1, are derived as follows: predSamples[x][y]=Clip1(((pDsY[x][y]*a)>>k)+b) (409) NOTE: This process uses sps_chroma_vertical_collocated_flag, but for simplicity of implementation, does not use sps_chroma_horizontal_collocated_flag.

[0447] 5.29. Embodiment 29 The working draft specified in JVET-Q2001-vE can be modified as follows:

[0448] 8.4.5.2.13 INTRA_LT_CCLM, INTRA_L_CCLM, and INTRA_T_CCLM Intra Prediction Mode Specifications The predicted samples predSamples[x][y], where x=0..nTbW-1 and y=0..nTbH-1, are derived as follows: If both -numSampL and numSampT are equal to 0, the following applies: predSamples[x][y]=1<<(BitDepth-1) (359) - Otherwise, the following ordered steps apply: 1. The co-located luma sample pY[x][y], where x=0..nTbW*SubWidthC-1, y=0..nTbH*SubHeightC-1, is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y).

[0449] [ka]

[0450] 5.30. Embodiment 30 The working draft specified in JVET-Q2001-vE can be modified as follows:

[0451] 8.4.5.2.13 INTRA_LT_CCLM, INTRA_L_CCLM, and INTRA_T_CCLM Intra Prediction Mode Specifications The predicted samples predSamples[x][y], where x=0..nTbW-1 and y=0..nTbH-1, are derived as follows: If both -numSampL and numSampT are equal to 0, the following applies: predSamples[x][y]=1<<(BitDepth-1) (359) - Otherwise, the following ordered steps apply: 1. The co-located luma sample pY[x][y], where x=0..nTbW*SubWidthC-1, y=0..nTbH*SubHeightC-1, is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y).

[0452] [ka]

[0453] 5.31. Embodiment 31 The working draft specified in JVET-Q2001-vE can be modified as follows:

[0454] 8.4.5.2.13 INTRA_LT_CCLM, INTRA_L_CCLM, and INTRA_T_CCLM Intra Prediction Mode Specifications The inputs to this process are: - intra prediction mode predModeIntra, - sample position (xTbC, yTbC) of the top left sample of the current transform block relative to the top left sample of the current picture, - the variable nTbW that defines the width of the transformation block, - variable nTbH, which defines the height of the transformation block; - a variable cIdx that defines the color component of the current block, - Let x=-1, y=0..2*nTbH-1 and x=0..2*nTbW-1, y=-1, and let p[x][y] be the saturation neighborhood sample. The output of this process is the predicted samples preSamples[x][y], where x=0..nTbW-1, y=0..nTbH-1.

[0455] The current luminance position (xTbY, yTbY) is derived as follows: (xTbY,yTbY)=(xTbC<<(SubWidthC-1),yTbC<<(SubHeightC-1)) (351) The variables availL, availT and availTL are derived as follows: The derivation process for neighborhood block availability specified in Section 6.4.4 starts with the current luminance position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighborhood luminance position (xTbY-1, yTbY), checkPredModeY set equal to FALSE, and cIdx as inputs, and assigns the output to availL. The derivation process for neighborhood block availability specified in Section 6.4.4 starts with the current luminance position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighborhood luminance position (xTbY, yTbY-1), checkPredModeY set equal to FALSE, and cIdx as inputs, and assigns the output to availT.

[0456] The variable availTL is derived as follows: availTL=availL&&availT (352) The number of available chroma samples in the top right neighborhood, numTopRight, is derived as follows: The variable numTopRight is set equal to 0 and availTR is set equal to TRUE. -If preModeIntra 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: The derivation process for neighborhood block availability specified in Section 6.4.4 starts with the current luminance position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighborhood luminance position (xTbY+x, yTbY-1), checkPredModeY set equal to FALSE, and cIdx as inputs, and assigns the output to availTR. If -availTR is equal to TRUE, numTopRight is increased by one. - The number of available bottom-left neighbor chroma samples, numLeftBelow, is derived as follows: The variable numLeftBelow is set equal to 0 and availLB is set equal to TRUE. -If preModeIntra 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: The derivation process for neighborhood block availability specified in Section 6.4.4 is invoked with the current luminance position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighborhood luminance position (xTbY-1, yTbY+y), checkPredModeY set equal to FALSE, and cIdx as inputs, and assigns the output to availLB. If -availLB is equal to TRUE, numLeftBelow is increased by one.

[0457] The number of available neighboring chroma samples in the top and top-right numSampT and the number of available neighboring chroma samples in the left and bottom-left numSampL are derived as follows: If -predModeIntra is equal to INTRA_LT_CCLM, the following applies: numSampT=availT?nTbW:0 (353) numSampL=availL?nTbH:0 (354) - Otherwise, the following applies: numSampT=(availT&&predModeIntra==INTRA_T_CCLM)?(nTbW+Min(numTopRight,nTbH)):0 (355) numSampL=(availL&&predModeIntra==INTRA_L_CCLM)?(nTbH+Min(numLeftBelow,nTbW)):0 (356)

[0458] The variable bCTUboundary is derived as follows: bCTUboundary=(yTbY&(CtbSizeY-1)==0)?TRUE:FALSE (357) The variable cntN and the array pickPosN, with N replaced by L and T, are derived as follows: The variable numIs4N is derived as follows: numIs4N=((availT&&availL&&predModeIntra==INTRA_LT_CCLM)?0:1) (358) The variable startPosN is set equal to numSampN>(2+numIs4N). The variable pickStepN is set equal to Max(1,numSampN>(1+numIs4N)). If -availN is equal to TRUE and preModeIntra is equal to INTRA_LT_CCLM or INTRA_N_CCLM, the following allocation occurs: -cntN is set equal to Min(numSampN, (1+numIs4N)<<1). -pospickPosN[pos] is set equal to (startPosN+pos*pospickStepN), where pos=0..cntN-1. Otherwise, cntN is set equal to 0.

[0459] [ka]

[0460] The predicted samples predSamples[x][y], where x=0..nTbW-1 and y=0..nTbH-1, are derived as follows: If both -numSampL and numSampT are equal to 0, the following applies: predSamples[x][y]=1<<(BitDepth-1) (359) - Otherwise, the following ordered steps apply: 1. The co-located luma sample pY[x][y], where x=0..nTbW*SubWidthC-1, y=0..nTbH*SubHeightC-1, is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y). 2. The neighboring luminance samples pY[x][y] are derived as follows: If -numSampL is greater than 0, the nearby left luma sample pY[x][y] for x=-1..-3, y=0..SubHeightC*numSampL-1 is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y). If -availT is equal to FALSE, the top-most luminance sample pY[x][y] in the neighborhood with x=-1..SubWidthC*numSampT-1, y=-1..-2 is set equal to the luminance sample pY[x][0]. If -availL is equal to FALSE, the left luminance sample pY[x][y] in the neighborhood with x=-1..-3, y=-1..SubHeightC*numSampL-1 is set equal to luminance sample pY[0][y]. If -numSampT is greater than 0, the top-most luma sample pY[x][y] in the neighborhood with x=0..SubWidthC*numSampT-1, y=-1,-2 is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y). If -availTL is equal to TRUE, the top-left neighboring luma sample pY[x][y] at x=-1, y=-1,-2 is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y).

[0461] 3. The downsampled and arranged luminance samples pDsY[x][y], where x=0..nTbW-1 and y=0..nTbH-1, are derived as follows: -If both SubWidthC and SubHeightC are equal to 1, the following applies: pDsY[x][y] where x=1..nTbW-1 and y=1..nTbH-1 is derived as follows: pDstY[x][y]=pY[x][y] (360)

[0462] [ka]

[0463] [ka]

[0464] 4. If numSampL is greater than 0, the selected neighboring left chroma sample pSelC[idx] is set equal to p[-1][pickPosL[idx]], idx=0..cntL-1, and the selected downsampled neighboring left luma sample pSelDsY[idx], idx=0..cntL-1, is derived as follows: The variable y is set equal to pickPosL[idx]. -If both SubWidthC and SubHeightC are equal to 1, the following applies: pSelDsY[idx]= pY[-1][y] (372)

[0465] [ka]

[0466] [ka]

[0467] [ka]

[0468] 6. If cntT+cntL is not equal to 0, then the variables minY, maxY, minC, and maxC are derived as follows: If -cntT+cntL is equal to 2, then with Comp substituted for DsY and C, pSelComp[3] is set equal to pSelComp[0], pSelComp[2] is set equal to pSelComp[1], pSelComp[0] is set equal to pSelComp[1], and pSelComp[1] is set equal to pSelComp[3]. The arrays minGrpIdx and maxGrpIdx are derived as follows: minGrpIdx[0]=0 (380) minGrpIdx[1]=2 (381) maxGrpIdx[0]=1 (382) maxGrpIdx[1]=3 (383)

[0469] -If pSelDsY[minGrpIdx[0]] is greater than pSelDsY[minGrpIdx[1]], minGrpIdx[0] and minGrpIdx[1] are swapped as follows: (minGrpIdx[0],minGrpIdx[1])=Swap(minGrpIdx[0],minGrpIdx[1]) (384) - If pSelDsY[maxGrpIdx[0]] is greater than pSelDsY[maxGrpIdx[1]], maxGrpIdx[0] and maxGrpIdx[1] are swapped as follows: (maxGrpIdx[0],maxGrpIdx[1])=Swap(maxGrpIdx[0],maxGrpIdx[1]) (385) - If pSelDsY[minGrpIdx[0]] is greater than pSelDsY[maxGrpIdx[1]], the arrays minGrpIdx and maxGrpIdx are swapped as follows: (minGrpIdx,maxGrpIdx)=Swap(minGrpIdx,maxGrpIdx) (386) - If pSelDsY[minGrpIdx[1]] is greater than pSelDsY[maxGrpIdx[0]], minGrpIdx[1] and maxGrpIdx[0] are swapped as follows: (minGrpIdx[1],maxGrpIdx[0])=Swap(minGrpIdx[1],maxGrpIdx[0]) (387) The variables maxY, maxC, minY and minC are derived as follows: maxY=(pSelDsY[maxGrpIdx[0]]+pSelDsY[maxGrpIdx[1]]+1)>>1 (388) maxC=(pSelC[maxGrpIdx[0]]+pSelC[maxGrpIdx[1]]+1)>>1 (389) minY=(pSelDsY[minGrpIdx[0]]+pSelDsY[minGrpIdx[1]]+1)>>1 (390) minC=(pSelC[minGrpIdx[0]]+pSelC[minGrpIdx[1]]+1)>>1 (391)

[0470] 7. The variables a, b, and k are derived as follows: If -numSampL is equal to 0 and numSampT is equal to 0, the following applies: k=0 (392) a=0 (393) b=1<<(BitDepth-1) (394) - Otherwise, the following applies: diff=maxY-minY (395) If -diff is not equal to 0, the following applies: diffC=maxC-minC (396) x=Floor(Log2(diff)) (397) normDiff=((diff<<4)>>x)&15 (398) x+=(normDiff!=0)?1:0 (399) y=Abs(diffC)>0?Floor(Log2(Abs(diffC)))+1:0 (400) a=(diffC*(divSigTable[normDiff]|8)+2 y-1 )>>y (401) k=((3+xy)<1)?1:3+xy (402) a=((3+xy)<1)?Sign(a)*15:a (403) b=minC-((a*minY)>>k) (404) Here, divSigTable[] is defined as follows: divSigTable[]={0,7,6,5,5,4,4,3,3,2,2,1,1,1,1,0} (405) - Otherwise (diff is equal to 0), the following applies: k=0 (406) a=0 (407) b=minC (408)

[0471] 8. The predicted samples predSamples[x][y], where x=0..nTbW-1 and y=0..nTbH-1, are derived as follows: predSamples[x][y]=Clip1(((pDsY[x][y]*a)>>k)+b) (409) NOTE: This process uses sps_chroma_vertical_collocated_flag, but for simplicity of implementation, does not use sps_chroma_horizontal_collocated_flag.

[0472] 9 is a block diagram of a video processing device 900. The device 900 may be used to implement one or more methods described herein. The device 900 may be implemented by a smartphone, a tablet, a computer, an Internet of Things (IoT) receiver, etc. The device 900 may include one or more processors 902, one or more memories 904, and video processing hardware 906. The one or more processors 902 may be configured to implement one or more methods described herein. The memory(s) 904 may be used to store data and code used to implement the methods and techniques described herein. The video processing hardware 906 may be used to implement the techniques described herein in hardware circuitry (e.g., as described in the previous section).

[0473] FIG. 10 shows a block diagram of an exemplary video encoder.

[0474] 11 is a flowchart of a method 1100 for processing video. The method 1100 includes deriving parameters of a cross-component linear model for converting between chroma blocks of the video and a coded representation of the video by using a downsampling filter to generate top luma samples of downsampled aligned neighbors of N upper neighbors of the aligned luma block (1102), where N is a positive integer, and performing the conversion using predicted chroma blocks generated using the cross-component linear model (1104).

[0475] FIG. 12 is a block diagram illustrating an exemplary video processing system in which the disclosed techniques can be implemented.

[0476] 12 is a block diagram illustrating an example video processing system 1200 in which various techniques disclosed herein may be implemented. Various implementations may include some or all of the components of system 1200. System 1200 may include an input 1202 for receiving video content. The video content may be received in a raw or uncompressed format, e.g., 8- or 10-bit multi-component pixel values, or in a compressed or encoded format. Input 1202 may represent a network interface, a peripheral bus interface, or a storage interface. Examples of network interfaces include wired interfaces such as Ethernet, Passive Optical Network (PON), and wireless interfaces such as Wi-Fi or cellular interfaces.

[0477] System 1200 may include a coding component 1204 capable of implementing various coding or encoding methods described herein. Coding component 1204 may reduce the average bit rate of video from input 1202 to its output, generating a coded representation of the video. Accordingly, this coding technique may be referred to as a video compression or video transcoding technique. The output of coding component 1204 may be stored or transmitted via a connected communication, as represented by component 1206. The bitstream (or coded) representation of the video received at input 1202, stored, or communicated, may be used by component 1208 to generate pixel values ​​or displayable video that are transmitted to display interface 1210. The process of generating user-viewable video from the bitstream representation may be referred to as video decompression (video unfolding). Furthermore, while certain video processing operations are referred to as “coding” operations or tools, it will be understood that the coding tools or operations are used in an encoder, and that corresponding decoding tools or operations that reverse the results of the coding are performed by a decoder.

[0478] Examples of peripheral bus interfaces or display interfaces may include Universal Serial Bus (USB), High Definition Multimedia Interface (HDMI), DisplayPort, etc. Examples of storage interfaces include Serial Advanced Technology Attachment (SATA), PCI, IDE interfaces, etc. The techniques described herein may be implemented in various electronic devices such as mobile phones, laptops, smartphones, or other devices capable of digital data processing and / or video display.

[0479] FIG. 14 is a block diagram illustrating an example video coding system 100 that may utilize techniques of this disclosure.

[0480] 14, video coding system 100 may include source device 110 and destination device 120. Source device 110 generates coded video data and may also be referred to as a video coding device. Destination device 120 may decode the coded video data generated by source device 110 and may also be referred to as a video decoding device.

[0481] Source device 110 may include a video source 112, a video encoder 114, and an input / output (I / O) interface .

[0482] The video source 112 may include a source such as a video capture device, an interface for receiving video data from a video content provider, and / or a computer graphics system for generating video data, or a combination of these sources. The video data may include one or more pictures. The video encoder 114 encodes the video data from the video source 112 and generates a bitstream. The bitstream may include a sequence of bits forming a coded representation of the video data. The bitstream may include coded pictures and associated data. A coded picture is a coded representation of a picture. The associated data may include sequence parameter sets, picture parameter sets, and other syntax structures. The I / O interface 116 may include a modulator / demodulator (modem) and / or transmitter. The coded video data may be transmitted directly to the destination device 120 via the I / O interface 116 over the network 130a. The coded video data may be stored on a recording medium / server 130b for access by the destination device 120.

[0483] Destination device 120 may include an I / O interface 126 , a video decoder 124 , and a display device 122 .

[0484] I / O interface 126 may include a receiver and / or a modem. I / O interface 126 may obtain encoded video data from source device 110 or storage medium / server 130b. Video decoder 124 may decode the encoded video data. Display device 122 may display the decoded video data to a user. Display device 122 may be integrated with destination device 120 or may be external to destination device 120 configured to interface with an external display device.

[0485] Video encoder 114 and video decoder 124 may operate according to video compression standards such as the High Efficiency Video Coding (HEVC) standard, the Versatile Video Coding (VVVM) standard, and other current and / or future standards.

[0486] FIG. 15 is a block diagram illustrating an example of a video encoder 200, which may be video encoder 114 in system 100 shown in FIG.

[0487] Video encoder 200 may be configured to perform any or all of the techniques of this disclosure. In the example of FIG. 15, video encoder 200 includes multiple functional components. Techniques described in this disclosure may be shared among various components of video encoder 200. In some examples, a processor may be configured to perform any or all of the techniques described in this disclosure.

[0488] The functional components of the video encoder 200 may include a splitter 201, a predictor 202, which may include a mode selector 203, a motion estimator 204, a motion compensator 205, an intra predictor 206, a residual generator 207, a transformer 208, a quantizer 209, an inverse quantizer 210, an inverse transformer 211, a reconstructor 212, a buffer 213, and an entropy encoder 214.

[0489] In other examples, video encoder 200 may include more, fewer, or different functional components. In one example, prediction unit 202 may include an Intra Block Copy (IBC) unit. The IBC unit may perform prediction in an IBC mode in which at least one reference picture is the picture in which the current video block is located.

[0490] Furthermore, some components, such as the motion estimator 204 and the motion compensator 205, may be highly integrated, but are represented separately in the example of FIG. 15 for illustrative purposes.

[0491] Divider 201 may divide a picture into one or more video blocks. Video encoder 200 and video decoder 300 may support various video block sizes.

[0492] The mode selector 203 may select one of either intra or inter coding modes based on, for example, an error result, and provide the resulting intra or inter coding block to the residual generator 207 to generate residual block data and to the reconstruction unit 212 to reconstruct a coded block for use as a reference picture. In some examples, the mode selector 203 may select a Combination of Intra and Inter Prediction (CIIP) mode, which performs prediction based on an inter prediction signal and an intra prediction signal. In the case of inter prediction, the mode selector 203 may select a resolution of the motion vector for the block (e.g., sub-pixel or integer pixel precision).

[0493] To perform inter prediction on the current video block, motion estimation unit 204 may generate motion information for the current video block by comparing the current video block to one or more reference frames from buffer 213. Motion compensation unit 205 may determine a prediction video block for the current video block based on the motion information and decoded samples of pictures from buffer 213 other than the picture associated with the current video block.

[0494] Motion estimation unit 204 and motion compensation unit 205 may, for example, perform different operations on the current video block depending on whether the current video block is an I-slice, a P-slice, or a B-slice.

[0495] In some examples, motion estimator 204 may perform unidirectional prediction on the current video block, and motion estimator 204 may search reference pictures in list 0 or list 1 for a reference video block for the current video block. Motion estimator 204 may then generate a reference index indicating the reference picture in list 0 or list 1, the reference index including the reference video block and a motion vector indicating a spatial displacement between the current video block and the reference video block. Motion estimator 204 may output the reference index, prediction direction indicator, and motion vector as motion information for the current video block. Motion compensation unit 205 may generate a prediction video block for the current block based on the reference video block indicated by the motion information of the current video block.

[0496] In another example, motion estimator 204 may bidirectionally predict the current video block, and motion estimator 204 may search for a reference video block from among the reference pictures in list 0 to obtain the current video block, and may also search for another reference video block from among the reference pictures in list 1 to obtain the current video block. Motion estimator 204 may then generate reference indices indicating the reference pictures in lists 0 and 1 that contain the reference video blocks, and motion vectors indicating spatial displacements between the reference video blocks and the current video block. Motion estimator 204 may output the reference index and motion vector for the current video block as motion information for the current video block. Motion compensation unit 205 may generate a prediction video block for the current video block based on the reference video block indicated by the motion information of the current video block.

[0497] In some examples, the motion estimator 204 may output a full set of motion information for decoding processing in a decoder.

[0498] In some examples, the motion estimator 204 may not output a full set of motion information for the current picture. Rather, the motion estimator 204 may signal the motion information of the current video block by reference to the motion information of another video block. For example, the motion estimator 204 may determine that the motion information of the current video block is sufficiently similar to the motion information of a neighboring video block.

[0499] In one example, motion estimator 204 may indicate, in a syntax structure associated with the current video block, a value that indicates to video decoder 300 that the current video block has the same motion information as another video block.

[0500] In another example, motion estimation unit 204 may identify another video block and a motion vector difference (MVD) in a syntax structure associated with the current video block. The motion vector difference indicates the difference between the motion vector of the current video block and the motion vector of the indicated video block. Video decoder 300 may use the motion vector of the indicated video block and the motion vector difference to determine the motion vector of the current video block.

[0501] As mentioned above, video encoder 200 may predictively signal motion vectors. Two examples of predictive signaling techniques that may be implemented by video encoder 200 include Advanced Motion Vector Prediction (AMVP) and merge mode signaling.

[0502] Intra predictor 206 may perform intra prediction on the current video block. When intra predictor 206 performs intra prediction on the current video block, intra predictor 206 may generate prediction data for the current video block based on decoded samples of other video blocks in the same picture. The prediction data for the current video block may include a predicted video block and various syntax elements.

[0503] Residual generator 207 may generate residual data for the current video block by subtracting (e.g., as indicated by a minus sign) the predicted video block of the current video block from the current video block. The residual data for the current video block may include residual video blocks that correspond to different sample components of the samples in the current video block.

[0504] In other examples, for example in skip mode, there may be no residual data for the current video block, and residual generator 207 may not perform the subtraction operation.

[0505] Transform processor 208 may generate one or more transform coefficient video blocks for the current video block by applying one or more transforms to the residual video block associated with the current video block.

[0506] After the transform processor 208 generates the transform coefficient video block associated with the current video block, the quantizer 209 may quantize the transform coefficient video block associated with the current video block based on one or more quantization parameter (QP) values ​​associated with the current video block.

[0507] The inverse quantization unit 210 and the inverse transform unit 211 may apply inverse quantization and inverse transform, respectively, to the transform coefficient video blocks to reconstruct residual video blocks from the transform coefficient video blocks. The reconstruction unit 212 may add the reconstructed residual video blocks to corresponding samples from one or more prediction video blocks generated by the prediction unit 202 to generate a reconstructed video block associated with the current block for storing in the buffer 213.

[0508] After the reconstructor 212 reconstructs the video block, a loop filtering operation may be performed to reduce video blocking artifacts in the video block.

[0509] The entropy encoder 214 may receive data from other functional components of the video encoder 200. If the entropy encoder 214 receives data, the entropy encoder 214 may perform one or more entropy encoding operations to generate entropy-coded data and output a bitstream that includes the entropy-coded data.

[0510] FIG. 16 is a block diagram illustrating an example of a video decoder 300, which may be the video decoder 114 in the system 100 shown in FIG.

[0511] Video decoder 300 may be configured to perform any or all of the techniques of this disclosure. In the example of Figure 16, video decoder 300 includes multiple functional components. Techniques described in this disclosure may be shared among various components of video decoder 300. In some examples, a processor may be configured to perform any or all of the techniques described in this disclosure.

[0512] 16, video decoder 300 includes an entropy decoding unit 301, a motion compensation unit 302, an intra prediction unit 303, an inverse quantization unit 304, an inverse transform unit 305, and a reconstruction unit 306, as well as a buffer 307. In some examples, video decoder 300 may perform a decoding path that is generally the reverse of the encoding path described with respect to video encoder 200 (e.g., FIG. 15).

[0513] The entropy decoder 301 retrieves an encoded bitstream. The encoded bitstream may include entropy-coded video data (e.g., encoded blocks of video data). The entropy decoder 301 decodes the entropy-coded video data, and from the entropy-decoded video data, the motion compensation unit 302 may determine motion information including motion vectors, motion vector precision, reference picture list indexes, and other motion information. The motion compensation unit 302 may determine such information by, for example, implementing AMVP and merge mode.

[0514] The motion compensation unit 302 may generate motion-compensated blocks, possibly performing interpolation based on an interpolation filter. The syntax element may include an identifier for the interpolation filter to be used with sub-pixel precision.

[0515] Motion compensation unit 302 may calculate interpolated values ​​for sub-integer pixels of the reference block using interpolation filters such as those used by video encoder 200 during encoding of the video block. Motion compensation unit 302 may determine the interpolation filters used by video encoder 200 based on received syntax information and use the interpolation filters to generate the prediction block.

[0516] The motion compensation unit 302 may use syntax information to determine the size of the blocks used to code the frames and / or slices of the coded video sequence, partitioning information describing how each macroblock of a picture of the coded video sequence is divided, a mode indicating how each division is coded, one or more reference frames (and reference frame lists) for each inter-coded block, and some other information to decode the coded video sequence.

[0517] The intra predictor 303 may form a prediction block from spatially adjacent blocks, for example, using an intra prediction mode received in the bitstream. The inverse quantizer 303 inverse quantizes (i.e., dequantizes) the quantized video block coefficients provided in the bitstream and decoded by the entropy decoder 301. The inverse transformer 303 applies an inverse transform.

[0518] The reconstruction unit 306 may sum the residual block with the corresponding prediction block generated by the motion compensation unit 202 or the intra prediction unit 303 to form a decoded block. If desired, a deblocking filter may be applied to filter the decoded block to remove blocking artifacts. The decoded video block is stored in a buffer 307, which provides a reference block for subsequent motion compensation.

[0519] The following series of items provide preferred examples with some embodiments provided below.

[0520] The first section presents an exemplary embodiment of the techniques described in items 18 and 19 of the previous chapter.

[0521] A method of video processing (e.g., method 1700 shown in FIG. 17A ), comprising: determining 1702 parameters of a cross-component linear model of the video block according to rules for conversion between a video block of a video having a 1.4:2:2 color format and a bitstream of the video; 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 the rule specifies that the parameters are determined independently of the value of the syntax element 1704.

[0522] 2. The method according to item 1, wherein the parameters of the cross-component linear model correspond to the parameters of downsampling filtering in the cross-component linear model.

[0523] 3. The method of item 2, wherein the downsampling filtering includes downsampling luminance samples above the neighborhood, and / or downsampling luminance samples to the left of the neighborhood, and / or downsampling samples of the video block that is a luminance block.

[0524] 4. The method according to item 2 or 3, wherein downsampling filtering is performed using a fixed filter regardless of the value of the syntax element.

[0525] 5. The method according to item 4, wherein the fixed filter is a 3-tap horizontal filter with coefficients [1 / 4, 2 / 4, 1 / 4] or [2 / 8, 4 / 8, 2 / 8].

[0526] 6. A method of video processing (e.g., method 1710 shown in FIG. 17B ), comprising: performing a conversion between video and a video bitstream according to rules, wherein the format rules specify that a field indicating whether chroma sample positions are vertically shifted relative to corresponding luma sample positions due to the video having a 4:2:2 or 4:4:4 color format is set to a default value.

[0527] 7. The method according to item 6, wherein the default value is 0 or 1.

[0528] 8. The method of item 6, wherein the rules further specify that if the field is not present, the value of the field is inferred to be equal to 1.

[0529] 9. The method of item 6, wherein the rules further specify that if the field is not present, the value of the field is inferred to be equal to 0.

[0530] 10. A method according to any one of items 1 to 9, characterized in that the cross-component linear model derives a predicted value of a saturation component from another component using a linear mode.

[0531] 11. The method of any of items 1 to 9, wherein the conversion includes encoding the video into a bitstream.

[0532] 12. The method of any of items 1 to 9, wherein the conversion includes decoding the video from a bitstream.

[0533] 13. The method of any of items 1 to 12, wherein the converting includes generating a bitstream from the video, and the method further includes storing the bitstream in a non-transitory computer-readable recording medium.

[0534] 14. A video processing device comprising a processor configured to implement the method according to one or more of items 1 to 12.

[0535] 15. A method for storing a video bitstream, comprising the method of any one of items 1 to 12 and further comprising storing the bitstream in a non-transitory computer-readable recording medium.

[0536] 16. A computer-readable medium having stored thereon program code that, when executed, causes a processor to perform the method described in any of items 1 to 12.

[0537] 17. A computer-readable medium storing a bitstream generated according to any of the methods described above.

[0538] 18. A video processing device for storing a bitstream representation, configured to implement the methods described in one or more of items 1 to 12.

[0539] The second section presents an illustrative implementation of the technique discussed in item 20 of the previous section.

[0540] 1. A method of video processing (e.g., method 1800 shown in FIG. 18 ) for converting between a video block of a video and a video bitstream, comprising determining 1802 parameters of a CCLM (Cross-Component Linear Model) of the video block according to a rule, and performing 1804 the conversion based on the determination, wherein the rule specifies that a variable indicating a neighboring luminance sample is used in determining the parameters of the CCLM only if the variable has a certain value.

[0541] 2. The method according to item 1, wherein the constant value of the variable representing the luminance samples above the neighborhood of the video block is equal to the value of the reconstructed luminance samples before the deblocking filter processing.

[0542] 3. If a luminance sample above the neighborhood is available, a variable representing the luminance sample above the neighborhood, denoted as pY[x][y], is set equal to the reconstructed luminance sample before deblocking filtering at position (xTbY+x, yTbY+y), where (xTbY, yTbY) indicates the top-left position of the video block, and x and y are integers. The method described in item 2.

[0543] 4. The method described in item 3, wherein x ranges from 0 to SubWidthC*max(numSampT,nTbW)-1, nTbW indicates the width of the video block, SubWidthC is the width scale factor of the video block determined from a table according to the saturation format of the image containing the video block, and numSampT indicates the number of available neighboring saturation samples at the top and upper right of the video block.

[0544] 5. The method according to item 3, wherein y is 1 or 2.

[0545] 6. The method of item 1, wherein the value of a variable representing a left luminance sample of a neighbor of a video block is set equal to the value of the reconstructed luminance sample before deblocking filtering.

[0546] 7. If a neighboring left luminance sample is available, a variable representing the neighboring left luminance sample, denoted as pY[x][y], is set equal to the reconstructed luminance sample before deblocking filtering at position (xTbY+x, yTbY+y), where (xTbY, yTbY) indicates the top-left position of the video block, and x and y are integers. The method described in item 6.

[0547] 8. The method according to item 7, wherein X is in the range of -1 to -3.

[0548] 9. The method described in item 7, wherein y ranges from 0 to SubHeightC*max(numSampL,nTbH)-1, nTbH indicates the height of the image block, SubHeightC is a height scale factor of the image block determined from a table according to the saturation format of the image containing the image block, and numSampL indicates the number of available neighboring saturation samples to the left and below the image block.

[0549] 10. A method according to any one of items 1 to 9, characterized in that the cross-component linear model derives a predicted value of a saturation component from another component using a linear mode.

[0550] 11. The method of any of items 1 to 9, wherein the conversion includes encoding the video into a bitstream.

[0551] 12. The method of any of items 1 to 9, wherein the conversion includes decoding the video from a bitstream.

[0552] 13. The method of any of items 1 to 12, wherein the converting includes generating a bitstream from the video, and the method further includes storing the bitstream in a non-transitory computer-readable recording medium.

[0553] 14. A video processing device comprising a processor configured to implement the method according to one or more of items 1 to 12.

[0554] 15. A method for storing a video bitstream, comprising the method of any one of items 1 to 12 and further comprising storing the bitstream in a non-transitory computer-readable recording medium.

[0555] 16. A computer-readable medium having stored thereon program code that, when executed, causes a processor to perform the method described in any of items 1 to 12.

[0556] 17. A computer-readable medium storing a bitstream generated according to any of the methods described above.

[0557] 18. A video processing device for storing a bitstream, configured to implement the methods described in one or more of items 1 to 12.

[0558] The third section presents exemplary implementations of the techniques described in items 21 to 26 of the previous chapter.

[0559] 1. A method of video processing (e.g., method 1900 shown in FIG. 19A), comprising: determining 1902 whether a first coding tool is valid for a video unit according to rules for conversion between video constituting the video unit and a video bitstream, wherein the rules specify that the first coding tool and a second coding tool are mutually exclusively valid and that the first coding tool or the second coding tool constitutes a code data hiding tool; and performing 1904 the conversion according to the determination.

[0560] 2. The method of item 1, wherein the video unit corresponds to a sequence, a picture, a slice, a tile, a brick, or a subpicture.

[0561] 3. The method according to item 1 or 2, wherein the rule specifies that if a second coding tool including a Block Differential Pulse-Code Modulation (BDPCM) tool is enabled for the video unit, the first coding tool including the code data hiding tool is disabled.

[0562] 4. The method according to item 1 or 2, wherein the rule specifies that a first coding tool including a Block Differential Pulse-Code Modulation (BDPCM) tool is disabled if a second coding tool including a code data hiding tool is enabled for the video unit.

[0563] 5. The method according to item 1 or 2, wherein the rule specifies that a first coding tool constituting a code data hiding tool is disabled if a second coding tool that applies only an identity transformation to the video unit is enabled.

[0564] 6. The method according to item 1 or 2, wherein the rule specifies that a first coding tool that applies only an identity transformation is disabled if a second coding tool that constitutes a code data hiding tool for a video unit is enabled.

[0565] 7. The method according to item 5 or 6, wherein the second coding tool that applies only the identity transform or the first coding tool that applies only the identity transform comprises a transform skip mode tool or another coding tool.

[0566] 8. A method of video processing (e.g., method 1910 shown in FIG. 19B), comprising: determining 1912 whether a first coding tool is valid for a video unit according to rules for conversion between video constituting the video unit and a video bitstream, wherein the rules specify that the first coding tool and the second coding tool are mutually exclusively valid and that the first coding tool or the second coding tool constitutes a dependent quantization tool; and performing 1914 the conversion according to the determination.

[0567] 9. The method of item 8, wherein the video unit corresponds to a sequence, a picture, a slice, a tile, a brick, or a subpicture.

[0568] 10. The method of item 8 or 9, wherein the rule specifies that a first coding tool including a dependent quantization tool is disabled when a second coding tool including a Block Differential Pulse-Code Modulation (BDPCM) tool is enabled for the video unit.

[0569] 11. The method of item 8 or 9, wherein the rule specifies that a first coding tool including a BDPCM (Block Differential Pulse-Code Modulation) tool is disabled if a second coding tool including the dependent quantization tool is valid for the video unit.

[0570] 12. The method of item 8 or 9, wherein the rule specifies that a first coding tool that includes a dependent quantization tool is disabled when a second coding tool that applies only an identity transform is enabled for a video unit.

[0571] 13. The method of item 8 or 9, wherein the rule specifies that, for a video unit, a first coding tool that applies only an identity transform is disabled if a second coding tool that includes dependent quantization is enabled.

[0572] 14. The method of item 8 or 9, wherein the second coding tool that applies only the identity transform or the first coding tool that applies only the identity transform comprises a transform skip mode tool or another coding tool.

[0573] 15. A method of video processing (e.g., method 1920 shown in FIG. 19C ), comprising performing 1922 a conversion between a video including one or more pictures including one or more slices and a video bitstream in accordance with rules, the rules specifying that the slice type of a slice depends on a reference picture entry in a reference picture list for the slice.

[0574] 16. The method according to item 15, wherein the rule specifies that the slice type of a slice is an I-slice if the number of reference picture entries in reference picture list 0 is equal to 0 and the number of reference picture entries in reference picture list 1 is equal to 0.

[0575] 17. The method according to item 15, wherein the rule specifies that the slice type of a slice is a P slice if the number of reference picture entries in reference picture list 0 is greater than 0 and the number of reference picture entries in reference picture list 1 is equal to 0.

[0576] 18. The method of item 15, wherein the rule specifies that the slice type of a slice is not a B slice if the number of reference picture entries in reference picture list 0 is greater than 0 and the number of reference picture entries in reference picture list 1 is equal to 0.

[0577] 19. The method of any of items 16 to 18, wherein the slice type is not included in the bitstream.

[0578] 20. The method of item 15, wherein reference picture entries are signaled or inferred before slice types are signaled or inferred.

[0579] 21. The method of item 15, wherein the reference picture entry is included in a picture header associated with the picture that contains the slice.

[0580] 22. A method of video processing (e.g., method 1930 shown in FIG. 19D) that includes performing 1932 a conversion between a video including one or more pictures including one or more slices and a video bitstream in accordance with rules, the rules specifying that the number of allowed filters in an Adaptation Parameter Set (APS) or the number of APSs depends on the coded information of the video.

[0581] 23. The method according to item 22, wherein the coded information includes the number of sub-pictures of the picture.

[0582] 24. The method described in item 22, wherein the number of allowed filters in an APS includes the number of luma ALFs (Adaptive Loop Filters), chroma ALFs, and cross-component ALFs of the ALF APS in all APS (Adaptation Parameter Set) NAL (Network Abstraction Layer) units within a picture unit.

[0583] 25. The method of item 22, wherein the number of allowed filters in an APS includes the number of ALF (Adaptive Loop Filter) classes for the luma component, the number of alternative filters for the chroma component, and / or the number of cross-component filters in all APS (Adaptation Parameter Set) NAL (Network Abstraction Layer) units within a picture unit.

[0584] 26. The method according to item 22, wherein the APS corresponds to an ALF APS, a scaling list APS, and / or an LMCS (Luma Mapping with Chroma Scaling) APS.

[0585] 27. The method according to item 22, wherein how the APS identifier and / or the number of APSs used by the video unit are signaled depends on the number of allowed filters in the APS.

[0586] 28. The method of any one of items 1 to 27, wherein the conversion includes encoding the video into a bitstream.

[0587] 29. The method of any one of items 1 to 27, wherein the conversion includes decoding the video from a bitstream.

[0588] 30. A method according to any one of items 1 to 27, wherein the converting includes generating a bitstream from the video, and the method further includes storing the bitstream in a non-transitory computer-readable recording medium.

[0589] 31. A video processing device comprising a processor configured to implement the methods described in one or more of items 1 to 30.

[0590] 32. A method for storing a video bitstream, comprising the method of any one of items 1 to 30 and further comprising storing the bitstream on a non-transitory computer-readable recording medium.

[0591] 33. A computer-readable medium storing program code that, when executed, causes a processor to implement the method described in one or more of items 1 to 30.

[0592] 34. A computer-readable medium storing a bitstream generated according to any of the methods described above.

[0593] 35. A video processing device for storing a bitstream, configured to implement the methods described in one or more of items 1 to 30.

[0594] Some embodiments of the disclosed technology include determining or deciding to enable a video processing tool or mode. In one example, when a video processing tool or mode is enabled, an encoder uses or implements the tool or mode when processing a single video block, but does not necessarily modify the resulting bitstream based on the use of the tool or mode. That is, the conversion from a block of video to a bitstream representation of video uses the video processing tool or mode when the video processing tool or mode is enabled based on the determination or decision. In another example, when a video processing tool or mode is enabled, a decoder processes the bitstream knowing that the bitstream has been modified based on the video processing tool or mode. That is, the conversion from the bitstream representation of video to a block of video uses the video processing tool or mode enabled based on the determination or decision.

[0595] Some embodiments of the disclosed techniques include deciding or determining to disable a video processing tool or mode. In one example, when a video processing tool or mode is disabled, an encoder does not use the tool or mode when converting blocks of video into a bitstream representation of the video. In another example, when a video processing tool or mode is disabled, a decoder processes the bitstream knowing that the bitstream has not been modified using the video processing tool or mode that was enabled based on the decision or determination.

[0596] Implementations of the disclosed and other solutions, examples, embodiments, modules, and functional operations described herein, including the structures disclosed herein and their structural equivalents, may be implemented in digital electronic circuitry, or in computer software, firmware, or hardware, or in one or more combinations thereof. The disclosed and other embodiments may be implemented as one or more computer program products, i.e., one or more modules of computer program instructions encoded on a computer-readable medium for implementation by or controlling the operation of a data processing apparatus. The computer-readable medium may be a machine-readable storage device, a machine-readable storage substrate, a memory device, a composition of matter providing a machine-readable propagated signal, or one or more combinations thereof. The term "data processing apparatus" includes all apparatuses, devices, and machines for processing data, including, for example, a programmable processor, a computer, or multiple processors or computers. In addition to hardware, the apparatus may include code that creates an execution environment for the computer program, such as code constituting processor firmware, a protocol stack, a database management system, an operating system, or one or more combinations thereof. A propagated signal is an artificially generated signal, for example, a machine-generated electrical, optical, or electromagnetic signal, that is generated to encode information for transmission to an appropriate receiving device.

[0597] A computer program (also referred to as a program, software, software application, script, or code) can be written in any form of programming language, including compiled or interpreted languages, and can be deployed in any form, including as a stand-alone program or as modules, components, subroutines, or other units suitable for use in a computing environment. A computer program does not necessarily correspond to a file in a file system. A program may be recorded as part of a file that holds other programs or data (e.g., one or more scripts stored in a markup language document), may be stored in a single file dedicated to the program, or may be stored in multiple coordinating files (e.g., files containing one or more modules, subprograms, or portions of code). A computer program can be deployed to run on one computer located at one site or on multiple computers distributed across multiple sites and interconnected by a communications network.

[0598] The processing and logic flows described herein may be performed by one or more programmable processors executing one or more computer programs to perform functions by operating on input data and generating output. The processing and logic flows may also be performed by, and devices may be implemented as, special purpose logic circuitry, such as a Field Programmable Gate Array (FPGA) or an Application Specific Integrated Circuit (ASIC).

[0599] Processors suitable for executing a computer program include, for example, both general-purpose and special-purpose microprocessors, and any one or more processors of any kind of digital computer. Typically, a processor receives instructions and data from a read-only memory or a random-access memory, or both. The essential elements of a computer are a processor for executing instructions and one or more memory devices for storing instructions and data. Typically, a computer will include one or more mass storage devices, e.g., magnetic, magneto-optical, or optical disks, for storing data, or be operatively coupled to receive data from or transfer data to these mass storage devices. However, a computer need not have such devices. Computer-readable media suitable for storing computer program instructions and data include all forms of non-volatile memory, media, and memory devices, including, for example, EPROMs, EEPROMs, flash storage devices, magnetic disks, e.g., internal or removable disks, magneto-optical disks, and semiconductor storage devices such as CD-ROM and DVD-ROM disks. The processor and memory may be supplemented by, or incorporated in, special-purpose logic circuitry.

[0600] While this patent specification contains many details, these should not be construed as limiting the scope of any subject matter or the scope of the claims, but rather as descriptions of features that may be specific to particular embodiments of a particular technology. Certain features described in this patent document in the context of separate embodiments may also be implemented in combination in a single example. Conversely, various features described in the context of a single example may also be implemented in multiple embodiments separately or in any suitable subcombination. Furthermore, while features may be described above as acting in a particular combination and initially claimed as such, one or more features from a claimed combination may, in some cases, be extracted from the combination, and the claimed combination may be combined into a subcombination or subcombination. It may also be directed to variations of the combination.

[0601] Similarly, although operations are shown in a particular order in the figures, this should not be understood as requiring that such operations be performed in the particular order or sequential order shown, or that all of the operations shown be performed, to achieve desired results. Also, the separation of various system components in the embodiments described in this patent specification should not be understood as requiring such separation in all embodiments. stomach.

[0602] Only a few implementations and examples are described; other embodiments, extensions and variations are possible based on the content described and illustrated in this patent document.

Claims

1. 1. A method for processing video data, comprising: determining that a cross-component linear model (CCLM) prediction mode is applied to a first chroma block of a first video unit of a video for conversion between the first chroma block and a bitstream of the video; determining CCLM parameters for the first chroma block according to a rule; In the CCLM prediction mode, deriving a prediction sample of the first chroma block based on the CCLM and a parameter of the CCLM; performing the transform based on the predicted samples of the first chroma block; and The rules specify that the parameters of the CCLM are determined based on selected neighboring chroma samples of the first chroma block and selected downsampled neighboring luma samples derived based on a first variable representing neighboring luma samples of a first luma block corresponding to the first chroma block; The rules further specify that if the value of a second variable indicates that a neighboring block is available, the first variable is set equal to a neighboring luma sample of the first luma block, and if the value of the second variable indicates that the neighboring block is not available, the first variable is set equal to a valid sample; The rules further specify that if the color format of the first chroma block is 4:2:0, the selected downsampled neighboring luma samples are derived further based on at least one of a value of a first syntax element and a value of a third variable, the first syntax element included in the bitstream indicating whether a position of a chroma sample is vertically shifted relative to a position of a corresponding luma sample, and the third variable indicating whether the first chroma block is located at a boundary of a coding tree unit that includes the first chroma block; the rules further specify that if the value of the third variable indicates that the first chroma block is located at the boundary of the coding tree unit that includes the first chroma block, the selected downsampled neighboring luma samples are derived using the same filter regardless of the value of the first syntax element; The rule may further include: if the value of the third variable indicates that the first chroma block is not located at the boundary of the coding tree unit that includes the first chroma block, and the color format of the first chroma block is 4:2:0, the selected downsampled neighboring luma samples are obtained using different filters when the first syntax element has a different value; The rule further states that if the value of the third variable indicates that the first chroma block is not located at the boundary of the coding tree unit that has the first chroma block, and the color format of the first chroma block is 4:2:0, then if the first syntax element has a value of 1, then pSelDsY[i] is equal to (pY[SubWidthC*x][-3] + pY[SubWidthC*x][-3]). pSelDsY[i] denotes the selected downsampled neighboring luminance sample with index i, and pY[m][n] denotes one of said first variables with position (m,n), or The rule further states that if the value of the third variable indicates that the first chroma block is not located at the boundary of the coding tree unit that has the first chroma block, and the color format of the first chroma block is 4:2:0, then if the first syntax element has a value of 0, then pSelDsY[i] is equal to (pY[SubWidthC*x-1][-1] + pY[SubWidthC*x-1 ][−2]+2*pY[SubWidthC*x][−1]+2*pY[SubWidthC*x][−2]+pY[SubWidthC*x+1][−1]+pY[SubWidthC*x+1][−2]+4)>>3, pSelDsY[i] denotes the selected downsampled neighboring luminance sample with index i, and pY[m][n] denotes one of said first variables with position (m,n), if 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 neighboring left luma sample reconstructed before deblocking filtering at position (xTbY+x, yTbY+y), where x is in the range of [−3, −1] and the maximum value of y is equal to SubHeightC*Max(numSampL, nTbH)−1, where (xTbY, yTbY) indicates a top-left position of the first luma block, x and y are integers, nTbH indicates the height of the first chroma block, SubHeightC is a height scale factor obtained according to a chroma format of the first video unit, and numSampL indicates the number of neighboring left and bottom-left available chroma samples in the CCLM prediction mode; yTbY) indicates a top-left position of the first luma block, x and y are integers, nTbW indicates the width of the first chroma block, SubWidthC indicates a width scale factor obtained according to a chroma format of the first video unit, and numSampT indicates the number of available above-neighboring chroma samples or available above-and-top-right neighboring chroma samples for the CCLM prediction mode.

2. In response to the first variable, denoted pY[x][y], being set equal to the pre-deblocking filtering upper luminance sample of the neighboring block at position (xTbY+x, yTbY+y) if the value of the second variable indicates that the neighboring block is available, if the CCLM prediction mode is a first CCLM prediction mode, numSampL is equal to the height of the first chroma block when the value of the second variable indicates that the neighboring block is available; if the CCLM prediction mode is a second CCLM prediction mode, numSampL is equal to nTbH+Min(numLeftBelow, nTbW), where nTbW indicates the width of the first chroma block and numLeftBelow indicates the number of available bottom-left neighbor chroma samples; or The neighboring block indicated by the second variable is a neighboring chroma block covering a neighboring left position of the first luma block, or 2. The method of claim 1, wherein if the value of the second variable indicates that the neighboring block is unavailable, then the first variable, denoted as pY[x][y], is set equal to reconstructed luma sample pY[0][y], where x=-1, y=-1..SubHeightC*numSampL-1.

3. In response to the first variable, denoted pY[x][y], being set equal to the neighboring upper luminance sample reconstructed before deblocking filtering at position (xTbY+x, yTbY+y) if the value of the second variable indicates that the neighboring block is available, if the CCLM prediction mode is a 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 first chroma block; 2. The method of claim 1, wherein when the CCLM prediction mode is a third CCLM prediction mode, numSampT is equal to nTbW+Min(numTopRight, nTbH), where nTbH indicates a height of the first chroma block and numTopRight indicates the number of available upper-right neighbor chroma samples.

4. In response to the first variable, denoted pY[x][y], being set equal to the pre-deblocking filtering upper luminance sample of the neighboring block at position (xTbY+x, yTbY+y) if the value of the second variable indicates that the neighboring block is available, The neighboring block indicated by the second variable is a neighboring chroma block covering a position above the neighbor of the first luma block, or 2. The method of claim 1, wherein if the value of the second variable indicates that the neighboring block is unavailable, the first variable, denoted as pY[x][y], is set equal to the reconstructed luma sample pY[x][0], where x=-1..SubWidthC*numSampT-1, y=-1..-2.

5. The method of claim 1 , wherein the rules specify that if transform skip mode is enabled for the first video unit, then concealment and dependent quantization of code data is disabled for the video unit.

6. the first video unit corresponds to a sequence, a picture, a slice, a tile, or a subpicture, or 6. The method of claim 5, wherein the bitstream includes a syntax element indicating whether a transform is applied to the first video unit, and when a value of the syntax element is equal to 1, the transform skip mode is enabled for the first video unit.

7. 2. The method of claim 1 , wherein the rule further comprises: if the color format of the first chroma block is 4:2:2, then the selected downsampled neighboring luma sample is derived without considering the value of the first syntax element.

8. The rule may further comprise: if the color format of the first chroma block is 4:2:2, the selected downsampled neighboring luma samples are obtained using a fixed filter regardless of the value of the first syntax element; the fixed filter is a 3-tap horizontal filter; When the fixed filter is used, pSelDsY[i]=(pY[SubWidthC*x-1][-1]+2*pY[SubWidthC*x][-1]+pY[SubWidthC*x+1][-1]+2)>>2, pSelDsY[i] denotes the selected downsampled neighboring luminance sample with index i; The method of claim 7 , wherein pY[m][n] denotes one of the first variables having a position (m,n).

9. 8. The method of claim 7, wherein the rule further comprises: if the value of the third variable indicates that the first chroma block is located at the boundary of the coding tree unit that includes the first chroma block, then the selected downsampled neighboring luma sample is derived using the same filter for the first chroma block having the color format of 4:2:0 and the first chroma block having the color format of 4:2:

2.

10. the first variable indicating a neighboring luminance sample is derived based on at least one of a neighboring luminance sample above the first luminance block, a neighboring luminance sample to the left of the first luminance block, or a sample of the first luminance block; The method of claim 7 , wherein the rule further comprises: if the first syntax element is not present, then the value of the first syntax element is inferred to be equal to 1.

11. The method of claim 1 , wherein the converting comprises encoding the video into the bitstream.

12. The method of claim 1 , wherein the converting comprises decoding the video from the bitstream.

13. 1. An apparatus for processing video data, comprising a processor and a non-transitory memory having instructions, The instructions, when executed by the processor, cause the processor to: determining that a cross-component linear model (CCLM) prediction mode is applied to a first chroma block of a first video unit of a video for conversion between the first chroma block and a bitstream of the video; determining CCLM parameters for the first chroma block according to a rule; In the CCLM prediction mode, deriving a prediction sample of the first chroma block based on the CCLM and a parameter of the CCLM; performing the transform based on the predicted samples of the first chroma block; Execute The rules specify that the parameters of the CCLM are determined based on selected neighboring chroma samples of the first chroma block and selected downsampled neighboring luma samples derived based on a first variable representing neighboring luma samples of a first luma block corresponding to the first chroma block; The rules further specify that if the value of a second variable indicates that a neighboring block is available, the first variable is set equal to a neighboring luma sample of the first luma block, and if the value of the second variable indicates that the neighboring block is not available, the first variable is set equal to a valid sample; The rules further specify that if the color format of the first chroma block is 4:2:0, the selected downsampled neighboring luma samples are derived further based on at least one of a value of a first syntax element and a value of a third variable, the first syntax element included in the bitstream indicating whether a position of a chroma sample is vertically shifted relative to a position of a corresponding luma sample, and the third variable indicating whether the first chroma block is located at a boundary of a coding tree unit that includes the first chroma block; the rules further specify that if the value of the third variable indicates that the first chroma block is located at the boundary of the coding tree unit that includes the first chroma block, the selected downsampled neighboring luma samples are derived using the same filter regardless of the value of the first syntax element; The rule may further include: if the value of the third variable indicates that the first chroma block is not located at the boundary of the coding tree unit that includes the first chroma block, and the color format of the first chroma block is 4:2:0, the selected downsampled neighboring luma samples are obtained using different filters when the first syntax element has a different value; The rule further states that if the value of the third variable indicates that the first chroma block is not located at the boundary of the coding tree unit that has the first chroma block, and the color format of the first chroma block is 4:2:0, then if the first syntax element has a value of 1, then pSelDsY[i] is equal to (pY[SubWidthC*x][-3] + pY[SubWidthC*x][-3]). pSelDsY[i] denotes the selected downsampled neighboring luminance sample with index i, and pY[m][n] denotes one of said first variables with position (m,n), or The rule further states that if the value of the third variable indicates that the first chroma block is not located at the boundary of the coding tree unit that has the first chroma block, and the color format of the first chroma block is 4:2:0, then if the first syntax element has a value of 0, then pSelDsY[i] is equal to (pY[SubWidthC*x-1][-1] + pY[SubWidthC*x-1 ][−2]+2*pY[SubWidthC*x][−1]+2*pY[SubWidthC*x][−2]+pY[SubWidthC*x+1][−1]+pY[SubWidthC*x+1][−2]+4)>>3, pSelDsY[i] denotes the selected downsampled neighboring luminance sample with index i, and pY[m][n] denotes one of said first variables with position (m,n), if 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 neighboring left luma sample reconstructed before deblocking filtering at position (xTbY+x, yTbY+y), where x is in the range of [−3, −1] and the maximum value of y is equal to SubHeightC*Max(numSampL, nTbH)−1, where (xTbY, yTbY) indicates a top-left position of the first luma block, x and y are integers, nTbH indicates the height of the first chroma block, SubHeightC is a height scale factor obtained according to a chroma format of the first video unit, and numSampL indicates the number of neighboring left and bottom-left available chroma samples in the CCLM prediction mode; yTbY) indicates a top-left position of the first luma block, x and y are integers, nTbW indicates the width of the first chroma block, SubWidthC indicates a width scale factor obtained according to a chroma format of the first video unit, and numSampT indicates the number of available above-neighboring chroma samples or available above-and-top-right neighboring chroma samples for the CCLM prediction mode.

14. The processor determining that a cross-component linear model (CCLM) prediction mode is applied to a first chroma block of a first video unit of a video for conversion between the first chroma block and a bitstream of the video; determining CCLM parameters for the first chroma block according to a rule; In the CCLM prediction mode, deriving a prediction sample of the first chroma block based on the CCLM and a parameter of the CCLM; performing the transform based on the predicted samples of the first chroma block; Execute The rules specify that the parameters of the CCLM are determined based on selected neighboring chroma samples of the first chroma block and selected downsampled neighboring luma samples derived based on a first variable representing neighboring luma samples of a first luma block corresponding to the first chroma block; The rules further specify that if the value of a second variable indicates that a neighboring block is available, the first variable is set equal to a neighboring luma sample of the first luma block, and if the value of the second variable indicates that the neighboring block is not available, the first variable is set equal to a valid sample; The rules further specify that if the color format of the first chroma block is 4:2:0, the selected downsampled neighboring luma samples are derived further based on at least one of a value of a first syntax element and a value of a third variable, the first syntax element included in the bitstream indicating whether a position of a chroma sample is vertically shifted relative to a position of a corresponding luma sample, and the third variable indicating whether the first chroma block is located at a boundary of a coding tree unit that includes the first chroma block; the rules further specify that if the value of the third variable indicates that the first chroma block is located at the boundary of the coding tree unit that includes the first chroma block, the selected downsampled neighboring luma samples are derived using the same filter regardless of the value of the first syntax element; The rule may further include: if the value of the third variable indicates that the first chroma block is not located at the boundary of the coding tree unit that includes the first chroma block, and the color format of the first chroma block is 4:2:0, the selected downsampled neighboring luma samples are obtained using different filters when the first syntax element has a different value; The rule further states that if the value of the third variable indicates that the first chroma block is not located at the boundary of the coding tree unit that has the first chroma block, and the color format of the first chroma block is 4:2:0, then if the first syntax element has a value of 1, then pSelDsY[i] is equal to (pY[SubWidthC*x][-3] + pY[SubWidthC*x][-3]). pSelDsY[i] denotes the selected downsampled neighboring luminance sample with index i, and pY[m][n] denotes one of said first variables with position (m,n), or The rule further states that if the value of the third variable indicates that the first chroma block is not located at the boundary of the coding tree unit that has the first chroma block, and the color format of the first chroma block is 4:2:0, then if the first syntax element has a value of 0, then pSelDsY[i] is equal to (pY[SubWidthC*x-1][-1] + pY[SubWidthC*x-1 ][−2]+2*pY[SubWidthC*x][−1]+2*pY[SubWidthC*x][−2]+pY[SubWidthC*x+1][−1]+pY[SubWidthC*x+1][−2]+4)>>3, pSelDsY[i] denotes the selected downsampled neighboring luminance sample with index i, and pY[m][n] denotes one of said first variables with position (m,n), if 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 neighboring left luma sample reconstructed before deblocking filtering at position (xTbY+x, yTbY+y), where x is in the range of [−3, −1] and the maximum value of y is equal to SubHeightC*Max(numSampL, nTbH)−1, where (xTbY, yTbY) indicates a top-left position of the first luma block, x and y are integers, nTbH indicates the height of the first chroma block, SubHeightC is a height scale factor obtained according to a chroma format of the first video unit, and numSampL indicates the number of neighboring left and bottom-left available chroma samples in the CCLM prediction mode; 9. A non-transitory computer-readable storage medium storing instructions, wherein if the value of the second variable indicates that the neighboring block is available, the first variable, denoted by pY[x][y], is set equal to the neighboring upper luma sample reconstructed before deblocking filtering at position (xTbY+x, yTbY+y), where a maximum value of x is equal to SubWidthC*Max(numSampT, nTbW)-1, where (xTbY, yTbY) indicates a top-left position of the first luma block, x and y are integers, nTbW indicates the width of the first chroma block, SubWidthC indicates a width scale factor obtained according to a chroma format of the first video unit, and numSampT indicates the number of available above neighboring chroma samples or available above-and-top-right neighboring chroma samples for the CCLM prediction mode.

15. 1. A method for storing a video bitstream, comprising: determining that a cross-component linear model (CCLM) prediction mode is applied to a first chroma block of a first video unit of the video; determining CCLM parameters for the first chroma block according to a rule; In the CCLM prediction mode, deriving a prediction sample of the first chroma block based on the CCLM and a parameter of the CCLM; generating the bitstream based on the predicted samples of the first chroma block; storing the bitstream on a non-transitory computer-readable recording medium; and The rules specify that the parameters of the CCLM are determined based on selected neighboring chroma samples of the first chroma block and selected downsampled neighboring luma samples derived based on a first variable representing neighboring luma samples of a first luma block corresponding to the first chroma block; The rules further specify that if the value of a second variable indicates that a neighboring block is available, the first variable is set equal to a neighboring luma sample of the first luma block, and if the value of the second variable indicates that the neighboring block is not available, the first variable is set equal to a valid sample; The rules further specify that if the color format of the first chroma block is 4:2:0, the selected downsampled neighboring luma samples are derived further based on at least one of a value of a first syntax element and a value of a third variable, the first syntax element included in the bitstream indicating whether a position of a chroma sample is vertically shifted relative to a position of a corresponding luma sample, and the third variable indicating whether the first chroma block is located at a boundary of a coding tree unit that includes the first chroma block; the rules further specify that if the value of the third variable indicates that the first chroma block is located at the boundary of the coding tree unit that includes the first chroma block, the selected downsampled neighboring luma samples are derived using the same filter regardless of the value of the first syntax element; The rule may further include: if the value of the third variable indicates that the first chroma block is not located at the boundary of the coding tree unit that includes the first chroma block, and the color format of the first chroma block is 4:2:0, the selected downsampled neighboring luma samples are obtained using different filters when the first syntax element has a different value; The rule further states that if the value of the third variable indicates that the first chroma block is not located at the boundary of the coding tree unit that has the first chroma block, and the color format of the first chroma block is 4:2:0, then if the first syntax element has a value of 1, then pSelDsY[i] is equal to (pY[SubWidthC*x][-3] + pY[SubWidthC*x][-3]). pSelDsY[i] denotes the selected downsampled neighboring luminance sample with index i, and pY[m][n] denotes one of said first variables with position (m,n), or The rule further states that if the value of the third variable indicates that the first chroma block is not located at the boundary of the coding tree unit that has the first chroma block, and the color format of the first chroma block is 4:2:0, then if the first syntax element has a value of 0, then pSelDsY[i] is equal to (pY[SubWidthC*x-1][-1] + pY[SubWidthC*x-1 ][−2]+2*pY[SubWidthC*x][−1]+2*pY[SubWidthC*x][−2]+pY[SubWidthC*x+1][−1]+pY[SubWidthC*x+1][−2]+4)>>3, pSelDsY[i] denotes the selected downsampled neighboring luminance sample with index i, and pY[m][n] denotes one of said first variables with position (m,n), if 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 neighboring left luma sample reconstructed before deblocking filtering at position (xTbY+x, yTbY+y), where x is in the range of [−3, −1] and the maximum value of y is equal to SubHeightC*Max(numSampL, nTbH)−1, where (xTbY, yTbY) indicates a top-left position of the first luma block, x and y are integers, nTbH indicates the height of the first chroma block, SubHeightC is a height scale factor obtained according to a chroma format of the first video unit, and numSampL indicates the number of neighboring left and bottom-left available chroma samples in the CCLM prediction mode; yTbY) indicates a top-left position of the first luma block, x and y are integers, nTbW indicates the width of the first chroma block, SubWidthC indicates a width scale factor obtained according to a chroma format of the first video unit, and numSampT indicates the number of available above-neighboring chroma samples or available above-and-top-right neighboring chroma samples for the CCLM prediction mode.