Limitations on the use of cross-component predictions
By using cross-component linear model prediction technology in video codec technology, down-sampled co-located top luma samples are derived for chroma blocks of 4:2:2 video, and the signaling design of transform skip and BDPCM flags is adjusted , solves the problem of inaccurate parameter derivation caused by differences in color formats, and improves the efficiency and quality of video encoding and decoding.
Patent Information
- Application Number
- CN202180029353.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2020-04-18
- Filing Date
- 2021-04-19
- Publication Date
- 2025-01-24
- Estimated Expiration
- 2041-04-19
Smart Images

Figure CN115428446B_ABST
Abstract
Description
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This is the national phase of International Patent Application No. PCT / CN2021 / 088000 filed on April 19, 2021, claiming priority to and benefit of International Patent Application No. PCT / CN2020 / 085484 filed on April 18, 2020. The entire disclosure of the above application is incorporated by reference as part of the disclosure of this application. Technical Field
[0003] This document deals with video and image coding technologies. Background Art
[0004] Digital video accounts for the largest usage of bandwidth on the Internet and other digital communications networks. As the number of connected user devices capable of receiving and displaying video increases, bandwidth demand for digital video usage is expected to continue to grow. Summary of the invention
[0005] The disclosed techniques may be used by video or image decoder or encoder embodiments to perform encoding or decoding using cross-component linear model prediction.
[0006] In one example aspect, a method of processing a video is disclosed. The method includes: for conversion between a chroma block of the video and a coded representation of the video, deriving parameters of a cross-component linear model from downsampled co-located adjacent top luma samples generated from N top-neighboring rows of the co-located luma block using a downsampled filter, where N is a positive integer; and performing the conversion using a predicted chroma block generated using the cross-component linear model.
[0007] In another example aspect, a method of processing video is disclosed. The method includes: for conversion between a video block of video having a 4:2:2 color format and a bitstream of the video, determining parameters of a cross-component linear model for the video block according to a rule; and performing the conversion based on the determination, wherein a syntax element indicates whether chroma samples of the video are vertically shifted relative to luma samples of the video, and wherein the rule specifies that the parameter is determined independently of a value of the syntax element.
[0008] In another example aspect, a method of processing video is disclosed. The method includes: performing conversion between a video and a bitstream of the video according to a rule, and wherein the format rule specifies that because the video has a 4:2:2 or 4:4:4 color format, a field indicating whether a chroma sample position is vertically shifted relative to a corresponding luma sample position is set to a default value.
[0009] In another example aspect, a method of processing a video is disclosed. The method includes: for conversion between a video block of the video and a bitstream of the video, determining parameters of a cross-component linear model (CCLM) for the video block according to a rule; and performing the conversion based on the determination, wherein the rule specifies that a variable representing adjacent luma samples is used in determining the parameters of the CCLM only if the variable has a specific value.
[0010] In another example aspect, a method for processing a video is disclosed. The method includes: for conversion between a video including a video unit and a bitstream of the video, determining whether to enable a first codec tool for the video unit according to a rule, wherein the rule specifies that the first codec tool and the second codec tool are mutually exclusive enabled, and wherein the first codec tool or the second codec tool includes a symbol data hiding tool; and performing the conversion according to the determination.
[0011] In another example aspect, a method for processing a video is disclosed. The method includes: for conversion between a video including a video unit and a bitstream of the video, determining whether to enable a first codec tool for the video unit according to a rule, wherein the rule specifies that the first codec tool and the second codec tool are mutually exclusive enabled, and wherein the first codec tool or the second codec tool includes a dependent quantization tool; and performing the conversion according to the determination.
[0012] In another example aspect, a method of processing a video is disclosed. The method includes performing conversion between a video including one or more pictures including one or more slices and a bitstream of the video according to a rule, and wherein the rule specifies that a slice type of a slice depends on a reference picture entry of a reference picture list for the slice.
[0013] In another example aspect, a method of processing a video is disclosed. The method includes: performing conversion between a video 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 the number of filters allowed in an adaptive parameter set (APS) or the number of APSs depends on coded information of the video.
[0014] In another example aspect, the above method may be implemented by a video encoder device including a processor.
[0015] In yet another example aspect, the methods may be implemented in the form of processor-executable instructions and stored on a computer-readable program medium.
[0016] These and other aspects are also described in this document. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1AThe nominal vertical and horizontal positions of the 4:2:2 luma and chroma samples in the picture are shown.
[0018] Figure 1B An example of a video encoder is shown.
[0019] Figure 2 Examples of 67 intra prediction modes are shown.
[0020] Figure 3 Examples of horizontal and vertical traversal scans are shown.
[0021] Figure 4 Examples of the locations of the sample points used for the derivation of α and β are shown.
[0022] Figure 5 An example of partitioning a block of 4x8 samples into two independently decodable regions is shown.
[0023] Figure 6 An example order of processing pixel rows to maximize throughput for a 4xN block with a vertical predictor is shown.
[0024] Figure 7 An example of a low frequency non-separable transform (LFNST) process is shown.
[0025] Figure 8 An example of adjacent chroma samples and down-sampled co-located adjacent luma samples used in the derivation of CCLM parameters for 4:2:2 video is shown.
[0026] Fig. 9 An example of a video processing apparatus is shown.
[0027] Fig.10 A block diagram of a video encoder is shown.
[0028] Fig.11 is a flow chart of an example of a video processing method.
[0029] Fig.12 is a block diagram of an example of a video processing system.
[0030] Fig.13 An example of the samples in the current block and the top left sample to be used is shown.
[0031] Fig.14 is a block diagram illustrating an example video codec system.
[0032] Fig.15 is a block diagram illustrating an encoder according to some embodiments of the disclosed technology.
[0033] Fig.16 is a block diagram illustrating a decoder according to some embodiments of the disclosed technology.
[0034] Fig.17A and Fig. 17B is a flow chart of an example video processing method according to some embodiments of the disclosed technology.
[0035] Fig.18 is a flow chart of an example method of video processing according to some embodiments of the disclosed technology.
[0036] FIG. 19A to FIG. 19D is a flow chart of an example video processing method according to some embodiments of the disclosed technology. DETAILED DESCRIPTION
[0037] This document provides various techniques that can be used by a decoder of an image or video bitstream to improve the quality of a decompressed or decoded digital video or image. For brevity, the term "video" is used herein to include both a sequence of pictures (traditionally referred to as video) and a single image. In addition, a video encoder may also implement these techniques during the encoding process in order to reconstruct a decoded frame for further encoding.
[0038] For ease of understanding, section headings are used in this document, and the section headings do not limit the embodiments and techniques to the corresponding subsections. Therefore, embodiments from one section can be combined with embodiments from other sections.
[0039] 1. Brief Overview
[0040] The present invention relates to video coding technology. In particular, it relates to cross-component linear model prediction and other coding tools in image / video coding. It can be applied to existing video coding standards (such as HEVC), or standards to be finalized (multi-function video codec). It may also be applicable to future video coding standards or video codecs. 2. Background technology
[0042] Video codec standards have evolved primarily through the development of the well-known ITU-T and ISO / IEC standards. ITU-T developed H.261 and H.263, ISO / IEC developed MPEG-1 and MPEG-4 Vision, and the two organizations jointly developed the H.262 / MPEG-2 Video, H.264 / MPEG-4 Advanced Video Codec (AVC) standards, and H.265 / HEVC standards. Since H.262, video codec standards have been based on a hybrid video codec structure, in which temporal prediction plus transform codec is used. In order to explore future video codec technologies beyond HEVC, VCEG and MPEG jointly established the Joint Video Exploration Team (JVET) in 2015. Since then, many new methods have been adopted by JVET and introduced into the reference software called the Joint Exploration Model (JEM). In April 2018, the Joint Video Experts Team (JVET) between VCEG (Q6 / 16) and ISO / IEC JTC1 SC29 / WG11 (MPEG) was established to develop the VVC standard with the goal of reducing the bit rate by 50% compared to HEVC.
[0043] The latest version of the VVC draft, Versatile Video Coding (Draft 7), can be found at:
[0044] http: / / phenix.it-sudparis.eu / jvet / doc_end_user / documents / 16_Geneva / wg11 / JVET-P2001-v9.zip
[0045] The latest reference software for VVC (called VTM) can be found at the following URL:
[0046] https: / / vcgit.hhi.fraunhofer.de / jvet / VVCSoftware_VTM / - / tags / VTM-6.0
[0047] 2.1. Color Space and Chroma Subsampling
[0048] A color space, also called a color model (or color system), is an abstract mathematical model that simply describes the range of colors as a tuple of numbers, usually 3 or 4 values or color components (such as RGB). Fundamentally, a color space is an elaboration of coordinate systems and subspaces.
[0049] For video compression, the most commonly used color spaces are YCbCr and RGB.
[0050] YCbCr, Y'CbCr or Y Pb / Cb Pr / Cr, also written as YCBCR or Y'CBCR, is a family of color spaces used as part of the color imaging pipeline in video and digital photography systems. Y' is the luma component, CB and CR are the blue difference and red difference chroma components. Y' (with a superscript symbol) is distinguished from Y, which is brightness, meaning that light intensity is encoded non-linearly based on the gamma-corrected RGB primaries.
[0051] Chroma subsampling is the practice of encoding images at a lower resolution for chroma information than for luminance information, taking advantage of the fact that the human visual system is less sensitive to color differences than to luminance. 2.1.1.4:4:4
[0053] Each of the three Y'CbCr components has the same sample rate, so there is no chroma subsampling. This scheme is sometimes used in high-end film scanners and film post-production. 2.1.2.4:2:2
[0055] The two chroma components are sampled at half the sampling rate of luma: the horizontal chroma resolution is halved, while the vertical chroma resolution is unchanged. This reduces the bandwidth of the uncompressed video signal by one third with little or no visual difference. Examples of nominal vertical and horizontal positions for a 4:2:2 color format are shown in the VVC working draft. Figure 1A Depicted in. 2.1.3.4:2:0
[0057] In 4:2:0, the horizontal sampling is doubled compared to 4:1:1, but the vertical resolution is reduced by half because the Cb and Cr channels are sampled only on every alternate line in this scheme. Therefore, the data rate is the same. Cb and Cr are subsampled by a factor of 2 both horizontally and vertically. There are three variants of the 4:2:0 scheme with different horizontal and vertical positions.
[0058] In MPEG-2, Cb and Cr are cosited in the horizontal direction. Cb and Cr are located between pixels in the vertical direction (are located alternately).
[0059] In JPEG / JFIF, H.261, and MPEG-1, Cb and Cr are interspersed midway between alternate luminance samples.
[0060] In 4:2:0 DV, Cb and Cr are co-located horizontally. In the vertical direction, they are co-located on alternate lines.
[0061] Table 2-1 SubWidthC and SubHeightC values derived from chroma_format_idc and separate_colour_plane_flag
[0062]
[0063]
[0064] 2.2. Encoding and decoding process of typical video codecs
[0065] Figure 1B An example of an encoder block diagram for VVC is shown, which contains three in-loop filtering blocks: deblocking filter (DF), sample adaptive offset (SAO) and ALF. Unlike DF, which uses a predefined filter, SAO and ALF use the original samples of the current picture to reduce the mean square error between the original samples and the reconstructed samples by adding an offset and applying a finite impulse response (FIR) filter, respectively, where the offset and filter coefficients are signaled by codec-side information. ALF is located at the last processing stage of each picture and can be seen as a tool that tries to capture and repair artifacts created by previous stages.
[0066] 2.3. Intra-mode codec with 67 intra-prediction modes
[0067] To capture arbitrary edge orientations present in natural videos, the number of directional intra modes is extended from 33 used in HEVC to 65. Additional directional modes are Figure 2 The planar and DC modes remain unchanged as depicted in Fig. 3. These more dense directional intra prediction modes apply to all block sizes and both luma and chroma intra prediction.
[0068] like Figure 2 As shown, the traditional angular intra prediction direction is defined from 45 degrees to -135 degrees in the clockwise direction. In VTM, for non-square blocks, the wide-angle intra prediction mode is used to adaptively replace several traditional angular intra prediction modes. The replaced mode is signaled using the original method and is remapped to the index of the wide-angle mode after parsing. The total number of intra prediction modes remains unchanged, i.e. 67, and the intra mode encoding and decoding remains unchanged.
[0069] In HEVC, each intra-coded block has a square shape, and the length of each side is a power of 2. Therefore, no division operation is required to generate the intra predictor using the DC mode. In VVC, blocks can have a rectangular shape, and in general, a division operation is required for each block. To avoid the division operation for DC prediction, for non-square blocks, only the longer side is used to calculate the average.
[0070] Figure 2 Examples of 67 intra prediction modes are shown.
[0071] 2.4. Inter-frame prediction
[0072] For each inter-frame predicted CU, the motion parameters consist of a motion vector, a reference picture index and a reference picture list usage index, as well as additional information required for the new codec features of VVC that will be used for inter-frame prediction sample generation. The motion parameters can be signaled in an explicit or implicit manner. When a CU is encoded and decoded in skip mode, the CU is associated with one PU and has no significant residual coefficients, no coded motion vector increments or reference picture indexes. The merge mode is specified, whereby the motion parameters of the current CU are obtained from neighboring CUs, including spatial and temporal candidates, as well as additional scheduling introduced in VVC. The merge mode is not only applicable to skip mode, but can also be applied to any inter-frame predicted CU. An alternative to the merge mode is the explicit transmission of motion parameters, where each CU explicitly signals the motion vector, the corresponding reference picture index and reference picture list usage flag for each reference picture list, as well as other required information.
[0073] 2.5. Intra-block copy (IBC)
[0074] Intra-block copying (IBC) is a tool adopted in the HEVC extension on SCC. It is well known that it significantly improves the encoding and decoding efficiency of screen content materials. Since the IBC mode is implemented as a block-level codec mode, block matching (BM) is performed at the encoder to find the best block vector (or motion vector) for each CU. Here, a block vector is used to indicate the displacement from the current block to the reference block, which has been reconstructed within the current picture. The luminance block vector of the CU encoded and decoded by IBC is integer precision. The chrominance block vector is also rounded to integer precision. When combined with AMVR, the IBC mode can switch between 1 pixel and 4 pixel motion vector precision. The CU encoded and decoded by IBC is regarded as a third prediction mode in addition to the intra or inter prediction mode. The IBC mode is applicable to CUs with a width and height that are less than or equal to 64 luminance samples.
[0075] On the encoder side, hash-based motion estimation is performed for IBC. The encoder performs RD checks on blocks with a width or height of no more than 16 luma samples. For non-merge mode, a block vector search is first performed using a hash-based search. If the hash search does not return a valid candidate, a local search based on block matching is performed.
[0076] In hash-based search, the hash key matching (32-bit CRC) between the current block and the reference blocks is extended to all allowed block sizes. The hash key calculation for each position in the current picture is based on 4×4 sub-blocks. For larger-sized current blocks, the hash key that matches the hash key of the reference block is determined when all hash keys of all 4×4 sub-blocks match the hash keys in the corresponding reference positions. If multiple reference blocks are found whose hash keys match the hash key of the current block, the block vector cost of each matching reference is calculated and the one with the smallest cost is selected.
[0077] In the block matching search, the search range is set to cover both the previous and current CTUs.
[0078] At CU level, IBC mode is signaled using a flag, which can be signaled as IBC AMVP mode or IBC skip / merge mode as shown below:
[0079] -IBC skip / merge mode: merge candidate index is used to indicate which block vectors from neighboring candidate IBC codec blocks in the list are used to predict the current block. The merge list consists of spatial candidates, HMVP candidates and pairwise candidates.
[0080] - IBC AMVP mode: Block vector differences are encoded and decoded in the same way as motion vector differences. The block vector prediction method uses two candidates as predictors, one from the left neighbor and one from the upper neighbor (if IBC codec). When any neighbor is not available, the default block vector is used as predictor. A flag is signaled to indicate the block vector predictor index.
[0081] 2.6. Palette Mode
[0082] For palette mode signaling, the palette mode is encoded and decoded as the prediction mode of the codec unit, that is, the prediction mode of the codec unit can be MODE_INTRA, MODE_INTER, MODE_IBC and MODE_PLT. If the palette mode is used, the pixel values in the CU are represented by a small set of representative color values. This set is called a palette. For pixels whose values are close to the palette color, the palette index is signaled. For pixels whose values are outside the palette, the pixel is represented by an escape symbol and the quantized pixel value is directly signaled.
[0083] To decode a palette coded block, the decoder needs to decode the palette colors and indices. The palette colors are described by a palette table and are encoded by the palette table codec. An escape flag is signaled for each CU to indicate whether an escape symbol is present in the current CU. If an escape symbol is present, the palette table is incremented by one and the last index is assigned to the escape mode. The palette indices of all pixels in the CU form a palette index map and are encoded by the palette index map codec.
[0084] In order to encode and decode the palette table, a palette predictor is maintained. The predictor is initialized at the beginning of each stripe where the predictor is reset to 0. For each entry in the palette predictor, a reuse flag is signaled to indicate whether it is part of the current palette. The reuse flag is sent using run-length encoding of zero. After this, the number of new palette entries is signaled using an exponential Golomb code of order 0. Finally, the component values of the new palette entries are signaled. After encoding the current CU, the palette predictor will be updated with the current palette, and entries from the previous palette predictor that are not reused in the current palette will be added to the end of the new palette predictor until the maximum allowed size is reached (palette padding).
[0085] To encode and decode a palette index map, use Figure 3 The indexes are encoded and decoded by scanning horizontally and vertically as shown. The scanning order is explicitly signaled in the bitstream using palette_transpose_flag.
[0086] Figure 3 Examples of horizontal and vertical traversal scans are shown.
[0087] Palette indices are encoded and decoded using two main palette sampling modes: 'INDEX' and 'COPY_ABOVE'. Flags are used to signal the mode except when the top row is used when horizontal scanning is used, the first column is used when vertical scanning is used, or the previous mode is 'COPY_ABOVE'. In 'COPY_ABOVE' mode, the palette index of the samples 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 which specifies the number of pixels to be encoded and decoded using the same mode.
[0088] The encoding order of the index map is as follows: First, the number of index values for the CU is signaled. Then, truncated binary codec is used to signal the actual index value for the entire CU. Both the index number and the index value are encoded and decoded in bypass mode. This groups the index-related bypass bins together. Then, the palette mode (INDEX or COPY_ABOVE) and the run value are signaled in an interleaved manner. Finally, the component escape values corresponding to the escape samples of the entire CU are grouped together and encoded and decoded in bypass mode. After signaling the index value, an additional syntax element last_run_type_flag is signaled. This syntax element is used in conjunction with the index number to avoid the need to signal the run value corresponding to the last run in the block.
[0089] In VTM, a binary tree is enabled for the I slice, which separates the luminance (Luma) and chrominance (Chroma) codecs. Therefore, in this scheme, the palette is applied to the luminance (Y component) and chrominance (Cb and Cr components) separately. If the binary tree is disabled, the palette will be applied to the Y, Cb, Cr components together, the same as the HEVC palette.
[0090] 2.7. Cross-component linear model prediction
[0091] The cross-component linear model (CCLM) prediction mode is used in VVC. For this mode, the chrominance samples are predicted based on the reconstructed luma samples of the same CU using the following linear model:
[0092] pred C (i, j) = α·rec L ′(i,j)+β (2-1)
[0093] where pred C (i, j) represents the predicted chroma sample in the CU, and rec L (i, j) represents the downsampled reconstructed luma samples of the same CU.
[0094] Figure 4 An example of the positions of left and upper samples involved in the LM mode and samples of the current block is shown.
[0095] Figure 4 Examples of the locations of the sample points used for the derivation of α and β are shown.
[0096] In addition to the upper template and the left template being used together to calculate the linear model coefficients in the LM mode, they can also be used alternately in the other two LM modes (i.e., LM_A and LM_L modes). In the LM_A mode, only the upper template is used to calculate the linear model coefficients. In order to obtain more samples, the upper template is expanded to (W+H). In the LM_L mode, only the left template is used to calculate the linear model coefficients. In order to obtain more samples, the left template is expanded to (H+W). For non-square blocks, the upper template is expanded to W+W and the left template is expanded to H+H.
[0097] CCLM parameters (α and β) are derived using up to four adjacent chroma samples and their corresponding downsampled luma samples. Assuming the current chroma block dimension is W×H, W' and H' are set to
[0098] —When LM mode is applied, W'=W, H'=H;
[0099] —When LM-A mode is applied, W'=W+H;
[0100] —When LM-L mode is applied, H'=H+W;
[0101] The upper adjacent position is represented as S[0, -1] ... S[W'-1, -1], and the left adjacent position is represented as S[-1, 0] ... S[-1, H'-1]. Then four sample points are selected as
[0102] - When LM mode is applied and both upper and left adjacent samples are available, S[W' / 4, -1], S[3W' / 4, -1], S[-1, H' / 4], S[-1, 3H' / 4];
[0103] – When LM-A mode is applied or only upper adjacent samples are available, S[W' / 8, -1], S[3W' / 8, -1], S[5W' / 8, -1], S[7W' / 8, -1];
[0104] - When LM-L mode is applied or only left adjacent samples are available, S[-1, H' / 8], S[-1, 3H' / 8], S[-1, 5H' / 8], S[-1, 7H' / 8];
[0105] Downsample the four adjacent brightness samples at the selected position and perform four comparisons to find the smaller of the two values: x 0 A and x 1 A , and two larger values: x 0 B and x 1 BTheir corresponding chrominance sample values are represented by y 0 A ,y 1 A ,y 0 B and 1 B Then x A 、x B ,y A and B It is derived as follows:
[0106] X a =(x 0 A +x 1 A +1)>>1;X b =(x 0 B +x 1 B +1)>>1;Y a =(y 0 A +y 1 A +1)>>1;Y b =(y 0 B +y 1 B +1)>>1 (2-2)
[0107] Finally, the linear model parameters α and β are obtained according to the following equations.
[0108]
[0109] β=Y b -α·X b (2-4)
[0110] The division operation to calculate the parameter α is implemented using a lookup table. To reduce the memory required to store the table, the diff value (the difference between the maximum and minimum values) and the parameter α are expressed in exponential notation. For example, diff is approximated using a 4-bit significant part and an exponent. Therefore, the table of 1 / diff is reduced to 16 elements for 16 meaningful values, as shown below:
[0111] DivTable[]={0,7,6,5,5,4,4,3,3,2,2,1,1,1,1,0} (2-5)
[0112] The benefit of doing this is that it reduces both the complexity of the computation and the size of the memory required to store the required tables.
[0113] To match the chroma sample positions of a 4:2:0 video sequence, two downsampling filters are applied to the luma samples to achieve a 2:1 downsampling ratio in both the horizontal and vertical directions. The choice of downsampling filter is specified by the SPS level flag. The two downsampling filters are shown below, corresponding to "Type 0" and "Type 2" content, respectively.
[0114]
[0115]
[0116] Note that when the upper reference line is at a CTU boundary, only one luma line (typically a line buffer in intra prediction) is used to derive the downsampled luma samples.
[0117] This parameter calculation is performed as part of the decoding process and not just as an encoder search operation. As a result, no syntax is used to pass the α and β values to the decoder.
[0118] For chroma intra mode coding and decoding, a total of 8 intra modes are allowed for chroma intra mode coding and decoding. These modes include five traditional intra modes and three cross-component linear model modes (LM, LM_A and LM_L). The chroma mode signaling and derivation process are shown in Table 2-2. Chroma mode coding and decoding directly depends on the intra prediction mode of the corresponding luminance block. Since separate block partitioning structures for luminance and chrominance components are enabled in the I stripe, one chroma block can correspond to multiple luminance blocks. Therefore, for the chroma DM mode, the intra prediction mode of the corresponding luminance block covering the center position of the current chroma block is directly inherited.
[0119] Table 2-2. Derivation of chrominance prediction from luma mode when ccm_is is enabled
[0120]
[0121]
[0122] Specification of INTRA_LT_CCLM, INTRA_L_CCLM and INTRA_T_CCLM intra prediction modes in JVET-Q2001-vE 8.4.5.2.13
[0124] The inputs to this process are:
[0125] —Intra prediction mode predModeIntra,
[0126] - the sample position of the upper left sample of the current transform block relative to the upper left sample of the current picture (xTbC, yTbC),
[0127] - variable nTbW specifying the transform block width,
[0128] - variable nTbH specifying the transform block height,
[0129] — variable cIdx that specifies the color component of the current block,
[0130] - Chroma neighboring samples p[x][y], where x=-1, y=0..2×nTbH-1, and x=0..2×nTbW-1, y=-1.
[0131] The output of this process is the predicted samples predSamples[x][y], where x=0..nTbW-1, y=0..nTbH-1.
[0132] The current brightness position (xTbY, yTbY) is derived as follows:
[0133] (xTbY, yTbY) = (xTbC<<(SubWidthC-1), yTbC<<(SubHeightC-1)) (351)
[0134] The variables availL, availT, and availTL are derived as follows:
[0135] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using as input the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY-1, yTbY), checkPredModeY set equal to false (FLASE), and cIdx, and assign the output to availL.
[0136] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using as input the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY, yTbY-1), checkPredModeY set equal to false (FLASE), and cIdx, and assign the output to availT.
[0137] —The variable availTL is derived as follows:
[0138] availTL=availL&&availT (352)
[0139] —The number of available top-right adjacent chroma samples numTopRight is derived as follows:
[0140] —The variable numTopRight is set to 0, and availTR is set to TRUE.
[0141] - When predModeIntra is equal to INTRA_T_CCLM, the following applies for x=nTbW..2×nTbW-1 until availTR is equal to FALSE or x is equal to 2×nTbW-1:
[0142] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using as input the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY+x, yTbY-1), checkPredModeY set equal to false (FLASE), and cIdx, and assign the output to availTR.
[0143] —When availTR is equal to TRUE, numTopRight is increased by 1.
[0144] —The number of available lower left adjacent chroma samples numLeftBelow is derived as follows:
[0145] —The variable numLeftBelow is set to 0, and availLB is set to TRUE.
[0146] - When predModeIntra is equal to INTRA_L_CCLM, the following applies for y=nTbH..2×nTbH-1 until availLB is equal to FALSE or y is equal to 2×nTbH-1:
[0147] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using as input the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY-1, yTbY+y), checkPredModeY set equal to false (FLASE), and cIdx, and assign the output to availLB.
[0148] —When availLB is equal to TRUE, numLeftBelow is increased by 1.
[0149] The number of available adjacent chroma samples numSampT at the top and upper right and the number of available adjacent chroma samples numSampL at the left and lower left are derived as follows:
[0150] — If predModeIntra is equal to INTRA_LT_CCLM, the following applies:
[0151] numSampT=availT? nTbW:0 (353)
[0152] numSampL=availL? nTbH:0 (354)
[0153] — Otherwise, the following applies:
[0154] numSampT=(availT&&predModeIntra==INTRA_T_CCLM)? (nTbW+Min(numTopRight,nTbH)):0 (355)
[0155] numSampL=(availL&&predModeIntra==INTRA_L_CCLM)? (nTbH+Min(numLeftBelow,nTbW)):0 (356)
[0157] The variable bCTUboundary is derived as follows:
[0158] bCTUboundary=(yTbY&(CtbSizeY-1)==0)? TRUE:FALSE (357)
[0159] The variable cntN and array pickPosN where N is replaced by L and T are derived as follows:
[0160] —The variable numIs4N is derived as follows:
[0161] numIs4N=((availT&&availL&&predModeIntra==INTRA_LT_CCLM)?0:1) (358)
[0162] —The variable startPosN is set equal to numSampN>>(2+numIs4N).
[0163] —The variable pickStepN is set equal to Max(1, numSampN>>(1+numIs4N)).
[0164] —If availN is equal to TRUE and predModeIntra is equal to INTRA_LT_CCLM or INTRA_N_CCLM, the following assignments are made:
[0165] —cntN is set equal to Min(numSampN, (1+numIs4N)<<1).
[0166] —pickPosN[pos] is set equal to (startPosN+pos×pickStepN), where pos=0..cntN-1.
[0167] Otherwise, cntN is set equal to 0.
[0168] The predicted sample predSample[x][y], where x = 0..nTbW-1, y = 0..nTbH-1, is derived as follows:
[0169] — If numSampL and numSampT are both equal to 0, the following applies:
[0170] predSamples[x][y]=1<<(BitDepth-1) (359)
[0172] — Otherwise, the following ordered steps apply:
[0173] 1. The co-located luma sample pY[x][y] where x=0..nTbW×SubWidthC-1, y=0..TbH×SubHeightC-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).
[0174] 2. The adjacent brightness samples pY[x][y] are derived as follows:
[0175] —When numSampL is greater than 0, the adjacent left luma sample pY[x][y] with x=-1..-3, y=0..SubHeightC×numSampL-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).
[0176] - When availT is equal to FALSE, the adjacent top luma sample pY[x][y] where x = -1..SubWidthC×numSampT-1, y = -1..-2 is set equal to luma sample pY[x][0].
[0177] - When availL is equal to FALSE, the adjacent left luma sample pY[x][y] where x = -1..-3, y = -1..SubHeightC×numSampL-1 is set equal to luma sample pY[0][y].
[0178] —When numSampT is greater than 0, the neighboring top luma sample pY[x][y] where x=0..SubWidthC×numSampT-1, y=-1..-2 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).
[0179] —When availTL is equal to true (TRUE), the adjacent upper left luma sample pY[x][y] where x=-1, y=-1, -2 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).
[0180] 3. The downsampled co-located luminance sample pDsY[x][y], where x = 0..nTbW-1, y = 0..nTbH-1, is derived as follows:
[0181] —If SubWidthC and SubHeightC are both equal to 1, then the following applies:
[0182] —pDsY[x][y], where x=1..nTbW-1, y=1..nTbH-1 is derived as follows:
[0183] pDstY[x][y]=pY[x][y] (360)
[0184] — Otherwise, the following applies:
[0185] —The one-dimensional filter coefficient arrays F1 and F2 and the two-dimensional filter coefficient arrays F3 and F4 are specified as follows.
[0186] F1[0]=2,F1[1]=0 (361)
[0187] F2[0]=1,F2[1]=2,F2[2]=1 (362)
[0188] F3[i][j]=F4[i][j]=0, where i=0..2, j=0..2(363)
[0189] — If SubWidthC and SubHeightC are both equal to 2, then the following applies:
[0190] F1[0]=1,F1[1]=1 (364)
[0191] F3[0][1]=1,F3[1][1]=4,F3[2][1]=1,F3[1][0]=1,F3[1][2]=1 (365)
[0192] F4[0][1]=1, F4[1][1]=2, F4[2][1]=1(366)
[0193] F4[0][2]=1, F4[1][2]=2, F4[2][2]=1(367)
[0194] — Otherwise, the following applies:
[0195] F3[1][1]=8 (368)
[0196] F4[0][1]=2, F4[1][1]=4, F4[2][1]=2, (369)
[0197] - If sps_chroma_vertical_collocated_flag is equal to 1, the following applies:
[0198] —pDsY[x][y], where x=0..nTbW-1, y=0..nTbH-1 is derived as follows:
[0199] pDsY[x][y]=(F3[1][0]×pY[SubWidthC×x][SubHeightC×y-1]+
[0200] F3[0][1]×pY[SubWidthC×x-1][SubHeightC×y]+
[0201] F3[1][1]×pY[SubWidthC×x][SubHeightC×y]+(370)
[0202] F3[2][1]×pY[SubWidthC×x+1][SubHeightC×y]+
[0203] F3[1][2]×pY[SubWidthC×x][SubHeightC×y+1]+4)>>3
[0204] - Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies:
[0205] —pDsY[x][y], where x=0..nTbW-1, y=0..nTbH-1 is derived as follows:
[0206] pDsY[x][y]=(F4[0][1]×pY[SubWidthC×x-1][SubHeightC×y]+
[0207] F4[0][2]×pY[SubWidthC×x-1][SubHeightC×y+1]+
[0208] F4[1][1]×pY[SubWidthC×x][SubHeightC×y]+(371)
[0209] F4[1][2]×pY[SubWidthC×x][SubHeightC×y+1]+
[0210] F4[2][1]×pY[SubWidthC×x+1][SubHeightC×y]+
[0211] F4[2][2]×pY[SubWidthC×x+1][SubHeightC×y+1]+4)>>3
[0212] 4. When numSampL is greater than 0, the selected adjacent left chroma sample pSelC[idx] is set equal to p[-1][pickPosL[idx]], where idx = 0..cntL-1, and the selected downsampled adjacent left luma sample pSelDsY[idx], where idx = 0..cntL-1 is derived as follows:
[0213] —The variable y is set equal to pickPosL[idx].
[0214] —If SubWidthC and SubHeightC are both equal to 1, then the following applies:
[0215] pSelDsY[idx]=pY[-1][y] (372)
[0216] — Otherwise, the following applies:
[0217] - If sps_chroma_vertical_collocated_flag is equal to 1, the following applies:
[0218] pSelDsY[idx]=(F3[1][0]×pY[-SubWidthC][SubHeightC×y-1]+
[0219] F3[0][1]×pY[-1-SubWidthC][SubHeightC×y]+
[0220] F3[1][1]×pY[-SubWidthC][SubHeightC×y]+(373)
[0221] F3[2][1]×pY[1-SubWidthC][SubHeightC×y]+
[0222] F3[1][2]×pY[-SubWidthC][SubHeightC×y+1]+4)>>3
[0223] - Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies:
[0224] pSelDsY[idx]=(F4[0][1]×pY[-1-SubWidthC][SubHeightC×y]+
[0225] F4[0][2]×pY[-1-SubWidthC][SubHeightC×y+1]+
[0226] F4[1][1]×pY[-SubWidthC][SubHeightC×y]+(374)
[0227] F4[1][2]×pY[-SubWidthC][SubHeightC×y+1]+
[0228] F4[2][1]×pY[1-SubWidthC][SubHeightC×y]+
[0229] F4[2][2]×pY[1-SubWidthC][SubHeightC×y+1]+4)>>3
[0230] 5. When numSampT is greater than 0, the selected adjacent top chroma sample pSelC[idx] is set equal to p[pickPosT[idx-cntL]][-1], where idx=cntL..cntL+cntT-1, and the downsampled adjacent top luma sample pSelDsY[idx], where idx=0..cntL+cntT-1 is specified as follows:
[0231] —The variable x is set equal to pickPosT[idx-cntL].
[0232] —If SubWidthC and SubHeightC are both equal to 1, then the following applies:
[0233] pSelDsY[idx]=pY[x][-1] (375)
[0234] — Otherwise, the following applies:
[0235] - If sps_chroma_vertical_collocated_flag is equal to 1, the following applies:
[0236] — If bCTUboundary is equal to FALSE, the following applies:
[0237] pSelDsY[idx]=(F3[1][0]×pY[SubWidthC×x][-1-SubHeightC]+
[0238] F3[0][1]×pY[SubWidthC×x-1][-SubHeightC]+
[0239] F3[1][1]×pY[SubWidthC×x][-SubHeightC]+(376)
[0240] F3[2][1]×pY[SubWidthC×x+1][-SubHeightC]+
[0241] F3[1][2]×pY[SubWidthC×x][1-SubHeightC]+4)>>3
[0242] — Otherwise (bCTUboundary is TRUE), the following applies:
[0243] pSelDsY[idx]=(F2[0]×pY[SubWidthC×x-1][-1]+
[0244] F2[1]×pY[SubWidthC×x][-1]+(377)
[0245] F2[2]×pY[SubWidthC×x+1][-1]+2)>>2
[0246] - Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies:
[0247] — If bCTUboundary is equal to FALSE, the following applies:
[0248] pSelDsY[idx]=(F4[0][1]×pY[SubWidthC x-1][-1]+
[0249] F4[0][2]×pY[SubWidthC×x-1][-2]+
[0250] F4[1][1]×pY[SubWidthC×x][-1]+(378)
[0251] F4[1][2]×pY[SubWidthC×x][-2]+
[0252] F4[2][1]×pY[SubWidthC×x+1][-1]+
[0253] F4[2][2]×pY[SubWidthC×x+1][-2]+4)>>3
[0254] — Otherwise (bCTUboundary is TRUE), the following applies:
[0255] pSelDsY[idx]=(F2[0]×pY[SubWidthC×x-1][-1]+
[0256] F2[1]×pY[SubWidthC×x][-1]+(379)
[0257] F2[2]×pY[SubWidthC×x+1][-1]+2)>>2
[0258] 6. When cntT+cntL is not equal to 0, the variables minY, maxY, minC and maxC are derived as follows:
[0259] —When cntT+cntL is equal to 2, pSelComp[3] is set equal to pSelComp[0], pSelComp[2] is set equal to pSelComp[1], pSelComp[0] is set equal to pSelComp[1], pSelComp[1] is set equal to pSelComp[3], and Comp is replaced with DsY and C.
[0260] —The arrays minGrpIdx and maxGrpIdx are derived as follows:
[0261] minGrpIdx[0]=0 (380)
[0262] minGrpIdx[1]=2 (381)
[0263] maxGrpIdx[0]=1 (382)
[0264] maxGrpIdx[1]=3 (383)
[0265] —When pSelDsY[minGrpIdx[0]] is greater than pSelDsY[minGrpIdx[1]], minGrpIdx[0] and minGrpIdx[1] are swapped as follows:
[0266] (minGrpIdx[0], minGrpIdx[1])=Swap(minGrpIdx[0], minGrpIdx[1(384)
[0267] —When pSelDsY[maxGrpIdx[0]] is greater than pSelDsY[maxGrpIdx[1]], maxGrpIdx[0] and maxGrpIdx[1] are swapped as follows:
[0268] (maxGrpIdx[0], maxGrpIdx[1])=Swap(maxGrpIdx[0], maxGrpIdx[1] (385)
[0269] —When pSelDsY[minGrpIdx[0]] is greater than pSelDsY[maxGrpIdx[1]], the arrays minGrpIdx and maxGrpIdx are swapped as follows:
[0270] (minGrpIdx, maxGrpIdx) = Swap (minGrpIdx, maxGrpIdx) (386)
[0271] —When pSelDsY[minGrpIdx[1]] is greater than pSelDsY[maxGrpIdx[0]], minGrpIdx[1] and maxGrpIdx[0] are swapped as follows:
[0272] (minGrpIdx[1], maxGrpIdx[0])=Swap(minGrpIdx[1], maxGrpIdx[0]) (387)
[0273] —The variables maxY, maxC, minY and minC are derived as follows:
[0274] maxY=(pSelDsY[maxGrpIdx[0]]+pSelDsY[maxGrpIdx[1]]+1)>>1 (388)
[0275] maxC=(pSelC[maxGrpIdx[0]]+pSelC[maxGrpIdx[1]]+1)>>1 (389)
[0276] minY=(pSelDsY[minGrpIdx[0]]+pSelDsY[minGrpIdx[1]]+1)>>1 (390)
[0277] minC=(pSelC[minGrpIdx[0]]+pSelC[minGrpIdx[1]]+1)>>1 (391)
[0278] 7. The variables a, b and k are derived as follows:
[0279] — If numSampL is equal to 0 and numSampT is equal to 0, then the following applies:
[0280] k=0 (392)
[0281] a=0 (393)
[0282] b=1<<(BitDepth-1) (394)
[0283] — Otherwise, the following applies:
[0284] diff=maxY-minY (395)
[0285] — If diff is not equal to 0, the following applies:
[0286] diffC=maxC-minC (396)
[0287] x=Floor(Log2(diff)) (397)
[0288] normDiff=((diff<<4)>>x)&15 (398)
[0289] x+=(normDiff!=0)? 1:0 (399)
[0290] y=Abs(diffC)>0? Floor(Log2(Abs(diffC)))+1:0 (400)
[0291] a=(diffC×(divSigTable[normDiff]|8)+2 y - 1 )>>y (401)
[0292] k=((3+xy)<1)? 1:3+xy (402)
[0293] a=((3+xy)<1)? Sign(a)×15:a (403)
[0294] b=minC-((a×minY)>>k) (404)
[0295] where divSigTable[] is specified as follows:
[0296] divSigTable[]={0, 7, 6, 5, 5, 4, 4, 3, 3, 2, 2, 1, 1, 1, 1, 0} (405)
[0297] — Otherwise (diff is equal to 0), the following applies:
[0298] k=0 (406)
[0299] a=0 (407)
[0300] b=minC (408)
[0301] 8. The predicted sample point predSample[x][y], where x = 0..nTbW-1, y = 0..nTbH-1 is derived as follows:
[0302] predSamples[x][y]=Clip1(((pDsY[x][y]×a)>>k)+b) (409)
[0303] NOTE - This process uses sps_chroma_vertical_collocated_flag. However, to simplify the implementation, it does not use sps_chroma_horizontal_collocated_flag.
[0304] 2.8. Block Differential Pulse Code Modulation (BDPCM)
[0305] BDPCM was proposed in JVET-M0057. Due to the shape of the horizontal (vertical) predictor, which uses the left (A) (top (B)) pixel to predict the current pixel, the most throughput-efficient way to process a block is to process all pixels of a column (row) in parallel and process these columns (rows) sequentially. To improve throughput, we introduce the following procedure: when the predictor selected on this block is vertical, the block of width 4 is split into two halves with a horizontal boundary; when the predictor selected on this block is horizontal, the block of height 4 is split into two halves with a vertical boundary.
[0306] When a block is partitioned, samples from one region are not allowed to use pixels from another region to compute a prediction: if this happens, the predicted pixel is replaced by a reference pixel in the prediction direction. This is done for different positions of the current pixel X in the vertically predicted 4×8 block. Figure 5 Shown in.
[0307] Figure 5 An example of partitioning a block of 4x8 samples into two independently decodable regions is shown.
[0308] Due to this feature, it is now possible to process a 4×4 block in 2 cycles, a 4×8 or 8×4 block in 4 cycles, and so on. Figure 6 shown.
[0309] Figure 6 An example order of processing pixel rows to maximize throughput for a 4xN block with a vertical predictor is shown.
[0310] Table 2-3 summarizes the number of cycles required to process a block, depending on the size of the block. It shows that any block with both dimensions greater than or equal to 8 can be processed with 8 pixels per cycle or even more, which is easy to solve.
[0311] Table 2-3. Worst-case throughput for blocks of size 4×N, N×4
[0312]
[0313] 2.9. Quantized Residual Domain BDPCM
[0314] In JVET-N0413, quantized residual domain BDPCM (hereinafter referred to as RBDPCM) is proposed. Intra-frame prediction is performed on the entire block by copying samples in the prediction direction (horizontal or vertical prediction) similar to intra-frame prediction. The residual is quantized, and the delta between the quantized residual and its predictor (horizontal or vertical) quantized value is encoded and decoded.
[0315] For a block of size M (rows) × N (columns), let r i,j , 0≤i≤M-1, 0≤j≤N-1 is the prediction residual after performing intra prediction horizontally (copying the left neighboring pixel values row by row across the prediction block) or vertically (copying the top neighboring row to each row in the prediction block) using the unfiltered samples from the upper or left block boundary samples. Let Q(r i,k ), 0≤i≤M-1, 0≤j≤N-1 represents the residual r i,j The quantized version of , where the residual is the difference between the original block value and the predicted block value. Block DPCM is then applied to the quantized residual samples to obtain a value with elements The modified M×N array of When vertical BDPCM is signaled:
[0316]
[0317] For horizontal prediction, similar rules are applied and the residual quantization samples are obtained by
[0318]
[0319] Residual quantization samples is sent to the decoder.
[0320] At the decoder end, the above calculation is inverted to produce Q(r i,j ),0≤i≤M-1,0≤j≤N-1. For vertical prediction,
[0321]
[0322] For the horizontal case,
[0323]
[0324] The inverse quantized residual Q -1 (Q(r i , j )) is added to the intra-block prediction value to generate the reconstructed sample value.
[0325] The main advantage of this scheme is that inverse DPCM can be performed dynamically during coefficient analysis by simply adding the predictor when the coefficients are analyzed, or it can be performed after analysis.
[0326] In quantized residual domain BDPCM, the transform skip method is often used.
[0327] 2.10. Multiple Transform Set (MTS) in VVC
[0328] In VTM, large block size transforms are enabled, up to 64×64 in size, which is mainly used for higher resolution videos, such as 1080p and 4K sequences. For transform blocks with a size (width or height, or both width and height) equal to 64, the high-frequency transform coefficients are zeroed, so that only the low-frequency coefficients are retained. For example, for an M×N transform block, M is the block width and N is the block height, when M is equal to 64, only the left 32 columns of transform coefficients are retained. Similarly, when N is equal to 64, only the top 32 rows of transform coefficients are retained. When the transform skip mode is used for large blocks, the entire block will be used without clearing any values. VTM also supports a configurable maximum transform size in SPS, allowing the encoder to flexibly select a transform size of up to 16 lengths, 32 lengths, or 64 lengths according to the needs of the specific implementation.
[0329] In addition to DCT-II used in HEVC, a multiple transform selection (MTS) scheme is used for residual coding of blocks for inter-frame and intra-frame coding. It uses multiple selected transforms in DCT8 / DST7. The newly introduced transform matrices are DST-VII and DCT-VIII. Table 2-4 shows the basic functions of the selected DST / DCT.
[0330] Table 2-4. Basic functions of DCT-II / VIII and DSTVII transforms for N-point input
[0331]
[0332]
[0333] To maintain the orthogonality of the transform matrix, the quantization of the transform matrix is more accurate than that in HEVC. To keep the intermediate values of the transformed coefficients within the 16-bit range, all coefficients should be 10 bits after horizontal and vertical transforms.
[0334] To control the MTS scheme, separate enable flags are specified at the SPS level for intra and inter frames respectively. When MTS is enabled at the SPS, a CU level flag is signaled to indicate whether MTS is applied. Here, MTS is applied only to luma. The MTS CU level flag is signaled when the following conditions are met.
[0335] - Both width and height are less than or equal to 32
[0336] -CBF flag equals 1
[0337] If the MTS CU flag is equal to zero, DCT2 is applied in both directions. However, if the MTS CU flag is equal to 1, two other flags are additionally signaled to indicate the transform type in the horizontal and vertical directions, respectively. The transform and signaling mapping table is shown in Table 2-5. The transform selection of ISP is unified, and implicit MTS is used by eliminating the dependency on intra mode and block shape. If the current block is in ISP mode, or if the current block is an intra block and both intra and inter explicit MTS are turned on, only DST7 is used for both horizontal and vertical transform kernels. When it comes to transform matrix accuracy, an 8-bit main transform kernel is used. Therefore, all transform kernels used in HEVC remain unchanged, including 4-point DCT-2 and DST-7, 8-point, 16-point and 32-point DCT-2. Moreover, other transform kernels including 64-point DCT-2, 4-point DCT-8, 8-point, 16-point, 32-point DST-7 and DCT-8 use 8-bit main transform kernels.
[0338] Table 2-5. Transformation and signaling mapping table
[0339]
[0340]
[0341] To reduce the complexity of large-size DST-7 and DCT-8, high-frequency transform coefficients are zeroed for DST-7 and DCT-8 blocks with size (width or height, or both) equal to 32. Only coefficients in the 16×16 low-frequency region are retained.
[0342] As in HEVC, the residual of the block can be encoded and decoded with transform skip mode. To avoid redundancy in syntax encoding and decoding, the transform skip flag is not signaled when the CU level MTS_CU_flag is not equal to zero. The block size limit for transform skip is the same as MTS in JEM4, which indicates that transform skip applies to CUs with both block width and block height equal to or less than 32. Note that when LFNST or MIP is activated for the current CU, the implicit MTS transform is set to DCT2. Moreover, when MTS is enabled for inter-frame codec blocks, implicit MTS can still be enabled.
[0343] 2.1.1. Low-frequency non-separable transform (LFNST)
[0344] In VVC, Figure 7 As shown, LFNST (Low Frequency Non-separable Transform) is applied between the forward main transform and quantization (at the encoder) and between dequantization and the inverse main transform (at the decoder side), which is called a simplified auxiliary transform. In LFNST, 4×4 non-separable transform or 8×8 non-separable transform is adopted according to the block size. For example, 4×4 LFNST is applied to small blocks (i.e., min(width, height)<8), while 8×8 LFNST is applied to larger blocks (i.e., min(width, height)>4).
[0345] Figure 7 An example of a low frequency non-separable transform (LFNST) process is shown.
[0346] The following describes the application of the non-separable transformation used in LFNST, taking the input as an example. To apply 4×4 LFNST, the 4×4 input block X
[0347]
[0348] First, we represent it as a vector
[0349]
[0350] The non-separable transformation is calculated as in Indicates the transform coefficient vector, and T is a 16×16 transform matrix. Subsequently, the 16×1 coefficient vector is reorganized into 4×4 blocks using the scan order (horizontal, vertical, or diagonal) of the block. Coefficients with smaller indices are placed in the 4×4 coefficient block together with smaller scan indices.
[0351] 2.11.1 Simplified Non-Separable Transform
[0352] The LFNST (Low-Frequency Non-Separable Transform) applies a non-separable transform based on direct matrix multiplication to achieve it in a single pass without multiple iterations. However, it is necessary to reduce the dimension of the non-separable transform matrix to minimize the computational complexity and the storage spatial domain for storing the transform coefficients. Therefore, the Simplified Non-Separable Transform (or RST) method is used in the LFNST. The main idea of the Simplified Non-Separable Transform is to map an N-dimensional vector (N in the 8×8 NSST usually equals 64) to an R-dimensional vector in a different space, where N / R (R < N) is the reduction factor. Thus, the RST matrix replaces the N×N matrix to become an R×N matrix as shown below:
[0353]
[0354] Where the R rows of the transform are the R basis of the N-dimensional space. The inverse transform matrix of RT is the transpose of its forward transform. For 8×8 LFNST, a reduction factor of 4 is adopted to reduce the traditional 8×8 non-separable transform matrix size 64×64 direct matrix to a 16×48 direct matrix. Therefore, a 48×16 inverse RST matrix is used on the decoder side to generate the core (main) transform coefficients of the 8×8 upper left region. When a 16×48 matrix with the same transform set configuration is used instead of a 16×64 matrix, each matrix takes 48 input data from three 4×4 blocks in the upper left 8×8 block excluding the lower right 4×4 block. With the help of dimensionality reduction, the memory footprint of storing all LFNST matrices is reduced from 10KB to 8KB, and the performance degradation is reasonable. In order to reduce complexity, LFNST is restricted to be applicable only when all coefficients outside the first coefficient subgroup are non-significant. Therefore, when LFNST is applied, all main transform coefficients must be zero. This allows for the regulation of LFNST index signaling at the least significant position, thus avoiding the extra coefficient scans required in the current LFNST design to check for significant coefficients only at specific positions. The worst-case handling of LFNST (in terms of multiplications per pixel) limits the inseparable transforms for 4×4 and 8×8 blocks to 8×16 and 8×48 transforms, respectively. In these cases, the least significant scan position must be less than 8 when applying LFNST, and less than 16 for other sizes. For blocks of shape 4×n and N×4 with N>8, the proposed restrictions mean that LFNST is now applied only once and only to the top-left 4×4 region. When applying LFNST, the number of operations required for the main transform is reduced in this case since all main-only coefficients are zero. From the encoder perspective, the quantization of coefficients is significantly simplified when testing the LFNST transform. The first 16 coefficients (in scan order) must be quantized with maximum rate distortion optimization, and the remaining coefficients are forced to zero.
[0355] 2.11.2. LFNST Transform Selection
[0356] A total of 4 transform sets are used in LFNST, each using 2 inseparable transform matrices (kernels). The mapping from intra prediction modes to transform sets is predefined as shown in Table 2-6. If one of the three CCLM modes (INTRA_LT_CCLM, INTRA_T_CCLM, or INTRA_L_CCLM) is used for the current block (81 <= predModeIntra <= 83), transform set 0 is selected for the current chroma block. For each transform set, the selected inseparable auxiliary transform candidate is further specified by the LFNST index that is explicitly signaled. The index is signaled once in the bitstream for each CU after the transform coefficients.
[0357] Table 2-6. Transformation selection table
[0358] IntraPredMode Tr set index IntraPredMode<0 1 0<=IntraPredMode<=1 0 2<=IntraPredMode<=12 1 13<=IntraPredMode<=23 2 24<=IntraPredMode<=44 3 45<=IntraPredMode<=55 2 56<=IntraPredMode<=80 1 81<=IntraPredMode<=83 0
[0359] 2.11.3.LFNST index signaling and its interaction with other tools
[0360] Since LFNST is restricted to be applicable only when all coefficients outside the first coefficient subgroup are non-significant, the LFNST index encoding depends on the position of the last significant coefficient. In addition, the LFNST index is context-encoded, but does not depend on the intra prediction mode, and only the first binary number is context-encoded. In addition, LFNST is applied to intra CUs in both intra and inter slices and for both luma and chroma. If binary tree is enabled, the LFNST indexes for luma and chroma are signaled separately. For inter slices (binary tree disabled), a single LFNST index is signaled and used for both luma and chroma.
[0361] When ISP mode is selected, LFNST is disabled and the RST index is not signaled, because even if RST is applied to every feasible partition block, the performance improvement is minimal. In addition, disabling RST for ISP prediction residuals can reduce coding complexity. When MIP mode is selected, LFNST is also disabled and the index is not signaled.
[0362] Considering that larger CUs than 64×64 are implicitly split (TU tiling) due to the existing maximum transform size limit (64×64), LFNST index search can increase the data buffer by four times for a certain number of decoding pipeline stages. Therefore, the maximum size allowed by LFNST is limited to 64×64. Note that LFNST is only enabled in DCT2.
[0363] 2.12. Transform Skip for Chroma
[0364] Chroma Transform Skip (TS) was introduced in VVC. The motivation was to unify TS and MTS signaling between luma and chroma by relocating transform_skip_flag and mts_idx to the residual_coding part. A context model was added for the chroma TS. The context model and binarization were not changed for mts_idx. In addition, TS residual coding is also applied when using chroma TS.
[0365] Semantics
[0366] transform_skip_flag[x0][y0][cIdx] specifies whether a transform is applied to the associated luma transform block. Array indexes x0, y0 specify the position (x0, y0) of the top-left luma sample of the transform block under consideration relative to the top-left luma sample of the picture. transform_skip_flag[x0][y0][cIdx] equal to 1 specifies that no transform is applied to the current luma transform block. Array index cIdx specifies the indicator of the color component; equal to 0 for luma, 1 for Cb, and 2 for Cr. transform_skip_flag[x0][y0][cIdx] equal to 0 specifies that whether a transform is applied to the current transform block depends on other syntax elements. When transform_skip_flag[x0][y0][cIdx] is not present, it is inferred to be equal to 0.
[0367] BDPCM for Chroma
[0368] In addition to the chroma TS support, BDPCM is added to the chroma component. If sps_bdpcm_enable_flag is 1, another syntax element sps_bdpcm_chroma_enable_flag is added to the SPS. These flags have the following behavior, as shown in Table 2-7.
[0369] Table 2-7. SPS flags for luminance and chrominance BDPCM
[0370]
[0371] When BDPCM is only applied to luma, the current behavior is unchanged. When BDPCM can also be used for chroma, bdpcm_chroma_flag is sent for each chroma block. This indicates whether BDPCM is used on the chroma block. When it is enabled, BDPCM is used for both chroma components and an additional bdpcm_dir_chroma flag is encoded, indicating the prediction direction for both chroma components.
[0372] The deblocking filter is deactivated on the boundary between two Block-DPCM blocks, since neither block uses the transform stage that is usually responsible for blocking artifacts. This deactivation occurs independently for the luma and chroma components.
[0373] 3. Examples of technical problems solved by the disclosed solutions
[0374] The current design of linear parameter derivation in CCLM and TS has the following problems:
[0375] 1. For non-4:4:4 color formats, the derivation of linear parameters in CCLM involves adjacent chroma samples and downsampled co-located adjacent luminance samples. Figure 8 As shown, in the current VVC, when the nearest row is not at the CTU boundary, the second row above the current block of the 4:2:2 video is used to derive the downsampled co-located adjacent top luma sample. However, for 4:2:2 video, the vertical resolution is unchanged. Therefore, there is a phase shift between the downsampled co-located adjacent top luma sample and the adjacent chroma samples.
[0376] Figure 8 An example of adjacent chroma samples and down-sampled co-located adjacent luma samples used in the derivation of CCLM parameters for 4:2:2 video is shown.
[0377] 2. In the current VVC, for the signaling of the luma transform skip flag and the signaling of the chroma transform skip flag, the same maximum block size is used in the conditional check. Such a design does not take the color format into consideration, which is undesirable.
[0378] a. A similar problem exists for the signaling of the luma BDPCM flag and the signaling of the chroma BDPCM flag, where the same maximum block size is used in the conditional check.
[0379] 3. In the VVC specified in JVET-Q2001-vE, the left neighboring samples are put into the selected neighboring sample list before the upper neighboring samples. However, it may be better to put the upper neighboring samples before the left neighboring samples.
[0380] 4. In the VVC specified in JVET-Q2001-vE, two adjacent rows of luma samples are allocated. However, when sps_chroma_vertical_collocated_flag is equal to 1, three adjacent rows of luma samples are required.
[0381] 5. In VVC specified in JVET-Q2001-vE, when the left neighboring luma samples are not available, the left neighboring luma samples are filled with the leftmost samples of the current block, and the top neighboring luma samples are filled with the top left neighboring luma samples. However, the top neighboring luma samples have not been derived. For example, in JVET-Q2001-VE.
[0382] "— When availL is equal to FALSE, the adjacent left luma sample pY[x][y] with x = -1..-3, y = -1..SubHeightC×numSampL-1 is set equal to the luma sample pY[0][y]. — When numSampT is greater than 0, the adjacent top luma sample pY[x][y] with x = 0..SubWidthC×numSampT-1, y = -1..-2 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y)."
[0383] 6. In VVC specified in JVET-Q2001-vE, when the top (or / and left) neighboring luma samples are not available, they are incorrectly derived. For example, in JVET-Q2001-vE, "When availT is equal to FALSE, the neighboring top luma sample pY[x][y] where x=-1..SubWidthC×numSampT-1, y=-1..-2 is set equal to luma sample pY[x][0]" is used to derive the top neighboring luma samples when they are not available. However, when the top neighboring luma sample is not available, numSampT is set to 0.
[0384] 7. In the current VVC, when the top and left neighboring brightness samples are available, the top left neighboring brightness sample is used for the derivation of CCLM parameters, but when the top and left neighboring brightness samples are in different strips (for example, in the case of raster strips), the top left neighboring brightness sample is not available.
[0385] 4. List of Examples and Techniques
[0386] The following list should be considered as examples to explain the general concepts. These items should not be interpreted narrowly. Furthermore, these items can be combined in any way.
[0387] In this article, the term "CCLM" refers to a codec tool that uses cross-color component information to predict the samples / residues of the current color component or derive the reconstruction of the samples in the current color component. It is not limited to the CCLM technology described in VVC.
[0388] Derivation of linear parameters in CCLM
[0389] 1. When deriving CCLM parameters for a chroma block, one or more upper neighboring rows of its co-located luma block may be used to derive its downsampled co-located top luma samples.
[0390] a. In one example, when the current chroma block is not at the top CTU boundary, the nearest upper row of the co-located luma block instead of the second row above can be used to derive the downsampled co-located adjacent top luma samples.
[0391] i. In one example, one and the same downsampling filter can be used to derive the downsampled co-located adjacent top luma samples and the downsampled co-located adjacent left luma samples.
[0392] 1) For example, a [1 2 1] filter 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 the luminance samples from the nearest upper adjacent row, and pDsY[x] represents the downsampled co-located adjacent top luminance sample.
[0393] ii. In one example, different downsampling filters (eg, different filter taps / different filter coefficients) may be used to derive the downsampled co-located adjacent top luma samples and the downsampled co-located adjacent left luma samples.
[0394] iii. In one example, a same downsampling filter may be used to derive the downsampled co-located adjacent top luma samples regardless of the location of the chroma blocks (eg, the chroma blocks may or may not be at the top CTU boundary).
[0395] iv. In one example, the above method can be applied only to pictures / videos in 4:2:2 format.
[0396] b. In one example, when the current chroma block is not at the top CTU boundary, the above-neighboring luma samples, including the nearest above row of the co-located luma block but excluding the second row above, can be used to derive the downsampled co-located top luma samples.
[0397] c. In one example, the derivation of downsampled co-located adjacent top luma samples may rely on samples located at multiple rows.
[0398] i. In one example, it may rely on the second nearest row and the nearest row above the co-located luma block.
[0399] ii. In one example, for different color formats (eg, 4:2:0 and 4:2:2), a same downsampling filter may be used to derive downsampled co-located adjacent top luma samples.
[0400] 1) In one example, a 6-tap filter (eg, [1 2 1; 1 2 1]) may be used.
[0401] a) In one example, the downsampled co-located adjacent top luma sample may be derived as: pDsY[x] = (pY[2×x-1][-2]+2×pY[2×x][-2]+pY[2×x-1][-1]+2×pY[2×x][-1]+pY[2×x+1][-1]+pY[2×x+1][-1]+4)>>3, where pY is the corresponding luma sample and pDsY[x] represents the downsampled co-located adjacent top luma sample.
[0402] b) Alternatively, also when sps_cclm_colocated_chroma_flag is equal to 0, the above method may be applied.
[0403] 2) In one example, a 5-tap filter may be used (eg, [0 1 0; 1 4 1; 0 1 0]).
[0404] a) In one example, the downsampled co-located adjacent top luma sample may be derived as: pDsY[x]=(pY[2×x][-2]+pY[2×x][-1]+4×pY[2×x][-1]+pY[2×x+1][-1]+pY[2×x][0]+4)>>3, where pY is the corresponding luma sample and pDsY[x] represents the downsampled co-located adjacent top luma sample.
[0405] b) Alternatively, also when sps_cclm_colocated_chroma_flag is equal to 1, the above method may be applied.
[0406] iii. In one example, the above method may only be applied to pictures / videos in 4:2:2 format.
[0407] Change the maximum block size for skipping codec blocks (e.g. in case of transform_skip_flag equal to 1, or in BDPCM or other modes that skip transform processing / use a signature transform)
[0408] 2. The maximum block size of a transform skip codec block may depend on the color component. The maximum block size of a transform skip codec block for luma and chroma is represented by MaxTsSizeY and MaxTsSizeC, respectively.
[0409] a. In one example, the maximum block sizes for luma and chroma components may be different.
[0410] b. In one example, the maximum block size for the two chroma components may be different.
[0411] c. In one example, the maximum block size for luma and chroma components or for each color component may be signaled separately.
[0412] i. In one example, MaxTsSizeC / MaxTsSizeY may be signaled at the sequence level / picture level / slice level / slice group level, such as in the sequence header / picture header / SPS / VPS / DPS / PPS / APS / slice header / slice group header.
[0413] ii. In one example, MaxTsSizeY may be signaled conditionally, such as depending on whether transform skip is enabled / BDPCM is enabled.
[0414] iii. In one example, MaxTsSizeC may be signaled conditionally, such as depending on color format / transform skip enabled / BDPCM enabled.
[0415] iv. Alternatively, a predictive codec between the maximum block sizes for luma and chroma components may be used.
[0416] d. In one example, MaxTsSizeC may depend on MaxTsSizeY.
[0417] i. In one example, MaxTsSizeC may be set equal to MaxTsSizeY.
[0418] ii. In one example, MaxTsSizeC may be set equal to MaxTsSizeY / N (N is an integer). For example, N=2.
[0419] e. In one example, MaxTsSizeC may be set according to the chroma subsampling ratio.
[0420] i. In one example, MaxTsSizeC is set equal to MaxTsSizeY>>SubWidthC, where SubWidthC is defined in Table 2-1.
[0421] ii. In one example, MaxTsSizeC is set equal to MaxTsSizeY>>SubHeightC, where SubHeightC is defined in Table 2-1.
[0422] iii. In one example, MaxTsSizeC is set equal to MaxTsSizeY>>max(SubWidthC, SubHeightC).
[0423] iv. In one example, MaxTsSizeC is set equal to MaxTsSizeY>>min(SubWidthC, SubHeightC).
[0424] 3. The maximum allowed block size, width and height of transform codec blocks can be defined differently.
[0425] a. In one example, the maximum allowed block size width and height may be signaled separately.
[0426] b. In one example, the maximum allowed block size width and height of the chroma transform codec block can be represented as MaxTsSizeWC and MaxTsSizeHC, respectively. MaxTsSizeWC can be set equal to MaxTsSizeY>>SubWidthC, and MaxTsSizeHC can be set equal to MaxTsSizeY>>SubHeightC.
[0427] i. In one example, MaxTsSizeY is that defined in bullet 2.
[0428] 4. Whether to signal the transform skip flag for chroma blocks (eg, transform_skip_flag[x0][y0][1] and / or transform_skip_flag[x0][y0][2]) may depend on the maximum allowed size of the chroma transform skip codec block.
[0429] a. In one example, the chroma transform skip flag may be conditionally signaled based on the following conditions:
[0430] i. In one example, the condition is: tbW is less than or equal to MaxTsSizeC and tbH is less than or equal to MaxTsSizeC, where tbW and tbH are the width and height of the current chroma block.
[0431] 1) In one example, MaxTsSizeC may be defined as that in bullet points 2-3.
[0432] ii. In one example, the condition is: tbW is less than or equal to MaxTsSizeWC and tbH is less than or equal to MaxTsSizeHC, where tbW and tbH are the width and height of the current chroma block, and MaxTsSizeWC and MaxTsSizeHC represent the maximum allowed block size width and height of the chroma transform skip codec block, respectively.
[0433] 1) In one example, MaxTsSizeWC and / or MaxTsSizeHC may be defined as that in bullet point 3.
[0434] b. In one example, the above method can be applied to the encoding and decoding of the chroma BDPCM flag (eg, intra_bdpcm_chroma_flag) by replacing "transform skip" with "BDPCM".
[0435] 5. It is proposed to use one syntax to indicate the use of TS for two chrominance color components, instead of encoding and decoding two TS flags for two chrominance color components.
[0436] a. In one example, instead of encoding and decoding transform_skip_flag[x0][y0][1] and / or transform_skip_flag[x0][y0][2]), a single syntax element (eg, TS_chroma_flag) may be encoded and decoded.
[0437] i. In one example, the value of a single syntax element is a binary value.
[0438] 1) In addition, alternatively, two chroma component blocks share the same TS mode on / off control according to a single syntax element.
[0439] a) In one example, a single syntax element with a value equal to 0 indicates that TS is disabled for both.
[0440] b) In one example, a single syntax element with a value equal to 0 indicates that TS is enabled for both.
[0441] 2) In addition, alternatively, the second syntax element may be further signaled based on whether the value of the single syntax element is equal to K (eg, K=1).
[0442] a) In one example, a single syntax element value equal to 0 indicates that TS is disabled for both; a single syntax element value equal to 0 indicates that TS is enabled for at least one of the two chroma components.
[0443] b) The second syntax element may be used to indicate which of the two chroma components the TS is applied to and / or whether the TS is applied to both of them.
[0444] ii. In one example, the value of a single syntax element is a non-binary value.
[0445] 1) In one example, a single syntax element with a value equal to K0 indicates that TS is disabled for both.
[0446] 2) In one example, a single syntax element with a value equal to K1 indicates that TS is enabled for the first chroma color component and disabled for the second color component.
[0447] 3) In one example, a single syntax element having a value equal to K2 indicates that TS is disabled for a first chroma color component and enabled for a second color component.
[0448] 4) In one example, a single syntax element with a value equal to K3 indicates that TS is enabled for both.
[0449] 5) In one example, a single syntax element may be encoded or decoded using fixed length, unary, truncated unary, k-order EG binarization methods.
[0450] iii. In one example, the single syntax element and / or the second syntax element may be context coded or bypass coded.
[0451] General Statement
[0452] 6. Whether and / or how to apply the above disclosed method may be signaled at the sequence level / picture level / slice level / slice group level, such as in the sequence header / picture header / SPS / VPS / DPS / PPS / APS / slice header / slice group header.
[0453] 7. Whether and / or how to apply the above disclosed method depends on the codec information, such as color format, single tree / binary tree partitioning.
[0454] Additional statement to CCLM
[0455] 8. In the CCLM parameter derivation process, the upper adjacent sample point is placed in the selected adjacent sample point list before the left adjacent sample point, and the selected adjacent sample point list is used to derive CCLM parameters (for example, using a 4-point derivation method, where 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 demonstrated in Example 5.
[0456] 9. During the CCLM parameter derivation process, when the downsampled upper adjacent luminance sample represented as pSelDsY[idx] is obtained, the index value idx should be in the range of cntL to cntL+cntT-1, where cntL and cntT respectively represent the number of left adjacent chroma samples and upper adjacent chroma samples used to derive the CCLM parameters.
[0457] a. An example is demonstrated in Example 5.
[0458] b. Additionally, alternatively, the left neighboring sample point is placed in the selected neighboring sample point list before the upper neighboring sample point.
[0459] 10. In the CCLM parameter derivation process, three rows of upper adjacent luminance samples are allocated. An example is demonstrated in Embodiment 6.
[0460] 11. In the process of CCLM parameter derivation, T is assigned 1 Row and T 2 The upper left adjacent brightness sample of the column.
[0461] a. In one example, T 1 =2 and T 2 = 2. An example is demonstrated in Example 12.
[0462] b. In one example, T 1 =3 and T 2 =3.
[0463] 12. During CCLM parameter derivation, the number of rows of upper luma neighboring samples to allocate may depend on a variable or syntax element indicating whether the chroma sample positions are not vertically shifted relative to the corresponding luma sample positions, such as sps_chroma_vertical_collocated_flag in JVET-Q2001-vE.
[0464] a. In one example, when sps_chroma_vertical_collocated_flag is equal to 1, three rows of upper adjacent luma samples are allocated. Otherwise, two rows of upper adjacent luma samples are allocated. An example is demonstrated in Embodiment 7.
[0465] 13. In the above example, the adjacent luminance samples may be adjacent luminance samples before downsampling or adjacent luminance samples after downsampling.
[0466] 14. In the CCLM parameter derivation process, whether and / or how to fill the upper left neighboring sample points may depend on the availability of at least one of the upper left neighboring sample points, rather than the availability of the left neighboring sample points and / or the upper neighboring sample points.
[0467] 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.
[0468] i. In addition, the above-mentioned strips can be rectangular strips or non-rectangular strips.
[0469] b. In one example, if at least one of the upper left neighboring sample and the samples in the current block are in different slices, the upper left neighboring sample is padded.
[0470] c. In one example, if the availability of at least one upper left neighboring sample point is false, fill the upper left neighboring sample point.
[0471] 15. During the CCLM parameter derivation process, when the upper left adjacent luminance samples are "unavailable", they may not be used.
[0472] a. In one example, a neighboring sample is "unavailable" if it is outside the current picture, or current sub-picture, or current slice, or current slice, or current tile, or current CTU, or current processing unit, or any other current video unit.
[0473] i. In one example, for Fig.13 For the non-rectangular stripe case shown, the top left adjacent luma sample that is in a different stripe than the current block is "unavailable".
[0474] b. In one example, whether the top-left neighboring luma samples are used in the CCLM process may depend on whether they are in the same picture / sub-picture / slice / strip / brick / CTU / processing unit / other video unit as the current block.
[0475] i. In one example, when the top left neighboring luma samples are located in a different raster strip than the current block, they may not be used in the CCLM process.
[0476] 1) An example is demonstrated in Example 10.
[0477] ii. In one example, the top left neighboring luma samples may not be used in the CCLM process even though they are in the same picture / sub-picture / slice / strip / brick / CTU / processing unit / other video unit as the current block.
[0478] c. In the CCLM parameter derivation process, when the upper left adjacent luma sample is "unavailable", repeated padding can be used to generate the upper left adjacent luma sample. Denote the upper left sample position of the current block by (x, y). Denote the reconstructed luma sample before the deblocking filter process by pY[i][j]. Denote the padded upper 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.
[0479] i. In one example, when left or / and top adjacent luma samples are available, a repetition filling method can be used.
[0480] ii. In one example, when the top-neighboring luma samples are available, the top-left-neighboring luma samples may be filled from the top-neighboring luma samples.
[0481] 2) In one example, pD[m][n]=pY[x][n].
[0482] iii. In one example, when the left adjacent luma samples are available, the top left adjacent luma samples may be filled from the left adjacent luma samples.
[0483] 3) In one example, pD[m][n]=pY[m][y].
[0484] iv. In one example, when the top-neighboring luma samples are available and the left-neighboring luma samples are available, the top-left-neighboring luma samples may be filled from the top-neighboring luma samples.
[0485] 4) In one example, pD[m][n]=pY[x][n].
[0486] v. Alternatively, when the top-neighboring luma samples are available and the left-neighboring luma samples are available, the top-left-neighboring luma samples may be filled from the left-neighboring luma samples.
[0487] 5) In one example, pD[m][n]=pY[m][y].
[0488] vi. In one example, M=2, N=2, or M=3, N=3.
[0489] d. Alternatively, when the top left adjacent luma samples are "unavailable", they can be replaced by predefined values.
[0490] i. In one example, the predetermined value may be equal to a constant value, such as 128.
[0491] ii. In one example, the predefined value may be derived using the left or / and top neighboring luma samples.
[0492] 6) In one example, the predefined value may be equal to the average value of the adjacent brightness samples on the left or / and the top.
[0493] 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.
[0494] e. Alternatively, even if the upper left adjacent luma sample is "available", the above-mentioned filling method in bullet 14.c and the predefined value in bullet 14.d may be used to replace the available upper left adjacent luma sample.
[0495] i. An example is demonstrated in Example 11.
[0496] f. In one example, whether to check the availability of the top left neighboring luma sample may depend on whether the left neighboring luma sample is available or / and whether the top neighboring luma sample is available.
[0497] i. In one example, the availability of the top left neighboring luma sample is checked only when both the left neighboring luma sample and the top neighboring luma sample are available. An example is shown in Embodiment 17.
[0498] g. In one example, whether and / or how to use or / and fill the top left neighboring luma samples may depend on the availability of the top left, or / and left, or / and top neighboring luma samples.
[0499] i. In one example, the top-left neighboring luma sample can be used only if the top-left neighboring luma sample is available.
[0500] ii. In one example, the top-left adjacent luma sample can be used only when the top-left, left-side and top adjacent luma samples are available. An example is shown in Embodiment 18.
[0501] iii. In one example, when left and / or top neighboring luma samples are available, the top left neighboring luma samples may be filled.
[0502] 1) In one example, the top-left neighboring luma samples may be filled only if the left or top neighboring luma samples are available and the top-left neighboring luma samples are not available.
[0503] 2) In one example, the top-left neighboring luma sample may be filled only if the left and top neighboring luma samples are available and the top-left neighboring luma sample is not available.
[0504] 3) In one example, the top adjacent luma sample may be used to fill the top left adjacent luma sample. The top left adjacent luma sample pY[x][y] where x=-1,-2, y=-1,-2 is set equal to the luma sample pY[0][y]. An example is shown in Example 18.
[0505] 4) In one example, the top adjacent luma sample can be used to fill the upper left adjacent luma sample. The upper left adjacent luma sample pY[x][y] of x=-1,-2, y=-1,-2 is set equal to the luma sample pY[x][0]. An example is shown in Example 19.
[0506] 5) In one example, the top and left neighboring luma samples may be used to fill the top left neighboring luma samples.
[0507] h. In one example, whether to check the availability of the upper left neighboring luma sample, or / and use the upper left neighboring luma sample, or / and fill the upper left neighboring luma sample may depend on the chroma color format.
[0508] i. In one example, when using a 4:4:4 color format, there is no need to check the availability of the upper left adjacent luma sample, or / and use the upper left adjacent luma sample, or / and fill the upper left adjacent luma sample. An example is shown in Embodiment 20.
[0509] i. In one example, whether to fill the upper left adjacent luma sample and / or which samples need to be filled may depend on a variable or syntax element indicating whether the chroma sample position is not vertically shifted relative to the corresponding luma sample position, such as sps_chroma_vertical_collocated_flag in JVET-Q2001-vE.
[0510] i. In one example, when sps_chroma_vertical_collocated_flag is equal to 1, the upper left adjacent luma samples are filled. Otherwise, the upper left adjacent samples are not filled. An example is demonstrated in Embodiment 14.
[0511] 16. In the CCLM process, when the top (or / and left) neighboring luma samples are not available, the top (or / and left) neighboring luma samples are derived using the topmost (or / and leftmost) samples of the current block. And the top-left neighboring samples can be derived using the left (or / and top) available neighboring luma samples. a. In one example, when the top neighboring luma samples are not available, the topmost samples and the left neighboring luma samples of the current block can be used to derive the top and top-left neighboring luma samples.
[0512] i. In one example, the top adjacent luma sample pY[x][y] where x=0..SubWidthC×nTbW-1, y=-1..-2 is set equal to luma sample pY[x][0]. And the top left adjacent luma sample pY[x][y] where x=-1, y=-1..-2 is set equal to 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.
[0513] ii. In one example, the top adjacent sample pY[x][y] where x=0..SubWidthC×nTbW-1, y=-1..-N is set equal to the luma sample pY[x][0]. And the top left adjacent luma sample pY[x][y] where x=-M..-1, y=-1..-N is set equal to the luma sample pY[x][0], where pY[0][0] represents the top left sample of the current block, nTbW represents the width of the current block, and SubWidthC is defined in 2.1. An example is demonstrated in Example 13.
[0514] 1) In one example, M and N are integers, such as M=2 and N=3.
[0515] 2) In one example, M may depend on the chroma color format, such as M=SubWidthC, which is defined in 2.1.
[0516] 3) In one example, a maximum of T top-left adjacent luma samples may be filled, where T is an integer (such as 1).
[0517] a) In one example, pY[-M][-1]=pY[-M][0], where M=1 or M=SubWidthC.
[0518] b. In one example, when the left-neighboring luma samples are not available, the leftmost sample and the top-neighboring luma samples of the current block may be used to derive the left and top-left-neighboring luma samples.
[0519] i. In one example, the left adjacent luma sample pY[x][y] where x=0..-3, y=-1..SubHeightC×nTbH-1 is set equal to the luma sample pY[0][y]. And the top left adjacent luma sample pY[x][y] where x=0..-3, y=-1 is set equal to the luma sample pY[0][y], where pY[0][0] represents the top left sample of the current block, nTbH represents the height of the current block, and SubHeightC is defined in 2.1.
[0520] ii. In one example, the left adjacent luma sample pY[x][y] where x=-1..-M, y=0..SubHeightC×nTbH-1 is set equal to the luma sample pY[0][y]. And the top left adjacent luma sample pY[x][y] where x=-1..-M, y=-1..-N is set equal to the luma sample pY[0][y], where pY[0][0] represents the top left sample of the current block, nTbH represents the height of the current block, and SubHeightC is defined in 2.1. An example is demonstrated in Example 15.
[0521] 1) In one example, M and N are integers, such as M=2, N=3.
[0522] 2) In one example, M may depend on the chroma color format, such as N=SubHeightC, which is defined in 2.1.
[0523] 3) In one example, a maximum of T top-left adjacent luma samples may be filled, where T is an integer (such as 1).
[0524] a) In one example, pY[-1][-N]=pY[0][-N], where N=1 or N=SubHeightC.
[0525] b) Alternatively, T is equal to 2. pY[-1][-1]=pY[0][-1], pY[-1][-2]=pY[0][-2].
[0526] iii. In one example, the top left luma neighboring samples may be filled after the top luma neighboring samples are derived. An example is demonstrated in Embodiment 16.
[0527] c. In one example, in the process of filling the top (or / and left) neighboring luma samples, the top left neighboring luma samples derived in item 13 may be used.
[0528] d. In one example, whether to fill the top (or / and left) adjacent luma (or chroma) samples and / or which adjacent samples need to be filled depends on the chroma color format.
[0529] i. In one example, when using a 4:4:4 color format, there is no need to fill the top (or / and left) adjacent luma samples. An example is shown in Embodiment 21.
[0530] e. In one example, when filling the top (or / and left) adjacent luma samples, the top left adjacent luma samples are filled using the method in 15 (such as 15.c). An example is shown in Embodiment 22.
[0531] 17. In the CCLM prediction process, the top adjacent samples, the left adjacent samples and the upper left adjacent samples can be filled in a fixed order. The adjacent samples can be luminance samples or chrominance samples.
[0532] a. For example, the order may be top adjacent sample point fill, left adjacent sample point fill, and upper left adjacent sample point fill.
[0533] b. For example, the order may be left adjacent fill, top adjacent sample point fill, and top left adjacent sample point fill.
[0534] c. For example, the order may be upper left adjacent fill, top adjacent sample point fill, and left adjacent sample point fill.
[0535] d. For example, the order may be top left adjacent fill, left adjacent sample point fill, and top adjacent sample point fill.
[0536] The downsampling process in CCLM for 18.4:2:2 color format video can be decoupled from a syntax element or variable (such as sps_chroma_vertical_collocated_flag in JVET-Q2001-vE) that indicates whether the chroma sample positions are vertically shifted relative to the corresponding luma sample positions.
[0537] a. In one example, the downsampling process may refer to downsampling the adjacent upper luma samples, or / and downsampling the adjacent left luma samples, or / and downsampling the samples in the current luma block.
[0538] b. In one example, whether sps_chroma_vertical_collocated_flag is equal to 1 or 0, a fixed filter (such as a 3-tap horizontal filter with coefficients [1 / 4, 2 / 4, 1 / 4] or [2 / 8, 4 / 8, 2 / 8]) can be used for the downsampling process in CCLM of 4:2:2 color format video. An example is shown in Example 27 and Example 28.
[0539] 19. In one example, a variable or syntax element indicating whether the chroma sample positions are vertically shifted relative to the corresponding luma sample positions (e.g., sps_chroma_vertical_collocated_flag in JVET-Q2001-vE) may be set to a default value, such as 0 or 1 for 4:2:2 and / or 4:4:4:4 color formats.
[0540] a. In one example, when sps_chroma_vertical_collocated_flag is not present, it can be inferred to be equal to 1.
[0541] b. In one example, when sps_chroma_vertical_collocated_flag is not present, it may be inferred to be equal to 0.
[0542] 20. In the CCLM process, the variable representing the adjacent brightness sample point can be used only when the variable is set to a valid value. An example is shown in Embodiment 29 and Embodiment 30.
[0543] a. In one example, the variable representing the neighboring upper luma sample may be set equal to the reconstructed luma sample before the deblocking filtering process.
[0544] i. In one example, when the adjacent above luma sample is available (e.g., availT is equal to true in JVET-Q2001-vE), the variable representing the adjacent above luma sample represented by pY[x][y] is set equal to the reconstructed luma sample before the deblocking filtering process at the position (xTbY+x, yTbY+y), where (xTbY, yTbY) represents the upper left position of the current block.
[0545] 1) In one example, x and y can be in the range of x=0...SubWidthC×max(numSampT, nTbW)-1, y=-1, -2, where nTbW represents the width of the current block, and SubWidthC is defined in 2.1, and numSampT indicates the number of adjacent chroma samples available at the top and upper right, and is defined in JVET-Q2001-vE.
[0546] b. In one example, the variable representing the neighboring left luma sample may be set equal to the reconstructed luma sample before the deblocking filtering process.
[0547] i. In one example, when the adjacent left luma sample is available (e.g., availL is equal to true in JVET-Q2001-vE), the variable representing the adjacent left luma sample represented by pY[x][y] is set equal to the reconstructed luma sample before the deblocking filtering process at the position (xTbY+x, yTbY+y), where (xTbY, yTbY) represents the upper left position of the current block.
[0548] 1) In one example, x and y can be in the range of x=-1..-3, y=0..SubHeightC×max(numSampL,nTbH)-1, where nTbH represents the width of the current block, and SubHeightC is defined in 2.1, and numSampL indicates the number of adjacent chroma samples available on the left and bottom left, and is defined in JVET-Q2001-vE.
[0549] 21. The slice type of a slice may depend on the reference picture entries of the slice.
[0550] a. In one example, if the number of reference picture entries of list 0 is equal to 0, and the number of reference picture entries of list 1 is equal to 0, then the slice type must be an I slice.
[0551] i. In one example, the slice type is not signaled in this case.
[0552] b. In one example, if the number of reference picture entries of list 0 is greater than 0, and the number of reference picture entries of list 1 is equal to 0, then the slice type must be a P slice.
[0553] i. Alternatively, if the number of reference picture entries of list 0 is greater than 0, and the number of reference picture entries of list 1 is equal to 0, the slice type cannot be a B slice.
[0554] ii. In one example, the slice type is not signaled in this case.
[0555] c. The reference picture entries for a slice may be signaled or inferred before the slice type is signaled or inferred.
[0556] i. The reference picture entries for a slice may be signaled in the picture header associated with the picture.
[0557] 22. The total number of filters allowed in an APS or the total number of APSs may be limited according to coded information (such as the number of sub-pictures).
[0558] a. The total number of filters allowed in an APS may include the total number of ALFs in all APS NAL units with PUs, luma / chroma ALFs, and CC-ALFs in an APS.
[0559] b. The total number of filters allowed in an APS may include the total number of adaptive loop filter classes for luma components (or luma ALF filters), the total number of alternative filters for chroma components (chroma ALF filters), and / or the total number of cross-component filters in all APS NAL units with PUs.
[0560] c. APS is ALF APS / Zoom List APS / LMCS APS.
[0561] d. How to signal the APS ID, and / or the number of APSs to be used by the video unit depends on the number of restrictions.
[0562] 23. Conformant bitstreams shall follow the following rules: If BDPCM is enabled for a video unit (e.g., sequence / picture / slice / tile / sub-picture), symbol data hiding is disabled.
[0563] a. Alternatively, the conforming bitstream should follow the following rule, if symbol data hiding is enabled for a video unit (e.g., sequence / picture / slice / tile / sub-picture), then BDPCM is disabled.
[0564] 24. Conformant bitstreams shall follow the following rules: If transform skip / codec tools that only apply identity transforms are enabled for a video unit (e.g., sequence / picture / slice / tile / sub-picture), symbol data hiding is disabled.
[0565] a. Alternatively, the conforming bitstream should follow the following rule, if symbol data hiding is enabled for a video unit (e.g., sequence / picture / slice / tile / sub-picture), then only transform skipping / codec tools that identify transforms are applied are disabled.
[0566] 25. Conformant bitstreams should follow the following rules: If BDPCM is enabled for a video unit (e.g., sequence / picture / slice / tile / brick / sub-picture), DQ (dependent quantization) is disabled.
[0567] a. Alternatively, the conforming bitstream should follow the following rule, if DQ is enabled for a video unit (e.g., sequence / picture / slice / tile / sub-picture), then BDPCM is disabled.
[0568] 26. Conformant bitstreams shall follow the following rules: DQ (dependent quantization) is disabled if transform skip / codec tools that only apply the identified transform are enabled for a video unit (e.g., sequence / picture / slice / tile / sub-picture).
[0569] a. Alternatively, conforming bitstreams should follow the following rule, if DQ is enabled for a video unit (e.g., sequence / picture / slice / tile / sub-picture), then only transform skipping / codec tools that identify transforms are applied are disabled.
[0570] 5. Examples
[0571] This section shows example embodiments and methods of modifying the current VVC standard to describe these embodiments. Changes to the VVC specification are highlighted in bold and italics. Deleted text is marked with double brackets (e.g., [[a]] means deleting the character "a").
[0572] 5.1. Example 1
[0573] The working draft specified in JVET-P2001-v9 may be modified as follows.
[0574] 8.4.5.2.13 Specification of INTRA_LT_CCLM, INTRA_L_CCLM and INTRA_T_CCLM intra prediction modes
[0575] …
[0576] 3. The downsampled co-located luminance sample pDsY[x][y], where x = 0..nTbW-1, y = 0..nTbH-1, is derived as follows:
[0577] —If SubWidthC and SubHeightC are both equal to 1, then the following applies:
[0578] —pDsY[x][y], where x=1..nTbW-1, y=1..nTbH-1 is derived as follows:
[0579] pDstY[x][y]=pY[x][y] (8-159)
[0580] — Otherwise, the following applies:
[0581] —The one-dimensional filter coefficient arrays F1 and F2 and the two-dimensional filter coefficient arrays F3 and F4 are specified as follows.
[0582] F1[i]=1, where i=0..1 (8-160)
[0583] F2[0]=1,F2[1]=2,F2[2]=1 (8-161)
[0584] F3[i][j]=F4[i][j]=0, where i=0..2, j=0..2 (8-162)
[0585] — If SubWidthC and SubHeightC are both equal to 2, then the following applies:
[0586] F1[0]=1,F1[1]=1 (8-163)
[0587] F3[0][1]=1,F3[1][1]=4,F3[2][1]=1,F3[1][0]=1,F3[1][2]=1 (8-164)
[0588] F4[0][1]=1, F4[1][1]=2, F4[2][1]=1 (8-165)
[0589] F4[0][2]=1, F4[1][2]=2, F4[2][2]=1 (8-166)
[0590] — Otherwise, the following applies:
[0591] F1[0]=2,F1[1]=0 (8-167)
[0592] F3[1][1]=8 (8-168)
[0593] F4[0][1]=2, F4[1][1]=4, F4[2][1]=2, (8-169)
[0594] …
[0595] 5. When numSampT is greater than 0, the selected adjacent top chroma sample pSelC[idx] is set equal to p[pickPosT[idx-cntL]][-1], where idx=cntL..cntL+cntT-1, and the downsampled adjacent top luma sample pSelDsY[idx], where idx=0..cntL+cntT-1, is specified as follows:
[0596] …
[0597] - Otherwise (sps_cclm_colocated_chroma_flag is equal to 0), the following applies:
[0598] — If x is greater than 0, the following applies:
[0599] — If bCTUboundary is equal to FALSE, the following applies:
[0600]
[0601] — Otherwise (bCTUboundary is TRUE), the following applies:
[0602] pSelDsY[idx]=(F2[0]×pY[SubWidthC×x-1][-1]+
[0603] F2[1]×pY[SubWidthC×x][-1]+ (8-194)
[0604] F2[2]×pY[SubWidthC×x+1][-1]+2)>>2
[0605] — Otherwise (x is equal to 0), the following applies:
[0606] —If availTL is equal to TRUE and bCTUboundary is equal to FALSE, then the following applies:
[0607]
[0608] — Otherwise, if availTL is equal to TRUE and bCTUboundary is equal to TRUE, the following applies:
[0609] pSelDsY[idx]=(F2[0]×pY[-1][-1]+F2[1]×pY[0][-1]+
[0610] F2[2]×pY[1][-1]+2)>>2 (8-196)
[0611] — Otherwise, if availTL is equal to FALSE and bCTUboundary is equal to TRUE, the following applies:
[0612] pSelDsY[idx]=(F1[1]×pY[0][-2]+F1[0]×pY[0][-1]+1)>>1 (8-197)
[0613] — Otherwise (availTL is equal to FALSE and bCTUboundary is equal to TRUE), the following applies:
[0614] pSelDsY[idx]=pY[0][-1] (8-198)
[0615] …
[0616] 5.2. Example 2
[0617] This embodiment shows an example of performing chroma transform skip flag encoding and decoding according to the maximum allowed transform skip encoding and decoding block size. The working draft specified in JVET-P2001-v9 can be modified as follows.
[0618] 7.3.9.10 Transformation unit syntax
[0619] …
[0620]
[0621]
[0622] …
[0623] 5.3. Example 3
[0624] This embodiment shows an example of performing chroma BDPCM flag encoding and decoding according to the maximum allowed chroma transform skip encoding and decoding block size. The working draft specified in JVET-P2001-v9 can be modified as follows.
[0625] 7.3.9.5 Codec unit syntax
[0626] …
[0627]
[0628]
[0629] …
[0630] 5.4. Example 4
[0631] The working draft specified in JVET-Q2001-vE may be modified as follows. 8.4.5.2.13
[0633] The inputs to this process are:
[0634] —Intra prediction mode predModeIntra,
[0635] - the sample position of the upper left sample of the current transform block relative to the upper left sample of the current picture (xTbC, yTbC),
[0636] - variable nTbW specifying the transform block width,
[0637] - variable nTbH specifying the transform block height,
[0638] — variable cIdx that specifies the color component of the current block,
[0639] - Chroma neighboring samples p[x][y], where x=-1, y=0..2×nTbH-1, and x=0..2×nTbW-1, y=-1.
[0640] The output of this process is the predicted samples predSamples[x][y], where x=0..nTbW-1, y=0..nTbH-1.
[0641] The current brightness position (xTbY, yTbY) is derived as follows:
[0642] (xTbY, yTbY) = (xTbC<<(SubWidthC-1), yTbC<<(SubHeightC-1)) (351)
[0643] The variables availL, availT, and availTL are derived as follows:
[0644] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using as input the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY-1, yTbY), checkPredModeY set equal to false (FLASE), and cIdx, and assign the output to availL.
[0645] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using as input the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY, yTbY-1), checkPredModeY set equal to false (FLASE), and cIdx, and assign the output to availT.
[0646] —The variable availTL is derived as follows:
[0647] availTL=availL&&availT (352)
[0648] —The number of available top-right adjacent chroma samples numTopRight is derived as follows:
[0649] —The variable numTopRight is set to 0, and availTR is set to TRUE.
[0650] - When predModeIntra is equal to INTRA_T_CCLM, the following applies for x=nTbW..2×nTbW-1 until availTR is equal to FALSE or x is equal to 2×nTbW-1:
[0651] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using as input the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY+x, yTbY-1), checkPredModeY set equal to false (FLASE), and cIdx, and assign the output to availTR.
[0652] —When availTR is equal to TRUE, numTopRight is increased by 1.
[0653] —The number of available lower left adjacent chroma samples numLeftBelow is derived as follows:
[0654] —The variable numLeftBelow is set to 0, and availLB is set to TRUE.
[0655] - When predModeIntra is equal to INTRA_L_CCLM, the following applies for y=nTbH..2×nTbH-1 until availLB is equal to FALSE or y is equal to 2×nTbH-1:
[0656] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using as input the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY-1, yTbY+y), checkPredModeY set equal to false (FLASE), and cIdx, and assign the output to availLB.
[0657] —When availLB is equal to TRUE, numLeftBelow is increased by 1.
[0658] The number of available adjacent chroma samples numSampT at the top and upper right and the number of available adjacent chroma samples numSampL at the left and lower left are derived as follows:
[0659] — If predModeIntra is equal to INTRA_LT_CCLM, the following applies:
[0660] numSampT=availT? nTbW:0 (353)
[0661] numSampL=availL? nTbH:0 (354)
[0662] — Otherwise, the following applies:
[0663] numSampT=(availT&&predModeIntra==INTRA_T_CCLM)? (nTbW+Min(numTopRight,nTbH)):0 (355)
[0664] numSampL=(availL&&predModeIntra==INTRA_L_CCLM)? (nTbH+Min(numLeftBelow,nTbW)):0 (356)
[0665] The variable bCTUboundary is derived as follows:
[0666] bCTUboundary=(yTbY&(CtbSizeY-1)==0)? TRUE:FALSE (357)
[0667] The variable cntN and array pickPosN where N is replaced by L and T are derived as follows:
[0668] —The variable numIs4N is derived as follows:
[0669] numIs4N=((availT&&availL&&predModeIntra==INTRA_LT_CCLM)?0:1) (358)
[0670] —The variable startPosN is set equal to numSampN>>(2+numIs4N).
[0671] —The variable pickStepN is set equal to Max(1, numSampN>>(1+numIs4N)).
[0672] —If availN is equal to TRUE and predModeIntra is equal to INTRA_LT_CCLM or INTRA_N_CCLM, the following assignments are made:
[0673] —cntN is set equal to Min(numSampN, (1+numIs4N)<<1).
[0674] —pickPosN[pos] is set equal to (startPosN+pos×pickStepN), where pos=0..cntN-1.
[0675] Otherwise, cntN is set equal to 0.
[0676] The predicted sample predSample[x][y], where x = 0..nTbW-1, y = 0..nTbH-1, is derived as follows:
[0677] — If numSampL and numSampT are both equal to 0, the following applies:
[0678] predSamples[x][y]=1<<(BitDepth-1) (359)
[0679] — Otherwise, the following ordered steps apply:
[0680] 1. The co-located luma sample pY[x][y] where x=0..nTbW×SubWidthC-1, y=0..TbH×SubHeightC-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).
[0681] 2. The adjacent brightness samples pY[x][y] are derived as follows:
[0682] —When numSampL is greater than 0, the adjacent left luma sample pY[x][y] where x=-1..-3, y=0..SubHeightC×numSampL-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).
[0683] - When availT is equal to FALSE, the adjacent top luma sample pY[x][y] where x = -1..SubWidthC×numSampT-1, y = -1..-2 is set equal to luma sample pY[x][0].
[0684] - When availL is equal to FALSE, the adjacent left luma sample pY[x][y] where x = -1..-3, y = -1..SubHeightC×numSampL-1 is set equal to luma sample pY[0][y].
[0685] —When numSampT is greater than 0, the adjacent top luma sample pY[x][y] where x=0..SubWidthC×numSampT-1, y=-1..-2 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).
[0686] —When availTL is equal to true (TRUE), the adjacent upper left luma sample pY[x][y] where x=-1, y=-1, -2 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).
[0687] 3. The downsampled co-located luminance sample pDsY[x][y], x=0..nTbW-1, y=0..nTbH-1 is derived as follows:
[0688] —If SubWidthC and SubHeightC are both equal to 1, then the following applies:
[0689] —pDsY[x][y], where x=1..nTbW-1, y=1..nTbH-1 is derived as follows:
[0690] pDstY[x][y]=pY[x][y] (360)
[0691] — Otherwise, the following applies:
[0692] —The one-dimensional filter coefficient arrays F1 and F2 and the two-dimensional filter coefficient arrays F3 and F4 are specified as follows.
[0693] F1[0]=2,F1[1]=0 (361)
[0694] F2[0]=1,F2[1]=2,F2[2]=1 (362)
[0695] F3[i][j]=F4[i][j]=0, where i=0..2, j=0..2 (363)
[0696] — If SubWidthC and SubHeightC are both equal to 2, then the following applies:
[0697] F1[0]=1,F1[1]=1 (364)
[0698] F3[0][1]=1,F3[1][1]=4,F3[2][1]=1,F3[1][0]=1,F3[1][2]=1 (365)
[0699] F4[0][1]=1,F4[1][1]=2,F4[2][1]=1 (366)
[0700] F4[0][2]=1,F4[1][2]=2,F4[2][2]=1 (367)
[0701] — Otherwise, the following applies:
[0702] F3[1][1]=8 (368)
[0703] F4[0][1]=2, F4[1][1]=4, F4[2][1]=2, (369)
[0704] - If sps_chroma_vertical_collocated_flag is equal to 1, the following applies:
[0705] —pDsY[x][y], where x=0..nTbW-1, y=0..nTbH-1 is derived as follows:
[0706] pDsY[x][y]=(F3[1][0]×pY[SubWidthC×x][SubHeightC×y-1]+
[0707] F3[0][1]×pY[SubWidthC×x-1][SubHeightC×y]+
[0708] F3[1][1]×pY[SubWidthC×x][SubHeightC×y]+(370)
[0709] F3[2][1]×pY[SubWidthC×x+1][SubHeightC×y]+
[0710] F3[1][2]×pY[SubWidthC×x][SubHeightC×y+1]+4)>>3
[0711] - Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies:
[0712] —pDsY[x][y], where x=0..nTbW-1, y=0..nTbH-1 is derived as follows:
[0713] pDsY[x][y]=(F4[0][1]×pY[SubWidthC×x-1][SubHeightC×y]+
[0714] F4[0][2]×pY[SubWidthC×x-1][SubHeightC×y+1]+
[0715] F4[1][1]×pY[SubWidthC×x][SubHeightC×y]+(371)
[0716] F4[1][2]×pY[SubWidthC×x][SubHeightC×y+1]+
[0717] F4[2][1]×pY[SubWidthC×x+1][SubHeightC×y]+
[0718] F4[2][2]×pY[SubWidthC×x+1][SubHeightC×y+1]+4)>>3
[0719] [[4. When numSampL is greater than 0, the selected adjacent left chroma sample pSelC[idx] is set equal to p[-1][pickPosL[idx]], where idx = 0..cntL-1, and the selected downsampled adjacent left luma sample pSelDsY[idx], where idx = 0..cntL-1 is derived as follows:
[0720] —The variable y is set equal to pickPosL[idx].
[0721] —If SubWidthC and SubHeightC are both equal to 1, then the following applies:
[0722] pSelDsY[idx]=pY[-1][y] (372)
[0723] — Otherwise, the following applies:
[0724] - If sps_chroma_vertical_collocated_flag is equal to 1, the following applies:
[0725] pSelDsY[idx]=(F3[1][0]×pY[-SubWidthC][SubHeightC×y-1]+
[0726] F3[0][1]×pY[-1-SubWidthC][SubHeightC×y]+
[0727] F3[1][1]×pY[-SubWidthC][SubHeightC×y]+(373)
[0728] F3[2][1]×pY[1-SubWidthC][SubHeightC×y]+
[0729] F3[1][2]×pY[-SubWidthC][SubHeightC×y+1]+4)>>3
[0730] - Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies:
[0731] pSelDsY[idx]=(F4[0][1]×pY[-1-SubWidthC][SubHeightC×y]+
[0732] F4[0][2]×pY[-1-SubWidthC][SubHeightC×y+1]+
[0733] F4[1][1]×pY[-SubWidthC][SubHeightC×y]+(374)
[0734] F4[1][2]×pY[-SubWidthC][SubHeightC×y+1]+
[0735] F4[2][1]×pY[1-SubWidthC][SubHeightC×y]+
[0736] F4[2][2]×pY[1-SubWidthC][SubHeightC×y+1]+4)>>3
[0737] 5. When numSampT is greater than 0, the selected adjacent top chroma sample pSelC[idx] is set equal to p[pickPosT[idx-cntL]][-1], where idx=cntL..cntL+cntT-1, and the downsampled adjacent top luma sample pSelDsY[idx], where idx=0..cntL+cntT-1 is specified as follows:
[0738] —The variable x is set equal to pickPosT[idx-cntL].
[0739] —If SubWidthC and SubHeightC are both equal to 1, then the following applies:
[0740] pSelDsY[idx]=pY[x][-1] (375)
[0741] — Otherwise, the following applies:
[0742] - If sps_chroma_vertical_collocated_flag is equal to 1, the following applies:
[0743] — If bCTUboundary is equal to FALSE, the following applies:
[0744] pSelDsY[idx]=(F3[1][0]×pY[SubWidthC×x][-1-SubHeightC]+
[0745] F3[0][1]×pY[SubWidthC×x-1][-SubHeightC]+
[0746] F3[1][1]×pY[SubWidthC×x][-SubHeightC]+(376)
[0747] F3[2][1]×pY[SubWidthC×x+1][-SubHeightC]+
[0748] F3[1][2]×pY[SubWidthC×x][1-SubHeightC]+4)>>3
[0749] — Otherwise (bCTUboundary is TRUE), the following applies:
[0750] pSelDsY[idx]=(F2[0]×pY[SubWidthC×x-1][-1]+
[0751] F2[1]×pY[SubWidthC×x][-1]+(377)
[0752] F2[2]×pY[SubWidthC×x+1][-1]+2)>>2
[0753] - Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies:
[0754] — If bCTUboundary is equal to FALSE, the following applies:
[0755] pSelDsY[idx]=(F4[0][1]×pY[SubWidthC x-1][-1]+
[0756] F4[0][2]×pY[SubWidthC×x-1][-2]+
[0757] F4[1][1]×pY[SubWidthC×x][-1]+(378)
[0758] F4[1][2]×pY[SubWidthC×x][-2]+
[0759] F4[2][1]×pY[SubWidthC×x+1][-1]+
[0760] F4[2][2]×pY[SubWidthC×x+1][-2]+4)>>3
[0761] Otherwise (bCTUboundary is TRUE), the following applies: pSelDsY[idx] = (F2[0] × pY[SubWidthC×x-1][-1] +
[0762] F2[1]×pY[SubWidthC×x][-1]+(379)
[0763] F2[2]×pY[SubWidthC×x+1][-1]+2)>>2]]
[0764]
[0765]
[0766] 6. When cntT+cntL is not equal to 0, the variables minY, maxY, minC and maxC are derived as follows:
[0767] —When cntT+cntL is equal to 2, pSelComp[3] is set equal to pSelComp[0], pSelComp[2] is set equal to pSelComp[1], pSelComp[0] is set equal to pSelComp[1], pSelComp[1] is set equal to pSelComp[3], and Comp is replaced with DsY and C.
[0768] —The arrays minGrpIdx and maxGrpIdx are derived as follows:
[0769] minGrpIdx[0]=0 (380)
[0770] minGrpIdx[1]=2 (381)
[0771] maxGrpIdx[0]=1 (382)
[0772] maxGrpIdx[1]=3 (383)
[0773] —When pSelDsY[minGrpIdx[0]] is greater than pSelDsY[minGrpIdx[1]], minGrpIdx[0] and minGrpIdx[1] are swapped as follows:
[0774] (minGrpIdx[0], minGrpIdx[1])=Swap(minGrpIdx[0], minGrpIdx[1]) (384)
[0775] —When pSelDsY[maxGrpIdx[0]] is greater than pSelDsY[maxGrpIdx[1]], maxGrpIdx[0] and maxGrpIdx[1] are swapped as follows:
[0776] (maxGrpIdx[0], maxGrpIdx[1])=Swap(maxGrpIdx[0], maxGrpIdx[1]) (385)
[0777] —When pSelDsY[minGrpIdx[0]] is greater than pSelDsY[maxGrpIdx[1]], the arrays minGrpIdx and maxGrpIdx are swapped as follows:
[0778] (minGrpIdx, maxGrpIdx) = Swap (minGrpIdx, maxGrpIdx) (386)
[0779] —When pSelDsY[minGrpIdx[1]] is greater than pSelDsY[maxGrpIdx[0]], minGrpIdx[1] and maxGrpIdx[0] are swapped as follows:
[0780] (minGrpIdx[1], maxGrpIdx[0])=Swap(minGrpIdx[1], maxGrpIdx[0]) (387)
[0781] —The variables maxY, maxC, minY and minC are derived as follows:
[0782] maxY=(pSelDsY[maxGrpIdx[0]]+pSelDsY[maxGrpIdx[1]]+1)>>1 (388)
[0783] maxC=(pSelC[maxGrpIdx[0]]+pSelC[maxGrpIdx[1]]+1)>>1 (389)
[0784] minY=(pSelDsY[minGrpIdx[0]]+pSelDsY[minGrpIdx[1]]+1)>>1 (390)
[0785] minC=(pSelC[minGrpIdx[0]]+pSelC[minGrpIdx[1]]+1)>>1 (391)
[0786] 7. The variables a, b and k are derived as follows:
[0787] — If numSampL is equal to 0 and numSampT is equal to 0, then the following applies:
[0788] k=0 (392)
[0789] a=0 (393)
[0790] b=1<<(BitDepth-1) (394)
[0791] — Otherwise, the following applies:
[0792] diff=maxY-minY (395)
[0793] — If diff is not equal to 0, the following applies:
[0794] diffC=maxC-minC(396)
[0795] x = Floor(Log2(diff))(397)
[0796] normDiff=((diff<<4)>>x)&15 (398)
[0797] x+=(normDiff!=0)? 1:0 (399)
[0798] y=Abs(diffC)>0? Floor(Log2(Abs(diffC)))+1:0 (400)
[0799] a=(diffC×(divSigTable[normDiff]|8)+2 y-1 )>>y (401)
[0800] k=((3+xy)<1)? 1:3+xy (402)
[0801] a=((3+xy)<1)? Sign(a)×15:a (403)
[0802] b=minC-((a×minY)>>k) (404)
[0803] where divSigTable[] is specified as follows:
[0804] divSigTable[]={0, 7, 6, 5, 5, 4, 4, 3, 3, 2, 2, 1, 1, 1, 1, 0} (405)
[0805] — Otherwise (diff is equal to 0), the following applies:
[0806] k=0 (406)
[0807] a=0 (407)
[0808] b=minC (408)
[0809] 8. The predicted sample point predSample[x][y], where x = 0..nTbW-1, y = 0..nTbH-1 is derived as follows:
[0810] predSamples[x][y]=Clip1(((pDsY[x][y]×a)>>k)+b) (409)
[0811] NOTE - This process uses sps_chroma_vertical_collocated_flag. However, to simplify the implementation, it does not use sps_chroma_horizontal_collocated_flag.
[0812] 5.5. Example 5
[0813] The working draft specified in JVET-Q2001-vE may be modified as follows. 8.4.5.2.13
[0815] The inputs to this process are:
[0816] —Intra prediction mode predModeIntra,
[0817] - the sample position of the upper left sample of the current transform block relative to the upper left sample of the current picture (xTbC, yTbC),
[0818] - variable nTbW specifying the transform block width,
[0819] - variable nTbH specifying the transform block height,
[0820] — variable cIdx that specifies the color component of the current block,
[0821] - Chroma neighboring samples p[x][y], where x=-1, y=0..2×nTbH-1, x=0..2×nTbW-1, y=-1.
[0822] The output of this process is the predicted samples predSamples[x][y], where x=0..nTbW-1, y=0..nTbH-1.
[0823] The current brightness position (xTbY, yTbY) is derived as follows:
[0824] (xTbY, yTbY) = (xTbC<<(SubWidthC-1), yTbC<<(SubHeightC-1)) (351)
[0825] The variables availL, availT, and availTL are derived as follows:
[0826] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using as input the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY-1, yTbY), checkPredModeY set equal to false (FLASE), and cIdx, and assign the output to availL.
[0827] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using as input the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY, yTbY-1), checkPredModeY set equal to false (FLASE), and cIdx, and assign the output to availT.
[0828] —The variable availTL is derived as follows:
[0829] availTL=availL&&availT (352)
[0830] —The number of available top-right adjacent chroma samples numTopRight is derived as follows:
[0831] —The variable numTopRight is set to 0, and availTR is set to TRUE.
[0832] - When predModeIntra is equal to INTRA_T_CCLM, the following applies for x=nTbW..2×nTbW-1 until availTR is equal to FALSE or x is equal to 2×nTbW-1:
[0833] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using as input the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY+x, yTbY-1), checkPredModeY set equal to false (FLASE), and cIdx, and assign the output to availTR.
[0834] —When availTR is equal to TRUE, numTopRight is increased by 1.
[0835] —The number of available lower left adjacent chroma samples numLeftBelow is derived as follows:
[0836] —The variable numLeftBelow is set to 0, and availLB is set to TRUE.
[0837] - When predModeIntra is equal to INTRA_L_CCLM, the following applies for y=nTbH..2×nTbH-1 until availLB is equal to FALSE or y is equal to 2×nTbH-1:
[0838] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using as input the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY-1, yTbY+y), checkPredModeY set equal to false (FLASE), and cIdx, and assign the output to availLB.
[0839] —When availLB is equal to TRUE, numLeftBelow is increased by 1.
[0840] The number of available adjacent chroma samples numSampT at the top and upper right and the number of available adjacent chroma samples numSampL at the left and lower left are derived as follows:
[0841] — If predModeIntra is equal to INTRA_LT_CCLM, the following applies:
[0842] numSampT=availT? nTbW:0 (353)
[0843] numSampL=availL? nTbH:0 (354)
[0844] — Otherwise, the following applies:
[0845] numSampT=(availT&&predModeIntra==INTRA_T_CCLM)? (nTbW+Min(numTopRight,nTbH)):0 (355)
[0846] numSampL=(availL&&predModeIntra==INTRA_L_CCLM)? (nTbH+Min(numLeftBelow,nTbW)):0 (356)
[0847] The variable bCTUboundary is derived as follows:
[0848] bCTUboundary=(yTbY&(CtbSizeY-1)==0)? TRUE:FALSE(357)
[0849] The variable cntN and array pickPosN where N is replaced by L and T are derived as follows:
[0850] —The variable numIs4N is derived as follows:
[0851] numIs4N=((availT&&availL&&predModeIntra==INTRA_LT_CCLM)?0:1) (358)
[0852] —The variable startPosN is set equal to numSampN>>(2+numIs4N).
[0853] —The variable pickStepN is set equal to Max(1, numSampN>>(1+numIs4N)).
[0854] —If availN is equal to TRUE and predModeIntra is equal to INTRA_LT_CCLM or INTRA_N_CCLM, the following assignments are made:
[0855] —cntN is set equal to Min(numSampN, (1+numIs4N)<<1).
[0856] —pickPosN[pos] is set equal to (startPosN+pos×pickStepN), where pos=0..cntN-1.
[0857] Otherwise, cntN is set equal to 0.
[0858] The predicted sample predSample[x][y], where x = 0..nTbW-1, y = 0..nTbH-1, is derived as follows:
[0859] — If numSampL and numSampT are both equal to 0, the following applies:
[0860] predSamples[x][y]=1<<(BitDepth-1)(359)
[0861] — Otherwise, the following ordered steps apply:
[0862] 1. The co-located luma sample pY[x][y] where x=0..nTbW×SubWidthC-1, y=0..TbH×SubHeightC-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).
[0863] 2. The adjacent brightness samples pY[x][y] are derived as follows:
[0864] —When numSampL is greater than 0, the adjacent left luma sample pY[x][y] where x=-1..-3, y=0..SubHeightC×numSampL-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).
[0865] - When availT is equal to FALSE, the adjacent top luma sample pY[x][y] where x = -1..SubWidthC×numSampT-1, y = -1..-2 is set equal to luma sample pY[x][0].
[0866] - When availL is equal to FALSE, the adjacent left luma sample pY[x][y] where x = -1..-3, y = -1..SubHeightC×numSampL-1 is set equal to luma sample pY[0][y].
[0867] —When numSampT is greater than 0, the adjacent top luma sample pY[x][y] where x=0..SubWidthC×numSampT-1, y=-1..-2 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).
[0868] —When availTL is equal to true (TRUE), the adjacent upper left luma sample pY[x][y] where x=-1, y=-1, -2 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).
[0869] 3. The downsampled co-located luminance sample pDsY[x][y], where x = 0..nTbW-1, y = 0..nTbH-1, is derived as follows:
[0870] —If SubWidthC and SubHeightC are both equal to 1, then the following applies:
[0871] —pDsY[x][y], where x=1..nTbW-1, y=1..nTbH-1 is derived as follows:
[0872] pDstY[x][y]=pY[x][y] (360)
[0873] — Otherwise, the following applies:
[0874] —The one-dimensional filter coefficient arrays F1 and F2 and the two-dimensional filter coefficient arrays F3 and F4 are specified as follows.
[0875] F1[0]=2,F1[1]=0 (361)
[0876] F2[0]=1,F2[1]=2,F2[2]=1 (362)
[0877] F3[i][j]=F4[i][j]=0, where i=0..2, j=0..2 (363)
[0878] — If SubWidthC and SubHeightC are both equal to 2, then the following applies:
[0879] F1[0]=1,F1[1]=1 (364)
[0880] F3[0][1]=1,F3[1][1]=4,F3[2][1]=1,F3[1][0]=1,F3[1][2]=1 (365)
[0881] F4[0][1]=1,F4[1][1]=2,F4[2][1]=1 (366)
[0882] F4[0][2]=1,F4[1][2]=2,F4[2][2]=1 (367)
[0883] — Otherwise, the following applies:
[0884] F3[1][1]=8 (368)
[0885] F4[0][1]=2, F4[1][1]=4, F4[2][1]=2, (369)
[0886] - If sps_chroma_vertical_collocated_flag is equal to 1, the following applies:
[0887] —pDsY[x][y], where x=0..nTbW-1, y=0..nTbH-1 is derived as follows:
[0888] pDsY[x][y]=(F3[1][0]×pY[SubWidthC×x][SubHeightC×y-1]+
[0889] F3[0][1]×pY[SubWidthC×x-1][SubHeightC×y]+
[0890] F3[1][1]×pY[SubWidthC×x][SubHeightC×y]+(370)
[0891] F3[2][1]×pY[SubWidthC×x+1][SubHeightC×y]+
[0892] F3[1][2]×pY[SubWidthC×x][SubHeightC×y+1]+4)>>3
[0893] - Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies:
[0894] —pDsY[x][y], where x=0..nTbW-1, y=0..nTbH-1 is derived as follows:
[0895] pDsY[x][y]=(F4[0][1]×pY[SubWidthC×x-1][SubHeightC×y]+
[0896] F4[0][2]×pY[SubWidthC×x-1][SubHeightC×y+1]+
[0897] F4[1][1]×pY[SubWidthC×x][SubHeightC×y]+(371)
[0898] F4[1][2]×pY[SubWidthC×x][SubHeightC×y+1]+
[0899] F4[2][1]×pY[SubWidthC×x+1][SubHeightC×y]+
[0900] F4[2][2]×pY[SubWidthC×x+1][SubHeightC×y+1]+4)>>3
[0901] 4. When numSampL is greater than 0, the selected adjacent left chroma sample pSelC[idx] is set equal to p[-1][pickPosL[idx]], where idx = 0..cntL-1, and the selected downsampled adjacent left luma sample pSelDsY[idx], where idx = 0..cntL-1 is derived as follows:
[0902] —The variable y is set equal to pickPosL[idx].
[0903] —If SubWidthC and SubHeightC are both equal to 1, then the following applies:
[0904] pSelDsY[idx]=pY[-1][y] (372)
[0905] — Otherwise, the following applies:
[0906] - If sps_chroma_vertical_collocated_flag is equal to 1, the following applies:
[0907] pSelDsY[idx]=(F3[1][0]×pY[-SubWidthC][SubHeightC×y-1]+
[0908] F3[0][1]×pY[-1-SubWidthC][SubHeightC×y]+
[0909] F3[1][1]×pY[-SubWidthC][SubHeightC×y]+(373)
[0910] F3[2][1]×pY[1-SubWidthC][SubHeightC×y]+
[0911] F3[1][2]×pY[-SubWidthC][SubHeightC×y+1]+4)>>3
[0912] - Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies:
[0913] pSelDsY[idx]=(F4[0][1]×pY[-1-SubWidthC][SubHeightC×y]+
[0914] F4[0][2]×pY[-1-SubWidthC][SubHeightC×y+1]+
[0915] F4[1][1]×pY[-SubWidthC][SubHeightC×y]+(374)
[0916] F4[1][2]×pY[-SubWidthC][SubHeightC×y+1]+
[0917] F4[2][1]×pY[1-SubWidthC][SubHeightC×y]+
[0918] F4[2][2]×pY[1-SubWidthC][SubHeightC×y+1]+4)>>3
[0919] 5. When numSampT is greater than 0, the selected adjacent top chroma sample pSelC[idx] is set equal to p[pickPosT[idx-cntL]][-1], where idx = cntL..cntL+cntT-1, and the downsampled adjacent top luma sample pSelDsY[idx], where Specify as follows:
[0920] —The variable x is set equal to pickPosT[idx-cntL].
[0921] —If SubWidthC and SubHeightC are both equal to 1, then the following applies:
[0922] pSelDsY[idx]=pY[x][-1] (375)
[0923] — Otherwise, the following applies:
[0924] - If sps_chroma_vertical_collocated_flag is equal to 1, the following applies:
[0925] — If bCTUboundary is equal to FALSE, the following applies:
[0926] pSelDsY[idx]=(F3[1][0]×pY[SubWidthC×x][-1-SubHeightC]+
[0927] F3[0][1]×pY[SubWidthC×x-1][-SubHeightC]+
[0928] F3[1][1]×pY[SubWidthC×x][-SubHeightC]+(376)
[0929] F3[2][1]×pY[SubWidthC×x+1][-SubHeightC]+
[0930] F3[1][2]×pY[SubWidthC×x][1-SubHeightC]+4)>>3
[0931] — Otherwise (bCTUboundary is TRUE), the following applies:
[0932] pSelDsY[idx]=(F2[0]×pY[SubWidthC×x-1][-1]+
[0933] F2[1]×pY[SubWidthC×x][-1]+(377)
[0934] F2[2]×pY[SubWidthC×x+1][-1]+2)>>2
[0935] - Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies:
[0936] — If bCTUboundary is equal to FALSE, the following applies:
[0937] pSelDsY[idx]=(F4[0][1]×pY[SubWidthC x-1][-1]+
[0938] F4[0][2]×pY[SubWidthC×x-1][-2]+
[0939] F4[1][1]×pY[SubWidthC×x][-1]+ (378)
[0940] F4[1][2]×pY[SubWidthC×x][-2]+
[0941] F4[2][1]×pY[SubWidthC×x+1][-1]+
[0942] F4[2][2]×pY[SubWidthC×x+1][-2]+4)>>3
[0943] — Otherwise (bCTUboundary is TRUE), the following applies:
[0944] pSelDsY[idx]=(F2[0]×pY[SubWidthC×x-1][-1]+
[0945] F2[1]×pY[SubWidthC×x][-1]+ (379)
[0946] F2[2]×pY[SubWidthC×x+1][-1]+2)>>2
[0947] 6. When cntT+cntL is not equal to 0, the variables minY, maxY, minC and maxC are derived as follows:
[0948] —When cntT+cntL is equal to 2, pSelComp[3] is set equal to pSelComp[0], pSelComp[2] is set equal to pSelComp[1], pSelComp[0] is set equal to pSelComp[1], pSelComp[1] is set equal to pSelComp[3], and Comp is replaced with DsY and C.
[0949] —The arrays minGrpIdx and maxGrpIdx are derived as follows:
[0950] minGrpIdx[0]=0 (380)
[0951] minGrpIdx[1]=2 (381)
[0952] maxGrpIdx[0]=1 (382)
[0953] maxGrpIdx[1]=3 (383)
[0954] —When pSelDsY[minGrpIdx[0]] is greater than pSelDsY[minGrpIdx[1]], minGrpIdx[0] and minGrpIdx[1] are swapped as follows:
[0955] (minGrpIdx[0], minGrpIdx[1])=Swap(minGrpIdx[0], minGrpIdx[1]) (384)
[0956] —When pSelDsY[maxGrpIdx[0]] is greater than pSelDsY[maxGrpIdx[1]], maxGrpIdx[0] and maxGrpIdx[1] are swapped as follows:
[0957] (maxGrpIdx[0], maxGrpIdx[1])=Swap(maxGrpIdx[0], maxGrpIdx[1]) (385)
[0958] —When pSelDsY[minGrpIdx[0]] is greater than pSelDsY[maxGrpIdx[1]], the arrays minGrpIdx and maxGrpIdx are swapped as follows:
[0959] (minGrpIdx, maxGrpIdx) = Swap (minGrpIdx, maxGrpIdx) (386)
[0960] —When pSelDsY[minGrpIdx[1]] is greater than pSelDsY[maxGrpIdx[0]], minGrpIdx[1] and maxGrpIdx[0] are swapped as follows:
[0961] (minGrpIdx[1], maxGrpIdx[0])=Swap(minGrpIdx[1], maxGrpIdx[0]) (387)
[0962] —The variables maxY, maxC, minY and minC are derived as follows:
[0963] maxY=(pSelDsY[maxGrpIdx[0]]+pSelDsY[maxGrpIdx[1]]+1)>>1 (388)
[0964] maxC=(pSelC[maxGrpIdx[0]]+pSelC[maxGrpIdx[1]]+1)>>1 (389)
[0965] minY=(pSelDsY[minGrpIdx[0]]+pSelDsY[minGrpIdx[1]]+1)>>1 (390)
[0966] minC=(pSelC[minGrpIdx[0]]+pSelC[minGrpIdx[1]]+1)>>1(391)
[0967] 7. The variables a, b and k are derived as follows:
[0968] — If numSampL is equal to 0 and numSampT is equal to 0, then the following applies:
[0969] k=0 (392)
[0970] a=0 (393)
[0971] b=1<<(BitDepth-1) (394)
[0972] — Otherwise, the following applies:
[0973] diff=maxY-minY (395)
[0974] — If diff is not equal to 0, the following applies:
[0975] diffC=maxC-minC (396)
[0976] x=Floor(Log2(diff)) (397)
[0977] normDiff=((diff<<4)>>x)&15 (398)
[0978] x+=(normDiff!=0)? 1:0 (399)
[0979] y=Abs(diffC)>0? Floor(Log2(Abs(diffC)))+1:0 (400)
[0980] a=(diffC×(divSigTable[normDiff]|8)+2 y-1 )>>y (401)
[0981] k=((3+xy)<1)? 1:3+xy (402)
[0982] a=((3+xy)<1)? Sign(a)×15:a (403)
[0983] b=minC-((a×minY)>>k) (404)
[0984] where divSigTable[] is specified as follows:
[0985] divSigTable[]={0, 7, 6, 5, 5, 4, 4, 3, 3, 2, 2, 1, 1, 1, 1, 0} (405)
[0986] — Otherwise (diff is equal to 0), the following applies:
[0987] k=0 (406)
[0988] a=0 (407)
[0989] b=minC (408)
[0990] 8. The predicted sample point predSample[x][y], where x = 0..nTbW-1, y = 0..nTbH-1 is derived as follows:
[0991] predSamples[x][y]=Clip1(((pDsY[x][y]×a)>>k)+b) (409)
[0992] NOTE - This process uses sps_chroma_vertical_collocated_flag. However, to simplify the implementation, it does not use sps_chroma_horizontal_collocated_flag.
[0993] 5.6. Example 6
[0994] The working draft specified in JVET-Q2001-vE may be modified as follows. 8.4.5.2.13
[0996] The inputs to this process are:
[0997] —Intra prediction mode predModeIntra,
[0998] - the sample position of the upper left sample of the current transform block relative to the upper left sample of the current picture (xTbC, yTbC),
[0999] - variable nTbW specifying the transform block width,
[1000] - variable nTbH specifying the transform block height,
[1001] — variable cIdx that specifies the color component of the current block,
[1002] - Chroma neighboring samples p[x][y], where x=-1, y=0..2×nTbH-1, x=0..2×nTbW-1, y=-1.
[1003] The output of this process is the predicted samples predSamples[x][y], where x=0..nTbW-1, y=0..nTbH-1.
[1004] The current brightness position (xTbY, yTbY) is derived as follows:
[1005] (xTbY, yTbY) = (xTbC<<(SubWidthC-1), yTbC<<(SubHeightC-1)) (351)
[1006] The variables availL, availT, and availTL are derived as follows:
[1007] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using as input the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY-1, yTbY), checkPredModeY set equal to false (FLASE), and cIdx, and assign the output to availL.
[1008] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using as input the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY, yTbY-1), checkPredModeY set equal to false (FLASE), and cIdx, and assign the output to availT.
[1009] —The variable availTL is derived as follows:
[1010] availTL=availL&&availT (352)
[1011] —The number of available top-right adjacent chroma samples numTopRight is derived as follows:
[1012] —The variable numTopRight is set to 0, and availTR is set to TRUE.
[1013] - When predModeIntra is equal to INTRA_T_CCLM, the following applies for x=nTbW..2×nTbW-1 until availTR is equal to FALSE or x is equal to 2×nTbW-1:
[1014] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using as input the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY+x, yTbY-1), checkPredModeY set equal to false (FLASE), and cIdx, and assign the output to availTR.
[1015] —When availTR is equal to TRUE, numTopRight is increased by 1.
[1016] —The number of available lower left adjacent chroma samples numLeftBelow is derived as follows:
[1017] —The variable numLeftBelow is set to 0, and availLB is set to TRUE.
[1018] - When predModeIntra is equal to INTRA_L_CCLM, the following applies for y=nTbH..2×nTbH-1 until availLB is equal to FALSE or y is equal to 2×nTbH-1:
[1019] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using as input the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY-1, yTbY+y), checkPredModeY set equal to false (FLASE), and cIdx, and assign the output to availLB.
[1020] —When availLB is equal to TRUE, numLeftBelow is increased by 1.
[1021] The number of available adjacent chroma samples numSampT at the top and upper right and the number of available adjacent chroma samples numSampL at the left and lower left are derived as follows:
[1022] — If predModeIntra is equal to INTRA_LT_CCLM, the following applies:
[1023] numSampT=availT? nTbW:0 (353)
[1024] numSampL=availL? nTbH:0 (354)
[1025] — Otherwise, the following applies:
[1026] numSampT=(availT&&predModeIntra==INTRA_T_CCLM)? (nTbW+Min(numTopRight,nTbH)):0 (355)
[1027] numSampL=(availL&&predModeIntra==INTRA_L_CCLM)? (nTbH+Min(numLeftBelow,nTbW)):0 (356)
[1028] The variable bCTUboundary is derived as follows:
[1029] bCTUboundary=(yTbY&(CtbSizeY-1)==0)? TRUE:FALSE(357)
[1030] The variable cntN and array pickPosN where N is replaced by L and T are derived as follows:
[1031] —The variable numIs4N is derived as follows:
[1032] numIs4N=((availT&&availL&&predModeIntra==INTRA_LT_CCLM)?0:1) (358)
[1033] —The variable startPosN is set equal to numSampN>>(2+numIs4N).
[1034] —The variable pickStepN is set equal to Max(1, numSampN>>(1+numIs4N)).
[1035] —If availN is equal to TRUE and predModeIntra is equal to INTRA_LT_CCLM or INTRA_N_CCLM, the following assignments are made:
[1036] —cntN is set equal to Min(numSampN, (1+numIs4N)<<1).
[1037] —pickPosN[pos] is set equal to (startPosN+pos×pickStepN), where pos=0..cntN-1.
[1038] Otherwise, cntN is set equal to 0.
[1039] The predicted sample predSample[x][y], where x = 0..nTbW-1, y = 0..nTbH-1, is derived as follows:
[1040] — If numSampL and numSampT are both equal to 0, the following applies:
[1041] predSamples[x][y]=1<<(BitDepth-1) (359)
[1042] — Otherwise, the following ordered steps apply:
[1043] 1. The co-located luma sample pY[x][y] where x=0..nTbW×SubWidthC-1, y=0..TbH×SubHeightC-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).
[1044] 2. The adjacent brightness samples pY[x][y] are derived as follows:
[1045] —When numSampL is greater than 0, the adjacent left luma sample pY[x][y] where x=-1..-3, y=0..SubHeightC×numSampL-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).
[1046] - When availT is equal to FALSE, the adjacent top luma sample pY[x][y] where x = -1..SubWidthC×numSampT-1, y = -1..-2 is set equal to luma sample pY[x][0].
[1047] - When availL is equal to FALSE, the adjacent left luma sample pY[x][y] where x = -1..-3, y = -1..SubHeightC×numSampL-1 is set equal to luma sample pY[0][y].
[1048] - When numSampT is greater than 0, x = 0..SubWidthC×numSampT-1, The adjacent top luma sample pY[x][y] of is set equal to the reconstructed luma sample before the deblocking filtering process at the position (xTbY+x, yTbY+y).
[1049] - When availTL is equal to TRUE, where x = -1, The adjacent upper left luma sample pY[x][y] is set equal to the reconstructed luma sample before the deblocking filtering process at the position (xTbY+x, yTbY+y).
[1050] 3. The downsampled co-located luminance sample pDsY[x][y], where x = 0..nTbW-1, y = 0..nTbH-1, is derived as follows:
[1051] —If SubWidthC and SubHeightC are both equal to 1, then the following applies:
[1052] —pDsY[x][y], where x=1..nTbW-1, y=1..nTbH-1 is derived as follows:
[1053] pDstY[x][y]=pY[x][y] (360)
[1054] — Otherwise, the following applies:
[1055] —The one-dimensional filter coefficient arrays F1 and F2 and the two-dimensional filter coefficient arrays F3 and F4 are specified as follows.
[1056] F1[0]=2,F1[1]=0 (361)
[1057] F2[0]=1,F2[1]=2,F2[2]=1 (362)
[1058] F3[i][j]=F4[i][j]=0, where i=0..2, j=0..2 (363)
[1059] — If SubWidthC and SubHeightC are both equal to 2, then the following applies:
[1060] F1[0]=1,F1[1]=1 (364)
[1061] F3[0][1]=1,F3[1][1]=4,F3[2][1]=1,F3[1][0]=1,F3[1][2]=1 (365)
[1062] F4[0][1]=1,F4[1][1]=2,F4[2][1]=1 (366)
[1063] F4[0][2]=1,F4[1][2]=2,F4[2][2]=1 (367)
[1064] — Otherwise, the following applies:
[1065] F3[1][1]=8 (368)
[1066] F4[0][1]=2, F4[1][1]=4, F4[2][1]=2, (369)
[1067] - If sps_chroma_vertical_collocated_flag is equal to 1, the following applies:
[1068] —pDsY[x][y], where x=0..nTbW-1, y=0..nTbH-1 is derived as follows:
[1069] pDsY[x][y]=(F3[1][0]×pY[SubWidthC×x][SubHeightC×y-1]+
[1070] F3[0][1]×pY[SubWidthC×x-1][SubHeightC×y]+
[1071] F3[1][1]×pY[SubWidthC×x][SubHeightC×y]+(370)
[1072] F3[2][1]×pY[SubWidthC×x+1][SubHeightC×y]+
[1073] F3[1][2]×pY[SubWidthC×x][SubHeightC×y+1]+4)>>3
[1074] - Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies:
[1075] —pDsY[x][y], where x=0..nTbW-1, y=0..nTbH-1 is derived as follows:
[1076] pDsY[x][y]=(F4[0][1]×pY[SubWidthC×x-1][SubHeightC×y]+
[1077] F4[0][2]×pY[SubWidthC×x-1][SubHeightC×y+1]+
[1078] F4[1][1]×pY[SubWidthC×x][SubHeightC×y]+(371)
[1079] F4[1][2]×pY[SubWidthC×x][SubHeightC×y+1]+
[1080] F4[2][1]×pY[SubWidthC×x+1][SubHeightC×y]+
[1081] F4[2][2]×pY[SubWidthC×x+1][SubHeightC×y+1]+4)>>3
[1082] 4. When numSampL is greater than 0, the selected adjacent left chroma sample pSelC[idx] is set equal to p[-1][pickPosL[idx]], where idx = 0..cntL-1, and the selected downsampled adjacent left luma sample pSelDsY[idx], where idx = 0..cntL-1 is derived as follows:
[1083] —The variable y is set equal to pickPosL[idx].
[1084] —If SubWidthC and SubHeightC are both equal to 1, then the following applies:
[1085] pSelDsY[idx]=pY[-1][y] (372)
[1086] — Otherwise, the following applies:
[1087] - If sps_chroma_vertical_collocated_flag is equal to 1, the following applies:
[1088] pSelDsY[idx]=(F3[1][0]×pY[-SubWidthC][SubHeightC×y-1]+
[1089] F3[0][1]×pY[-1-SubWidthC][SubHeightC×y]+
[1090] F3[1][1]×pY[-SubWidthC][SubHeightC×y]+(373)
[1091] F3[2][1]×pY[1-SubWidthC][SubHeightC×y]+
[1092] F3[1][2]×pY[-SubWidthC][SubHeightC×y+1]+4)>>3
[1093] - Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies:
[1094] pSelDsY[idx]=(F4[0][1]×pY[-1-SubWidthC][SubHeightC×y]+
[1095] F4[0][2]×pY[-1-SubWidthC][SubHeightC×y+1]+
[1096] F4[1][1]×pY[-SubWidthC][SubHeightC×y]+(374)
[1097] F4[1][2]×pY[-SubWidthC][SubHeightC×y+1]+
[1098] F4[2][1]×pY[1-SubWidthC][SubHeightC×y]+
[1099] F4[2][2]×pY[1-SubWidthC][SubHeightC×y+1]+4)>>3
[1100] 5. When numSampT is greater than 0, the selected adjacent top chroma sample pSelC[idx] is set equal to p[pickPosT[idx-cntL]][-1], where idx=cntL..cntL+cntT-1, and the downsampled adjacent top luma sample pSelDsY[idx], where idx=0..cntL+cntT-1 is specified as follows:
[1101] —The variable x is set equal to pickPosT[idx-cntL].
[1102] —If SubWidthC and SubHeightC are both equal to 1, then the following applies:
[1103] pSelDsY[idx]=pY[x][-1] (375)
[1104] — Otherwise, the following applies:
[1105] - If sps_chroma_vertical_collocated_flag is equal to 1, the following applies:
[1106] — If bCTUboundary is equal to FALSE, the following applies:
[1107] pSelDsY[idx]=(F3[1][0]×pY[SubWidthC×x][-1-SubHeightC]+
[1108] F3[0][1]×pY[SubWidthC×x-1][-SubHeightC]+
[1109] F3[1][1]×pY[SubWidthC×x][-SubHeightC]+(376)
[1110] F3[2][1]×pY[SubWidthC×x+1][-SubHeightC]+
[1111] F3[1][2]×pY[SubWidthC×x][1-SubHeightC]+4)>>3
[1112] — Otherwise (bCTUboundary is TRUE), the following applies:
[1113] pSelDsY[idx]=(F2[0]×pY[SubWidthC×x-1][-1]+
[1114] F2[1]×pY[SubWidthC×x][-1]+(377)
[1115] F2[2]×pY[SubWidthC×x+1][-1]+2)>>2
[1116] - Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies:
[1117] — If bCTUboundary is equal to FALSE, the following applies:
[1118] pSelDsY[idx]=(F4[0][1]×pY[SubWidthC x-1][-1]+
[1119] F4[0][2]×pY[SubWidthC×x-1][-2]+
[1120] F4[1][1]×pY[SubWidthC×x][-1]+(378)
[1121] F4[1][2]×pY[SubWidthC×x][-2]+
[1122] F4[2][1]×pY[SubWidthC×x+1][-1]+
[1123] F4[2][2]×pY[SubWidthC×x+1][-2]+4)>>3
[1124] — Otherwise (bCTUboundary is TRUE), the following applies:
[1125] pSelDsY[idx]=(F2[0]×pY[SubWidthC×x-1][-1]+
[1126] F2[1]×pY[SubWidthC×x][-1]+(379)
[1127] F2[2]×pY[SubWidthC×x+1][-1]+2)>>2
[1128] 6. When cntT+cntL is not equal to 0, the variables minY, maxY, minC and maxC are derived as follows:
[1129] —When cntT+cntL is equal to 2, pSelComp[3] is set equal to pSelComp[0], pSelComp[2] is set equal to pSelComp[1], pSelComp[0] is set equal to pSelComp[1], pSelComp[1] is set equal to pSelComp[3], and Comp is replaced with DsY and C.
[1130] —The arrays minGrpIdx and maxGrpIdx are derived as follows:
[1131] minGrpIdx[0]=0 (380)
[1132] minGrpIdx[1]=2 (381)
[1133] maxGrpIdx[0]=1 (382)
[1134] maxGrpIdx[1]=3 (383)
[1135] —When pSelDsY[minGrpIdx[0]] is greater than pSelDsY[minGrpIdx[1]], minGrpIdx[0] and minGrpIdx[1] are swapped as follows:
[1136] (minGrpIdx[0], minGrpIdx[1])=Swap(minGrpIdx[0], minGrpIdx[1]) (384)
[1137] —When pSelDsY[maxGrpIdx[0]] is greater than pSelDsY[maxGrpIdx[1]], maxGrpIdx[0] and maxGrpIdx[1] are swapped as follows:
[1138] (maxGrpIdx[0], maxGrpIdx[1])=Swap(maxGrpIdx[0], maxGrpIdx[1]) (385)
[1139] —When pSelDsY[minGrpIdx[0]] is greater than pSelDsY[maxGrpIdx[1]], the arrays minGrpIdx and maxGrpIdx are swapped as follows:
[1140] (minGrpIdx, maxGrpIdx) = Swap (minGrpIdx, maxGrpIdx) (386)
[1141] —When pSelDsY[minGrpIdx[1]] is greater than pSelDsY[maxGrpIdx[0]], minGrpIdx[1] and maxGrpIdx[0] are swapped as follows:
[1142] (minGrpIdx[1], maxGrpIdx[0])=Swap(minGrpIdx[1], maxGrpIdx[0]) (387)
[1143] —The variables maxY, maxC, minY and minC are derived as follows:
[1144] maxY=(pSelDsY[maxGrpIdx[0]]+pSelDsY[maxGrpIdx[1]]+1)>>1 (388)
[1145] maxC=(pSelC[maxGrpIdx[0]]+pSelC[maxGrpIdx[1]]+1)>>1 (389)
[1146] minY=(pSelDsY[minGrpIdx[0]]+pSelDsY[minGrpIdx[1]]+1)>>1 (390)
[1147] minC=(pSelC[minGrpIdx[0]]+pSelC[minGrpIdx[1]]+1)>>1(391)
[1148] 7. The variables a, b and k are derived as follows:
[1149] — If numSampL is equal to 0 and numSampT is equal to 0, then the following applies:
[1150] k=0 (392)
[1151] a=0 (393)
[1152] b=1<<(BitDepth-1) (394)
[1153] — Otherwise, the following applies:
[1154] diff=maxY-minY (395)
[1155] — If diff is not equal to 0, the following applies:
[1156] diffC=maxC-minC (396)
[1157] x=Floor(Log2(diff)) (397)
[1158] normDiff=((diff<<4)>>x)&15 (398)
[1159] x+=(normDiff!=0)? 1:0 (399)
[1160] y=Abs(diffC)>0? Floor(Log2(Abs(diffC)))+1:0 (400)
[1161] a=(diffC×(divSigTable[normDiff]|8)+2 y-1 )>>y (401)
[1162] k=((3+xy)<1)? 1:3+xy (402)
[1163] a=((3+xy)<1)? Sign(a)×15:a (403)
[1164] b=minC-((a×minY)>>k) (404)
[1165] where divSigTable[] is specified as follows:
[1166] divSigTable[]={0, 7, 6, 5, 5, 4, 4, 3, 3, 2, 2, 1, 1, 1, 1, 0} (405)
[1167] — Otherwise (diff is equal to 0), the following applies:
[1168] k=0 (406)
[1169] a=0 (407)
[1170] b=minC (408)
[1171] 8. The predicted sample point predSample[x][y], where x = 0..nTbW-1, y = 0..nTbH-1 is derived as follows:
[1172] predSamples[x][y]=Clip1(((pDsY[x][y]×a)>>k)+b) (409)
[1173] NOTE - This process uses sps_chroma_vertical_collocated_flag. However, to simplify the implementation, it does not use sps_chroma_horizontal_collocated_flag.
[1174] 5.7. Example 7
[1175] The working draft specified in JVET-Q2001-vE may be modified as follows. 8.4.5.2.13
[1177] The inputs to this process are:
[1178] —Intra prediction mode predModeIntra,
[1179] - the sample position of the upper left sample of the current transform block relative to the upper left sample of the current picture (xTbC, yTbC),
[1180] - variable nTbW specifying the transform block width,
[1181] - variable nTbH specifying the transform block height,
[1182] — variable cIdx that specifies the color component of the current block,
[1183] - Chroma neighboring samples p[x][y], where x=-1, y=0..2×nTbH-1 and x=0..2×nTbW-1, y=-1.
[1184] The output of this process is the predicted samples predSamples[x][y], where x=0..nTbW-1, y=0..nTbH-1.
[1185] The current brightness position (xTbY, yTbY) is derived as follows:
[1186] (xTbY, yTbY) = (xTbC<<(SubWidthC-1), yTbC<<(SubHeightC-1)) (351)
[1187] The variables availL, availT, and availTL are derived as follows:
[1188] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using as input the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY-1, yTbY), checkPredModeY set equal to false (FLASE), and cIdx, and assign the output to availL.
[1189] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using as input the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY, yTbY-1), checkPredModeY set equal to false (FLASE), and cIdx, and assign the output to availT.
[1190] —The variable availTL is derived as follows:
[1191] availTL=availL&&availT (352)
[1192] —The number of available top-right adjacent chroma samples numTopRight is derived as follows:
[1193] —The variable numTopRight is set to 0, and availTR is set to TRUE.
[1194] - When predModeIntra is equal to INTRA_T_CCLM, the following applies for x=nTbW..2×nTbW-1 until availTR is equal to FALSE or x is equal to 2×nTbW-1:
[1195] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using as input the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY+x, yTbY-1), checkPredModeY set equal to false (FLASE), and cIdx, and assign the output to availTR.
[1196] —When availTR is equal to TRUE, numTopRight is increased by 1.
[1197] —The number of available lower left adjacent chroma samples numLeftBelow is derived as follows:
[1198] —The variable numLeftBelow is set to 0, and availLB is set to TRUE.
[1199] - When predModeIntra is equal to INTRA_L_CCLM, the following applies for y=nTbH..2×nTbH-1 until availLB is equal to FALSE or y is equal to 2×nTbH-1:
[1200] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using as input the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY-1, yTbY+y), checkPredModeY set equal to false (FLASE), and cIdx, and assign the output to availLB.
[1201] —When availLB is equal to TRUE, numLeftBelow is increased by 1.
[1202] The number of available adjacent chroma samples numSampT at the top and upper right and the number of available adjacent chroma samples numSampL at the left and lower left are derived as follows:
[1203] — If predModeIntra is equal to INTRA_LT_CCLM, the following applies:
[1204] numSampT=availT? nTbW:0 (353)
[1205] numSampL=availL? nTbH:0 (354)
[1206] — Otherwise, the following applies:
[1207] numSampT=(availT&&predModeIntra==INTRA_T_CCLM)? (nTbW+Min(numTopRight,nTbH)):0 (355)
[1208] numSampL=(availL&&predModeIntra==INTRA_L_CCLM)? (nTbH+Min(numLeftBelow,nTbW)):0 (356)
[1209] The variable bCTUboundary is derived as follows:
[1210] bCTUboundary=(yTbY&(CtbSizeY-1)==0)? TRUE:FALSE (357)
[1211] The variable cntN and array pickPosN where N is replaced by L and T are derived as follows:
[1212] —The variable numIs4N is derived as follows:
[1213] numIs4N=((availT&&availL&&predModeIntra==INTRA_LT_CCLM)?0:1) (358)
[1214] —The variable startPosN is set equal to numSampN>>(2+numIs4N).
[1215] —The variable pickStepN is set equal to Max(1, numSampN>>(1+numIs4N)).
[1216] —If availN is equal to TRUE and predModeIntra is equal to INTRA_LT_CCLM or INTRA_N_CCLM, the following assignments are made:
[1217] —cntN is set equal to Min(numSampN, (1+numIs4N)<<1).
[1218] —pickPosN[pos] is set equal to (startPosN+pos×pickStepN), where pos=0..cntN-1.
[1219] Otherwise, cntN is set equal to 0.
[1220] The predicted sample predSample[x][y], where x = 0..nTbW-1, y = 0..nTbH-1, is derived as follows:
[1221] — If numSampL and numSampT are both equal to 0, the following applies:
[1222] predSamples[x][y]=1<<(BitDepth-1) (359)
[1223] — Otherwise, the following ordered steps apply:
[1224] 1. The co-located luma sample pY[x][y] where x=0..nTbW×SubWidthC-1, y=0..TbH×SubHeightC-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).
[1225] 2. The adjacent brightness samples pY[x][y] are derived as follows:
[1226] —When numSampL is greater than 0, the adjacent left luma sample pY[x][y] where x=-1..-3, y=0..SubHeightC×numSampL-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).
[1227] - when availT is equal to FALSE, where x = -1..SubWidthC×numSampT-1, The adjacent top luma sample pY[x][y] is set equal to the luma sample pY[x][0].
[1228] - When availL is equal to FALSE, the adjacent left luma sample pY[x][y] where x = -1..-3, y = -1..SubHeightC×numSampL-1 is set equal to luma sample pY[0][y].
[1229] - When numSampT is greater than 0, x = 0..SubWidthC×numSampT-1, The neighboring top luma sample pY[x][y] of [[-2]] is set equal to the reconstructed luma sample before the deblocking filtering process at the position (xTbY+x, yTbY+y).
[1230] —When availTL is equal to true (TRUE), the adjacent upper left luma sample pY[x][y] where x=-1, y=-1, -2 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).
[1231] 3. The downsampled co-located luminance sample pDsY[x][y], where x = 0..nTbW-1, y = 0..nTbH-1, is derived as follows:
[1232] —If SubWidthC and SubHeightC are both equal to 1, then the following applies:
[1233] —pDsY[x][y], where x=1..nTbW-1, y=1..nTbH-1 is derived as follows:
[1234] pDstY[x][y]=pY[x][y] (360)
[1235] — Otherwise, the following applies:
[1236] —The one-dimensional filter coefficient arrays F1 and F2 and the two-dimensional filter coefficient arrays F3 and F4 are specified as follows.
[1237] F1[0]=2,F1[1]=0 (361)
[1238] F2[0]=1,F2[1]=2,F2[2]=1 (362)
[1239] F3[i][j]=F4[i][j]=0, where i=0..2, j=0..2 (363)
[1240] — If SubWidthC and SubHeightC are both equal to 2, then the following applies:
[1241] F1[0]=1,F1[1]=1 (364)
[1242] F3[0][1]=1,F3[1][1]=4,F3[2][1]=1,F3[1][0]=1,F3[1][2]=1 (365)
[1243] F4[0][1]=1,F4[1][1]=2,F4[2][1]=1 (366)
[1244] F4[0][2]=1,F4[1][2]=2,F4[2][2]=1 (367)
[1245] — Otherwise, the following applies:
[1246] F3[1][1]=8 (368)
[1247] F4[0][1]=2, F4[1][1]=4, F4[2][1]=2, (369)
[1248] - If sps_chroma_vertical_collocated_flag is equal to 1, the following applies:
[1249] —pDsY[x][y], where x=0..nTbW-1, y=0..nTbH-1 is derived as follows:
[1250] pDsY[x][y]=(F3[1][0]×pY[SubWidthC×x][SubHeightC×y-1]+
[1251] F3[0][1]×pY[SubWidthC×x-1][SubHeightC×y]+
[1252] F3[1][1]×pY[SubWidthC×x][SubHeightC×y]+(370)
[1253] F3[2][1]×pY[SubWidthC×x+1][SubHeightC×y]+
[1254] F3[1][2]×pY[SubWidthC×x][SubHeightC×y+1]+4)>>3
[1255] - Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies:
[1256] —pDsY[x][y], where x=0..nTbW-1, y=0..nTbH-1 is derived as follows:
[1257] pDsY[x][y]=(F4[0][1]×pY[SubWidthC×x-1][SubHeightC×y]+
[1258] F4[0][2]×pY[SubWidthC×x-1][SubHeightC×y+1]+
[1259] F4[1][1]×pY[SubWidthC×x][SubHeightC×y]+(371)
[1260] F4[1][2]×pY[SubWidthC×x][SubHeightC×y+1]+
[1261] F4[2][1]×pY[SubWidthC×x+1][SubHeightC×y]+
[1262] F4[2][2]×pY[SubWidthC×x+1][SubHeightC×y+1]+4)>>3
[1263] 4. When numSampL is greater than 0, the selected adjacent left chroma sample pSelC[idx] is set equal to p[-1][pickPosL[idx]], where idx = 0..cntL-1, and the selected downsampled adjacent left luma sample pSelDsY[idx], where idx = 0..cntL-1 is derived as follows:
[1264] —The variable y is set equal to pickPosL[idx].
[1265] —If SubWidthC and SubHeightC are both equal to 1, then the following applies:
[1266] pSelDsY[idx]=pY[-1][y] (372)
[1267] — Otherwise, the following applies:
[1268] - If sps_chroma_vertical_collocated_flag is equal to 1, the following applies:
[1269] pSelDsY[idx]=(F3[1][0]×pY[-SubWidthC][SubHeightC×y-1]+
[1270] F3[0][1]×pY[-1-SubWidthC][SubHeightC×y]+
[1271] F3[1][1]×pY[-SubWidthC][SubHeightC×y]+(373)
[1272] F3[2][1]×pY[1-SubWidthC][SubHeightC×y]+
[1273] F3[1][2]×pY[-SubWidthC][SubHeightC×y+1]+4)>>3
[1274] - Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies:
[1275] pSelDsY[idx]=(F4[0][1]×pY[-1-SubWidthC][SubHeightC×y]+
[1276] F4[0][2]×pY[-1-SubWidthC][SubHeightC×y+1]+
[1277] F4[1][1]×pY[-SubWidthC][SubHeightC×y]+(374)
[1278] F4[1][2]×pY[-SubWidthC][SubHeightC×y+1]+
[1279] F4[2][1]×pY[1-SubWidthC][SubHeightC×y]+
[1280] F4[2][2]×pY[1-SubWidthC][SubHeightC×y+1]+4)>>3
[1281] 5. When numSampT is greater than 0, the selected adjacent top chroma sample pSelC[idx] is set equal to p[pickPosT[idx-cntL]][-1], where idx=cntL..cntL+cntT-1, and the downsampled adjacent top luma sample pSelDsY[idx], where idx=0..cntL+cntT-1 is specified as follows:
[1282] —The variable x is set equal to pickPosT[idx-cntL].
[1283] —If SubWidthC and SubHeightC are both equal to 1, then the following applies:
[1284] pSelDsY[idx]=pY[x][-1] (375)
[1285] — Otherwise, the following applies:
[1286] - If sps_chroma_vertical_collocated_flag is equal to 1, the following applies:
[1287] — If bCTUboundary is equal to FALSE, the following applies:
[1288] pSelDsY[idx]=(F3[1][0]×pY[SubWidthC×x][-1-SubHeightC]+
[1289] F3[0][1]×pY[SubWidthC×x-1][-SubHeightC]+
[1290] F3[1][1]×pY[SubWidthC×x][-SubHeightC]+(376)
[1291] F3[2][1]×pY[SubWidthC×x+1][-SubHeightC]+
[1292] F3[1][2]×pY[SubWidthC×x][1-SubHeightC]+4)>>3
[1293] — Otherwise (bCTUboundary is TRUE), the following applies:
[1294] pSelDsY[idx]=(F2[0]×pY[SubWidthC×x-1][-1]+
[1295] F2[1]×pY[SubWidthC×x][-1]+ (377)
[1296] F2[2]×pY[SubWidthC×x+1][-1]+2)>>2
[1297] - Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies:
[1298] — If bCTUboundary is equal to FALSE, the following applies:
[1299] pSelDsY[idx]=(F4[0][1]×pY[SubWidthC x-1][-1]+
[1300] F4[0][2]×pY[SubWidthC×x-1][-2]+
[1301] F4[1][1]×pY[SubWidthC×x][-1]+ (378)
[1302] F4[1][2]×pY[SubWidthC×x][-2]+
[1303] F4[2][1]×pY[SubWidthC×x+1][-1]+
[1304] F4[2][2]×pY[SubWidthC×x+1][-2]+4)>>3
[1305] — Otherwise (bCTUboundary is TRUE), the following applies:
[1306] pSelDsY[idx]=(F2[0]×pY[SubWidthC×x-1][-1]+
[1307] F2[1]×pY[SubWidthC×x][-1]+ (379)
[1308] F2[2]×pY[SubWidthC×x+1][-1]+2)>>2
[1309] 6. When cntT+cntL is not equal to 0, the variables minY, maxY, minC and maxC are derived as follows:
[1310] —When cntT+cntL is equal to 2, pSelComp[3] is set equal to pSelComp[0], pSelComp[2] is set equal to pSelComp[1], pSelComp[0] is set equal to pSelComp[1], pSelComp[1] is set equal to pSelComp[3], and Comp is replaced with DsY and C.
[1311] —The arrays minGrpIdx and maxGrpIdx are derived as follows:
[1312] minGrpIdx[0]=0 (380)
[1313] minGrpIdx[1]=2 (381)
[1314] maxGrpIdx[0]=1 (382)
[1315] maxGrpIdx[1]=3 (383)
[1316] —When pSelDsY[minGrpIdx[0]] is greater than pSelDsY[minGrpIdx[1]], minGrpIdx[0] and minGrpIdx[1] are swapped as follows:
[1317] (minGrpIdx[0], minGrpIdx[1])=Swap(minGrpIdx[0], minGrpIdx[1]) (384)
[1318] —When pSelDsY[maxGrpIdx[0]] is greater than pSelDsY[maxGrpIdx[1]], maxGrpIdx[0] and maxGrpIdx[1] are swapped as follows:
[1319] (maxGrpIdx[0], maxGrpIdx[1])=Swap(maxGrpIdx[0], maxGrpIdx[1]) (385)
[1320] —When pSelDsY[minGrpIdx[0]] is greater than pSelDsY[maxGrpIdx[1]], the arrays minGrpIdx and maxGrpIdx are swapped as follows:
[1321] (minGrpIdx, maxGrpIdx) = Swap (minGrpIdx, maxGrpIdx) (386)
[1322] —When pSelDsY[minGrpIdx[1]] is greater than pSelDsY[maxGrpIdx[0]], minGrpIdx[1] and maxGrpIdx[0] are swapped as follows:
[1323] (minGrpIdx[1], maxGrpIdx[0])=Swap(minGrpIdx[1], maxGrpIdx[0]) (387)
[1324] —The variables maxY, maxC, minY and minC are derived as follows:
[1325] maxY=(pSelDsY[maxGrpIdx[0]]+pSelDsY[maxGrpIdx[1]]+1)>>1 (388)
[1326] maxC=(pSelC[maxGrpIdx[0]]+pSelC[maxGrpIdx[1]]+1)>>1 (389)
[1327] minY=(pSelDsY[minGrpIdx[0]]+pSelDsY[minGrpIdx[1]]+1)>>1 (390)
[1328] minC=(pSelC[minGrpIdx[0]]+pSelC[minGrpIdx[1]]+1)>>1(391)
[1329] 7. The variables a, b and k are derived as follows:
[1330] — If numSampL is equal to 0 and numSampT is equal to 0, then the following applies:
[1331] k=0 (392)
[1332] a=0 (393)
[1333] b=1<<(BitDepth-1) (394)
[1334] — Otherwise, the following applies:
[1335] diff=maxY-minY (395)
[1336] — If diff is not equal to 0, the following applies:
[1337] diffC=maxC-minC (396)
[1338] x=Floor(Log2(diff)) (397)
[1339] normDiff=((diff<<4)>>x)&15 (398)
[1340] x+=(normDiff!=0)? 1:0 (399)
[1341] y=Abs(diffC)>0? Floor(Log2(Abs(diffC)))+1:0 (400)
[1342] a=(diffC×(divSigTable[normDiff]|8)+2 y -1)>>y (401)
[1343] k=((3+xy)<1)? 1:3+xy (402)
[1344] a=((3+xy)<1)? Sign(a)×15:a (403)
[1345] b=minC-((a×minY)>>k) (404)
[1346] where divSigTable[] is specified as follows:
[1347] divSigTable[]={0, 7, 6, 5, 5, 4, 4, 3, 3, 2, 2, 1, 1, 1, 1, 0} (405)
[1348] — Otherwise (diff is equal to 0), the following applies:
[1349] k=0 (406)
[1350] a=0 (407)
[1351] b=minC (408)
[1352] 8. The predicted sample point predSample[x][y], where x = 0..nTbW-1, y = 0..nTbH-1 is derived as follows:
[1353] predSamples[x][y]=Clip1(((pDsY[x][y]×a)>>k)+b) (409)
[1354] NOTE - This process uses sps_chroma_vertical_collocated_flag. However, to simplify the implementation, it does not use sps_chroma_horizontal_collocated_flag.
[1355] 5.8. Example 8
[1356] The working draft specified in JVET-Q2001-vE may be modified as follows. 8.4.5.2.13
[1358] The inputs to this process are:
[1359] —Intra prediction mode predModeIntra,
[1360] - the sample position of the upper left sample of the current transform block relative to the upper left sample of the current picture (xTbC, yTbC),
[1361] - variable nTbW specifying the transform block width,
[1362] - variable nTbH specifying the transform block height,
[1363] — variable cIdx that specifies the color component of the current block,
[1364] —Chroma neighboring samples p[x][y], where x=-1, y=0..2×nTbH-1, x=0.2×nTbW-1, y=-1.
[1365] The output of this process is the predicted samples predSamples[x][y], where x=0..nTbW-1, y=0..nTbH-1.
[1366] The current brightness position (xTbY, yTbY) is derived as follows:
[1367] (xTbY, yTbY) = (xTbC<<(SubWidthC-1), yTbC<<(SubHeightC-1)) (351)
[1368] The variables availL, availT, and availTL are derived as follows:
[1369] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using as input the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY-1, yTbY), checkPredModeY set equal to false (FLASE), and cIdx, and assign the output to availL.
[1370] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using as input the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY, yTbY-1), checkPredModeY set equal to false (FLASE), and cIdx, and assign the output to availT.
[1371]
[1372] [[—The variable availTL is derived as follows:
[1373] availTL=availL&&availT (352)]]
[1374] —The number of available top-right adjacent chroma samples numTopRight is derived as follows:
[1375] —The variable numTopRight is set to 0, and availTR is set to TRUE.
[1376] - When predModeIntra is equal to INTRA_T_CCLM, the following applies for x=nTbW..2×nTbW-1 until availTR is equal to FALSE or x is equal to 2×nTbW-1:
[1377] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using as input the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY+x, yTbY-1), checkPredModeY set equal to false (FLASE), and cIdx, and assign the output to availTR.
[1378] —When availTR is equal to TRUE, numTopRight is increased by 1.
[1379] —The number of available lower left adjacent chroma samples numLeftBelow is derived as follows:
[1380] —The variable numLeftBelow is set to 0, and availLB is set to TRUE.
[1381] - When predModeIntra is equal to INTRA_L_CCLM, the following applies for y=nTbH..2×nTbH-1 until availLB is equal to FALSE or y is equal to 2×nTbH-1:
[1382] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using as input the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY-1, yTbY+y), checkPredModeY set equal to false (FLASE), and cIdx, and assign the output to availLB.
[1383] —When availLB is equal to TRUE, numLeftBelow is increased by 1.
[1384] The number of available adjacent chroma samples numSampT at the top and upper right and the number of available adjacent chroma samples numSampL at the left and lower left are derived as follows:
[1385] — If predModeIntra is equal to INTRA_LT_CCLM, the following applies:
[1386] numSampT=availT? nTbW:0 (353)
[1387] numSampL=availL? nTbH:0 (354)
[1388] — Otherwise, the following applies:
[1389] numSampT=(availT&&predModeIntra==INTRA_T_CCLM)?
[1390] (nTbW+Min(numTopRight,nTbH)):0 (355)
[1391] numSampL=(availL&&predModeIntra==INTRA_L_CCLM)? (nTbH+Min(numLeftBelow,nTbW)):0 (356)
[1392] The variable bCTUboundary is derived as follows:
[1393] bCTUboundary=(yTbY&(CtbSizeY-1)==0)? TRUE:FALSE (357)
[1394] The variable cntN and array pickPosN where N is replaced by L and T are derived as follows:
[1395] —The variable numIs4N is derived as follows:
[1396] numIs4N=((availT&&availL&&predModeIntra==INTRA_LT_CCLM)?0:1) (358)
[1397] —The variable startPosN is set equal to numSampN>>(2+numIs4N).
[1398] —The variable pickStepN is set equal to Max(1, numSampN>>(1+numIs4N)).
[1399] —If availN is equal to TRUE and predModeIntra is equal to INTRA_LT_CCLM or INTRA_N_CCLM, the following assignments are made:
[1400] —cntN is set equal to Min(numSampN, (1+numIs4N)<<1).
[1401] —pickPosN[pos] is set equal to (startPosN+pos×pickStepN), where pos=0..cntN-1.
[1402] Otherwise, cntN is set equal to 0.
[1403] The predicted sample predSample[x][y], where x = 0..nTbW-1, y = 0..nTbH-1, is derived as follows:
[1404] — If numSampL and numSampT are both equal to 0, the following applies:
[1405] predSamples[x][y]=1<<(BitDepth-1) (359)
[1406] — Otherwise, the following ordered steps apply:
[1407] 1. The co-located luma sample pY[x][y] where x=0..nTbW×SubWidthC-1, y=0..TbH×SubHeightC-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).
[1408] 2. The adjacent brightness samples pY[x][y] are derived as follows:
[1409] —When numSampL is greater than 0, the adjacent left luma sample pY[x][y] where x=-1..-3, y=0..SubHeightC×numSampL-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).
[1410] - When availT is equal to FALSE, the adjacent top luma sample pY[x][y] where x = -1..SubWidthC×numSampT-1, y = -1..-2 is set equal to luma sample pY[x][0].
[1411] - When availL is equal to FALSE, the adjacent left luma sample pY[x][y] where x = -1..-3, y = -1..SubHeightC×numSampL-1 is set equal to luma sample pY[0][y].
[1412] —When numSampT is greater than 0, the adjacent top luma sample pY[x][y] where x=0..SubWidthC×numSampT-1, y=-1..-2 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).
[1413] -[[when]] When availTL is equal to true (TRUE), the adjacent upper left luma sample pY[x][y] of x=-1,-2, y=-1,-2 is set equal to the reconstructed luma sample before the deblocking filtering process at the position (xTbY+x, yTbY+y).
[1414]
[1415] 3. The downsampled co-located luminance sample pDsY[x][y], where x = 0..nTbW-1, y = 0..nTbH-1, is derived as follows:
[1416] —If SubWidthC and SubHeightC are both equal to 1, then the following applies:
[1417] —pDsY[x][y], where x=1..nTbW-1, y=1..nTbH-1 is derived as follows:
[1418] pDstY[x][y]=pY[x][y] (360)
[1419] — Otherwise, the following applies:
[1420] —The one-dimensional filter coefficient arrays F1 and F2 and the two-dimensional filter coefficient arrays F3 and F4 are specified as follows.
[1421] F1[0]=2,F1[1]=0 (361)
[1422] F2[0]=1,F2[1]=2,F2[2]=1 (362)
[1423] F3[i][j]=F4[i][j]=0, where i=0..2, j=0..2 (363)
[1424] — If SubWidthC and SubHeightC are both equal to 2, then the following applies:
[1425] F1[0]=1,F1[1]=1 (364)
[1426] F3[0][1]=1,F3[1][1]=4,F3[2][1]=1,F3[1][0]=1,F3[1][2]=1 (365)
[1427] F4[0][1]=1,F4[1][1]=2,F4[2][1]=1 (366)
[1428] F4[0][2]=1,F4[1][2]=2,F4[2][2]=1 (367)
[1429] — Otherwise, the following applies:
[1430] F3[1][1]=8 (368)
[1431] F4[0][1]=2, F4[1][1]=4, F4[2][1]=2, (369)
[1432] - If sps_chroma_vertical_collocated_flag is equal to 1, the following applies:
[1433] —pDsY[x][y], where x=0..nTbW-1, y=0..nTbH-1 is derived as follows:
[1434] pDsY[x][y]=(F3[1][0]×pY[SubWidthC×x][SubHeightC×y-1]+
[1435] F3[0][1]×pY[SubWidthC×x-1][SubHeightC×y]+
[1436] F3[1][1]×pY[SubWidthC×x][SubHeightC×y]+(370)
[1437] F3[2][1]×pY[SubWidthC×x+1][SubHeightC×y]+
[1438] F3[1][2]×pY[SubWidthC×x][SubHeightC×y+1]+4)>>3
[1439] - Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies:
[1440] —pDsY[x][y], where x=0..nTbW-1, y=0..nTbH-1 is derived as follows:
[1441] pDsY[x][y]=(F4[0][1]×pY[SubWidthC×x-1][SubHeightC×y]+
[1442] F4[0][2]×pY[SubWidthC×x-1][SubHeightC×y+1]+
[1443] F4[1][1]×pY[SubWidthC×x][SubHeightC×y]+(371)
[1444] F4[1][2]×pY[SubWidthC×x][SubHeightC×y+1]+
[1445] F4[2][1]×pY[SubWidthC×x+1][SubHeightC×y]+
[1446] F4[2][2]×pY[SubWidthC×x+1][SubHeightC×y+1]+4)>>3
[1447] 4. When numSampL is greater than 0, the selected adjacent left chroma sample pSelC[idx] is set equal to p[-1][pickPosL[idx]], where idx = 0..cntL-1, and the selected downsampled adjacent left luma sample pSelDsY[idx], where idx = 0..cntL-1 is derived as follows:
[1448] —The variable y is set equal to pickPosL[idx].
[1449] —If SubWidthC and SubHeightC are both equal to 1, then the following applies:
[1450] pSelDsY[idx]=pY[-1][y] (372)
[1451] — Otherwise, the following applies:
[1452] - If sps_chroma_vertical_collocated_flag is equal to 1, the following applies:
[1453] pSelDsY[idx]=(F3[1][0]×pY[-SubWidthC][SubHeightC×y-1]+
[1454] F3[0][1]×pY[-1-SubWidthC][SubHeightC×y]+
[1455] F3[1][1]×pY[-SubWidthC][SubHeightC×y]+(373)
[1456] F3[2][1]×pY[1-SubWidthC][SubHeightC×y]+
[1457] F3[1][2]×pY[-SubWidthC][SubHeightC×y+1]+4)>>3
[1458] - Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies:
[1459] pSelDsY[idx]=(F4[0][1]×pY[-1-SubWidthC][SubHeightC×y]+
[1460] F4[0][2]×pY[-1-SubWidthC][SubHeightC×y+1]+
[1461] F4[1][1]×pY[-SubWidthC][SubHeightC×y]+(374)
[1462] F4[1][2]×pY[-SubWidthC][SubHeightC×y+1]+
[1463] F4[2][1]×pY[1-SubWidthC][SubHeightC×y]+
[1464] F4[2][2]×pY[1-SubWidthC][SubHeightC×y+1]+4)>>3
[1465] 5. When numSampT is greater than 0, the selected adjacent top chroma sample pSelC[idx] is set equal to p[pickPosT[idx-cntL]][-1], where idx=cntL..cntL+cntT-1, and the downsampled adjacent top luma sample pSelDsY[idx], where idx=0..cntL+cntT-1 is specified as follows:
[1466] —The variable x is set equal to pickPosT[idx-cntL].
[1467] —If SubWidthC and SubHeightC are both equal to 1, then the following applies:
[1468] pSelDsY[idx]=pY[x][-1] (375)
[1469] — Otherwise, the following applies:
[1470] - If sps_chroma_vertical_collocated_flag is equal to 1, the following applies:
[1471] — If bCTUboundary is equal to FALSE, the following applies:
[1472] pSelDsY[idx]=(F3[1][0]×pY[SubWidthC×x][-1-SubHeightC]+
[1473] F3[0][1]×pY[SubWidthC×x-1][-SubHeightC]+
[1474] F3[1][1]×pY[SubWidthC×x][-SubHeightC]+(376)
[1475] F3[2][1]×pY[SubWidthC×x+1][-SubHeightC]+
[1476] F3[1][2]×pY[SubWidthC×x][1-SubHeightC]+4)>>3
[1477] — Otherwise (bCTUboundary is TRUE), the following applies:
[1478] pSelDsY[idx]=(F2[0]×pY[SubWidthC×x-1][-1]+
[1479] F2[1]×pY[SubWidthC×x][-1]+(377)
[1480] F2[2]×pY[SubWidthC×x+1][-1]+2)>>2
[1481] - Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies:
[1482] — If bCTUboundary is equal to FALSE, the following applies:
[1483] pSelDsY[idx]=(F4[0][1]×pY[SubWidthC x-1][-1]+
[1484] F4[0][2]×pY[SubWidthC×x-1][-2]+
[1485] F4[1][1]×pY[SubWidthC×x][-1]+(378)
[1486] F4[1][2]×pY[SubWidthC×x][-2]+
[1487] F4[2][1]×pY[SubWidthC×x+1][-1]+
[1488] F4[2][2]×pY[SubWidthC×x+1][-2]+4)>>3
[1489] — Otherwise (bCTUboundary is TRUE), the following applies:
[1490] pSelDsY[idx]=(F2[0]×pY[SubWidthC×x-1][-1]+
[1491] F2[1]×pY[SubWidthC×x][-1]+(379)
[1492] F2[2]×pY[SubWidthC×x+1][-1]+2)>>2
[1493] 6. When cntT+cntL is not equal to 0, the variables minY, maxY, minC and maxC are derived as follows:
[1494] —When cntT+cntL is equal to 2, pSelComp[3] is set equal to pSelComp[0], pSelComp[2] is set equal to pSelComp[1], pSelComp[0] is set equal to pSelComp[1], pSelComp[1] is set equal to pSelComp[3], and Comp is replaced with DsY and C.
[1495] —The arrays minGrpIdx and maxGrpIdx are derived as follows:
[1496] minGrpIdx[0]=0 (380)
[1497] minGrpIdx[1]=2 (381)
[1498] maxGrpIdx[0]=1 (382)
[1499] maxGrpIdx[1]=3 (383)
[1500] —When pSelDsY[minGrpIdx[0]] is greater than pSelDsY[minGrpIdx[1]], minGrpIdx[0] and minGrpIdx[1] are swapped as follows:
[1501] (minGrpIdx[0], minGrpIdx[1])=Swap(minGrpIdx[0], minGrpIdx[1]) (384)
[1502] —When pSelDsY[maxGrpIdx[0]] is greater than pSelDsY[maxGrpIdx[1]], maxGrpIdx[0] and maxGrpIdx[1] are swapped as follows:
[1503] (maxGrpIdx[0], maxGrpIdx[1])=Swap(maxGrpIdx[0], maxGrpIdx[1]) (385)
[1504] —When pSelDsY[minGrpIdx[0]] is greater than pSelDsY[maxGrpIdx[1]], the arrays minGrpIdx and maxGrpIdx are swapped as follows:
[1505] (minGrpIdx, maxGrpIdx) = Swap (minGrpIdx, maxGrpIdx) (386)
[1506] —When pSelDsY[minGrpIdx[1]] is greater than pSelDsY[maxGrpIdx[0]], minGrpIdx[1] and maxGrpIdx[0] are swapped as follows:
[1507] (minGrpIdx[1], maxGrpIdx[0])=Swap(minGrpIdx[1], maxGrpIdx[0]) (387)
[1508] —The variables maxY, maxC, minY and minC are derived as follows:
[1509] maxY=(pSelDsY[maxGrpIdx[0]]+pSelDsY[maxGrpIdx[1]]+1)>>1 (388)
[1510] maxC=(pSelC[maxGrpIdx[0]]+pSelC[maxGrpIdx[1]]+1)>>1 (389)
[1511] minY=(pSelDsY[minGrpIdx[0]]+pSelDsY[minGrpIdx[1]]+1)>>1 (390)
[1512] minC=(pSelC[minGrpIdx[0]]+pSelC[minGrpIdx[1]]+1)>>1(391)
[1513] 7. The variables a, b and k are derived as follows:
[1514] — If numSampL is equal to 0 and numSampT is equal to 0, then the following applies:
[1515] k=0 (392)
[1516] a=0 (393)
[1517] b=1<<(BitDepth-1) (394)
[1518] — Otherwise, the following applies:
[1519] diff=maxY-minY (395)
[1520] — If diff is not equal to 0, the following applies:
[1521] diffC=maxC-minC (396)
[1522] x=Floor(Log2(diff)) (397)
[1523] normDiff=((diff<<4)>>x)&15 (398)
[1524] x+=(normDiff!=0)? 1:0 (399)
[1525] y=Abs(diffC)>0? Floor(Log2(Abs(diffC)))+1:0 (400)
[1526] a=(diffC×(divSigTable[normDiff]|8)+2 y -1)>>y (401)
[1527] k=((3+xy)<1)? 1:3+xy (402)
[1528] a=((3+xy)<1)? Sign(a)×15:a (403)
[1529] b=minC-((a×minY)>>k) (404)
[1530] where divSigTable[] is specified as follows:
[1531] divSigTable[]={0, 7, 6, 5, 5, 4, 4, 3, 3, 2, 2, 1, 1, 1, 1, 0} (405)
[1532] — Otherwise (diff is equal to 0), the following applies:
[1533] k=0 (406)
[1534] a=0 (407)
[1535] b=minC (408)
[1536] 8. The predicted sample point predSample[x][y], where x = 0..nTbW-1, y = 0..nTbH-1 is derived as follows:
[1537] predSamples[x][y]=Clip1(((pDsY[x][y]×a)>>k)+b) (409)
[1538] NOTE - This process uses sps_chroma_vertical_collocated_flag. However, to simplify the implementation, it does not use sps_chroma_horizontal_collocated_flag.
[1539] 5.9. Example 9
[1540] The working draft specified in JVET-Q2001-vE may be modified as follows. 8.4.5.2.13
[1542] The inputs to this process are:
[1543] —Intra prediction mode predModeIntra,
[1544] - the sample position of the upper left sample of the current transform block relative to the upper left sample of the current picture (xTbC, yTbC),
[1545] - variable nTbW specifying the transform block width,
[1546] - variable nTbH specifying the transform block height,
[1547] — variable cIdx that specifies the color component of the current block,
[1548] —Chroma neighboring samples p[x][y], where x=-1, y=0..2×nTbH-1, x=0.2×nTbW-1, y=-1.
[1549] The output of this process is the predicted samples predSamples[x][y], where x=0..nTbW-1, y=0..nTbH-1.
[1550] The current brightness position (xTbY, yTbY) is derived as follows:
[1551] (xTbY, yTbY) = (xTbC<<(SubWidthC-1), yTbC<<(SubHeightC-1)) (351)
[1552] The variables availL, availT, and availTL are derived as follows:
[1553] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using as input the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY-1, yTbY), checkPredModeY set equal to false (FLASE), and cIdx, and assign the output to availL.
[1554] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using as input the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY, yTbY-1), checkPredModeY set equal to false (FLASE), and cIdx, and assign the output to availT.
[1555] —The variable availTL is derived as follows:
[1556] availTL=availL&&availT (352)
[1557] —The number of available top-right adjacent chroma samples numTopRight is derived as follows:
[1558] —The variable numTopRight is set to 0, and availTR is set to TRUE.
[1559] - When predModeIntra is equal to INTRA_T_CCLM, the following applies for x=nTbW..2×nTbW-1 until availTR is equal to FALSE or x is equal to 2×nTbW-1:
[1560] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using as input the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY+x, yTbY-1), checkPredModeY set equal to false (FLASE), and cIdx, and assign the output to availTR.
[1561] —When availTR is equal to TRUE, numTopRight is increased by 1.
[1562] —The number of available lower left adjacent chroma samples numLeftBelow is derived as follows:
[1563] —The variable numLeftBelow is set to 0, and availLB is set to TRUE.
[1564] - When predModeIntra is equal to INTRA_L_CCLM, the following applies for y=nTbH..2×nTbH-1 until availLB is equal to FALSE or y is equal to 2×nTbH-1:
[1565] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using as input the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY-1, yTbY+y), checkPredModeY set equal to false (FLASE), and cIdx, and assign the output to availLB.
[1566] —When availLB is equal to TRUE, numLeftBelow is increased by 1.
[1567] The number of available adjacent chroma samples numSampT at the top and upper right and the number of available adjacent chroma samples numSampL at the left and lower left are derived as follows:
[1568] — If predModeIntra is equal to INTRA_LT_CCLM, the following applies:
[1569] numSampT=availT? nTbW:0 (353)
[1570] numSampL=availL? nTbH:0 (354)
[1571] — Otherwise, the following applies:
[1572] numSampT=(availT&&predModeIntra==INTRA_T_CCLM)? (nTbW+Min(numTopRight,nTbH)):0 (355)
[1573] numSampL=(availL&&predModeIntra==INTRA_L_CCLM)? (nTbH+Min(numLeftBelow,nTbW)):0 (356)
[1574] The variable bCTUboundary is derived as follows:
[1575] bCTUboundary=(yTbY&(CtbSizeY-1)==0)? TRUE:FALSE (357)
[1576] The variable cntN and array pickPosN where N is replaced by L and T are derived as follows:
[1577] —The variable numIs4N is derived as follows:
[1578] numIs4N=((availT&&availL&&predModeIntra==INTRA_LT_CCLM)?0:1) (358)
[1579] —The variable startPosN is set equal to numSampN>>(2+numIs4N).
[1580] —The variable pickStepN is set equal to Max(1, numSampN>>(1+numIs4N)).
[1581] —If availN is equal to TRUE and predModeIntra is equal to INTRA_LT_CCLM or INTRA_N_CCLM, the following assignments are made:
[1582] —cntN is set equal to Min(numSampN, (1+numIs4N)<<1).
[1583] —pickPosN[pos] is set equal to (startPosN+pos×pickStepN), where pos=0..cntN-1.
[1584] Otherwise, cntN is set equal to 0.
[1585] The predicted sample predSample[x][y], where x = 0..nTbW-1, y = 0..nTbH-1, is derived as follows:
[1586] — If numSampL and numSampT are both equal to 0, the following applies:
[1587] predSamples[x][y]=1<<(BitDepth-1) (359)
[1588] — Otherwise, the following ordered steps apply:
[1589] 1. The co-located luma sample pY[x][y] where x=0..nTbW×SubWidthC-1, y=0..TbH×SubHeightC-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).
[1590] 2. The adjacent brightness samples pY[x][y] are derived as follows:
[1591] —When numSampL is greater than 0, the adjacent left luma sample pY[x][y] where x=-1..-3, y=0..SubHeightC×numSampL-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).
[1592] —When availT is equal to FALSE, where The adjacent top luma sample pY[x][y] with y=-1..-2 is set equal to the luma sample pY[x][0].
[1593] [[—When availL is equal to FALSE, the adjacent left luma sample pY[x][y] where x = -1..-3, y = -1..SubHeightC×numSampL-1 is set equal to luma sample pY[0][y]. ]]
[1594] —When numSampT is greater than 0, the adjacent top luma sample pY[x][y] where x=0..SubWidthC×numSampT-1, y=-1..-2 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).
[1595]
[1596] —When availTL is equal to true (TRUE), the adjacent upper left luma sample pY[x][y] where x=-1, y=-1, -2 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).
[1597] 3. The downsampled co-located luminance sample pDsY[x][y], where x = 0..nTbW-1, y = 0..nTbH-1, is derived as follows:
[1598] —If SubWidthC and SubHeightC are both equal to 1, then the following applies:
[1599] —pDsY[x][y], where x=1..nTbW-1, y=1..nTbH-1 is derived as follows:
[1600] pDstY[x][y]=pY[x][y] (360)
[1601] — Otherwise, the following applies:
[1602] —The one-dimensional filter coefficient arrays F1 and F2 and the two-dimensional filter coefficient arrays F3 and F4 are specified as follows.
[1603] F1[0]=2,F1[1]=0 (361)
[1604] F2[0]=1,F2[1]=2,F2[2]=1 (362)
[1605] F3[i][j]=F4[i][j]=0, where i=0..2, j=0..2 (363)
[1606] — If SubWidthC and SubHeightC are both equal to 2, then the following applies:
[1607] F1[0]=1,F1[1]=1 (364)
[1608] F3[0][1]=1,F3[1][1]=4,F3[2][1]=1,F3[1][0]=1,F3[1][2]=1 (365)
[1609] F4[0][1]=1,F4[1][1]=2,F4[2][1]=1 (366)
[1610] F4[0][2]=1,F4[1][2]=2,F4[2][2]=1 (367)
[1611] — Otherwise, the following applies:
[1612] F3[1][1]=8 (368)
[1613] F4[0][1]=2, F4[1][1]=4, F4[2][1]=2, (369)
[1614] - If sps_chroma_vertical_collocated_flag is equal to 1, the following applies:
[1615] —pDsY[x][y], where x=0..nTbW-1, y=0..nTbH-1 is derived as follows:
[1616] pDsY[x][y]=(F3[1][0]×pY[SubWidthC×x][SubHeightC×y-1]+
[1617] F3[0][1]×pY[SubWidthC×x-1][SubHeightC×y]+
[1618] F3[1][1]×pY[SubWidthC×x][SubHeightC×y]+(370)
[1619] F3[2][1]×pY[SubWidthC×x+1][SubHeightC×y]+
[1620] F3[1][2]×pY[SubWidthC×x][SubHeightC×y+1]+4)>>3
[1621] - Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies:
[1622] —pDsY[x][y], x=0..nTbW-1, y=0..nTbH-1 is derived as follows:
[1623] pDsY[x][y]=(F4[0][1]×pY[SubWidthC×x-1][SubHeightC×y]+
[1624] F4[0][2]×pY[SubWidthC×x-1][SubHeightC×y+1]+
[1625] F4[1][1]×pY[SubWidthC×x][SubHeightC×y]+(371)
[1626] F4[1][2]×pY[SubWidthC×x][SubHeightC×y+1]+
[1627] F4[2][1]×pY[SubWidthC×x+1][SubHeightC×y]+
[1628] F4[2][2]×pY[SubWidthC×x+1][SubHeightC×y+1]+4)>>3
[1629] 4. When numSampL is greater than 0, the selected adjacent left chroma sample pSelC[idx] is set equal to p[-1][pickPosL[idx]], where idx = 0..cntL-1, and the selected downsampled adjacent left luma sample pSelDsY[idx], where idx = 0..cntL-1 is derived as follows:
[1630] —The variable y is set equal to pickPosL[idx].
[1631] —If SubWidthC and SubHeightC are both equal to 1, then the following applies:
[1632] pSelDsY[idx]=pY[-1][y] (372)
[1633] — Otherwise, the following applies:
[1634] - If sps_chroma_vertical_collocated_flag is equal to 1, the following applies:
[1635] pSelDsY[idx]=(F3[1][0]×pY[-SubWidthC][SubHeightC×y-1]+
[1636] F3[0][1]×pY[-1-SubWidthC][SubHeightC×y]+
[1637] F3[1][1]×pY[-SubWidthC][SubHeightC×y]+(373)
[1638] F3[2][1]×pY[1-SubWidthC][SubHeightC×y]+
[1639] F3[1][2]×pY[-SubWidthC][SubHeightC×y+1]+4)>>3
[1640] - Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies:
[1641] pSelDsY[idx]=(F4[0][1]×pY[-1-SubWidthC][SubHeightC×y]+
[1642] F4[0][2]×pY[-1-SubWidthC][SubHeightC×y+1]+
[1643] F4[1][1]×pY[-SubWidthC][SubHeightC×y]+(374)
[1644] F4[1][2]×pY[-SubWidthC][SubHeightC×y+1]+
[1645] F4[2][1]×pY[1-SubWidthC][SubHeightC×y]+
[1646] F4[2][2]×pY[1-SubWidthC][SubHeightC×y+1]+4)>>3
[1647] 5. When numSampT is greater than 0, the selected adjacent top chroma sample pSelC[idx] is set equal to p[pickPosT[idx-cntL]][-1], where idx=cntL..cntL+cntT-1, and the downsampled adjacent top luma sample pSelDsY[idx], where idx=0..cntL+cntT-1 is specified as follows:
[1648] —The variable x is set equal to pickPosT[idx-cntL].
[1649] —If SubWidthC and SubHeightC are both equal to 1, then the following applies:
[1650] pSelDsY[idx]=pY[x][-1] (375)
[1651] — Otherwise, the following applies:
[1652] - If sps_chroma_vertical_collocated_flag is equal to 1, the following applies:
[1653] — If bCTUboundary is equal to FALSE, the following applies:
[1654] pSelDsY[idx]=(F3[1][0]×pY[SubWidthC×x][-1-SubHeightC]+
[1655] F3[0][1]×pY[SubWidthC×x-1][-SubHeightC]+
[1656] F3[1][1]×pY[SubWidthC×x][-SubHeightC]+(376)
[1657] F3[2][1]×pY[SubWidthC×x+1][-SubHeightC]+
[1658] F3[1][2]×pY[SubWidthC×x][1-SubHeightC]+4)>>3
[1659] — Otherwise (bCTUboundary is TRUE), the following applies:
[1660] pSelDsY[idx]=(F2[0]×pY[SubWidthC×x-1][-1]+
[1661] F2[1]×pY[SubWidthC×x][-1]+(377)
[1662] F2[2]×pY[SubWidthC×x+1][-1]+2)>>2
[1663] - Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies:
[1664] — If bCTUboundary is equal to FALSE, the following applies:
[1665] pSelDsY[idx]=(F4[0][1]×pY[SubWidthC x-1][-1]+
[1666] F4[0][2]×pY[SubWidthC×x-1][-2]+
[1667] F4[1][1]×pY[SubWidthC×x][-1]+(378)
[1668] F4[1][2]×pY[SubWidthC×x][-2]+
[1669] F4[2][1]×pY[SubWidthC×x+1][-1]+
[1670] F4[2][2]×pY[SubWidthC×x+1][-2]+4)>>3
[1671] — Otherwise (bCTUboundary is TRUE), the following applies:
[1672] pSelDsY[idx]=(F2[0]×pY[SubWidthC×x-1][-1]+
[1673] F2[1]×pY[SubWidthC×x][-1]+(379)
[1674] F2[2]×pY[SubWidthC×x+1][-1]+2)>>2
[1675] 6. When cntT+cntL is not equal to 0, the variables minY, maxY, minC and maxC are derived as follows:
[1676] —When cntT+cntL is equal to 2, pSelComp[3] is set equal to pSelComp[0], pSelComp[2] is set equal to pSelComp[1], pSelComp[0] is set equal to pSelComp[1], pSelComp[1] is set equal to pSelComp[3], and Comp is replaced with DsY and C.
[1677] —The arrays minGrpIdx and maxGrpIdx are derived as follows:
[1678] minGrpIdx[0]=0 (380)
[1679] minGrpIdx[1]=2 (381)
[1680] maxGrpIdx[0]=1 (382)
[1681] maxGrpIdx[1]=3 (383)
[1682] —When pSelDsY[minGrpIdx[0]] is greater than pSelDsY[minGrpIdx[1]], minGrpIdx[0] and minGrpIdx[1] are swapped as follows:
[1683] (minGrpIdx[0], minGrpIdx[1])=Swap(minGrpIdx[0], minGrpIdx[1]) (384)
[1684] —When pSelDsY[maxGrpIdx[0]] is greater than pSelDsY[maxGrpIdx[1]], maxGrpIdx[0] and maxGrpIdx[1] are swapped as follows:
[1685] (maxGrpIdx[0], maxGrpIdx[1])=Swap(maxGrpIdx[0], maxGrpIdx[1]) (385)
[1686] —When pSelDsY[minGrpIdx[0]] is greater than pSelDsY[maxGrpIdx[1]], the arrays minGrpIdx and maxGrpIdx are swapped as follows:
[1687] (minGrpIdx, maxGrpIdx) = Swap (minGrpIdx, maxGrpIdx) (386)
[1688] —When pSelDsY[minGrpIdx[1]] is greater than pSelDsY[maxGrpIdx[0]], minGrpIdx[1] and maxGrpIdx[0] are swapped as follows:
[1689] (minGrpIdx[1], maxGrpIdx[0])=Swap(minGrpIdx[1], maxGrpIdx[0]) (387)
[1690] —The variables maxY, maxC, minY and minC are derived as follows:
[1691] maxY=(pSelDsY[maxGrpIdx[0]]+pSelDsY[maxGrpIdx[1]]+1)>>1 (388)
[1692] maxC=(pSelC[maxGrpIdx[0]]+pSelC[maxGrpIdx[1]]+1)>>1 (389)
[1693] minY=(pSelDsY[minGrpIdx[0]]+pSelDsY[minGrpIdx[1]]+1)>>1 (390)
[1694] minC=(pSelC[minGrpIdx[0]]+pSelC[minGrpIdx[1]]+1)>>1 (391)
[1695] 7. The variables a, b and k are derived as follows:
[1696] — If numSampL is equal to 0 and numSampT is equal to 0, then the following applies:
[1697] k=0 (392)
[1698] a=0 (393)
[1699] b=1<<(BitDepth-1) (394)
[1700] — Otherwise, the following applies:
[1701] diff=maxY-minY (395)
[1702] — If diff is not equal to 0, the following applies:
[1703] diffC=maxC-minC (396)
[1704] x=Floor(Log2(diff)) (397)
[1705] normDiff=((diff<<4)>>x)&15 (398)
[1706] x+=(normDiff!=0)? 1:0 (399)
[1707] y=Abs(diffC)>0? Floor(Log2(Abs(diffC)))+1:0 (400)
[1708] a=(diffC×(divSigTable[normDiff]|8)+2 y -1)>>y (401)
[1709] k=((3+xy)<1)? 1:3+xy (402)
[1710] a=((3+xy)<1)? Sign(a)×15:a (403)
[1711] b=minC-((a×minY)>>k) (404)
[1712] where divSigTable[] is specified as follows:
[1713] divSigTable[]={0, 7, 6, 5, 5, 4, 4, 3, 3, 2, 2, 1, 1, 1, 1, 0} (405)
[1714] — Otherwise (diff is equal to 0), the following applies:
[1715] k=0 (406)
[1716] a=0 (407)
[1717] b=minC (408)
[1718] 8. The predicted sample point predSample[x][y], where x = 0..nTbW-1, y = 0..nTbH-1 is derived as follows:
[1719] predSamples[x][y]=Clip1(((pDsY[x][y]×a)>>k)+b) (409)
[1720] NOTE - This process uses sps_chroma_vertical_collocated_flag. However, to simplify the implementation, it does not use sps_chroma_horizontal_collocated_flag.
[1721] 5.10. Example 10
[1722] The working draft specified in JVET-Q2001-vE may be modified as follows. 8.4.5.2.13
[1724] The inputs to this process are:
[1725] —Intra prediction mode predModeIntra,
[1726] - the sample position of the upper left sample of the current transform block relative to the upper left sample of the current picture (xTbC, yTbC),
[1727] - variable nTbW specifying the transform block width,
[1728] - variable nTbH specifying the transform block height,
[1729] — variable cIdx that specifies the color component of the current block,
[1730] - Chroma neighboring samples p[x][y], where x=-1, y=0..2×nTbH-1, and x=0..2×nTbW-1, y=-1.
[1731] The output of this process is the predicted samples predSamples[x][y], where x=0..nTbW-1, y=0..nTbH-1.
[1732] The current brightness position (xTbY, yTbY) is derived as follows:
[1733] (xTbY, yTbY) = (xTbC<<(SubWidthC-1), yTbC<<(SubHeightC-1)) (351)
[1734] The variables availL, availT, and availTL are derived as follows:
[1735] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using as input the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY-1, yTbY), checkPredModeY set equal to false (FLASE), and cIdx, and assign the output to availL.
[1736] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using as input the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY, yTbY-1), checkPredModeY set equal to false (FLASE), and cIdx, and assign the output to availT.
[1737]
[1738] [[—The variable availTL is derived as follows:
[1739] availTL=availL&&availT (352)]]
[1740] —The number of available top-right adjacent chroma samples numTopRight is derived as follows:
[1741] —The variable numTopRight is set to 0, and availTR is set to TRUE.
[1742] - When predModeIntra is equal to INTRA_T_CCLM, the following applies for x=nTbW..2×nTbW-1 until availTR is equal to FALSE or x is equal to 2×nTbW-1:
[1743] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using as input the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY+x, yTbY-1), checkPredModeY set equal to false (FLASE), and cIdx, and assign the output to availTR.
[1744] —When availTR is equal to TRUE, numTopRight is increased by 1.
[1745] —The number of available lower left adjacent chroma samples numLeftBelow is derived as follows:
[1746] —The variable numLeftBelow is set to 0, and availLB is set to TRUE.
[1747] - When predModeIntra is equal to INTRA_L_CCLM, the following applies for y=nTbH..2×nTbH-1 until availLB is equal to FALSE or y is equal to 2×nTbH-1:
[1748] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using as input the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY-1, yTbY+y), checkPredModeY set equal to false (FLASE), and cIdx, and assign the output to availLB.
[1749] —When availLB is equal to TRUE, numLeftBelow is increased by 1.
[1750] The number of available adjacent chroma samples numSampT at the top and upper right and the number of available adjacent chroma samples numSampL at the left and lower left are derived as follows:
[1751] — If predModeIntra is equal to INTRA_LT_CCLM, the following applies:
[1752] numSampT=availT? nTbW:0 (353)
[1753] numSampL=availL? nTbH:0 (354)
[1754] — Otherwise, the following applies:
[1755] numSampT=(availT&&predModeIntra==INTRA_T_CCLM)? (nTbW+Min(numTopRight,nTbH)):0 (355)
[1756] numSampL=(availL&&predModeIntra==INTRA_L_CCLM)? (nTbH+Min(numLeftBelow,nTbW)):0 (356)
[1757] The variable bCTUboundary is derived as follows:
[1758] bCTUboundary=(yTbY&(CtbSizeY-1)==0)? TRUE:FALSE (357)
[1759] The variable cntN and array pickPosN where N is replaced by L and T are derived as follows:
[1760] —The variable numIs4N is derived as follows:
[1761] numIs4N=((availT&&availL&&predModeIntra==INTRA_LT_CCLM)?0:1) (358)
[1762] —The variable startPosN is set equal to numSampN>>(2+numIs4N).
[1763] —The variable pickStepN is set equal to Max(1, numSampN>>(1+numIs4N)).
[1764] —If availN is equal to TRUE and predModeIntra is equal to INTRA_LT_CCLM or INTRA_N_CCLM, the following assignments are made:
[1765] —cntN is set equal to Min(numSampN, (1+numIs4N)<<1).
[1766] —pickPosN[pos] is set equal to (startPosN+pos×pickStepN), where pos=0..cntN-1.
[1767] Otherwise, cntN is set equal to 0.
[1768] The predicted sample predSample[x][y], where x = 0..nTbW-1, y = 0..nTbH-1, is derived as follows:
[1769] — If numSampL and numSampT are both equal to 0, the following applies:
[1770] predSamples[x][y]=1<<(BitDepth-1) (359)
[1771] — Otherwise, the following ordered steps apply:
[1772] 1. The co-located luma sample pY[x][y] where x=0..nTbW×SubWidthC-1, y=0..TbH×SubHeightC-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).
[1773] 2. The adjacent brightness samples pY[x][y] are derived as follows:
[1774] —When numSampL is greater than 0, the adjacent left luma sample pY[x][y] where x=-1..-3, y=0..SubHeightC×numSampL-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).
[1775] [[—When availT is equal to FALSE, the adjacent top luma sample pY[x][y] where x=-1..SubWidthC×numSampT-1, y=-1..-2 is set equal to luma sample pY[x][0].
[1776] - When availL is equal to FALSE, the adjacent left luma sample pY[x][y] where x = -1..-3, y = -1..SubHeightC×numSampL-1 is set equal to luma sample pY[0][y]. ]]
[1777] —When numSampT is greater than 0, the adjacent top luma sample pY[x][y] where x=0..SubWidthC×numSampT-1, y=-1..-2 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).
[1778] -[[when]] When availTL is equal to TRUE, The adjacent upper left luma sample pY[x][y] of y=-1, -2 is set equal to the reconstructed luma sample before the deblocking filtering process at the position (xTbY+x, yTbY+y).
[1779]
[1780]
[1781] 3. The downsampled co-located luminance sample pDsY[x][y], where x = 0..nTbW-1, y = 0..nTbH-1, is derived as follows:
[1782] —If SubWidthC and SubHeightC are both equal to 1, then the following applies:
[1783] —pDsY[x][y], x=1..nTbW-1, y=1..nTbH-1 is derived as follows:
[1784] pDstY[x][y]=pY[x][y] (360)
[1785] — Otherwise, the following applies:
[1786] —The one-dimensional filter coefficient arrays F1 and F2 and the two-dimensional filter coefficient arrays F3 and F4 are specified as follows.
[1787] F1[0]=2,F1[1]=0 (361)
[1788] F2[0]=1,F2[1]=2,F2[2]=1 (362)
[1789] F3[i][j]=F4[i][j]=0, where i=0..2, j=0..2 (363)
[1790] — If SubWidthC and SubHeightC are both equal to 2, then the following applies:
[1791] F1[0]=1,F1[1]=1 (364)
[1792] F3[0][1]=1,F3[1][1]=4,F3[2][1]=1,F3[1][0]=1,F3[1][2]=1 (365)
[1793] F4[0][1]=1,F4[1][1]=2,F4[2][1]=1 (366)
[1794] F4[0][2]=1,F4[1][2]=2,F4[2][2]=1 (367)
[1795] — Otherwise, the following applies:
[1796] F3[1][1]=8 (368)
[1797] F4[0][1]=2, F4[1][1]=4, F4[2][1]=2, (369)
[1798] - If sps_chroma_vertical_collocated_flag is equal to 1, the following applies:
[1799] —pDsY[x][y], where x=0..nTbW-1, y=0..nTbH-1 is derived as follows:
[1800] pDsY[x][y]=(F3[1][0]×pY[SubWidthC×x][SubHeightC×y-1]+
[1801] F3[0][1]×pY[SubWidthC×x-1][SubHeightC×y]+
[1802] F3[1][1]×pY[SubWidthC×x][SubHeightC×y]+(370)
[1803] F3[2][1]×pY[SubWidthC×x+1][SubHeightC×y]+
[1804] F3[1][2]×pY[SubWidthC×x][SubHeightC×y+1]+4)>>3
[1805] - Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies:
[1806] —pDsY[x][y], where x=0..nTbW-1, y=0..nTbH-1 is derived as follows:
[1807] pDsY[x][y]=(F4[0][1]×pY[SubWidthC×x-1][SubHeightC×y]+
[1808] F4[0][2]×pY[SubWidthC×x-1][SubHeightC×y+1]+
[1809] F4[1][1]×pY[SubWidthC×x][SubHeightC×y]+(371)
[1810] F4[1][2]×pY[SubWidthC×x][SubHeightC×y+1]+
[1811] F4[2][1]×pY[SubWidthC×x+1][SubHeightC×y]+
[1812] F4[2][2]×pY[SubWidthC×x+1][SubHeightC×y+1]+4)>>3
[1813] 4. When numSampL is greater than 0, the selected adjacent left chroma sample pSelC[idx] is set equal to p[-1][pickPosL[idx]], where idx = 0..cntL-1, and the selected downsampled adjacent left luma sample pSelDsY[idx], where idx = 0..cntL-1 is derived as follows:
[1814] —The variable y is set equal to pickPosL[idx].
[1815] —If SubWidthC and SubHeightC are both equal to 1, then the following applies:
[1816] pSelDsY[idx]=pY[-1][y] (372)
[1817] — Otherwise, the following applies:
[1818] - If sps_chroma_vertical_collocated_flag is equal to 1, the following applies:
[1819] pSelDsY[idx]=(F3[1][0]×pY[-SubWidthC][SubHeightC×y-1]+
[1820] F3[0][1]×pY[-1-SubWidthC][SubHeightC×y]+
[1821] F3[1][1]×pY[-SubWidthC][SubHeightC×y]+(373)
[1822] F3[2][1]×pY[1-SubWidthC][SubHeightC×y]+
[1823] F3[1][2]×pY[-SubWidthC][SubHeightC×y+1]+4)>>3
[1824] - Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies:
[1825] pSelDsY[idx]=(F4[0][1]×pY[-1-SubWidthC][SubHeightC×y]+
[1826] F4[0][2]×pY[-1-SubWidthC][SubHeightC×y+1]+
[1827] F4[1][1]×pY[-SubWidthC][SubHeightC×y]+(374)
[1828] F4[1][2]×pY[-SubWidthC][SubHeightC×y+1]+
[1829] F4[2][1]×pY[1-SubWidthC][SubHeightC×y]+
[1830] F4[2][2]×pY[1-SubWidthC][SubHeightC×y+1]+4)>>3
[1831] 5. When numSampT is greater than 0, the selected adjacent top chroma sample pSelC[idx] is set equal to p[pickPosT[idx-cntL]][-1], where idx=cntL..cntL+cntT-1, and the downsampled adjacent top luma sample pSelDsY[idx], where idx=0..cntL+cntT-1 is specified as follows:
[1832] —The variable x is set equal to pickPosT[idx-cntL].
[1833] —If SubWidthC and SubHeightC are both equal to 1, then the following applies:
[1834] pSelDsY[idx]=pY[x][-1] (375)
[1835] — Otherwise, the following applies:
[1836] - If sps_chroma_vertical_collocated_flag is equal to 1, the following applies:
[1837] — If bCTUboundary is equal to FALSE, the following applies:
[1838] pSelDsY[idx]=(F3[1][0]×pY[SubWidthC×x][-1-SubHeightC]+
[1839] F3[0][1]×pY[SubWidthC×x-1][-SubHeightC]+
[1840] F3[1][1]×pY[SubWidthC×x][-SubHeightC]+(376)
[1841] F3[2][1]×pY[SubWidthC×x+1][-SubHeightC]+
[1842] F3[1][2]×pY[SubWidthC×x][1-SubHeightC]+4)>>3
[1843] — Otherwise (bCTUboundary is TRUE), the following applies:
[1844] pSelDsY[idx]=(F2[0]×pY[SubWidthC×x-1][-1]+
[1845] F2[1]×pY[SubWidthC×x][-1]+(377)
[1846] F2[2]×pY[SubWidthC×x+1][-1]+2)>>2
[1847] - Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies:
[1848] — If bCTUboundary is equal to FALSE, the following applies:
[1849] pSelDsY[idx]=(F4[0][1]×pY[SubWidthC x-1][-1]+
[1850] F4[0][2]×pY[SubWidthC×x-1][-2]+
[1851] F4[1][1]×pY[SubWidthC×x][-1]+(378)
[1852] F4[1][2]×pY[SubWidthC×x][-2]+
[1853] F4[2][1]×pY[SubWidthC×x+1][-1]+
[1854] F4[2][2]×pY[SubWidthC×x+1][-2]+4)>>3
[1855] — Otherwise (bCTUboundary is TRUE), the following applies:
[1856] pSelDsY[idx]=(F2[0]×pY[SubWidthC×x-1][-1]+
[1857] F2[1]×pY[SubWidthC×x][-1]+(379)
[1858] F2[2]×pY[SubWidthC×x+1][-1]+2)>>2
[1859] 6. When cntT+cntL is not equal to 0, the variables minY, maxY, minC and maxC are derived as follows:
[1860] —When cntT+cntL is equal to 2, pSelComp[3] is set equal to pSelComp[0], pSelComp[2] is set equal to pSelComp[1], pSelComp[0] is set equal to pSelComp[1], pSelComp[1] is set equal to pSelComp[3], and Comp is replaced with DsY and C.
[1861] —The arrays minGrpIdx and maxGrpIdx are derived as follows:
[1862] minGrpIdx[0]=0 (380)
[1863] minGrpIdx[1]=2 (381)
[1864] maxGrpIdx[0]=1 (382)
[1865] maxGrpIdx[1]=3 (383)
[1866] —When pSelDsY[minGrpIdx[0]] is greater than pSelDsY[minGrpIdx[1]], minGrpIdx[0] and minGrpIdx[1] are swapped as follows:
[1867] (minGrpIdx[0], minGrpIdx[1])=Swap(minGrpIdx[0], minGrpIdx[1]) (384)
[1868] —When pSelDsY[maxGrpIdx[0]] is greater than pSelDsY[maxGrpIdx[1]], maxGrpIdx[0] and maxGrpIdx[1] are swapped as follows:
[1869] (maxGrpIdx[0], maxGrpIdx[1])=Swap(maxGrpIdx[0], maxGrpIdx[1]) (385)
[1870] —When pSelDsY[minGrpIdx[0]] is greater than pSelDsY[maxGrpIdx[1]], the arrays minGrpIdx and maxGrpIdx are swapped as follows:
[1871] (minGrpIdx, maxGrpIdx) = Swap (minGrpIdx, maxGrpIdx) (386)
[1872] —When pSelDsY[minGrpIdx[1]] is greater than pSelDsY[maxGrpIdx[0]], minGrpIdx[1] and maxGrpIdx[0] are swapped as follows:
[1873] (minGrpIdx[1], maxGrpIdx[0])=Swap(minGrpIdx[1], maxGrpIdx[0]) (387)
[1874] —The variables maxY, maxC, minY and minC are derived as follows:
[1875] maxY=(pSelDsY[maxGrpIdx[0]]+pSelDsY[maxGrpIdx[1]]+1)>>1 (388)
[1876] maxC=(pSelC[maxGrpIdx[0]]+pSelC[maxGrpIdx[1]]+1)>>1 (389)
[1877] minY=(pSelDsY[minGrpIdx[0]]+pSelDsY[minGrpIdx[1]]+1)>>1 (390)
[1878] minC=(pSelC[minGrpIdx[0]]+pSelC[minGrpIdx[1]]+1)>>1(391)
[1879] 7. The variables a, b and k are derived as follows:
[1880] — If numSampL is equal to 0 and numSampT is equal to 0, then the following applies:
[1881] k=0 (392)
[1882] a=0 (393)
[1883] b=1<<(BitDepth-1) (394)
[1884] — Otherwise, the following applies:
[1885] diff=maxY-minY (395)
[1886] — If diff is not equal to 0, the following applies:
[1887] diffC=maxC-minC (396)
[1888] x=Floor(Log2(diff)) (397)
[1889] normDiff=((diff<<4)>>x)&15 (398)
[1890] x+=(normDiff!=0)? 1:0 (399)
[1891] y=Abs(diffC)>0? Floor(Log2(Abs(diffC)))+1:0 (400)
[1892] a=(diffC×(divSigTable[normDiff]|8)+2 y-1 )>>y (401)
[1893] k=((3+xy)<1)? 1:3+xy (402)
[1894] a=((3+xy)<1)? Sign(a)×15:a (403)
[1895] b=minC-((a×minY)>>k) (404)
[1896] where divSigTable[] is specified as follows:
[1897] divSigTable[]={0, 7, 6, 5, 5, 4, 4, 3, 3, 2, 2, 1, 1, 1, 1, 0} (405)
[1898] — Otherwise (diff is equal to 0), the following applies:
[1899] k=0 (406)
[1900] a=0 (407)
[1901] b=minC (408)
[1902] 8. The predicted sample point predSample[x][y], where x = 0..nTbW-1, y = 0..nTbH-1 is derived as follows:
[1903] predSamples[x][y]=Clip1(((pDsY[x][y]×a)>>k)+b) (409)
[1904] NOTE - This process uses sps_chroma_vertical_collocated_flag. However, to simplify the implementation, it does not use sps_chroma_horizontal_collocated_flag.
[1905] Example 11
[1906] The working draft specified in JVET-Q2001-vE may be modified as follows. 8.4.5.2.13
[1908] The inputs to this process are:
[1909] —Intra prediction mode predModeIntra,
[1910] - the sample position of the upper left sample of the current transform block relative to the upper left sample of the current picture (xTbC, yTbC),
[1911] - variable nTbW specifying the transform block width,
[1912] - variable nTbH specifying the transform block height,
[1913] — variable cIdx that specifies the color component of the current block,
[1914] - Chroma neighboring samples p[x][y], where x=-1, y=0..2×nTbH-1, and x=0..2×nTbW-1, y=-1.
[1915] The output of this process is the predicted samples predSamples[x][y], where x=0..nTbW-1, y=0..nTbH-1.
[1916] The current brightness position (xTbY, yTbY) is derived as follows:
[1917] (xTbY, yTbY) = (xTbC<<(SubWidthC-1), yTbC<<(SubHeightC-1))(351)
[1918] The variables availL, availT, and availTL are derived as follows:
[1919] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using as input the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY-1, yTbY), checkPredModeY set equal to false (FLASE), and cIdx, and assign the output to availL.
[1920] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using as input the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY, yTbY-1), checkPredModeY set equal to false (FLASE), and cIdx, and assign the output to availT.
[1921] [[—The variable availTL is derived as follows:
[1922] availTL=availL&&availT (352)]]
[1923] —The number of available top-right adjacent chroma samples numTopRight is derived as follows:
[1924] —The variable numTopRight is set to 0, and availTR is set to TRUE.
[1925] - When predModeIntra is equal to INTRA_T_CCLM, the following applies for x=nTbW..2×nTbW-1 until availTR is equal to FALSE or x is equal to 2×nTbW-1:
[1926] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using as input the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY+x, yTbY-1), checkPredModeY set equal to false (FLASE), and cIdx, and assign the output to availTR.
[1927] —When availTR is equal to TRUE, numTopRight is increased by 1.
[1928] —The number of available lower left adjacent chroma samples numLeftBelow is derived as follows:
[1929] —The variable numLeftBelow is set to 0, and availLB is set to TRUE.
[1930] - When predModeIntra is equal to INTRA_L_CCLM, the following applies for y=nTbH..2×nTbH-1 until availLB is equal to FALSE or y is equal to 2×nTbH-1:
[1931] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using as input the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY-1, yTbY+y), checkPredModeY set equal to false (FLASE), and cIdx, and assign the output to availLB.
[1932] —When availLB is equal to TRUE, numLeftBelow is increased by 1.
[1933] The number of available adjacent chroma samples numSampT at the top and upper right and the number of available adjacent chroma samples numSampL at the left and lower left are derived as follows:
[1934] — If predModeIntra is equal to INTRA_LT_CCLM, the following applies:
[1935] numSampT=availT? nTbW:0 (353)
[1936] numSampL=availL? nTbH:0(354)
[1937] — Otherwise, the following applies:
[1938] numSampT=(availT&&predModeIntra==INTRA_T_CCLM)? (nTbW+Min(numTopRight,nTbH)):0 (355)
[1939] numSampL=(availL&&predModeIntra==INTRA_L_CCLM)? (nTbH+Min(numLeftBelow,nTbW)):0 (356)
[1940] The variable bCTUboundary is derived as follows:
[1941] bCTUboundary=(yTbY&(CtbSizeY-1)==0)? TRUE:FALSE (357)
[1942] The variable cntN and array pickPosN where N is replaced by L and T are derived as follows:
[1943] —The variable numIs4N is derived as follows:
[1944] numIs4N=((availT&&availL&&predModeIntra==INTRA_LT_CCLM)?0:1) (358)
[1945] —The variable startPosN is set equal to numSampN>>(2+numIs4N).
[1946] —The variable pickStepN is set equal to Max(1, numSampN>>(1+numIs4N)).
[1947] —If availN is equal to TRUE and predModeIntra is equal to INTRA_LT_CCLM or INTRA_N_CCLM, the following assignments are made:
[1948] —cntN is set equal to Min(numSampN, (1+numIs4N)<<1).
[1949] —pickPosN[pos] is set equal to (startPosN+pos×pickStepN), where pos=0..cntN-1.
[1950] Otherwise, cntN is set equal to 0.
[1951] The predicted sample predSample[x][y], where x = 0..nTbW-1, y = 0..nTbH-1, is derived as follows:
[1952] — If numSampL and numSampT are both equal to 0, the following applies:
[1953] predSamples[x][y]=1<<(BitDepth-1) (359)
[1954] — Otherwise, the following ordered steps apply:
[1955] 1. The co-located luma sample pY[x][y] where x=0..nTbW×SubWidthC-1, y=0..TbH×SubHeightC-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).
[1956] 2. The adjacent brightness samples pY[x][y] are derived as follows:
[1957] —When numSampL is greater than 0, the adjacent left luma sample pY[x][y] where x=-1..-3, y=0..SubHeightC×numSampL-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).
[1958] - When availT is equal to FALSE, the adjacent top luma sample pY[x][y] where x = -1..SubWidthC×numSampT-1, y = -1..-2 is set equal to luma sample pY[x][0].
[1959] - When availL is equal to FALSE, the adjacent left luma sample pY[x][y] where x = -1..-3, y = -1..SubHeightC×numSampL-1 is set equal to luma sample pY[0][y].
[1960] —When numSampT is greater than 0, the adjacent top luma sample pY[x][y] where x=0..SubWidthC×numSampT-1, y=-1..-2 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).
[1961] [[—When availTL is equal to TRUE, the adjacent upper left luma sample pY[x][y] of x=-1, y=-1, -2 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y). ]]
[1962]
[1963] 3. The downsampled co-located luminance sample pDsY[x][y], where x = 0..nTbW-1, y = 0..nTbH-1, is derived as follows:
[1964] —If SubWidthC and SubHeightC are both equal to 1, then the following applies:
[1965] —pDsY[x][y], x=1..nTbW-1, y=1..nTbH-1 is derived as follows:
[1966] pDstY[x][y]=pY[x][y] (360)
[1967] — Otherwise, the following applies:
[1968] —The one-dimensional filter coefficient arrays F1 and F2 and the two-dimensional filter coefficient arrays F3 and F4 are specified as follows.
[1969] F1[0]=2,F1[1]=0 (361)
[1970] F2[0]=1,F2[1]=2,F2[2]=1 (362)
[1971] F3[i][j]=F4[i][j]=0, where i=0..2, j=0..2 (363)
[1972] — If SubWidthC and SubHeightC are both equal to 2, then the following applies:
[1973] F1[0]=1,F1[1]=1 (364)
[1974] F3[0][1]=1,F3[1][1]=4,F3[2][1]=1,F3[1][0]=1,F3[1][2]=1 (365)
[1975] F4[0][1]=1,F4[1][1]=2,F4[2][1]=1 (366)
[1976] F4[0][2]=1,F4[1][2]=2,F4[2][2]=1 (367)
[1977] — Otherwise, the following applies:
[1978] F3[1][1]=8 (368)
[1979] F4[0][1]=2, F4[1][1]=4, F4[2][1]=2, (369)
[1980] - If sps_chroma_vertical_collocated_flag is equal to 1, the following applies:
[1981] pDsY[x][y], where x = 0..nTbW-1, y = 0..nTbH-1 is derived as follows:
[1982] pDsY[x][y]=(F3[1][0]×pY[SubWidthC×x][SubHeightC×y-1]+
[1983] F3[0][1]×pY[SubWidthC×x-1][SubHeightC×y]+
[1984] F3[1][1]×pY[SubWidthC×x][SubHeightC×y]+(370)
[1985] F3[2][1]×pY[SubWidthC×x+1][SubHeightC×y]+
[1986] F3[1][2]×pY[SubWidthC×x][SubHeightC×y+1]+4)>>3
[1987] - Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies:
[1988] pDsY[x][y], where x = 0..nTbW-1, y = 0..nTbH-1 is derived as follows:
[1989] pDsY[x][y]=(F4[0][1]×pY[SubWidthC×x-1][SubHeightC×y]+
[1990] F4[0][2]×pY[SubWidthC×x-1][SubHeightC×y+1]+
[1991] F4[1][1]×pY[SubWidthC×x][SubHeightC×y]+(371)
[1992] F4[1][2]×pY[SubWidthC×x][SubHeightC×y+1]+
[1993] F4[2][1]×pY[SubWidthC×x+1][SubHeightC×y]+
[1994] F4[2][2]×pY[SubWidthC×x+1][SubHeightC×y+1]+4)>>3
[1995] 4. When numSampL is greater than 0, the selected adjacent left chroma sample pSelC[idx] is set equal to p[-1][pickPosL[idx]], where idx = 0..cntL-1, and the selected downsampled adjacent left luma sample pSelDsY[idx], where idx = 0..cntL-1 is derived as follows:
[1996] —The variable y is set equal to pickPosL[idx].
[1997] —If SubWidthC and SubHeightC are both equal to 1, then the following applies:
[1998] pSelDsY[idx]=pY[-1][y] (372)
[1999] — Otherwise, the following applies:
[2000] - If sps_chroma_vertical_collocated_flag is equal to 1, the following applies:
[2001] pSelDsY[idx]=(F3[1][0]×pY[-SubWidthC][SubHeightC×y-1]+
[2002] F3[0][1]×pY[-1-SubWidthC][SubHeightC×y]+
[2003] F3[1][1]×pY[-SubWidthC][SubHeightC×y]+(373)
[2004] F3[2][1]×pY[1-SubWidthC][SubHeightC×y]+
[2005] F3[1][2]×pY[-SubWidthC][SubHeightC×y+1]+4)>>3
[2006] - Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies:
[2007] pSelDsY[idx]=(F4[0][1]×pY[-1-SubWidthC][SubHeightC×y]+
[2008] F4[0][2]×pY[-1-SubWidthC][SubHeightC×y+1]+
[2009] F4[1][1]×pY[-SubWidthC][SubHeightC×y]+(374)
[2010] F4[1][2]×pY[-SubWidthC][SubHeightC×y+1]+
[2011] F4[2][1]×pY[1-SubWidthC][SubHeightC×y]+
[2012] F4[2][2]×pY[1-SubWidthC][SubHeightC×y+1]+4)>>3
[2013] 5. When numSampT is greater than 0, the selected adjacent top chroma sample pSelC[idx] is set equal to p[pickPosT[idx-cntL]][-1], where idx=cntL..cntL+cntT-1, and the downsampled adjacent top luma sample pSelDsY[idx], where idx=0..cntL+cntT-1 is specified as follows:
[2014] —The variable x is set equal to pickPosT[idx-cntL].
[2015] —If SubWidthC and SubHeightC are both equal to 1, then the following applies:
[2016] pSelDsY[idx]=pY[x][-1] (375)
[2017] — Otherwise, the following applies:
[2018] - If sps_chroma_vertical_collocated_flag is equal to 1, the following applies:
[2019] — If bCTUboundary is equal to FALSE, the following applies:
[2020] pSelDsY[idx]=(F3[1][0]×pY[SubWidthC×x][-1-SubHeightC]+
[2021] F3[0][1]×pY[SubWidthC×x-1][-SubHeightC]+
[2022] F3[1][1]×pY[SubWidthC×x][-SubHeightC]+(376)
[2023] F3[2][1]×pY[SubWidthC×x+1][-SubHeightC]+
[2024] F3[1][2]×pY[SubWidthC×x][1-SubHeightC]+4)>>3
[2025] — Otherwise (bCTUboundary is TRUE), the following applies:
[2026] pSelDsY[idx]=(F2[0]×pY[SubWidthC×x-1][-1]+
[2027] F2[1]×pY[SubWidthC×x][-1]+(377)
[2028] F2[2]×pY[SubWidthC×x+1][-1]+2)>>2
[2029] - Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies:
[2030] — If bCTUboundary is equal to FALSE, the following applies:
[2031] pSelDsY[idx]=(F4[0][1]×pY[SubWidthC x-1][-1]+
[2032] F4[0][2]×pY[SubWidthC×x-1][-2]+
[2033] F4[1][1]×pY[SubWidthC×x][-1]+(378)
[2034] F4[1][2]×pY[SubWidthC×x][-2]+
[2035] F4[2][1]×pY[SubWidthC×x+1][-1]+
[2036] F4[2][2]×pY[SubWidthC×x+1][-2]+4)>>3
[2037] — Otherwise (bCTUboundary is TRUE), the following applies:
[2038] pSelDsY[idx]=(F2[0]×pY[SubWidthC×x-1][-1]+
[2039] F2[1]×pY[SubWidthC×x][-1]+ (379)
[2040] F2[2]×pY[SubWidthC×x+1][-1]+2)>>2
[2041] 6. When cntT+cntL is not equal to 0, the variables minY, maxY, minC and maxC are derived as follows:
[2042] —When cntT+cntL is equal to 2, pSelComp[3] is set equal to pSelComp[0], pSelComp[2] is set equal to pSelComp[1], pSelComp[0] is set equal to pSelComp[1], pSelComp[1] is set equal to pSelComp[3], and Comp is replaced with DsY and C.
[2043] —The arrays minGrpIdx and maxGrpIdx are derived as follows:
[2044] minGrpIdx[0]=0 (380)
[2045] minGrpIdx[1]=2 (381)
[2046] maxGrpIdx[0]=1 (382)
[2047] maxGrpIdx[1]=3 (383)
[2048] —When pSelDsY[minGrpIdx[0]] is greater than pSelDsY[minGrpIdx[1]], minGrpIdx[0] and minGrpIdx[1] are swapped as follows:
[2049] (minGrpIdx[0], minGrpIdx[1])=Swap(minGrpIdx[0], minGrpIdx[1]) (384)
[2050] —When pSelDsY[maxGrpIdx[0]] is greater than pSelDsY[maxGrpIdx[1]], maxGrpIdx[0] and maxGrpIdx[1] are swapped as follows:
[2051] (maxGrpIdx[0], maxGrpIdx[1])=Swap(maxGrpIdx[0], maxGrpIdx[1]) (385)
[2052] —When pSelDsY[minGrpIdx[0]] is greater than pSelDsY[maxGrpIdx[1]], the arrays minGrpIdx and maxGrpIdx are swapped as follows:
[2053] (minGrpIdx, maxGrpIdx) = Swap (minGrpIdx, maxGrpIdx) (386)
[2054] —When pSelDsY[minGrpIdx[1]] is greater than pSelDsY[maxGrpIdx[0]], minGrpIdx[1] and maxGrpIdx[0] are swapped as follows:
[2055] (minGrpIdx[1], maxGrpIdx[0])=Swap(minGrpIdx[1], maxGrpIdx[0]) (387)
[2056] —The variables maxY, maxC, minY and minC are derived as follows:
[2057] maxY=(pSelDsY[maxGrpIdx[0]]+pSelDsY[maxGrpIdx[1]]+1)>>1 (388)
[2058] maxC=(pSelC[maxGrpIdx[0]]+pSelC[maxGrpIdx[1]]+1)>>1 (389)
[2059] minY=(pSelDsY[minGrpIdx[0]]+pSelDsY[minGrpIdx[1]]+1)>>1 (390)
[2060] minC=(pSelC[minGrpIdx[0]]+pSelC[minGrpIdx[1]]+1)>>1(391)
[2061] 7. The variables a, b and k are derived as follows:
[2062] — If numSampL is equal to 0 and numSampT is equal to 0, then the following applies:
[2063] k=0 (392)
[2064] a=0 (393)
[2065] b=1<<(BitDepth-1) (394)
[2066] — Otherwise, the following applies:
[2067] diff=maxY-minY (395)
[2068] — If diff is not equal to 0, the following applies:
[2069] diffC=maxC-minC (396)
[2070] x=Floor(Log2(diff)) (397)
[2071] normDiff=((diff<<4)>>x)&15 (398)
[2072] x+=(normDiff!=0)? 1:0 (399)
[2073] y=Abs(diffC)>0? Floor(Log2(Abs(diffC)))+1:0 (400)
[2074] a=(diffC×(divSigTable[normDiff]|8)+2 y - 1 )>>y (401)
[2075] k=((3+xy)<1)? 1:3+xy (402)
[2076] a=((3+xy)<1)? Sign(a)×15:a (403)
[2077] b=minC-((a×minY)>>k) (404)
[2078] where divSigTable[] is specified as follows:
[2079] divSigTable[]={0, 7, 6, 5, 5, 4, 4, 3, 3, 2, 2, 1, 1, 1, 1, 0} (405)
[2080] — Otherwise (diff is equal to 0), the following applies:
[2081] k=0 (406)
[2082] a=0 (407)
[2083] b=minC (408)
[2084] 8. The predicted sample point predSample[x][y], where x = 0..nTbW-1, y = 0..nTbH-1 is derived as follows:
[2085] predSamples[x][y]=Clip1(((pDsY[x][y]×a)>>k)+b) (409)
[2086] NOTE - This process uses sps_chroma_vertical_collocated_flag. However, to simplify the implementation, it does not use sps_chroma_horizontal_collocated_flag.
[2087] 5.12. Example 12
[2088] The working draft specified in JVET-Q2001-vE may be modified as follows. 8.4.5.2.13
[2090] The inputs to this process are:
[2091] —Intra prediction mode predModeIntra,
[2092] - the sample position of the upper left sample of the current transform block relative to the upper left sample of the current picture (xTbC, yTbC),
[2093] - variable nTbW specifying the transform block width,
[2094] - variable nTbH specifying the transform block height,
[2095] — variable cIdx that specifies the color component of the current block,
[2096] - Chroma neighboring samples p[x][y], where x=-1, y=0..2×nTbH-1, and x=0..2×nTbW-1, y=-1.
[2097] The output of this process is the predicted samples predSamples[x][y], where x=0..nTbW-1, y=0..nTbH-1.
[2098] The current brightness position (xTbY, yTbY) is derived as follows:
[2099] (xTbY, yTbY) = (xTbC<<(SubWidthC-1), yTbC<<(SubHeightC-1)) (351)
[2100] The variables availL, availT, and availTL are derived as follows:
[2101] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using as input the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY-1, yTbY), checkPredModeY set equal to false (FLASE), and cIdx, and assign the output to availL.
[2102] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using as input the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY, yTbY-1), checkPredModeY set equal to false (FLASE), and cIdx, and assign the output to availT.
[2103] —The variable availTL is derived as follows:
[2104] availTL=availL&&availT (352)
[2105] —The number of available top-right adjacent chroma samples numTopRight is derived as follows:
[2106] —The variable numTopRight is set to 0, and availTR is set to TRUE.
[2107] - When predModeIntra is equal to INTRA_T_CCLM, the following applies for x=nTbW..2×nTbW-1 until availTR is equal to FALSE or x is equal to 2×nTbW-1:
[2108] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using as input the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY+x, yTbY-1), checkPredModeY set equal to false (FLASE), and cIdx, and assign the output to availTR.
[2109] —When availTR is equal to TRUE, numTopRight is increased by 1.
[2110] —The number of available lower left adjacent chroma samples numLeftBelow is derived as follows:
[2111] —The variable numLeftBelow is set to 0, and availLB is set to TRUE.
[2112] - When predModeIntra is equal to INTRA_L_CCLM, the following applies for y=nTbH..2×nTbH-1 until availLB is equal to FALSE or y is equal to 2×nTbH-1:
[2113] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using as input the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY-1, yTbY+y), checkPredModeY set equal to false (FLASE), and cIdx, and assign the output to availLB.
[2114] —When availLB is equal to TRUE, numLeftBelow is increased by 1.
[2115] The number of available adjacent chroma samples numSampT at the top and upper right and the number of available adjacent chroma samples numSampL at the left and lower left are derived as follows:
[2116] — If predModeIntra is equal to INTRA_LT_CCLM, the following applies:
[2117] numSampT=availT? nTbW:0 (353)
[2118] numSampL=availL? nTbH:0 (354)
[2119] — Otherwise, the following applies:
[2120] numSampT=(availT&&predModeIntra==INTRA_T_CCLM)? (nTbW+Min(numTopRight,nTbH)):0 (355)
[2121] numSampL=(availL&&predModeIntra==INTRA_L_CCLM)? (nTbH+Min(numLeftBelow,nTbW)):0 (356)
[2122] The variable bCTUboundary is derived as follows:
[2123] bCTUboundary=(yTbY&(CtbSizeY-1)==0)? TRUE:FALSE(357)
[2124] The variable cntN and array pickPosN where N is replaced by L and T are derived as follows:
[2125] —The variable numIs4N is derived as follows:
[2126] numIs4N=((availT&&availL&&predModeIntra==INTRA_LT_CCLM)?0:1) (358)
[2127] —The variable startPosN is set equal to numSampN>>(2+numIs4N).
[2128] —The variable pickStepN is set equal to Max(1, numSampN>>(1+numIs4N)).
[2129] —If availN is equal to TRUE and predModeIntra is equal to INTRA_LT_CCLM or INTRA_N_CCLM, the following assignments are made:
[2130] —cntN is set equal to Min(numSampN, (1+numIs4N)<<1).
[2131] —pickPosN[pos] is set equal to (startPosN+pos×pickStepN), where pos=0..cntN-1.
[2132] Otherwise, cntN is set equal to 0.
[2133] The predicted sample predSample[x][y], where x = 0..nTbW-1, y = 0..nTbH-1, is derived as follows:
[2134] — If numSampL and numSampT are both equal to 0, the following applies:
[2135] predSamples[x][y]=1<<(BitDepth-1) (359)
[2136] — Otherwise, the following ordered steps apply:
[2137] 1. The co-located luma sample pY[x][y] where x=0..nTbW×SubWidthC-1, y=0..TbH×SubHeightC-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).
[2138] 2. The adjacent brightness samples pY[x][y] are derived as follows:
[2139] —When numSampL is greater than 0, the adjacent left luma sample pY[x][y] where x=-1..-3, y=0..SubHeightC×numSampL-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).
[2140] - When availT is equal to FALSE, the adjacent top luma sample pY[x][y] where x = -1..SubWidthC×numSampT-1, y = -1..-2 is set equal to luma sample pY[x][0].
[2141] - When availL is equal to FALSE, the adjacent left luma sample pY[x][y] where x = -1..-3, y = -1..SubHeightC×numSampL-1 is set equal to luma sample pY[0][y].
[2142] - When numSampT is greater than 0, x = 0..SubWidthC×numSampT-1,
[2143] The neighboring top luma sample pY[x][y] with y=-1..-3 is set equal to the reconstructed luma sample before the deblocking filtering process at the position (xTbY+x, yTbY+y).
[2144] —When availTL is equal to TRUE, The adjacent upper left luma sample pY[x][y] of y=-1, -2 is set equal to the reconstructed luma sample before the deblocking filtering process at the position (xTbY+x, yTbY+y).
[2145] 3. The downsampled co-located luminance sample pDsY[x][y], where x = 0..nTbW-1, y = 0..nTbH-1, is derived as follows:
[2146] —If SubWidthC and SubHeightC are both equal to 1, then the following applies:
[2147] —pDsY[x][y], x=1..nTbW-1, y=1..nTbH-1 is derived as follows:
[2148] pDstY[x][y]=pY[x][y] (360)
[2149] — Otherwise, the following applies:
[2150] —The one-dimensional filter coefficient arrays F1 and F2 and the two-dimensional filter coefficient arrays F3 and F4 are specified as follows.
[2151] F1[0]=2,F1[1]=0 (361)
[2152] F2[0]=1,F2[1]=2,F2[2]=1(362)
[2153] F3[i][j]=F4[i][j]=0, where i=0..2, j=0..2(363)
[2154] — If SubWidthC and SubHeightC are both equal to 2, then the following applies:
[2155] F1[0]=1,F1[1]=1 (364)
[2156] F3[0][1]=1,F3[1][1]=4,F3[2][1]=1,F3[1][0]=1,F3[1][2]=1 (365)
[2157] F4[0][1]=1,F4[1][1]=2,F4[2][1]=1 (366)
[2158] F4[0][2]=1,F4[1][2]=2,F4[2][2]=1 (367)
[2159] — Otherwise, the following applies:
[2160] F3[1][1]=8 (368)
[2161] F4[0][1]=2, F4[1][1]=4, F4[2][1]=2, (369)
[2162] - If sps_chroma_vertical_collocated_flag is equal to 1, the following applies:
[2163] —pDsY[x][y], where x=0..nTbW-1, y=0..nTbH-1 is derived as follows:
[2164] pDsY[x][y]=(F3[1][0]×pY[SubWidthC×x][SubHeightC×y-1]+
[2165] F3[0][1]×pY[SubWidthC×x-1][SubHeightC×y]+
[2166] F3[1][1]×pY[SubWidthC×x][SubHeightC×y]+(370)
[2167] F3[2][1]×pY[SubWidthC×x+1][SubHeightC×y]+
[2168] F3[1][2]×pY[SubWidthC×x][SubHeightC×y+1]+4)>>3
[2169] - Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies:
[2170] —pDsY[x][y] where x=0..nTbW-1, y=0..nTbH-1 is derived as follows:
[2171] pDsY[x][y]=(F4[0][1]×pY[SubWidthC×x-1][SubHeightC×y]+
[2172] F4[0][2]×pY[SubWidthC×x-1][SubHeightC×y+1]+
[2173] F4[1][1]×pY[SubWidthC×x][SubHeightC×y]+(371)
[2174] F4[1][2]×pY[SubWidthC×x][SubHeightC×y+1]+
[2175] F4[2][1]×pY[SubWidthC×x+1][SubHeightC×y]+
[2176] F4[2][2]×pY[SubWidthC×x+1][SubHeightC×y+1]+4)>>3
[2177] 4. When numSampL is greater than 0, the selected adjacent left chroma sample pSelC[idx] is set equal to p[-1][pickPosL[idx]], where idx = 0..cntL-1, and the selected downsampled adjacent left luma sample pSelDsY[idx], where idx = 0..cntL-1 is derived as follows:
[2178] —The variable y is set equal to pickPosL[idx].
[2179] —If SubWidthC and SubHeightC are both equal to 1, then the following applies:
[2180] pSelDsY[idx]=pY[-1][y] (372)
[2181] — Otherwise, the following applies:
[2182] - If sps_chroma_vertical_collocated_flag is equal to 1, the following applies:
[2183] pSelDsY[idx]=(F3[1][0]×pY[-SubWidthC][SubHeightC×y-1]+
[2184] F3[0][1]×pY[-1-SubWidthC][SubHeightC×y]+
[2185] F3[1][1]×pY[-SubWidthC][SubHeightC×y]+(373)
[2186] F3[2][1]×pY[1-SubWidthC][SubHeightC×y]+
[2187] F3[1][2]×pY[-SubWidthC][SubHeightC×y+1]+4)>>3
[2188] - Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies:
[2189] pSelDsY[idx]=(F4[0][1]×pY[-1-SubWidthC][SubHeightC×y]+
[2190] F4[0][2]×pY[-1-SubWidthC][SubHeightC×y+1]+
[2191] F4[1][1]×pY[-SubWidthC][SubHeightC×y]+(374)
[2192] F4[1][2]×pY[-SubWidthC][SubHeightC×y+1]+
[2193] F4[2][1]×pY[1-SubWidthC][SubHeightC×y]+
[2194] F4[2][2]×pY[1-SubWidthC][SubHeightC×y+1]+4)>>3
[2195] 5. When numSampT is greater than 0, the selected adjacent top chroma sample pSelC[idx] is set equal to p[pickPosT[idx-cntL]][-1], where idx=cntL..cntL+cntT-1, and the downsampled adjacent top luma sample pSelDsY[idx], where idx=0..cntL+cntT-1 is specified as follows:
[2196] —The variable x is set equal to pickPosT[idx-cntL].
[2197] —If SubWidthC and SubHeightC are both equal to 1, then the following applies:
[2198] pSelDsY[idx]=pY[x][-1](375)
[2199] — Otherwise, the following applies:
[2200] - If sps_chroma_vertical_collocated_flag is equal to 1, the following applies:
[2201] — If bCTUboundary is equal to FALSE, the following applies:
[2202] pSelDsY[idx]=(F3[1][0]×pY[SubWidthC×x][-1-SubHeightC]+
[2203] F3[0][1]×pY[SubWidthC×x-1][-SubHeightC]+
[2204] F3[1][1]×pY[SubWidthC×x][-SubHeightC]+(376)
[2205] F3[2][1]×pY[SubWidthC×x+1][-SubHeightC]+
[2206] F3[1][2]×pY[SubWidthC×x][1-SubHeightC]+4)>>3
[2207] — Otherwise (bCTUboundary is TRUE), the following applies:
[2208] pSelDsY[idx]=(F2[0]×pY[SubWidthC×x-1][-1]+
[2209] F2[1]×pY[SubWidthC×x][-1]+(377)
[2210] F2[2]×pY[SubWidthC×x+1][-1]+2)>>2
[2211] - Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies:
[2212] — If bCTUboundary is equal to FALSE, the following applies:
[2213] pSelDsY[idx]=(F4[0][1]×pY[SubWidthC x-1][-1]+
[2214] F4[0][2]×pY[SubWidthC×x-1][-2]+
[2215] F4[1][1]×pY[SubWidthC×x][-1]+(378)
[2216] F4[1][2]×pY[SubWidthC×x][-2]+
[2217] F4[2][1]×pY[SubWidthC×x+1][-1]+
[2218] F4[2][2]×pY[SubWidthC×x+1][-2]+4)>>3
[2219] — Otherwise (bCTUboundary is TRUE), the following applies:
[2220] pSelDsY[idx]=(F2[0]×pY[SubWidthC×x-1][-1]+
[2221] F2[1]×pY[SubWidthC×x][-1]+(379)
[2222] F2[2]×pY[SubWidthC×x+1][-1]+2)>>2
[2223] 6. When cntT+cntL is not equal to 0, the variables minY, maxY, minC and maxC are derived as follows:
[2224] —When cntT+cntL is equal to 2, pSelComp[3] is set equal to pSelComp[0], pSelComp[2] is set equal to pSelComp[1], pSelComp[0] is set equal to pSelComp[1], pSelComp[1] is set equal to pSelComp[3], and Comp is replaced with DsY and C.
[2225] —The arrays minGrpIdx and maxGrpIdx are derived as follows:
[2226] minGrpIdx[0]=0 (380)
[2227] minGrpIdx[1]=2 (381)
[2228] maxGrpIdx[0]=1 (382)
[2229] maxGrpIdx[1]=3 (383)
[2230] —When pSelDsY[minGrpIdx[0]] is greater than pSelDsY[minGrpIdx[1]], minGrpIdx[0] and minGrpIdx[1] are swapped as follows:
[2231] (minGrpIdx[0], minGrpIdx[1])=Swap(minGrpIdx[0], minGrpIdx[1]) (384)
[2232] —When pSelDsY[maxGrpIdx[0]] is greater than pSelDsY[maxGrpIdx[1]], maxGrpIdx[0] and maxGrpIdx[1] are swapped as follows:
[2233] (maxGrpIdx[0], maxGrpIdx[1])=Swap(maxGrpIdx[0], maxGrpIdx[1]) (385)
[2234] —When pSelDsY[minGrpIdx[0]] is greater than pSelDsY[maxGrpIdx[1]], the arrays minGrpIdx and maxGrpIdx are swapped as follows:
[2235] (minGrpIdx, maxGrpIdx) = Swap (minGrpIdx, maxGrpIdx) (386)
[2236] —When pSelDsY[minGrpIdx[1]] is greater than pSelDsY[maxGrpIdx[0]], minGrpIdx[1] and maxGrpIdx[0] are swapped as follows:
[2237] (minGrpIdx[1], maxGrpIdx[0])=Swap(minGrpIdx[1], maxGrpIdx[0]) (387)
[2238] —The variables maxY, maxC, minY and minC are derived as follows:
[2239] maxY=(pSelDsY[maxGrpIdx[0]]+pSelDsY[maxGrpIdx[1]]+1)>>1 (388)
[2240] maxC=(pSelC[maxGrpIdx[0]]+pSelC[maxGrpIdx[1]]+1)>>1 (389)
[2241] minY=(pSelDsY[minGrpIdx[0]]+pSelDsY[minGrpIdx[1]]+1)>>1 (390)
[2242] minC=(pSelC[minGrpIdx[0]]+pSelC[minGrpIdx[1]]+1)>>1(391)
[2243] 7. The variables a, b and k are derived as follows:
[2244] — If numSampL is equal to 0 and numSampT is equal to 0, then the following applies:
[2245] k=0 (392)
[2246] a=0 (393)
[2247] b=1<<(BitDepth-1) (394)
[2248] — Otherwise, the following applies:
[2249] diff=maxY-minY (395)
[2250] — If diff is not equal to 0, the following applies:
[2251] diffC=maxC-minC (396)
[2252] x=Floor(Log2(diff)) (397)
[2253] normDiff=((diff<<4)>>x)&15 (398)
[2254] x+=(normDiff!=0)? 1:0(399)y=Abs(diffC)>0? Floor(Log2(Abs(diffC)))+1:0 (400)
[2255] a=(diffC×(divSigTable[normDiff]|8)+2 y - 1 )>>y (401)
[2256] k=((3+xy)<1)? 1:3+xy (402)
[2257] a=((3+xy)<1)? Sign(a)×15:a (403)
[2258] b=minC-((a×minY)>>k) (404)
[2259] where divSigTable[] is specified as follows:
[2260] divSigTable[]={0, 7, 6, 5, 5, 4, 4, 3, 3, 2, 2, 1, 1, 1, 1, 0} (405)
[2261] — Otherwise (diff is equal to 0), the following applies:
[2262] k=0 (406)
[2263] a=0 (407)
[2264] b=minC (408)
[2265] 8. The predicted sample point predSample[x][y], where x = 0..nTbW-1, y = 0..nTbH-1 is derived as follows:
[2266] predSamples[x][y]=Clip1(((pDsY[x][y]×a)>>k)+b) (409)
[2267] NOTE - This process uses sps_chroma_vertical_collocated_flag. However, to simplify the implementation, it does not use sps_chroma_horizontal_collocated_flag.
[2268] Example 13
[2269] The working draft specified in JVET-Q2001-vE may be modified as follows.
[2270] 8.4.5.2.13 Specification of INTRA_LT_CCLM, INTRA_L_CCLM and INTRA_T_CCLM intra prediction modes
[2271] The predicted sample predSample[x][y], where x = 0..nTbW-1, y = 0..nTbH-1, is derived as follows:
[2272] — If numSampL and numSampT are both equal to 0, the following applies:
[2273] predSamples[x][y]=1<<(BitDepth-1) (359)
[2274] — Otherwise, the following ordered steps apply:
[2275] 1. The co-located luma sample pY[x][y] where x=0..nTbW×SubWidthC-1, y=0..TbH×SubHeightC-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).
[2276] 2. The adjacent brightness samples pY[x][y] are derived as follows:
[2277] —When numSampL is greater than 0, the adjacent left luma sample pY[x][y] where x=-1..-3, y=0..SubHeightC×numSampL-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).
[2278] —When availT is equal to FALSE, where The adjacent top luma sample pY[x][y] with y=-1..-2 is set equal to the luma sample pY[x][0].
[2279] - When availL is equal to FALSE, the adjacent left luma sample pY[x][y] where x = -1..-3, y = -1..SubHeightC×numSampL-1 is set equal to luma sample pY[0][y].
[2280] —When numSampT is greater than 0, the adjacent top luma sample pY[x][y] where x=0..SubWidthC×numSampT-1, y=-1..-2 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).
[2281] —When availTL is equal to true (TRUE), the adjacent upper left luma sample pY[x][y] where x=-1, y=-1, -2 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).
[2282] Example 14
[2283] The working draft specified in JVET-Q2001-vE may be modified as follows.
[2284] 8.4.5.2.13 Specification of INTRA_LT_CCLM, INTRA_L_CCLM and INTRA_T_CCLM intra prediction modes
[2285] The predicted sample predSample[x][y], where x = 0..nTbW-1, y = 0..nTbH-1, is derived as follows:
[2286] — If numSampL and numSampT are both equal to 0, the following applies:
[2287] predSamples[x][y]=1<<(BitDepth-1) (359)
[2288] — Otherwise, the following ordered steps apply:
[2289] 1. The co-located luma sample pY[x][y] where x=0..nTbW×SubWidthC-1, y=0..TbH×SubHeightC-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).
[2290] 2. The adjacent brightness samples pY[x][y] are derived as follows:
[2291] —When numSampL is greater than 0, the adjacent left luma sample pY[x][y] where x=-1..-3, y=0..SubHeightC×numSampL-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).
[2292] —When availT is equal to FALSE When The adjacent top luma sample pY[x][y] with y=-1..-2 is set equal to the luma sample pY[x][0].
[2293] When availL is equal to FALSE, the adjacent left luma sample pY[x][y] where x=-1..-3, y=-1..SubHeightC×numSampL-1 is set equal to luma sample pY[0][y].
[2294] —When numSampT is greater than 0, the adjacent top luma sample pY[x][y] where x=0..SubWidthC×numSampT-1, y=-1..-2 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).
[2295] —When availTL is equal to true (TRUE), the adjacent upper left luma sample pY[x][y] where x=-1, y=-1, -2 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).
[2296] 5.15. Example 15
[2297] The working draft specified in JVET-Q2001-vE may be modified as follows.
[2298] 8.4.5.2.13 Specification of INTRA_LT_CCLM, INTRA_L_CCLM and INTRA_T_CCLM intra prediction modes
[2299] The predicted sample predSample[x][y], where x = 0..nTbW-1, y = 0..nTbH-1, is derived as follows:
[2300] — If numSampL and numSampT are both equal to 0, the following applies:
[2301] predSamples[x][y]=1<<(BitDepth-1) (359)
[2302] — Otherwise, the following ordered steps apply:
[2303] 1. The co-located luma sample pY[x][y] where x=0..nTbW×SubWidthC-1, y=0..TbH×SubHeightC-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).
[2304] 2. The adjacent brightness samples pY[x][y] are derived as follows:
[2305] —When numSampL is greater than 0, the adjacent left luma sample pY[x][y] where x=-1..-3, y=0..SubHeightC×numSampL-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).
[2306] - When availT is equal to FALSE, the adjacent top luma sample pY[x][y] where x = -1..SubWidthC×numSampT-1, y = -1..-2 is set equal to luma sample pY[x][0].
[2307] - when availL is equal to FALSE, where x = -1..-3, The adjacent left luma sample pY[x][y] is set equal to the luma sample pY[0][y].
[2308] —When numSampT is greater than 0, the adjacent top luma sample pY[x][y] where x=0..SubWidthC×numSampT-1, y=-1..-2 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).
[2309] —When availTL is equal to true (TRUE), the adjacent upper left luma sample pY[x][y] where x=-1, y=-1, -2 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).
[2310] Example 16
[2311] The working draft specified in JVET-Q2001-vE may be modified as follows.
[2312] 8.4.5.2.13 Specification of INTRA_LT_CCLM, INTRA_L_CCLM and INTRA_T_CCLM intra prediction modes
[2313] The predicted sample predSample[x][y], where x = 0..nTbW-1, y = 0..nTbH-1, is derived as follows:
[2314] — If numSampL and numSampT are both equal to 0, the following applies:
[2315] predSamples[x][y]=1<<(BitDepth-1) (359)
[2316] — Otherwise, the following ordered steps apply:
[2317] 1. The co-located luma sample pY[x][y] where x=0..nTbW×SubWidthC-1, y=0..TbH×SubHeightC-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).
[2318] 2. The adjacent brightness samples pY[x][y] are derived as follows:
[2319] —When numSampL is greater than 0, the adjacent left luma sample pY[x][y] where x=-1..-3, y=0..SubHeightC×numSampL-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).
[2320] - When availT is equal to FALSE, the adjacent top luma sample pY[x][y] where x = -1..SubWidthC×numSampT-1, y = -1..-2 is set equal to luma sample pY[x][0].
[2321] -[[When availL is equal to FALSE, the adjacent left luma sample pY[x][y] where x = -1..-3, y = -1..SubHeightC×numSampL-1 is set equal to the luma sample pY[0][y]. ]]
[2322] —When numSampT is greater than 0, the adjacent top luma sample pY[x][y] where x=0..SubWidthC×numSampT-1, y=-1..-2 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).
[2323]
[2324] —When availTL is equal to true (TRUE), the adjacent upper left luma sample pY[x][y] where x=-1, y=-1, -2 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).
[2325] 5.17. Example 17
[2326] The working draft specified in JVET-Q2001-vE may be modified as follows.
[2327] 8.4.5.2.13 Specification of INTRA_LT_CCLM, INTRA_L_CCLM and INTRA_T_CCLM intra prediction modes
[2328] The inputs to this process are:
[2329] —Intra prediction mode predModeIntra,
[2330] - the sample position of the upper left sample of the current transform block relative to the upper left sample of the current picture (xTbC, yTbC),
[2331] - variable nTbW specifying the transform block width,
[2332] - variable nTbH specifying the transform block height,
[2333] — variable cIdx that specifies the color component of the current block,
[2334] - Chroma neighboring samples p[x][y], where x=-1, y=0..2×nTbH-1, and x=0..2×nTbW-1, y=-1.
[2335] The output of this process is the predicted samples predSamples[x][y], where x=0..nTbW-1, y=0..nTbH-1.
[2336] The current brightness position (xTbY, yTbY) is derived as follows:
[2337] (xTbY, yTbY) = (xTbC<<(SubWidthC-1), yTbC<<(SubHeightC-1)) (351)
[2338] The variables availL, availT, and availTL are derived as follows:
[2339] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using as input the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY-1, yTbY), checkPredModeY set equal to false (FLASE), and cIdx, and assign the output to availL.
[2340] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using as input the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY, yTbY-1), checkPredModeY set equal to false (FLASE), and cIdx, and assign the output to availT.
[2341]
[2342] [[-The variable availTL is derived as follows:
[2343] availTL=availL&&availT (352)]]
[2344] 5.18. Example 18
[2345] The working draft specified in JVET-Q2001-vE may be modified as follows.
[2346] 8.4.5.2.13 Specification of INTRA_LT_CCLM, INTRA_L_CCLM and INTRA_T_CCLM intra prediction modes
[2347] The predicted sample predSample[x][y], where x = 0..nTbW-1, y = 0..nTbH-1, is derived as follows:
[2348] — If numSampL and numSampT are both equal to 0, the following applies:
[2349] predSamples[x][y]=1<<(BitDepth-1) (359)
[2350] — Otherwise, the following ordered steps apply:
[2351] 1. The co-located luma sample pY[x][y] where x=0..nTbW×SubWidthC-1, y=0..TbH×SubHeightC-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).
[2352] 2. The adjacent brightness samples pY[x][y] are derived as follows:
[2353] —When numSampL is greater than 0, the adjacent left luma sample pY[x][y] where x=-1..-3, y=0..SubHeightC×numSampL-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).
[2354] - When availT is equal to FALSE, the adjacent top luma sample pY[x][y] where x = -1..SubWidthC×numSampT-1, y = -1..-2 is set equal to luma sample pY[x][0].
[2355] - When availL is equal to FALSE, the adjacent left luma sample pY[x][y] where x = -1..-3, y = -1..SubHeightC×numSampL-1 is set equal to luma sample pY[0][y].
[2356] —When numSampT is greater than 0, the adjacent top luma sample pY[x][y] where x=0..SubWidthC×numSampT-1, y=-1..-2 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).
[2357] [[-When availTL is equal to TRUE, the adjacent upper left luma sample pY[x][y] where x=-1, y=-1, -2 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y). ]]
[2358]
[2359] 5.19. Example 19
[2360] The working draft specified in JVET-Q2001-vE may be modified as follows.
[2361] 8.4.5.2.13 Specification of INTRA_LT_CCLM, INTRA_L_CCLM and INTRA_T_CCLM intra prediction modes
[2362] The predicted sample predSample[x][y], where x = 0..nTbW-1, y = 0..nTbH-1, is derived as follows:
[2363] — If numSampL and numSampT are both equal to 0, the following applies:
[2364] predSamples[x][y]=1<<(BitDepth-1) (359)
[2365] — Otherwise, the following ordered steps apply:
[2366] 1. The co-located luma sample pY[x][y] where x=0..nTbW×SubWidthC-1, y=0..TbH×SubHeightC-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).
[2367] 2. The adjacent brightness samples pY[x][y] are derived as follows:
[2368] —When numSampL is greater than 0, the adjacent left luma sample pY[x][y] where x=-1..-3, y=0..SubHeightC×numSampL-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).
[2369] - When availT is equal to FALSE, the adjacent top luma sample pY[x][y] where x = -1..SubWidthC×numSampT-1, y = -1..-2 is set equal to luma sample pY[x][0].
[2370] - When availL is equal to FALSE, the adjacent left luma sample pY[x][y] where x = -1..-3, y = -1..SubHeightC×numSampL-1 is set equal to luma sample pY[0][y].
[2371] —When numSampT is greater than 0, the adjacent top luma sample pY[x][y] where x=0..SubWidthC×numSampT-1, y=-1..-2 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).
[2372] [[-When availTL is equal to TRUE, the adjacent upper left luma sample pY[x][y] where x=-1, y=-1, -2 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y). ]]
[2373]
[2374] 5.20. Example 20
[2375] The working draft specified in JVET-Q2001-vE may be modified as follows.
[2376] 8.4.5.2.13 Specification of INTRA_LT_CCLM, INTRA_L_CCLM and INTRA_T_CCLM intra prediction modes
[2377] The inputs to this process are:
[2378] —Intra prediction mode predModeIntra,
[2379] - the sample position of the upper left sample of the current transform block relative to the upper left sample of the current picture (xTbC, yTbC),
[2380] - variable nTbW specifying the transform block width,
[2381] - variable nTbH specifying the transform block height,
[2382] — variable cIdx that specifies the color component of the current block,
[2383] - Chroma neighboring samples p[x][y], where x=-1, y=0..2×nTbH-1, and x=0..2×nTbW-1, y=-1.
[2384] The output of this process is the predicted samples predSamples[x][y], where x=0..nTbW-1, y=0..nTbH-1.
[2385] The current brightness position (xTbY, yTbY) is derived as follows:
[2386] (xTbY, yTbY) = (xTbC<<(SubWidthC-1), yTbC<<(SubHeightC-1)) (351)
[2387] The variables availL, availT, and availTL are derived as follows:
[2388] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using as input the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY-1, yTbY), checkPredModeY set equal to false (FLASE), and cIdx, and assign the output to availL.
[2389] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using as input the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY, yTbY-1), checkPredModeY set equal to false (FLASE), and cIdx, and assign the output to availT.
[2390]
[2391] [[-The variable availTL is derived as follows:
[2392] availTL=availL&&availT (352)]]
[2393] …
[2394] The predicted sample predSample[x][y], where x = 0..nTbW-1, y = 0..nTbH-1, is derived as follows:
[2395] — If numSampL and numSampT are both equal to 0, the following applies:
[2396] predSamples[x][y]=1<<(BitDepth-1) (359)
[2397] — Otherwise, the following ordered steps apply:
[2398] 1. The co-located luma sample pY[x][y] where x=0..nTbW×SubWidthC-1, y=0..TbH×SubHeightC-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).
[2399] 2. The adjacent brightness samples pY[x][y] are derived as follows:
[2400] —When numSampL is greater than 0, the adjacent left luma sample pY[x][y] where x=-1..-3, y=0..SubHeightC×numSampL-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).
[2401] - When availT is equal to FALSE, the adjacent top luma sample pY[x][y] where x = -1..SubWidthC×numSampT-1, y = -1..-2 is set equal to luma sample pY[x][0].
[2402] - When availL is equal to FALSE, the adjacent left luma sample pY[x][y] where x = -1..-3, y = -1..SubHeightC×numSampL-1 is set equal to luma sample pY[0][y].
[2403] —When numSampT is greater than 0, the adjacent top luma sample pY[x][y] where x=0..SubWidthC×numSampT-1, y=-1..-2 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).
[2404] —When availTL is equal to TRUE When x=-1, y=-1, -2, the adjacent upper left luma sample pY[x][y] is set equal to the reconstructed luma sample before the deblocking filtering process at the position (xTbY+x, yTbY+y).
[2405] 5.21. Example 21
[2406] The working draft specified in JVET-Q2001-vE may be modified as follows.
[2407] 8.4.5.2.13 Specification of INTRA_LT_CCLM, INTRA_L_CCLM and INTRA_T_CCLM intra prediction modes
[2408] The predicted sample predSample[x][y], where x = 0..nTbW-1, y = 0..nTbH-1, is derived as follows:
[2409] — If numSampL and numSampT are both equal to 0, the following applies:
[2410] predSamples[x][y]=1<<(BitDepth-1) (359)
[2411] — Otherwise, the following ordered steps apply:
[2412] 1. The co-located luma sample pY[x][y] where x=0..nTbW×SubWidthC-1, y=0..TbH×SubHeightC-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).
[2413] 2. The adjacent brightness samples pY[x][y] are derived as follows:
[2414] —When numSampL is greater than 0, the adjacent left luma sample pY[x][y] where x=-1..-3, y=0..SubHeightC×numSampL-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).
[2415] —When availT is equal to FALSE When x=-1..SubWidthC×numSampT-1, y=-1..-2, the adjacent top luma sample pY[x][y] is set equal to the luma sample pY[x][0].
[2416] —When availL is equal to FALSE When x=-1..-3, y=-1..SubHeightC×numSampL-1, the adjacent left luma sample pY[x][y] is set equal to the luma sample pY[0][y].
[2417] —When numSampT is greater than 0, the adjacent top luma sample pY[x][y] where x=0..SubWidthC×numSampT-1, y=-1..-2 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).
[2418] —When availTL is equal to true (TRUE), the adjacent upper left luma sample pY[x][y] where x=-1, y=-1, -2 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).
[2419] 5.22. Example 22
[2420] The working draft specified in JVET-Q2001-vE may be modified as follows.
[2421] 8.4.5.2.13 Specification of INTRA_LT_CCLM, INTRA_L_CCLM and INTRA_T_CCLM intra prediction modes
[2422] The predicted sample predSample[x][y], where x = 0..nTbW-1, y = 0..nTbH-1, is derived as follows:
[2423] — If numSampL and numSampT are both equal to 0, the following applies:
[2424] predSamples[x][y]=1<<(BitDepth-1) (359)
[2425] — Otherwise, the following ordered steps apply:
[2426] 1. The co-located luma sample pY[x][y] where x=0..nTbW×SubWidthC-1, y=0..TbH×SubHeightC-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).
[2427] 2. The adjacent brightness samples pY[x][y] are derived as follows:
[2428] —When numSampL is greater than 0, the adjacent left luma sample pY[x][y] where x=-1..-3, y=0..SubHeightC×numSampL-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).
[2429] - When availT is equal to FALSE, the adjacent top luma sample pY[x][y] where x = [[1]] 0..SubWidthC×numSampT-1, y = -1..-2 is set equal to luma sample pY[x][0].
[2430] - When availL is equal to FALSE, the adjacent left luma sample pY[x][y] where x = -1..-3, y = [[-1]]0..SubHeightC×numSampL-1 is set equal to the luma sample pY[0][y].
[2431] —When numSampT is greater than 0, the adjacent top luma sample pY[x][y] where x=0..SubWidthC×numSampT-1, y=-1..-2 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).
[2432] —When availTL is equal to true (TRUE), the adjacent upper left luma sample pY[x][y] where x=-1, y=-1, -2 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).
[2433]
[2434] 5.23. Example 23
[2435] The working draft specified in JVET-Q2001-vE may be modified as follows.
[2436] 8.4.5.2.13 Specification of INTRA_LT_CCLM, INTRA_L_CCLM and INTRA_T_CCLM intra prediction modes
[2437] The inputs to this process are:
[2438] —Intra prediction mode predModeIntra,
[2439] - the sample position of the upper left sample of the current transform block relative to the upper left sample of the current picture (xTbC, yTbC),
[2440] - variable nTbW specifying the transform block width,
[2441] - variable nTbH specifying the transform block height,
[2442] — variable cIdx that specifies the color component of the current block,
[2443] - Chroma neighboring samples p[x][y], where x=-1, y=0..2×nTbH-1, and x=0..2×nTbW-1, y=-1.
[2444] The output of this process is predSamples[x][y], where x = 0..nTbW-1, y = 0..nTbH-1.
[2445] The current brightness position (xTbY, yTbY) is derived as follows:
[2446] (xTbY, yTbY) = (xTbC<<(SubWidthC-1), yTbC<<(SubHeightC-1)) (351)
[2447] The variables availL, availT, and availTL are derived as follows:
[2448] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using as input the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY-1, yTbY), checkPredModeY set equal to false (FLASE), and cIdx, and assign the output to availL.
[2449] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using as input the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY, yTbY-1), checkPredModeY set equal to false (FLASE), and cIdx, and assign the output to availT.
[2450]
[2451] [[-The variable availTL is derived as follows:
[2452] availTL=availL&&availT (352)]]
[2453] …
[2454] The predicted sample predSample[x][y], where x = 0..nTbW-1, y = 0..nTbH-1, is derived as follows:
[2455] — If numSampL and numSampT are both equal to 0, the following applies:
[2456] predSamples[x][y]=1<<(BitDepth-1) (359)
[2457] — Otherwise, the following ordered steps apply:
[2458] 1. The co-located luma sample pY[x][y] where x=0..nTbW×SubWidthC-1, y=0..TbH×SubHeightC-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).
[2459] 2. The adjacent brightness samples pY[x][y] are derived as follows:
[2460] —When numSampL is greater than 0, the adjacent left luma sample pY[x][y] where x=-1..-3, y=0..SubHeightC×numSampL-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).
[2461] - When availT is equal to FALSE, the adjacent top luma sample pY[x][y] where x = -1..SubWidthC×numSampT-1, y = -1..-2 is set equal to luma sample pY[x][0].
[2462] - When availL is equal to FALSE, the adjacent left luma sample pY[x][y] where x = -1..-3, y = -1..SubHeightC×numSampL-1 is set equal to luma sample pY[0][y].
[2463] —When numSampT is greater than 0, the adjacent top luma sample pY[x][y] with x=0..SubWidthC×numSampT-1, y=-1..-2 is set equal to the reconstructed luma sample before the deblocking filtering process at the position (xTbY+x, yTbY+y).
[2464] [[-When availTL is equal to TRUE, the adjacent upper left luma sample pY[x][y] where x=-1, y=-1, -2 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y). ]]
[2465]
[2466] 5.24. Example 24
[2467] The working draft specified in JVET-Q2001-vE may be modified as follows.
[2468] 8.4.5.2.13 Specification of INTRA_LT_CCLM, INTRA_L_CCLM and INTRA_T_CCLM intra prediction modes
[2469] The inputs to this process are:
[2470] —Intra prediction mode predModeIntra,
[2471] - the sample position of the upper left sample of the current transform block relative to the upper left sample of the current picture (xTbC, yTbC),
[2472] - variable nTbW specifying the transform block width,
[2473] - variable nTbH specifying the transform block height,
[2474] — variable cIdx that specifies the color component of the current block,
[2475] - Chroma neighboring samples p[x][y], where x=-1, y=0..2×nTbH-1, and x=0..2×nTbW-1, y=-1.
[2476] The output of this process is predSamples[x][y], where x = 0..nTbW-1, y = 0..nTbH-1.
[2477] The current brightness position (xTbY, yTbY) is derived as follows:
[2478] (xTbY, yTbY) = (xTbC<<(SubWidthC-1), yTbC<<(SubHeightC-1)) (351)
[2479] The variables availL, availT, and availTL are derived as follows:
[2480] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using as input the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY-1, yTbY), checkPredModeY set equal to false (FLASE), and cIdx, and assign the output to availL.
[2481] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using as input the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY, yTbY-1), checkPredModeY set equal to false (FLASE), and cIdx, and assign the output to availT.
[2482]
[2483] [[-The variable availTL is derived as follows:
[2484] availTL=availL&&availT (352)]]
[2485] …
[2486] The predicted sample predSample[x][y], where x = 0..nTbW-1, y = 0..nTbH-1, is derived as follows:
[2487] — If numSampL and numSampT are both equal to 0, the following applies:
[2488] predSamples[x][y]=1<<(BitDepth-1) (359)
[2489] — Otherwise, the following ordered steps apply:
[2490] 1. The co-located luma sample pY[x][y] where x=0..nTbW×SubWidthC-1, y=0..TbH×SubHeightC-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).
[2491] 2. The adjacent brightness samples pY[x][y] are derived as follows:
[2492] —When numSampL is greater than 0, the adjacent left luma sample pY[x][y] where x=-1..-3, y=0..SubHeightC×numSampL-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).
[2493] - When availT is equal to FALSE, the adjacent top luma sample pY[x][y] where x = -1..SubWidthC×numSampT-1, y = -1..-2 is set equal to luma sample pY[x][0].
[2494] - When availL is equal to FALSE, the adjacent left luma sample pY[x][y] where x = -1..-3, y = -1..SubHeightC×numSampL-1 is set equal to luma sample pY[0][y].
[2495] —When numSampT is greater than 0, the adjacent top luma sample pY[x][y] where x=0..SubWidthC×numSampT-1, y=-1..-2 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).
[2496] [[-When availTL is equal to TRUE, the adjacent upper left luma sample pY[x][y] where x=-1, y=-1, -2 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y). ]]
[2497]
[2498] Example 25
[2499] The working draft specified in JVET-Q2001-vE may be modified as follows.
[2500] 8.4.5.2.13 Specification of INTRA_LT_CCLM, INTRA_L_CCLM and INTRA_T_CCLM intra prediction modes
[2501] The inputs to this process are:
[2502] —Intra prediction mode predModeIntra,
[2503] - the sample position of the upper left sample of the current transform block relative to the upper left sample of the current picture (xTbC, yTbC),
[2504] - variable nTbW specifying the transform block width,
[2505] - variable nTbH specifying the transform block height,
[2506] — variable cIdx that specifies the color component of the current block,
[2507] - Chroma neighboring samples p[x][y], where x=-1, y=0..2×nTbH-1, and x=0..2×nTbW-1, y=-1.
[2508] The output of this process is predSamples[x][y], where x = 0..nTbW-1, y = 0..nTbH-1.
[2509] The current brightness position (xTbY, yTbY) is derived as follows:
[2510] (xTbY, yTbY) = (xTbC<<(SubWidthC-1), yTbC<<(SubHeightC-1)) (351)
[2511] The variables availL, availT, and availTL are derived as follows:
[2512] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using as input the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY-1, yTbY), checkPredModeY set equal to false (FLASE), and cIdx, and assign the output to availL.
[2513] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using as input the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY, yTbY-1), checkPredModeY set equal to false (FLASE), and cIdx, and assign the output to availT.
[2514]
[2515] [[-The variable availTL is derived as follows:
[2516] availTL=availL&&availT (352)]]
[2517] …
[2518] The predicted sample predSample[x][y], where x = 0..nTbW-1, y = 0..nTbH-1, is derived as follows:
[2519] — If numSampL and numSampT are both equal to 0, the following applies:
[2520] predSamples[x][y]=1<<(BitDepth-1) (359)
[2521] — Otherwise, the following ordered steps apply:
[2522] 1. The co-located luma sample pY[x][y] where x=0..nTbW×SubWidthC-1, y=0..TbH×SubHeightC-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).
[2523] 2. The adjacent brightness samples pY[x][y] are derived as follows:
[2524] —When numSampL is greater than 0, the adjacent left luma sample pY[x][y] where x=-1..-3, y=0..SubHeightC×numSampL-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).
[2525] - When availT is equal to FALSE, the adjacent top luma sample pY[x][y] where x = -1..SubWidthC×numSampT-1, y = -1..-2 is set equal to luma sample pY[x][0].
[2526] - When availL is equal to FALSE, the adjacent left luma sample pY[x][y] where x = -1..-3, y = -1..SubHeightC×numSampL-1 is set equal to luma sample pY[0][y].
[2527] —When numSampT is greater than 0, the adjacent top luma sample pY[x][y] where x=0..SubWidthC×numSampT-1, y=-1..-2 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).
[2528] [[-When availTL is equal to TRUE, the adjacent upper left luma sample pY[x][y] where x=-1, y=-1, -2 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y). ]]
[2529]
[2530] 5.26. Example 26
[2531] The working draft specified in JVET-Q2001-vE may be modified as follows.
[2532] 8.4.5.2.13 Specification of INTRA_LT_CCLM, INTRA_L_CCLM and INTRA_T_CCLM intra prediction modes
[2533] The inputs to this process are:
[2534] —Intra prediction mode predModeIntra,
[2535] - the sample position of the upper left sample of the current transform block relative to the upper left sample of the current picture (xTbC, yTbC),
[2536] - variable nTbW specifying the transform block width,
[2537] - variable nTbH specifying the transform block height,
[2538] — variable cIdx that specifies the color component of the current block,
[2539] - Chroma neighboring samples p[x][y], where x=-1, y=0..2×nTbH-1, and x=0..2×nTbW-1, y=-1.
[2540] The output of this process is predSamples[x][y], where x = 0..nTbW-1, y = 0..nTbH-1.
[2541] The current brightness position (xTbY, yTbY) is derived as follows:
[2542] (xTbY, yTbY) = (xTbC<<(SubWidthC-1), yTbC<<(SubHeightC-1)) (351)
[2543] The variables availL, availT, and availTL are derived as follows:
[2544] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using as input the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY-1, yTbY), checkPredModeY set equal to false (FLASE), and cIdx, and assign the output to availL.
[2545] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using as input the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY, yTbY-1), checkPredModeY set equal to false (FLASE), and cIdx, and assign the output to availT.
[2546]
[2547] [[-The variable availTL is derived as follows:
[2548] availTL=availL&&availT (352)]]
[2549] …
[2550] The predicted sample predSample[x][y], where x = 0..nTbW-1, y = 0..nTbH-1, is derived as follows:
[2551] — If numSampL and numSampT are both equal to 0, the following applies:
[2552] predSamples[x][y]=1<<(BitDepth-1) (359)
[2553] — Otherwise, the following ordered steps apply:
[2554] 1. The co-located luma sample pY[x][y] where x=0..nTbW×SubWidthC-1, y=0..TbH×SubHeightC-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).
[2555] 2. The adjacent brightness samples pY[x][y] are derived as follows:
[2556] —When numSampL is greater than 0, where x = -1..-3, y = 0..SubHeightC×
[2557] The neighboring left luma sample pY[x][y] of numSampL-1 is set equal to the reconstructed luma sample before the deblocking filtering process at the position (xTbY+x, yTbY+y).
[2558] - When availT is equal to FALSE, the adjacent top luma sample pY[x][y] where x = -1..SubWidthC×numSampT-1, y = -1..-2 is set equal to luma sample pY[x][0].
[2559] - When availL is equal to FALSE, the adjacent left luma sample pY[x][y] where x = -1..-3, y = -1..SubHeightC×numSampL-1 is set equal to luma sample pY[0][y].
[2560] —When numSampT is greater than 0, the adjacent top luma sample pY[x][y] where x=0..SubWidthC×numSampT-1, y=-1..-2 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).
[2561] [[-When availTL is equal to TRUE, the adjacent upper left luma sample pY[x][y] where x=-1, y=-1, -2 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y). ]]
[2562]
[2563] 5.27. Example 27
[2564] The working draft specified in JVET-Q2001-vE may be modified as follows.
[2565] 8.4.5.2.13 Specification of INTRA_LT_CCLM, INTRA_L_CCLM and INTRA_T_CCLM intra prediction modes
[2566] The predicted sample predSample[x][y], where x = 0..nTbW-1, y = 0..nTbH-1, is derived as follows:
[2567] — If numSampL and numSampT are both equal to 0, the following applies:
[2568] predSamples[x][y]=1<<(BitDepth-1) (359)
[2569] — Otherwise, the following ordered steps apply:
[2570] 1. The co-located luma sample pY[x][y] where x=0..nTbW×SubWidthC-1, y=0..TbH×SubHeightC-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).
[2571] 2. The adjacent brightness samples pY[x][y] are derived as follows:
[2572] —When numSampL is greater than 0, the adjacent left luma sample pY[x][y] where x=-1..-3, y=0..SubHeightC×numSampL-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).
[2573] - When availT is equal to FALSE, the adjacent top luma sample pY[x][y] where x = -1..SubWidthC×numSampT-1, y = -1..-2 is set equal to luma sample pY[x][0].
[2574] - When availL is equal to FALSE, the adjacent left luma sample pY[x][y] where x = -1..-3, y = -1..SubHeightC×numSampL-1 is set equal to luma sample pY[0][y].
[2575] —When numSampT is greater than 0, the adjacent top luma sample pY[x][y] where x=0..SubWidthC×numSampT-1, y=-1..-2 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).
[2576] —When availTL is equal to true (TRUE), the adjacent upper left luma sample pY[x][y] where x=-1, y=-1, -2 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).
[2577] 3. The downsampled co-located luminance sample pDsY[x][y], where x = 0..nTbW-1, y = 0..nTbH-1, is derived as follows:
[2578] —If SubWidthC and SubHeightC are both equal to 1, then the following applies:
[2579] —pDsY[x][y], where x=1..nTbW-1, y=1..nTbH-1 is derived as follows:
[2580] pDstY[x][y]=pY[x][y] (360)
[2581] — Otherwise, the following applies:
[2582] —The one-dimensional filter coefficient arrays F1 and F2 and the two-dimensional filter coefficient arrays F3 and F4 are specified as follows.
[2583] F1[0]=2,F1[1]=0 (361)
[2584] F2[0]=1,F2[1]=2,F2[2]=1 (362)
[2585] F3[i][j]=F4[i][j]=0,with i=0..2,j=0..2 (363)
[2586] — If SubWidthC and SubHeightC are both equal to 2, then the following applies:
[2587] F1[0]=1,F1[1]=1 (364)
[2588] F3[0][1]=1,F3[1][1]=4,F3[2][1]=1,F3[1][0]=1,F3[1][2]=1 (365)
[2589] F4[0][1]=1,F4[1][1]=2,F4[2][1]=1 (366)
[2590] F4[0][2]=1,F4[1][2]=2,F4[2][2]=1 (367)
[2591] — Otherwise, the following applies:
[2592]
[2593] F4[0][1]=2, F4[1][1]=4, F4[2][1]=2, (369)
[2594] - If sps_chroma_vertical_collocated_flag is equal to 1, the following applies:
[2595] —pDsY[x][y], where x=0..nTbW-1, y=0..nTbH-1 is derived as follows:
[2596] pDsY[x][y]=(F3[1][0]×pY[SubWidthC×x][SubHeightC×y-1]+
[2597] F3[0][1]×pY[SubWidthC×x-1][SubHeightC×y]+
[2598] F3[1][1]×pY[SubWidthC×x][SubHeightC×y]+(370)
[2599] F3[2][1]×pY[SubWidthC×x+1][SubHeightC×y]+
[2600] F3[1][2]×pY[SubWidthC×x][SubHeightC×y+1]+4)>>3
[2601] - Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies:
[2602] —pDsY[x][y], x=0..nTbW-1, y=0..nTbH-1 is derived as follows:
[2603] pDsY[x][y]=(F4[0][1]×pY[SubWidthC×x-1][SubHeightC×y]+
[2604] F4[0][2]×pY[SubWidthC×x-1][SubHeightC×y+1]+
[2605] F4[1][1]×pY[SubWidthC×x][SubHeightC×y]+(371)
[2606] F4[1][2]×pY[SubWidthC×x][SubHeightC×y+1]+
[2607] F4[2][1]×pY[SubWidthC×x+1][SubHeightC×y]+
[2608] F4[2][2]×pY[SubWidthC×x+1][SubHeightC×y+1]+4)>>3
[2609] 5.28. Example 28
[2610] The working draft specified in JVET-Q2001-vE may be modified as follows.
[2611] 8.4.5.2.13 Specification of INTRA_LT_CCLM, INTRA_L_CCLM and INTRA_T_CCLM intra prediction modes
[2612] The inputs to this process are:
[2613] —Intra prediction mode predModeIntra,
[2614] - the sample position of the upper left sample of the current transform block relative to the upper left sample of the current picture (xTbC, yTbC),
[2615] - variable nTbW specifying the transform block width,
[2616] - variable nTbH specifying the transform block height,
[2617] — variable cIdx that specifies the color component of the current block,
[2618] - Chroma neighboring samples p[x][y], where x=-1, y=0..2×nTbH-1, and x=0..2×nTbW-1, y=-1.
[2619] The output of this process is predSamples[x][y], where x = 0..nTbW-1, y = 0..nTbH-1.
[2620] The current brightness position (xTbY, yTbY) is derived as follows:
[2621] (xTbY, yTbY) = (xTbC<<(SubWidthC-1), yTbC<<(SubHeightC-1)) (351)
[2622] The variables availL, availT, and availTL are derived as follows:
[2623] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using as input the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY-1, yTbY), checkPredModeY set equal to false (FLASE), and cIdx, and assign the output to availL.
[2624] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using as input the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY, yTbY-1), checkPredModeY set equal to false (FLASE), and cIdx, and assign the output to availT.
[2625] —The variable availTL is derived as follows:
[2626] availTL=availL&&availT (352)
[2627] —The number of available top-right adjacent chroma samples numTopRight is derived as follows:
[2628] —The variable numTopRight is set to 0, and availTR is set to TRUE.
[2629] - When predModeIntra is equal to INTRA_T_CCLM, the following applies for x=nTbW..2×nTbW-1 until availTR is equal to FALSE or x is equal to 2×nTbW-1:
[2630] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using as input the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY+x, yTbY-1), checkPredModeY set equal to false (FLASE), and cIdx, and assign the output to availTR.
[2631] —When availTR is equal to TRUE, numTopRight is increased by 1.
[2632] —The number of available lower left adjacent chroma samples numLeftBelow is derived as follows:
[2633] —The variable numLeftBelow is set to 0, and availLB is set to TRUE.
[2634] - When predModeIntra is equal to INTRA_L_CCLM, the following applies for y=nTbH..2×nTbH-1 until availLB is equal to FALSE or y is equal to 2×nTbH-1:
[2635] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using as input the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY-1, yTbY+y), checkPredModeY set equal to false (FLASE), and cIdx, and assign the output to availLB.
[2636] —When availLB is equal to TRUE, numLeftBelow is increased by 1.
[2637] The number of available adjacent chroma samples numSampT at the top and upper right and the number of available adjacent chroma samples numSampL at the left and lower left are derived as follows:
[2638] — If predModeIntra is equal to INTRA_LT_CCLM, the following applies:
[2639] numSampT=availT? nTbW:0 (353)
[2640] numSampL=availL? nTbH:0(354)
[2641] — Otherwise, the following applies:
[2642] numSampT=(availT&&predModeIntra==INTRA_T_CCLM)? (nTbW+Min(numTopRight,nTbH)):0 (355)
[2643] numSampL=(availL&&predModeIntra==INTRA_L_CCLM)? (nTbH+Min(numLeftBelow,nTbW)):0 (356)
[2644] The variable bCTUboundary is derived as follows:
[2645] bCTUboundary=(yTbY&(CtbSizeY-1)==0)? TRUE:FALSE (357)
[2646] The variable cntN and array pickPosN where N is replaced by L and T are derived as follows:
[2647] —The variable numIs4N is derived as follows:
[2648] numIs4N=((availT&&availL&&predModeIntra==INTRA_LT_CCLM)?0:1) (358)
[2649] —The variable startPosN is set equal to numSampN>>(2+numIs4N).
[2650] —The variable pickStepN is set equal to Max(1, numSampN>>(1+numIs4N)).
[2651] —If availN is equal to TRUE and predModeIntra is equal to INTRA_LT_CCLM or INTRA_N_CCLM, the following assignments are made:
[2652] —cntN is set equal to Min(numSampN, (1+numIs4N)<<1).
[2653] —pickPosN[pos] is set equal to (startPosN+pos×pickStepN), where pos=0..cntN-1.
[2654] Otherwise, cntN is set equal to 0.
[2655]
[2656] The predicted sample predSample[x][y], where x = 0..nTbW-1, y = 0..nTbH-1, is derived as follows:
[2657] — If numSampL and numSampT are both equal to 0, the following applies:
[2658] predSamples[x][y]=1<<(BitDepth-1) (359)
[2659] — Otherwise, the following ordered steps apply:
[2660] 1. The co-located luma sample pY[x][y] where x=0..nTbW×SubWidthC-1, y=0..TbH×SubHeightC-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).
[2661] 2. The adjacent brightness samples pY[x][y] are derived as follows:
[2662] —When numSampL is greater than 0, the adjacent left luma sample pY[x][y] where x=-1..-3, y=0..SubHeightC×numSampL-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).
[2663] - When availT is equal to FALSE, the adjacent top luma sample pY[x][y] where x = -1..SubWidthC×numSampT-1, y = -1..-2 is set equal to luma sample pY[x][0].
[2664] - When availL is equal to FALSE, the adjacent left luma sample pY[x][y] where x = -1..-3, y = -1..SubHeightC×numSampL-1 is set equal to luma sample pY[0][y].
[2665] —When numSampT is greater than 0, the adjacent top luma sample pY[x][y] where x=0..SubWidthC×numSampT-1, y=-1..-2 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).
[2666] —When availTL is equal to true (TRUE), the adjacent upper left luma sample pY[x][y] where x=-1, y=-1, -2 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).
[2667] 3. The downsampled co-located luminance sample pDsY[x][y], where x = 0..nTbW-1, y = 0..nTbH-1, is derived as follows:
[2668] —If SubWidthC and SubHeightC are both equal to 1, then the following applies:
[2669] pDsY[x][y], where x=1..nTbW-1, y=1..nTbH-1 is derived as follows:
[2670] pDstY[x][y]=pY[x][y] (360)
[2671] — Otherwise, the following applies:
[2672] —The one-dimensional filter coefficient arrays F1 and F2 and the two-dimensional filter coefficient arrays F3 and F4 are specified as follows.
[2673] F1[0]=2,F1[1]=0 (361)
[2674] F2[0]=1,F2[1]=2,F2[2]=1 (362)
[2675] F3[i][j]=F4[i][j]=0,with i=0..2,j=0..2 (363)
[2676] — If SubWidthC and SubHeightC are both equal to 2, then the following applies:
[2677] F1[0]=1,F1[1]=1 (364)
[2678] F3[0][1]=1,F3[1][1]=4,F3[2][1]=1,F3[1][0]=1,F3[1][2]=1 (365)
[2679] F4[0][1]=1,F4[1][1]=2,F4[2][1]=1 (366)
[2680] F4[0][2]=1,F4[1][2]=2,F4[2][2]=1 (367)
[2681]
[2682] — Otherwise, the following applies:
[2683] F3[1][1]=8 (368)
[2684] F4[0][1]=2, F4[1][1]=4, F4[2][1]=2, (369)
[2685]
[2686] —if [[sps_chroma_vertical_collocated_flag]] is equal to 1, then the following applies:
[2687] —pDsY[x][y], where x=0..nTbW-1, y=0..nTbH-1 is derived as follows:
[2688] pDsY[x][y]=(F3[1][0]×pY[SubWidthC×x][SubHeightC×y-1]+
[2689] F3[0][1]×pY[SubWidthC×x-1][SubHeightC×y]+
[2690] F3[1][1]×pY[SubWidthC×x][SubHeightC×y]+(370)
[2691] F3[2][1]×pY[SubWidthC×x+1][SubHeightC×y]+
[2692] F3[1][2]×pY[SubWidthC×x][SubHeightC×y+1]+4)>>3
[2693] —otherwise([[sps_chroma_vertical_collocated_flag]] is equal to 0), then the following applies:
[2694] —pDsY[x][y], x=0..nTbW-1, y=0..nTbH-1 is derived as follows:
[2695] pDsY[x][y]=(F4[0][1]×pY[SubWidthC×x-1][SubHeightC×y]+
[2696] F4[0][2]×pY[SubWidthC×x-1][SubHeightC×y+1]+
[2697] F4[1][1]×pY[SubWidthC×x][SubHeightC×y]+(371)
[2698] F4[1][2]×pY[SubWidthC×x][SubHeightC×y+1]+
[2699] F4[2][1]×pY[SubWidthC×x+1][SubHeightC×y]+
[2700] F4[2][2]×pY[SubWidthC×x+1][SubHeightC×y+1]+4)>>3
[2701] 4. When numSampL is greater than 0, the selected adjacent left chroma sample pSelC[idx] is set equal to p[-1][pickPosL[idx]], where idx = 0..cntL-1, and the selected downsampled adjacent left luma sample pSelDsY[idx], where idx = 0..cntL-1 is derived as follows:
[2702] —The variable y is set equal to pickPosL[idx].
[2703] —If SubWidthC and SubHeightC are both equal to 1, then the following applies:
[2704] pSelDsY[idx]=pY[-1][y] (372)
[2705] — Otherwise, the following applies:
[2706] —if [[sps_chroma_vertical_collocated_flag]] equal
[2707] 1, the following applies:
[2708] pSelDsY[idx]=(F3[1][0]×pY[-SubWidthC][SubHeightC×y-1]+
[2709] F3[0][1]×pY[-1-SubWidthC][SubHeightC×y]+
[2710] F3[1][1]×pY[-SubWidthC][SubHeightC×y]+(373)
[2711] F3[2][1]×pY[1-SubWidthC][SubHeightC×y]+
[2712] F3[1][2]×pY[-SubWidthC][SubHeightC×y+1]+4)>>3
[2713] —otherwise([[sps_chroma_vertical_collocated_flag]] is equal to 0), the following applies:
[2714] pSelDsY[idx]=(F4[0][1]×pY[-1-SubWidthC][SubHeightC×y]+
[2715] F4[0][2]×pY[-1-SubWidthC][SubHeightC×y+1]+
[2716] F4[1][1]×pY[-SubWidthC][SubHeightC×y]+(374)
[2717] F4[1][2]×pY[-SubWidthC][SubHeightC×y+1]+
[2718] F4[2][1]×pY[1-SubWidthC][SubHeightC×y]+
[2719] F4[2][2]×pY[1-SubWidthC][SubHeightC×y+1]+4)>>3
[2720] 5. When numSampT is greater than 0, the selected adjacent top chroma sample pSelC[idx] is set equal to p[pickPosT[idx-cntL]][-1], where idx = cntL..cntL+cntT-1, and the adjacent top luma sample pSelDsY[idx] is downsampled, where It is specified as follows:
[2721] —The variable x is set equal to pickPosT[idx-cntL].
[2722] —If SubWidthC and SubHeightC are both equal to 1, then the following applies:
[2723] pSelDsY[idx]=pY[x][-1] (375)
[2724] — Otherwise, the following applies:
[2725] —if [[sps_chroma_vertical_collocated_flag]] is equal to 1, then the following applies:
[2726] — If bCTUboundary is equal to FALSE, the following applies:
[2727] pSelDsY[idx]=(F3[1][0]×pY[SubWidthC×x][-1-SubHeightC]+
[2728] F3[0][1]×pY[SubWidthC×x-1][-SubHeightC]+
[2729] F3[1][1]×pY[SubWidthC×x][-SubHeightC]+(376)
[2730] F3[2][1]×pY[SubWidthC×x+1][-SubHeightC]+
[2731] F3[1][2]×pY[SubWidthC×x][1-SubHeightC]+4)>>3
[2732] — Otherwise (bCTUboundary is TRUE), the following applies:
[2733] pSelDsY[idx]=(F2[0]×pY[SubWidthC×x-1][-1]+
[2734] F2[1]×pY[SubWidthC×x][-1]+(377)
[2735] F2[2]×pY[SubWidthC×x+1][-1]+2)>>2
[2736] —otherwise([[sps_chroma_vertical_collocated_flag]] is equal to 0), the following applies:
[2737] — If bCTUboundary is equal to FALSE, the following applies:
[2738] pSelDsY[idx]=(F4[0][1]×pY[SubWidthC x-1][-1]+
[2739] F4[0][2]×pY[SubWidthC×x-1][-2]+
[2740] F4[1][1]×pY[SubWidthC×x][-1]+(378)
[2741] F4[1][2]×pY[SubWidthC×x][-2]+
[2742] F4[2][1]×pY[SubWidthC×x+1][-1]+
[2743] F4[2][2]×pY[SubWidthC×x+1][-2]+4)>>3
[2744] — Otherwise (bCTUboundary is TRUE), the following applies:
[2745] pSelDsY[idx]=(F2[0]×pY[SubWidthC×x-1][-1]+
[2746] F2[1]×pY[SubWidthC×x][-1]+(379)
[2747] F2[2]×pY[SubWidthC×x+1][-1]+2)>>2
[2748] 6. When cntT+cntL is not equal to 0, the variables minY, maxY, minC and maxC are derived as follows:
[2749] —When cntT+cntL is equal to 2, pSelComp[3] is set equal to pSelComp[0], pSelComp[2] is set equal to pSelComp[1], pSelComp[0] is set equal to pSelComp[1], pSelComp[1] is set equal to pSelComp[3], and Comp is replaced with DsY and C.
[2750] —The arrays minGrpIdx and maxGrpIdx are derived as follows:
[2751] minGrpIdx[0]=0 (380)
[2752] minGrpIdx[1]=2 (381)
[2753] maxGrpIdx[0]=1 (382)
[2754] maxGrpIdx[1]=3 (383)
[2755] —When pSelDsY[minGrpIdx[0]] is greater than pSelDsY[minGrpIdx[1]], minGrpIdx[0] and minGrpIdx[1] are swapped as follows:
[2756] (minGrpIdx[0], minGrpIdx[1])=Swap(minGrpIdx[0], minGrpIdx[1]) (384)
[2757] —When pSelDsY[maxGrpIdx[0]] is greater than pSelDsY[maxGrpIdx[1]], maxGrpIdx[0] and maxGrpIdx[1] are swapped as follows:
[2758] (maxGrpIdx[0], maxGrpIdx[1])=Swap(maxGrpIdx[0], maxGrpIdx[1]) (385)
[2759] —When pSelDsY[minGrpIdx[0]] is greater than pSelDsY[maxGrpIdx[1]], the arrays minGrpIdx and maxGrpIdx are swapped as follows:
[2760] (minGrpIdx, maxGrpIdx) = Swap (minGrpIdx, maxGrpIdx) (386)
[2761] —When pSelDsY[minGrpIdx[1]] is greater than pSelDsY[maxGrpIdx[0]], minGrpIdx[1] and maxGrpIdx[0] are swapped as follows:
[2762] (minGrpIdx[1], maxGrpIdx[0])=Swap(minGrpIdx[1], maxGrpIdx[0]) (387)
[2763] —The variables maxY, maxC, minY and minC are derived as follows:
[2764] maxY=(pSelDsY[maxGrpIdx[0]]+pSelDsY[maxGrpIdx[1]]+1)>>1 (388)
[2765] maxC=(pSelC[maxGrpIdx[0]]+pSelC[maxGrpIdx[1]]+1)>>1 (389)
[2766] minY=(pSelDsY[minGrpIdx[0]]+pSelDsY[minGrpIdx[1]]+1)>>1 (390)
[2767] minC=(pSelC[minGrpIdx[0]]+pSelC[minGrpIdx[1]]+1)>>1(391)
[2768] 7. The variables a, b and k are derived as follows:
[2769] — If numSampL is equal to 0 and numSampT is equal to 0, then the following applies:
[2770] k=0 (392)
[2771] a=0 (393)
[2772] b=1<<(BitDepth-1) (394)
[2773] — Otherwise, the following applies:
[2774] diff=maxY-minY (395)
[2775] — If diff is not equal to 0, the following applies:
[2776] diffC=maxC-minC (396)
[2777] x=Floor(Log2(diff)) (397)
[2778] normDiff=((diff<<4)>>x)&15 (398)
[2779] x+=(normDiff!=0)? 1:0 (399)
[2780] y=Abs(diffC)>0? Floor(Log2(Abs(diffC)))+1:0 (400)
[2781] a=(diffC×(divSigTable[normDiff]|8)+2 y-1 )>>y (401)
[2782] k=((3+xy)<1)? 1:3+xy (402)
[2783] a=((3+xy)<1)? Sign(a)×15:a (403)
[2784] b=minC-((a×minY)>>k) (404)
[2785] where divSigTable[] is specified as follows:
[2786] divSigTable[]={0, 7, 6, 5, 5, 4, 4, 3, 3, 2, 2, 1, 1, 1, 1, 0} (405)
[2787] — Otherwise (diff is equal to 0), the following applies:
[2788] k=0 (406)
[2789] a=0 (407)
[2790] b=minC (408)
[2791] 8. The predicted sample point predSample[x][y], x=0..nTbW-1, y=0..nTbH-1 is derived as follows:
[2792] predSamples[x][y]=Clip1(((pDsY[x][y]×a)>>k)+b) (409)
[2793] NOTE - This process uses sps_chroma_vertical_collocated_flag. However, to simplify the implementation, it does not use sps_chroma_horizontal_collocated_flag.
[2794] 5.29. Example 29
[2795] The working draft specified in JVET-Q2001-vE may be modified as follows.
[2796] 8.4.5.2.13 Specification of INTRA_LT_CCLM, INTRA_L_CCLM and INTRA_T_CCLM intra prediction modes
[2797] The predicted sample predSample[x][y], where x = 0..nTbW-1, y = 0..nTbH-1, is derived as follows:
[2798] — If numSampL and numSampT are both equal to 0, the following applies:
[2799] predSamples[x][y]=1<<(BitDepth-1) (359)
[2800] — Otherwise, the following ordered steps apply:
[2801] 1. The co-located luma sample pY[x][y] where x=0..nTbW×SubWidthC-1, y=0..TbH×SubHeightC-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).
[2802] 2. The adjacent brightness samples pY[x][y] are derived as follows:
[2803] —When [[numSampL is greater than 0]] When x = -1..-3, The adjacent left luma sample pY[x][y] of is set equal to the reconstructed luma sample before the deblocking filtering process at the position (xTbY+x, yTbY+y).
[2804] - When availT is equal to FALSE, the adjacent top luma sample pY[x][y] where x = -1..SubWidthC×numSampT-1, y = -1..-2 is set equal to luma sample pY[x][0].
[2805] - When availL is equal to FALSE, the adjacent left luma sample pY[x][y] where x = -1..-3, y = -1..SubHeightC×numSampL-1 is set equal to luma sample pY[0][y].
[2806] —When [[numSampT is greater than 0]] When The neighboring top luma sample pY[x][y] with y=-1..-2 is set equal to the reconstructed luma sample before the deblocking filtering process at the position (xTbY+x, yTbY+y).
[2807] —When availTL is equal to true (TRUE), the adjacent upper left luma sample pY[x][y] where x=-1, y=-1, -2 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).
[2808] 5.30. Example 30
[2809] The working draft specified in JVET-Q2001-vE may be modified as follows.
[2810] 8.4.5.2.13 Specification of INTRA_LT_CCLM, INTRA_L_CCLM and INTRA_T_CCLM intra prediction modes
[2811] The predicted sample predSample[x][y], where x = 0..nTbW-1, y = 0..nTbH-1, is derived as follows:
[2812] — If numSampL and numSampT are both equal to 0, the following applies:
[2813] predSamples[x][y]=1<<(BitDepth-1) (359)
[2814] — Otherwise, the following ordered steps apply:
[2815] 1. The co-located luma sample pY[x][y] where x=0..nTbW×SubWidthC-1, y=0..TbH×SubHeightC-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).
[2816] 2. The adjacent brightness samples pY[x][y] are derived as follows:
[2817] —When numSampL is greater than 0, the adjacent left luma sample pY[x][y] where x=-1..-3, y=0..SubHeightC×numSampL-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).
[2818]
[2819] - When availT is equal to FALSE, the adjacent top luma sample pY[x][y] where x = -1..SubWidthC×numSampT-1, y = -1..-2 is set equal to luma sample pY[x][0].
[2820] - When availL is equal to FALSE, the adjacent left luma sample pY[x][y] where x = -1..-3, y = -1..SubHeightC×numSampL-1 is set equal to luma sample pY[0][y].
[2821] —When numSampT is greater than 0, the adjacent top luma sample pY[x][y] where x=0..SubWidthC×numSampT-1, y=-1..-2 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).
[2822]
[2823] —When availTL is equal to true (TRUE), the adjacent upper left luma sample pY[x][y] where x=-1, y=-1, -2 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).
[2824] Example 31
[2825] The working draft specified in JVET-Q2001-vE may be modified as follows.
[2826] 8.4.5.2.13 Specification of INTRA_LT_CCLM, INTRA_L_CCLM and INTRA_T_CCLM intra prediction modes
[2827] The inputs to this process are:
[2828] —Intra prediction mode predModeIntra,
[2829] - the sample position of the upper left sample of the current transform block relative to the upper left sample of the current picture (xTbC, yTbC),
[2830] - variable nTbW specifying the transform block width,
[2831] - variable nTbH specifying the transform block height,
[2832] — variable cIdx that specifies the color component of the current block,
[2833] - Chroma neighboring samples p[x][y], where x=-1, y=0..2×nTbH-1, and x=0..2×nTbW-1, y=-1.
[2834] The output of this process is predSamples[x][y], where x = 0..nTbW-1, y = 0..nTbH-1.
[2835] The current brightness position (xTbY, yTbY) is derived as follows:
[2836] (xTbY, yTbY) = (xTbC<<(SubWidthC-1), yTbC<<(SubHeightC-1)) (351)
[2837] The variables availL, availT, and availTL are derived as follows:
[2838] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using as input the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY-1, yTbY), checkPredModeY set equal to false (FLASE), and cIdx, and assign the output to availL.
[2839] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using as input the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY, yTbY-1), checkPredModeY set equal to false (FLASE), and cIdx, and assign the output to availT.
[2840] —The variable availTL is derived as follows:
[2841] availTL=availL&&availT (352)
[2842] —The number of available top-right adjacent chroma samples numTopRight is derived as follows:
[2843] —The variable numTopRight is set to 0, and availTR is set to TRUE.
[2844] - When predModeIntra is equal to INTRA_T_CCLM, the following applies for x=nTbW..2×nTbW-1 until availTR is equal to FALSE or x is equal to 2×nTbW-1:
[2845] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using as input the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY+x, yTbY-1), checkPredModeY set equal to false (FLASE), and cIdx, and assign the output to availTR.
[2846] —When availTR is equal to TRUE, numTopRight is increased by 1.
[2847] —The number of available lower left adjacent chroma samples numLeftBelow is derived as follows:
[2848] —The variable numLeftBelow is set to 0, and availLB is set to TRUE.
[2849] - When predModeIntra is equal to INTRA_L_CCLM, the following applies for y=nTbH..2×nTbH-1 until availLB is equal to FALSE or y is equal to 2×nTbH-1:
[2850] —Call the derivation process of neighbor block availability specified in clause 6.4.4 using as input the current luma position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighboring luma position (xTbY-1, yTbY+y), checkPredModeY set equal to false (FLASE), and cIdx, and assign the output to availLB.
[2851] —When availLB is equal to TRUE, numLeftBelow is increased by 1.
[2852] The number of available adjacent chroma samples numSampT at the top and upper right and the number of available adjacent chroma samples numSampL at the left and lower left are derived as follows:
[2853] — If predModeIntra is equal to INTRA_LT_CCLM, the following applies:
[2854] numSampT=availT? nTbW:0 (353)
[2855] numSampL=availL? nTbH:0 (354)
[2856] — Otherwise, the following applies:
[2857] numSampT=(availT&&predModeIntra==INTRA_T_CCLM)? (nTbW+Min(numTopRight,nTbH)):0 (355)
[2858] numSampL=(availL&&predModeIntra==INTRA_L_CCLM)? (nTbH+Min(numLeftBelow,nTbW)):0 (356)
[2859] The variable bCTUboundary is derived as follows:
[2860] bCTUboundary=(yTbY&(CtbSizeY-1)==0)? TRUE:FALSE (357)
[2861] The variable cntN and array pickPosN where N is replaced by L and T are derived as follows:
[2862] —The variable numIs4N is derived as follows:
[2863] numIs4N=((availT&&availL&&predModeIntra==INTRA_LT_CCLM)?0:1) (358)
[2864] —The variable startPosN is set equal to numSampN>>(2+numIs4N).
[2865] —The variable pickStepN is set equal to Max(1, numSampN>>(1+numIs4N)).
[2866] —If availN is equal to TRUE and predModeIntra is equal to INTRA_LT_CCLM or INTRA_N_CCLM, the following assignments are made:
[2867] —cntN is set equal to Min(numSampN, (1+numIs4N)<<1).
[2868] —pickPosN[pos] is set equal to (startPosN+pos×pickStepN), where pos=0..cntN-1.
[2869] Otherwise, cntN is set equal to 0.
[2870]
[2871] The predicted sample predSample[x][y], where x = 0..nTbW-1, y = 0..nTbH-1, is derived as follows:
[2872] — If numSampL and numSampT are both equal to 0, the following applies:
[2873] predSamples[x][y]=1<<(BitDepth-1) (359)
[2874] — Otherwise, the following ordered steps apply:
[2875] 1. The co-located luma sample pY[x][y] where x=0..nTbW×SubWidthC-1, y=0..TbH×SubHeightC-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).
[2876] 2. The adjacent brightness samples pY[x][y] are derived as follows:
[2877] —When numSampL is greater than 0, the adjacent left luma sample pY[x][y] where x=-1..-3, y=0..SubHeightC×numSampL-1 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).
[2878] - When availT is equal to FALSE, the adjacent top luma sample pY[x][y] where x = -1..SubWidthC×numSampT-1, y = -1..-2 is set equal to luma sample pY[x][0].
[2879] - When availL is equal to FALSE, the adjacent left luma sample pY[x][y] where x = -1..-3, y = -1..SubHeightC×numSampL-1 is set equal to luma sample pY[0][y].
[2880] —When numSampT is greater than 0, the adjacent top luma sample pY[x][y] where x=0..SubWidthC×numSampT-1, y=-1..-2 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).
[2881] —When availTL is equal to true (TRUE), the adjacent upper left luma sample pY[x][y] where x=-1, y=-1, -2 is set equal to the reconstructed luma sample before the deblocking filtering process at position (xTbY+x, yTbY+y).
[2882] 3. The downsampled co-located luminance sample pDsY[x][y], where x = 0..nTbW-1, y = 0..nTbH-1, is derived as follows:
[2883] —If SubWidthC and SubHeightC are both equal to 1, then the following applies:
[2884] —pDsY[x][y], where x=1..nTbW-1, y=1..nTbH-1 is derived as follows:
[2885] pDstY[x][y]=pY[x][y] (360)
[2886] — Otherwise, the following applies:
[2887] —The one-dimensional filter coefficient arrays F1 and F2 and the two-dimensional filter coefficient arrays F3 and F4 are specified as follows.
[2888] F1[0]=2,F1[1]=0 (361)
[2889] F2[0]=1,F2[1]=2,F2[2]=1 (362)
[2890] F3[i][j]=F4[i][j]=0, where i=0..2, j=0..2 (363)
[2891] — If SubWidthC and SubHeightC are both equal to 2, then the following applies:
[2892] F1[0]=1,F1[1]=1 (364)
[2893] F3[0][1]=1,F3[1][1]=4,F3[2][1]=1,F3[1][0]=1,F3[1][2]=1 (365)
[2894] F4[0][1]=1,F4[1][1]=2,F4[2][1]=1 (366)
[2895] F4[0][2]=1,F4[1][2]=2,F4[2][2]=1 (367)
[2896]
[2897] — Otherwise, the following applies:
[2898] F3[1][1]=8 (368)
[2899] F4[0][1]=2, F4[1][1]=4, F4[2][1]=2, (369)
[2900]
[2901] —if [[sps_chroma_vertical_collocated_flag]] is equal to 1, then the following applies:
[2902] —pDsY[x][y], x=0..nTbW-1, y=0..nTbH-1 is derived as follows:
[2903] pDsY[x][y]=(F3[1][0]×pY[SubWidthC×x][SubHeightC×y-1]+
[2904] F3[0][1]×pY[SubWidthC×x-1][SubHeightC×y]+
[2905] F3[1][1]×pY[SubWidthC×x][SubHeightC×y]+(370)
[2906] F3[2][1]×pY[SubWidthC×x+1][SubHeightC×y]+
[2907] F3[1][2]×pY[SubWidthC×x][SubHeightC×y+1]+4)>>3
[2908] —otherwise([[sps_chroma_vertical_collocated_flag]] is equal to 0), then the following applies:
[2909] —pDsY[x][y], x=0..nTbW-1, y=0..nTbH-1 is derived as follows:
[2910] pDsY[x][y]=(F4[0][1]×pY[SubWidthC×x-1][SubHeightC×y]+
[2911] F4[0][2]×pY[SubWidthC×x-1][SubHeightC×y+1]+
[2912] F4[1][1]×pY[SubWidthC×x][SubHeightC×y]+(371)
[2913] F4[1][2]×pY[SubWidthC×x][SubHeightC×y+1]+
[2914] F4[2][1]×pY[SubWidthC×x+1][SubHeightC×y]+
[2915] F4[2][2]×pY[SubWidthC×x+1][SubHeightC×y+1]+4)>>3
[2916] 4. When numSampL is greater than 0, the selected adjacent left chroma sample pSelC[idx] is set equal to p[-1][pickPosL[idx]], where idx = 0..cntL-1, and the selected downsampled adjacen...
Claims
1. A method for processing video data, comprising: For conversion between a chroma block of a video and a bitstream of the video, determining parameters of a cross-component linear model for the chroma block according to a rule; as well as performing said converting based on said determining, wherein the rule specifies that the parameters of the cross-component linear model are determined based on neighboring chroma samples of the chroma block and downsampled neighboring top luma samples, the downsampled neighboring top luma samples being derived based on variables representing neighboring luma samples of a luma block corresponding to the chroma block, wherein the rule further specifies that when the color format of the chroma block is 4:2:0, the downsampled adjacent top luma sample is further derived based on at least one of a value of a first syntax element and a value of a first variable, wherein the first syntax element is included in the bitstream and indicates whether the chroma sample position is vertically shifted relative to the corresponding luma sample position, and the first variable indicates whether the chroma block is located at a boundary of a codec tree unit including the chroma block, and The rule further specifies that when the color format of the chroma block is 4:2:2, the downsampled adjacent top luma samples are derived without considering the value of the first syntax element.
2. The method according to claim 1, wherein: The rule also specifies that when the color format of the chroma block is 4:2:2, regardless of the value of the first syntax element, a fixed filter is used to obtain the downsampled adjacent top luma samples, wherein the fixed filter is a 3-tap horizontal filter.
3. The method according to claim 2, wherein: 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, where pSelDsY[i] represents the downsampled adjacent top luma sample with index i, and pY[m][n] represents the adjacent luma sample with position (m, n).
4. The method according to any one of claims 1 to 3, wherein: The rule further specifies that, when the value of the first variable indicates that the chroma block is located at a boundary of the codec tree unit including the chroma block, the same filter is used to derive the downsampled adjacent top luma samples for the chroma block having a 4:2:0 color format and the chroma block having a 4:2:2 color format.
5. The method of claim 4 , wherein the rule further specifies that when the value of the first variable indicates that the chroma block is located at a boundary of the codec tree unit including the chroma block, the downsampled adjacent top luma samples are derived using the same filter regardless of the value of the first syntax element.
6. The method according to claim 5, wherein: The rule also specifies that when the value of the first variable indicates that the chroma block is not located at the boundary of the codec tree unit including the chroma block and the color format of the chroma block is 4:2:0, in response to the first syntax element having a different value, a different filter is used to obtain the downsampled adjacent top luma samples.
7. The method according to claim 6, wherein: The rule also specifies that when the value of the first variable indicates that the chroma block is not located at the boundary of the codec tree unit including the chroma block and the color format of the chroma block is 4:2:0, in response to the first syntax element having a value of 1, pSelDsY[i] is equal to (pY[SubWidthC*x][-3]+pY[SubWidthC*x-1][-2]+4*pY[SubWidthC*x][-2]+pY[SubWidthC*x+1][-2]+pY[SubWidthC*x][-1]+4)>>3, where pSelDsY[i] represents the adjacent top luma sample of the downsample with index i, and pY[m][n] represents the adjacent luma sample with position (m, n).
8. The method according to claim 6 or 7, wherein: The rule also specifies that when the value of the first variable indicates that the chroma block is not located at the boundary of the codec tree unit including the chroma block and the color format of the chroma block is 4:2:0, in response to the first syntax element having a value of 0, pSelDsY[i] is equal to (pY[SubWidthCx-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, where pSelDsY[i] represents the adjacent top luma sample of the downsample whose index is i, and pY[m][n] represents the adjacent luma sample whose position is (m, n).
9. The method according to any one of claims 1 to 8, wherein: The variable representing the adjacent luma sample is derived based on at least one of: an upper adjacent luma sample of the luma block, a left adjacent luma sample of the luma block, or a sample in the luma block.
10. The method according to any one of claims 1 to 9, wherein: The rule also specifies that, in the absence of the first syntax element, the value of the first syntax element is inferred to be equal to 1.
11. The method according to any one of claims 1 to 10, wherein: The converting includes encoding the video into the bitstream.
12. The method according to any one of claims 1 to 10, wherein: The converting includes decoding the video from the bitstream.
13. An apparatus for processing video data, comprising a processor and a non-transitory memory having instructions thereon, wherein the instructions, when executed by the processor, cause the processor to: For conversion between a chroma block of a video and a bitstream of the video, determining parameters of a cross-component linear model for the chroma block according to a rule; and performing said converting based on said determining, wherein the rule specifies that the parameters of the cross-component linear model are determined based on neighboring chroma samples of the chroma block and downsampled neighboring top luma samples, the downsampled neighboring top luma samples being derived based on variables representing neighboring luma samples of a luma block corresponding to the chroma block, wherein the rule further specifies that when the color format of the chroma block is 4:2:0, the downsampled adjacent top luma sample is further derived based on at least one of a value of a first syntax element and a value of a first variable, wherein the first syntax element is included in the bitstream and indicates whether the chroma sample position is vertically shifted relative to the corresponding luma sample position, and the first variable indicates whether the chroma block is located at a boundary of a codec tree unit including the chroma block, and The rule further specifies that when the color format of the chroma block is 4:2:2, the downsampled adjacent top luma samples are derived without considering the value of the first syntax element.
14. The device according to claim 13, wherein: The rule further specifies that, when the value of the first variable indicates that the chroma block is located at a boundary of the codec tree unit including the chroma block, the down-sampled adjacent top luma samples are derived using the same filter for the chroma block having a 4:2:0 color format and the chroma block having a 4:2:2 color format, and The rule further specifies that when the value of the first variable indicates that the chroma block is located at the boundary of the codec tree unit including the chroma block, the downsampled adjacent top luma samples are derived using the same filter regardless of the value of the first syntax element.
15. The device according to claim 13, wherein: The rule also specifies that when the value of the first variable indicates that the chroma block is not located at the boundary of the codec tree unit including the chroma block and the color format of the chroma block is 4:2:0, in response to the first syntax element having a different value, a different filter is used to obtain the downsampled adjacent top luma samples.
16. The device according to claim 14, wherein: The rule further specifies that when the value of the first variable indicates that the chroma block is not located at the boundary of the codec tree unit including the chroma block and the color format of the chroma block is 4:2:0, in response to the first syntax element having a value of 1, pSelDsY[i] is equal to (pY[SubWidthC*x][-3]+pY[SubWidthC*x-1][-2]+4*pY[SubWidthC*x][-2]+pY[SubWidthC*x+1][-2]+pY[SubWidthC*x][-1]+4)>>3, where pSelDsY[i] represents the adjacent top luma sample of the downsample whose index is i, and pY[m][n] represents the adjacent luma sample whose position is (m, n), or The rule further specifies that when the value of the first variable indicates that the chroma block is not located at the boundary of the codec tree unit including the chroma block and the color format of the chroma block is 4:2:0, in response to the first syntax element having a value of 0, 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, wherein pSelDsY[i] represents the adjacent top luma sample of the downsample with index i, and pY[m][n] represents the adjacent luma sample with position (m, n).
17. A non-transitory computer-readable storage medium storing instructions that cause a processor to: For conversion between a chroma block of a video and a bitstream of the video, determining parameters of a cross-component linear model for the chroma block according to a rule; and performing said converting based on said determining, wherein the rule specifies that the parameters of the cross-component linear model are determined based on neighboring chroma samples of the chroma block and downsampled neighboring top luma samples, the downsampled neighboring top luma samples being derived based on variables representing neighboring luma samples of a luma block corresponding to the chroma block, wherein the rule further specifies that when the color format of the chroma block is 4:2:0, the downsampled adjacent top luma sample is further derived based on at least one of a value of a first syntax element and a value of a first variable, wherein the first syntax element is included in the bitstream and indicates whether the chroma sample position is vertically shifted relative to the corresponding luma sample position, and the first variable indicates whether the chroma block is located at a boundary of a codec tree unit including the chroma block, and The rule further specifies that when the color format of the chroma block is 4:2:2, the downsampled adjacent top luma samples are derived without considering the value of the first syntax element.
18. The non-transitory computer-readable storage medium of claim 17, wherein: The rule further specifies that, when the value of the first variable indicates that the chroma block is located at a boundary of the codec tree unit including the chroma block, the down-sampled adjacent top luma samples are derived using the same filter for the chroma block having a 4:2:0 color format and the chroma block having a 4:2:2 color format, and The rule further specifies that when the value of the first variable indicates that the chroma block is located at the boundary of the codec tree unit including the chroma block, the downsampled adjacent top luma samples are derived using the same filter regardless of the value of the first syntax element.
19. A non-transitory computer-readable recording medium storing a bit stream of a video generated by a method performed by a video processing device, wherein the method comprises: Determining parameters of a cross-component linear model for a chroma block of the video according to a rule; as well as generating the bitstream based on the determination, wherein the rule specifies that the parameters of the cross-component linear model are determined based on neighboring chroma samples of the chroma block and downsampled neighboring top luma samples, the downsampled neighboring top luma samples being derived based on variables representing neighboring luma samples of a luma block corresponding to the chroma block, wherein the rule further specifies that when the color format of the chroma block is 4:2:0, the downsampled adjacent top luma sample is further derived based on at least one of a value of a first syntax element and a value of a first variable, wherein the first syntax element is included in the bitstream and indicates whether the chroma sample position is vertically shifted relative to the corresponding luma sample position, and the first variable indicates whether the chroma block is located at a boundary of a codec tree unit including the chroma block, and The rule further specifies that when the color format of the chroma block is 4:2:2, the downsampled adjacent top luma samples are derived without considering the value of the first syntax element.
20. The non-transitory computer-readable recording medium according to claim 19, wherein The rule further specifies that, when the value of the first variable indicates that the chroma block is located at a boundary of the codec tree unit including the chroma block, the down-sampled adjacent top luma samples are derived using the same filter for the chroma block having a 4:2:0 color format and the chroma block having a 4:2:2 color format, and The rule further specifies that when the value of the first variable indicates that the chroma block is located at the boundary of the codec tree unit including the chroma block, the downsampled adjacent top luma samples are derived using the same filter regardless of the value of the first syntax element.
21. A method for storing a bit stream of a video, comprising: Determining parameters of a cross-component linear model for a chroma block of the video according to a rule; generating the bitstream based on the determination; as well as storing the bitstream in a non-transitory computer-readable recording medium, wherein the rule specifies that the parameters of the cross-component linear model are determined based on neighboring chroma samples of the chroma block and downsampled neighboring top luma samples, the downsampled neighboring top luma samples being derived based on variables representing neighboring luma samples of a luma block corresponding to the chroma block, wherein the rule further specifies that when the color format of the chroma block is 4:2:0, the downsampled adjacent top luma sample is further derived based on at least one of a value of a first syntax element and a value of a first variable, wherein the first syntax element is included in the bitstream and indicates whether the chroma sample position is vertically shifted relative to the corresponding luma sample position, and the first variable indicates whether the chroma block is located at a boundary of a codec tree unit including the chroma block, and The rule further specifies that when the color format of the chroma block is 4:2:2, the downsampled adjacent top luma samples are derived without considering the value of the first syntax element.
22. A video processing device, comprising a processor configured to implement the method according to any one of claims 2-3, 9-12, and 21.
23. A method of storing a bitstream of a video, comprising the method of any one of claims 2 to 12, and further comprising storing the bitstream to a non-transitory computer-readable recording medium.
24. A computer readable medium storing program code, which, when executed, causes a processor to implement the method of any one of claims 2-3, 6-12, and 21.
25. A computer-readable medium storing a bit stream generated by the method according to any one of claims 2-3, 6-12, and 21.
26. A video processing device for storing a bit stream, wherein the video processing device is configured to implement the method according to any one of claims 1-12 and 21.
Citation Information
Patent Citations
Down-sampling in cross-component linear modeling
CN110896478A
Intra bc and inter unification
US20160100189A1