Syntax for signaling cross-component video coding
By optimizing CCLM parameter derivation and transform skip signaling based on chroma subsampling, the solution addresses inefficiencies in video coding for non-4:4:4 formats, enhancing compression efficiency and accuracy.
Patent Information
- Application Number
- JP2022563091
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2020-04-18
- Filing Date
- 2021-04-19
- Publication Date
- 2024-09-26
- Estimated Expiration
- 2041-04-19
AI Technical Summary
Current video coding technologies face challenges in efficiently handling non-4:4:4 color formats, particularly in deriving linear parameters for cross-component linear model prediction and transform skip flags, which do not account for chroma subsampling, leading to inefficiencies and inaccuracies in video compression.
Adopting methods to derive CCLM parameters using multiple lines of the luminance block for downsampling, adjusting maximum block sizes based on color components, and optimizing transform skip and BDPCM flag signaling to align with chroma subsampling ratios, ensuring accurate prediction and compression.
Improves video compression efficiency by aligning parameter derivation with chroma subsampling, reducing computational complexity, and enhancing prediction accuracy across various color formats.
Smart Images

Figure 0007556980000073 
Figure 0007556980000085 
Figure 0007556980000086
Abstract
Description
[Technical field]
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS Books This application claims priority to and the benefit of International Patent Application No. PCT / CN2020 / 085484, filed on April 18, 2020. main Stretch This is the national phase of International Patent Application No. PCT / CN2021 / 087999, filed on April 19, 2021. The entire disclosure of the above application is incorporated by reference as part of the disclosure of this specification.
[0002] TECHNICAL FIELD This disclosure relates to video and image coding technology. [Background technology]
[0003] Digital video accounts for the largest bandwidth usage on the Internet and other digital communications networks, and the bandwidth demands for digital video use are expected to continue to grow as the number of connected user devices capable of receiving and displaying video increases. Summary of the Invention
[0004] The disclosed techniques may be used by embodiments of a video or image decoder or encoder to encode or decode using cross-component linear model prediction.
[0005] In one exemplary embodiment, a method for processing a video is disclosed, which includes deriving parameters of a cross-component linear model by using a downsampling filter to generate a top luma sample of a downsampled aligned neighborhood from a positive integer number of N upper neighboring lines of the aligned luma block for conversion between a chroma block of the video and a coded representation of the video, and performing the conversion using a predicted chroma block generated using the cross-component linear model.
[0006] In another exemplary aspect, a method for processing video is disclosed, the method including: determining parameters of a cross-component linear model of a video block for conversion between a video block of a video having a 4:2:2 color format and a bitstream of the video according to a rule; and performing the conversion based on the determination, where a syntax element indicates whether chroma samples of the video are vertically shifted relative to luma samples of the video, and the rule specifies that the parameters are determined independently of a value of the syntax element.
[0007] In another exemplary aspect, a method for processing video is disclosed, the method including performing a conversion between the video and a video bitstream according to a rule, where the format rule specifies that a field indicating whether a chroma sample position is vertically shifted relative to a corresponding luma sample position due to the video having a 4:2:2 or 4:4:4 color format is set to a default value.
[0008] In another exemplary aspect, a method for processing a video is disclosed, the method including: determining a parameter of a Cross Component Linear Model (CCLM) of a video block according to a rule for conversion between a video block of the video and a bitstream of the video; and performing the conversion based on the determination, the rule specifying that a variable representing a neighboring luminance sample is used in determining the parameter of the CCLM only if the variable has a specific value.
[0009] In another exemplary aspect, a method of processing video is disclosed, the method including: determining whether a first coding tool is valid for a video unit according to a rule for conversion between video constituting a video unit and a video bitstream, the rule specifying that the first coding tool and a second coding tool are mutually exclusively valid, the first coding tool or the second coding tool comprising a code data hiding tool, and performing the conversion according to the determination.
[0010] In another exemplary aspect, a method of processing video is disclosed, the method including: determining whether a first coding tool is valid for a video unit according to a rule for conversion between a video constituting a video unit and a video bitstream, the rule specifying that the first coding tool and a second coding tool are mutually exclusively valid, the first coding tool or the second coding tool including a dependent quantization tool, and performing the conversion according to the determination.
[0011] In another exemplary aspect, a method for processing a video is disclosed, the method includes performing a conversion between a video including one or more pictures including one or more slices and a video bitstream according to a rule, the rule specifying that a slice type of the slice depends on a reference picture entry of a reference picture list of the slice.
[0012] In another exemplary aspect, a method for processing video is disclosed, the method includes performing a conversion between a video including one or more pictures including one or more slices and a video bitstream according to a rule, the rule specifying that a number of allowed filters in an Adaptation Parameter Set (APS) or a number of APSs depends on coded information of the video.
[0013] In another exemplary aspect, the methods described above may be implemented by a video encoder device that includes a processor.
[0014] In yet another exemplary aspect, the methods may be embodied in the form of processor-executable instructions and stored on a computer-readable program medium.
[0015] These and other aspects are further described herein. [Brief description of the drawings]
[0016] [Figure 1A] Indicates the nominal vertical and horizontal locations of the 4:2:2 luma and chroma samples in the picture. [Figure 1B] 1 shows an example of a video encoder. [Diagram 2] 67 examples of intra prediction modes are shown. [Diagram 3] 4 shows examples of horizontal and vertical traverse scans. [Figure 4] An example of the sample positions used to derive α and β is shown below. [Diagram 5] An example is given of dividing a block of 4x8 samples into two independent decodable regions. [Figure 6] 1 shows an exemplary order for processing rows of pixels to maximize throughput for a 4×N block with a vertical predictor. [Figure 7] An example of LFNST (Low-Frequency Non-Separable Transform) processing is shown below. [Figure 8] 13 shows an example of neighboring chroma samples and downsampled neighboring luma samples used to derive CCLM parameters for 4:2:2 video. [Figure 9] 1 illustrates an example of a video processing device. [Figure 10] 1 shows a block diagram of an exemplary video encoder. [Figure 11] 1 is a flowchart illustrating an example of a video processing method. [Figure 12] FIG. 1 is a block diagram illustrating an example of a video processing system. [Figure 13] An example of a sample in the current block and the top left sample used is shown. [Figure 14] 1 is a block diagram illustrating an example video coding system. [Figure 15] 1 is a block diagram illustrating an encoder in accordance with some embodiments of the disclosed techniques. [Figure 16]1 is a block diagram illustrating a decoder in accordance with some embodiments of the disclosed techniques. [Figure 17A] 1 is a flowchart of an exemplary method of video processing in accordance with some implementations of the disclosed technology. [Figure 17B] 1 is a flowchart of an exemplary method of video processing in accordance with some implementations of the disclosed technology. [Figure 18] 1 is a flowchart of an exemplary method of video processing in accordance with some implementations of the disclosed technology. [Figure 19A] 1 is a flowchart of an exemplary method of video processing in accordance with some implementations of the disclosed technology. [Figure 19B] 1 is a flowchart of an exemplary method of video processing in accordance with some implementations of the disclosed technology. [Figure 19C] 1 is a flowchart of an exemplary method of video processing in accordance with some implementations of the disclosed technology. [Figure 19D] 1 is a flowchart of an exemplary method of video processing in accordance with some implementations of the disclosed technology. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0017] This specification provides various techniques that can be used by a decoder of an image or video bitstream to improve the quality of the decompressed or decoded digital video or image. For simplicity, the term "video" is used herein to include both a series of pictures (conventionally called video) and individual images. Furthermore, a video encoder may implement these techniques during the encoding process to reconstruct the decoded frames that are used for further encoding.
[0018] Section headings are used herein for ease of understanding and are not intended to limit embodiments disclosed in one section to only that section, and thus embodiments in one section may be combined with embodiments in other sections.
[0019] 1. Brief Overview The present invention relates to video coding techniques. In particular, the present invention relates to cross-component linear model prediction and other coding tools in image / video coding. The present invention may be applied to existing video coding standards such as HEVC, or to finalize standards (Versatile Video Coding). The present invention may also be applied to future video coding standards or video codecs.
[0020] 2. Background Video coding standards have evolved primarily through the development of well-known ITU-T and ISO / IEC standards. ITU-T created H.261 and H.263, ISO / IEC created MPEG-1 and MPEG-4 Visual, and the two organizations jointly created H.262 / MPEG-2 Video, H.264 / MPEG-4 AVC (Advanced Video Coding), and H.265 / HEVC standards. Since H.262, video coding standards have been based on hybrid video coding structures where temporal prediction and transform coding are utilized. In 2015, VCEG and MPEG jointly established the Joint Video Exploration Team (JVET) to explore future video coding technologies beyond HEVC. Since then, many new methods have been adopted by JVET and incorporated into reference software called JEM (Joint Exploration Mode). In April 2018, the Joint Video Expert Team (JVET) was established between VCEG (Q6 / 16) and ISO / IEC JTC1 SC29 / WG11 (MPEG), and is working on formulating the VVC standard with the goal of reducing the bitrate by 50% compared to HEVC.
[0021] The latest version of the VVC draft, namely Versatile Video Coding (Draft 7), can be found at:
[0022] http: / / phenix.it-sudparis.eu / jvet / doc_end_user / documents / 16_Geneva / wg11 / JVET-P2001-v9.zip
[0023] The latest reference software for VVC, called VTM, can be found at:
[0024] https: / / vcgit.hhi.fraunhofer.de / jvet / VVCSoftware_VTM / - / tags / VTM-6.0
[0025] 2.1. Color Space and Saturation Subsampling A color space, also known as a color model (or color system), is an abstract mathematical model that describes a range of colors simply as a tuple of numbers, typically three or four values or color components (e.g., RGB). Essentially, a color space is a refinement of a coordinate system and a subspace.
[0026] For video compression, the most frequently used color spaces are YCbCr and RGB.
[0027] YCbCr, Y'CbCr, or Y Pb / Cb Pr / Cr, also written as YCBCR or Y'CBCR, is a family of color spaces used as part of a color image pipeline video and digital photography systems. Y' is the luma component, and CB and CR are the blue-difference and red-difference chroma components. Y' (primed) is distinguished from Y, which is luminance, by implying that the light intensity is nonlinearly encoded based on the gamma-corrected RGB primaries.
[0028] Chroma subsampling is a method of encoding images by implementing chroma information at a lower resolution than the luma information, taking advantage of the fact that the human visual system perceives chrominance less well than luminance.
[0029] 2.1.1. 4:4:4 Each of the three Y'CbCr components has the same sample rate, so there is no chroma subsampling. This method is sometimes used in high-end film scanners and in post-production film editing.
[0030] 2.1.2. 4:2:2 The two chroma components are sampled at half the sample rate of the luma, the horizontal chroma resolution is halved, and the vertical chroma resolution is unchanged. This allows the bandwidth of the uncompressed video signal to be reduced by a factor of three with little or no visual difference. Examples of nominal vertical and horizontal positions for the 4:2:2 color format are shown, for example, in Figure 1A of the VVC Working Draft.
[0031] 2.1.3. 4:2:0 In 4:2:0, the horizontal sampling is doubled compared to 4:1:1, but the vertical resolution is halved because the scheme samples the Cb and Cr channels only on each alternate line. Thus, the data rate is the same. Cb and Cr are each subsampled by a factor of two in both the horizontal and vertical directions. There are three variants of the 4:2:0 scheme with different horizontal and vertical positions: ● In MPEG-2, Cb and Cr are cosited horizontally. Cb and Cr are located between pixels vertically (located between the grid). In JPEG / JFIF, H.261, and MPEG-1, Cb and Cr are located in the middle grid of alternating luminance samples. ● In 4:2:0 DV, Cb and Cr are horizontally co-sited. Vertically, they are alternately co-sited.
[0032] Table 2-1. SubWidthC and SubHeightC values derived from chroma_format_idc and separate_colour_plane_flag
[0033] [Table 1]
[0034] 2.2. Typical video codec coding flow FIG. 1B shows an example of an encoder block diagram of VVC, including three in-loop filtering blocks: Deblocking Filter (DF), Sample Adaptive Offset (SAO), and ALF. Unlike DF, which uses a predefined filter, SAO and ALF utilize the original samples of the current picture and reduce the mean square error between the original and reconstructed samples by adding an offset and applying a Finite Impulse Response (FIR) filter, respectively, with coded-side information signaling the offset and filter coefficients. ALF is located at the last processing stage of each picture and can be considered as a tool that tries to capture and correct artifacts generated in the previous stage.
[0035] 2.3. Intra-mode coding with 67 intra-prediction modes To capture any edge orientation represented in natural video, the number of directional intra modes, as used in HEVC, is expanded from 33 to 65. The additional directional modes are indicated by the red dotted arrows in Figure 2, while the planar and DC modes remain the same. These denser directional intra prediction modes apply to all block sizes, and to both luma and chroma intra prediction.
[0036] The conventional angular intra prediction direction is defined from 45 degrees to -135 degrees in a clockwise direction as shown in Figure 2. In VTM, some conventional angular intra prediction modes are adaptively replaced with wide-angle intra prediction modes for non-square blocks. The replaced modes are signaled using the original method and 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 coding remains unchanged.
[0037] In HEVC, all intra-coded blocks have a square shape, and the length of each of their sides is a power of two. Thus, no division operations are required to generate an intra predictor using DC mode. In VVC, blocks may have rectangular shapes, which in the general case requires the use of division operations for each block. To avoid division operations for DC prediction, only the long sides are used to calculate the average of non-square blocks. Figure 2 shows examples of 67 intra prediction modes.
[0038] 2.4. Inter Prediction For each inter-predicted CU, motion parameters consisting of a motion vector, a reference picture index, and a reference picture list usage index, as well as additional information required for the new coding features of VVC, are used for inter-predicted sample generation. The motion parameters may be signaled explicitly or implicitly. If a CU is coded in skip mode, it is associated with one PU and has no significant residual coefficients, coded motion vector deltas, or reference picture indexes. A merge mode is defined, which obtains motion parameters for the current CU, including spatial and temporal candidates, as well as additional schedules introduced in VVC, from neighboring CUs. The merge mode can be applied to any inter-predicted CU, not just for skip mode. An alternative to the merge mode is to explicitly transmit the motion parameters, where the motion vector, the reference picture index corresponding to each reference picture list and the reference picture list usage flag, as well as other necessary information, are explicitly signaled for each CU.
[0039] 2.5. IBC (Intra Block Copy) IBC (Intra Block Copy) is a tool adopted in the HEVC extension of SCC. It is known to significantly improve the coding efficiency of screen content material. Since IBC mode is implemented as a block-level coding mode, Block Matching (BM) is performed in the encoder to find the optimal block vector (or motion vector) for each CU. Here, the block vector is used to indicate the displacement from the current block to a reference block already reconstructed inside the current picture. The luma block vectors of IBC coded CUs are integer precision. The chroma block vectors are also rounded to integer precision. When combined with AMVR, IBC mode can switch between 1-pixel and 4-pixel motion vector precision. IBC coded CUs are treated as a third prediction mode other than intra or inter prediction modes. IBC mode is applicable for CUs whose width and height are both 64 luma samples or less.
[0040] On the encoder side, hash-based motion estimation is performed for IBC. The encoder performs RD checks on blocks with width or height less than or equal to 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 block matching-based local search is performed.
[0041] In hash-based search, the hash key matching (32-bit CRC) between the current block and the reference block is expanded to all allowed block sizes. The calculation of the hash key for all positions in the current picture is based on 4×4 sub-blocks. If the size of the current block is larger, the hash key is determined to match that of the reference block if all the hash keys of all the 4×4 sub-blocks match the hash key of the corresponding reference position. If the hash keys of multiple reference blocks are found to match the hash key of the current block, calculate the block vector cost of each matched reference block and select the one with the minimum cost. In the block matching search, the search range is set to cover both the previous CTU and the current CTU. At the CU level, the IBC mode is signaled by a flag and can be signaled as IBC AMVP mode or IBC skip / merge mode as follows:
[0042] - IBC skip / merge mode: The merge candidate index is used to indicate which block vector in the list from neighboring candidate IBC coded blocks is used to predict the current block. The merge list consists of spatial candidates, HMVP candidates, and pairwise candidates.
[0043] -IBC AMVP mode: Block vector differences are coded similarly to motion vector differences. The block vector prediction method uses two candidates as predictors, one from the left neighbor and one from the top neighbor (if IBC coded). If any neighbor is not available, a default block vector is used as predictor. A flag is signaled to indicate the block vector predictor index.
[0044] 2.6. Palette Mode For palette mode signaling, the palette mode is coded as the prediction mode for the coding unit, i.e., the prediction mode for the coding unit may be MODE_INTRA, MODE_INTER, MODE_IBC, MODE_PLT. When the palette mode is used, pixel values in the CU are represented by a small set of representative color values. The set is called the palette. For pixels with values close to the colors in the palette, a palette index is signaled. For pixels with values outside the palette, the pixel is represented by an escape symbol and the quantized pixel value is signaled directly.
[0045] To decode a palette-coded block, the decoder needs to decode the palette colors and indices. The palette colors are described in a palette table and are coded by a palette table coding tool. An escape flag is signaled for each CU to indicate whether an escape symbol is present in the current CU. If an escape symbol is present, we increase the palette table by one and assign the last index to the escape mode. The palette indices of all pixels in a CU form a palette index map and are coded by a palette index map coding tool.
[0046] For coding the palette table, a palette predictor is maintained. The predictor is initialized at the beginning of each slice, where the predictor is reset to 0. For each entry in the palette predictor, a reuse flag is signaled to indicate whether it is part of the current palette or not. The reuse flag is transmitted using run-length coding of zeros. After this, the number of new palette entries is signaled using an Exponential-Golomb code of order 0. Finally, the component values for the new palette entries are signaled. After encoding the current CU, the palette predictor is updated using the current palette and entries from the previous palette predictor that are not reused in the current palette are added to the end of the new palette predictor until the maximum size allowed is reached (palette stuffing).
[0047] To code a palette index map, the indices are coded using horizontal and vertical transverse scans as shown in Figure 3. The palette_transpose_flag is used to explicitly signal the scan order in the bitstream.
[0048] FIG. 3 shows an example of horizontal and vertical traverse scans.
[0049] The palette index is coded using the two main palette sample modes ("INDEX" and "COPY_ABOVE"). The mode is signaled using flags excluding the top row if horizontal scanning is used, and excluding the first column if vertical scanning is used or the previous mode was "COPY_ABOVE". In "COPY_ABOVE" mode the palette index of the sample in the row above is copied. In "INDEX" mode the palette index is signaled explicitly. For both "INDEX" and "COPY_ABOVE" modes a run value is signaled that specifies the number of pixels to be coded using the same mode.
[0050] The coding order of the index map is as follows: First, the number of index values for the CU is signaled. This is followed by signaling the actual index value for the entire CU using truncated binary coding. In bypass mode, both the number of indexes and the index value are coded. This groups index-related bypass bins. Next, the palette mode (INDEX or COPY_ABOVE) and run are signaled in an interleaved manner. Finally, the component escape values corresponding to the escape samples for the entire CU are grouped and coded in bypass mode. After signaling the index value, an additional syntax element, last_run_type_flag, is signaled. This syntax element, in conjunction with the number of indexes, eliminates the need to signal a run value corresponding to the last run in the block.
[0051] In VTM, dual trees are enabled for I-slices which separate the partitioning of coding units for luma and chroma. Thus, in this proposal, palettes are applied separately for luma (Y component) and chroma (Cb, Cr components). When dual trees are disabled, palettes are applied jointly for Y, Cb, Cr components, similar to the HEVC palette.
[0052] 2.7. Cross-component linear model prediction A CCLM (Cross-Component Linear Model) prediction mode is used in VVC, where a linear model is used to predict chroma samples based on reconstructed luma samples of the same CU as follows:
[0053]
number
[0054] Here, pred C(i,j) represents the predicted chroma sample in one CU, and rec L (i,j) represents the downsampled and reconstructed luma sample of the same CU.
[0055] FIG. 4 illustrates the positions of the left and top samples and the samples of the current block involved in the LM mode.
[0056] FIG. 4 shows an example of the sample positions used to derive α and β.
[0057] Besides using the top and left templates to jointly calculate the linear model coefficients in LM mode, they can also be used alternatively in two other LM modes called LM_A and LM_L modes. In LM_A mode, only the top template is used to calculate the linear model coefficients. To get more samples, the top template is extended to (W+H). In LM_L mode, only the left template is used to calculate the linear model coefficients. To get more samples, the left template is extended to (H+W). For non-square blocks, the top template is extended to W+W and the left template is extended to H+H.
[0058] The CCLM parameters (α and β) are derived using at most four neighboring chroma samples and their corresponding downsampled luma samples. If the current chroma block dimensions are W×H, then W' and H' are set as follows: -When LM mode is applied, W'=W, H'=H - When LM-A mode is applied, W'=W+H -When LM-L mode is applied, H'=H+W
[0059] The top neighbourhood is denoted as S[0,-1]…S[W'-1,-1], and the left neighbourhood is denoted as S[-1,0]…S[-1,H'-1]. Then, we select four samples as follows: -When LM mode is applied and both upper and left neighboring samples are available, then S[W' / 4,-1], S[3W' / 4,-1], S[-1,H' / 4], S[-1,3H' / 4]. -If LM-A mode is applied or only the top neighboring samples are available, then S[W' / 8,-1], S[3W' / 8,-1], S[5W' / 8,-1], S[7W' / 8,-1]. -If LM-L mode is applied or only left neighboring samples are available, then S[-1,H' / 8], S[-1,3H' / 8], S[-1,5H' / 8], S[-1,7H' / 8].
[0060] The four neighboring luminance samples at the selected location are downsampled and compared four times to find the smaller of the two values x 0 A and x 1 A , and two larger values of x 0 B and x 1 B Their corresponding saturation sample values are y 0 A ,y 1 A ,y 0 B ,y 1 B And, x A ,x B ,y A ,y B is derived as follows:
[0061]
number
[0062] Finally, the linear model parameters α and β are calculated according to the following equations:
[0063]
number
[0064]
number
[0065] The division operations to calculate the parameters are implemented using lookup tables. To reduce the memory required to store the tables, the diff value (the difference between the maximum and minimum values) and the parameter α are expressed in exponential notation. For example, diff is approximated with a 4-bit significant part and an exponent. As a result, the table of 1 / diff is converted to 16 elements for 16 mantissa values as follows: DivTable[]={0,7,6,5,5,4,4,3,3,2,2,1,1,1,1,0} (2-5)
[0066] This has the advantage of reducing the computational complexity as well as reducing the memory size required to store the required tables.
[0067] To match the chroma sample positions of 4:2:0 video sequences, two types of downsampling filters are applied to the luma samples to achieve a 2:1 downsampling ratio in both horizontal and vertical directions. The selection of the downsampling filter is dictated by the SPS level flag. The two downsmapping filters correspond to "Type 0" and "Type 2" content, respectively.
[0068]
number
[0069]
number
[0070] Note that if the upper reference line is on a CTU boundary, only one luma line (a common line buffer in intra prediction) is used to generate the downsampled luma samples.
[0071] This parameter computation is done as part of the decoding process and not just as an encoder search operation, and as a result no syntax is used to communicate the α and β values to the decoder.
[0072] For chroma intra mode coding, a total of eight intra modes are allowed for chroma intra mode coding. These modes include five traditional intra modes and six cross-component linear model modes (LM, LM_A, and LM_L). The chroma mode signaling and derivation process is shown in Table 2-2. Chroma mode coding directly depends on the intra prediction mode of the corresponding luma block. In I slice, since the separation of the block partition structure for luma and chroma components is enabled, one chroma block may correspond to multiple luma blocks. Therefore, for chroma DM mode, the intra prediction mode of the corresponding luma block, including the center position of the current chroma block, is directly inherited.
[0073] Table 2-2 Deriving chroma prediction mode from luma mode when cclm_ is enabled
[0074] [Table 2]
[0075] JVET-Q2001-vE specification of the intra prediction modes INTRA_LT_CCLM, INTRA_L_CCLM, and INTRA_T_CCLM
[0076] 8.4.5.2.13 The inputs to this process are: - intra prediction mode predModeIntra, - the sample position (xTbC, yTbC) of the top-left sample of the current transform block relative to the top-left sample of the current picture, - the variable nTbW, which defines the width of the transformation block; - the variable nTbH, which defines the height of the transformation block; - the variable cIdx, which defines the color components of the current block; - Chroma neighborhood sample p[x][y] for x=-1, y=0..2*nTbH-1, and x=0..2*nTbW-1, y=-1
[0077] The output of this process is the predicted samples preSamples[x][y], where x=0..nTbW-1 and y=0..nTbH-1. The current luminance position (xTbY, yTbY) is derived as follows. (xTbY,yTbY)=(xTbC<<(SubWidthC-1),yTbC<<(SubHeightC-1)) (351) The variables availL, availT and availTL are derived as follows. - The derivation process for neighborhood block availability specified in Section 6.4.4 is invoked with the current luminance position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighborhood luminance position (xTbY-1, yTbY), checkPredModeY set equal to FALSE, and cIdx as input, and assigns the output to availL. - The derivation process for neighborhood block availability specified in Section 6.4.4 is invoked with the current luminance position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighborhood luminance position (xTbY, yTbY-1), checkPredModeY set equal to FALSE, and cIdx as input, and assigns the output to availT. The variable availTL is derived as follows: availTL=availL&&availT (352) - The number of available top right neighbor chroma samples, numTopRight, is derived as follows: The variable numTopRight is set equal to 0 and availTR is set equal to TRUE. -If preModeIntra is equal to INTRA_T_CCLM, the following applies for x=nTbW..2*nTbW-1 until either availTR is equal to FALSE or x is equal to 2*nTbW-1: - The derivation process for neighborhood block availability specified in Section 6.4.4 is invoked with the current luminance position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighborhood luminance position (xTbY+x, yTbY-1), checkPredModeY set equal to FALSE, and cIdx as input, and assigns the output to availTR. If -availTR is equal to TRUE, numTopRight is increased by one. - The number of available bottom-left neighboring chroma samples, numLeftBelow, is derived as follows: The variable numLeftBelow is set equal to 0 and availLB is set equal to TRUE. - if preModeIntra is equal to INTRA_L_CCLM, the following applies for y=nTbH..2*nTbH-1 until either availLB is equal to FALSE or y is equal to 2*nTbH-1: - The derivation process for neighborhood block availability specified in Section 6.4.4 is invoked with the current luminance position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighborhood luminance position (xTbY-1, yTbY+y), checkPredModeY set equal to FALSE, and cIdx as input, and assigns the output to availLB. If -availLB is equal to TRUE, numLeftBelow is increased by one.
[0078] The number of available neighboring chroma samples in the top and top-right numSampT and the number of available neighboring chroma samples in the left and bottom-left numSampL are derived as follows: -If predModeIntra is equal to INTRA_LT_CCLM, the following applies: numSampT=availT?nTbW:0 (353) numSampL=availL?nTbH:0 (354) - If not, the following applies: numSampT=(availT&&predModeIntra==INTRA_T_CCLM)?(nTbW+Min(numTopRight,nTbH)):0 (355) numSampL=(availL&&predModeIntra==INTRA_L_CCLM)?(nTbH+Min(numLeftBelow,nTbW)):0 (356)
[0079] The variable bCTUboundary is derived as follows. bCTUboundary=(yTbY&(CtbSizeY-1)==0)?TRUE:FALSE. (357) The variable cntN and the array pickPosN in which N is replaced with L and T are derived as follows. The variable numIs4N is derived as follows: numIs4N=((availT&&availL&&predModeIntra==INTRA_LT_CCLM)?0:1) (358) - The variable startPosN is set equal to numSampN>>(2+numIs4N). - The variable pickStepN is set equal to Max(1,numSampN>>(1+numIs4N)). If -availN is equal to TRUE and preModeIntra is equal to INTRA_LT_CCLM or INTRA_N_CCLM, the following allocations are made: -cntN is set equal to Min(numSampN, (1+numIs4N)<<1). -pickPosN[pos] is set equal to (startPosN+pos*pospickStepN), where pos=0..cntN-1. Otherwise, cntN is set equal to 0. The predicted samples predSamples[x][y], where x=0..nTbW-1 and y=0..nTbH-1, are derived as follows: If both -numSampL and numSampT are equal to 0, the following applies: predSamples[x][y]=1<<(BitDepth-1) (359)
[0080] - Otherwise, the following ordered steps apply: 1. The co-located luma sample pY[x][y], where x=0..nTbW*SubWidthC-1, y=0..nTbH*SubHeightC-1, is set equal to the pre-deblocking filtered reconstructed luma sample at position (xTbY+x, yTbY+y). 2. The neighboring luminance samples pY[x][y] are derived as follows: If -numSampL is greater than 0, the neighboring left luma sample pY[x][y], where x=-1..-3, y=0..SubHeightC*numSampL-1, is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y). If -availT is equal to FALSE, the top-most luma sample pY[x][y] in the neighborhood with x=-1..SubWidthC*numSampT-1, y=-1..-2 is set equal to the luma sample pY[x][0]. If -availL is equal to FALSE, the left luma sample pY[x][y] in the neighborhood x=-1..-3, y=-1..SubHeightC*numSampL-1 is set equal to the luma sample pY[0][y]. If -numSampT is greater than 0, the top-most luma sample pY[x][y] in the neighborhood with x=0..SubWidthC*numSampT-1, y=-1,-2 is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y). When -availTL is equal to TRUE, the nearby top-left luma sample pY[x][y], where x=-1, y=-1,-2, is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y).
[0081] 3. The downsampled and arranged luminance samples pDsY[x][y] for x=0..nTbW-1 and y=0..nTbH-1 are derived as follows: -If both SubWidthC and SubHeightC are equal to 1, the following applies: pDsY[x][y], where x=1..nTbW-1 and y=1..nTbH-1, is derived as follows: pDstY[x][y]=pY[x][y] (360) - If not, the following applies: The one-dimensional filter coefficient arrays F1 and F2 and the two-dimensional filter coefficient arrays F3 and F4 are defined as follows: F1[0]=2, F1[1]=0 (361) F2[0]=1, F2[1]=2, F2[2]=1 (362) F3[i][j]=F4[i][j]=0,i=0..2,j=0..2 (363) -If both SubWidthC and SubHeightC are equal to 2, the following applies: F1[0]=1, F1[1]=1 (364) F3[0][1]=1,F3[1][1]=4,F3[2][1]=1,F3[1][0]=1,F3[1][2]=1 (365) F4[0][1]=1,F4[1][1]=2,F4[2][1]=1 (366) F4[0][2]=1,F4[1][2]=2,F4[2][2]=1 (367) - If not, the following applies: F3[1][1]=8 (368) F4[0][1]=2,F4[1][1]=4,F4[2][1]=2, (369) - when sps_chroma_vertical_collocated_flag is equal to 1, the following applies: pDsY[x][y], where x=1..nTbW-1 and y=1..nTbH-1, is derived as follows: pDsY[x][y]=(F3[1][0]*pY[SubWidthC*x][SubHeightC*y-1]+ F3[0][1]*pY[SubWidthC*x-1][SubHeightC*y]+ F3[1][1]*pY[SubWidthC*x][SubHeightC*y]+ F3[2][1]*pY[SubWidthC*x+1][SubHeightC*y]+ F3[1][2]*pY[SubWidthC*x][SubHeightC*y+1]+4)>>3 (370) - Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies: pDsY[x][y], where x=1..nTbW-1 and y=1..nTbH-1, is derived as follows: pDsY[x][y]=(F4[0][1]*pY[SubWidthC*x-1][SubHeightC*y]+ F4[0][2]*pY[SubWidthC*x-1][SubHeightC*y+1]+ F4[1][1]*pY[SubWidthC*x][SubHeightC*y]+ F4[1][2]*pY[SubWidthC*x][SubHeightC*y+1]+ F4[2][1]*pY[SubWidthC*x+1][SubHeightC*y]+ F4[2][2]*pY[SubWidthC*x+1][SubHeightC*y+1]+4)>>3 (371)
[0082] 4. If numSampL is greater than 0, the selected neighboring left chroma sample pSelC[idx] is set equal to p[-1][pickPosL[idx]], for idx=0..cntL-1, and the selected downsampled neighboring left luma sample pSelDsY[idx], for idx=0..cntL-1, is derived as follows: - The variable y is set equal to pickPosL[idx]. -If both SubWidthC and SubHeightC are equal to 1, the following applies: pSelDsY[idx]=pY[-1][y] (372) - If not, the following applies: - when sps_chroma_vertical_collocated_flag is equal to 1, the following applies: pSelDsY[idx]=(F3[1][0]*pY[-SubWidthC][SubHeightC*y-1]+ F3[0][1]*pY[-1-SubWidthC][SubHeightC*y]+ F3[1][1]*pY[-SubWidthC][SubHeightC*y]+ F3[2][1]*pY[1-SubWidthC][SubHeightC*y]+ F3[1][2]*pY[-SubWidthC][SubHeightC*y+1]+4)>>3 (373) - Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies: pSelDsY[idx]=(F4[0][1]*pY[-1-SubWidthC][SubHeightC*y]+ F4[0][2]*pY[-1-SubWidthC][SubHeightC*y+1]+ F4[1][1]*pY[-SubWidthC][SubHeightC*y]+ F4[1][2]*pY[-SubWidthC][SubHeightC*y+1]+ F4[2][1]*pY[1-SubWidthC][SubHeightC*y]+ F4[2][2]*pY[1-SubWidthC][SubHeightC*y+1]+4)>>3 (374)
[0083] 5. If numSampT is greater than 0, the top chroma sample of the selected neighborhood pSelC[idx] is set equal to p[pickPost[idx-cntL][-1], where idx=cntL..cntL+cntT-1, and the top luma sample of the downsampled neighborhood pSelDsY[idx], for idx=0..cntL+cntT-1, is defined as follows: - The variable x is set equal to pickPost[idx-cntL]. -If both SubWidthC and SubHeightC are equal to 1, the following applies: pSelDsY[idx]=pY[x][-1] (375) - If not, the following applies: - when sps_chroma_vertical_collocated_flag is equal to 1, the following applies: When -bCTUboundary is equal to FALSE, the following applies: pSelDsY[idx]=(F3[1][0]*pY[SubWidthC*x][-1-SubHeightC]+ F3[0][1]*pY[SubWidthC*x-1][-SubHeightC]+ F3[1][1]*pY[SubWidthC*x][-SubHeightC]+ F3[2][1]*pY[SubWidthC*x+1][-SubHeightC]+ F3[1][2]*pY[SubWidthC*x][1-SubHeightC]+4)>>3 (376) - Otherwise (bCTUboundary is equal to TRUE), the following applies: pSelDsY[idx]=(F2[0]*pY[SubWidthC*x-1][-1]+ F2[1]*pY[SubWidthC*x][-1]+ F2[2]*pY[SubWidthC*x+1][-1]+2)>>2 (377) - Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies: When -bCTUboundary is equal to FALSE, the following applies: pSelDsY[idx]=(F4[0][1]*pY[SubWidthCx-1][-1]+ F4[0][2]*pY[SubWidthC*x-1][-2]+ F4[1][1]*pY[SubWidthC*x][-1]+ F4[1][2]*pY[SubWidthC*x][-2]+ F4[2][1]*pY[SubWidthC*x+1][-1]+ F4[2][2]*pY[SubWidthC*x+1][-2]+4)>>3 (378) - Otherwise (bCTUboundary is equal to TRUE), the following applies: pSelDsY[idx]=(F2[0]*pY[SubWidthC*x-1][-1]+ F2[1]*pY[SubWidthC*x][-1]+ F2[2]*pY[SubWidthC*x+1][-1]+2)>>2 (379)
[0084] 6. If cntT+cntL is not equal to 0, then the variables minY, maxY, minC, and maxC are derived as follows: If -cntT+cntL is equal to 2, then in Comp substituted for DsY and C, pSelComp[3] is set equal to pSelComp[0], pSelComp[2] is set equal to pSelComp[1], pSelComp[0] is set equal to pSelComp[1], and pSelComp[1] is set equal to pSelComp[3]. - The arrays minGrpIdx and maxGrpIdx are derived as follows: minGrpIdx[0]=0 (380) minGrpIdx[1]=2 (381) maxGrpIdx[0]=1 (382) maxGrpIdx[1]=3 (383) - If pSelDsY[minGrpIdx[0]] is greater than pSelDsY[minGrpIdx[1], minGrpIdx[0] and minGrpIdx[1] are swapped as follows: (minGrpIdx[0],minGrpIdx[1])=Swap(minGrpIdx[0],minGrpIdx[1]) (384) - If pSelDsY[maxGrpIdx[0]] is greater than pSelDsY[maxGrpIdx[1], maxGrpIdx[0] and maxGrpIdx[1] are swapped as follows: (maxGrpIdx[0],maxGrpIdx[1])=Swap(maxGrpIdx[0],maxGrpIdx[1]) (385) - If pSelDsY[minGrpIdx[0]] is greater than pSelDsY[maxGrpIdx[1], the arrays minGrpIdx and maxGrpIdx are swapped as follows: (minGrpIdx,maxGrpIdx)=Swap(minGrpIdx,maxGrpIdx) (386) - If pSelDsY[minGrpIdx[1]] is greater than pSelDsY[maxGrpIdx[0], minGrpIdx[1] and maxGrpIdx[0] are swapped as follows: (minGrpIdx[1],maxGrpIdx[0])=Swap(minGrpIdx[1],maxGrpIdx[0]) (387) The variables maxY, maxC, minY and minC are derived as follows: maxY=(pSelDsY[maxGrpIdx[0]]+pSelDsY[maxGrpIdx[1]]+1)>>1 (388) maxC=(pSelC[maxGrpIdx[0]]+pSelC[maxGrpIdx[1]]+1)>>1 (389) minY=(pSelDsY[minGrpIdx[0]]+pSelDsY[minGrpIdx[1]]+1)>>1 (390) minC=(pSelC[minGrpIdx[0]]+pSelC[minGrpIdx[1]]+1)>>1 (391)
[0085] 7. The variables a, b, and k are derived as follows: -If numSampL is equal to 0 and numSampT is equal to 0, the following applies: k=0 (392) a=0 (393) b=1<<(BitDepth-1) (394) - If not, the following applies: diff=maxY-minY (395) If -diff is not equal to 0, the following applies: diffC=maxC-minC (396) x=Floor(Log2(diff)) (397) normDiff=((diff<<4)>>x)&15 (398) x+=(normDiff!=0)?1:0 (399) y=Abs(diffC)>0?Floor(Log2(Abs(diffC)))+1:0 (400) a=(diffC*(divSigTable[normDiff]|8)+2 y-1 )>>y (401) k=((3+xy)<1)?1:3+xy (402) a=((3+xy)<1)?Sign(a)*15:a (403) b=minC-((a*minY)>>k) (404) Here, divSigTable[] is defined as follows: divSigTable[]={0,7,6,5,5,4,4,3,3,2,2,1,1,1,1,0} (405) - Otherwise (diff is equal to 0), the following applies: k=0 (406) a=0 (407) b=minC (408)
[0086] 8. The predicted samples predSamples[x][y], where x=0..nTbW-1 and y=0..nTbH-1, are derived as follows: predSamples[x][y]=Clip1(((pDsY[x][y]*a)>>k)+b) (409) NOTE - This process uses the sps_chroma_vertical_collocated_flag, but for simplicity of implementation, does not use the sps_chroma_horizontal_collocated_flag.
[0087] 2.8. BDPCM (Block Differential Pulse-Code Modulation) coding In JVET-M0057, BDPCM is proposed. Due to the shape of the horizontal (or vertical) predictor, which uses the pixel to the left (A) (or above (B)) to predict the current pixel, the most throughput-efficient way to process a block is to process all pixels of one column (or line) in parallel and process these columns (or lines) sequentially. To improve the throughput, we introduce the following process: if the predictor selected for this block is vertical, we bisect a block of width 4 with the horizontal frontier, and if the predictor selected for this block is horizontal, we bisect a block of height 4 with the vertical frontier.
[0088] When splitting a block, it is not allowed to compute a prediction for a sample from one region using pixels from another region, and if this situation occurs, we replace the predicted pixel with a reference pixel in the prediction direction. This is illustrated in Figure 5 for different positions of the current pixel X in a 4x8 block predicted vertically.
[0089] FIG. 5 shows an example of dividing a block of 4×8 samples into two independently decodable regions.
[0090] Thanks to this property, a 4x4 block can be processed in two cycles, and a 4x8 or 8x4 block may be processed in four cycles, as shown in FIG.
[0091] FIG. 6 shows an exemplary order for processing rows of pixels to maximize throughput for a 4×N block with a vertical predictor.
[0092] Table 2-3 summarizes the number of cycles required to process a block depending on the size of the block. Note that for any block with both dimensions greater than or equal to 8, it is trivial to say that more than 8 pixels can be processed per cycle.
[0093] Table 2-3 Worst-case throughput for blocks of size 4xN, Nx4
[0094] [Table 3]
[0095] 2.9. Quantized Residual Domain BDPCM In JVET-N0413, quantized residual domain BDPCM (hereinafter referred to as RBDPCM) is proposed. Intra prediction predicts the whole block by copying samples in the prediction direction (horizontal or vertical prediction) similar to intra prediction. The residual is quantized, and the delta between the quantized residual and its predictor (horizontal or vertical) quantized value is coded.
[0096] For a block of size M (rows) × N (columns), r i,j , 0≦i≦M-1, 0≦j≦N-1 are the prediction residuals after intra prediction in the horizontal direction (copying the pixel values of the left neighbor to the prediction block line by line) or vertical direction (copying the upper neighbor to each line in the prediction block) using unfiltered samples from the boundary samples of the upper or left block. i , j ), 0≦i≦M-1, 0≦j≦N-1 is the residual r i , j where the residual is the difference between the original block and the predicted block values. Then, block DPCM is applied to the quantized residual samples, resulting in the element r i , j A modified M×N array R with ~ When the vertical BDPCM is signaled,
[0097]
number
[0098] For horizontal prediction, a similar rule applies and the residual quantized samples are given by:
[0099]
number
[0100] The residual quantized sample r ~ i,j is sent to the decoder.
[0101] At the decoder, the above calculation is reversed to obtain Q(r i,j ), 0≦i≦M-1, 0≦j≦N-1. For vertical prediction,
[0102]
number
[0103] For the horizontal direction,
[0104]
number
[0105] The dequantized residual Q -1 (Q(r i,j )) to the intrablock prediction to generate a reconstructed sample value.
[0106] The main advantage of this scheme is that the inverse DPCM can be done on the fly while parsing the coefficients, only needing to add the predictor while parsing the coefficients, or it can be done after parsing.
[0107] In quantized residual domain BDPCM, transform skip is always used.
[0108] 2.10. Multiple Transform Set (MTS) in VVC In the VTM, transforms of large block sizes up to 64x64 in size are enabled, which is mainly useful for high resolution video, e.g., 1080p and 4K sequences. For transform blocks with size (width or height, or both width and height) of 64, we zero out the high frequency transform coefficients and keep only the lower frequency coefficients. For example, for an MxN transform block, where M is the block width and N is the block height, if M is 64, only the left 32 columns of transform coefficients are kept. Similarly, if N is 64, only the top 32 rows of transform coefficients are kept. When using transform skip mode for large blocks, we use the entire block without zeroing values. The VTM also supports a configurable maximum transform size in the SPS, so that the encoder has the flexibility to choose a transform size up to 16-length, 32-length, or 64-length based on the needs of a particular implementation.
[0109] In addition to the DCT-II used in HEVC, a Multiple Transform Selection (MTS) scheme is used for residual coding of both inter-coded and intra-coded blocks. It uses multiple transforms selected from DCT8 / DST7. The newly introduced transform matrices are DST-VII and DCT-VIII. The selected DST / DCT basic functions are shown in Table 2-4 below.
[0110] Table 2-4 Transform-based functions of DCT-II / VIII and DSTVII for N-point input
[0111] [Table 4]
[0112] To maintain the orthogonality of the transform matrices, they are quantized more precisely than in HEVC: after horizontal and vertical transformations, all coefficients will have 10 bits to keep intermediate values of the transform coefficients within the 16-bit range.
[0113] To control the MTS scheme, separate enable flags are defined for intra and inter at the SPS level. When MTS is enabled at the SPS, a CU level flag is signaled to indicate whether MTS is applied or not, where MTS is only applied to luma. The MTS CU level flag is signaled if the following conditions are met: -Width and height are both 32 or less, - CBF flag is equal to 1.
[0114] If the MTS CU flag is equal to zero, DCT2 is applied in both directions. However, if the MTS CU flag is equal to one, two other flags are additionally signaled to indicate the transform type in the horizontal and vertical directions, respectively. Transform mapping table is signaled as shown in Table 2-5. Use unified transform selection for ISP and implicit MTS by removing the dependency of intra mode and block shape. If the current block is in ISP mode, or if the current block is an intra block and both intra and inter explicit MTS are on, only DST7 is used for both horizontal and vertical transform cores. When transforming matrix precision, use 8-bit primary transform core. So, all transform cores used in HEVC are kept the same, such as 4-point DCT-2 and DST-7, 8-point, 16-point, 32-point DCT-2, etc. Also, other transform cores such as 64-point DCT-2, 4-point DCT-8, 8-point, 16-point, and 32-point DST-7 and DCT-8 use an 8-bit primary transform core.
[0115] Table 2-5 Mapping Table Conversions and Signaling
[0116] [Table 5]
[0117] To reduce the complexity of large sizes of DST-7 and DCT-8, high frequency transform coefficients are zeroed for DST-7 and DCT-8 blocks whose size (width or height or both width and height) is equal to 32. Only coefficients in the lower frequency region of 16x16 are retained.
[0118] As in HEVC, the residual of a block may be coded in transform skip mode. To avoid syntax coding redundancy, the transform skip flag is not signaled if the CU level MTS_CU_flag is not equal to zero. The block size restriction for transform skip is the same as for MTS in JEM4, and indicates that transform skip is applicable to a CU if the width and height of the block are both less than or equal to 32. Note that if LFNST or MIP is activated for the current CU, the implicit MTS transform is set to DCT2. Also, implicit MTS may still be enabled if MTS is enabled for inter-coded blocks.
[0119] 2.11. LFNST(Low-Frequency Non-Separable Transform) In VVC, a low-frequency non-separable transform (LFNST), known as a contraction secondary transform, is applied between the forward primary transform and quantization (encoder side), and between the inverse quantization and the inverse primary transform (decoder side), as shown in Fig. 7. In LFNST, a 4x4 non-separable transform or an 8x8 non-separable transform is applied according to the block size. For example, a 4x4 LFNST is applied to small blocks (i.e., min(width, height)<8), and an 8x8 LFNST is applied to larger blocks (i.e., min(width, height)>4).
[0120] FIG. 7 shows an example of LFNST (Low-Frequency Non-Separable Transform) processing.
[0121] The application of the non-separable transform used in LFNST is explained below using the input as an example. To apply 4x4 LFNST, we have a 4x4 input block X
[0122]
number
[0123] But first, the vector X → It is expressed as:
[0124]
number
[0125] Non-separable transformations are
[0126]
number
[0127] where F → Let denote the transform coefficient vector, and T is the 16x16 transform matrix. The 16x1 coefficient vector is then reorganized into 4x4 blocks using the scan order of the block (horizontal, vertical, diagonal). Coefficients with smaller indices are arranged in the 4x4 coefficient block with smaller scan indices.
[0128] 2.11.1. Narrowing non-separable transformations The Low-Frequency Non-Separatable Transform (LFNST) is based on the direct matrix multiplication algorithm to apply the non-separable transform, whereby it is implemented in a single pass without multiple iterations. However, in order to minimize the computational complexity and the memory space for storing the transform coefficients, it is necessary to reduce the dimension of the non-separable transform matrix. Therefore, in LFNST, the reduced non-separable transform (or RST) method is used. The main idea of the reduced non-separable transform is to map an N (where N is usually equal to 64 for an 8×8 NSST) -dimensional vector to an R -dimensional vector in a different space, and N / R (R < N) is the reduction ratio. Thus, instead of an N×N matrix, the RST matrix becomes an R×N matrix as follows.
[0129] [Number]
[0130] Let the R rows of the transform be a basis of R in the N-dimensional space. The inverse transform matrix for RT is the transpose of its forward transform. For 8×8 LFNST, a 4x reduction factor is applied to reduce the traditional 8×8 non-separable transform matrix size of 64×64 direct matrix to a 16×48 direct matrix. That is, at the decoder side, a 48×16 inverse RST matrix is used to generate the core (primary) transform coefficients in the 8×8 top-left region. If a 16×48 matrix is applied instead of a 16×64 matrix with the same transform set configuration, each matrix takes in 48 input data from three 4×4 blocks in the top-left 8×8 block excluding the bottom-right 4×4 block. The reduced dimensions reduce the memory usage for storing all LFNST matrices from 10KB to 8KB with reasonable performance degradation. 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 the first-only transform coefficients must be zero. This allows for adjustment of the signaling of the LFNST index at the previous significant position, thus avoiding the extra coefficient scan in the current LFNST design, which is required to check the significant coefficients only at certain positions. The worst case of handling LFNST (in terms of multiplications per pixel) limits the non-separable transforms for 4×4 and 8×8 blocks to 8×16 and 8×48 transforms, respectively. In such cases, the previous significant scan position must be less than 8 when LFNST is applied, and less than 16 for other sizes. For blocks with shapes of 4×N, N×4, and N>8, the proposed restriction means that LFNST is applied only once, and only in the top-left 4×4 region. Since all the first-only coefficients are zero when LFNST is applied, the number of operations required for the primary transform is reduced in such cases. From the encoder's perspective, the quantization of coefficients becomes very simple when testing the LFNST transform. A maximum distortion-optimized quantization must be performed on the first 16 coefficients (in scan order), and the remaining coefficients are forced to zero.
[0131] 2.11.2. LFNST Conversion Selection There are four transform sets in total, with two non-separable transform matrices (kernels) per transform set used in LFNST. The mapping from intra prediction modes to transform sets is 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), select transform set 0 for the current chroma block. For each transform set, the selected non-separable secondary transform candidate is further defined by an explicitly signaled LFNST index. The index is signaled in the bitstream once per intra CU after the transform coefficients.
[0132] Table 2-6 Conversion Selection Table
[0133] [Table 6]
[0134] 2.11.3. LFNST Index Signals and Interaction with Other Tools Since LFNST is restricted to be applicable only when all coefficients outside the first coefficient subgroup are non-significant, the LFNST index coding depends on the position of the last significant coefficient. Also, the LFNST index is context coded, but it is independent of the intra prediction mode, only the first bin is context coded. Furthermore, LFNST is applied in both intra slices and inter slices, and for both luma and chroma. When dual tree is enabled, the LFNST indexes for luma and chroma are signaled separately. For inter slices (dual tree is disabled), a single LFNST index is signaled and used for both luma and chroma.
[0135] When ISP mode is selected, LFNST is disabled and RST index is not signaled because performance improvement was marginal even if RST was applied to all feasible partition blocks. Furthermore, encoding complexity may be reduced by disabling RST for ISP predicted residuals. When MIP mode is selected, LFNST is also disabled and index is not signaled.
[0136] Considering that large CUs larger than 64x64 are implicitly split (TU tiling) due to the existing maximum transform size limitation (64x64), LFNST index lookup may increase data buffering by 4x for a certain number of stages of the decode pipeline. Therefore, the maximum size allowed for LFNST is limited to 64x64. Note that LFNST is only enabled for DCT2.
[0137] 2.12. Chroma conversion skip In VVC, chroma TS (Transform Skip) is introduced. The motivation is to unify TS and MTS signaling between luma and chroma by relocating transform_skip_flag and mts_idx to the residual_coding part. One context model is added for chroma TS. For mts_idx, neither the context model nor the binarization is changed. In addition, TS residual coding is applied even when using chroma TS.
[0138] Semantics transform_skip_flag[x0][y0][cIdx] specifies whether to apply a transformation to the associated transform block. The array indexes x0,y0 specify the position (x0,y0) of the top-left luma sample of the considered transform block relative to the top-left luma sample of the picture. When transformation_skip_flag[x0][y0][cIdx] is equal to 1, it specifies that no transformation is applied to the current transform block. The array index cIdx specifies an indicator for the color components and is equal to 0 for luma, 1 for Cb, and 2 for Cr. transform_skip_flag[x0][y0][cIdx] equal to t0 specifies that the decision of whether a transformation applies to the current transform block depends on other syntax elements. If transform_skip_flag[x0][y0][cIdx] is not present, it is inferred to be equal to 0.
[0139] 2.13. BDPCM for chroma In addition to the chroma TS support, BDPCM is added to the chroma component. If sps_bdpcm_enable_flag is 1, an additional syntax element sps_bdpcm_chroma_enable_flag is added to the SPS. The flag indicates the following behavior, as shown in Table 2-7:
[0140] Table 2-7 sps flags for luma and chroma BDPCM
[0141] [Table 7]
[0142] If BDPCM is available for luma only, the current behavior remains unchanged. If BDPCM is also available for chroma, then bdpcm_chroma_flag is sent for each chroma block, which indicates whether BDPCM is used in the chroma block. If on, BDPCM is used for both chroma components and an additional bdpcm_dir_chroma flag is coded to indicate the prediction direction used for both chroma components.
[0143] The deblocking filter is deactivated at the boundary between two Block-DPCM blocks, since neither block uses a transform stage that would normally cause blocking artifacts. This deactivation is done independently for the luma and chroma components.
[0144] 3. Examples of technical problems that the disclosed solution aims to solve The current design of the derivation of linear parameters in CCLM and TS has the following problems. 1. For non-4:4:4 color formats, the derivation of linear parameters in CCLM involves the neighboring chroma samples and the neighboring downsampled luma samples. As shown in Figure 8, in the current VVC, if the nearest line is not on the CTU boundary, the second line above the current block for 4:2:2 video is used to derive the neighboring top luma sample. However, for 4:2:2 video, the vertical resolution does not change. Therefore, there is a phase shift between the neighboring top luma sample and the neighboring chroma sample.
[0145] FIG. 8 shows an example of neighboring chroma samples and downsampled neighboring luma samples used in deriving CCLM parameters for 4:2:2 video. 2. In the current VVC, the same maximum block size is used in the condition check for signaling the luma transform skip flag and the chroma transform skip flag. Such a design does not consider the color format and is not desirable. A similar problem exists for signaling of the luma BDPCM flag and for signaling of the chroma BDPCM flag, and the same maximum block size is used for the condition check.
[0146] 3. In VVC as specified in JVET-Q2001-vE, the left neighbor sample is put into the selected neighbor sample list before the upper neighbor sample. However, there are cases where it is better to put the upper neighbor sample before the left neighbor sample. 4. In VVC as specified in JVET-Q2001-vE, two rows of neighboring luma samples are allocated, but if sps_chroma_vertical_collocated_flag is equal to 1, three rows of neighboring luma samples are required.
[0147] 5. In VVC as specified in JVET-Q2001-vE, if the left neighbor luma sample is not available, pad the left neighbor luma sample using the leftmost sample of the current block and pad the top-left neighbor luma sample using the top-most neighbor luma sample. However, the top-most neighbor luma sample is not derived. For example, see JVET-Q2001-vE. "If -availL is equal to FALSE, the neighboring left luma sample pY[x][y], where x=-1..-3, y=-1..SubHeightC*numSampL-1, is set equal to luma sample pY[0][y]. If -numSampT is greater than 0, the top-most luma sample pY[x][y] in the neighborhood with x=0..SubWidthC*numSampT-1, y=-1,-2 is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y)."
[0148] 6. In VVC as specified in JVET-Q2001-vE, the top (or / and left) neighbor luma sample is derived incorrectly if it is not available. For example, in JVET-Q2001-vE, "If availT is equal to FALSE, the top neighbor luma sample pY[x][y] for x=-1..SubWidthC*numSampT-1, y=-1..-2 is set equal to luma sample pY[x][0]" is used to derive the top neighbor luma sample if it is unavailable. However, if the top neighbor luma sample is not available, numSampT is set equal to 0. 7. In current VVC, the top-left neighboring luma sample is used to derive the CCLM parameters if the top-most and left neighboring luma samples are available, but the top-left neighboring luma sample is not available if it is in a different slice, e.g., in the case of a raster slice.
[0149] 4. List of embodiments and techniques The following should be considered as examples to illustrate the general concept. These items should not be construed in a narrow sense. Moreover, these items can be combined in any way.
[0150] In this document, the term "CCLM" refers to a coding tool that utilizes cross-color component information to predict samples / residuals for a current color component or to derive a reconstruction of samples in the current color component. The present invention is not limited to the CCLM technique described in VVC.
[0151] Derivation of linear parameters in CCLM 1. When deriving CCLM parameters for a chroma block, one or more upper neighboring lines of the aligned luma block may be used to derive the top luma sample of the downsampled aligned neighborhood. a. In one example, if the current chroma block is not at the topmost CTU boundary, the closest upper line of the aligned luma block may be used to derive the downsampled topmost aligned luma sample instead of the second line above. i. In one example, one and the same downsampling filter may be used to derive the top luma sample of the downsampled neighborhood and the left luma sample of the downsampled neighborhood. 1) For example, a filter of the form
[0121] may be used. More specifically, pDsY[x]=(pY[2*x-1][-1]+2*pY[2*x][-1]+pY[2*x+1][-1]+2)>>2, where pY[2*x][-1], pY[2*x-1][-1], and pY[2*x+1][-1] are the luminance samples from the nearest neighbor line above, and pDstY[x] denotes the topmost luminance sample in the downsampled neighborhood. ii. In one example, different downsampling filters (e.g., different filter taps / different filter coefficients) may be used to derive the top luma sample of the downsampled neighborhood and the left luma sample of the downsampled neighborhood. iii. In one example, one and the same downsampling filter may be used to derive the top luma sample of a downsampled neighborhood regardless of the location of the chroma block (e.g., the chroma block may or may not be on the upper CTU boundary). iv. In one example, the above method may only be applied to images / videos in 4:2:2 format.
[0152] b. In one example, if the current chroma block is not at the topmost CTU boundary, the upper neighboring luma samples including the nearest upper line of the placed luma block, excluding the second upper line, may be downsampled and used to derive the placed upper luma sample. c. In one example, the derivation of the top luminance sample in a downsampled neighborhood may depend on samples located on multiple lines. i. In one example, it may depend on both the second closest line and the closest line above the placed luma block. ii. In one example, the top luminance sample of the downsampled neighborhood may be derived using one and the same downsampling filter for different color formats (eg, 4:2:0 and 4:2:2). 1) In one example, a 6-tap filter (eg, [1 2 1; 1 2 1]) may be used. a) In one example, the top-most luminance sample in the downsampled neighborhood may be derived as pDsY[x]=(pY[2*x-1][-2]+2*pY[2*x][-2]+pY[2*x+1][-2]+pY[2*x-1][-1]+2*pY[2*x][-1]+pY[2*x+1][-1]+4)>>3, where pY is the corresponding luminance sample and pDstY[x] represents the top-most luminance sample in the downsampled neighborhood. b) Additionally, alternatively, the above method may be applied when sps_cclm_colocated_chroma_flag is equal to 0. 2) In one example, a 5-tap filter (eg, [0 1 0; 1 4 1; 0 1 0]) may be used. a) In one example, the top-most luminance sample in the downsampled neighborhood may be derived as pDsY[x]=(pY[2*x][-2]+pY[2*x-1][-1]+4*pY[2*x][-1]+pY[2*x+1][-1]+pY[2*x][0]+4)>>3, where pY is the corresponding luminance sample and pDstY[x] represents the top-most luminance sample in the downsampled neighborhood. b) Additionally, alternatively, the above method may be applied when sps_cclm_colocated_chroma_flag is equal to 0. iii. In one example, the above method may only be applied to images / videos in 4:2:2 format. Maximum block size of transform skip coded blocks (e.g., transform_skip_flag equal to 1, or BDPCM or other modes that bypass the transform process / use the identity transform).
[0153] 2. The maximum block size of the transform skip coded blocks may depend on the color components, where MaxTsSizeY and MaxTsSizeC are the maximum block sizes of the transform skip coded blocks for luma and chroma, respectively. In one example, the maximum block sizes for luma and chroma components may be different. b. In one example, the maximum block sizes for the two chroma components may be different. c. In one example, the maximum block size for luma and chroma components, or for each color component, may be signaled separately. i. In one example, MaxTsSizeC / MaxTsSizeY may be signaled at sequence level / picture level / slice level / tile group level, e.g., in sequence header / picture header / SPS / VPS / DPS / PPS / APS / slice header / tile group header. ii. In one example, MaxTsSizeY may be conditionally signaled, for example according to whether transform skip is enabled or not, or whether / BDPCM is enabled or not. iii. In one example, MaxTsSizeC may be conditionally signaled according to, for example, color format / convert skip is enabled or not / BDPCM is enabled or not. iv. Alternatively, predictive coding of the largest block size between the luma and chroma components may be used. d. In one example, MaxTsSizeC may depend on MaxTsSizeY. i. In one example, MaxTsSizeC may be set equal to MaxTsSizeY. ii. In one example, MaxTsSizeC may be set equal to MaxTsSizeY / N, where N is an integer. For example, N=2. e. In one example, MaxTsSizeC may be set according to a chroma subsampling ratio. i. In one example, MaxTsSizeC is set equal to MaxTsSizeY>>SubWidthC, where SubWidthC is defined in Table 2-1. ii. In one example, MaxTsSizeC is set equal to MaxTsSizeY>SubHeightC, where SubHeightC is defined in Table 2-1. iii. In one example, MaxTsSizeC is set equal to MaxTsSizeY>>max(SubWidthC, SubHeightC). iv. In one example, MaxTsSizeC is set equal to MaxTsSizeY>>min(SubWidthC, SubHeightC).
[0154] 3. The width and height of the maximum allowed block size for a transform coded block may be defined differently. In one example, the width and height of the maximum allowed block size may be signaled separately. In one example, the maximum allowed block size width and height for chroma transform coded blocks may be denoted as MaxTsSizeWC and MaxTsSizeHC, respectively, where MaxTsSizeWC may be set equal to MaxTsSizeY>>SubWidthC, and MaxTsSizeHC may be set equal to MaxTsSizeY>>SubHeightC. i. In one example, MaxTsSizeY is as defined in bullet 2.
[0155] 4. Whether to signal a transform skip flag for a chroma block (e.g., transform_skip_flag[x0][y0][1] and / or transform_skip_flag[x0][y0][2]) may depend on the maximum allowed size of a chroma transform skip coded block. In one example, the chroma transform skip flag may be conditionally signaled according to the following conditions: i. In one example, the conditions are: tbW is less than or equal to MaxTsSizeC, and tbH is less than or equal to MaxTsSizeC, where tbW and tbH are the width and height of the current chroma block. 1) In one example, MaxTsSizeC can be defined the same as that in bullets 2-3. 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, respectively, for a chroma transform skip coded block. 1) In one example, MaxTsSizeWC and / or MaxTsSizeHC can be defined similarly to that in bullet 3. b. In one example, the above method may be applicable to coding of chroma BDPCM flags (eg, intra_bdpcm_chroma_flag) by replacing "transform skip" with "BDPCM".
[0156] 5. Instead of coding two TS flags for the two saturation color components, it is proposed to use one syntax to indicate the usage of TS for the two saturation color components. In one example, instead of coding transform_skip_flag[x0][y0][1] and / or transform_skip_flag[x0][y0][2], a single syntax element (eg, TS_chroma_flag) may be coded. i. In one example, the value of the single syntax element is a binary value. 1) Further alternatively, the two chroma component blocks share the same TS mode on / off control according to a single syntax element. a) In one example, a value of a single syntax element equal to 0 indicates that the TS is disabled for both. b) In one example, a single syntax element value equal to 0 indicates that the TS is enabled for both. 2) Alternatively, the second syntax element may be further signaled based on whether the value of the single syntax element is equal to K (eg, K=1). a) In one example, a value of the single syntax element equal to 0 indicates that TS is disabled for both syntax elements, and a value of the single syntax element equal to 0 indicates that TS is enabled for at least one of the two chroma components. b) A second syntax element may be used to indicate whether the TS applies to either one of the two chroma components and / or whether the TS applies to both. ii. In one example, the value of the single syntax element is a non-binary value. 1) In one example, a single syntax element value equal to K0 indicates that TS is disabled for both. 2) In one example, a single syntax element value equal to K1 indicates that TS is enabled for the first chroma color component and TS is disabled for the second color component. 3) In one example, a single syntax element value equal to K2 indicates that TS is disabled for the first chroma color component and TS is enabled for the second color component. 4) In one example, a single syntax element value equal to K3 indicates that the TS is valid for both. 5) In one example, a single syntax element may be coded using a fixed-length, unary, truncated unary, k-th exponential EG binarization method. iii. In one example, the single syntax element and / or the second syntax element may be context coded or bypass coded.
[0157] General requirements 6. Whether and / or how to apply the above disclosed methods may be signaled at sequence level / picture level / slice level / tile group level, for example in the sequence header / picture header / SPS / VPS / DPS / PPS / APS / slice header / tile group header.
[0158] 7. Whether and / or how to apply the above disclosed methods may depend on the coded information, such as color format, single / dual tree split, etc.
[0159] Additional CCLM requirements 8. In the CCLM parameter derivation process, the upper neighbor sample is put into the selected neighbor sample list before the left neighbor sample, and the selected neighbor sample list is used to derive the CCLM parameters (e.g., using a four-point derivation method in which the two larger values are averaged, the two smaller values are averaged, and the two averages are used to derive the linear parameters). An example is shown in embodiment 5.
[0160] 9. In the CCLM parameter derivation process, when obtaining the downsampled upper neighbor luma sample indicated by pSelDsY[idx], the index value idx must be in the range of cntL to cntL+cntT-1, where cntL and cntT are the number of left neighbor chroma samples and upper neighbor chroma samples used in the CCLM parameter derivation, respectively. An example is shown in embodiment 5. b. Alternatively, and in addition, put the sample from the left neighbor into the sample list of selected neighbors before the sample from the neighbor above.
[0161] 10. In the CCLM parameter derivation process, the top three rows of neighboring luminance samples are assigned. An example is shown in embodiment 6.
[0162] 11. In the CCLM parameter derivation process, the T1 row and T2 column of the upper left neighboring luminance sample are assigned. In one example, T1 = 2 and T2 = 2. An example is shown in embodiment 12. b. In one example, T1=3 and T2=3.
[0163] 12. In the CCLM parameter derivation process, the number of rows of upper luma neighbor samples to be assigned may depend on a variable or syntax element that indicates whether the chroma sample position is not vertically shifted relative to the corresponding luma sample position, such as sps_chroma_vertical_collocated_flag in JVET-Q2001-vE. In one example, if sps_chroma_vertical_collocated_flag is equal to 1, then three rows of neighboring luma samples above are allocated. Otherwise, two rows of neighboring luma samples above are allocated. An example is shown in embodiment 7.
[0164] 13. In the above example, the neighboring luminance samples may be before or after downsampling.
[0165] 14. In the CCLM parameter derivation process, whether and / or how to pad the top-left neighboring sample may depend on the availability of at least one of the top-left neighboring samples instead of the availability of the left neighboring sample and / or the top neighboring sample. a. In one example, the availability of at least one of the upper-left neighboring samples may depend on whether at least one of the upper-left neighboring samples and the samples in the current block are in the same slice or in different slices. i. Also, the top slice may be a rectangular slice or a non-rectangular slice. b. In one example, if the top-left neighboring sample and at least one of the samples of the current block are in different slices, the top-left neighboring sample is padded. c. In one example, if the availability of at least one top-left neighboring sample is false, the top-left neighboring sample is padded.
[0166] 15. In the CCLM parameter derivation process, the top-left neighboring luminance samples may not be used if they are "unavailable". a. In one example, a neighboring sample is “unavailable” if it is outside the current picture, or the current subpicture, or the current tile, or the current slice, or the current brick, or the current CTU, or the current processing unit, or any other current video unit. i. In one example, for the non-rectangular slice shown in FIG. 13, the top-left neighboring luma sample is "unavailable" and is in a different slice than the current block. b. In one example, whether to use the top-left neighboring luma samples in the process of CCLM may depend on whether they are within the same picture / subpicture / tile / slice / brick / CTU / processing unit / other video unit as the current block. i. In one example, the top-left neighboring luma sample may not be used in the processing of CCLM if it is in a different raster slice than the current block. 1) An example is shown in embodiment 10. ii. In one example, the top-left neighboring luma sample may not be used in the CCLM process even though it is in the same picture / subpicture / tile / slice / brick / CTU / processing unit / other video unit as the current block.
[0167] c. In the CCLM parameter derivation process, if the top-left neighboring luma sample is "unavailable", iterative padding may be used to generate the top-left neighboring luma sample. Denote the top-left sample position of the current block by (x,y). Denote the reconstructed luma sample before deblocking filter by pY[i][j]. Denote the padded top-left luma sample by pD[m][n], where m=x-1..xM, n=y-1..yN, where M and N are integers, such as 1. i. In one example, if the left and / or top neighboring chroma samples are available, a repetitive padding method may be used. ii. In one example, if a top-most neighboring luma sample is available, the top-left neighboring luma sample may be padded from the top-most neighboring luma sample. 2) In one example, pD[m][n]=pY[x][n]. iii. In one example, the top-left neighboring luma sample may be padded from the left neighboring luma sample if the left neighboring luma sample is available. 3) In one example, pD[m][n]=pY[m][y]. iv. In one example, if a top-most neighboring luma sample is available and a left-most neighboring luma sample is available, the top-left neighboring luma sample may be padded from the top-most neighboring luma sample. 4) In one example, pD[m][n]=pY[x][n]. v. Alternatively, if a top-most neighboring luma sample is available and a left neighboring luma sample is available, then the top-left neighboring luma sample may be padded from the left neighboring luma sample. 5) In one example, pD[m][n] = pY[m][y]. vi. In one example, M=2, N=2, or M=3, N=3.
[0168] d. Alternatively, if the top-left neighboring luma samples are "unavailable", they may be replaced with a predefined value. i. In one example, this predefined value may be equal to a constant value (eg, 128). ii. In one example, the predefined value may be derived using the left and / or top-most neighboring luminance samples. 6) In one example, the predefined value may be equal to the average value of the left and / or top-most neighboring luminance samples. In one example, the predefined value may depend on the bit depth of the sample. For example, the predefined value may be equal to 1<(BD-1), where BD represents the bit depth of the sample.
[0169] e. Alternatively, even if the top-left neighboring luma sample is "available", the padding method described above in bullet 14.c and predefined values in bullet 14.d may be used to replace the available top-left neighboring luma sample. i. An example is shown in embodiment 11. f. In one example, whether to check the availability of the top-left neighboring luma sample may depend on whether the left neighboring luma sample is available and / or whether the above neighboring luma sample is available. In one example, check the availability of the top-left neighbor luma sample only if both the top-left neighbor luma sample and the above neighbor luma sample are available. An example is shown in embodiment 17.
[0170] g. In one example, how to use and / or pad the top-left neighboring luma sample may depend on the availability of top-left and / or left and / or top-most neighboring luma samples. i. In one example, the top-left neighboring luma sample may be used only if the top-left neighboring luma sample is available. ii. In one example, the top-left neighboring luma sample may be used only if top-left, left, and top neighboring luma samples are available. An example is shown in embodiment 18. iii. In one example, if left and / or top neighboring luma samples are available, the top-left neighboring luma sample may be padded. 1) In one example, the top-left neighboring luma sample may be padded only if the left or top neighboring luma sample is available and the top-left neighboring luma sample is not available. 2) In one example, the top-left neighboring luma sample may be padded only if the left or top neighboring luma sample is available and the top-left neighboring luma sample is not available. 3) In one example, the top-left neighboring luma sample may be padded with the neighboring luma sample above. The top-left neighboring luma sample pY[x][y] with x=-1,-2, y=-1,-2 is set equal to luma sample pY[0][y]. An example is shown in embodiment 18. 4) In one example, the top-left neighboring luma sample may be padded with the neighboring luma sample above. The top-left neighboring luma sample pY[x][y] with x=-1,-2, y=-1,-2 is set equal to luma sample pY[x][0]. An example is shown in embodiment 19. 5) In one example, the top-left neighboring luma sample may be padded with the top and left neighboring luma samples.
[0171] h. In one example, whether to check the availability of a top-left neighboring luma sample, and / or whether to use a top-left neighboring luma sample, and / or whether to pad the top-left neighboring luma sample may depend on the chroma color format. In one example, when a 4:4:4 color format is used, there is no need to check the availability of the top-left neighboring luma sample, and / or there is no need to use the top-left neighboring luma sample, and / or there is no need to pad the top-left neighboring luma sample. An example is shown in embodiment 20. i. In one example, whether to pad the top-left neighboring luma sample and / or which sample needs to be padded may depend on a variable or syntax element that indicates the chroma sample position that is not vertically shifted relative to the corresponding luma sample position, e.g., sps_chroma_vertical_collocated_flag in JVET-Q2001-vE. In one example, if sps_chroma_vertical_collocated_flag is equal to 1, then pad the top-left neighboring sample. Otherwise, the top-left neighboring sample is not padded. An example is shown in embodiment 14.
[0172] 16. During the process of CCLM, if the top-most (or / and left) neighboring luma sample is not available, it is proposed to use the top-most (or / and left-most) sample of the current block to derive the top-most (or / and left) neighboring luma sample, and the available left (and / or top) neighboring luma sample may be used to derive the top-left neighboring sample. In one example, if no above neighboring luma sample is available, the top-top and left neighboring luma samples of the current block may be used to derive the top-top and top-left neighboring luma samples. In one example, the top neighboring luma sample pY[x][y], for x=0..SubWidthC*nTbW-1, y=-1..-2, is set equal to the luma sample pY[x][0], and the top-left neighboring luma sample pY[x][y], for x=-1, y=-1..-2, is set equal to the luma sample pY[x][0], where pY[0][0] represents the top-left sample of the current block, nTbW represents the width of the current block, and SubWidthC is defined in 2.1. ii. In one example, the top neighbor sample pY[x][y], where x=0..SubWidthC*nTbW-1, y=-1..-N, is set equal to the luma sample pY[x][0]. And the top-left neighbor luma sample pY[x][y], where x=-M..-1, y=-1..-N, is set equal to the luma sample pY[x][0], where pY[0][0] represents the top-left sample of the current block, nTbW represents the width of the current block, and SubWidthC is defined in 2.1. An example is shown in embodiment 13. 1) In one example, M and N are integers, such as M=2 and N=3. 2) In one example, M may depend on the saturation color format, such as M=SubWidthC as defined in 2.1. 3) In one example, up to T top-left neighboring luma samples may be padded, where T is an integer such as 1. a) In one example, pY[-M][-1]=pY[-M][0], where M=1 or M=SubWidthC.
[0173] b. In one example, if the left neighboring luma sample is not available, the leftmost and topmost neighboring luma samples of the current block may be used to derive the left and top-left neighboring luma samples. In one example, the left neighboring luma sample pY[x][y], where x=0..-3, y=-1..SubHeightC*nTbH-1, is set equal to luma sample pY[0][y], and the top-left neighboring luma sample pY[x][y], where x=0..-3, y=-1, is set equal to luma sample pY[0][y], where pY[0][0] represents the top-left sample of the current block, nTbH represents the height of the current block, and SubHeightC is defined in 2.1. ii. In one example, the left neighboring luma sample pY[x][y], where x=-1..-M, y=0..SubHeightC*nTbH-1, is set equal to luma sample pY[0][y]. And the top-left neighboring luma sample pY[x][y], where x=-1..-M, y=-1..-N, is set equal to luma sample pY[0][y], where pY[0][0] represents the top-left sample of the current block, nTbH represents the height of the current block, and SubHeightC is defined in 2.1. An example is shown in embodiment 15. 1) In one example, M and N are integers, such as M=1, N=3. 2) In one example, N may depend on the saturation color format, such as N=SubHeightC as defined in 2.1. 3) In one example, up to T top-left neighboring luma samples may be padded, where T is an integer such as 1. a) In one example, pY[-1][-N]=pY[0][-N], where N=1 or N=SubHeightC. b) Or, T is equal to 2. pY[-1][-1]=pY[0][-1] and pY[-1][-2]=pY[0][-2]. iii. In one example, the top-left luma neighboring sample may be padded after derivation of the top-most luma neighboring sample. An example is shown in embodiment 16.
[0174] c. In one example, the top-left neighboring luma sample derived in bullet 13 may be used during the padding process of the top-most (or / and left) neighboring luma sample. d. In one example, whether the top (or left) neighboring luma (or chroma) sample is padded and / or which neighboring samples need to be padded may depend on the chroma color format. In one example, when a 4:4:4 color format is used, there is no need to pad the top (or / and left) neighboring luma sample. An example is shown in embodiment 21. e. In one example, when padding the top (or / and left) neighboring luma sample, the top-left neighboring luma sample is padded using a method such as 15.c. in 15. An example is shown in embodiment 22.
[0175] 17. In the CCLM prediction process, padding of the top-most neighbor sample, the left neighbor sample, and the top-left neighbor sample may be performed in a fixed order. The neighbor samples may be luma samples or chroma samples. For example, the order may be padding of the top neighboring sample, padding of the left neighboring sample, and padding of the top-left neighboring sample. b. For example, the order may be: padding of the left neighbor, padding of the top-most neighbor sample, and padding of the top-left neighbor sample. c. For example, the order may be top-left neighbor padding, top-most neighbor sample padding, and left neighbor sample padding. d. For example, the order may be top-left neighbor padding, left neighbor sample padding, and top-most neighbor sample padding.
[0176] 18. The downsampling process in CCLM for 4:2:2 color format video may be decoupled from the syntax element or variable (such as sps_chroma_vertical_collocated_flag in JVET-Q2001-vE) that indicates whether the chroma sample positions are vertically shifted relative to the corresponding luma sample positions. a. In one example, the process of downsampling may refer to downsampling the neighboring luma samples above, and / or downsampling the neighboring luma samples to the left, and / or downsampling samples in the current luma block. In one example, a fixed filter (such as a 3-tap horizontal filter with coefficients [1 / 4, 2 / 4, 1 / 4] or [2 / 8, 4 / 8, 2 / 8]) may be used during downsampling in CCLM for 4:2:2 color format video regardless of whether sps_chroma_vertical_collocated_flag is equal to 1 or 0. An example is shown in embodiment 27 and embodiment 28.
[0177] 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 as a default value, such as 0 or 1, for 4:2:2 and / or 4:4:4 color formats. If sps_chroma_vertical_collocated_flag is not present, it may be inferred to be equal to 1. b. If sps_chroma_vertical_collocated_flag is not present, it may be inferred to be equal to 0.
[0178] 20. A variable representing a neighboring luminance sample can be used in the processing of CCLM only if it is set equal to a valid value. An example is shown in embodiment 29 and embodiment 30. In one example, a variable representing the luma sample above the neighborhood may be set equal to the reconstructed luma sample before deblocking filtering. i. In one example, if the neighboring luma sample is available (e.g., in JVET-Q2001-vE, availT is equal to true), a variable representing the neighboring luma sample, denoted as pY[x][y], is set equal to the reconstructed luma sample before deblocking filtering at a position where (xTbY, yTbY) represents the top-left position of the current block. 1) In one example, x and y may be in the range of x=0..SubWidthC*max(numSampT,nTbW)-1, y=-1,-2, where nTbW denotes the width of the current block, SubWidthC is defined in 2.1, and numSampT denotes the number of available neighboring chroma samples above and to the right as defined in JVET-Q2001-vE. b. In one example, a variable representing the left neighboring luma sample may be set equal to the reconstructed luma sample before deblocking filtering. i. In one example, if a nearby left luma sample is available (e.g., in JVET-Q2001-vE, availT is equal to true), a variable representing the nearby left luma sample, denoted as pY[x][y], is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y), where (xTbY, yTbY) represents the top-left position of the current block. 1) In one example, x and y may be in the range of x=-1..-3, y=0..SubHeightC*max(numSampL,nTbH)-1, where nTbH is the width of the current block, and SubHeightC is defined in 2.1, and numSampL indicates the number of nearby chroma samples available on the left and bottom left, as defined in JVET-Q2001-vE.
[0179] 21. The slice type of a slice may depend on the slice's reference picture entries. In one example, if the number of reference picture entries in list 0 is equal to 0 and the number of reference picture entries in list 1 is equal to 0, then the slice type must be an I-slice. i. In one example, in this case, no slice type is signaled. b. In one example, if the number of reference picture entries in list 0 is greater than 0 and the number of reference picture entries in list 1 is equal to 0, then the slice type must be a P-slice. i. Alternatively, if the number of reference picture entries in list 0 is greater than 0 and the number of reference picture entries in list 1 is equal to 0, the slice type cannot be B-slice. ii. In one example, no slice type is signaled in this case. c. Reference picture entries for a slice may be signaled or inferred before the slice type is signaled or inferred. i. The reference picture entries for a slice may be signaled in the picture header associated with the picture.
[0180] 22. The total number of filters allowed in an APS or the total number of APSs may be limited based on coded information such as the number of sub-pictures. The total number of allowed filters for an APS may include the total number of ALFs (luma / chroma ALFs and CC-ALFs in the APS) of all APS NAL units that have a PU. b. The total number of allowed filters in an APS may include the total number of adaptive loop filter classes for the luma component (or luma ALF filters), the total number of alternative filters for the chroma component (chroma ALF filters), and / or the total number of chroma component filters in all APS NAL units with a PU. c. The APS is an ALF APS / scaled list APS / LMCS APS. d. The method of signaling the APS ID and / or the number of APSs used in a video unit depends on the limited number.
[0181] 23. Conforming bitstreams shall follow the rule that when BDPCM is enabled for a video unit (sequence / picture / slice / tile / brick / subpicture, etc.), sign data hiding is disabled. a. Alternatively, a conforming bitstream shall follow the rule that if sign data hiding is enabled for a video unit (sequence / picture / slice / tile / brick / subpicture, etc.), then BDPCM is disabled.
[0182] 24. Conforming bitstreams shall follow the rule that, for a video unit (sequence / picture / slice / tile / brick / subpicture, etc.), if a transform skip / coding tool that applies only the identity transform is in effect, then code data hiding shall be disabled. a. Alternatively, the adaptive bitstream shall follow the rule that when code data hiding is enabled for a video unit (sequence / picture / slice / tile / brick / subpicture, etc.), transform skipping / coding tools that apply only identity transforms shall be disabled.
[0183] 25. Conforming bitstreams shall follow the rule that when BDPCM is enabled for a video unit (sequence / picture / slice / tile / brick / subpicture, etc.), DQ (Dependent Quantization) is disabled. a. Alternatively, a conforming bitstream shall follow the rule that if DQ is enabled for a video unit (sequence / picture / slice / tile / brick / subpicture, etc.), then BDPCM is disabled.
[0184] 26. Conforming bitstreams shall follow the rule that, for a video unit (sequence / picture / slice / tile / brick / subpicture, etc.), if a transform skip / coding tool that applies only the identity transform is in effect, then DQ (Dependent Quantization) shall be disabled. a. Alternatively, a conforming bitstream shall follow the rule that when DQ is enabled for a video unit (sequence / picture / slice / tile / brick / subpicture, etc.), transform skipping / coding tools that only apply the identity transform shall be disabled.
[0185] 5. Embodiments This section presents example embodiments and how the current VVC standard is amended to account for these embodiments. Changes to the VVC specification are highlighted in bold and italic text. Deleted text is marked in double brackets (e.g., [[a]] means the deletion of the letter "a").
[0186] 5.1. First embodiment The working draft specified in JVET-P2001-v9 can be modified as follows:
[0187] 8.4.5.2.13 Specification of the INTRA_LT_CCLM, INTRA_L_CCLM, and INTRA_T_CCLM intra prediction modes …
[0188] 3. The downsampled and arranged luminance samples pDsY[x][y] for x=0..nTbW-1 and y=0..nTbH-1 are derived as follows: -If both SubWidthC and SubHeightC are equal to 1, the following applies: pDsY[x][y], where x=1..nTbW-1 and y=1..nTbH-1, is derived as follows: pDstY[x][y]=pY[x][y] (8-159) - If not, the following applies: The one-dimensional filter coefficient arrays F1 and F2 and the two-dimensional filter coefficient arrays F3 and F4 are defined as follows: F1[i]=1,i=0..1 (8-160) F2[0]=1,F2[1]=2,F2[2]=1 (8-161) F3[i][j]=F4[i][j]=0,i=0..2,j=0..2 (8-162) -If both SubWidthC and SubHeightC are equal to 2, the following applies: F1[0]=1, F1[1]=1 (8-163) F3[0][1]=1,F3[1][1]=4,F3[2][1]=1,F3[1][0]=1,F3[1][2]=1 (8-164) F4[0][1]=1,F4[1][1]=2,F4[2][1]=1 (8-165) F4[0][2]=1,F4[1][2]=2,F4[2][2]=1 (8-166) - If not, the following applies: F1[0]=2, F1[1]=0 (8-167) F3[1][1]=8 (8-168) F4[0][1]=2,F4[1][1]=4,F4[2][1]=2 (8-169) …
[0189] 5. If numSampT is greater than 0, the top chroma sample of the selected neighborhood pSelC[idx] is set equal to p[pickPost[idx-cntL][-1], where idx=cntL..cntL+cntT-1, and the top luma sample of the downsampled neighborhood pSelDsY[idx], for idx=0..cntL+cntT-1, is defined as follows: … - Otherwise (sps_cclm_colocated_chroma_flag is equal to 0), the following applies: If -x is greater than 0, the following applies: When -bCTUboundary is equal to FALSE, the following applies: pSelDsY[idx]=(F4[0][1]*pY[SubWidthC*x-1][[[-2]]-1]+ F4[0][2]*pY[SubWidthC*x-1][[[-1]]-2]+ F4[1][1]*pY[SubWidthC*x][[[-2]]-1]+ F4[1][2]*pY[SubWidthC*x][[[-1]]-2]+ F4[2][1]*pY[SubWidthC*x+1][[[-2]]-1]+ F4[2][2]*pY[SubWidthC*x+1][[[-1]]-2]+4)>>3 (8-193) - Otherwise (bCTUboundary is equal to TRUE), the following applies: pSelDsY[idx]=(F2[0]*pY[SubWidthC*x-1][-1]+ F2[1]*pY[SubWidthC*x][-1]+ F2[2]*pY[SubWidthC*x+1][-1]+2)>>2 (8-194) - Otherwise (x is equal to 0), the following applies: If -availTL is equal to TRUE and bCTUboundary is equal to FALSE, the following applies: pSelDsY[idx]=(F4[0][1]*pY[-1][[[-2]]-1]+F4[0][2]*pY[-1][[[-1]]-2]+F4[1][1]*pY[0][[[-2]]-1]+F4[1][2]*pY[0][[[-1]]-2]+ F4[2][1]*pY[1][[[-2]]-1]+F4[2][2]*pY[1][[[-1]]-2]+4)>>3 (8-195) - Else, if availTL is equal to TRUE and bCTUboundary is equal to TRUE, the following applies: pSelDsY[idx]=(F2[0]*pY[-1][-1]+F2[1]*pY[0][-1]+ F2[2]*pY[1][-1]+2)>>2 (8-196) - Else, if availTL is equal to FALSE and bCTUboundary is equal to FALSE, the following applies: pSelDsY[idx]=(F1[1]*pY[0][-2]+F1[0]*pY[0][-1]+1)>>1 (8-197) Otherwise (availTL is equal to FALSE and bCTUboundary is equal to TRUE), the following applies: pSelDsY[idx]=pY[0][-1] (8-198) …
[0190] 5.2. Embodiment 2 In this embodiment, an example of chroma transform skip flag coding according to the maximum allowed transform skip coded block size is given. The working draft specified in JVET-P2001-v9 can be modified as follows:
[0191] 7.3.9.10 Transformation Unit Syntax …
[0192] [Table 8]
[0193] …
[0194] 5.3. Third embodiment In this embodiment, an example of chroma transform skip flag coding according to the maximum allowed transform skip coded block size is given. The working draft specified in JVET-P2001-v9 can be modified as follows:
[0195] 7.3.9.5 Coding unit syntax …
[0196] [Table 9]
[0197] …
[0198] 5.4. Embodiment 4 The working draft specified in JVET-Q2001-vE can be modified as follows:
[0199] 8.4.5.2.13 The inputs to this process are: - intra prediction mode predModeIntra, - the sample position (xTbC, yTbC) of the top-left sample of the current transform block relative to the top-left sample of the current picture, - the variable nTbW, which defines the width of the transformation block; - the variable nTbH, which defines the height of the transformation block; - the variable cIdx, which defines the color components of the current block; -Let x=-1, y=0..2*nTbH-1 and x=0..2*nTbW-1, y=-1, and let p[x][y] be the saturation neighborhood sample.
[0200] The output of this process is the predicted samples preSamples[x][y], where x=0..nTbW-1, y=0..nTbH-1. The current luminance position (xTbY, yTbY) is derived as follows. (xTbY,yTbY)=(xTbC<<(SubWidthC-1),yTbC<<(SubHeightC-1)) (351) The variables availL, availT and availTL are derived as follows. - The derivation process for neighborhood block availability specified in Section 6.4.4 is invoked with the current luminance position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighborhood luminance position (xTbY-1, yTbY), checkPredModeY set equal to FALSE, and cIdx as input, and assigns the output to availL. - The derivation process for neighborhood block availability specified in Section 6.4.4 is invoked with the current luminance position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighborhood luminance position (xTbY, yTbY-1), checkPredModeY set equal to FALSE, and cIdx as input, and assigns the output to availT.
[0201] The variable availTL is derived as follows: availTL=availL&&availT (352) - The number of available top right neighbor chroma samples, numTopRight, is derived as follows: The variable numTopRight is set equal to 0 and availTR is set equal to TRUE. -If preModeIntra is equal to INTRA_T_CCLM, the following applies for x=nTbW..2*nTbW-1 until either availTR is equal to FALSE or x is equal to 2*nTbW-1: - The derivation process for neighborhood block availability specified in Section 6.4.4 is invoked with the current luminance position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighborhood luminance position (xTbY+x, yTbY-1), checkPredModeY set equal to FALSE, and cIdx as input, and assigns the output to availTR. If -availTR is equal to TRUE, numTopRight is increased by one. - The number of available bottom-left neighboring chroma samples, numLeftBelow, is derived as follows: The variable numLeftBelow is set equal to 0 and availLB is set equal to TRUE. - if preModeIntra is equal to INTRA_L_CCLM, the following applies for y=nTbH..2*nTbH-1 until either availLB is equal to FALSE or y is equal to 2*nTbH-1: - The derivation process for neighborhood block availability specified in Section 6.4.4 is invoked with the current luminance position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighborhood luminance position (xTbY-1, yTbY+y), checkPredModeY set equal to FALSE, and cIdx as input, and assigns the output to availLB. If -availLB is equal to TRUE, numLeftBelow is increased by one.
[0202] The number of available neighboring chroma samples in the top and top-right numSampT and the number of available neighboring chroma samples in the left and bottom-left numSampL are derived as follows: -If predModeIntra is equal to INTRA_LT_CCLM, the following applies: numSampT=availT?nTbW:0 (353) numSampL=availL?nTbH:0 (354) - If not, the following applies: numSampT=(availT&&predModeIntra==INTRA_T_CCLM)?(nTbW+Min(numTopRight,nTbH)):0 (355) numSampL=(availL&&predModeIntra==INTRA_L_CCLM)?(nTbH+Min(numLeftBelow,nTbW)):0 (356)
[0203] The variable bCTUboundary is derived as follows. bCTUboundary=(yTbY&(CtbSizeY-1)==0)?TRUE:FALSE (357) The variable cntN and the array pickPosN in which N is replaced with L and T are derived as follows. The variable numIs4N is derived as follows: numIs4N=((availT&&availL&&predModeIntra==INTRA_LT_CCLM)?0:1) (358) - The variable startPosN is set equal to numSampN>(2+numIs4N). - The variable pickStepN is set equal to Max(1,numSampN>(1+numIs4N)). If -availN is equal to TRUE and preModeIntra is equal to INTRA_LT_CCLM or INTRA_N_CCLM, the following allocations are made: -cntN is set equal to Min(numSampN, (1+numIs4N)<<1). -pospickPosN[pos] is set equal to (startPosN+pos*pospickStepN), where pos=0..cntN-1. Otherwise, cntN is set equal to 0.
[0204] The predicted samples predSamples[x][y], where x=0..nTbW-1 and y=0..nTbH-1, are derived as follows: If both -numSampL and numSampT are equal to 0, the following applies: predSamples[x][y]=1<<(BitDepth-1) (359) - Otherwise, the following ordered steps apply: 1. The co-located luma sample pY[x][y], where x=0..nTbW*SubWidthC-1, y=0..nTbH*SubHeightC-1, is set equal to the pre-deblocking filtered reconstructed luma sample at position (xTbY+x, yTbY+y). 2. The neighboring luminance samples pY[x][y] are derived as follows: If -numSampL is greater than 0, the nearby left luma sample pY[x][y], for x=-1..-3, y=0..SubHeightC*numSampL-1, is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y). If -availT is equal to FALSE, the top-most luma sample pY[x][y] in the neighborhood with x=-1..SubWidthC*numSampT-1, y=-1..-2 is set equal to the luma sample pY[x][0]. If -availL is equal to FALSE, the left neighbor luma sample pY[x][y] for x=-1..-3, y=-1..SubHeightC*numSampL-1 is set equal to luma sample pY[0][y]. If -numSampT is greater than 0, the top-most luma sample pY[x][y] in the neighborhood with x=0..SubWidthC*numSampT-1, y=-1,-2 is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y). When -availTL is equal to TRUE, the top-left nearby luma sample pY[x][y] at x=-1, y=-1,-2 is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y).
[0205] 3. The downsampled and arranged luminance samples pDsY[x][y] for x=0..nTbW-1, y=0..nTbH-1 are derived as follows: -If both SubWidthC and SubHeightC are equal to 1, the following applies: pDsY[x][y], where x=1..nTbW-1 and y=1..nTbH-1, is derived as follows: pDstY[x][y]=pY[x][y] (360) - If not, the following applies: The one-dimensional filter coefficient arrays F1 and F2 and the two-dimensional filter coefficient arrays F3 and F4 are defined as follows: F1[0]=2, F1[1]=0 (361) F2[0]=1, F2[1]=2, F2[2]=1 (362) F3[i][j]=F4[i][j]=0,i=0..2,j=0..2 (363) -If both SubWidthC and SubHeightC are equal to 2, the following applies: F1[0]=1, F1[1]=1 (364) F3[0][1]=1,F3[1][1]=4,F3[2][1]=1,F3[1][0]=1,F3[1][2]=1 (365) F4[0][1]=1,F4[1][1]=2,F4[2][1]=1 (366) F4[0][2]=1,F4[1][2]=2,F4[2][2]=1 (367) - If not, the following applies: F3[1][1]=8 (368) F4[0][1]=2,F4[1][1]=4,F4[2][1]=2 (369)
[0206] - when sps_chroma_vertical_collocated_flag is equal to 1, the following applies: pDsY[x][y], where x=1..nTbW-1 and y=1..nTbH-1, is derived as follows: pDsY[x][y]=(F3[1][0]*pY[SubWidthC*x][SubHeightC*y-1]+ F3[0][1]*pY[SubWidthC*x-1][SubHeightC*y]+ F3[1][1]*pY[SubWidthC*x][SubHeightC*y]+ F3[2][1]*pY[SubWidthC*x+1][SubHeightC*y]+ F3[1][2]*pY[SubWidthC*x][SubHeightC*y+1]+4)>>3 (370) - Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies: pDsY[x][y], where x=1..nTbW-1 and y=1..nTbH-1, is derived as follows: pDsY[x][y]=(F4[0][1]*pY[SubWidthC*x-1][SubHeightC*y]+ F4[0][2]*pY[SubWidthC*x-1][SubHeightC*y+1]+ F4[1][1]*pY[SubWidthC*x][SubHeightC*y]+ F4[1][2]*pY[SubWidthC*x][SubHeightC*y+1]+ F4[2][1]*pY[SubWidthC*x+1][SubHeightC*y]+ F4[2][2]*pY[SubWidthC*x+1][SubHeightC*y+1]+4)>>3 (371)
[0207] [[4. If numSampL is greater than 0, the selected neighboring left chroma sample pSelC[idx] is set equal to p[-1][pickPosL[idx]], for idx=0..cntL-1, and the selected downsampled neighboring left luma sample pSelDsY[idx], for idx=0..cntL-1, is derived as follows: - The variable y is set equal to pickPosL[idx]. -If both SubWidthC and SubHeightC are equal to 1, the following applies: pSelDsY[idx]=pY[-1][y] (372) - If not, the following applies: - when sps_chroma_vertical_collocated_flag is equal to 1, the following applies: pSelDsY[idx]=(F3[1][0]*pY[-SubWidthC][SubHeightC*y-1]+ F3[0][1]*pY[-1-SubWidthC][SubHeightC*y]+ F3[1][1]*pY[-SubWidthC][SubHeightC*y]+ F3[2][1]*pY[1-SubWidthC][SubHeightC*y]+ F3[1][2]*pY[-SubWidthC][SubHeightC*y+1]+4)>>3 (373) - Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies: pSelDsY[idx]=(F4[0][1]*pY[-1-SubWidthC][SubHeightC*y]+ F4[0][2]*pY[-1-SubWidthC][SubHeightC*y+1]+ F4[1][1]*pY[-SubWidthC][SubHeightC*y]+ F4[1][2]*pY[-SubWidthC][SubHeightC*y+1]+ F4[2][1]*pY[1-SubWidthC][SubHeightC*y]+ F4[2][2]*pY[1-SubWidthC][SubHeightC*y+1]+4)>>3 (374)
[0208] 5. If numSampT is greater than 0, the top chroma sample of the selected neighborhood pSelC[idx] is set equal to p[pickPost[idx-cntL][-1], where idx=cntL..cntL+cntT-1, and the top luma sample of the downsampled neighborhood pSelDsY[idx], where idx=0..cntL+cntT-1, is defined as follows: - The variable x is set equal to pickPost[idx-cntL]. -If both SubWidthC and SubHeightC are equal to 1, the following applies: pSelDsY[idx]=pY[x][-1] (375) - If not, the following applies: - when sps_chroma_vertical_collocated_flag is equal to 1, the following applies: When -bCTUboundary is equal to FALSE, the following applies: pSelDsY[idx]=(F3[1][0]*pY[SubWidthC*x][-1-SubHeightC]+ F3[0][1]*pY[SubWidthC*x-1][-SubHeightC]+ F3[1][1]*pY[SubWidthC*x][-SubHeightC]+ F3[2][1]*pY[SubWidthC*x+1][-SubHeightC]+ F3[1][2]*pY[SubWidthC*x][1-SubHeightC]+4)>>3 (376) - Otherwise (bCTUboundary is equal to TRUE), the following applies: pSelDsY[idx]=(F2[0]*pY[SubWidthC*x-1][-1]+ F2[1]*pY[SubWidthC*x][-1]+ F2[2]*pY[SubWidthC*x+1][-1]+2)>>2 (377) - Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies: When -bCTUboundary is equal to FALSE, the following applies: pSelDsY[idx]=(F4[0][1]*pY[SubWidthCx-1][-1]+ F4[0][2]*pY[SubWidthC*x-1][-2]+ F4[1][1]*pY[SubWidthC*x][-1]+ F4[1][2]*pY[SubWidthC*x][-2]+ F4[2][1]*pY[SubWidthC*x+1][-1]+ F4[2][2]*pY[SubWidthC*x+1][-2]+4)>>3 (378) - Otherwise (bCTUboundary is equal to TRUE), the following applies: pSelDsY[idx]=(F2[0]*pY[SubWidthC*x-1][-1]+ F2[1]*pY[SubWidthC*x][-1]+ F2[2]*pY[SubWidthC*x+1][-1]+2)>>2 (379)]]
[0209] [ka]
[0210] [ka]
[0211] [ka]
[0212] [ka]
[0213] 6. If cntT + cntL is not equal to 0, then the variables minY, maxY, minC, and maxC are derived as follows: If -cntT+cntL is equal to 2, then in Comp substituted for DsY and C, pSelComp[3] is set equal to pSelComp[0], pSelComp[2] is set equal to pSelComp[1], pSelComp[0] is set equal to pSelComp[1], and pSelComp[1] is set equal to pSelComp[3]. - The arrays minGrpIdx and maxGrpIdx are derived as follows: minGrpIdx[0]=0 (380) minGrpIdx[1]=2 (381) maxGrpIdx[0]=1 (382) maxGrpIdx[1]=3 (383) - If pSelDsY[minGrpIdx[0]] is greater than pSelDsY[minGrpIdx[1], minGrpIdx[0] and minGrpIdx[1] are swapped as follows: (minGrpIdx[0],minGrpIdx[1])=Swap(minGrpIdx[0],minGrpIdx[1]) (384) - If pSelDsY[maxGrpIdx[0]] is greater than pSelDsY[maxGrpIdx[1], maxGrpIdx[0] and maxGrpIdx[1] are swapped as follows: (maxGrpIdx[0],maxGrpIdx[1])=Swap(maxGrpIdx[0],maxGrpIdx[1]) (385) - If pSelDsY[minGrpIdx[0]] is greater than pSelDsY[maxGrpIdx[1], the arrays minGrpIdx and maxGrpIdx are swapped as follows: (minGrpIdx,maxGrpIdx)=Swap(minGrpIdx,maxGrpIdx) (386) - If pSelDsY[minGrpIdx[1]] is greater than pSelDsY[maxGrpIdx[0], minGrpIdx[1] and maxGrpIdx[0] are swapped as follows: (minGrpIdx[1],maxGrpIdx[0])=Swap(minGrpIdx[1],maxGrpIdx[0]) (387) The variables maxY, maxC, minY and minC are derived as follows: maxY=(pSelDsY[maxGrpIdx[0]]+pSelDsY[maxGrpIdx[1]]+1)>>1 (388) maxC=(pSelC[maxGrpIdx[0]]+pSelC[maxGrpIdx[1]]+1)>>1 (389) minY=(pSelDsY[minGrpIdx[0]]+pSelDsY[minGrpIdx[1]]+1)>>1 (390) minC=(pSelC[minGrpIdx[0]]+pSelC[minGrpIdx[1]]+1)>>1 (391)
[0214] 7. The variables a, b, and k are derived as follows: If -numSampL is equal to 0 and numSampT is equal to 0, the following applies: k=0 (392) a=0 (393) b=1<<(BitDepth-1) (394) - If not, the following applies: diff=maxY-minY (395) If -diff is not equal to 0, the following applies: diffC=maxC-minC (396) x=Floor(Log2(diff)) (397) normDiff=((diff<<4)>>x)&15 (398) x+=(normDiff!=0)?1:0 (399) y=Abs(diffC)>0?Floor(Log2(Abs(diffC)))+1:0 (400) a=(diffC*(divSigTable[normDiff]|8)+2 y-1 )>>y (401) k=((3+xy)<1)?1:3+xy (402) a=((3+xy)<1)? Sign(a)*15:a (403) b=minC-((a*minY)>>k) (404) Here, divSigTable[] is defined as follows: divSigTable[]={0,7,6,5,5,4,4,3,3,2,2,1,1,1,1,0} (405) - Otherwise (diff is equal to 0), the following applies: k=0 (406) a=0 (407) b=minC (408)
[0215] 8. The predicted samples predSamples[x][y], where x=0..nTbW-1 and y=0..nTbH-1, are derived as follows: predSamples[x][y]=Clip1(((pDsY[x][y]*a)>>k)+b) (409) NOTE - This process uses the sps_chroma_vertical_collocated_flag, but for simplicity of implementation, does not use the sps_chroma_horizontal_collocated_flag.
[0216] 5.5. Embodiment 5 The working draft specified in JVET-Q2001-vE can be modified as follows:
[0217] 8.4.5.2.13 The inputs to this process are: - intra prediction mode predModeIntra, - the sample position (xTbC, yTbC) of the top-left sample of the current transform block relative to the top-left sample of the current picture, - the variable nTbW, which defines the width of the transformation block; - the variable nTbH, which defines the height of the transformation block; - the variable cIdx, which defines the color components of the current block; -Let x=-1, y=0..2*nTbH-1 and x=0..2*nTbW-1, y=-1, and let p[x][y] be the saturation neighborhood sample.
[0218] The output of this process is the predicted samples preSamples[x][y], where x=0..nTbW-1, y=0..nTbH-1. The current luminance position (xTbY, yTbY) is derived as follows. (xTbY,yTbY)=(xTbC<<(SubWidthC-1),yTbC<<(SubHeightC-1)) (351) The variables availL, availT and availTL are derived as follows. - The derivation process for neighborhood block availability specified in Section 6.4.4 is invoked with the current luminance position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighborhood luminance position (xTbY-1, yTbY), checkPredModeY set equal to FALSE, and cIdx as input, and assigns the output to availL. - The derivation process for neighborhood block availability specified in Section 6.4.4 is invoked with the current luminance position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighborhood luminance position (xTbY, yTbY-1), checkPredModeY set equal to FALSE, and cIdx as input, and assigns the output to availT.
[0219] The variable availTL is derived as follows: availTL=availL&&availT (352) - The number of available top right neighbor chroma samples, numTopRight, is derived as follows: The variable numTopRight is set equal to 0 and availTR is set equal to TRUE. -If preModeIntra is equal to INTRA_T_CCLM, the following applies for x=nTbW..2*nTbW-1 until either availTR is equal to FALSE or x is equal to 2*nTbW-1: - The derivation process for neighborhood block availability specified in Section 6.4.4 is invoked with the current luminance position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighborhood luminance position (xTbY+x, yTbY-1), checkPredModeY set equal to FALSE, and cIdx as input, and assigns the output to availTR. If -availTR is equal to TRUE, numTopRight is increased by one. - The number of available bottom-left neighboring chroma samples, numLeftBelow, is derived as follows: The variable numLeftBelow is set equal to 0 and availLB is set equal to TRUE. - if preModeIntra is equal to INTRA_L_CCLM, the following applies for y=nTbH..2*nTbH-1 until either availLB is equal to FALSE or y is equal to 2*nTbH-1: - The derivation process for neighborhood block availability specified in Section 6.4.4 is invoked with the current luminance position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighborhood luminance position (xTbY-1, yTbY+y), checkPredModeY set equal to FALSE, and cIdx as input, and assigns the output to availLB. If -availLB is equal to TRUE, numLeftBelow is increased by one.
[0220] The number of available neighboring chroma samples in the top and top-right numSampT and the number of available neighboring chroma samples in the left and bottom-left numSampL are derived as follows: -If predModeIntra is equal to INTRA_LT_CCLM, the following applies: numSampT=availT?nTbW:0 (353) numSampL=availL?nTbH:0 (354) - If not, the following applies: numSampT=(availT&&predModeIntra==INTRA_T_CCLM)?(nTbW+Min(numTopRight,nTbH)):0 (355) numSampL=(availL&&predModeIntra==INTRA_L_CCLM)?(nTbH+Min(numLeftBelow,nTbW)):0 (356)
[0221] The variable bCTUboundary is derived as follows. bCTUboundary=(yTbY&(CtbSizeY-1)==0)?TRUE:FALSE (357) The variable cntN and the array pickPosN in which N is replaced with L and T are derived as follows. The variable numIs4N is derived as follows: numIs4N=((availT&&availL&&predModeIntra==INTRA_LT_CCLM)?0:1) (358) - The variable startPosN is set equal to numSampN>(2+numIs4N). - The variable pickStepN is set equal to Max(1,numSampN>(1+numIs4N)). If -availN is equal to TRUE and preModeIntra is equal to INTRA_LT_CCLM or INTRA_N_CCLM, the following allocations are made: -cntN is set equal to Min(numSampN, (1+numIs4N)<<1). -pospickPosN[pos] is set equal to (startPosN+pos*pospickStepN), where pos=0..cntN-1. Otherwise, cntN is set equal to 0.
[0222] The predicted samples predSamples[x][y], where x=0..nTbW-1 and y=0..nTbH-1, are derived as follows: If both -numSampL and numSampT are equal to 0, the following applies: predSamples[x][y]=1<<(BitDepth-1) (359) - Otherwise, the following ordered steps apply: 1. The co-located luma sample pY[x][y], where x=0..nTbW*SubWidthC-1, y=0..nTbH*SubHeightC-1, is set equal to the pre-deblocking filtered reconstructed luma sample at position (xTbY+x, yTbY+y). 2. The neighboring luminance samples pY[x][y] are derived as follows: If -numSampL is greater than 0, the nearby left luma sample pY[x][y], for x=-1..-3, y=0..SubHeightC*numSampL-1, is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y). If -availT is equal to FALSE, the top-most luma sample pY[x][y] in the neighborhood with x=-1..SubWidthC*numSampT-1, y=-1..-2 is set equal to the luma sample pY[x][0]. If -availL is equal to FALSE, the left neighbor luma sample pY[x][y] for x=-1..-3, y=-1..SubHeightC*numSampL-1 is set equal to luma sample pY[0][y]. If -numSampT is greater than 0, the top-most luma sample pY[x][y] in the neighborhood with x=0..SubWidthC*numSampT-1, y=-1,-2 is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y). When -availTL is equal to TRUE, the top-left nearby luma sample pY[x][y] at x=-1, y=-1,-2 is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y).
[0223] 3. The downsampled and arranged luminance samples pDsY[x][y] for x=0..nTbW-1 and y=0..nTbH-1 are derived as follows: -If both SubWidthC and SubHeightC are equal to 1, the following applies: pDsY[x][y], where x=1..nTbW-1 and y=1..nTbH-1, is derived as follows: pDstY[x][y]=pY[x][y] (360) - If not, the following applies: The one-dimensional filter coefficient arrays F1 and F2 and the two-dimensional filter coefficient arrays F3 and F4 are defined as follows: F1[0]=2, F1[1]=0 (361) F2[0]=1, F2[1]=2, F2[2]=1 (362) F3[i][j]=F4[i][j]=0,i=0..2,j=0..2 (363) -If both SubWidthC and SubHeightC are equal to 2, the following applies: F1[0]=1, F1[1]=1 (364) F3[0][1]=1,F3[1][1]=4,F3[2][1]=1,F3[1][0]=1,F3[1][2]=1 (365) F4[0][1]=1,F4[1][1]=2,F4[2][1]=1 (366) F4[0][2]=1,F4[1][2]=2,F4[2][2]=1 (367)
[0224] - If not, the following applies: F3[1][1]=8 (368) F4[0][1]=2,F4[1][1]=4,F4[2][1]=2 (369) - when sps_chroma_vertical_collocated_flag is equal to 1, the following applies: pDsY[x][y], where x=1..nTbW-1 and y=1..nTbH-1, is derived as follows: pDsY[x][y]=(F3[1][0]*pY[SubWidthC*x][SubHeightC*y-1]+ F3[0][1]*pY[SubWidthC*x-1][SubHeightC*y]+ F3[1][1]*pY[SubWidthC*x][SubHeightC*y]+ F3[2][1]*pY[SubWidthC*x+1][SubHeightC*y]+ F3[1][2]*pY[SubWidthC*x][SubHeightC*y+1]+4)>>3 (370) - Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies: pDsY[x][y], where x=1..nTbW-1 and y=1..nTbH-1, is derived as follows: pDsY[x][y]=(F4[0][1]*pY[SubWidthC*x-1][SubHeightC*y]+ F4[0][2]*pY[SubWidthC*x-1][SubHeightC*y+1]+ F4[1][1]*pY[SubWidthC*x][SubHeightC*y]+ F4[1][2]*pY[SubWidthC*x][SubHeightC*y+1]+ F4[2][1]*pY[SubWidthC*x+1][SubHeightC*y]+ F4[2][2]*pY[SubWidthC*x+1][SubHeightC*y+1]+4)>>3 (371)
[0225] 4. If numSampL is greater than 0, the selected neighboring left chroma sample pSelC[idx] is set equal to p[-1][pickPosL[idx]], idx=0..cntL-1, and the selected downsampled neighboring left luma sample pSelDsY[idx], idx=0..cntL-1, is derived as follows: - The variable y is set equal to pickPosL[idx]. -If both SubWidthC and SubHeightC are equal to 1, the following applies: pSelDsY[idx]=pY[-1][y] (372) - If not, the following applies: - when sps_chroma_vertical_collocated_flag is equal to 1, the following applies: pSelDsY[idx]=(F3[1][0]*pY[-SubWidthC][SubHeightC*y-1]+ F3[0][1]*pY[-1-SubWidthC][SubHeightC*y]+ F3[1][1]*pY[-SubWidthC][SubHeightC*y]+ F3[2][1]*pY[1-SubWidthC][SubHeightC*y]+ F3[1][2]*pY[-SubWidthC][SubHeightC*y+1]+4)>>3 (373) - Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies: pSelDsY[idx]=(F4[0][1]*pY[-1-SubWidthC][SubHeightC*y]+ F4[0][2]*pY[-1-SubWidthC][SubHeightC*y+1]+ F4[1][1]*pY[-SubWidthC][SubHeightC*y]+ F4[1][2]*pY[-SubWidthC][SubHeightC*y+1]+ F4[2][1]*pY[1-SubWidthC][SubHeightC*y]+ F4[2][2]*pY[1-SubWidthC][SubHeightC*y+1]+4)>>3 (374)
[0226] 5. If numSampT is greater than 0, the top chroma sample pSelC[idx] of the selected neighborhood is set equal to p[pickPost[idx-cntL][-1], where idx=cntL..cntL+cntT-1, and the top luma sample pSelDsY[idx] of the downsampled neighborhood, where idx=[[0]]cntL..cntL+cntT-1, is defined as follows: - The variable x is set equal to pickPost[idx-cntL]. -If both SubWidthC and SubHeightC are equal to 1, the following applies: pSelDsY[idx]=pY[x][-1] (375) - If not, the following applies: - when sps_chroma_vertical_collocated_flag is equal to 1, the following applies: When -bCTUboundary is equal to FALSE, the following applies: pSelDsY[idx]=(F3[1][0]*pY[SubWidthC*x][-1-SubHeightC]+ F3[0][1]*pY[SubWidthC*x-1][-SubHeightC]+ F3[1][1]*pY[SubWidthC*x][-SubHeightC]+ F3[2][1]*pY[SubWidthC*x+1][-SubHeightC]+ F3[1][2]*pY[SubWidthC*x][1-SubHeightC]+4)>>3 (376) - Otherwise (bCTUboundary is equal to TRUE), the following applies: pSelDsY[idx]=(F2[0]*pY[SubWidthC*x-1][-1]+ F2[1]*pY[SubWidthC*x][-1]+ F2[2]*pY[SubWidthC*x+1][-1]+2)>>2 (377)
[0227] - Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies: When -bCTUboundary is equal to FALSE, the following applies: pSelDsY[idx]=(F4[0][1]*pY[SubWidthCx-1][-1]+ F4[0][2]*pY[SubWidthC*x-1][-2]+ F4[1][1]*pY[SubWidthC*x][-1]+ F4[1][2]*pY[SubWidthC*x][-2]+ F4[2][1]*pY[SubWidthC*x+1][-1]+ F4[2][2]*pY[SubWidthC*x+1][-2]+4)>>3 (378) - Otherwise (bCTUboundary is equal to TRUE), the following applies: pSelDsY[idx]=(F2[0]*pY[SubWidthC*x-1][-1]+ F2[1]*pY[SubWidthC*x][-1]+ F2[2]*pY[SubWidthC*x+1][-1]+2)>>2 (379)
[0228] 6. If cntT+cntL is not equal to 0, then the variables minY, maxY, minC, and maxC are derived as follows: If -cntT+cntL is equal to 2, then in Comp substituted for DsY and C, pSelComp[3] is set equal to pSelComp[0], pSelComp[2] is set equal to pSelComp[1], pSelComp[0] is set equal to pSelComp[1], and pSelComp[1] is set equal to pSelComp[3]. - The arrays minGrpIdx and maxGrpIdx are derived as follows: minGrpIdx[0]=0 (380) minGrpIdx[1]=2 (381) maxGrpIdx[0]=1 (382) maxGrpIdx[1]=3 (383) - If pSelDsY[minGrpIdx[0]] is greater than pSelDsY[minGrpIdx[1], minGrpIdx[0] and minGrpIdx[1] are swapped as follows: (minGrpIdx[0],minGrpIdx[1])=Swap(minGrpIdx[0],minGrpIdx[1]) (384) - If pSelDsY[maxGrpIdx[0]] is greater than pSelDsY[maxGrpIdx[1], maxGrpIdx[0] and maxGrpIdx[1] are swapped as follows: (maxGrpIdx[0],maxGrpIdx[1])=Swap(maxGrpIdx[0],maxGrpIdx[1]) (385) - If pSelDsY[minGrpIdx[0]] is greater than pSelDsY[maxGrpIdx[1], the arrays minGrpIdx and maxGrpIdx are swapped as follows: (minGrpIdx,maxGrpIdx)=Swap(minGrpIdx,maxGrpIdx) (386) - If pSelDsY[minGrpIdx[1]] is greater than pSelDsY[maxGrpIdx[0], minGrpIdx[1] and maxGrpIdx[0] are swapped as follows: (minGrpIdx[1],maxGrpIdx[0])=Swap(minGrpIdx[1],maxGrpIdx[0]) (387) The variables maxY, maxC, minY and minC are derived as follows: maxY=(pSelDsY[maxGrpIdx[0]]+pSelDsY[maxGrpIdx[1]]+1)>>1 (388) maxC=(pSelC[maxGrpIdx[0]]+pSelC[maxGrpIdx[1]]+1)>>1 (389) minY=(pSelDsY[minGrpIdx[0]]+pSelDsY[minGrpIdx[1]]+1)>>1 (390) minC=(pSelC[minGrpIdx[0]]+pSelC[minGrpIdx[1]]+1)>>1 (391)
[0229] 7. The variables a, b, and k are derived as follows: If -numSampL is equal to 0 and numSampT is equal to 0, the following applies: k=0 (392) a=0 (393) b=1<<(BitDepth-1) (394) - If not, the following applies: diff=maxY-minY (395) If -diff is not equal to 0, the following applies: diffC=maxC-minC (396) x=Floor(Log2(diff)) (397) normDiff=((diff<<4)>>x)&15 (398) x+=(normDiff!=0)?1:0 (399) y=Abs(diffC)>0?Floor(Log2(Abs(diffC)))+1:0 (400) a=(diffC*(divSigTable[normDiff]|8)+2 y-1 )>>y (401) k=((3+xy)<1)?1:3+xy (402) a=((3+xy)<1)?Sign(a)*15:a (403) b=minC-((a*minY)>>k) (404) Here, divSigTable[] is defined as follows: divSigTable[]={0,7,6,5,5,4,4,3,3,2,2,1,1,1,1,0} (405) - Otherwise (diff is equal to 0), the following applies: k=0 (406) a=0 (407) b=minC (408)
[0230] 8. The predicted samples predSamples[x][y], where x=0..nTbW-1 and y=0..nTbH-1, are derived as follows: predSamples[x][y]=Clip1(((pDsY[x][y]*a)>>k)+b) (409) NOTE - This process uses the sps_chroma_vertical_collocated_flag, but for simplicity of implementation, does not use the sps_chroma_horizontal_collocated_flag.
[0231] 5.6. Embodiment 6 The working draft specified in JVET-Q2001-vE can be modified as follows:
[0232] 8.4.5.2.13 The inputs to this process are: - intra prediction mode predModeIntra, - the sample position (xTbC, yTbC) of the top-left sample of the current transform block relative to the top-left sample of the current picture, - the variable nTbW, which defines the width of the transformation block; - the variable nTbH, which defines the height of the transformation block; - the variable cIdx, which defines the color components of the current block; -Let x=-1, y=0..2*nTbH-1 and x=0..2*nTbW-1, y=-1, and let p[x][y] be the saturation neighborhood sample. The output of this process are the predicted samples preSamples[x][y], where x=0..nTbW-1, y=0..nTbH-1. The current luminance position (xTbY, yTbY) is derived as follows. (xTbY,yTbY)=(xTbC<<(SubWidthC-1),yTbC<<(SubHeightC-1)) (351)
[0233] The variables availL, availT and availTL are derived as follows. - The derivation process for neighborhood block availability specified in Section 6.4.4 is invoked with the current luminance position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighborhood luminance position (xTbY-1, yTbY), checkPredModeY set equal to FALSE, and cIdx as input, and assigns the output to availL. - The derivation process for neighborhood block availability specified in Section 6.4.4 is invoked with the current luminance position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighborhood luminance position (xTbY, yTbY-1), checkPredModeY set equal to FALSE, and cIdx as input, and assigns the output to availT.
[0234] The variable availTL is derived as follows: availTL=availL&&availT (352) - The number of available top right neighbor chroma samples, numTopRight, is derived as follows: The variable numTopRight is set equal to 0 and availTR is set equal to TRUE. -If preModeIntra is equal to INTRA_T_CCLM, the following applies for x=nTbW..2*nTbW-1 until either availTR is equal to FALSE or x is equal to 2*nTbW-1: - The derivation process for neighborhood block availability specified in Section 6.4.4 is invoked with the current luminance position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighborhood luminance position (xTbY+x, yTbY-1), checkPredModeY set equal to FALSE, and cIdx as input, and assigns the output to availTR. If -availTR is equal to TRUE, numTopRight is increased by one.
[0235] - The number of available bottom-left neighboring chroma samples, numLeftBelow, is derived as follows: The variable numLeftBelow is set equal to 0 and availLB is set equal to TRUE. - if preModeIntra is equal to INTRA_L_CCLM, the following applies for y=nTbH..2*nTbH-1 until either availLB is equal to FALSE or y is equal to 2*nTbH-1: - The derivation process for neighborhood block availability specified in Section 6.4.4 is invoked with the current luminance position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighborhood luminance position (xTbY-1, yTbY+y), checkPredModeY set equal to FALSE, and cIdx as input, and assigns the output to availLB. If -availLB is equal to TRUE, numLeftBelow is increased by one.
[0236] The number of available neighboring chroma samples in the top and top-right numSampT and the number of available neighboring chroma samples in the left and bottom-left numSampL are derived as follows: -If predModeIntra is equal to INTRA_LT_CCLM, the following applies: numSampT=availT?nTbW:0 (353) numSampL=availL?nTbH:0 (354) - If not, the following applies: numSampT=(availT&&predModeIntra==INTRA_T_CCLM)?(nTbW+Min(numTopRight,nTbH)):0 (355) numSampL=(availL&&predModeIntra==INTRA_L_CCLM)?(nTbH+Min(numLeftBelow,nTbW)):0 (356)
[0237] The variable bCTUboundary is derived as follows. bCTUboundary=(yTbY&(CtbSizeY-1)==0)?TRUE:FALSE (357) The variable cntN and the array pickPosN in which N is replaced with L and T are derived as follows. The variable numIs4N is derived as follows: numIs4N=((availT&&availL&&predModeIntra==INTRA_LT_CCLM)?0:1) (358) - The variable startPosN is set equal to numSampN>(2+numIs4N). - The variable pickStepN is set equal to Max(1,numSampN>(1+numIs4N)). If -availN is equal to TRUE and preModeIntra is equal to INTRA_LT_CCLM or INTRA_N_CCLM, the following allocations are made: -cntN is set equal to Min(numSampN, (1+numIs4N)<<1). -pospickPosN[pos] is set equal to (startPosN+pos*pospickStepN), where pos=0..cntN-1. Otherwise, cntN is set equal to 0.
[0238] The predicted samples predSamples[x][y], where x=0..nTbW-1 and y=0..nTbH-1, are derived as follows: If both -numSampL and numSampT are equal to 0, the following applies: predSamples[x][y]=1<<(BitDepth-1) (359) - Otherwise, the following ordered steps apply: 1. The co-located luma sample pY[x][y], where x=0..nTbW*SubWidthC-1, y=0..nTbH*SubHeightC-1, is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y).
[0239] 2. The neighboring luminance samples pY[x][y] are derived as follows: If -numSampL is greater than 0, the nearby left luma sample pY[x][y], for x=-1..-3, y=0..SubHeightC*numSampL-1, is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y). If -availT is equal to FALSE, the top-most luma sample pY[x][y] in the neighborhood with x=-1..SubWidthC*numSampT-1, y=-1..-2 is set equal to luma sample pY[x][0]. If -availL is equal to FALSE, the left neighbor luma sample pY[x][y] for x=-1..-3, y=-1..SubHeightC*numSampL-1 is set equal to luma sample pY[0][y]. If -numSampT is greater than 0, the luma sample pY[x][y] above the neighborhood with x=0..SubWidthC*numSampT-1, y=-1,-[[2]]3 is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y). When -availTL is equal to TRUE, the top-left nearby luma sample pY[x][y], where x=-1, y=-1,-2,-3, is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y).
[0240] 3. The downsampled and arranged luminance samples pDsY[x][y] for x=0..nTbW-1 and y=0..nTbH-1 are derived as follows: -If both SubWidthC and SubHeightC are equal to 1, the following applies: pDsY[x][y], where x=1..nTbW-1 and y=1..nTbH-1, is derived as follows: pDstY[x][y]=pY[x][y] (360) - If not, the following applies: The one-dimensional filter coefficient arrays F1 and F2 and the two-dimensional filter coefficient arrays F3 and F4 are defined as follows: F1[0]=2, F1[1]=0 (361) F2[0]=1, F2[1]=2, F2[2]=1 (362) F3[i][j]=F4[i][j]=0,i=0..2,j=0..2 (363) -If both SubWidthC and SubHeightC are equal to 2, the following applies: F1[0]=1, F1[1]=1 (364) F3[0][1]=1,F3[1][1]=4,F3[2][1]=1,F3[1][0]=1,F3[1][2]=1 (365) F4[0][1]=1,F4[1][1]=2,F4[2][1]=1 (366) F4[0][2]=1,F4[1][2]=2,F4[2][2]=1 (367)
[0241] - If not, the following applies: F3[1][1]=8 (368) F4[0][1]=2,F4[1][1]=4,F4[2][1]=2 (369) - when sps_chroma_vertical_collocated_flag is equal to 1, the following applies: pDsY[x][y], where x=1..nTbW-1 and y=1..nTbH-1, is derived as follows: pDsY[x][y]=(F3[1][0]*pY[SubWidthC*x][SubHeightC*y-1]+ F3[0][1]*pY[SubWidthC*x-1][SubHeightC*y]+ F3[1][1]*pY[SubWidthC*x][SubHeightC*y]+ F3[2][1]*pY[SubWidthC*x+1][SubHeightC*y]+ F3[1][2]*pY[SubWidthC*x][SubHeightC*y+1]+4)>>3 (370)
[0242] - Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies: pDsY[x][y], where x=1..nTbW-1 and y=1..nTbH-1, is derived as follows: pDsY[x][y]=(F4[0][1]*pY[SubWidthC*x-1][SubHeightC*y]+ F4[0][2]*pY[SubWidthC*x-1][SubHeightC*y+1]+ F4[1][1]*pY[SubWidthC*x][SubHeightC*y]+ F4[1][2]*pY[SubWidthC*x][SubHeightC*y+1]+ F4[2][1]*pY[SubWidthC*x+1][SubHeightC*y]+ F4[2][2]*pY[SubWidthC*x+1][SubHeightC*y+1]+4)>>3 (371)
[0243] 4. If numSampL is greater than 0, the selected neighboring left chroma sample pSelC[idx] is set equal to p[-1][pickPosL[idx]], idx=0..cntL-1, and the selected downsampled neighboring left luma sample pSelDsY[idx], idx=0..cntL-1, is derived as follows: - The variable y is set equal to pickPosL[idx]. -If both SubWidthC and SubHeightC are equal to 1, the following applies: pSelDsY[idx]=pY[-1][y] (372) - If not, the following applies: - when sps_chroma_vertical_collocated_flag is equal to 1, the following applies: pSelDsY[idx]=(F3[1][0]*pY[-SubWidthC][SubHeightC*y-1]+ F3[0][1]*pY[-1-SubWidthC][SubHeightC*y]+ F3[1][1]*pY[-SubWidthC][SubHeightC*y]+ F3[2][1]*pY[1-SubWidthC][SubHeightC*y]+ F3[1][2]*pY[-SubWidthC][SubHeightC*y+1]+4)>>3 (373)
[0244] - Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies: pSelDsY[idx]=(F4[0][1]*pY[-1-SubWidthC][SubHeightC*y]+ F4[0][2]*pY[-1-SubWidthC][SubHeightC*y+1]+ F4[1][1]*pY[-SubWidthC][SubHeightC*y]+ F4[1][2]*pY[-SubWidthC][SubHeightC*y+1]+ F4[2][1]*pY[1-SubWidthC][SubHeightC*y]+ F4[2][2]*pY[1-SubWidthC][SubHeightC*y+1]+4)>>3 (374)
[0245] 5. If numSampT is greater than 0, the top chroma sample of the selected neighborhood pSelC[idx] is set equal to p[pickPost[idx-cntL][-1], where idx=cntL..cntL+cntT-1, and the top luma sample of the downsampled neighborhood pSelDsY[idx], for idx=0..cntL+cntT-1, is defined as follows: - The variable x is set equal to pickPost[idx-cntL]. -If both SubWidthC and SubHeightC are equal to 1, the following applies: pSelDsY[idx]=pY[x][-1] (375) - If not, the following applies: - when sps_chroma_vertical_collocated_flag is equal to 1, the following applies: When -bCTUboundary is equal to FALSE, the following applies: pSelDsY[idx]=(F3[1][0]*pY[SubWidthC*x][-1-SubHeightC]+ F3[0][1]*pY[SubWidthC*x-1][-SubHeightC]+ F3[1][1]*pY[SubWidthC*x][-SubHeightC]+ F3[2][1]*pY[SubWidthC*x+1][-SubHeightC]+ F3[1][2]*pY[SubWidthC*x][1-SubHeightC]+4)>>3 (376) - Otherwise (bCTUboundary is equal to TRUE), the following applies: pSelDsY[idx]=(F2[0]*pY[SubWidthC*x-1][-1]+ F2[1]*pY[SubWidthC*x][-1]+ F2[2]*pY[SubWidthC*x+1][-1]+2)>>2 (377)
[0246] - Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies: When -bCTUboundary is equal to FALSE, the following applies: pSelDsY[idx]=(F4[0][1]*pY[SubWidthCx-1][-1]+ F4[0][2]*pY[SubWidthC*x-1][-2]+ F4[1][1]*pY[SubWidthC*x][-1]+ F4[1][2]*pY[SubWidthC*x][-2]+ F4[2][1]*pY[SubWidthC*x+1][-1]+ F4[2][2]*pY[SubWidthC*x+1][-2]+4)>>3 (378) - Otherwise (bCTUboundary is equal to TRUE), the following applies: pSelDsY[idx]=(F2[0]*pY[SubWidthC*x-1][-1]+ F2[1]*pY[SubWidthC*x][-1]+ F2[2]*pY[SubWidthC*x+1][-1]+2)>>2 (379)
[0247] 6. If cntT+cntL is not equal to 0, then the variables minY, maxY, minC, and maxC are derived as follows: If -cntT+cntL is equal to 2, then in Comp substituted for DsY and C, pSelComp[3] is set equal to pSelComp[0], pSelComp[2] is set equal to pSelComp[1], pSelComp[0] is set equal to pSelComp[1], and pSelComp[1] is set equal to pSelComp[3]. - The arrays minGrpIdx and maxGrpIdx are derived as follows: minGrpIdx[0]=0 (380) minGrpIdx[1]=2 (381) maxGrpIdx[0]=1 (382) maxGrpIdx[1]=3 (383) - If pSelDsY[minGrpIdx[0]] is greater than pSelDsY[minGrpIdx[1], minGrpIdx[0] and minGrpIdx[1] are swapped as follows: (minGrpIdx[0],minGrpIdx[1])=Swap(minGrpIdx[0],minGrpIdx[1]) (384) - If pSelDsY[maxGrpIdx[0]] is greater than pSelDsY[maxGrpIdx[1], maxGrpIdx[0] and maxGrpIdx[1] are swapped as follows: (maxGrpIdx[0],maxGrpIdx[1])=Swap(maxGrpIdx[0],maxGrpIdx[1]) (385) - If pSelDsY[minGrpIdx[0]] is greater than pSelDsY[maxGrpIdx[1], the arrays minGrpIdx and maxGrpIdx are swapped as follows: (minGrpIdx,maxGrpIdx)=Swap(minGrpIdx,maxGrpIdx) (386) - If pSelDsY[minGrpIdx[1]] is greater than pSelDsY[maxGrpIdx[0], minGrpIdx[1] and maxGrpIdx[0] are swapped as follows: (minGrpIdx[1],maxGrpIdx[0])=Swap(minGrpIdx[1],maxGrpIdx[0]) (387) The variables maxY, maxC, minY and minC are derived as follows: maxY=(pSelDsY[maxGrpIdx[0]]+pSelDsY[maxGrpIdx[1]]+1)>>1 (388) maxC=(pSelC[maxGrpIdx[0]]+pSelC[maxGrpIdx[1]]+1)>>1 (389) minY=(pSelDsY[minGrpIdx[0]]+pSelDsY[minGrpIdx[1]]+1)>>1 (390) minC=(pSelC[minGrpIdx[0]]+pSelC[minGrpIdx[1]]+1)>>1 (391)
[0248] 7. The variables a, b, and k are derived as follows: If -numSampL is equal to 0 and numSampT is equal to 0, the following applies: k=0 (392) a=0 (393) b=1<<(BitDepth-1) (394) - If not, the following applies: diff=maxY-minY (395) If -diff is not equal to 0, the following applies: diffC=maxC-minC (396) x=Floor(Log2(diff)) (397) normDiff=((diff<<4)>>x)&15 (398) x+=(normDiff!=0)?1:0 (399) y=Abs(diffC)>0?Floor(Log2(Abs(diffC)))+1:0 (400) a=(diffC*(divSigTable[normDiff]|8)+2 y-1 )>>y (401) k=((3+xy)<1)?1:3+xy (402) a=((3+xy)<1)?Sign(a)*15:a (403) b=minC-((a*minY)>>k) (404) Here, divSigTable[] is defined as follows: divSigTable[]={0,7,6,5,5,4,4,3,3,2,2,1,1,1,1,0} (405) - Otherwise (diff is equal to 0), the following applies: k=0 (406) a=0 (407) b=minC (408)
[0249] 8. The predicted samples predSamples[x][y], where x=0..nTbW-1 and y=0..nTbH-1, are derived as follows: predSamples[x][y]=Clip1(((pDsY[x][y]*a)>>k)+b) (409) NOTE - This process uses sps_chroma_vertical_collocated_flag, but for simplicity of implementation, does not use sps_chroma_horizontal_collocated_flag.
[0250] 5.7. Seventh embodiment The working draft specified in JVET-Q2001-vE can be modified as follows:
[0251] 8.4.5.2.13 The inputs to this process are: - intra prediction mode predModeIntra, - the sample position (xTbC, yTbC) of the top-left sample of the current transform block relative to the top-left sample of the current picture, - the variable nTbW, which defines the width of the transformation block; - the variable nTbH, which defines the height of the transformation block; - the variable cIdx, which defines the color components of the current block; -Let x=-1, y=0..2*nTbH-1 and x=0..2*nTbW-1, y=-1, and let p[x][y] be the saturation neighborhood sample.
[0252] The output of this process are the predicted samples preSamples[x][y], where x=0..nTbW-1, y=0..nTbH-1. The current luminance position (xTbY, yTbY) is derived as follows. (xTbY,yTbY)=(xTbC<<(SubWidthC-1),yTbC<<(SubHeightC-1)) (351)
[0253] The variables availL, availT and availTL are derived as follows. - The derivation process for neighborhood block availability specified in Section 6.4.4 is invoked with the current luminance position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighborhood luminance position (xTbY-1, yTbY), checkPredModeY set equal to FALSE, and cIdx as input, and assigns the output to availL. - The derivation process for neighborhood block availability specified in Section 6.4.4 is invoked with the current luminance position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighborhood luminance position (xTbY, yTbY-1), checkPredModeY set equal to FALSE, and cIdx as input, and assigns the output to availT.
[0254] The variable availTL is derived as follows: availTL=availL&&availT (352) - The number of available chroma samples in the top right neighborhood, numTopRight, is derived as follows: The variable numTopRight is set equal to 0 and availTR is set equal to TRUE. -If preModeIntra is equal to INTRA_T_CCLM, the following applies for x=nTbW..2*nTbW-1 until either availTR is equal to FALSE or x is equal to 2*nTbW-1: - The derivation process for neighborhood block availability specified in Section 6.4.4 is invoked with the current luminance position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighborhood luminance position (xTbY+x, yTbY-1), checkPredModeY set equal to FALSE, and cIdx as input, and assigns the output to availTR. If -availTR is equal to TRUE, numTopRight is increased by one.
[0255] - The number of available bottom-left neighboring chroma samples, numLeftBelow, is derived as follows: The variable numLeftBelow is set equal to 0 and availLB is set equal to TRUE. - if preModeIntra is equal to INTRA_L_CCLM, the following applies for y=nTbH..2*nTbH-1 until either availLB is equal to FALSE or y is equal to 2*nTbH-1: - The derivation process for neighborhood block availability specified in Section 6.4.4 is invoked with the current luminance position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighborhood luminance position (xTbY-1, yTbY+y), checkPredModeY set equal to FALSE, and cIdx as input, and assigns the output to availLB. If -availLB is equal to TRUE, numLeftBelow is increased by one.
[0256] The number of available neighboring chroma samples in the top and top-right numSampT and the number of available neighboring chroma samples in the left and bottom-left numSampL are derived as follows: -If predModeIntra is equal to INTRA_LT_CCLM, the following applies: numSampT=availT?nTbW:0 (353) numSampL=availL?nTbH:0 (354) - If not, the following applies: numSampT=(availT&&predModeIntra==INTRA_T_CCLM)?(nTbW+Min(numTopRight,nTbH)):0 (355) numSampL=(availL&&predModeIntra==INTRA_L_CCLM)?(nTbH+Min(numLeftBelow,nTbW)):0 (356)
[0257] The variable bCTUboundary is derived as follows. bCTUboundary=(yTbY&(CtbSizeY-1)==0)?TRUE:FALSE (357) The variable cntN and the array pickPosN, with N replaced by L and T, are derived as follows: The variable numIs4N is derived as follows: numIs4N=((availT&&availL&&predModeIntra==INTRA_LT_CCLM)?0:1) (358) - The variable startPosN is set equal to numSampN>(2+numIs4N). - The variable pickStepN is set equal to Max(1,numSampN>(1+numIs4N)). If -availN is equal to TRUE and preModeIntra is equal to INTRA_LT_CCLM or INTRA_N_CCLM, the following allocations are made: -cntN is set equal to Min(numSampN, (1+numIs4N)<<1). -pickPosN[pos] is set equal to (startPosN+pos*pospickStepN), where pos=0..cntN-1. Otherwise, cntN is set equal to 0. The predicted samples predSamples[x][y], where x=0..nTbW-1 and y=0..nTbH-1, are derived as follows: If both -numSampL and numSampT are equal to 0, the following applies: predSamples[x][y]=1<<(BitDepth-1) (359)
[0258] - Otherwise, the following ordered steps apply: 1. The co-located luma sample pY[x][y], where x=0..nTbW*SubWidthC-1, y=0..nTbH*SubHeightC-1, is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y).
[0259] [ka]
[0260] 3. The downsampled and arranged luminance samples pDsY[x][y] for x=0..nTbW-1 and y=0..nTbH-1 are derived as follows: -If both SubWidthC and SubHeightC are equal to 1, the following applies: pDsY[x][y], where x=1..nTbW-1 and y=1..nTbH-1, is derived as follows: pDstY[x][y]=pY[x][y] (360) - If not, the following applies: The one-dimensional filter coefficient arrays F1 and F2 and the two-dimensional filter coefficient arrays F3 and F4 are defined as follows: F1[0]=2, F1[1]=0 (361) F2[0]=1, F2[1]=2, F2[2]=1 (362) F3[i][j]=F4[i][j]=0,i=0..2,j=0..2 (363) -If both SubWidthC and SubHeightC are equal to 2, the following applies: F1[0]=1, F1[1]=1 (364) F3[0][1]=1,F3[1][1]=4,F3[2][1]=1,F3[1][0]=1,F3[1][2]=1 (365) F4[0][1]=1,F4[1][1]=2,F4[2][1]=1 (366) F4[0][2]=1,F4[1][2]=2,F4[2][2]=1 (367) - If not, the following applies: F3[1][1]=8 (368) F4[0][1]=2,F4[1][1]=4,F4[2][1]=2 (369) - when sps_chroma_vertical_collocated_flag is equal to 1, the following applies: pDsY[x][y], where x=1..nTbW-1 and y=1..nTbH-1, is derived as follows: pDsY[x][y]=(F3[1][0]*pY[SubWidthC*x][SubHeightC*y-1]+ F3[0][1]*pY[SubWidthC*x-1][SubHeightC*y]+ F3[1][1]*pY[SubWidthC*x][SubHeightC*y]+ F3[2][1]*pY[SubWidthC*x+1][SubHeightC*y]+ F3[1][2]*pY[SubWidthC*x][SubHeightC*y+1]+4)>>3 (370) - Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies: pDsY[x][y], where x=1..nTbW-1 and y=1..nTbH-1, is derived as follows: pDsY[x][y]=(F4[0][1]*pY[SubWidthC*x-1][SubHeightC*y]+ F4[0][2]*pY[SubWidthC*x-1][SubHeightC*y+1]+ F4[1][1]*pY[SubWidthC*x][SubHeightC*y]+ F4[1][2]*pY[SubWidthC*x][SubHeightC*y+1]+ F4[2][1]*pY[SubWidthC*x+1][SubHeightC*y]+ F4[2][2]*pY[SubWidthC*x+1][SubHeightC*y+1]+4)>>3 (371)
[0261] 4. If numSampL is greater than 0, the selected neighboring left chroma sample pSelC[idx] is set equal to p[-1][pickPosL[idx]], idx=0..cntL-1, and the selected downsampled neighboring left luma sample pSelDsY[idx], idx=0..cntL-1, is derived as follows: - The variable y is set equal to pickPosL[idx]. -If both SubWidthC and SubHeightC are equal to 1, the following applies: pSelDsY[idx]=pY[-1][y] (372) - If not, the following applies: - when sps_chroma_vertical_collocated_flag is equal to 1, the following applies: pSelDsY[idx]=(F3[1][0]*pY[-SubWidthC][SubHeightC*y-1]+ F3[0][1]*pY[-1-SubWidthC][SubHeightC*y]+ F3[1][1]*pY[-SubWidthC][SubHeightC*y]+ F3[2][1]*pY[1-SubWidthC][SubHeightC*y]+ F3[1][2]*pY[-SubWidthC][SubHeightC*y+1]+4)>>3 (373) - Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies: pSelDsY[idx]=(F4[0][1]*pY[-1-SubWidthC][SubHeightC*y]+ F4[0][2]*pY[-1-SubWidthC][SubHeightC*y+1]+ F4[1][1]*pY[-SubWidthC][SubHeightC*y]+ F4[1][2]*pY[-SubWidthC][SubHeightC*y+1]+ F4[2][1]*pY[1-SubWidthC][SubHeightC*y]+ F4[2][2]*pY[1-SubWidthC][SubHeightC*y+1]+4)>>3 (374)
[0262] 5. If numSampT is greater than 0, the top chroma sample of the selected neighborhood pSelC[idx] is set equal to p[pickPost[idx-cntL][-1], where idx=cntL..cntL+cntT-1, and the top luma sample of the downsampled neighborhood pSelDsY[idx], for idx=0..cntL+cntT-1, is defined as follows: - The variable x is set equal to pickPost[idx-cntL]. -If both SubWidthC and SubHeightC are equal to 1, the following applies: pSelDsY[idx]=pY[x][-1] (375) - If not, the following applies: - when sps_chroma_vertical_collocated_flag is equal to 1, the following applies: When -bCTUboundary is equal to FALSE, the following applies: pSelDsY[idx]=(F3[1][0]*pY[SubWidthC*x][-1-SubHeightC]+ F3[0][1]*pY[SubWidthC*x-1][-SubHeightC]+ F3[1][1]*pY[SubWidthC*x][-SubHeightC]+ F3[2][1]*pY[SubWidthC*x+1][-SubHeightC]+ F3[1][2]*pY[SubWidthC*x][1-SubHeightC]+4)>>3 (376) - Otherwise (bCTUboundary is equal to TRUE), the following applies: pSelDsY[idx]=(F2[0]*pY[SubWidthC*x-1][-1]+ F2[1]*pY[SubWidthC*x][-1]+ F2[2]*pY[SubWidthC*x+1][-1]+2)>>2 (377)
[0263] - Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies: When -bCTUboundary is equal to FALSE, the following applies: pSelDsY[idx]=(F4[0][1]*pY[SubWidthCx-1][-1]+ F4[0][2]*pY[SubWidthC*x-1][-2]+ F4[1][1]*pY[SubWidthC*x][-1]+ F4[1][2]*pY[SubWidthC*x][-2]+ F4[2][1]*pY[SubWidthC*x+1][-1]+ F4[2][2]*pY[SubWidthC*x+1][-2]+4)>>3 (378) - Otherwise (bCTUboundary is equal to TRUE), the following applies: pSelDsY[idx]=(F2[0]*pY[SubWidthC*x-1][-1]+ F2[1]*pY[SubWidthC*x][-1]+ F2[2]*pY[SubWidthC*x+1][-1]+2)>>2 (379)
[0264] 6. If cntT+cntL is not equal to 0, then the variables minY, maxY, minC, and maxC are derived as follows: If -cntT+cntL is equal to 2, then in Comp substituted for DsY and C, pSelComp[3] is set equal to pSelComp[0], pSelComp[2] is set equal to pSelComp[1], pSelComp[0] is set equal to pSelComp[1], and pSelComp[1] is set equal to pSelComp[3]. - The arrays minGrpIdx and maxGrpIdx are derived as follows: minGrpIdx[0]=0 (380) minGrpIdx[1]=2 (381) maxGrpIdx[0]=1 (382) maxGrpIdx[1]=3 (383)
[0265] - If pSelDsY[minGrpIdx[0]] is greater than pSelDsY[minGrpIdx[1], minGrpIdx[0] and minGrpIdx[1] are swapped as follows: (minGrpIdx[0],minGrpIdx[1])=Swap(minGrpIdx[0],minGrpIdx[1]) (384) - If pSelDsY[maxGrpIdx[0]] is greater than pSelDsY[maxGrpIdx[1], maxGrpIdx[0] and maxGrpIdx[1] are swapped as follows: (maxGrpIdx[0],maxGrpIdx[1])=Swap(maxGrpIdx[0],maxGrpIdx[1]) (385) - If pSelDsY[minGrpIdx[0]] is greater than pSelDsY[maxGrpIdx[1], the arrays minGrpIdx and maxGrpIdx are swapped as follows: (minGrpIdx,maxGrpIdx)=Swap(minGrpIdx,maxGrpIdx) (386)
[0266] - If pSelDsY[minGrpIdx[1]] is greater than pSelDsY[maxGrpIdx[0], minGrpIdx[1] and maxGrpIdx[0] are swapped as follows: (minGrpIdx[1],maxGrpIdx[0])=Swap(minGrpIdx[1],maxGrpIdx[0]) (387) The variables maxY, maxC, minY and minC are derived as follows: maxY=(pSelDsY[maxGrpIdx[0]]+pSelDsY[maxGrpIdx[1]]+1)>>1 (388) maxC=(pSelC[maxGrpIdx[0]]+pSelC[maxGrpIdx[1]]+1)>>1 (389) minY=(pSelDsY[minGrpIdx[0]]+pSelDsY[minGrpIdx[1]]+1)>>1 (390) minC=(pSelC[minGrpIdx[0]]+pSelC[minGrpIdx[1]]+1)>>1 (391)
[0267] 7. The variables a, b, and k are derived as follows: If -numSampL is equal to 0 and numSampT is equal to 0, the following applies: k=0 (392) a=0 (393) b=1<<(BitDepth-1) (394) - If not, the following applies: diff=maxY-minY (395) If -diff is not equal to 0, the following applies: diffC=maxC-minC (396) x=Floor(Log2(diff)) (397) normDiff=((diff<<4)>>x)&15 (398) x+=(normDiff!=0)?1:0 (399) y=Abs(diffC)>0?Floor(Log2(Abs(diffC)))+1:0 (400) a=(diffC*(divSigTable[normDiff]|8)+2 y-1 )>>y (401) k=((3+xy)<1)?1:3+xy (402) a=((3+xy)<1)?Sign(a)*15:a (403) b=minC-((a*minY)>>k) (404) Here, divSigTable[] is defined as follows: divSigTable[]={0,7,6,5,5,4,4,3,3,2,2,1,1,1,1,0} (405) - Otherwise (diff is equal to 0), the following applies: k=0 (406) a=0 (407) b=minC (408)
[0268] 8. The predicted samples predSamples[x][y], where x=0..nTbW-1 and y=0..nTbH-1, are derived as follows: predSamples[x][y]=Clip1(((pDsY[x][y]*a)>>k)+b) (409) NOTE - This process uses sps_chroma_vertical_collocated_flag, but for simplicity of implementation, does not use sps_chroma_horizontal_collocated_flag.
[0269] 5.8. Embodiment 8 The working draft specified in JVET-Q2001-vE can be modified as follows:
[0270] 8.4.5.2.13 The inputs to this process are: - intra prediction mode predModeIntra, - the sample position (xTbC, yTbC) of the top-left sample of the current transform block relative to the top-left sample of the current picture, - the variable nTbW, which defines the width of the transformation block; - the variable nTbH, which defines the height of the transformation block; - the variable cIdx, which defines the color components of the current block; -Let x=-1,y=0..2*nTbH-1 and x=0..2*nTbW-1,y=-1, and let p[x][y] be the saturation neighborhood sample.
[0271] The output of this process are the predicted samples preSamples[x][y], where x=0..nTbW-1, y=0..nTbH-1. The current luminance position (xTbY, yTbY) is derived as follows. (xTbY,yTbY)=(xTbC<<(SubWidthC-1),yTbC<<(SubHeightC-1)) (351)
[0272] [ka]
[0273] - The number of available chroma samples in the top right neighborhood, numTopRight, is derived as follows: The variable numTopRight is set equal to 0 and availTR is set equal to TRUE. -If preModeIntra is equal to INTRA_T_CCLM, the following applies for x=nTbW..2*nTbW-1 until either availTR is equal to FALSE or x is equal to 2*nTbW-1: - The derivation process for neighborhood block availability specified in Section 6.4.4 is invoked with the current luminance position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighborhood luminance position (xTbY+x, yTbY-1), checkPredModeY set equal to FALSE, and cIdx as input, and assigns the output to availTR. If -availTR is equal to TRUE, numTopRight is increased by one. - The number of available bottom-left neighboring chroma samples, numLeftBelow, is derived as follows: The variable numLeftBelow is set equal to 0 and availLB is set equal to TRUE. - if preModeIntra is equal to INTRA_L_CCLM, the following applies for y=nTbH..2*nTbH-1 until either availLB is equal to FALSE or y is equal to 2*nTbH-1: - The derivation process for neighborhood block availability specified in Section 6.4.4 is invoked with the current luminance position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighborhood luminance position (xTbY-1, yTbY+y), checkPredModeY set equal to FALSE, and cIdx as input, and assigns the output to availLB. If -availLB is equal to TRUE, numLeftBelow is increased by one.
[0274] The number of available neighboring chroma samples in the top and top-right numSampT and the number of available neighboring chroma samples in the left and bottom-left numSampL are derived as follows: -If predModeIntra is equal to INTRA_LT_CCLM, the following applies: numSampT=availT?nTbW:0 (353) numSampL=availL?nTbH:0 (354) - If not, the following applies: numSampT=(availT&&predModeIntra==INTRA_T_CCLM)?(nTbW+Min(numTopRight,nTbH)):0 (355) numSampL=(availL&&predModeIntra==INTRA_L_CCLM)?(nTbH+Min(numLeftBelow,nTbW)):0 (356)
[0275] The variable bCTUboundary is derived as follows. bCTUboundary=(yTbY&(CtbSizeY-1)==0)?TRUE:FALSE (357) The variable cntN and the array pickPosN, with N replaced by L and T, are derived as follows: The variable numIs4N is derived as follows: numIs4N=((availT&&availL&&predModeIntra==INTRA_LT_CCLM)?0:1) (358) - The variable startPosN is set equal to numSampN>(2+numIs4N). - The variable pickStepN is set equal to Max(1,numSampN>(1+numIs4N)). If -availN is equal to TRUE and preModeIntra is equal to INTRA_LT_CCLM or INTRA_N_CCLM, the following allocations are made: -cntN is set equal to Min(numSampN, (1+numIs4N)<<1). -pospickPosN[pos] is set equal to (startPosN+pos*pospickStepN), where pos=0..cntN-1. Otherwise, cntN is set equal to 0. The predicted samples predSamples[x][y], where x=0..nTbW-1 and y=0..nTbH-1, are derived as follows: If both -numSampL and numSampT are equal to 0, the following applies: predSamples[x][y]=1<<(BitDepth-1) (359)
[0276] - Otherwise, the following ordered steps apply: 1. The co-located luma sample pY[x][y], where x=0..nTbW*SubWidthC-1, y=0..nTbH*SubHeightC-1, is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y).
[0277] [ka]
[0278] 3. The downsampled and arranged luminance samples pDsY[x][y] for x=0..nTbW-1 and y=0..nTbH-1 are derived as follows: -If both SubWidthC and SubHeightC are equal to 1, the following applies: pDsY[x][y], where x=1..nTbW-1 and y=1..nTbH-1, is derived as follows: pDstY[x][y]=pY[x][y] (360) - If not, the following applies: The one-dimensional filter coefficient arrays F1 and F2 and the two-dimensional filter coefficient arrays F3 and F4 are defined as follows: F1[0]=2, F1[1]=0 (361) F2[0]=1, F2[1]=2, F2[2]=1 (362) F3[i][j]=F4[i][j]=0,i=0..2,j=0..2 (363) -If both SubWidthC and SubHeightC are equal to 2, the following applies: F1[0]=1, F1[1]=1 (364) F3[0][1]=1,F3[1][1]=4,F3[2][1]=1,F3[1][0]=1,F3[1][2]=1 (365) F4[0][1]=1,F4[1][1]=2,F4[2][1]=1 (366) F4[0][2]=1,F4[1][2]=2,F4[2][2]=1 (367) - If not, the following applies: F3[1][1]=8 (368) F4[0][1]=2,F4[1][1]=4,F4[2][1]=2 (369)
[0279] - when sps_chroma_vertical_collocated_flag is equal to 1, the following applies: pDsY[x][y], where x=1..nTbW-1 and y=1..nTbH-1, is derived as follows: pDsY[x][y]=(F3[1][0]*pY[SubWidthC*x][SubHeightC*y-1]+ F3[0][1]*pY[SubWidthC*x-1][SubHeightC*y]+ F3[1][1]*pY[SubWidthC*x][SubHeightC*y]+ F3[2][1]*pY[SubWidthC*x+1][SubHeightC*y]+ F3[1][2]*pY[SubWidthC*x][SubHeightC*y+1]+4)>>3 (370) - Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies: pDsY[x][y], where x=1..nTbW-1 and y=1..nTbH-1, is derived as follows: pDsY[x][y]=(F4[0][1]*pY[SubWidthC*x-1][SubHeightC*y]+ F4[0][2]*pY[SubWidthC*x-1][SubHeightC*y+1]+ F4[1][1]*pY[SubWidthC*x][SubHeightC*y]+ F4[1][2]*pY[SubWidthC*x][SubHeightC*y+1]+ F4[2][1]*pY[SubWidthC*x+1][SubHeightC*y]+ F4[2][2]*pY[SubWidthC*x+1][SubHeightC*y+1]+4)>>3 (371)
[0280] 4. If numSampL is greater than 0, the selected neighboring left chroma sample pSelC[idx] is set equal to p[-1][pickPosL[idx]], idx=0..cntL-1, and the selected downsampled neighboring left luma sample pSelDsY[idx], idx=0..cntL-1, is derived as follows: - The variable y is set equal to pickPosL[idx]. -If both SubWidthC and SubHeightC are equal to 1, the following applies: pSelDsY[idx]=pY[-1][y] (372) - If not, the following applies: - when sps_chroma_vertical_collocated_flag is equal to 1, the following applies: pSelDsY[idx]=(F3[1][0]*pY[-SubWidthC][SubHeightC*y-1]+ F3[0][1]*pY[-1-SubWidthC][SubHeightC*y]+ F3[1][1]*pY[-SubWidthC][SubHeightC*y]+ F3[2][1]*pY[1-SubWidthC][SubHeightC*y]+ F3[1][2]*pY[-SubWidthC][SubHeightC*y+1]+4)>>3 (373) - Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies: pSelDsY[idx]=(F4[0][1]*pY[-1-SubWidthC][SubHeightC*y]+ F4[0][2]*pY[-1-SubWidthC][SubHeightC*y+1]+ F4[1][1]*pY[-SubWidthC][SubHeightC*y]+ F4[1][2]*pY[-SubWidthC][SubHeightC*y+1]+ F4[2][1]*pY[1-SubWidthC][SubHeightC*y]+ F4[2][2]*pY[1-SubWidthC][SubHeightC*y+1]+4)>>3 (374)
[0281] 5. If numSampT is greater than 0, the top chroma sample of the selected neighborhood pSelC[idx] is set equal to p[pickPost[idx-cntL][-1], where idx=cntL..cntL+cntT-1, and the top luma sample of the downsampled neighborhood pSelDsY[idx], for idx=0..cntL+cntT-1, is defined as follows: - The variable x is set equal to pickPost[idx-cntL]. -If both SubWidthC and SubHeightC are equal to 1, the following applies: pSelDsY[idx]=pY[x][-1] (375) - If not, the following applies: - when sps_chroma_vertical_collocated_flag is equal to 1, the following applies: When -bCTUboundary is equal to FALSE, the following applies: pSelDsY[idx]=(F3[1][0]*pY[SubWidthC*x][-1-SubHeightC]+ F3[0][1]*pY[SubWidthC*x-1][-SubHeightC]+ F3[1][1]*pY[SubWidthC*x][-SubHeightC]+ F3[2][1]*pY[SubWidthC*x+1][-SubHeightC]+ F3[1][2]*pY[SubWidthC*x][1-SubHeightC]+4)>>3 (376) - Otherwise (bCTUboundary is equal to TRUE), the following applies: pSelDsY[idx]=(F2[0]*pY[SubWidthC*x-1][-1]+ F2[1]*pY[SubWidthC*x][-1]+ F2[2]*pY[SubWidthC*x+1][-1]+2)>>2 (377)
[0282] - Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies: When -bCTUboundary is equal to FALSE, the following applies: pSelDsY[idx]=(F4[0][1]*pY[SubWidthCx-1][-1]+ F4[0][2]*pY[SubWidthC*x-1][-2]+ F4[1][1]*pY[SubWidthC*x][-1]+ F4[1][2]*pY[SubWidthC*x][-2]+ F4[2][1]*pY[SubWidthC*x+1][-1]+ F4[2][2]*pY[SubWidthC*x+1][-2]+4)>>3 (378) - Otherwise (bCTUboundary is equal to TRUE), the following applies: pSelDsY[idx]=(F2[0]*pY[SubWidthC*x-1][-1]+ F2[1]*pY[SubWidthC*x][-1]+ F2[2]*pY[SubWidthC*x+1][-1]+2)>>2 (379)
[0283] 6. If cntT+cntL is not equal to 0, then the variables minY, maxY, minC, and maxC are derived as follows: If -cntT+cntL is equal to 2, then in Comp substituted for DsY and C, pSelComp[3] is set equal to pSelComp[0], pSelComp[2] is set equal to pSelComp[1], pSelComp[0] is set equal to pSelComp[1], and pSelComp[1] is set equal to pSelComp[3]. - The arrays minGrpIdx and maxGrpIdx are derived as follows: minGrpIdx[0]=0 (380) minGrpIdx[1]=2 (381) maxGrpIdx[0]=1 (382) maxGrpIdx[1]=3 (383) - If pSelDsY[minGrpIdx[0]] is greater than pSelDsY[minGrpIdx[1], minGrpIdx[0] and minGrpIdx[1] are swapped as follows: (minGrpIdx[0],minGrpIdx[1])=Swap(minGrpIdx[0],minGrpIdx[1]) (384)
[0284] - If pSelDsY[maxGrpIdx[0]] is greater than pSelDsY[maxGrpIdx[1], maxGrpIdx[0] and maxGrpIdx[1] are swapped as follows: (maxGrpIdx[0],maxGrpIdx[1])=Swap(maxGrpIdx[0],maxGrpIdx[1]) (385) - If pSelDsY[minGrpIdx[0]] is greater than pSelDsY[maxGrpIdx[1], the arrays minGrpIdx and maxGrpIdx are swapped as follows: (minGrpIdx,maxGrpIdx)=Swap(minGrpIdx,maxGrpIdx) (386) - If pSelDsY[minGrpIdx[1]] is greater than pSelDsY[maxGrpIdx[0], minGrpIdx[1] and maxGrpIdx[0] are swapped as follows: (minGrpIdx[1],maxGrpIdx[0])=Swap(minGrpIdx[1],maxGrpIdx[0]) (387) The variables maxY, maxC, minY and minC are derived as follows: maxY=(pSelDsY[maxGrpIdx[0]]+pSelDsY[maxGrpIdx[1]]+1)>>1 (388) maxC=(pSelC[maxGrpIdx[0]]+pSelC[maxGrpIdx[1]]+1)>>1 (389) minY=(pSelDsY[minGrpIdx[0]]+pSelDsY[minGrpIdx[1]]+1)>>1 (390) minC=(pSelC[minGrpIdx[0]]+pSelC[minGrpIdx[1]]+1)>>1 (391)
[0285] 7. The variables a, b, and k are derived as follows: If -numSampL is equal to 0 and numSampT is equal to 0, the following applies: k=0 (392) a=0 (393) b=1<<(BitDepth-1) (394) - If not, the following applies: diff=maxY-minY (395) If -diff is not equal to 0, the following applies: diffC=maxC-minC (396) x=Floor(Log2(diff)) (397) normDiff=((diff<<4)>>x)&15 (398) x+=(normDiff!=0)?1:0 (399) y=Abs(diffC)>0?Floor(Log2(Abs(diffC)))+1:0 (400) a=(diffC*(divSigTable[normDiff]|8)+2 y-1 )>>y (401) k=((3+xy)<1)?1:3+xy (402) a=((3+xy)<1)?Sign(a)*15:a (403) b=minC-((a*minY)>>k) (404) Here, divSigTable[] is defined as follows: divSigTable[]={0,7,6,5,5,4,4,3,3,2,2,1,1,1,1,0} (405) - Otherwise (diff is equal to 0), the following applies: k=0 (406) a=0 (407) b=minC (408)
[0286] 8. The predicted samples predSamples[x][y], where x=0..nTbW-1 and y=0..nTbH-1, are derived as follows: predSamples[x][y]=Clip1(((pDsY[x][y]*a)>>k)+b) (409) NOTE - This process uses sps_chroma_vertical_collocated_flag, but for simplicity of implementation, does not use sps_chroma_horizontal_collocated_flag.
[0287] 5.9. EMBODIMENT 9 The working draft specified in JVET-Q2001-vE can be modified as follows:
[0288] 8.4.5.2.13 The inputs to this process are: - intra prediction mode predModeIntra, - the sample position (xTbC, yTbC) of the top-left sample of the current transform block relative to the top-left sample of the current picture, - the variable nTbW, which defines the width of the transformation block; - the variable nTbH, which defines the height of the transformation block; - the variable cIdx, which defines the color components of the current block; -Let x=-1,y=0..2*nTbH-1 and x=0..2*nTbW-1,y=-1, and let p[x][y] be the saturation neighborhood sample.
[0289] The output of this process are the predicted samples preSamples[x][y], where x=0..nTbW-1, y=0..nTbH-1. The current luminance position (xTbY, yTbY) is derived as follows. (xTbY,yTbY)=(xTbC<<(SubWidthC-1),yTbC<<(SubHeightC-1)) (351) The variables availL, availT and availTL are derived as follows. - The derivation process for neighborhood block availability specified in Section 6.4.4 is invoked with the current luminance position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighborhood luminance position (xTbY-1, yTbY), checkPredModeY set equal to FALSE, and cIdx as input, and assigns the output to availL. - The derivation process for neighborhood block availability specified in Section 6.4.4 is invoked with the current luminance position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighborhood luminance position (xTbY, yTbY-1), checkPredModeY set equal to FALSE, and cIdx as input, and assigns the output to availT.
[0290] The variable availTL is derived as follows: availTL=availL&&availT (352) - The number of available chroma samples in the top right neighborhood, numTopRight, is derived as follows: The variable numTopRight is set equal to 0 and availTR is set equal to TRUE. -If preModeIntra is equal to INTRA_T_CCLM, the following applies for x=nTbW..2*nTbW-1 until either availTR is equal to FALSE or x is equal to 2*nTbW-1: - The derivation process for neighborhood block availability specified in Section 6.4.4 is invoked with the current luminance position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighborhood luminance position (xTbY+x, yTbY-1), checkPredModeY set equal to FALSE, and cIdx as input, and assigns the output to availTR. If -availTR is equal to TRUE, numTopRight is increased by one. - The number of available bottom-left neighboring chroma samples, numLeftBelow, is derived as follows: The variable numLeftBelow is set equal to 0 and availLB is set equal to TRUE. - if preModeIntra is equal to INTRA_L_CCLM, the following applies for y=nTbH..2*nTbH-1 until either availLB is equal to FALSE or y is equal to 2*nTbH-1: - The derivation process for neighborhood block availability specified in Section 6.4.4 is invoked with the current luminance position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighborhood luminance position (xTbY-1, yTbY+y), checkPredModeY set equal to FALSE, and cIdx as input, and assigns the output to availLB. If -availLB is equal to TRUE, numLeftBelow is increased by one.
[0291] The number of available neighboring chroma samples in the top and top-right numSampT and the number of available neighboring chroma samples in the left and bottom-left numSampL are derived as follows: -If predModeIntra is equal to INTRA_LT_CCLM, the following applies: numSampT=availT?nTbW:0 (353) numSampL=availL?nTbH:0 (354) - If not, the following applies: numSampT=(availT&&predModeIntra==INTRA_T_CCLM)?(nTbW+Min(numTopRight,nTbH)):0 (355) numSampL=(availL&&predModeIntra==INTRA_L_CCLM)?(nTbH+Min(numLeftBelow,nTbW)):0 (356)
[0292] The variable bCTUboundary is derived as follows. bCTUboundary=(yTbY&(CtbSizeY-1)==0)?TRUE:FALSE (357) The variable cntN and the array pickPosN, with N replaced by L and T, are derived as follows: The variable numIs4N is derived as follows: numIs4N=((availT&&availL&&predModeIntra==INTRA_LT_CCLM)?0:1) (358) - The variable startPosN is set equal to numSampN>(2+numIs4N). - The variable pickStepN is set equal to Max(1,numSampN>(1+numIs4N)). If -availN is equal to TRUE and preModeIntra is equal to INTRA_LT_CCLM or INTRA_N_CCLM, the following allocations are made: -cntN is set equal to Min(numSampN, (1+numIs4N)<<1). -pospickPosN[pos] is set equal to (startPosN+pos*pospickStepN), where pos=0..cntN-1. Otherwise, cntN is set equal to 0.
[0293] The predicted samples predSamples[x][y], where x=0..nTbW-1 and y=0..nTbH-1, are derived as follows: If both -numSampL and numSampT are equal to 0, the following applies: predSamples[x][y]=1<<(BitDepth-1) (359) - Otherwise, the following ordered steps apply: 1. The co-located luma sample pY[x][y], where x=0..nTbW*SubWidthC-1, y=0..nTbH*SubHeightC-1, is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y).
[0294] [ka]
[0295] 3. The downsampled and arranged luminance samples pDsY[x][y], where x=0..nTbW-1 and y=0..nTbH-1, are derived as follows: -If both SubWidthC and SubHeightC are equal to 1, the following applies: pDsY[x][y], where x=1..nTbW-1 and y=1..nTbH-1, is derived as follows: pDstY[x][y]=pY[x][y] (360) - If not, the following applies: The one-dimensional filter coefficient arrays F1 and F2 and the two-dimensional filter coefficient arrays F3 and F4 are defined as follows: F1[0]=2, F1[1]=0 (361) F2[0]=1, F2[1]=2, F2[2]=1 (362) F3[i][j]=F4[i][j]=0,i=0..2,j=0..2 (363) -If both SubWidthC and SubHeightC are equal to 2, the following applies: F1[0]=1, F1[1]=1 (364) F3[0][1]=1,F3[1][1]=4,F3[2][1]=1,F3[1][0]=1,F3[1][2]=1 (365) F4[0][1]=1,F4[1][1]=2,F4[2][1]=1 (366) F4[0][2]=1,F4[1][2]=2,F4[2][2]=1 (367) - If not, the following applies: F3[1][1]=8 (368) F4[0][1]=2,F4[1][1]=4,F4[2][1]=2, (369)
[0296] - when sps_chroma_vertical_collocated_flag is equal to 1, the following applies: pDsY[x][y], where x=1..nTbW-1 and y=1..nTbH-1, is derived as follows: pDsY[x][y]=(F3[1][0]*pY[SubWidthC*x][SubHeightC*y-1]+ F3[0][1]*pY[SubWidthC*x-1][SubHeightC*y]+ F3[1][1]*pY[SubWidthC*x][SubHeightC*y]+ F3[2][1]*pY[SubWidthC*x+1][SubHeightC*y]+ F3[1][2]*pY[SubWidthC*x][SubHeightC*y+1]+4)>>3 (370) - Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies: pDsY[x][y], where x=1..nTbW-1 and y=1..nTbH-1, is derived as follows: pDsY[x][y]=(F4[0][1]*pY[SubWidthC*x-1][SubHeightC*y]+ F4[0][2]*pY[SubWidthC*x-1][SubHeightC*y+1]+ F4[1][1]*pY[SubWidthC*x][SubHeightC*y]+ F4[1][2]*pY[SubWidthC*x][SubHeightC*y+1]+ F4[2][1]*pY[SubWidthC*x+1][SubHeightC*y]+ F4[2][2]*pY[SubWidthC*x+1][SubHeightC*y+1]+4)>>3 (371)
[0297] 4. If numSampL is greater than 0, the selected neighboring left chroma sample pSelC[idx] is set equal to p[-1][pickPosL[idx]], idx=0..cntL-1, and the selected downsampled neighboring left luma sample pSelDsY[idx], idx=0..cntL-1, is derived as follows: - The variable y is set equal to pickPosL[idx]. -If both SubWidthC and SubHeightC are equal to 1, the following applies: pSelDsY[idx]=pY[-1][y] (372) - If not, the following applies: - when sps_chroma_vertical_collocated_flag is equal to 1, the following applies: pSelDsY[idx]=(F3[1][0]*pY[-SubWidthC][SubHeightC*y-1]+ F3[0][1]*pY[-1-SubWidthC][SubHeightC*y]+ F3[1][1]*pY[-SubWidthC][SubHeightC*y]+ F3[2][1]*pY[1-SubWidthC][SubHeightC*y]+ F3[1][2]*pY[-SubWidthC][SubHeightC*y+1]+4)>>3 (373)
[0298] - Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies: pSelDsY[idx]=(F4[0][1]*pY[-1-SubWidthC][SubHeightC*y]+ F4[0][2]*pY[-1-SubWidthC][SubHeightC*y+1]+ F4[1][1]*pY[-SubWidthC][SubHeightC*y]+ F4[1][2]*pY[-SubWidthC][SubHeightC*y+1]+ F4[2][1]*pY[1-SubWidthC][SubHeightC*y]+ F4[2][2]*pY[1-SubWidthC][SubHeightC*y+1]+4)>>3 (374)
[0299] 5. If numSampT is greater than 0, the top chroma sample of the selected neighborhood pSelC[idx] is set equal to p[pickPost[idx-cntL][-1], where idx=cntL..cntL+cntT-1, and the top luma sample of the downsampled neighborhood pSelDsY[idx], for idx=0..cntL+cntT-1, is defined as follows: - The variable x is set equal to pickPost[idx-cntL]. -If both SubWidthC and SubHeightC are equal to 1, the following applies: pSelDsY[idx]=pY[x][-1] (375) - If not, the following applies: - when sps_chroma_vertical_collocated_flag is equal to 1, the following applies: When -bCTUboundary is equal to FALSE, the following applies: pSelDsY[idx]=(F3[1][0]*pY[SubWidthC*x][-1-SubHeightC]+ F3[0][1]*pY[SubWidthC*x-1][-SubHeightC]+ F3[1][1]*pY[SubWidthC*x][-SubHeightC]+ F3[2][1]*pY[SubWidthC*x+1][-SubHeightC]+ F3[1][2]*pY[SubWidthC*x][1-SubHeightC]+4)>>3 (376)
[0300] - Otherwise (bCTUboundary is equal to TRUE), the following applies: pSelDsY[idx]=(F2[0]*pY[SubWidthC*x-1][-1]+ F2[1]*pY[SubWidthC*x][-1]+ F2[2]*pY[SubWidthC*x+1][-1]+2)>>2 (377) - Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies: When -bCTUboundary is equal to FALSE, the following applies: pSelDsY[idx]=(F4[0][1]*pY[SubWidthCx-1][-1]+ F4[0][2]*pY[SubWidthC*x-1][-2]+ F4[1][1]*pY[SubWidthC*x][-1]+ F4[1][2]*pY[SubWidthC*x][-2]+ F4[2][1]*pY[SubWidthC*x+1][-1]+ F4[2][2]*pY[SubWidthC*x+1][-2]+4)>>3 (378) - Otherwise (bCTUboundary is equal to TRUE), the following applies: pSelDsY[idx]=(F2[0]*pY[SubWidthC*x-1][-1]+ F2[1]*pY[SubWidthC*x][-1]+ F2[2]*pY[SubWidthC*x+1][-1]+2)>>2 (379)
[0301] 6. If cntT+cntL is not equal to 0, then the variables minY, maxY, minC, and maxC are derived as follows: If -cntT+cntL is equal to 2, then in Comp substituted for DsY and C, pSelComp[3] is set equal to pSelComp[0], pSelComp[2] is set equal to pSelComp[1], pSelComp[0] is set equal to pSelComp[1], and pSelComp[1] is set equal to pSelComp[3]. - The arrays minGrpIdx and maxGrpIdx are derived as follows: minGrpIdx[0]=0 (380) minGrpIdx[1]=2 (381) maxGrpIdx[0]=1 (382) maxGrpIdx[1]=3 (383) - If pSelDsY[minGrpIdx[0]] is greater than pSelDsY[minGrpIdx[1], minGrpIdx[0] and minGrpIdx[1] are swapped as follows: (minGrpIdx[0],minGrpIdx[1])=Swap(minGrpIdx[0],minGrpIdx[1]) (384) - If pSelDsY[maxGrpIdx[0]] is greater than pSelDsY[maxGrpIdx[1], maxGrpIdx[0] and maxGrpIdx[1] are swapped as follows: (maxGrpIdx[0],maxGrpIdx[1])=Swap(maxGrpIdx[0],maxGrpIdx[1]) (385) - If pSelDsY[minGrpIdx[0]] is greater than pSelDsY[maxGrpIdx[1], the arrays minGrpIdx and maxGrpIdx are swapped as follows: (minGrpIdx,maxGrpIdx)=Swap(minGrpIdx,maxGrpIdx) (386) - If pSelDsY[minGrpIdx[1]] is greater than pSelDsY[maxGrpIdx[0], minGrpIdx[1] and maxGrpIdx[0] are swapped as follows: (minGrpIdx[1],maxGrpIdx[0])=Swap(minGrpIdx[1],maxGrpIdx[0]) (387) The variables maxY, maxC, minY and minC are derived as follows: maxY=(pSelDsY[maxGrpIdx[0]]+pSelDsY[maxGrpIdx[1]]+1)>>1 (388) maxC=(pSelC[maxGrpIdx[0]]+pSelC[maxGrpIdx[1]]+1)>>1 (389) minY=(pSelDsY[minGrpIdx[0]]+pSelDsY[minGrpIdx[1]]+1)>>1 (390) minC=(pSelC[minGrpIdx[0]]+pSelC[minGrpIdx[1]]+1)>>1 (391)
[0302] 7. The variables a, b, and k are derived as follows: If -numSampL is equal to 0 and numSampT is equal to 0, the following applies: k=0 (392) a=0 (393) b=1<<(BitDepth-1) (394) - If not, the following applies: diff=maxY-minY (395) If -diff is not equal to 0, the following applies: diffC=maxC-minC (396) x=Floor(Log2(diff)) (397) normDiff=((diff<<4)>>x)&15 (398) x+=(normDiff!=0)?1:0 (399) y=Abs(diffC)>0?Floor(Log2(Abs(diffC)))+1:0 (400) a=(diffC*(divSigTable[normDiff]|8)+2 y-1 )>>y (401) k=((3+xy)<1)?1:3+xy (402) a=((3+xy)<1)?Sign(a)*15:a (403) b=minC-((a*minY)>>k) (404) Here, divSigTable[] is defined as follows: divSigTable[]={0,7,6,5,5,4,4,3,3,2,2,1,1,1,1,0} (405) - Otherwise (diff is equal to 0), the following applies: k=0 (406) a=0 (407) b=minC (408)
[0303] 8. The predicted samples predSamples[x][y], where x=0..nTbW-1 and y=0..nTbH-1, are derived as follows: predSamples[x][y]=Clip1(((pDsY[x][y]*a)>>k)+b) (409) NOTE - This process uses sps_chroma_vertical_collocated_flag, but for simplicity of implementation, does not use sps_chroma_horizontal_collocated_flag.
[0304] 5.10. Embodiment 10 The working draft specified in JVET-Q2001-vE can be modified as follows:
[0305] 8.4.5.2.13 The inputs to this process are: - intra prediction mode predModeIntra, - the sample position (xTbC, yTbC) of the top-left sample of the current transform block relative to the top-left sample of the current picture, - the variable nTbW, which defines the width of the transformation block; - the variable nTbH, which defines the height of the transformation block; - the variable cIdx, which defines the color components of the current block; -Let x=-1,y=0..2*nTbH-1 and x=0..2*nTbW-1,y=-1, and let p[x][y] be the saturation neighborhood sample. The output of this process are the predicted samples preSamples[x][y], where x=0..nTbW-1, y=0..nTbH-1.
[0306] [ka]
[0307] - The number of available chroma samples in the top right neighborhood, numTopRight, is derived as follows: The variable numTopRight is set equal to 0 and availTR is set equal to TRUE. -If preModeIntra is equal to INTRA_T_CCLM, the following applies for x=nTbW..2*nTbW-1 until either availTR is equal to FALSE or x is equal to 2*nTbW-1: - The derivation process for neighborhood block availability specified in Section 6.4.4 is invoked with the current luminance position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighborhood luminance position (xTbY+x, yTbY-1), checkPredModeY set equal to FALSE, and cIdx as input, and assigns the output to availTR. If -availTR is equal to TRUE, numTopRight is increased by one.
[0308] - The number of available bottom-left neighboring chroma samples, numLeftBelow, is derived as follows: The variable numLeftBelow is set equal to 0 and availLB is set equal to TRUE. - if preModeIntra is equal to INTRA_L_CCLM, the following applies for y=nTbH..2*nTbH-1 until either availLB is equal to FALSE or y is equal to 2*nTbH-1: - The derivation process for neighborhood block availability specified in Section 6.4.4 is invoked with the current luminance position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighborhood luminance position (xTbY-1, yTbY+y), checkPredModeY set equal to FALSE, and cIdx as input, and assigns the output to availLB. If -availLB is equal to TRUE, numLeftBelow is increased by one.
[0309] The number of available neighboring chroma samples in the top and top-right numSampT and the number of available neighboring chroma samples in the left and bottom-left numSampL are derived as follows: -If predModeIntra is equal to INTRA_LT_CCLM, the following applies: numSampT=availT?nTbW:0 (353) numSampL=availL?nTbH:0 (354) - If not, the following applies: numSampT=(availT&&predModeIntra==INTRA_T_CCLM)?(nTbW+Min(numTopRight,nTbH)):0 (355) numSampL=(availL&&predModeIntra==INTRA_L_CCLM)?(nTbH+Min(numLeftBelow,nTbW)):0 (356)
[0310] The variable bCTUboundary is derived as follows. bCTUboundary=(yTbY&(CtbSizeY-1)==0)?TRUE:FALSE (357) The variable cntN and the array pickPosN, with N replaced by L and T, are derived as follows: The variable numIs4N is derived as follows: numIs4N=((availT&&availL&&predModeIntra==INTRA_LT_CCLM)?0:1) (358) - The variable startPosN is set equal to numSampN>(2+numIs4N). - The variable pickStepN is set equal to Max(1,numSampN>(1+numIs4N)). If -availN is equal to TRUE and preModeIntra is equal to INTRA_LT_CCLM or INTRA_N_CCLM, the following allocations are made: -cntN is set equal to Min(numSampN, (1+numIs4N)<<1). -pospickPosN[pos] is set equal to (startPosN+pos*pospickStepN), where pos=0..cntN-1. Otherwise, cntN is set equal to 0.
[0311] The predicted samples predSamples[x][y], where x=0..nTbW-1 and y=0..nTbH-1, are derived as follows: If both -numSampL and numSampT are equal to 0, the following applies: predSamples[x][y]=1<<(BitDepth-1) (359) - Otherwise, the following ordered steps apply: 1. The co-located luma sample pY[x][y], where x=0..nTbW*SubWidthC-1, y=0..nTbH*SubHeightC-1, is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y).
[0312] [ka]
[0313] 3. The downsampled and arranged luminance samples pDsY[x][y], where x=0..nTbW-1 and y=0..nTbH-1, are derived as follows: -If both SubWidthC and SubHeightC are equal to 1, the following applies: pDsY[x][y], where x=1..nTbW-1 and y=1..nTbH-1, is derived as follows: pDstY[x][y]=pY[x][y] (360) - If not, the following applies: The one-dimensional filter coefficient arrays F1 and F2 and the two-dimensional filter coefficient arrays F3 and F4 are defined as follows: F1[0]=2, F1[1]=0 (361) F2[0]=1, F2[1]=2, F2[2]=1 (362) F3[i][j]=F4[i][j]=0,i=0..2,j=0..2 (363) -If both SubWidthC and SubHeightC are equal to 2, the following applies: F1[0]=1, F1[1]=1 (364) F3[0][1]=1,F3[1][1]=4,F3[2][1]=1,F3[1][0]=1,F3[1][2]=1 (365) F4[0][1]=1,F4[1][1]=2,F4[2][1]=1 (366) F4[0][2]=1,F4[1][2]=2,F4[2][2]=1 (367) - If not, the following applies: F3[1][1]=8 (368) F4[0][1]=2,F4[1][1]=4,F4[2][1]=2 (369)
[0314] - when sps_chroma_vertical_collocated_flag is equal to 1, the following applies: pDsY[x][y], where x=1..nTbW-1 and y=1..nTbH-1, is derived as follows: pDsY[x][y]=(F3[1][0]*pY[SubWidthC*x][SubHeightC*y-1]+ F3[0][1]*pY[SubWidthC*x-1][SubHeightC*y]+ F3[1][1]*pY[SubWidthC*x][SubHeightC*y]+ F3[2][1]* pY[SubWidthC*x+1][SubHeightC*y]+ F3[1][2]*pY[SubWidthC*x][SubHeightC*y+1]+4)>>3 (370) - Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies: pDsY[x][y], where x=1..nTbW-1 and y=1..nTbH-1, is derived as follows: pDsY[x][y]=(F4[0][1]*pY[SubWidthC*x-1][SubHeightC*y]+ F4[0][2]*pY[SubWidthC*x-1][SubHeightC*y+1]+ F4[1][1]*pY[SubWidthC*x][SubHeightC*y]+ F4[1][2]*pY[SubWidthC*x][SubHeightC*y+1]+ F4[2][1]*pY[SubWidthC*x+1][SubHeightC*y]+ F4[2][2]*pY[SubWidthC*x+1][SubHeightC*y+1]+4)>>3 (371)
[0315] 4. If numSampL is greater than 0, the selected neighboring left chroma sample pSelC[idx] is set equal to p[-1][pickPosL[idx]], idx=0..cntL-1, and the selected downsampled neighboring left luma sample pSelDsY[idx], idx=0..cntL-1, is derived as follows: - The variable y is set equal to pickPosL[idx]. -If both SubWidthC and SubHeightC are equal to 1, the following applies: pSelDsY[idx]=pY[-1][y] (372) - If not, the following applies: - when sps_chroma_vertical_collocated_flag is equal to 1, the following applies: pSelDsY[idx]=(F3[1][0]*pY[-SubWidthC][SubHeightC*y-1]+ F3[0][1]*pY[-1-SubWidthC][SubHeightC*y]+ F3[1][1]*pY[-SubWidthC][SubHeightC*y]+ F3[2][1]*pY[1-SubWidthC][SubHeightC*y]+ F3[1][2]*pY[-SubWidthC][SubHeightC*y+1]+4)>>3 (373) - Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies: pSelDsY[idx]=(F4[0][1]*pY[-1-SubWidthC][SubHeightC*y]+ F4[0][2]*pY[-1-SubWidthC][SubHeightC*y+1]+ F4[1][1]*pY[-SubWidthC][SubHeightC*y]+ F4[1][2]*pY[-SubWidthC][SubHeightC*y+1]+ F4[2][1]*pY[1-SubWidthC][SubHeightC*y]+ F4[2][2]*pY[1-SubWidthC][SubHeightC*y+1]+4)>>3 (374)
[0316] 5. If numSampT is greater than 0, the top chroma sample of the selected neighborhood pSelC[idx] is set equal to p[pickPost[idx-cntL][-1], where idx=cntL..cntL+cntT-1, and the top luma sample of the downsampled neighborhood pSelDsY[idx], for idx=0..cntL+cntT-1, is defined as follows: - The variable x is set equal to pickPost[idx-cntL]. -If both SubWidthC and SubHeightC are equal to 1, the following applies: pSelDsY[idx]=pY[x][-1] (375) - If not, the following applies: - when sps_chroma_vertical_collocated_flag is equal to 1, the following applies: When -bCTUboundary is equal to FALSE, the following applies: pSelDsY[idx]=(F3[1][0]*pY[SubWidthC*x][-1-SubHeightC]+ F3[0][1]*pY[SubWidthC*x-1][-SubHeightC]+ F3[1][1]*pY[SubWidthC*x][-SubHeightC]+ F3[2][1]*pY[SubWidthC*x+1][-SubHeightC]+ F3[1][2]*pY[SubWidthC*x][1-SubHeightC]+4)>>3 (376) - Otherwise (bCTUboundary is equal to TRUE), the following applies: pSelDsY[idx]=(F2[0]*pY[SubWidthC*x-1][-1]+ F2[1]*pY[SubWidthC*x][-1]+ F2[2]*pY[SubWidthC*x+1][-1]+2)>>2 (377)
[0317] - Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies: When -bCTUboundary is equal to FALSE, the following applies: pSelDsY[idx]=(F4[0][1]*pY[SubWidthCx-1][-1]+ F4[0][2]*pY[SubWidthC*x-1][-2]+ F4[1][1]*pY[SubWidthC*x][-1]+ F4[1][2]*pY[SubWidthC*x][-2]+ F4[2][1]*pY[SubWidthC*x+1][-1]+ F4[2][2]*pY[SubWidthC*x+1][-2]+4)>>3 (378) - Otherwise (bCTUboundary is equal to TRUE), the following applies: pSelDsY[idx]=(F2[0]*pY[SubWidthC*x-1][-1]+ F2[1]*pY[SubWidthC*x][-1]+ F2[2]*pY[SubWidthC*x+1][-1]+2)>>2 (379)
[0318] 6. If cntT+cntL is not equal to 0, then the variables minY, maxY, minC, and maxC are derived as follows: If -cntT+cntL is equal to 2, then in Comp substituted for DsY and C, pSelComp[3] is set equal to pSelComp[0], pSelComp[2] is set equal to pSelComp[1], pSelComp[0] is set equal to pSelComp[1], and pSelComp[1] is set equal to pSelComp[3]. - The arrays minGrpIdx and maxGrpIdx are derived as follows: minGrpIdx[0]=0 (380) minGrpIdx[1]=2 (381) maxGrpIdx[0]=1 (382) maxGrpIdx[1]=3 (383)
[0319] - If pSelDsY[minGrpIdx[0]] is greater than pSelDsY[minGrpIdx[1], minGrpIdx[0] and minGrpIdx[1] are swapped as follows: (minGrpIdx[0],minGrpIdx[1])=Swap(minGrpIdx[0],minGrpIdx[1]) (384) - If pSelDsY[maxGrpIdx[0]] is greater than pSelDsY[maxGrpIdx[1], maxGrpIdx[0] and maxGrpIdx[1] are swapped as follows: (maxGrpIdx[0],maxGrpIdx[1])=Swap(maxGrpIdx[0],maxGrpIdx[1]) (385) - If pSelDsY[minGrpIdx[0]] is greater than pSelDsY[maxGrpIdx[1], the arrays minGrpIdx and maxGrpIdx are swapped as follows: (minGrpIdx,maxGrpIdx)=Swap(minGrpIdx,maxGrpIdx) (386) - If pSelDsY[minGrpIdx[1]] is greater than pSelDsY[maxGrpIdx[0], minGrpIdx[1] and maxGrpIdx[0] are swapped as follows: (minGrpIdx[1],maxGrpIdx[0])=Swap(minGrpIdx[1],maxGrpIdx[0]) (387) The variables maxY, maxC, minY and minC are derived as follows: maxY=(pSelDsY[maxGrpIdx[0]]+pSelDsY[maxGrpIdx[1]]+1)>>1 (388) maxC=(pSelC[maxGrpIdx[0]]+pSelC[maxGrpIdx[1]]+1)>>1 (389) minY=(pSelDsY[minGrpIdx[0]]+pSelDsY[minGrpIdx[1]]+1)>>1 (390) minC=(pSelC[minGrpIdx[0]]+pSelC[minGrpIdx[1]]+1)>>1 (391)
[0320] 7. The variables a, b, and k are derived as follows: If -numSampL is equal to 0 and numSampT is equal to 0, the following applies: k=0 (392) a=0 (393) b=1<<(BitDepth-1) (394) - If not, the following applies: diff=maxY-minY (395) If -diff is not equal to 0, the following applies: diffC=maxC-minC (396) x=Floor(Log2(diff)) (397) normDiff=((diff<<4)>>x)&15 (398) x+=(normDiff!=0)?1:0 (399) y=Abs(diffC)>0?Floor(Log2(Abs(diffC)))+1:0 (400) a=(diffC*(divSigTable[normDiff]|8)+2 y-1 )>>y (401) k=((3+xy)<1)?1:3+xy (402) a=((3+xy)<1)?Sign(a)*15:a (403) b=minC-((a*minY)>>k) (404) Here, divSigTable[] is defined as follows: divSigTable[]={0,7,6,5,5,4,4,3,3,2,2,1,1,1,1,0} (405) - Otherwise (diff is equal to 0), the following applies: k=0 (406) a=0 (407) b=minC (408)
[0321] 8. The predicted samples predSamples[x][y], where x=0..nTbW-1 and y=0..nTbH-1, are derived as follows: predSamples[x][y]=Clip1(((pDsY[x][y]*a)>>k)+b) (409) NOTE - This process uses sps_chroma_vertical_collocated_flag, but for simplicity of implementation, does not use sps_chroma_horizontal_collocated_flag.
[0322] 5.11. Eleventh embodiment The working draft specified in JVET-Q2001-vE can be modified as follows:
[0323] 8.4.5.2.13 The inputs to this process are: - intra prediction mode predModeIntra, - the sample position (xTbC, yTbC) of the top-left sample of the current transform block relative to the top-left sample of the current picture, - the variable nTbW, which defines the width of the transformation block; - the variable nTbH, which defines the height of the transformation block; - the variable cIdx, which defines the color components of the current block; -Let x=-1, y=0..2*nTbH-1 and x=0..2*nTbW-1, y=-1, and let p[x][y] be the saturation neighborhood sample. The output of this process are the predicted samples preSamples[x][y], where x=0..nTbW-1, y=0..nTbH-1.
[0324] The current luminance position (xTbY, yTbY) is derived as follows. (xTbY,yTbY)=(xTbC<<(SubWidthC-1),yTbC<<(SubHeightC-1)) (351) The variables availL, availT and availTL are derived as follows. - The derivation process for neighborhood block availability specified in Section 6.4.4 is invoked with the current luminance position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighborhood luminance position (xTbY-1, yTbY), checkPredModeY set equal to FALSE, and cIdx as input, and assigns the output to availL. - The derivation process for neighborhood block availability specified in Section 6.4.4 is invoked with the current luminance position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighborhood luminance position (xTbY, yTbY-1), checkPredModeY set equal to FALSE, and cIdx as input, and assigns the output to availT.
[0325] [[-The variable availTL is derived as follows: availTL=availL&&availT (352)]] - The number of available chroma samples in the top right neighborhood, numTopRight, is derived as follows: The variable numTopRight is set equal to 0 and availTR is set equal to TRUE. -If preModeIntra is equal to INTRA_T_CCLM, the following applies for x=nTbW..2*nTbW-1 until either availTR is equal to FALSE or x is equal to 2*nTbW-1: - The derivation process for neighborhood block availability specified in Section 6.4.4 is invoked with the current luminance position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighborhood luminance position (xTbY+x, yTbY-1), checkPredModeY set equal to FALSE, and cIdx as input, and assigns the output to availTR. If -availTR is equal to TRUE, numTopRight is increased by one. - The number of available bottom-left neighboring chroma samples, numLeftBelow, is derived as follows: The variable numLeftBelow is set equal to 0 and availLB is set equal to TRUE. - if preModeIntra is equal to INTRA_L_CCLM, the following applies for y=nTbH..2*nTbH-1 until either availLB is equal to FALSE or y is equal to 2*nTbH-1: - The derivation process for neighborhood block availability specified in Section 6.4.4 is invoked with the current luminance position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighborhood luminance position (xTbY-1, yTbY+y), checkPredModeY set equal to FALSE, and cIdx as input, and assigns the output to availLB. If -availLB is equal to TRUE, numLeftBelow is increased by one.
[0326] The number of available neighboring chroma samples in the top and top-right numSampT and the number of available neighboring chroma samples in the left and bottom-left numSampL are derived as follows: -If predModeIntra is equal to INTRA_LT_CCLM, the following applies: numSampT=availT?nTbW:0 (353) numSampL=availL?nTbH:0 (354) - If not, the following applies: numSampT=(availT&&predModeIntra==INTRA_T_CCLM)?(nTbW+Min(numTopRight,nTbH)):0 (355) numSampL=(availL&&predModeIntra==INTRA_L_CCLM)?(nTbH+Min(numLeftBelow,nTbW)):0 (356)
[0327] The variable bCTUboundary is derived as follows. bCTUboundary=(yTbY&(CtbSizeY-1)==0)?TRUE:FALSE (357) The variable cntN and the array pickPosN, with N replaced by L and T, are derived as follows: The variable numIs4N is derived as follows: numIs4N=((availT&&availL&&predModeIntra==INTRA_LT_CCLM)?0:1) (358) - The variable startPosN is set equal to numSampN>(2+numIs4N). - The variable pickStepN is set equal to Max(1,numSampN>(1+numIs4N)). If -availN is equal to TRUE and preModeIntra is equal to INTRA_LT_CCLM or INTRA_N_CCLM, the following allocations are made: -cntN is set equal to Min(numSampN, (1+numIs4N)<<1). -pospickPosN[pos] is set equal to (startPosN+pos*pospickStepN), where pos=0..cntN-1. Otherwise, cntN is set equal to 0. The predicted samples predSamples[x][y], where x=0..nTbW-1 and y=0..nTbH-1, are derived as follows: If both -numSampL and numSampT are equal to 0, the following applies: predSamples[x][y]=1<<(BitDepth-1) (359)
[0328] - Otherwise, the following ordered steps apply: 1. The co-located luma sample pY[x][y], where x=0..nTbW*SubWidthC-1, y=0..nTbH*SubHeightC-1, is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y).
[0329] [ka]
[0330] 3. The downsampled and arranged luminance samples pDsY[x][y], where x=0..nTbW-1 and y=0..nTbH-1, are derived as follows: -If both SubWidthC and SubHeightC are equal to 1, the following applies: pDsY[x][y], where x=1..nTbW-1 and y=1..nTbH-1, is derived as follows: pDstY[x][y]=pY[x][y] (360) - If not, the following applies: The one-dimensional filter coefficient arrays F1 and F2 and the two-dimensional filter coefficient arrays F3 and F4 are defined as follows: F1[0]=2, F1[1]=0 (361) F2[0]=1, F2[1]=2, F2[2]=1 (362) F3[i][j]=F4[i][j]=0,i=0..2,j=0..2 (363) -If both SubWidthC and SubHeightC are equal to 2, the following applies: F1[0]=1, F1[1]=1 (364) F3[0][1]=1,F3[1][1]=4,F3[2][1]=1,F3[1][0]=1,F3[1][2]=1 (365) F4[0][1]=1,F4[1][1]=2,F4[2][1]=1 (366) F4[0][2]=1,F4[1][2]=2,F4[2][2]=1 (367) - If not, the following applies: F3[1][1]=8 (368) F4[0][1]=2,F4[1][1]=4,F4[2][1]=2 (369)
[0331] - when sps_chroma_vertical_collocated_flag is equal to 1, the following applies: pDsY[x][y], where x=1..nTbW-1 and y=1..nTbH-1, is derived as follows: pDsY[x][y]=(F3[1][0]*pY[SubWidthC*x][SubHeightC*y-1]+ F3[0][1]*pY[SubWidthC*x-1][SubHeightC*y]+ F3[1][1]*pY[SubWidthC*x][SubHeightC*y]+ F3[2][1]*pY[SubWidthC*x+1][SubHeightC*y]+ F3[1][2]*pY[SubWidthC*x][SubHeightC*y+1]+4)>>3 (370) - Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies: pDsY[x][y], where x=1..nTbW-1 and y=1..nTbH-1, is derived as follows: pDsY[x][y]=(F4[0][1]*pY[SubWidthC*x-1][SubHeightC*y]+ F4[0][2]*pY[SubWidthC*x-1][SubHeightC*y+1]+ F4[1][1]*pY[SubWidthC*x][SubHeightC*y]+ F4[1][2]*pY[SubWidthC*x][SubHeightC*y+1]+ F4[2][1]*pY[SubWidthC*x+1][SubHeightC*y]+ F4[2][2]*pY[SubWidthC*x+1][SubHeightC*y+1]+4)>>3 (371)
[0332] 4. If numSampL is greater than 0, the selected neighboring left chroma sample pSelC[idx] is set equal to p[-1][pickPosL[idx]], idx=0..cntL-1, and the selected downsampled neighboring left luma sample pSelDsY[idx], idx=0..cntL-1, is derived as follows: - The variable y is set equal to pickPosL[idx]. -If both SubWidthC and SubHeightC are equal to 1, the following applies: pSelDsY[idx]=pY[-1][y] (372) - If not, the following applies: - when sps_chroma_vertical_collocated_flag is equal to 1, the following applies: pSelDsY[idx]=(F3[1][0]*pY[-SubWidthC][SubHeightC*y-1]+ F3[0][1]*pY[-1-SubWidthC][SubHeightC*y]+ F3[1][1]*pY[-SubWidthC][SubHeightC*y]+ F3[2][1]*pY[1-SubWidthC][SubHeightC*y]+ F3[1][2]*pY[-SubWidthC][SubHeightC*y+1]+4)>>3 (373)
[0333] - Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies: pSelDsY[idx]=(F4[0][1]*pY[-1-SubWidthC][SubHeightC*y]+ F4[0][2]*pY[-1-SubWidthC][SubHeightC*y+1]+ F4[1][1]*pY[-SubWidthC][SubHeightC*y]+ F4[1][2]*pY[-SubWidthC][SubHeightC*y+1]+ F4[2][1]*pY[1-SubWidthC][SubHeightC*y]+ F4[2][2]*pY[1-SubWidthC][SubHeightC*y+1]+4)>>3 (374)
[0334] 5. If numSampT is greater than 0, the top chroma sample of the selected neighborhood pSelC[idx] is set equal to p[pickPost[idx-cntL][-1], where idx=cntL..cntL+cntT-1, and the top luma sample of the downsampled neighborhood pSelDsY[idx], for idx=0..cntL+cntT-1, is defined as follows: - The variable x is set equal to pickPost[idx-cntL]. -If both SubWidthC and SubHeightC are equal to 1, the following applies: pSelDsY[idx]=pY[x][-1] (375) - If not, the following applies: - when sps_chroma_vertical_collocated_flag is equal to 1, the following applies: When -bCTUboundary is equal to FALSE, the following applies: pSelDsY[idx]=(F3[1][0]*pY[SubWidthC*x][-1-SubHeightC]+ F3[0][1]*pY[SubWidthC*x-1][-SubHeightC]+ F3[1][1]*pY[SubWidthC*x][-SubHeightC]+ F3[2][1]*pY[SubWidthC*x+1][-SubHeightC]+ F3[1][2]*pY[SubWidthC*x][1-SubHeightC]+4)>>3 (376) - Otherwise (bCTUboundary is equal to TRUE), the following applies: pSelDsY[idx]=(F2[0]*pY[SubWidthC*x-1][-1]+ F2[1]*pY[SubWidthC*x][-1]+ F2[2]*pY[SubWidthC*x+1][-1]+2)>>2 (377)
[0335] - Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies: When -bCTUboundary is equal to FALSE, the following applies: pSelDsY[idx]=(F4[0][1]*pY[SubWidthCx-1][-1]+ F4[0][2]*pY[SubWidthC*x-1][-2]+ F4[1][1]*pY[SubWidthC*x][-1]+ F4[1][2]*pY[SubWidthC*x][-2]+ F4[2][1]*pY[SubWidthC*x+1][-1]+ F4[2][2]*pY[SubWidthC*x+1][-2]+4)>>3 (378) - Otherwise (bCTUboundary is equal to TRUE), the following applies: pSelDsY[idx]=(F2[0]*pY[SubWidthC*x-1][-1]+ F2[1]*pY[SubWidthC*x][-1]+ F2[2]*pY[SubWidthC*x+1][-1]+2)>>2 (379)
[0336] 6. If cntT+cntL is not equal to 0, then the variables minY, maxY, minC, and maxC are derived as follows: If -cntT+cntL is equal to 2, then in Comp substituted for DsY and C, pSelComp[3] is set equal to pSelComp[0], pSelComp[2] is set equal to pSelComp[1], pSelComp[0] is set equal to pSelComp[1], and pSelComp[1] is set equal to pSelComp[3]. - The arrays minGrpIdx and maxGrpIdx are derived as follows: minGrpIdx[0]=0 (380) minGrpIdx[1]=2 (381) maxGrpIdx[0]=1 (382) maxGrpIdx[1]=3 (383)
[0337] - If pSelDsY[minGrpIdx[0]] is greater than pSelDsY[minGrpIdx[1], minGrpIdx[0] and minGrpIdx[1] are swapped as follows: (minGrpIdx[0],minGrpIdx[1])=Swap(minGrpIdx[0],minGrpIdx[1]) (384) - If pSelDsY[maxGrpIdx[0]] is greater than pSelDsY[maxGrpIdx[1], maxGrpIdx[0] and maxGrpIdx[1] are swapped as follows: (maxGrpIdx[0],maxGrpIdx[1])=Swap(maxGrpIdx[0],maxGrpIdx[1]) (385) - If pSelDsY[minGrpIdx[0]] is greater than pSelDsY[maxGrpIdx[1], the arrays minGrpIdx and maxGrpIdx are swapped as follows: (minGrpIdx,maxGrpIdx)=Swap(minGrpIdx,maxGrpIdx) (386) - If pSelDsY[minGrpIdx[1]] is greater than pSelDsY[maxGrpIdx[0], minGrpIdx[1] and maxGrpIdx[0] are swapped as follows: (minGrpIdx[1],maxGrpIdx[0])=Swap(minGrpIdx[1],maxGrpIdx[0]) (387) The variables maxY, maxC, minY and minC are derived as follows: maxY=(pSelDsY[maxGrpIdx[0]]+pSelDsY[maxGrpIdx[1]]+1)>>1 (388) maxC=(pSelC[maxGrpIdx[0]]+pSelC[maxGrpIdx[1]]+1)>>1 (389) minY=(pSelDsY[minGrpIdx[0]]+pSelDsY[minGrpIdx[1]]+1)>>1 (390) minC=(pSelC[minGrpIdx[0]]+pSelC[minGrpIdx[1]]+1)>>1 (391)
[0338] 7. The variables a, b, and k are derived as follows: If -numSampL is equal to 0 and numSampT is equal to 0, the following applies: k=0 (392) a=0 (393) b=1<<(BitDepth-1) (394) - If not, the following applies: diff=maxY-minY (395) If -diff is not equal to 0, the following applies: diffC=maxC-minC (396) x=Floor(Log2(diff)) (397) normDiff=((diff<<4)>>x)&15 (398) x+=(normDiff!=0)?1:0 (399) y=Abs(diffC)>0?Floor(Log2(Abs(diffC)))+1:0 (400) a=(diffC*(divSigTable[normDiff]|8)+2 y-1 )>>y (401) k=((3+xy)<1)?1:3+xy (402) a=((3+xy)<1)?Sign(a)*15:a (403) b=minC-((a*minY)>>k) (404) Here, divSigTable[] is defined as follows: divSigTable[]={0,7,6,5,5,4,4,3,3,2,2,1,1,1,1,0} (405) - Otherwise (diff is equal to 0), the following applies: k=0 (406) a=0 (407) b=minC (408)
[0339] 8. The predicted samples predSamples[x][y], where x=0..nTbW-1 and y=0..nTbH-1, are derived as follows: predSamples[x][y]=Clip1(((pDsY[x][y]*a)>>k)+b) (409) NOTE - This process uses sps_chroma_vertical_collocated_flag, but for simplicity of implementation, does not use sps_chroma_horizontal_collocated_flag.
[0340] 5.12. Twelfth embodiment The working draft specified in JVET-Q2001-vE can be modified as follows:
[0341] 8.4.5.2.13 The inputs to this process are: - intra prediction mode predModeIntra, - the sample position (xTbC, yTbC) of the top-left sample of the current transform block relative to the top-left sample of the current picture, - the variable nTbW, which defines the width of the transformation block; - the variable nTbH, which defines the height of the transformation block; - the variable cIdx, which defines the color components of the current block; -Let x=-1, y=0..2*nTbH-1 and x=0..2*nTbW-1, y=-1, and let p[x][y] be the saturation neighborhood sample. The output of this process are the predicted samples preSamples[x][y], where x=0..nTbW-1, y=0..nTbH-1. The current luminance position (xTbY, yTbY) is derived as follows. (xTbY,yTbY)=(xTbC<<(SubWidthC-1),yTbC<<(SubHeightC-1)) (351)
[0342] The variables availL, availT and availTL are derived as follows. - The derivation process for neighborhood block availability specified in Section 6.4.4 is invoked with the current luminance position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighborhood luminance position (xTbY-1, yTbY), checkPredModeY set equal to FALSE, and cIdx as input, and assigns the output to availL. - The derivation process for neighborhood block availability specified in Section 6.4.4 is invoked with the current luminance position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighborhood luminance position (xTbY, yTbY-1), checkPredModeY set equal to FALSE, and cIdx as input, and assigns the output to availT.
[0343] The variable availTL is derived as follows: availTL=availL&&availT (352) - The number of available chroma samples in the top right neighborhood, numTopRight, is derived as follows: The variable numTopRight is set equal to 0 and availTR is set equal to TRUE. -If preModeIntra is equal to INTRA_T_CCLM, the following applies for x=nTbW..2*nTbW-1 until either availTR is equal to FALSE or x is equal to 2*nTbW-1: - The derivation process for neighborhood block availability specified in Section 6.4.4 is invoked with the current luminance position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighborhood luminance position (xTbY+x, yTbY-1), checkPredModeY set equal to FALSE, and cIdx as input, and assigns the output to availTR. If -availTR is equal to TRUE, numTopRight is increased by one.
[0344] - The number of available bottom-left neighboring chroma samples, numLeftBelow, is derived as follows: The variable numLeftBelow is set equal to 0 and availLB is set equal to TRUE. - if preModeIntra is equal to INTRA_L_CCLM, the following applies for y=nTbH..2*nTbH-1 until either availLB is equal to FALSE or y is equal to 2*nTbH-1: - The derivation process for neighborhood block availability specified in Section 6.4.4 is invoked with the current luminance position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighborhood luminance position (xTbY-1, yTbY+y), checkPredModeY set equal to FALSE, and cIdx as input, and assigns the output to availLB. If -availLB is equal to TRUE, numLeftBelow is increased by one.
[0345] The number of available neighboring chroma samples in the top and top-right numSampT and the number of available neighboring chroma samples in the left and bottom-left numSampL are derived as follows: -If predModeIntra is equal to INTRA_LT_CCLM, the following applies: numSampT=availT?nTbW:0 (353) numSampL=availL?nTbH:0 (354) - If not, the following applies: numSampT=(availT&&predModeIntra==INTRA_T_CCLM)?(nTbW+Min(numTopRight,nTbH)):0 (355) numSampL=(availL&&predModeIntra==INTRA_L_CCLM)?(nTbH+Min(numLeftBelow,nTbW)):0 (356)
[0346] The variable bCTUboundary is derived as follows. bCTUboundary=(yTbY&(CtbSizeY-1)==0)?TRUE:FALSE (357) The variable cntN and the array pickPosN, with N replaced by L and T, are derived as follows: The variable numIs4N is derived as follows: numIs4N=((availT&&availL&&predModeIntra==INTRA_LT_CCLM)?0:1) (358) - The variable startPosN is set equal to numSampN>(2+numIs4N). - The variable pickStepN is set equal to Max(1,numSampN>(1+numIs4N)). If -availN is equal to TRUE and preModeIntra is equal to INTRA_LT_CCLM or INTRA_N_CCLM, the following allocations are made: -cntN is set equal to Min(numSampN, (1+numIs4N)<<1). -pospickPosN[pos] is set equal to (startPosN+pos*pospickStepN), where pos=0..cntN-1. Otherwise, cntN is set equal to 0.
[0347] The predicted samples predSamples[x][y], where x=0..nTbW-1 and y=0..nTbH-1, are derived as follows: If both -numSampL and numSampT are equal to 0, the following applies: predSamples[x][y]=1<<(BitDepth-1) (359) - Otherwise, the following ordered steps apply: 1. The co-located luma sample pY[x][y], where x=0..nTbW*SubWidthC-1, y=0..nTbH*SubHeightC-1, is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y).
[0348] 2. The neighboring luminance samples pY[x][y] are derived as follows: If -numSampL is greater than 0, the nearby left luma sample pY[x][y], for x=-1..-3, y=0..SubHeightC*numSampL-1, is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y). If -availT is equal to FALSE, the top-most luma sample pY[x][y] in the neighborhood with x=-1..SubWidthC*numSampT-1, y=-1..-2 is set equal to the luma sample pY[x][0]. If -availL is equal to FALSE, the left neighbor luma sample pY[x][y] for x=-1..-3, y=-1..SubHeightC*numSampL-1 is set equal to luma sample pY[0][y]. If -numSampT is greater than 0, the top-most luma sample pY[x][y] in the neighborhood x=0..SubWidthC*numSampT-1, y=-1,-2,-3 is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y). When -availTL is equal to TRUE, the top-left nearby luma sample pY[x][y], where x=-1,-2, y=-1,-2, is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y).
[0349] 3. The downsampled and arranged luminance samples pDsY[x][y], where x=0..nTbW-1 and y=0..nTbH-1, are derived as follows: -If both SubWidthC and SubHeightC are equal to 1, the following applies: pDsY[x][y], where x=1..nTbW-1 and y=1..nTbH-1, is derived as follows: pDstY[x][y]=pY[x][y] (360) - If not, the following applies: The one-dimensional filter coefficient arrays F1 and F2 and the two-dimensional filter coefficient arrays F3 and F4 are defined as follows: F1[0]=2, F1[1]=0 (361) F2[0]=1, F2[1]=2, F2[2]=1 (362) F3[i][j]=F4[i][j]=0,i=0..2,j=0..2 (363) -If both SubWidthC and SubHeightC are equal to 2, the following applies: F1[0]=1, F1[1]=1 (364) F3[0][1]=1,F3[1][1]=4,F3[2][1]=1,F3[1][0]=1,F3[1][2]=1 (365) F4[0][1]=1,F4[1][1]=2,F4[2][1]=1 (366) F4[0][2]=1,F4[1][2]=2,F4[2][2]=1 (367) - If not, the following applies: F3[1][1]=8 (368) F4[0][1]=2,F4[1][1]=4,F4[2][1]=2 (369)
[0350] - when sps_chroma_vertical_collocated_flag is equal to 1, the following applies: pDsY[x][y], where x=1..nTbW-1 and y=1..nTbH-1, is derived as follows: pDsY[x][y]=(F3[1][0]*pY[SubWidthC*x][SubHeightC*y-1]+ F3[0][1]*pY[SubWidthC*x-1][SubHeightC*y]+ F3[1][1]*pY[SubWidthC*x][SubHeightC*y]+ F3[2][1]*pY[SubWidthC*x+1][SubHeightC*y]+ F3[1][2]*pY[SubWidthC*x][SubHeightC*y+1]+4)>>3 (370)
[0351] - Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies: pDsY[x][y], where x=1..nTbW-1 and y=1..nTbH-1, is derived as follows: pDsY[x][y]=(F4[0][1]*pY[SubWidthC*x-1][SubHeightC*y]+ F4[0][2]*pY[SubWidthC*x-1][SubHeightC*y+1]+ F4[1][1]*pY[SubWidthC*x][SubHeightC*y]+ F4[1][2]*pY[SubWidthC*x][SubHeightC*y+1]+ F4[2][1]*pY[SubWidthC*x+1][SubHeightC*y]+ F4[2][2]*pY[SubWidthC*x+1][SubHeightC*y+1]+4)>>3 (371)
[0352] 4. If numSampL is greater than 0, the selected neighboring left chroma sample pSelC[idx] is set equal to p[-1][pickPosL[idx]], idx=0..cntL-1, and the selected downsampled neighboring left luma sample pSelDsY[idx], idx=0..cntL-1, is derived as follows: - The variable y is set equal to pickPosL[idx]. -If both SubWidthC and SubHeightC are equal to 1, the following applies: pSelDsY[idx] = pY[-1][y] (372) - If not, the following applies: - when sps_chroma_vertical_collocated_flag is equal to 1, the following applies: pSelDsY[idx]=(F3[1][0]*pY[-SubWidthC][SubHeightC*y-1]+ F3[0][1]*pY[-1-SubWidthC][SubHeightC*y]+ F3[1][1]*pY[-SubWidthC][SubHeightC*y]+ F3[2][1]*pY[1-SubWidthC][SubHeightC*y]+ F3[1][2]*pY[-SubWidthC][SubHeightC*y+1]+4)>>3 (373)
[0353] - Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies: pSelDsY[idx]=(F4[0][1]*pY[-1-SubWidthC][SubHeightC*y]+ F4[0][2]*pY[-1-SubWidthC][SubHeightC*y+1]+ F4[1][1]*pY[-SubWidthC][SubHeightC*y]+ F4[1][2]*pY[-SubWidthC][SubHeightC*y+1]+ F4[2][1]*pY[1-SubWidthC][SubHeightC*y]+ F4[2][2]*pY[1-SubWidthC][SubHeightC*y+1]+4)>>3 (374)
[0354] 5. If numSampT is greater than 0, the top chroma sample of the selected neighborhood pSelC[idx] is set equal to p[pickPost[idx-cntL][-1], where idx=cntL..cntL+cntT-1, and the top luma sample of the downsampled neighborhood pSelDsY[idx], for idx=0..cntL+cntT-1, is defined as follows: - The variable x is set equal to pickPost[idx-cntL]. -If both SubWidthC and SubHeightC are equal to 1, the following applies: pSelDsY[idx]=pY[x][-1] (375) - If not, the following applies: - when sps_chroma_vertical_collocated_flag is equal to 1, the following applies: When -bCTUboundary is equal to FALSE, the following applies: pSelDsY[idx]=(F3[1][0]*pY[SubWidthC*x][-1-SubHeightC]+ F3[0][1]*pY[SubWidthC*x-1][-SubHeightC]+ F3[1][1]*pY[SubWidthC*x][-SubHeightC]+ F3[2][1]*pY[SubWidthC*x+1][-SubHeightC]+ F3[1][2]*pY[SubWidthC*x][1-SubHeightC]+4)>>3 (376)
[0355] - Otherwise (bCTUboundary is equal to TRUE), the following applies: pSelDsY[idx]=(F2[0]*pY[SubWidthC*x-1][-1]+ F2[1]*pY[SubWidthC*x][-1]+ F2[2]*pY[SubWidthC*x+1][-1]+2)>>2 (377) - Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies: When -bCTUboundary is equal to FALSE, the following applies: pSelDsY[idx]=(F4[0][1]*pY[SubWidthCx-1][-1]+ F4[0][2]*pY[SubWidthC*x-1][-2]+ F4[1][1]*pY[SubWidthC*x][-1]+ F4[1][2]*pY[SubWidthC*x][-2]+ F4[2][1]*pY[SubWidthC*x+1][-1]+ F4[2][2]*pY[SubWidthC*x+1][-2]+4)>>3 (378) - Otherwise (bCTUboundary is equal to TRUE), the following applies: pSelDsY[idx]=(F2[0]*pY[SubWidthC*x-1][-1]+ F2[1]*pY[SubWidthC*x][-1]+ F2[2]*pY[SubWidthC*x+1][-1]+2)>>2 (379)
[0356] 6. If cntT+cntL is not equal to 0, then the variables minY, maxY, minC, and maxC are derived as follows: If -cntT+cntL is equal to 2, then in Comp substituted for DsY and C, pSelComp[3] is set equal to pSelComp[0], pSelComp[2] is set equal to pSelComp[1], pSelComp[0] is set equal to pSelComp[1], and pSelComp[1] is set equal to pSelComp[3]. - The arrays minGrpIdx and maxGrpIdx are derived as follows: minGrpIdx[0]=0 (380) minGrpIdx[1]=2 (381) maxGrpIdx[0]=1 (382) maxGrpIdx[1]=3 (383)
[0357] - If pSelDsY[minGrpIdx[0]] is greater than pSelDsY[minGrpIdx[1], minGrpIdx[0] and minGrpIdx[1] are swapped as follows: (minGrpIdx[0],minGrpIdx[1])=Swap(minGrpIdx[0],minGrpIdx[1]) (384) - If pSelDsY[maxGrpIdx[0]] is greater than pSelDsY[maxGrpIdx[1], maxGrpIdx[0] and maxGrpIdx[1] are swapped as follows: (maxGrpIdx[0],maxGrpIdx[1])=Swap(maxGrpIdx[0],maxGrpIdx[1]) (385) - If pSelDsY[minGrpIdx[0]] is greater than pSelDsY[maxGrpIdx[1], the arrays minGrpIdx and maxGrpIdx are swapped as follows: (minGrpIdx,maxGrpIdx)=Swap(minGrpIdx,maxGrpIdx) (386) - If pSelDsY[minGrpIdx[1]] is greater than pSelDsY[maxGrpIdx[0], minGrpIdx[1] and maxGrpIdx[0] are swapped as follows: (minGrpIdx[1],maxGrpIdx[0])=Swap(minGrpIdx[1],maxGrpIdx[0]) (387) The variables maxY, maxC, minY and minC are derived as follows: maxY=(pSelDsY[maxGrpIdx[0]]+pSelDsY[maxGrpIdx[1]]+1)>>1 (388) maxC=(pSelC[maxGrpIdx[0]]+pSelC[maxGrpIdx[1]]+1)>>1 (389) minY=(pSelDsY[minGrpIdx[0]]+pSelDsY[minGrpIdx[1]]+1)>>1 (390) minC=(pSelC[minGrpIdx[0]]+pSelC[minGrpIdx[1]]+1)>>1 (391)
[0358] 7. The variables a, b, and k are derived as follows: If -numSampL is equal to 0 and numSampT is equal to 0, the following applies: k=0 (392) a=0 (393) b=1<<(BitDepth-1) (394) - If not, the following applies: diff=maxY-minY (395) If -diff is not equal to 0, the following applies: diffC=maxC-minC (396) x=Floor(Log2(diff)) (397) normDiff=((diff<<4)>>x)&15 (398) x+=(normDiff!=0)?1:0 (399) y=Abs(diffC)>0?Floor(Log2(Abs(diffC)))+1:0 (400) a=(diffC*(divSigTable[normDiff]|8)+2 y-1 )>>y (401) k=((3+xy)<1)?1:3+xy (402) a=((3+xy)<1)?Sign(a)*15:a (403) b=minC-((a*minY)>>k) (404) Here, divSigTable[] is defined as follows: divSigTable[]={0,7,6,5,5,4,4,3,3,2,2,1,1,1,1,0} (405) - Otherwise (diff is equal to 0), the following applies: k=0 (406) a=0 (407) b=minC (408)
[0359] 8. The predicted samples predSamples[x][y], where x=0..nTbW-1 and y=0..nTbH-1, are derived as follows: predSamples[x][y]=Clip1(((pDsY[x][y]*a)>>k)+b) (409) NOTE - This process uses sps_chroma_vertical_collocated_flag, but for simplicity of implementation, does not use sps_chroma_horizontal_collocated_flag.
[0360] 5.13. EMBODIMENT 13 The working draft specified in JVET-Q2001-vE can be modified as follows:
[0361] 8.4.5.2.13 Specification of the INTRA_LT_CCLM, INTRA_L_CCLM, and INTRA_T_CCLM intra prediction modes The predicted samples predSamples[x][y], where x=0..nTbW-1 and y=0..nTbH-1, are derived as follows: If both -numSampL and numSampT are equal to 0, the following applies: predSamples[x][y]=1<<(BitDepth-1) (359)
[0362] - Otherwise, the following ordered steps apply: 1. The co-located luma sample pY[x][y], where x=0..nTbW*SubWidthC-1, y=0..nTbH*SubHeightC-1, is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y).
[0363] [ka]
[0364] 5.14. Fourteenth embodiment The working draft specified in JVET-Q2001-vE can be modified as follows:
[0365] 8.4.5.2.13 Specification of the INTRA_LT_CCLM, INTRA_L_CCLM, and INTRA_T_CCLM intra prediction modes The predicted samples predSamples[x][y], where x=0..nTbW-1 and y=0..nTbH-1, are derived as follows: If both -numSampL and numSampT are equal to 0, the following applies: predSamples[x][y]=1<<(BitDepth-1) (359)
[0366] - Otherwise, the following ordered steps apply: 1. The co-located luma sample pY[x][y], where x=0..nTbW*SubWidthC-1, y=0..nTbH*SubHeightC-1, is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y).
[0367] [ka]
[0368] 5.15. EMBODIMENT 15 The working draft specified in JVET-Q2001-vE can be modified as follows:
[0369] 8.4.5.2.13 Specification of the INTRA_LT_CCLM, INTRA_L_CCLM, and INTRA_T_CCLM intra prediction modes The predicted samples predSamples[x][y], where x=0..nTbW-1 and y=0..nTbH-1, are derived as follows: If both -numSampL and numSampT are equal to 0, the following applies: predSamples[x][y]=1<<(BitDepth-1) (359)
[0370] - Otherwise, the following ordered steps apply: 1. The co-located luma sample pY[x][y], where x=0..nTbW*SubWidthC-1, y=0..nTbH*SubHeightC-1, is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y).
[0371] [ka]
[0372] 5.16. Sixteenth embodiment The working draft specified in JVET-Q2001-vE can be modified as follows:
[0373] 8.4.5.2.13 Specification of the INTRA_LT_CCLM, INTRA_L_CCLM, and INTRA_T_CCLM intra prediction modes The predicted samples predSamples[x][y], where x=0..nTbW-1, y=0..nTbH-1, are derived as follows: If both -numSampL and numSampT are equal to 0, the following applies: predSamples[x][y]=1<<(BitDepth-1) (359)
[0374] - Otherwise, the following ordered steps apply: 1. The co-located luma sample pY[x][y], where x=0..nTbW*SubWidthC-1, y=0..nTbH*SubHeightC-1, is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y).
[0375] [ka]
[0376] 5.17. Seventeenth embodiment The working draft specified in JVET-Q2001-vE can be modified as follows:
[0377] 8.4.5.2.13 Specification of the INTRA_LT_CCLM, INTRA_L_CCLM, and INTRA_T_CCLM intra prediction modes The inputs to this process are: - intra prediction mode predModeIntra, - the sample position (xTbC, yTbC) of the top-left sample of the current transform block relative to the top-left sample of the current picture, - the variable nTbW, which defines the width of the transformation block; - the variable nTbH, which defines the height of the transformation block; - the variable cIdx, which defines the color components of the current block; -Let x=-1, y=0..2*nTbH-1 and x=0..2*nTbW-1, y=-1, and let p[x][y] be the saturation neighborhood sample. The output of this process are the predicted samples preSamples[x][y], where x=0..nTbW-1, y=0..nTbH-1.
[0378] [ka]
[0379] 5.18. EMBODIMENT 18 The working draft specified in JVET-Q2001-vE can be modified as follows:
[0380] 8.4.5.2.13 Specification of the INTRA_LT_CCLM, INTRA_L_CCLM, and INTRA_T_CCLM intra prediction modes The predicted samples predSamples[x][y], where x=0..nTbW-1 and y=0..nTbH-1, are derived as follows: If both -numSampL and numSampT are equal to 0, the following applies: predSamples[x][y]=1<<(BitDepth-1) (359)
[0381] - Otherwise, the following ordered steps apply: 1. The co-located luma sample pY[x][y], where x=0..nTbW*SubWidthC-1, y=0..nTbH*SubHeightC-1, is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y).
[0382] [ka]
[0383] 5.19. EMBODIMENT 19 The working draft specified in JVET-Q2001-vE can be modified as follows:
[0384] 8.4.5.2.13 Specification of the INTRA_LT_CCLM, INTRA_L_CCLM, and INTRA_T_CCLM intra prediction modes The predicted samples predSamples[x][y], where x=0..nTbW-1 and y=0..nTbH-1, are derived as follows: If both -numSampL and numSampT are equal to 0, the following applies: predSamples[x][y]=1<<(BitDepth-1) (359) - Otherwise, the following ordered steps apply: 1. The co-located luma sample pY[x][y], where x=0..nTbW*SubWidthC-1, y=0..nTbH*SubHeightC-1, is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y).
[0385] [ka]
[0386] 5.20. EMBODIMENT 20 The working draft specified in JVET-Q2001-vE can be modified as follows:
[0387] 8.4.5.2.13 Specification of the INTRA_LT_CCLM, INTRA_L_CCLM, and INTRA_T_CCLM intra prediction modes The inputs to this process are: - intra prediction mode predModeIntra, - the sample position (xTbC, yTbC) of the top-left sample of the current transform block relative to the top-left sample of the current picture, - the variable nTbW, which defines the width of the transformation block; - the variable nTbH, which defines the height of the transformation block; - the variable cIdx, which defines the color components of the current block; -Let x=-1, y=0..2*nTbH-1 and x=0..2*nTbW-1, y=-1, and let p[x][y] be the saturation neighborhood sample. The output of this process are the predicted samples preSamples[x][y], where x=0..nTbW-1, y=0..nTbH-1. The current luminance position (xTbY, yTbY) is derived as follows. (xTbY,yTbY)=(xTbC<<(SubWidthC-1),yTbC<<(SubHeightC-1)) (351)
[0388] [ka]
[0389] The predicted samples predSamples[x][y], where x=0..nTbW-1 and y=0..nTbH-1, are derived as follows: If both -numSampL and numSampT are equal to 0, the following applies: predSamples[x][y]=1<<(BitDepth-1) (359) - Otherwise, the following ordered steps apply: 1. The co-located luma sample pY[x][y], where x=0..nTbW*SubWidthC-1, y=0..nTbH*SubHeightC-1, is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y).
[0390] [ka]
[0391] 5.21. EMBODIMENT 21 The working draft specified in JVET-Q2001-vE can be modified as follows:
[0392] 8.4.5.2.13 Specification of the INTRA_LT_CCLM, INTRA_L_CCLM, and INTRA_T_CCLM intra prediction modes The predicted samples predSamples[x][y], where x=0..nTbW-1 and y=0..nTbH-1, are derived as follows: If both -numSampL and numSampT are equal to 0, the following applies: predSamples[x][y]=1<<(BitDepth-1) (359)
[0393] - Otherwise, the following ordered steps apply: 1. The co-located luma sample pY[x][y], where x=0..nTbW*SubWidthC-1, y=0..nTbH*SubHeightC-1, is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y).
[0394] [ka]
[0395] 5.22. EMBODIMENT 22 The working draft specified in JVET-Q2001-vE can be modified as follows:
[0396] 8.4.5.2.13 Specification of the INTRA_LT_CCLM, INTRA_L_CCLM, and INTRA_T_CCLM intra prediction modes The predicted samples predSamples[x][y], where x=0..nTbW-1 and y=0..nTbH-1, are derived as follows: If both -numSampL and numSampT are equal to 0, the following applies: predSamples[x][y]=1<<(BitDepth-1) (359) - Otherwise, the following ordered steps apply: 1. The co-located luma sample pY[x][y], where x=0..nTbW*SubWidthC-1, y=0..nTbH*SubHeightC-1, is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y).
[0397] [ka]
[0398] 5.23. EMBODIMENT 23 The working draft specified in JVET-Q2001-vE can be modified as follows:
[0399] 8.4.5.2.13 Specification of the INTRA_LT_CCLM, INTRA_L_CCLM, and INTRA_T_CCLM intra prediction modes The inputs to this process are: - intra prediction mode predModeIntra, - the sample position (xTbC, yTbC) of the top-left sample of the current transform block relative to the top-left sample of the current picture, - the variable nTbW, which defines the width of the transformation block; - the variable nTbH, which defines the height of the transformation block; - the variable cIdx, which defines the color components of the current block; -Let x=-1, y=0..2*nTbH-1 and x=0..2*nTbW-1, y=-1, and let p[x][y] be the saturation neighborhood sample. The output of this process are the predicted samples preSamples[x][y], where x=0..nTbW-1, y=0..nTbH-1. The current luminance position (xTbY, yTbY) is derived as follows. (xTbY,yTbY)=(xTbC<<(SubWidthC-1),yTbC<<(SubHeightC-1)) (351)
[0400] [ka]
[0401] The predicted samples predSamples[x][y], where x=0..nTbW-1 and y=0..nTbH-1, are derived as follows: If both -numSampL and numSampT are equal to 0, the following applies: predSamples[x][y]=1<<(BitDepth-1) (359) - Otherwise, the following ordered steps apply: 1. The co-located luma sample pY[x][y], where x=0..nTbW*SubWidthC-1, y=0..nTbH*SubHeightC-1, is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y).
[0402] [ka]
[0403] 5.24. EMBODIMENT 24 The working draft specified in JVET-Q2001-vE can be modified as follows:
[0404] 8.4.5.2.13 Specification of the INTRA_LT_CCLM, INTRA_L_CCLM, and INTRA_T_CCLM intra prediction modes The inputs to this process are: - intra prediction mode predModeIntra, - the sample position (xTbC, yTbC) of the top-left sample of the current transform block relative to the top-left sample of the current picture, - the variable nTbW, which defines the width of the transformation block; - the variable nTbH, which defines the height of the transformation block; - the variable cIdx, which defines the color components of the current block; -Let x=-1, y=0..2*nTbH-1 and x=0..2*nTbW-1, y=-1, and let p[x][y] be the saturation neighborhood sample. The output of this process are the predicted samples preSamples[x][y], where x=0..nTbW-1, y=0..nTbH-1. The current luminance position (xTbY, yTbY) is derived as follows. (xTbY,yTbY)=(xTbC<<(SubWidthC-1),yTbC<<(SubHeightC-1)) (351)
[0405] [ka]
[0406] The predicted samples predSamples[x][y], where x=0..nTbW-1 and y=0..nTbH-1, are derived as follows: If both -numSampL and numSampT are equal to 0, the following applies: predSamples[x][y]=1<<(BitDepth-1) (359) - Otherwise, the following ordered steps apply: 1. The co-located luma sample pY[x][y], where x=0..nTbW*SubWidthC-1, y=0..nTbH*SubHeightC-1, is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y).
[0407] [ka]
[0408] 5.25. EMBODIMENT 25 The working draft specified in JVET-Q2001-vE can be modified as follows:
[0409] 8.4.5.2.13 Specification of the INTRA_LT_CCLM, INTRA_L_CCLM, and INTRA_T_CCLM intra prediction modes The inputs to this process are: - intra prediction mode predModeIntra, - the sample position (xTbC, yTbC) of the top-left sample of the current transform block relative to the top-left sample of the current picture, - the variable nTbW, which defines the width of the transformation block; - the variable nTbH, which defines the height of the transformation block; - the variable cIdx, which defines the color components of the current block; -Let x=-1, y=0..2*nTbH-1 and x=0..2*nTbW-1,y=-1, and let p[x][y] be the saturation neighborhood sample. The output of this process are the predicted samples preSamples[x][y], where x=0..nTbW-1, y=0..nTbH-1. The current luminance position (xTbY, yTbY) is derived as follows. (xTbY,yTbY)=(xTbC<<(SubWidthC-1),yTbC<<(SubHeightC-1)) (351)
[0410] [ka]
[0411] The predicted samples predSamples[x][y], where x=0..nTbW-1 and y=0..nTbH-1, are derived as follows: If both -numSampL and numSampT are equal to 0, the following applies: predSamples[x][y]=1<<(BitDepth-1) (359) - Otherwise, the following ordered steps apply: 1. The co-located luma sample pY[x][y], where x=0..nTbW*SubWidthC-1, y=0..nTbH*SubHeightC-1, is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y).
[0412] [ka]
[0413] 5.26. EMBODIMENT 26 The working draft specified in JVET-Q2001-vE can be modified as follows:
[0414] 8.4.5.2.13 Specification of the INTRA_LT_CCLM, INTRA_L_CCLM, and INTRA_T_CCLM intra prediction modes The inputs to this process are: - intra prediction mode predModeIntra, - the sample position (xTbC, yTbC) of the top-left sample of the current transform block relative to the top-left sample of the current picture, - the variable nTbW, which defines the width of the transformation block; - the variable nTbH, which defines the height of the transformation block; - the variable cIdx, which defines the color components of the current block; -Let x=-1, y=0..2*nTbH-1 and x=0..2*nTbW-1, y=-1, and let p[x][y] be the saturation neighborhood sample. The output of this process are the predicted samples preSamples[x][y], where x=0..nTbW-1, y=0..nTbH-1. The current luminance position (xTbY, yTbY) is derived as follows. (xTbY,yTbY)=(xTbC<<(SubWidthC-1),yTbC<<(SubHeightC-1)) (351)
[0415] [ka]
[0416] The predicted samples predSamples[x][y], where x=0..nTbW-1 and y=0..nTbH-1, are derived as follows: If both -numSampL and numSampT are equal to 0, the following applies: predSamples[x][y]=1<<(BitDepth-1) (359) - Otherwise, the following ordered steps apply: 1. The co-located luma sample pY[x][y], where x=0..nTbW*SubWidthC-1, y=0..nTbH*SubHeightC-1, is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y).
[0417] [ka]
[0418] 5.27. EMBODIMENT 27 The working draft specified in JVET-Q2001-vE can be modified as follows:
[0419] 8.4.5.2.13 Specification of the INTRA_LT_CCLM, INTRA_L_CCLM, and INTRA_T_CCLM intra prediction modes The predicted samples predSamples[x][y], where x=0..nTbW-1 and y=0..nTbH-1, are derived as follows: If both -numSampL and numSampT are equal to 0, the following applies: predSamples[x][y]=1<<(BitDepth-1) (359) - Otherwise, the following ordered steps apply: 1. The co-located luma sample pY[x][y], where x=0..nTbW*SubWidthC-1, y=0..nTbH*SubHeightC-1, is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y).
[0420] 2. The neighboring luminance samples pY[x][y] are derived as follows: If -numSampL is greater than 0, the nearby left luma sample pY[x][y], for x=-1..-3, y=0..SubHeightC*numSampL-1, is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y). If -availT is equal to FALSE, the top-most luma sample pY[x][y] in the neighborhood with x=-1..SubWidthC*numSampT-1, y=-1..-2 is set equal to the luma sample pY[x][0]. If -availL is equal to FALSE, the left neighbor luma sample pY[x][y] for x=-1..-3, y=-1..SubHeightC*numSampL-1 is set equal to luma sample pY[0][y]. If -numSampT is greater than 0, the top-most luma sample pY[x][y] in the neighborhood with x=0..SubWidthC*numSampT-1, y=-1,-2 is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y). When -availTL is equal to TRUE, the top-left nearby luma sample pY[x][y] at x=-1, y=-1,-2 is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y).
[0421] 3. The downsampled and arranged luminance samples pDsY[x][y], where x=0..nTbW-1 and y=0..nTbH-1, are derived as follows: -If both SubWidthC and SubHeightC are equal to 1, the following applies: pDsY[x][y], where x=1..nTbW-1 and y=1..nTbH-1, is derived as follows: pDstY[x][y]=pY[x][y] (360)
[0422] [ka]
[0423] - when sps_chroma_vertical_collocated_flag is equal to 1, the following applies: pDsY[x][y], where x=1..nTbW-1 and y=1..nTbH-1, is derived as follows: pDsY[x][y]=(F3[1][0]*pY[SubWidthC*x][SubHeightC*y-1]+ F3[0][1]*pY[SubWidthC*x-1][SubHeightC*y]+ F3[1][1]*pY[SubWidthC*x][SubHeightC*y]+ F3[2][1]*pY[SubWidthC*x+1][SubHeightC*y]+ F3[1][2]*pY[SubWidthC*x][SubHeightC*y+1]+4)>>3 (370) - Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies: pDsY[x][y], where x=1..nTbW-1 and y=1..nTbH-1, is derived as follows: pDsY[x][y]=(F4[0][1]*pY[SubWidthC*x-1][SubHeightC*y]+ F4[0][2]*pY[SubWidthC*x-1][SubHeightC*y+1]+ F4[1][1]*pY[SubWidthC*x][SubHeightC*y]+ F4[1][2]*pY[SubWidthC*x][SubHeightC*y+1]+ F4[2][1]*pY[SubWidthC*x+1][SubHeightC*y]+ F4[2][2]*pY[SubWidthC*x+1][SubHeightC*y+1]+4)>>3 (371)
[0424] 5.28. EMBODIMENT 28 The working draft specified in JVET-Q2001-vE can be modified as follows:
[0425] 8.4.5.2.13 Specification of the INTRA_LT_CCLM, INTRA_L_CCLM, and INTRA_T_CCLM intra prediction modes The inputs to this process are: - intra prediction mode predModeIntra, - the sample position (xTbC, yTbC) of the top-left sample of the current transform block relative to the top-left sample of the current picture, - the variable nTbW, which defines the width of the transformation block; - the variable nTbH, which defines the height of the transformation block; - the variable cIdx, which defines the color components of the current block; -Let x=-1, y=0..2*nTbH-1 and x=0..2*nTbW-1, y=-1, and let p[x][y] be the saturation neighborhood sample. The output of this process are the predicted samples preSamples[x][y], where x=0..nTbW-1, y=0..nTbH-1.
[0426] The current luminance position (xTbY, yTbY) is derived as follows. (xTbY,yTbY)=(xTbC<<(SubWidthC-1),yTbC<<(SubHeightC-1)) (351) The variables availL, availT and availTL are derived as follows. - The derivation process for neighborhood block availability specified in Section 6.4.4 is invoked with the current luminance position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighborhood luminance position (xTbY-1, yTbY), checkPredModeY set equal to FALSE, and cIdx as input, and assigns the output to availL. - The derivation process for neighborhood block availability specified in Section 6.4.4 is invoked with the current luminance position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighborhood luminance position (xTbY, yTbY-1), checkPredModeY set equal to FALSE, and cIdx as input, and assigns the output to availT.
[0427] The variable availTL is derived as follows: availTL=availL&&availT (352) - The number of available chroma samples in the top right neighborhood, numTopRight, is derived as follows: The variable numTopRight is set equal to 0 and availTR is set equal to TRUE. -If preModeIntra is equal to INTRA_T_CCLM, the following applies for x=nTbW..2*nTbW-1 until either availTR is equal to FALSE or x is equal to 2*nTbW-1: - The derivation process for neighborhood block availability specified in Section 6.4.4 is invoked with the current luminance position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighborhood luminance position (xTbY+x, yTbY-1), checkPredModeY set equal to FALSE, and cIdx as input, and assigns the output to availTR. If -availTR is equal to TRUE, numTopRight is increased by one.
[0428] - The number of available bottom-left neighboring chroma samples, numLeftBelow, is derived as follows: The variable numLeftBelow is set equal to 0 and availLB is set equal to TRUE. - if preModeIntra is equal to INTRA_L_CCLM, the following applies for y=nTbH..2*nTbH-1 until either availLB is equal to FALSE or y is equal to 2*nTbH-1: - The derivation process for neighborhood block availability specified in Section 6.4.4 is invoked with the current luminance position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighborhood luminance position (xTbY-1, yTbY+y), checkPredModeY set equal to FALSE, and cIdx as input, and assigns the output to availLB. If -availLB is equal to TRUE, numLeftBelow is increased by one.
[0429] The number of available neighboring chroma samples in the top and top-right numSampT and the number of available neighboring chroma samples in the left and bottom-left numSampL are derived as follows: -If predModeIntra is equal to INTRA_LT_CCLM, the following applies: numSampT=availT?nTbW:0 (353) numSampL=availL?nTbH:0 (354) - If not, the following applies: numSampT=(availT&&predModeIntra==INTRA_T_CCLM)?(nTbW+Min(numTopRight,nTbH)):0 (355) numSampL=(availL&&predModeIntra==INTRA_L_CCLM)?(nTbH+Min(numLeftBelow,nTbW)):0 (356)
[0430] The variable bCTUboundary is derived as follows. bCTUboundary=(yTbY&(CtbSizeY-1)==0)?TRUE:FALSE (357) The variable cntN and the array pickPosN, with N replaced by L and T, are derived as follows: The variable numIs4N is derived as follows: numIs4N=((availT&&availL&&predModeIntra==INTRA_LT_CCLM)?0:1) (358) - The variable startPosN is set equal to numSampN>(2+numIs4N). - The variable pickStepN is set equal to Max(1,numSampN>(1+numIs4N)). If -availN is equal to TRUE and preModeIntra is equal to INTRA_LT_CCLM or INTRA_N_CCLM, the following allocations are made: -cntN is set equal to Min(numSampN, (1+numIs4N)<<1). -pospickPosN[pos] is set equal to (startPosN+pos*pospickStepN), where pos=0..cntN-1. Otherwise, cntN is set equal to 0.
[0431] [ka]
[0432] The predicted samples predSamples[x][y], where x=0..nTbW-1 and y=0..nTbH-1, are derived as follows: If both -numSampL and numSampT are equal to 0, the following applies: predSamples[x][y]=1<<(BitDepth-1) (359) - Otherwise, the following ordered steps apply: 1. The co-located luma sample pY[x][y], where x=0..nTbW*SubWidthC-1, y=0..nTbH*SubHeightC-1, is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y).
[0433] 2. The neighboring luminance samples pY[x][y] are derived as follows: If -numSampL is greater than 0, the nearby left luma sample pY[x][y], for x=-1..-3, y=0..SubHeightC*numSampL-1, is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y). If -availT is equal to FALSE, the top-most luma sample pY[x][y] in the neighborhood with x=-1..SubWidthC*numSampT-1, y=-1..-2 is set equal to the luma sample pY[x][0]. If -availL is equal to FALSE, the left neighbor luma sample pY[x][y] for x=-1..-3, y=-1..SubHeightC*numSampL-1 is set equal to luma sample pY[0][y]. If -numSampT is greater than 0, the top-most luma sample pY[x][y] in the neighborhood with x=0..SubWidthC*numSampT-1, y=-1,-2 is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y). When -availTL is equal to TRUE, the top-left nearby luma sample pY[x][y] at x=-1, y=-1,-2 is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y).
[0434] 3. The downsampled and arranged luminance samples pDsY[x][y], where x=0..nTbW-1 and y=0..nTbH-1, are derived as follows: -If both SubWidthC and SubHeightC are equal to 1, the following applies: pDsY[x][y], where x=1..nTbW-1 and y=1..nTbH-1, is derived as follows: pDstY[x][y]=pY[x][y] (360)
[0435] [ka]
[0436] [ka]
[0437] 4. If numSampL is greater than 0, the selected neighboring left chroma sample pSelC[idx] is set equal to p[-1][pickPosL[idx]], idx=0..cntL-1, and the selected downsampled neighboring left luma sample pSelDsY[idx], idx=0..cntL-1, is derived as follows: - The variable y is set equal to pickPosL[idx]. -If both SubWidthC and SubHeightC are equal to 1, the following applies: pSelDsY[idx]=pY[-1][y] (372)
[0438] [ka]
[0439] 5. If numSampT is greater than 0, the top chroma sample pSelC[idx] of the selected neighborhood is set equal to p[pickPost[idx-cntL][-1], where idx=cntL..cntL+cntT-1, and the top luma sample pSelDsY[idx] of the downsampled neighborhood, where [[0]]cntL..cntL+cntT-1, is defined as follows: - The variable x is set equal to pickPost[idx-cntL]. -If both SubWidthC and SubHeightC are equal to 1, the following applies: pSelDsY[idx]=pY[x][-1] (375)
[0440] [ka]
[0441] - Otherwise (bCTUboundary is equal to TRUE), the following applies: pSelDsY[idx]=(F2[0]*pY[SubWidthC*x-1][-1]+ F2[1]*pY[SubWidthC*x][-1]+ F2[2]*pY[SubWidthC*x+1][-1]+2)>>2 (377)
[0442] [ka]
[0443] 6. If cntT+cntL is not equal to 0, then the variables minY, maxY, minC, and maxC are derived as follows: If -cntT+cntL is equal to 2, then in Comp substituted for DsY and C, pSelComp[3] is set equal to pSelComp[0], pSelComp[2] is set equal to pSelComp[1], pSelComp[0] is set equal to pSelComp[1], and pSelComp[1] is set equal to pSelComp[3]. - The arrays minGrpIdx and maxGrpIdx are derived as follows: minGrpIdx[0]=0 (380) minGrpIdx[1]=2 (381) maxGrpIdx[0]=1 (382) maxGrpIdx[1]=3 (383)
[0444] - If pSelDsY[minGrpIdx[0]] is greater than pSelDsY[minGrpIdx[1], minGrpIdx[0] and minGrpIdx[1] are swapped as follows: (minGrpIdx[0],minGrpIdx[1])=Swap(minGrpIdx[0],minGrpIdx[1]) (384) - If pSelDsY[maxGrpIdx[0]] is greater than pSelDsY[maxGrpIdx[1], maxGrpIdx[0] and maxGrpIdx[1] are swapped as follows: (maxGrpIdx[0],maxGrpIdx[1])=Swap(maxGrpIdx[0],maxGrpIdx[1]) (385) - If pSelDsY[minGrpIdx[0]] is greater than pSelDsY[maxGrpIdx[1], the arrays minGrpIdx and maxGrpIdx are swapped as follows: (minGrpIdx,maxGrpIdx)=Swap(minGrpIdx,maxGrpIdx) (386) - If pSelDsY[minGrpIdx[1]] is greater than pSelDsY[maxGrpIdx[0], minGrpIdx[1] and maxGrpIdx[0] are swapped as follows: (minGrpIdx[1],maxGrpIdx[0])=Swap(minGrpIdx[1],maxGrpIdx[0]) (387) The variables maxY, maxC, minY and minC are derived as follows: maxY=(pSelDsY[maxGrpIdx[0]]+pSelDsY[maxGrpIdx[1]]+1)>>1 (388) maxC=(pSelC[maxGrpIdx[0]]+pSelC[maxGrpIdx[1]]+1)>>1 (389) minY=(pSelDsY[minGrpIdx[0]]+pSelDsY[minGrpIdx[1]]+1)>>1 (390) minC=(pSelC[minGrpIdx[0]]+pSelC[minGrpIdx[1]]+1)>>1 (391)
[0445] 7. The variables a, b, and k are derived as follows: If -numSampL is equal to 0 and numSampT is equal to 0, the following applies: k=0 (392) a=0 (393) b=1<<(BitDepth-1) (394) - If not, the following applies: diff=maxY-minY (395) If -diff is not equal to 0, the following applies: diffC=maxC-minC (396) x=Floor(Log2(diff)) (397) normDiff=((diff<<4)>>x)&15 (398) x+=(normDiff!=0)?1:0 (399) y=Abs(diffC)>0?Floor(Log2(Abs(diffC)))+1:0 (400) a=(diffC*(divSigTable[normDiff]|8)+2 y-1 )>>y (401) k=((3+xy)<1)?1:3+xy (402) a=((3+xy)<1)?Sign(a)*15:a (403) b=minC-((a*minY)>>k) (404) Here, divSigTable[] is defined as follows: divSigTable[]={0,7,6,5,5,4,4,3,3,2,2,1,1,1,1,0} (405) - Otherwise (diff is equal to 0), the following applies: k=0 (406) a=0 (407) b=minC (408)
[0446] 8. The predicted samples predSamples[x][y], where x=0..nTbW-1 and y=0..nTbH-1, are derived as follows: predSamples[x][y]=Clip1(((pDsY[x][y]*a)>>k)+b) (409) NOTE - This process uses sps_chroma_vertical_collocated_flag, but for simplicity of implementation, does not use sps_chroma_horizontal_collocated_flag.
[0447] 5.29. EMBODIMENT 29 The working draft specified in JVET-Q2001-vE can be modified as follows:
[0448] 8.4.5.2.13 Specification of the INTRA_LT_CCLM, INTRA_L_CCLM, and INTRA_T_CCLM intra prediction modes The predicted samples predSamples[x][y], where x=0..nTbW-1 and y=0..nTbH-1, are derived as follows: If both -numSampL and numSampT are equal to 0, the following applies: predSamples[x][y]=1<<(BitDepth-1) (359) - Otherwise, the following ordered steps apply: 1. The co-located luma sample pY[x][y], where x=0..nTbW*SubWidthC-1, y=0..nTbH*SubHeightC-1, is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y).
[0449] [ka]
[0450] 5.30. EMBODIMENT 30 The working draft specified in JVET-Q2001-vE can be modified as follows:
[0451] 8.4.5.2.13 Specification of the INTRA_LT_CCLM, INTRA_L_CCLM, and INTRA_T_CCLM intra prediction modes The predicted samples predSamples[x][y], where x=0..nTbW-1 and y=0..nTbH-1, are derived as follows: If both -numSampL and numSampT are equal to 0, the following applies: predSamples[x][y]=1<<(BitDepth-1) (359) - Otherwise, the following ordered steps apply: 1. The co-located luma sample pY[x][y], where x=0..nTbW*SubWidthC-1, y=0..nTbH*SubHeightC-1, is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y).
[0452] [ka]
[0453] 5.31. EMBODIMENT 31 The working draft specified in JVET-Q2001-vE can be modified as follows:
[0454] 8.4.5.2.13 Specification of the INTRA_LT_CCLM, INTRA_L_CCLM, and INTRA_T_CCLM intra prediction modes The inputs to this process are: - intra prediction mode predModeIntra, - the sample position (xTbC, yTbC) of the top-left sample of the current transform block relative to the top-left sample of the current picture, - the variable nTbW, which defines the width of the transformation block; - the variable nTbH, which defines the height of the transformation block; - the variable cIdx, which defines the color components of the current block; -Let x=-1, y=0..2*nTbH-1 and x=0..2*nTbW-1, y=-1, and let p[x][y] be the saturation neighborhood sample. The output of this process are the predicted samples preSamples[x][y], where x=0..nTbW-1, y=0..nTbH-1.
[0455] The current luminance position (xTbY, yTbY) is derived as follows. (xTbY,yTbY)=(xTbC<<(SubWidthC-1),yTbC<<(SubHeightC-1)) (351) The variables availL, availT and availTL are derived as follows. - The derivation process for neighborhood block availability specified in Section 6.4.4 is invoked with the current luminance position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighborhood luminance position (xTbY-1, yTbY), checkPredModeY set equal to FALSE, and cIdx as input, and assigns the output to availL. - The derivation process for neighborhood block availability specified in Section 6.4.4 is invoked with the current luminance position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighborhood luminance position (xTbY, yTbY-1), checkPredModeY set equal to FALSE, and cIdx as input, and assigns the output to availT.
[0456] The variable availTL is derived as follows: availTL=availL&&availT (352) - The number of available chroma samples in the top right neighborhood, numTopRight, is derived as follows: The variable numTopRight is set equal to 0 and availTR is set equal to TRUE. -If preModeIntra is equal to INTRA_T_CCLM, the following applies for x=nTbW..2*nTbW-1 until either availTR is equal to FALSE or x is equal to 2*nTbW-1: - The derivation process for neighborhood block availability specified in Section 6.4.4 is invoked with the current luminance position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighborhood luminance position (xTbY+x, yTbY-1), checkPredModeY set equal to FALSE, and cIdx as input, and assigns the output to availTR. If -availTR is equal to TRUE, numTopRight is increased by one. - The number of available bottom-left neighboring chroma samples, numLeftBelow, is derived as follows: The variable numLeftBelow is set equal to 0 and availLB is set equal to TRUE. - if preModeIntra is equal to INTRA_L_CCLM, the following applies for y=nTbH..2*nTbH-1 until either availLB is equal to FALSE or y is equal to 2*nTbH-1: - The derivation process for neighborhood block availability specified in Section 6.4.4 is invoked with the current luminance position (xCurr, yCurr) set equal to (xTbY, yTbY), the neighborhood luminance position (xTbY-1, yTbY+y), checkPredModeY set equal to FALSE, and cIdx as input, and assigns the output to availLB. If -availLB is equal to TRUE, numLeftBelow is increased by one.
[0457] The number of available neighboring chroma samples in the top and top-right numSampT and the number of available neighboring chroma samples in the left and bottom-left numSampL are derived as follows: -If predModeIntra is equal to INTRA_LT_CCLM, the following applies: numSampT=availT?nTbW:0 (353) numSampL=availL?nTbH:0 (354) - If not, the following applies: numSampT=(availT&&predModeIntra==INTRA_T_CCLM)?(nTbW+Min(numTopRight,nTbH)):0 (355) numSampL=(availL&&predModeIntra==INTRA_L_CCLM)?(nTbH+Min(numLeftBelow,nTbW)):0 (356)
[0458] The variable bCTUboundary is derived as follows. bCTUboundary=(yTbY&(CtbSizeY-1)==0)?TRUE:FALSE (357) The variable cntN and the array pickPosN, with N replaced by L and T, are derived as follows: The variable numIs4N is derived as follows: numIs4N=((availT&&availL&&predModeIntra==INTRA_LT_CCLM)?0:1) (358) - The variable startPosN is set equal to numSampN>(2+numIs4N). - The variable pickStepN is set equal to Max(1,numSampN>(1+numIs4N)). If -availN is equal to TRUE and preModeIntra is equal to INTRA_LT_CCLM or INTRA_N_CCLM, the following allocations are made: -cntN is set equal to Min(numSampN, (1+numIs4N)<<1). -pospickPosN[pos] is set equal to (startPosN+pos*pospickStepN), where pos=0..cntN-1. Otherwise, cntN is set equal to 0.
[0459] [ka]
[0460] The predicted samples predSamples[x][y], where x=0..nTbW-1 and y=0..nTbH-1, are derived as follows: If both -numSampL and numSampT are equal to 0, the following applies: predSamples[x][y]=1<<(BitDepth-1) (359) - Otherwise, the following ordered steps apply: 1. The co-located luma sample pY[x][y], where x=0..nTbW*SubWidthC-1, y=0..nTbH*SubHeightC-1, is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y). 2. The neighboring luminance samples pY[x][y] are derived as follows: If -numSampL is greater than 0, the nearby left luma sample pY[x][y], for x=-1..-3, y=0..SubHeightC*numSampL-1, is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y). If -availT is equal to FALSE, the top-most luma sample pY[x][y] in the neighborhood with x=-1..SubWidthC*numSampT-1, y=-1..-2 is set equal to the luma sample pY[x][0]. If -availL is equal to FALSE, the left neighbor luma sample pY[x][y] for x=-1..-3, y=-1..SubHeightC*numSampL-1 is set equal to luma sample pY[0][y]. If -numSampT is greater than 0, the top-most luma sample pY[x][y] in the neighborhood with x=0..SubWidthC*numSampT-1, y=-1,-2 is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y). When -availTL is equal to TRUE, the top-left nearby luma sample pY[x][y] at x=-1, y=-1,-2 is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y).
[0461] 3. The downsampled and arranged luminance samples pDsY[x][y], where x=0..nTbW-1 and y=0..nTbH-1, are derived as follows: -If both SubWidthC and SubHeightC are equal to 1, the following applies: pDsY[x][y], where x=1..nTbW-1 and y=1..nTbH-1, is derived as follows: pDstY[x][y]=pY[x][y] (360)
[0462] [ka]
[0463] [ka]
[0464] 4. If numSampL is greater than 0, the selected neighboring left chroma sample pSelC[idx] is set equal to p[-1][pickPosL[idx]], idx=0..cntL-1, and the selected downsampled neighboring left luma sample pSelDsY[idx], idx=0..cntL-1, is derived as follows: - The variable y is set equal to pickPosL[idx]. -If both SubWidthC and SubHeightC are equal to 1, the following applies: pSelDsY[idx] = pY[-1][y] (372)
[0465] [ka]
[0466] [ka]
[0467] [ka]
[0468] 6. If cntT+cntL is not equal to 0, then the variables minY, maxY, minC, and maxC are derived as follows: If -cntT+cntL is equal to 2, then in Comp substituted for DsY and C, pSelComp[3] is set equal to pSelComp[0], pSelComp[2] is set equal to pSelComp[1], pSelComp[0] is set equal to pSelComp[1], and pSelComp[1] is set equal to pSelComp[3]. - The arrays minGrpIdx and maxGrpIdx are derived as follows: minGrpIdx[0]=0 (380) minGrpIdx[1]=2 (381) maxGrpIdx[0]=1 (382) maxGrpIdx[1]=3 (383)
[0469] - If pSelDsY[minGrpIdx[0]] is greater than pSelDsY[minGrpIdx[1], minGrpIdx[0] and minGrpIdx[1] are swapped as follows: (minGrpIdx[0],minGrpIdx[1])=Swap(minGrpIdx[0],minGrpIdx[1]) (384) - If pSelDsY[maxGrpIdx[0]] is greater than pSelDsY[maxGrpIdx[1], maxGrpIdx[0] and maxGrpIdx[1] are swapped as follows: (maxGrpIdx[0],maxGrpIdx[1])=Swap(maxGrpIdx[0],maxGrpIdx[1]) (385) - If pSelDsY[minGrpIdx[0]] is greater than pSelDsY[maxGrpIdx[1], the arrays minGrpIdx and maxGrpIdx are swapped as follows: (minGrpIdx,maxGrpIdx)=Swap(minGrpIdx,maxGrpIdx) (386) - If pSelDsY[minGrpIdx[1]] is greater than pSelDsY[maxGrpIdx[0], minGrpIdx[1] and maxGrpIdx[0] are swapped as follows: (minGrpIdx[1],maxGrpIdx[0])=Swap(minGrpIdx[1],maxGrpIdx[0]) (387) The variables maxY, maxC, minY and minC are derived as follows: maxY=(pSelDsY[maxGrpIdx[0]]+pSelDsY[maxGrpIdx[1]]+1)>>1 (388) maxC=(pSelC[maxGrpIdx[0]]+pSelC[maxGrpIdx[1]]+1)>>1 (389) minY=(pSelDsY[minGrpIdx[0]]+pSelDsY[minGrpIdx[1]]+1)>>1 (390) minC=(pSelC[minGrpIdx[0]]+pSelC[minGrpIdx[1]]+1)>>1 (391)
[0470] 7. The variables a, b, and k are derived as follows: If -numSampL is equal to 0 and numSampT is equal to 0, the following applies: k=0 (392) a=0 (393) b=1<<(BitDepth-1) (394) - If not, the following applies: diff=maxY-minY (395) If -diff is not equal to 0, the following applies: diffC=maxC-minC (396) x=Floor(Log2(diff)) (397) normDiff=((diff<<4)>>x)&15 (398) x+=(normDiff!=0)?1:0 (399) y=Abs(diffC)>0?Floor(Log2(Abs(diffC)))+1:0 (400) a=(diffC*(divSigTable[normDiff]|8)+2 y-1 )>>y (401) k=((3+xy)<1)?1:3+xy (402) a=((3+xy)<1)?Sign(a)*15:a (403) b=minC-((a*minY)>>k) (404) Here, divSigTable[] is defined as follows: divSigTable[]={0,7,6,5,5,4,4,3,3,2,2,1,1,1,1,0} (405) - Otherwise (diff is equal to 0), the following applies: k=0 (406) a=0 (407) b=minC (408)
[0471] 8. The predicted samples predSamples[x][y], where x=0..nTbW-1 and y=0..nTbH-1, are derived as follows: predSamples[x][y]=Clip1(((pDsY[x][y]*a)>>k)+b) (409) NOTE - This process uses sps_chroma_vertical_collocated_flag, but for simplicity of implementation, does not use sps_chroma_horizontal_collocated_flag.
[0472] FIG. 9 is a block diagram of a video processing device 900. The device 900 may be used to implement one or more methods described herein. The device 900 may be implemented by a smartphone, a tablet, a computer, an Internet of Things (IoT) receiver, etc. The device 900 may include one or more processors 902, one or more memories 904, and video processing hardware 906. The one or more processors 902 may be configured to implement one or more methods described herein. The memory(s) 904 may be used to store data and code used to implement the methods and techniques described herein. The video processing hardware 906 may be used to implement the techniques described herein in hardware circuits (e.g., those described in the previous section).
[0473] FIG. 10 shows a block diagram of an example video encoder.
[0474] 11 is a flow chart of a method 1100 for processing video. The method 1100 includes deriving parameters of a cross-component linear model by using a downsampled top luma sample generated from N upper neighboring lines of a positioned luma block using a downsampling filter for conversion between chroma blocks of the video and a coded representation of the video (1102), where N is a positive integer, and performing the conversion using a predicted chroma block generated using the cross-component linear model (1104).
[0475] FIG. 12 is a block diagram illustrating an example video processing system in which the disclosed techniques can be implemented.
[0476] FIG. 12 is a block diagram illustrating an example video processing system 1200 in which various techniques disclosed herein may be implemented. Various implementations may include some or all of the components of system 1200. System 1200 may include an input 1202 for receiving video content. The video content may be received in a raw or uncompressed format, e.g., 8 or 10-bit multi-component pixel values, or may be received in a compressed or encoded format. Input 1202 may represent a network interface, a peripheral bus interface, or a storage interface. Examples of network interfaces include wired interfaces such as Ethernet, Passive Optical Network (PON), and wireless interfaces such as Wi-Fi or cellular interfaces.
[0477] System 1200 may include a coding component 1204 that may implement various coding or encoding methods described herein. Coding component 1204 may reduce the average bit rate of the video from input 1202 to the output of coding component 1204, generating a coded representation of the video. Thus, this coding technique may be referred to as a video compression or video transcoding technique. The output of coding component 1204 may be stored or transmitted via a connected communication, as represented by component 1206. The bitstream (or coded) representation of the video received at input 1202, stored or communicated may be used by component 1208 to generate pixel values or displayable video that are sent to display interface 1210. The process of generating a user-viewable video from the bitstream representation may be referred to as video decompression. Additionally, although certain video processing operations are referred to as "coding" operations or tools, it will be understood that the coding tools or operations are used in an encoder and that the corresponding decoding tools or operations that reverse the results of the coding are performed by a decoder.
[0478] Examples of peripheral bus interfaces or display interfaces may include Universal Serial Bus (USB) or High Definition Multimedia Interface (HDMI), DisplayPort, etc. Examples of storage interfaces include Serial Advanced Technology Attachment (SATA), PCI, IDE interfaces, etc. The techniques described herein may be implemented in various electronic devices such as mobile phones, laptops, smartphones, or other devices capable of digital data processing and / or video display.
[0479] FIG. 14 is a block diagram illustrating an example video coding system 100 that may utilize techniques of this disclosure.
[0480] 14, video coding system 100 may include source device 110 and destination device 120. Source device 110 generates coded video data and may also be referred to as a video coding device. Destination device 120 may decode the encoded video data generated by source device 110 and may also be referred to as a video decoding device.
[0481] Source device 110 may include a video source 112, a video encoder 114, and an input / output (I / O) interface 116.
[0482] The video source 112 may include a source such as a video capture device, an interface for receiving video data from a video content provider, and / or a computer graphics system for generating video data, or a combination of these sources. The video data may include one or more pictures. The video encoder 114 encodes the video data from the video source 112 and generates a bitstream. The bitstream may include a sequence of bits that form a coded representation of the video data. The bitstream may include a coded picture and associated data. A coded picture is a coded representation of a picture. The associated data may include sequence parameter sets, picture parameter sets, and other syntax structures. The I / O interface 116 may include a modulator / demodulator (modem) and / or a transmitter. The coded video data may be transmitted directly to the destination device 120 via the I / O interface 116 over the network 130a. The coded video data may be stored on a recording medium / server 130b for access by the destination device 120.
[0483] Destination device 120 may include an I / O interface 126 , a video decoder 124 , and a display device 122 .
[0484] The I / O interface 126 may include a receiver and / or a modem. The I / O interface 126 may obtain the encoded video data from the source device 110 or the storage medium / server 130b. The video decoder 124 may decode the encoded video data. The display device 122 may display the decoded video data to a user. The display device 122 may be integrated with the destination device 120 or may be external to the destination device 120 configured to interface with an external display device.
[0485] Video encoder 114 and video decoder 124 may operate according to a video compression standard, such as the High Efficiency Video Coding (HEVC) standard, the Versatile Video Coding (VVVM) standard, and other current and / or future standards.
[0486] FIG. 15 is a block diagram illustrating an example of a video encoder 200, which may be the video encoder 114 in the system 100 shown in FIG.
[0487] Video encoder 200 may be configured to perform any or all of the techniques of this disclosure. In the example of FIG. 15, video encoder 200 includes multiple functional components. Techniques described in this disclosure may be shared among various components of video encoder 200. In some examples, a processor may be configured to perform any or all of the techniques described in this disclosure.
[0488] Functional components of the video encoder 200 may include a splitting unit 201, a prediction unit 202, which may include a mode selection unit 203, a motion estimation unit 204, a motion compensation unit 205, and an intra prediction unit 206, a residual generation unit 207, a transformation unit 208, a quantization unit 209, an inverse quantization unit 210, an inverse transformation unit 211, a reconstruction unit 212, a buffer 213, and an entropy coding unit 214.
[0489] In other examples, video encoder 200 may include more, fewer, or different functional components. In one example, prediction unit 202 may include an Intra Block Copy (IBC) unit. The IBC unit may perform prediction in an IBC mode where at least one reference picture is the picture in which the current video block is located.
[0490] Furthermore, some components, such as the motion estimator 204 and the motion compensator 205, may be highly integrated, but are depicted separately in the example of FIG. 15 for purposes of illustration.
[0491] The divider 201 may divide a picture into one or more video blocks. The video encoder 200 and the video decoder 300 may support a variety of video block sizes.
[0492] The mode selector 203 may select one of the coding modes, either intra or inter, based on, for example, the error result, and provide the resulting intra or inter coding block to the residual generator 207 to generate residual block data and to the reconstruction unit 212 to reconstruct the coded block for use as a reference picture. In some examples, the mode selector 203 may select a Combination of Intra and Inter Prediction (CIIP) mode, which performs prediction based on an inter prediction signal and an intra prediction signal. The mode selector 203 may select a resolution of the motion vector for the block (e.g., sub-pixel or integer pixel precision) in the case of inter prediction.
[0493] To perform inter prediction on the current video block, motion estimation unit 204 may generate motion information for the current video block by comparing the current video block to one or more reference frames from buffer 213. Motion compensation unit 205 may determine a prediction video block for the current video block based on the motion information and decoded samples of pictures from buffer 213 other than the picture associated with the current video block.
[0494] Motion estimation unit 204 and motion compensation unit 205 may, for example, perform different operations on the current video block depending on whether the current video block is an I-slice, a P-slice, or a B-slice.
[0495] In some examples, the motion estimation unit 204 may perform unidirectional prediction on the current video block, and the motion estimation unit 204 may search the reference pictures in list 0 or list 1 for a reference video block for the current video block. The motion estimation unit 204 may then generate a reference index indicating a reference picture in list 0 or list 1, the reference picture including the reference video block and a motion vector indicating a spatial displacement between the current video block and the reference video block. The motion estimation unit 204 may output the reference index, the prediction direction indicator, and the motion vector as motion information for the current video block. The motion compensation unit 205 may generate a prediction video block for the current block based on the reference video block indicated by the motion information of the current video block.
[0496] In another example, motion estimation unit 204 may bidirectionally predict the current video block, and motion estimation unit 204 may search for a reference video block from among the reference pictures in list 0 for the current video block, and may search for another reference video block from among the reference pictures in list 1 for the current video block. Motion estimation unit 204 may then generate a reference index indicating the reference pictures in list 0 and list 1 that contain the reference video block, and a motion vector indicating a spatial displacement between the reference video block and the current video block. Motion estimation unit 204 may output the reference index and the motion vector of the current video block as motion information of the current video block. Motion compensation unit 205 may generate a predicted video block for the current video block based on the reference video block indicated by the motion information of the current video block.
[0497] In some examples, the motion estimation unit 204 may output a full set of motion information for the decoding process of the decoder.
[0498] In some examples, the motion estimator 204 may not output a full set of motion information for the current picture. Rather, the motion estimator 204 may signal the motion information of the current video block by reference to motion information of another video block. For example, the motion estimator 204 may determine that the motion information of the current video block is sufficiently similar to the motion information of a neighboring video block.
[0499] In one example, motion estimator 204 may indicate, in a syntax structure associated with the current video block, a value that indicates to video decoder 300 that the current video block has the same motion information as another video block.
[0500] In another example, motion estimation unit 204 may identify another video block in a syntax structure associated with the current video block and a motion vector difference (MVD). The motion vector difference indicates the difference between the motion vector of the current video block and the motion vector of the indicated video block. Video decoder 300 may use the motion vector of the indicated video block and the motion vector difference to determine the motion vector of the current video block.
[0501] As mentioned above, video encoder 200 may predictively signal motion vectors. Two examples of predictive signaling techniques that may be implemented by video encoder 200 include Advanced Motion Vector Prediction (AMVP) and merge mode signaling.
[0502] The intra predictor 206 may perform intra prediction on the current video block. When the intra predictor 206 performs intra prediction on the current video block, the intra predictor 206 may generate prediction data for the current video block based on decoded samples of other video blocks in the same picture. The prediction data for the current video block may include a predicted video block and various syntax elements.
[0503] Residual generator 207 may generate residual data for the current video block by subtracting (e.g., as indicated by a minus sign) the predicted video block of the current video block from the current video block. The residual data for the current video block may include residual video blocks that correspond to different sample components of the samples in the current video block.
[0504] In other examples, for example in skip mode, there may be no residual data for the current video block, and residual generator 207 may not perform the subtraction operation.
[0505] Transform processor 208 may generate one or more transform coefficient image blocks for the current video block by applying one or more transforms to a residual video block associated with the current video block.
[0506] After the transform processing unit 208 generates a transform coefficient image block associated with the current image block, the quantization unit 209 may quantize the transform coefficient image block associated with the current image block based on one or more quantization parameter (QP) values associated with the current image block.
[0507] The inverse quantization unit 210 and the inverse transform unit 211 may apply inverse quantization and inverse transform, respectively, to the transform coefficient image block to reconstruct a residual video block from the transform coefficient image block. The reconstruction unit 212 may add the reconstructed residual video block to corresponding samples from one or more prediction video blocks generated by the prediction unit 202 to generate a reconstructed video block associated with the current block for storing in the buffer 213.
[0508] After the reconstructor 212 reconstructs the image block, a loop filtering operation may be performed to reduce image blocking artifacts in the image block.
[0509] The entropy encoder 214 may receive data from other functional components of the video encoder 200. If the entropy encoder 214 receives data, the entropy encoder 214 may perform one or more entropy encoding operations to generate entropy coded data, and output a bitstream that includes the entropy coded data.
[0510] FIG. 16 is a block diagram illustrating an example of a video decoder 300, which may be the video decoder 114 in the system 100 shown in FIG.
[0511] The video decoder 300 may be configured to perform any or all of the techniques of this disclosure. In the example of FIG. 16, the video decoder 300 includes multiple functional components. The techniques described in this disclosure may be shared among various components of the video decoder 300. In some examples, a processor may be configured to perform any or all of the techniques described in this disclosure.
[0512] In the example of Figure 16, the video decoder 300 includes an entropy decoding unit 301, a motion compensation unit 302, an intra prediction unit 303, an inverse quantization unit 304, an inverse transform unit 305, and a reconstruction unit 306, as well as a buffer 307. The video decoder 300 may, in some examples, perform a decoding path that is generally the reverse of the encoding path described with respect to the video encoder 200 (e.g., Figure 15).
[0513] The entropy decoder 301 retrieves an encoded bitstream. The encoded bitstream may include entropy coded video data (e.g., coded blocks of video data). The entropy decoder 301 decodes the entropy coded video data, and from the entropy decoded video data, the motion compensation unit 302 may determine motion information including motion vectors, motion vector precision, reference picture list index, and other motion information. The motion compensation unit 302 may determine such information by, for example, implementing AMVP and merge mode.
[0514] The motion compensation unit 302 may generate motion compensated blocks and, in some cases, perform interpolation based on an interpolation filter. The syntax element may include an identifier for the interpolation filter to be used with sub-pixel accuracy.
[0515] The motion compensation unit 302 may calculate interpolated values for sub-integer pixels of the reference block using an interpolation filter as used by video encoder 200 during encoding of the video block. The motion compensation unit 302 may determine the interpolation filter used by video encoder 200 based on the received syntax information and use the interpolation filter to generate the prediction block.
[0516] The motion compensation unit 302 may use the syntax information to determine the size of blocks used to code frames and / or slices of the coded video sequence, partitioning information describing how each macroblock of a picture of the coded video sequence is divided, a mode indicating how each division is coded, one or more reference frames (and reference frame lists) for each inter-coded block, and any of the other information to decode the coded video sequence.
[0517] The intra prediction unit 303 may form a prediction block from spatially neighboring blocks, for example, using an intra prediction mode received in the bitstream. The inverse quantization unit 303 inverse quantizes (i.e., dequantizes) the quantized video block coefficients provided in the bitstream and decoded by the entropy decoding unit 301. The inverse transform unit 303 applies an inverse transform.
[0518] A reconstruction unit 306 may sum the residual block with a corresponding prediction block generated by the motion compensation unit 202 or the intra prediction unit 303 to form a decoded block. If desired, a deblocking filter may be applied to filter the decoded block to remove blocking artifacts. The decoded video block is stored in a buffer 307, which provides a reference block for subsequent motion compensation.
[0519] The following series of paragraphs provide preferred examples according to some embodiments provided below.
[0520] The first section presents an exemplary embodiment of the techniques described in items 18 and 19 of the previous chapter.
[0521] A method of video processing (e.g., method 1700 shown in FIG. 17A ), comprising: determining 1702 parameters of a cross-component linear model of the video block according to rules for conversion between a video block of a video having a 1.4:2:2 color format and a bitstream of the video; and performing the conversion based on the determination, wherein a syntax element indicates whether chroma samples of the video are vertically shifted relative to luma samples of the video, and the rules specify that the parameters are determined independent of a value of the syntax element 1704.
[0522] 2. The method according to item 1, wherein the parameters of the cross-component linear model correspond to the parameters of downsampling filtering in the cross-component linear model.
[0523] 3. The method of claim 2, wherein the downsampling filtering includes downsampling luminance samples above the neighborhood, and / or downsampling luminance samples to the left of the neighborhood, and / or downsampling samples of the image block that is a luminance block.
[0524] 4. The method according to item 2 or 3, wherein downsampling filtering is performed using a fixed filter regardless of the value of the syntax element.
[0525] 5. The method according to item 4, wherein the fixed filter is a 3-tap horizontal filter with coefficients [1 / 4, 2 / 4, 1 / 4] or [2 / 8, 4 / 8, 2 / 8].
[0526] 6. A method of video processing (e.g., method 1710 shown in FIG. 17B ), comprising: performing a conversion between video and a video bitstream in accordance with rules, the format rules specifying that a field indicating whether chroma sample positions are vertically shifted relative to corresponding luma sample positions due to the video having a 4:2:2 or 4:4:4 color format is set to a default value.
[0527] 7. The method according to item 6, wherein the default value is 0 or 1.
[0528] 8. The method of claim 6, wherein the rules further specify that if the field is not present, the value of the field is inferred to be equal to 1.
[0529] 9. The method of claim 6, wherein the rules further specify that if the field is not present, the value of the field is inferred to be equal to 0.
[0530] 10. A method according to any one of items 1 to 9, characterized in that the cross-component linear model derives a predicted value of a saturation component from another component using a linear mode.
[0531] 11. The method of any one of items 1 to 9, wherein the conversion includes encoding the video into a bitstream.
[0532] 12. The method of any one of items 1 to 9, wherein the conversion includes decoding the video from a bitstream.
[0533] 13. The method of any of items 1 to 12, wherein the conversion includes generating a bitstream from the video, and the method further includes storing the bitstream in a non-transitory computer-readable recording medium.
[0534] 14. A video processing device comprising a processor configured to implement the method according to one or more of items 1 to 12.
[0535] 15. A method for storing a video bitstream, comprising the method of any one of items 1 to 12 and further comprising storing the bitstream in a non-transitory computer-readable recording medium.
[0536] 16. A computer-readable medium having stored thereon program code which, when executed, causes a processor to perform the method recited in any of items 1 to 12.
[0537] 17. A computer readable medium storing a bitstream generated according to any of the methods described above.
[0538] 18. A video processing device for storing a bitstream representation, configured to implement the methods according to one or more of items 1 to 12.
[0539] The second section presents an illustrative implementation of the technique discussed in item 20 of the previous section.
[0540] 1. A method of video processing (e.g., method 1800 shown in FIG. 18 ) for converting between a video block of a video and a video bitstream, comprising determining 1802 parameters of a Cross-Component Linear Model (CCLM) of the video block according to a rule, and performing 1804 the conversion based on the determination, wherein the rule specifies that a variable indicating a neighboring luminance sample is used in determining the parameters of the CCLM only if the variable has a certain value.
[0541] 2. The method according to item 1, wherein the constant value of the variable representing the luma sample above the neighborhood of the video block is equal to the value of the reconstructed luma sample before the deblocking filter processing.
[0542] 3. If a luminance sample above the neighborhood is available, a variable representing the luminance sample above the neighborhood, denoted as pY[x][y], is set equal to the reconstructed luminance sample before deblocking filtering at position (xTbY+x, yTbY+y), where (xTbY, yTbY) indicates the top-left position of the image block, and x and y are integers. The method described in item 2.
[0543] 4. The method described in item 3, wherein x ranges from 0 to SubWidthC*max(numSampT, nTbW)-1, nTbW indicates the width of the image block, SubWidthC is a width scale factor of the image block determined from a table according to the saturation format of the image containing the image block, and numSampT indicates the number of available neighboring saturation samples at the top and upper right of the image block.
[0544] 5. The method according to item 3, wherein y is -1 or 2.
[0545] 6. The method according to item 1, in which the value of a variable representing a left luminance sample of a neighborhood of a video block is set equal to the value of the reconstructed luminance sample before the deblocking filter process.
[0546] 7. The method according to item 6, wherein if a neighboring left luma sample is available, a variable representing the neighboring left luma sample, denoted as pY[x][y], is set equal to the reconstructed luma sample before deblocking filtering at position (xTbY+x, yTbY+y), where (xTbY, yTbY) indicates the top-left position of the video block, and x and y are integers.
[0547] 8. The method according to item 7, wherein X is in the range of -1 to -3.
[0548] 9. The method described in item 7, wherein y ranges from 0 to SubHeightC*max(numSampL,nTbH) - 1, nTbH indicates the height of the image block, SubHeightC is a height scale factor of the image block determined from a table according to the saturation format of the image containing the image block, and numSampL indicates the number of available neighboring saturation samples to the left and below the image block.
[0549] 10. A method according to any one of items 1 to 9, characterized in that the cross-component linear model derives a predicted value of a saturation component from another component using a linear mode.
[0550] 11. The method of any one of items 1 to 9, wherein the conversion includes encoding the video into a bitstream.
[0551] 12. The method of any one of items 1 to 9, wherein the conversion includes decoding the video from a bitstream.
[0552] 13. The method of any of items 1 to 12, wherein the conversion includes generating a bitstream from the video, and the method further includes storing the bitstream in a non-transitory computer-readable recording medium.
[0553] 14. A video processing device comprising a processor configured to implement the method according to one or more of items 1 to 12.
[0554] 15. A method for storing a video bitstream, comprising the method of any one of items 1 to 12 and further comprising storing the bitstream in a non-transitory computer-readable recording medium.
[0555] 16. A computer-readable medium having stored thereon program code which, when executed, causes a processor to perform the method recited in any of items 1 to 12.
[0556] 17. A computer readable medium storing a bitstream generated according to any of the methods described above.
[0557] 18. A video processing device for storing a bitstream, configured to implement the methods according to one or more of items 1 to 12.
[0558] The third section presents exemplary implementations of the techniques described in items 21 to 26 of the previous chapter.
[0559] 1. A method of video processing (e.g., method 1900 shown in FIG. 19A ), comprising: determining 1902 whether a first coding tool is valid for a video unit according to rules for conversion between video constituting the video unit and a video bitstream, the rules specifying that the first coding tool and a second coding tool are mutually exclusively enabled and that the first coding tool or the second coding tool constitutes a code data hiding tool; and performing 1904 the conversion according to the determination.
[0560] 2. The method of claim 1, wherein the video unit corresponds to a sequence, a picture, a slice, a tile, a brick, or a subpicture.
[0561] 3. The method according to item 1 or 2, wherein the rule specifies that a first coding tool including a code data hiding tool is disabled if a second coding tool including a Block Differential Pulse-Code Modulation (BDPCM) tool is enabled for the video unit.
[0562] 4. The method according to item 1 or 2, wherein the rule specifies that a first coding tool including a Block Differential Pulse-Code Modulation (BDPCM) tool is disabled if a second coding tool including a code data hiding tool is valid for the video unit.
[0563] 5. The method according to item 1 or 2, wherein the rule specifies that a first coding tool constituting a code data hiding tool is disabled if a second coding tool that applies only an identity transformation to the video unit is valid.
[0564] 6. The method according to item 1 or 2, wherein the rule specifies that a first coding tool that applies only an identity transformation is disabled if a second coding tool that constitutes a code data hiding tool for a video unit is valid.
[0565] 7. The method according to item 5 or 6, wherein the second coding tool that applies only the identity transform or the first coding tool that applies only the identity transform comprises a transform skip mode tool or another coding tool.
[0566] 8. A method of video processing (e.g., method 1910 shown in FIG. 19B), comprising: determining 1912 whether a first coding tool is enabled for a video unit according to rules for conversion between video constituting the video unit and a video bitstream, the rules specifying that the first coding tool and the second coding tool are mutually exclusively enabled and that the first coding tool or the second coding tool constitutes a dependent quantization tool; and performing 1914 the conversion according to the determination.
[0567] 9. The method of claim 8, wherein the video unit corresponds to a sequence, a picture, a slice, a tile, a brick, or a subpicture.
[0568] 10. The method according to item 8 or 9, wherein the rule specifies that a first coding tool including a dependent quantization tool is disabled if a second coding tool including a Block Differential Pulse-Code Modulation (BDPCM) tool is valid for the video unit.
[0569] 11. The method of claim 8 or 9, wherein the rule specifies that a first coding tool including a Block Differential Pulse-Code Modulation (BDPCM) tool is disabled if a second coding tool including the dependent quantization tool is valid for the video unit.
[0570] 12. The method of claim 8 or 9, wherein the rule specifies that a first coding tool that includes a dependent quantization tool is disabled if a second coding tool that applies only an identity transform is enabled for a video unit.
[0571] 13. The method of claim 8 or 9, wherein the rule specifies that, for a video unit, a first coding tool that applies only an identity transform is disabled if a second coding tool that includes dependent quantization is enabled.
[0572] 14. The method according to item 8 or 9, wherein the second coding tool that applies only the identity transform or the first coding tool that applies only the identity transform comprises a transform skip mode tool or another coding tool.
[0573] 15. A method of video processing (e.g., method 1920 shown in FIG. 19C ), comprising performing 1922 a conversion between a video including one or more pictures including one or more slices and a video bitstream in accordance with rules, the rules specifying that the slice type of a slice depends on a reference picture entry in a reference picture list for the slice.
[0574] 16. The method according to item 15, wherein the rule specifies that if the number of reference picture entries in reference picture list 0 is equal to 0 and the number of reference picture entries in reference picture list 1 is equal to 0, the slice type of the slice is an I slice.
[0575] 17. The method according to item 15, wherein the rule specifies that the slice type of a slice is a P slice if the number of reference picture entries in reference picture list 0 is greater than 0 and the number of reference picture entries in reference picture list 1 is equal to 0.
[0576] 18. The method according to item 15, wherein the rule specifies that if the number of reference picture entries in reference picture list 0 is greater than 0 and the number of reference picture entries in reference picture list 1 is equal to 0, the slice type of the slice is not a B slice.
[0577] 19. The method according to any of items 16 to 18, wherein the slice type is not included in the bitstream.
[0578] 20. The method of item 15, wherein reference picture entries are signaled or inferred before slice type is signaled or inferred.
[0579] 21. The method of item 15, wherein the reference picture entry is included in a picture header associated with the picture that contains the slice.
[0580] 22. A method of video processing (e.g., method 1930 shown in FIG. 19D) including performing 1932 a conversion between a video including one or more pictures including one or more slices and a video bitstream in accordance with rules, the rules specifying that the number of allowed filters in an Adaptation Parameter Set (APS) or the number of APSs depends on the coded information of the video.
[0581] 23. The method according to item 22, wherein the coded information includes the number of sub-pictures of the picture.
[0582] 24. The method according to item 22, wherein the number of allowed filters in an APS includes the number of luma ALFs (Adaptive Loop Filters), chroma ALFs, and cross-component ALFs of the ALF APS in all Adaptation Parameter Set (APS) NAL (Network Abstraction Layer) units in the picture unit.
[0583] 25. The method of item 22, wherein the number of allowed filters in an APS includes the number of ALF (Adaptive Loop Filter) classes for the luma component, the number of alternative filters for the chroma component, and / or the number of cross-component filters in all APS (Adaptation Parameter Set) NAL (Network Abstraction Layer) units within the picture unit.
[0584] 26. The method according to item 22, wherein the APS corresponds to an ALF APS, a scaling list APS, and / or a Luma Mapping with Chroma Scaling (LMCS) APS.
[0585] 27. The method according to item 22, wherein how to signal the APS identifier and / or the number of APSs used by the video unit depends on the number of allowed filters in the APS.
[0586] 28. The method of any one of items 1 to 27, wherein the conversion includes encoding the video into a bitstream.
[0587] 29. The method of any one of items 1 to 27, wherein the conversion includes decoding the video from a bitstream.
[0588] 30. A method according to any of items 1 to 27, wherein the converting includes generating a bitstream from the video, and the method further includes storing the bitstream in a non-transitory computer-readable recording medium.
[0589] 31. A video processing device comprising a processor configured to implement the methods according to one or more of items 1 to 30.
[0590] 32. A method for storing a video bitstream, comprising the method of any one of items 1 to 30 and further comprising storing the bitstream in a non-transitory computer-readable recording medium.
[0591] 33. A computer-readable medium storing program code that, when executed, causes a processor to implement the method described in one or more of items 1 to 30.
[0592] 34. A computer readable medium storing a bitstream generated according to any of the methods described above.
[0593] 35. A video processing device for storing a bitstream, configured to implement a method according to one or more of items 1 to 30.
[0594] Some embodiments of the disclosed technology include determining or determining to enable a video processing tool or mode. In one example, when a video processing tool or mode is enabled, an encoder uses or implements the tool or mode when processing one video block, but does not necessarily modify the resulting bitstream based on the use of the tool or mode. That is, the conversion from a block of video to a bitstream representation of video uses the video processing tool or mode when the video processing tool or mode is enabled based on the decision or determination. In another example, when a video processing tool or mode is enabled, a decoder processes the bitstream knowing that the bitstream has been modified based on the video processing tool or mode. That is, the conversion from the bitstream representation of video to a block of video is performed using the video processing tool or mode enabled based on the decision or determination.
[0595] Some embodiments of the disclosed techniques include deciding or determining to disable a video processing tool or mode. In one example, when a video processing tool or mode is disabled, an encoder does not use the tool or mode when converting blocks of a video into a bitstream representation of the video. In another example, when a video processing tool or mode is disabled, a decoder processes the bitstream with the knowledge that the bitstream has not been modified using a video processing tool or mode that was enabled based on the decision or determination.
[0596] Implementations of the disclosed and other solutions, examples, embodiments, modules, and functional operations described herein, including the structures disclosed herein and their structural equivalents, may be implemented in digital electronic circuitry, or computer software, firmware, or hardware, or in one or more combinations thereof. The disclosed and other embodiments may be implemented as one or more computer program products, i.e., one or more modules of computer program instructions encoded on a computer-readable medium for implementation by or for controlling the operation of a data processing apparatus. The computer-readable medium may be a machine-readable storage device, a machine-readable storage substrate, a memory device, a composition of matter that provides a machine-readable propagated signal, or one or more combinations thereof. The term "data processing apparatus" includes all apparatus, devices, and machines for processing data, including, for example, a programmable processor, a computer, or multiple processors, or computers. In addition to hardware, the apparatus may include code that creates an environment for the execution of the computer program, such as code that constitutes a processor firmware, a protocol stack, a database management system, an operating system, or one or more combinations thereof. A propagated signal is an artificially generated signal, for example a machine-generated electrical, optical, or electromagnetic signal, that is generated to encode information for transmission to an appropriate receiving device.
[0597] A computer program (also called a program, software, software application, script, or code) can be written in any form of programming language, including compiled or interpreted languages, and it can be deployed in any form, including as a stand-alone program or as a module, component, subroutine, or other unit suitable for use in a computing environment. A computer program does not necessarily correspond to a file in a file system. A program may be recorded as part of a file that holds other programs or data (e.g., one or more scripts stored in a markup language document), may be stored in a single file dedicated to the program, or may be stored in multiple coordinating files (e.g., a file that stores one or more modules, subprograms, or code portions). A computer program can be deployed to run on one computer located at one site, or on multiple computers distributed across multiple sites and interconnected by a communication network.
[0598] The processing and logic flows described herein may be performed by one or more programmable processors executing one or more computer programs to perform functions by operating on input data and generating output. The processing and logic flows may also be performed by, and an apparatus may be implemented as, special purpose logic circuitry, such as a Field Programmable Gate Array (FPGA) or an Application Specific Integrated Circuit (ASIC).
[0599] Processors suitable for executing computer programs include, for example, both general purpose and special purpose microprocessors, as well as any one or more processors of any kind of digital computer. Typically, a processor receives instructions and data from a read-only memory or a random access memory or both. The essential elements of a computer are a processor for executing instructions and one or more memory devices for storing instructions and data. Typically, a computer may include one or more mass storage devices, such as magnetic, magneto-optical, or optical disks, for storing data, or may be operatively coupled to receive data from or transfer data to these mass storage devices. However, a computer need not have such devices. Computer-readable media suitable for storing computer program instructions and data include all forms of non-volatile memory, media, and memory devices, including, for example, EPROMs, EEPROMs, flash storage devices, magnetic disks, such as internal hard disks or removable disks, magneto-optical disks, and semiconductor storage devices such as CD-ROM and DVD-ROM disks. The processor and memory may be supplemented by, or incorporated in, special purpose logic circuitry.
[0600] Although this patent specification contains many details, these should not be construed as limiting the scope of any subject matter or the scope of the claims, but rather as descriptions of features that may be specific to particular embodiments of a particular technology. Certain features described in this patent document in the context of separate embodiments may be implemented in combination in one example. Conversely, various features described in the context of one example may be implemented in multiple embodiments separately or in any suitable subcombination. Furthermore, although features may be described above as acting in a particular combination and initially claimed as such, one or more features from a claimed combination may, in some cases, be extracted from the combination, and the claimed combination may be directed to a subcombination or a variation of the subcombination.
[0601] Similarly, although operations are shown in a particular order in the figures, this should not be understood as requiring that such operations be performed in the particular order or sequential order shown, or that all of the operations shown be performed, to achieve desired results, nor should the separation of various system components in the embodiments described in this patent specification be understood as requiring such separation in all embodiments.
[0602] Only certain implementations and examples have been described; other embodiments, extensions and variations are possible based on the content described and illustrated in this patent document.
Claims
1. 1. A method for processing video data, comprising the steps of: determining whether a cross-component linear model (CCLM) prediction mode is applied to a first chroma block of a first video picture of a video for conversion between the first chroma block and a bitstream of the video; determining parameters of a CCLM for the first chroma block according to a rule; In the CCLM prediction mode, deriving a prediction sample of the first chroma block based on the CCLM and a parameter of the CCLM; performing the transform based on predicted samples of the first chroma block; having The rule specifies that the parameters of the CCLM are determined based on a first variable indicating neighboring chroma samples of the first chroma block and neighboring luma samples of a first luma block corresponding to the first chroma block; The rules further provide that if a value of a second variable indicates that a neighboring block is available, the first variable is set equal to a neighboring luma sample of the first luma block, and if the value of the second variable indicates that the neighboring block is not available, the first variable is set equal to a valid sample. If the value of the second variable indicates that the neighboring block is available, the first variable, denoted pY[x][y], is set equal to the upper luma sample of the reconstructed neighboring block before deblocking filtering at location (xTbY+x, yTbY+y); The maximum of x is equal to SubWidthC*Max(numSampT, nTbW)-1, (xTbY, yTbY) indicates the top left position of the first luminance block, x and y are integers; nTbW denotes the width of the first chroma block, SubWidthC is a width scale factor obtained according to the chroma format of the first video picture; A method in which numSampT indicates the number of available top-most neighboring chroma samples or available top-top and upper-right neighboring chroma samples in said CCLM prediction mode.
2. If the value of the second variable indicates that the neighboring block is available, the first variable, denoted pY[x][y], is set equal to the reconstructed neighboring left luma sample before deblocking filtering at location (xTbY+x, yTbY+y); x is in the range [-1, -3], The maximum of y is equal to SubHeightC*Max(numSampL, nTbH)-1, (xTbY, yTbY) indicates the top left position of the first luminance block, x and y are integers; nTbH denotes the height of the first chroma block, SubHeightC is a height scale factor obtained according to the chroma format of the first video picture; The method of claim 1 , wherein numSampL indicates a number of available neighboring chroma samples in the CCLM prediction mode.
3. if the CCLM prediction mode is a first CCLM prediction mode, numSampL is equal to the height of the first chroma block if the value of the second variable indicates that the neighboring block is available; If the CCLM prediction mode is the second CCLM prediction mode, numSampL is equal to nTbH+Min(numLeftBelow, nTbW); nTbW denotes the width of the first chroma block, The method of claim 2 , wherein numLeftBelow indicates the number of top-left neighbor chroma samples available.
4. The method of claim 2 or 3, wherein the neighboring block indicated by the second variable is a neighboring chroma block covering a position to the left of the neighborhood of the first luma block.
5. 5. The method according to claim 2, wherein if the value of the second variable indicates that the neighboring block is unavailable, the first variable, denoted pY[x][y], where x=-1, y=-1..SubHeightC*numSampL-1, is set equal to the reconstructed luma sample pY[0][y].
6. if the CCLM prediction mode is a first CCLM prediction mode, numSampT is equal to a width of the first chroma block if the value of the second variable indicates that the neighboring block is available; If the CCLM prediction mode is the third CCLM prediction mode, numSampT is equal to nTbW+Min(numTopRight, nTbH); nTbH denotes the height of the first chroma block, The method of claim 1 , wherein numTopRight indicates the number of top-right neighbor chroma samples available.
7. The method of claim 1 or 6, wherein the neighboring blocks indicated by the second variable are neighboring chroma blocks covering a position above a neighbor of the first luma block.
8. 8. The method of claim 1, 6 or 7, wherein if the value of the second variable indicates that the neighboring block is unavailable, the first variable, denoted pY[x][y], where x=-1..SubWidthC*numSampT-1, y=-1..-2, is set equal to the reconstructed luma sample pY[x][0].
9. The method of claim 1 , wherein the conversion comprises encoding the video into the bitstream.
10. The method of claim 1 , wherein the converting comprises decoding the video from the bitstream.
11. 1. An apparatus for processing video data, comprising a processor and a non-transitory memory having instructions, The instructions, when executed by the processor, cause the processor to: determining whether a cross-component linear model (CCLM) prediction mode is applied to a first chroma block of a first video picture of a video for conversion between the first chroma block and a bitstream of the video; determining parameters of a CCLM for the first chroma block according to a rule; In the CCLM prediction mode, deriving a prediction sample of the first chroma block based on the CCLM and a parameter of the CCLM; performing the transform based on predicted samples of the first chroma block; Run the command, The rule specifies that the parameters of the CCLM are determined based on a first variable indicating neighboring chroma samples of the first chroma block and neighboring luma samples of a first luma block corresponding to the first chroma block; The rules further provide that if a value of a second variable indicates that a neighboring block is available, the first variable is set equal to a neighboring luma sample of the first luma block, and if the value of the second variable indicates that the neighboring block is not available, the first variable is set equal to a valid sample. If the value of the second variable indicates that the neighboring block is available, the first variable, denoted pY[x][y], is set equal to the upper luma sample of the reconstructed neighboring block before deblocking filtering at location (xTbY+x, yTbY+y); The maximum of x is equal to SubWidthC*Max(numSampT, nTbW)-1, (xTbY, yTbY) indicates the top left position of the first luminance block, x and y are integers; nTbW denotes the width of the first chroma block, SubWidthC is a width scale factor obtained according to the chroma format of the first video picture; An apparatus, wherein numSampT indicates the number of available top-most neighboring chroma samples or available top-top and upper-right neighboring chroma samples in the CCLM prediction mode.
12. The processor: determining whether a cross-component linear model (CCLM) prediction mode is applied to a first chroma block of a first video picture of a video for conversion between the first chroma block and a bitstream of the video; determining parameters of a CCLM for the first chroma block according to a rule; In the CCLM prediction mode, deriving a prediction sample of the first chroma block based on the CCLM and a parameter of the CCLM; performing the transform based on predicted samples of the first chroma block; Run the command, The rule specifies that the parameters of the CCLM are determined based on a first variable indicating neighboring chroma samples of the first chroma block and neighboring luma samples of a first luma block corresponding to the first chroma block; The rules further provide that if a value of a second variable indicates that a neighboring block is available, the first variable is set equal to a neighboring luma sample of the first luma block, and if the value of the second variable indicates that the neighboring block is not available, the first variable is set equal to a valid sample. If the value of the second variable indicates that the neighboring block is available, the first variable, denoted pY[x][y], is set equal to the upper luma sample of the reconstructed neighboring block before deblocking filtering at location (xTbY+x, yTbY+y); The maximum of x is equal to SubWidthC*Max(numSampT, nTbW)-1, (xTbY, yTbY) indicates the top left position of the first luminance block, x and y are integers; nTbW denotes the width of the first chroma block, SubWidthC is a width scale factor obtained according to the chroma format of the first video picture; numSampT indicates the number of available top neighbor chroma samples or available top and upper right neighbor chroma samples in the CCLM prediction mode; A non-transitory computer-readable storage medium storing instructions.
13. 1. A method for storing a video bitstream, comprising: determining whether a cross-component linear model (CCLM) prediction mode is applied to a first chroma block of a first video picture of a video for conversion between the first chroma block and a bitstream of the video; determining parameters of a CCLM for the first chroma block according to a rule; In the CCLM prediction mode, deriving a prediction sample of the first chroma block based on the CCLM and a parameter of the CCLM; generating the bitstream based on predicted samples of the first chroma block; storing said bitstream on a non-transitory readable recording medium; having The rule specifies that the parameters of the CCLM are determined based on a first variable indicating neighboring chroma samples of the first chroma block and neighboring luma samples of a first luma block corresponding to the first chroma block; The rules further provide that if a value of a second variable indicates that a neighboring block is available, the first variable is set equal to a neighboring luma sample of the first luma block, and if the value of the second variable indicates that the neighboring block is not available, the first variable is set equal to a valid sample. If the value of the second variable indicates that the neighboring block is available, the first variable, denoted pY[x][y], is set equal to the upper luma sample of the reconstructed neighboring block before deblocking filtering at location (xTbY+x, yTbY+y); The maximum of x is equal to SubWidthC*Max(numSampT, nTbW)-1, (xTbY, yTbY) indicates the top left position of the first luminance block, x and y are integers; nTbW denotes the width of the first chroma block, SubWidthC is a width scale factor obtained according to the chroma format of the first video picture; A method in which numSampT indicates the number of available top-most neighboring chroma samples or available top-top and upper-right neighboring chroma samples in said CCLM prediction mode.
Citation Information
Cited By
Syntax for signaling cross-component video coding
JP2024023524A
Syntax for signaling cross-component video coding
US12289451B2
