Method, apparatus, and medium for video processing
By using context-based binarized syntax elements for residual coding, the method enhances coding efficiency in video processing, addressing inefficiencies in existing technologies like MPEG and HEVC.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- BYTEDANCE INC
- Filing Date
- 2025-10-20
- Publication Date
- 2026-04-30
AI Technical Summary
Existing video coding technologies, such as MPEG, ITU-T H.264/MPEG-4 AVC, and ITU-T H.265 HEVC, face challenges in improving coding efficiency for video encoding and decoding.
The method involves determining binarized syntax elements for residual coding using a context based on coding information, block position, size, neighboring blocks, or bin index, and performing the conversion accordingly to enhance coding efficiency.
This approach improves coding efficiency by optimizing the encoding and decoding processes, particularly in residual coding, leading to more effective video processing.
Smart Images

Figure US2025051641_30042026_PF_FP_ABST
Abstract
Description
METHOD, APPARATUS, AND MEDIUM FOR VIDEO PROCESSING FIELDS[OOOlJEmbodiments of the present disclosure relates generally to video processing techniques, and more particularly, to residual coding.BACKGROUND
[0002] In nowadays, digital video capabilities are being applied in various aspects of peoples’ lives. Multiple types of video compression technologies, such as motion picture expert group (MPEG) -2, MPEG-4, international telecommunication union - telecommunication standardization sector (ITU-T) H.263, ITU-T H.264 / MPEG-4 Part 10 advanced video coding (AVC), ITU-T H.265 high efficiency video coding (HEVC) standard, versatile video coding (VVC) standard, have been proposed for video encoding / decoding. However, coding efficiency of video coding techniques is generally expected to be further improved,SUMMARY[O0O3]Embodiments of the present disclosure provide a solution for video processing.[0004 Jin a first aspect, a method for video processing is proposed. The method comprises: determining, for a conversion between a block of a video and a bitstream of the video, that at least one binarized bin of a syntax element (SE) for residual coding associated with the block is coded with a context, wherein the context is determined based on at least one of: coding information, a plurality of factors, a position of the SE in a residual block, a size of the residual block, at least one corresponding block of a second component, at least one neighbouring block, or a bin index; and performing the conversion based on the at least one binarized bin of the SE. In this way, it can improve coding efficiency.[0005 Jin a second aspect, an apparatus for video processing is proposed. The apparatus comprises a processor and a non-transitory memory with instructions thereon. The instructions upon execution by the processor, cause the processor to perform a method in accordance with the first aspect of the present disclosure.
[0006] In a third aspect, a non-transitory computer-readable storage medium is proposed. The non-transitory computer-readable storage medium stores instructions that cause a processor to perform a method in accordance with the first aspect of the present disclosure.
[0007] In a fourth aspect, another non-transitory computer-readable recording medium is proposed. The non-transitory computer-readable recording medium stores a bitstream of a video which is generated by a method performed by an apparatus for video processing. The method comprises: determining that at least one binarized bin of a syntax element (SE) for residual coding associated with a block of the video is coded with a context, wherein the context is determined based on at least one of: coding information, a plurality of factors, a position of the SE in a residual block, a size of the residual block, at least one corresponding block of a second component, at least one neighbouring block, or a bin index; andgenerating the bitstream based on the at least one binarized bin of the SE.
[0008] In a fifth aspect, a method for storing a bitstream of a video is proposed. The method comprises: determining that at least one binarized bin of a syntax element (SE) for residual coding associated with a block of the video is coded with a context, wherein the context is determined based on at least one of: coding information, a plurality of factors, a position of the SE in a residual block, a size of the residual block, at least one corresponding block of a second component, at least one neighbouring block, or a bin index; generating the bitstream based on the at least one binarized bin of the SE; and storing the bitstream in a non-transitory computer-readable recording medium.[0009 JThis Summary is provided to introduce a selection of concepts in a simplified form that are further described below in the Detailed Description. This Summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.BRIEF DESCRIPTION OF THE DRAWINGS
[0010] Through the following detailed description with reference to the accompanying drawings, the above and other objectives, features, and advantages of example embodiments of the present disclosure will become more apparent. Fig. 4 illustrates positions of spatial and temporal neighboring blocks used in AMVP / merge candidate list construction;
[0011] Fig. 1 illustrates a block diagram of an example video coding system in accordance with some embodiments of the present disclosure;
[0012] Fig. 2 illustrates a block diagram of an example video encoder in accordance with some embodiments of the present disclosure;
[0013] Fig. 3 illustrates a block diagram of an example video decoder in accordance with some embodiments of the present disclosure;
[0014] Fig. 4 illustrates positions of spatial and temporal neighboring blocks used in AMVP / merge candidate list construction;
[0015] Fig. 5 illustrates positions of non-adjacent candidate in ECM;
[0016] Fig. 6A and Fig. 6B illustrate a control point based affine motion model, respectivelyy;
[0017] Fig. 7 illustrates the affine MVF per subblock;
[0018] Fig. 8 illustrates locations of inherited affine motion predictors;
[0019] Fig. 9 illustrates the control point motion vector inheritance;
[0020] Fig. 10 illustrates locations of candidates position for constructed affine merge mode;
[0021] Fig. 11A and Fig. 11B illustrate spatial neighbors for deriving affine merge candidates, respectivelyy;
[0022] Fig. 12 illustrates from non-adjacent neighbors to constructed affine merge candidates;
[0023] Fig. 13 illustrates an example of generating an HAPC;
[0024] Fig. 14 illustrates an illustration of regression based affine merge candidate derivation;
[0025] Fig. 15 illustrates the template matching performing on a search area around initial MV;
[0026] Fig 16 illustrates a template and the corresponding reference template;
[0027] Fig. 17 illustrates a template and the reference template for block with sub -block motion using the motion information of the subblocks of current block;
[0028] Fig. 18 illustrates the derivation process of the sub-block level motion field for SbTMVP;
[0029] Fig. 19 illustrates examples of the GPM splits grouped by identical angles;
[0030] Fig. 20 illustrates a uni -prediction MV selection for geometric partitioning mode;[0031 IFig. 21 illus trates the exemplified generation of a bending weight w __0 using geometric partitioning mode;
[0032] Fig. 22 illustrates the ramp function for the weights for GPM blending based on the displacement (d) from a predicted sample position to the GPM partitioning boundary and the blending area size (r);
[0033] Fig. 23A to Fig. 23D illustrate the GPM with inter and intra prediction, respectivelyy;
[0034] Fig 24 illustrates the edge on templates;
[0035] Fig. 25 illustrates possible neighbouring block positions;
[0036] Fig. 26 illustrates a flowchart of a method for video processing in accordance with some embodiments of the present disclosure; and
[0037] Fig, 27 illustrates a block diagram of a computing device in which various embodiments of the present disclosure can be implemented.
[0038] Throughout the drawings, the same or similar reference numerals usually refer to the same or similar elements.DETAILED DESCRIPTION
[0039] Principle of the present disclosure will now be described with reference to some embodiments. It is to be understood that these embodiments are described only for the purpose of illustration and help those skilled in the art to understand and implement the present disclosure, without suggesting any limitation as to the scope of the disclosure. The disclosure described herein can be implemented in various manners other than the ones described below.[0040JIn the following description and claims, unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skills in the art to whichthis disclosure belongs.[0041 ^References in the present disclosure to “one embodiment,” “an embodiment,” “an example embodiment,” and the like indicate that the embodiment described may include a particular feature, structure, or characteristic, but it is not necessary that every embodiment includes the particular feature, structure, or characteristic. Moreover, such phrases are not necessarily referring to the same embodiment. Further, when a particular feature, structure, or characteristic is described in connection with an example embodiment, it is submitted that it is within the knowledge of one skilled in the art to affect such feature, structure, or characteristic in connection with other embodiments whether or not explicitly described.[0042 Jit shall be understood that although the terms “first” and “second” etc. may be used herein to describe various elements, these elements should not be limited by these terms. These terms are only used to distinguish one element from another. For example, a first element could be termed a second element, and similarly, a second element could be termed a first element, without departing from the scope of example embodiments. As used herein, the term “and / or” includes any and all combinations of one or more of the listed terms.
[0043] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of example embodiments. As used herein, the singular forms “a”, “an” and “the” are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms “comprises”, “comprising”, “has”, “having”, “includes” and / or “including”, when used herein, specify the presence of stated features, elements, and / or components etc., but do not preclude the presence or addition of one or more other features, elements, components and / or combinations thereof.Example Environment
[0044] Fig. 1 is a block diagram that illustrates an example video coding system 100 that may utilize the techniques of this disclosure. As shown, the video coding system 100 may include a source device 110 and a destination device 120. The source device 110 can be also referred to as a video encoding device, and the destination device 120 can be also referred to as a video decoding device. In operation, the source device 110 can be configured to generate encoded video data and the destination device 120 can be configured to decode the encoded video data generated by the source device 110. The source device 110 may include a video source 112, a video encoder 114, and an input / output (I / O) interface 116.
[0045] The video source 112 may include a source such as a video capture device. Examples of the video capture device include, but are not limited to, an interface to receive video data from a video content provider, a computer graphics system for generating video data, and / or a combination thereof.
[0046] The video data may comprise one or more pictures. The video encoder 114 encodes the video data from the video source 112 to generate a bitstream. The bitstream may include a sequence of bits that form a coded representation of the video data. The bitstream may include coded pictures and associated data. The coded picture is a coded representation of a picture. The associated data may include sequenceparameter sets, picture parameter sets, and other syntax structures. The I / O interface 116 may include a modulator / demodulator and / or a transmitter. The encoded video data may be transmitted directly to destination device 120 via the I / O interface 116 through the network 130A. The encoded video data may also be stored onto a storage medium / server 130B for access by destination device 120.
[0047] The destination device 120 may include an I / O interface 126, a video decoder 124, and a display device 122. The I / O interface 126 may include a receiver and / or a modem. The I / O interface 126 may acquire 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 which is configured to interface with an external display device.
[0048] The video encoder 114 and the video decoder 124 may operate according to a video compression standard, such as the High Efficiency Video Coding (HEVC) standard, Versatile Video Coding (VVC) standard and other current and / or further standards.
[0049] Fig. 2 is a block diagram illustrating an example of a video encoder 200, which may be an example of the video encoder 114 in the system 100 illustrated in Fig. 1, in accordance with some embodiments of the present disclosure,[OOSOJThe video encoder 200 may be configured to implement any or all of the techniques of this disclosure. In the example of Fig. 2, the video encoder 200 includes a plurality of functional components. The techniques described in this disclosure may be shared among the various components of the video encoder 200. In some examples, a processor may be configured to perform any or all of the techniques described in this disclosure.
[0051] In some embodiments, the video encoder 200 may include a partition unit 201, a prediction unit 202 which may include a mode select unit 203, a motion estimation unit 204, a motion compensation unit 205 and an intra-prediction unit 206, a residual generation unit 207, a transform unit 208, a quantization unit 209, an inverse quantization unit 210, an inverse transform unit 211, a reconstruction unit 212, a buffer 213, and an entropy encoding unit 214.
[0052] In other examples, the video encoder 200 may include more, fewer, or different functional components. In an example, the prediction unit 202 may include an intra block copy (IBC) unit. The IBC unit may perform prediction in an IBC mode in which at least one reference picture is a picture where the current video block is located.
[0053] Furthermore, although some components, such as the motion estimation unit 204 and the motion compensation unit 205, may be integrated, but are represented in the example of Fig. 2 separately for purposes of explanation.
[0054] The partition unit 201 may partition a picture into one or more video blocks. The video encoder 200 and the video decoder 300 may support various video block sizes.
[0055] The mode select unit 203 may select one of the coding modes, intra or inter, e.g., based on error results, and provide the resulting intra-coded or inter-coded block to a residual generation unit 207 to generate residual block data and to a reconstruction unit 212 to reconstruct the encoded block for use as a reference picture. In some examples, the mode select unit 203 may select a combined inter and intra prediction (CIIP) mode in which the prediction is based on an inter prediction signal and an intra prediction signal. The mode select unit 203 may also select a resolution for a motion vector (e.g., a sub-pixel or integer pixel precision) for the block in the case of inter-prediction.
[0056] To perform inter prediction on a current video block, the motion estimation unit 204 may generate motion information for the current video block by comparing one or more reference frames from buffer 213 to the current video block. The motion compensation unit 205 may determine a predicted video block for the current video block based on the motion information and decoded samples of pictures from the buffer 213 other than the picture associated with the current video block.
[0057] The motion estimation unit 204 and the motion compensation unit 205 may perform different operations for a current video block, for example, depending on whether the current video block is in an I-slice, a P-slice, or a B-slice. As used herein, an ‘T-slice” may refer to a portion of a picture composed of macroblocks, all of which are based upon macroblocks within the same picture. Further, as used herein, in some aspects, “P-slices” and “B-slices” may refer to portions of a picture composed of macroblocks that are not dependent on macroblocks in the same picture.
[0058] In some examples, the motion estimation unit 204 may perform uni -directional prediction for the current video block, and the motion estimation unit 204 may search reference pictures of 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 that indicates the reference picture in list 0 or list 1 that contains the reference video block and a motion vector that indicates a spatial displacement between the current video block and the reference video block. The motion estimation unit 204 may output the reference index, a prediction direction indicator, and the motion vector as the motion information of the current video block. The motion compensation unit 205 may generate the predicted video block of the current video block based on the reference video block indicated by the motion information of the current video block.
[0059] Alternatively, in other examples, the motion estimation unit 204 may perform bi-directional prediction for the current video block. The motion estimation unit 204 may search the reference pictures in list 0 for a reference video block for the current video block and may also search the reference pictures in list 1 for another reference video block for the current video block. The motion estimation unit 204 may then generate reference indexes that indicate the reference pictures in list 0 and list 1 containing the reference video blocks and motion vectors that indicate spatial displacements between the reference video blocks and the current video block. The motion estimation unit 204 may output the reference indexes and the motion vectors of the current video block as the motion information of the current video block. The motion compensation unit 205 may generate the predicted video block of the current video block based on the reference video blocks indicated by the motion information of the current video block.
[0060] In some examples, the motion estimation unit 204 may output a full set of motion information for decoding processing of a decoder. Alternatively, in some embodiments, the motion estimation unit 204 may signal the motion information of the current video block with reference to the motion information of another video block. For example, the motion estimation unit 204 may determine that the motion information of the current video block is sufficiently similar to the motion information of a neighboring video block,[0061 Jin one example, the motion estimation unit 204 may indicate, in a syntax structure associated with the current video block, a value that indicates to the video decoder 300 that the current video block has the same motion information as the another video block.
[0062] In another example, the motion estimation unit 204 may identify, in a syntax structure associated with the current video block, another video block and a motion vector difference (MVD). The motion vector difference indicates a difference between the motion vector of the current video block and the motion vector of the indicated video block. The 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.
[0063] As discussed above, video encoder 200 may predictively signal the motion vector. Two examples of predictive signaling techniques that may be implemented by video encoder 200 include advanced motion vector prediction (AMVP) and merge mode signaling.
[0064] The intra prediction unit 206 may perform intra prediction on the current video block. When the intra prediction unit 206 performs intra prediction on the current video block, the intra prediction unit 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.
[0065] The residual generation unit 207 may generate residual data for the current video block by subtracting (e.g., indicated by the minus sign) the predicted video block (s) of the current video block from the current video block. The residual data of the current video block may include residual video blocks that correspond to different sample components of the samples in the current video block.
[0066] In other examples, there may be no residual data for the current video block, for example in a skip mode, and the residual generation unit 207 may not perform the subtracting operation.
[0067] The transform unit 208 may generate one or more transform coefficient video blocks for the current video block by applying one or more transforms to a residual video block associated with the current video block.
[0068] After the transform unit 208 generates a transform coefficient video block associated with the current video block, the quantization unit 209 may quantize the transform coefficient video block associated with the current video block based on one or more quantization parameter (QP) values associated with the current video block.
[0069] The inverse quantization unit 210 and the inverse transform unit 211 may apply inverse quantization and inverse transforms to the transform coefficient video block, respectivelyy, to reconstruct a residual video block from the transform coefficient video block. The reconstruction unit 212 may add the reconstructed residual video block to corresponding samples from one or more predicted video blocks generated by the prediction unit 202 to produce a reconstructed video block associated with the current video block for storage in the buffer 213.
[0070] After the reconstruction unit 212 reconstructs the video block, loop filtering operation may be performed to reduce video blocking artifacts in the video block,[0071 JThe entropy encoding unit 214 may receive data from other functional components of the video encoder 200. When the entropy encoding unit 214 receives the data, the entropy encoding unit 214 may perform one or more entropy encoding operations to generate entropy encoded data and output a bitstream that includes the entropy encoded data.
[0072] Fig. 3 is a block diagram illustrating an example of a video decoder 300, which may be an example of the video decoder 124 in the system 100 illustrated in Fig. 1, in accordance with some embodiments of the present disclosure.
[0073] The video decoder 300 may be configured to perform any or all of the techniques of this disclosure. In the example of Fig. 3, the video decoder 300 includes a plurality of functional components. The techniques described in this disclosure may be shared among the 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.
[0074] In the example of Fig. 3, 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, a reconstruction unit 306 and a buffer 307. The video decoder 300 may, in some examples, perform a decoding pass generally reciprocal to the encoding pass described with respect to video encoder 200.
[0075] The entropy decoding unit 301 may retrieve an encoded bitstream. The encoded bitstream may include entropy coded video data (e.g., encoded blocks of video data). The entropy decoding unit 301 may decode the entropy coded video data, and from the entropy decoded video data, the motion compensation unit 302 may determine motion information including motion vectors, motion vector precision, reference picture list indexes, and other motion information. The motion compensation unit 302 may, for example, determine such information by performing the AMVP and merge mode. AMVP is used, including derivation of several most probable candidates based on data from adjacent PBs and the reference picture. Motion information typically includes the horizontal and vertical motion vector displacement values, one or two reference picture indices, and, in the case of prediction regions in B slices, an identification of which reference picture list is associ ated with each index. As used herein, in some aspects, a “merge mode” may refer to deriving the motion information from spatially or temporally neighboring blocks.
[0076] The motion compensation unit 302 may produce motion compensated blocks, possibly performing interpolation based on interpolation filters. Identifiers for interpolation filters to be used with sub -pixel precision may be included in the syntax elements.
[0077] The motion compensation unit 302 may use the interpolation filters as used by the video encoder 200 during encoding of the video block to calculate interpolated values for sub -integer pixels of a reference block. The motion compensation unit 302 may determine the interpolation filters used by the video encoder 200 according to the received syntax information and use the interpolation filters to produce predictive blocks.
[0078] The motion compensation unit 302 may use at least part of the syntax information to determine sizes of blocks used to encode frame(s) and / or slice(s) of the encoded video sequence, partition information that describes how each macroblock of a picture of the encoded video sequence is partitioned, modes indicating how each partition is encoded, one or more reference frames (and reference frame lists) for each inter-encoded block, and other information to decode the encoded video sequence. As used herein, in some aspects, a “slice” may refer to a data structure that can be decoded independently from other slices of the same picture, in terms of entropy coding, signal prediction, and residual signal reconstruction. A slice can either be an entire picture or a region of a picture.
[0079] The intra prediction unit 303 may use intra prediction modes for example received in the bitstream to form a prediction block from spatially adjacent blocks. The inverse quantization unit 304 inverse quantizes, i.e., de-quantizes, the quantized video block coefficients provided in the bitstream and decoded by entropy decoding unit 301. The inverse transform unit 305 applies an inverse transform.
[0080] The reconstruction unit 306 may obtain the decoded blocks, e.g., by summing the residual blocks with the corresponding prediction blocks generated by the motion compensation unit 302 or intraprediction unit 303. If desired, a deblocking filter may also be applied to filter the decoded blocks in order to remove blockiness artifacts. The decoded video blocks are then stored in the buffer 307, which provides reference blocks for subsequent motion compensation / intra prediction and also produces decoded video for presentation on a display device,
[0081] Some example embodiments of the present disclosure will be described in detailed hereinafter. It should be understood that section headings are used in the present document to facilitate ease of understanding and do not limit the embodiments disclosed in a section to only that section. Furthermore, while certain embodiments are described with reference to Versatile Video Coding or other specific video codecs, the disclosed techniques are applicable to other video coding technologies also. Furthermore, while some embodiments describe video coding steps in detail, it will be understood that corresponding steps decoding that undo the coding will be implemented by a decoder. Furthermore, the term video processing encompasses video coding or compression, video decoding or decompression and video transcoding in which video pixels are represented from one compressed format into another compressed format or at a different compressed bitrate.1 Brief Summary
[0082] The present disclosure is related to video coding technologies. Specifically, it is about residual coding in video coding. The ideas may be applied individually or in various combination, to any video coding standard or non-standard video codec.2 Introduction
[0083] The exponential increasing of multimedia data poses a critical challenge for video coding. To satisfy the increasing demands for more efficient compression technology, ITU-T and ISO / IEC have developed a series of video coding standards in the past decades. In particular, the ITU-T produced H.261 and H.263, ISO / IEC produced MPEG-1 and MPEG-4 visual, and the two organizations jointly developed the H.262 / MPEG-2 Video, H.264 / MPEG-4 Advanced Video Coding (AVC), H.265 / HEVC and the latest VVC standards. Since H.262 / MPEG-2, hybrid video coding framework is employed wherein in intra / inter prediction plus transform coding are utilized.2.1 MVP in video coding
[0084] Inter prediction aims to remove the temporal redundancy between adjacent frames, which serves as an indispensable component in the hybrid video coding framework. Specifically, inter prediction makes use of the contents specified by motion vector (MV) as the predicted version of the current to-be-coded block, thus only residual signals and motion information are transmitted in the bitstream. To reduce the cost for MV signaling, motion vector prediction (MVP) came into being as an effective mechanism to convey motion information. Early strategies simply use the MV of a specified neighboring block or the median MV of neighboring blocks as MVP. In H.265 / HEVC competing mechanism was involved where the optimal MVP is selected from multiple candidates through rate distortion optimization (RDO). In particular, advanced MVP (AMVP) mode and merge mode are devised with different motion information signaling strategy. With the AMVP mode, a reference index, a MVP candidate index referring to an AMVP candidate list and motion vector difference (MVD) is signaled. Regarding the merge mode, only a merge index referring to a merge candidate list is signaled, and all the motion information associated with the merge candidate is inherited. Both AMVP mode and merge mode need to construct MVP candidate list, and the details of the construction process for these two modes are described as follows.[0085JAMVP mode: AMVP exploits spatial -temporal correlation of motion vector with neighboring blocks, which is used for explicit transmission of motion parameters. For each reference picture list, a motion vector candidate list is constructed by firstly checking availability of left, above temporally neighboring positions, removing redundant candidates and adding zero vector to make the candidate list to be constant length. For spatial motion vector candidate derivation, two motion vector candidates are eventually derived based on motion vectors of blocks located in five different positions as depicted in Fig. 4. Fig. 4 illustrates positions of spatial and temporal neighboring blocks used in AMVP / merge candidate list construction. The five neighboring blocks located at BO, Bl, B2, and AO, Al are classified into two groups, where Group A includes the three above spatial neighboring blocks and Group B includes the two left spatial neighboring blocks. The two MV candidates are respectivelyy derived with the first available candidate from Group A and Group B in a predefined order. For temporal motion vectorcandidate derivation, one motion vector candidate is derived based on two different collocated positions (bottom-right (CO) and central (Cl)) checked in order, as depicted in Fig. 4. To avoid redundant MV candidates, duplicated motion vector candidates in the list are abandoned. If the number of potential candidates is smaller than two, additional zero motion vector candidates are added to the list.
[0086] Aferge mode. Similar to AMVP mode, MVP candidate list for merge mode comprises of spatial and temporal candidates as well. For spatial motion vector candidate derivation, at most four candidates are selected with order Al, Bl, BO, AO and B2 after performing availability and redundant checking. For temporal merge candidate (TMVP) derivation, at most one candidate is selected from two temporal neighboring blocks (CO and Cl), When there are not enough merge candidates with spatial and temporal candidates, combined bi-predictive merge candidates and zero MV candidates are added to MVP candidate list. Once the number of available merge candidates reaches the signaled maximally allowed number, the merge candidate list construction process is terminated.
[0087] In VVC, the construction process for merge mode is further improved by introducing the history -based MVP (HMVP), which incorporates the motion information of previously coded blocks which may be far away from current block. In VVC, HMVP merge candidates are appended to merge list after the spatial MVP and TMVP. In this method, the motion information of a previously coded block is stored in a table and used as MVP for the current CU, The table with multiple HMVP candidates is maintained with first-in -first-out strategy during the encoding / decoding process. Whenever there is a non-subblock inter-coded CU, the associated motion information is added to the last entry of the table as a new HMVP candidate.
[0088] During the standardization of VVC, Non-adjacent MVP was proposed to facilitate better motion information derivation by exploiting the non-adjacent area. In ECM software, Non-adjacent MVP are inserted between TMVP and HMVP, where the distances between non-adjacent spatial candidates and current coding block are based on the width and height of current coding block as depicted in Fig. 5. Fig, 5 illustrates positions of non-adjacent candidate in ECM.2.2 Affine motion compensated prediction
[0089] In HEVC, only translation motion model is applied for motion compensation prediction (MCP). While in the real world, there are many kinds of motion, e.g. zoom in / out, rotation, perspective motions and the other irregular motions. In VVC, a block -based affine transform motion compensation prediction is applied. As shown in Fig. 6A and Fig. 6B, the affine motion field of the block is described by motion information of two control point (4-parameter) or three control point motion vectors (6-parameter).
[0090] For 4-parameter affine motion model, motion vector at sample location (x, y) in a block is derived as:[0091 JFor 6-parameter affine motion model, motion vector at sample location (x, y) in a block is derived as:(2)miw..Where (mvOx, rnvOy) is motion vector of the top-left comer control point, (invlx, mvly) is motion vector of the top-right comer control point, and (mv2x, mv2y) is motion vector of the bottom -left comer control point.
[0092] In order to simplify the motion compensation prediction, block based affine transform prediction is applied. Fig. 7 illustrates the affine MVF per subblock. To derive motion vector of each 4x4 luma subblock, the motion vector of the center sample of each subblock, as shown in Fig. 7, is calculated according to above equations, and rounded to 1 / 16 fraction accuracy. Then the motion compensation interpolation filters are applied to generate the prediction of each subblock with derived motion vector. The subblock size of chroma-components is also set to be 4x4. The MV of a 4x4 chroma subblock is calculated as the average of the MVs of the top-left and bottom-right luma subblocks in the collocated 8x8 luma region.
[0093] As done for translational motion inter prediction, there are also two affine motion inter prediction modes: affine merge mode and affine AMVP mode.2.2.1 Affine merge prediction
[0094] Affine merge mode can be applied for CUs with both width and height larger than or equal to 8. In this mode the CPMVs of the current CU is generated based on the motion information of the spatial neighboring CUs. There can be up to five CPMVP candidates and an index is signalled to indicate the one to be used for the current CU. In VVC, the following three types of CPVM candidate are used to form the affine merge candidate list:- Inherited affine merge candidates that extrapolated from the CPMVs of the neighbour CUs- Constructed affine merge candidates CPMVPs that are derived using the translational MVs of the neighbour CUs- Zero MVs[0095JI11 VVC, there are maximum two inherited affine candidates, which are derived from affine motion model of the neighboring blocks, one from left neighboring CUs and one from above neighboring CUs. Fig. 8 illustrates locations of inherited affine motion predictors. The candidate blocks are shown in Fig.8. For the left predictor, the scan order is AO-> A1, and for the above predictor, the scan order is BO-> B1-> B2. Only the first inherited candidate from each side is selected. No pruning check is performed between two inherited candidates. When a neighboring affine CU is identified, its control point motion vectors are used to derived the CPMVP candidate in the affine merge list of the current CU. Fig, 9 illustrates the control point motion vector inheritance. As shown in Fig. 9, if the neighbour left bottom block A is coded in affine mode, the motion vectors v2, v and v4of the top left corner, above right corner and left bottom comer of the CU which contains the block A are attained. When block A is coded with 4-parameter affine model, the two CPMVs of the current CU are calculated according to v2, and v3. In case that block A is coded with 6-parameter affine model, the three CPMVs of the current CU are calculated according to v2, v3and v4.
[0096] Constructed affine candidate means the candidate is constructed by combining the neighbor translational motion inform ation of each control point. Fig, 10 illustrates locations of candidates positionfor constructed affine merge mode. The motion information for the control points is derived from the specified spatial neighbors and temporal neighbor shown in Fig. 10. CPMVk (k=l, 2, 3, 4) represents the k-th control point. For CPMV1, the B2-> B3-> A2 blocks are checked and the MV of the first available block is used. For CPMV2, the Bl-> B0 blocks are checked and for CPMV3, the Al-> A0 blocks are checked. For TMVP is used as CPMV4 if it’s available.
[0097] After MVs of four control points are attained, affine merge candidates are constructed based on those motion information. The following combinations of control point MVs are used to construct in order:{CPMV1, CPMV2, CPMV3}, {CPMVI, CPMV2, CPMV4}, {CPMVI, CPMV3, CPMV4),{CPMV2, CPMV3, CPMV4), { CPMVI, CPMV2}, { CPMV1, CPMV3}
[0098] The combination of 3 CPMVs constructs a 6-parameter affine merge candidate and the combination of 2 CPMVs constructs a 4 -parameter affine merge candidate. To avoid motion scaling process, if the reference indices of control points are different, the related combination of control point MVs is discarded.
[0099] After inherited affine merge candidates and constructed affine merge candidate are checked, if the list is still not full, zero MVs are inserted to the end of the list.2.2.2 Affine AMVP prediction
[0100] Affine AMVP mode can be applied for CUs with both width and height larger than or equal to 16. An affine flag in CU level is signalled in the bitstream to indicate whether affine AMVP mode is used and then another flag is signalled to indicate whether 4 -parameter affine or 6-parameter affine. In this mode, the difference of the CPMVs of current CU and their predictors CPMVPs is signalled in the bitstream. The affine AVMP candidate list size is 2 and it is generated by using the following four types of CPVM candidate in order:- Inherited affine AMVP candidates that extrapolated from the CPMVs of the neighbour CUs Constructed affine AMVP candidates CPMVPs that are derived using the translational MVs of the neighbour CUs- Translational MVs from neighboring CUs- Zero MVs[OlOlJThe checking order of inherited affine AMVP candidates is same to the checking order of inherited affine merge candidates. The only difference is that, for AVMP candidate, only the affine CU that has the same reference picture as in current block is considered. No pruning process is applied when inserting an inherited affine motion predictor into the candidate list.
[0102] Constructed AMVP candidate is derived from the specified spatial neighbors shown in Fig. 10. The same checking order is used as done in affine merge candidate construction. In addition, reference picture index of the neighboring block is also checked. The first block in the checking order that is inter coded and has the same reference picture as in current CUs is used. There is only one When the current CU is coded with 4-parameter affine mode, and mvO and mvl are both available, they are added as one candidate in the affine AMVP list. When the current CU is coded with 6-parameter affine mode, and all three CPMVs are available, they are added as one candidate in the affine AMVP list. Otherwise,constructed AMVP candidate is set as unavailable.
[0103] If affine AMVP list candidates is still less than 2 after valid inherited affine AMVP candidates and constructed AMVP candidate are inserted. mvO, mvl and mv2 will be added, in order, as the translational MVs to predict all control point MVs of the current CU, when available. Finally, zero MVs are used to fill the affine AMVP list if it is still not full.2.2.3 New Affine candidates derivation methods in ECM-6.0
[0104] ln ECM-6.0, 3 additional Affine merge and AMVP candidate derivation methods are integrated, which are Non-adjacent spatial candidates, History-parameter-based candidates and Regression based affine candidates.2.2.3.1 Non-adjacent spatial candidates
[0105] In ECM-6.0, non-adjacent spatial neighbors are investigated to provided candidates for both Affine merge and Affine AMVP. Fig. 11A and Fig. 11B illustrate spatial neighbors for deriving affine merge candidates, respectivelyy. Fig. 11A illustrates spatial neighbors for deriving affine merge candidates for deriving inherited affine merge candidates. Fig, 1 IB illustrates spatial neighbors for deriving affine merge candidates for deriving constructed affine merge candidates. The pattern of obtaining non-adjacent spatial candidates is shown in Fig. 11A and Fig. 1 IB. Same as the non-adjacent regular merge candidates, the distances between non-adjacent spatial candidates and current coding block are also defined based on the width and height of current CU.
[0106] The motion information of the non-adjacent spatial neighbors in Fig. 11A and Fig. 11B is utilized to generate additional inherited and constructed affine merge candidates. Specifically, to generate inherited candidates, the non-adjacent spatial neighbors are checked based on their distances to the current block, i.e., from near to far. At a specific distance, only the first available neighbor which is coded with Affine mode from each side (e.g., the left and above) of the current block is included. As indicated in Fig. 11A, the checking of the neighbors on the left and above sides are performed from bottom-to-up and right-to-left, respectivelyy. For constructed candidates, as shown in the Fig. I IB, the positions of one left and above non-adjacent spatial neighbors are firstly determined independently; After that, the location of the top-left neighbor can be determined accordingly to form a rectangular virtual block together with the left and above non-adjacent neighbors. Fig. 12 illustrates from non-adjacent neighbors to constructed affine merge candidates. The motion information of the three non-adjacent neighbors is used to form the CPMVs at the top-left (A), top-right (B) and bottom-left (C) of the virtual block, which is projected to the cun-ent CU to generate the corresponding constructed candidates, as shown in Fig. 12.2.2.3.2 History-parameter-based affine candidates
[0107] History-parameter-based affine model inheritance (HAMI) allows the affine model to be inherited from a previously affine-coded block which may not be neighboring to the current block. A history -parameter table (HPT) is established. An entry of HPT stores a set of affine parameters: a, b, c and d, each of which is represented by a 16-bit signed integer. Entries in HPT is categorized by reference list and reference index. Five reference indices are supported for each reference list in HPT. In a formular way, the category of HPT (denoted as HPTCat) is calculated asHPTCat (RefList, Refldx) = 5 / RefList + min (Refldx, 4) (3) wherein RefList and Refldx represents a reference picture list (0 or 1) and a reference index, respectivelyy. For each category, at most seven entries can be stored, resulting in 70 entries totally in HPT. At the beginning of each CTU row, the number of entries for each category is initialized as zero. After decoding an affine-coded CU with reference list RefListcur and Refldxcur, the affine parameters are utilized to update entries in the category7HPTCat(RefListcur, Refldxcur) in a way similar to HMVP table updating,
[0108] Fig. 13 illustrates an example of generating an HAPC, A history -affine-parameter-based candidate (HAPC) is derived from a neighbouring 4x4 block denoted as AO, Al, BO, Bl or B2 in Fig. 13 and a set of affine parameters stored in a corresponding entry7in HPT. The MV of a neighbouring 4x4 block served as the base MV. In a formulating way, the MV of the current block at position (x, y) is calculated as:where (mvhbase, mvvbase) represents the MV of the neighbouring 4x4 block, (xbase, ybase) represents the center position of the neighbouring 4x4 block, (x, y) can be the top-left, top-right and bottom-left comer of the current block to obtain the comer-position MVs (CPMVs) for the current block, or it can be the center of the current block to obtain a regular MV for the current block.
[0109] Fig. 13 shows an example of how to derive an HAPC from block AO. The affine parameters {a0, bO, cO, d0} are directly fetched from one entry of category HPTIdx(RefListAO, refldxOAO) in HPT. The affine parameters from HPT, with the center position of AO as the base position, and the MV of block AO as the base MV, are used together to derive the CPMVs for an affine merge HAPC, or an affine AMVP HAPC. They can also be used to derive MVs located at the center of the current block, as regular merge candidates. A HAPC can be put into the sub -block-based merge candidate list, the affine AMVP candidate list or the regular merge candidate list. As a response to new HAPCs being introduced, the size of sub-block-based merge candidate list is increased from five to ten and twelve for random access and low-delay B configurations, respectivelyy. Besides, the size of regular merge candidate list is increased from ten to eleven for random access configurations to accommodate the new7L added regular merge candidates.2.2.3.3 Regression based affine candidate[OllOJIn ECM-6.0, the regression based affine merge candidates are derived and added to the affine merge list. Subblock motion field from a previously coded affine CU and motion information from adjacent subblocks of a current CU are used as the input to the regression process to derive proposed affine candidates.[OlllJThe previously coded affine CU can be identified from scanning through non-adjacent positions and the affine HMVP table. Fig. 14 illustrates an illustration of regression based affine merge candidate derivation. Adjacent subblock information of current CU is fetched from 4x4 sub-blocks represented by the grey zone as depicted in Fig. 14, For each sub-block, given a reference list, the corresponding motion vector and center coordinate of the sub-block may be used.
[0112] For each affine CU, up to 2 affine candidates can be derived. One with adjacent subblock information and one without. All the linear-regression-generated candidates are pruned and collected into one candidate sub-group, TM cost based ARMC process is applied when ARMC is enabled. Afterwards,up to N linear-regression-generated candidates are added to the affine merge list when N affine CUs are found.2.3 Template matching merge / AMVP mode in ECM
[0113] Template matching (TM) merge / AMVP mode is a decoder-side MV derivation method to refine the motion information of the current CU by finding the closest match between a template (i.e., top and / or left neighboring blocks of the current CU) in the current picture and a block (i.e,, same size to the template) in a reference picture. Fig. 15 illustrates the template matching performing on a search area around initial MV. As illustrated in Fig. 15, a better MV is to be searched around the initial motion of the current CU within a [- 8, +8]-pel search range.
[0114] In AMVP mode, an MVP candidate is determined based on the template matching error to pick up the one which reaches the minimum difference between the current block and the reference block templates, and then TM performs only for this particular MVP candidate for MV refinement. TM refines this MVP candidate, starting from full-pel MVD precision (or 4-pel for 4-pel AMVR mode) within a [-8, -i-8]-pel search range by using iterative diamond search. The AMVP candidate may be further refined by using cross search with full -pel MVD precision (or 4-pel for 4-pel AMVR mode), followed sequentially by half-pel and quarter-pel ones depending on AMVR mode. This search process ensures that the MVP candidate still keeps the same MV precision as indicated by adaptive motion vector resolution (AMVR) mode after TM process.[0115 Jin the merge mode, similar search method is applied to the merge candidate indicated by the merge index. TM merge may perform all the way down to 1 / 8 -pel MVD precision or skipping those beyond half-pel MVD precision, depending on whether the alternative interpolation filter (that is used when AMVR is of half -pel mode) is used according to merged motion information. Besides, when TM mode is enabled, template matching may work as an independent process or an extra MV refinement process between block-based and subblock-based bilateral matching (BM) methods, depending on whether BM can be enabled or not according to its enabling condition check. When BM and TM are both enabled for a CU, the search process of TM stops at half-pel MVD precision and the resulted MVs are further refined by using the same model-based MVD derivation method as in DMVR.2.4 Adaptive reorder of merge candidates (ARMC)
[0116] Inspired by the spatial correlation between reconstructed neighboring pixels and the current coding block, adaptive reorder of merge candidates (ARMC) was proposed to refine the candidates order in a given candidate list. The underlying assumption is that the candidates with less template matching cost have higher probability to be chosen through RDO process, hence should be placed in front positions within the list to reduce the signaling cost.
[0117] The reordering method is applied to regular merge mode, template matching (TM) merge mode, and affine merge mode (excluding the SbTMVP candidate). For the TM merge mode, merge candidates are reordered before the refinement process.
[0118] After a merge candidate list is constructed, merge candidates are divided into several subgroups. The subgroup size is set to 5. Merge candidates in each subgroup are reordered ascendingly according to cost values based on template matching. For simplification, merge candidates in the last but not the firstsubgroup are not reordered.
[0119] The template matching cost is measured by the sum of absolute differences (SAD) between samples of a template of the current block and their corresponding reference template. Fig. 16 illustrates a template and the corresponding reference template. The template comprises a set of reconstructed samples neighboring to the current block, while reference template is located by the same motion information of the current block, as illustrated in Fig. 16, When a merge candidate utilizes bi-directional prediction, the reference samples of the template of the merge candidate are also generated by bi-prediction.
[0120] For subblock-based merge candidates with subblock size equal to Wsub * Hsub, the above template comprises several sub-templates with the size of Wsub * K, and the left template comprises several sub-templates with the size of K * Hsub. Fig. 17 illustrates a template and the reference template for block with sub-block motion using the motion information of the subblocks of current block. As shown in Fig. 17, the motion information of the subblocks in the first row and the first column of current block is used to derive the reference samples of each sub-template.2.5 Subblock-based temporal motion vector prediction (SbTMVP)
[0121] VVC supports the subblock -based temporal motion vector prediction (SbTMVP) method. Similar to the TMVP, SbTMVP takes advantage of the motion field in the collocated picture to facilitate more precise MVP derivation. The same collocated picture used by TMVP is used for SbTVMP. SbTMVP differs from TMVP mainly in two aspects. Firstly, SbTMVP enables sub-CU level.
[0122] motion prediction whereas TMVP predicts motion at CU level; Secondly, compared with TMVP that fetches the temporal MV from the collocated block in the collocated picture (the collocated block is the bottom-right or center block relative to the current CU), SbTMVP applies a motion shift before fetching the temporal motion information from the collocated picture, where the motion shift is obtained by re-using the MV from one of the spatial neighboring blocks of the current CU.
[0123] Fig. 18 illustrates the derivation process of the sub-block level motion field for SbTMVP. In particular, the motion information of left -bottom sub-block Al is firstly fetched, if either of the MVs in reference listO and listl points to the collocated frame, then the corresponding MV will be identified as motion shift. Otherwise, zero mv will be used as motion shift.
[0124] Once the motion shift is determined, the specified regions in the collocated frame is employed to derive sub-block level motion field. Assuming Al’ motion is used as motion shift as depicted in Fig. 18. Then for each sub-CU, the motion information of its corresponding block (the smallest motion grid that covers the center sample) in the collocated picture is fetched to provide motion information, where MV scale operation is firstly performed to align the reference frames of the temporal motion vectors to those of the current CU.
[0125] In VVC and ECM, in addition to CU level MVP candidate list, a sub-CU level MVP candidate list is also constructed to provide more precise motion prediction for the current CU, which comprises the motion fields produced by both SbTMVP and AFFINE methods. In particular, only one SbTMVP candidate is included and is always placed in the first entry of the constructed sub-CU level MVP candidate list, whereas multiple AFFINE candidates are included in the list after performing templatematching-based reordering, where those with smaller costs are placed in fronter positions.2,6 Geometric partitioning mode (GPM)
[0126] In VVC, a geometric partitioning mode is supported for inter prediction. The geometric partitioning mode is signalled using a CU-level flag as one kind of merge mode, with other merge modes including the regular merge mode, the MMVD mode, the CUP mode and the subblock merge mode. In total 64 partitions are supported by geometric partitioning mode for each possible CU size w x h = 2mx 2nwith m, n G {3 6} excluding 8x64 and 64x8.
[0127] Fig. 19 illustrates examples of the GPM splits grouped by identical angles. When this mode is used, a CU is split into two geometry partitions by a geometrically located straight line (Fig. 19). The location of the splitting line is mathematically derived from the angle and offset parameters of a specific partition. Each part of a geometric partition in the CU is inter-predicted using its own motion: only uniprediction is allowed for each partition, that is, each part has one motion vector and one reference index. The uni-prediction motion constraint is applied to ensure that same as the conventional bi -prediction, only two motion compensated prediction are needed for each CU.
[0128] If geometric partitioning mode is used for the current CU, then a geometric partition index indicating the partition mode of the geometric partition (angle and offset), and two merge indices (one for each partition) are further signalled. The number of maximum GPM candidate size is signalled explicitly in SPS and specifies syntax binarization for GPM merge indices. After predicting each of part of the geometric partition, the sample values along the geometric partition edge are adjusted using a blending processing with adaptive weights. This is the prediction signal for the whole CU, and transform and quantization process will be applied to the whole CU as in other prediction modes. Finally, the motion field of a CU predicted using the geometric partition modes is stored.2.6.1 Uni-prediction candidate list construction
[0129] Fig. 20 illustrates a uni -prediction MV selection for geometric partitioning mode. The uni-prediction candidate list is derived directly from the merge candidate list constructed according to the extended merge prediction process. Denote n as the index of the uni -prediction motion in the geometric uni-prediction candidate list. The LX motion vector of the n-th extended merge candidate, with X equal to the parity of n, is used as the n-th uni-prediction motion vector for geometric partitioning mode. These motion vectors are marked with “x” in Fig. 20. In case a corresponding LX motion vector of the n-the extended merge candidate does not exist, the L(1 - X) motion vector of the same candidate is used instead as the uni-prediction motion vector for geometric partitioning mode.2.6.2 Blending along the geometric partitioning edge
[0130] After predicting each part of a geometric partition using its own motion, blending is applied to the two prediction signals to derive samples around geometric partition edge. The blending weight for each position of the CU are derived based on the distance between individual position and the partition edge.
[0131] The distance for a position (x,y) to the partition edge are derived as:d(x,y) = (2x + 1 — w) cos(< Pi) + (2y + 1 — ) siitytp / ) — pj (2-1)Pj = Px cos(^t) + Py,j smGpi) (2-2)where i,j are the indices for angle and offset of a geometric partition, which depend on the signaled geometric partition index. The sign of pXiiand pydepend on angle index i.
[0132] The weights for each part of a geometric partition are derived as following:[0133JThe partldx depends on the angle index i. One example of weigh iv0is illustrated in Fig. 21. Fig, 21 illustrates the exemplified generation of a bending weight w0using geometric partitioning mode.2.6.3 Geometric partitioning mode (GPM) with merge motion vector differences (MMVD)[0134JGPM in VVC is extended by applying motion vector refinement on top of the existing GPM unidirectional MVs. A flag is first signalled for a GPM CU, to specify whether this mode is used. If the mode is used, each geometric partition of a GPM CU can further decide whether to signal MVD or not. If MVD is signalled for a geometric partition, after a GPM merge candidate is selected, the motion of the partition is further refined by the signalled MVDs information. All other procedures are kept the same as in GPM.[0135 JThe MVD is signaled as a pair of distance and direction, similar as in MMVD. There are nine candidate distances (!4-pel,! -pel, 1-pel, 2-pel, 3 -pel, 4-pel, 6-pel, 8-pel, 16-pel), and eight candidate directions (four horizontal / vertical directions and four diagonal directions) involved in GPM with MMVD (GPM-MMVD). In addition, when pic fpel mmvd enabled flag is equal to 1, the MVD is left shifted by 2 as in MMVD.2.6.4 Geometric partitioning mode (GPM) with adaptive blending
[0136] In VVC, the final prediction samples are generated with by blending the prediction of the two prediction signals using weighted average. Two integer blending matrices (IFo and C) are used. The weights in the GPM blending matrices are derived from the ramp function based on the displacement from a predicted sample position to the GPM partitioning boundary. The blending area size is fixed to two (2 samples on each side of the GPM partition split boundary).
[0137] Fig. 22 illustrates the ramp function for the weights for GPM blending based on the displacement (d) from a predicted sample position to the GPM partitioning boundary’ and the blending area size (T). The blending process in ECM is improved by adding four extra blending area sizes (quarter, half, double, and quadrupole of the existing area size) as shown in Fig. 22. A CU level flag is coded to signal the selected blending area size is signalled. Furthermore, the extended weighting precision is utilized, in which the maximum value of the weighs is changed from 8 (in VVC) to 32 to accommodate the extended blending area sizes.2.6.5 Geometric partitioning mode (GPM) with template matching (TM)
[0138] Template matching is applied to GPM. When GPM mode is enabled for a CU, a CU -level flag issignaled to indicate whether TM is applied to both geometric partitions. Motion information for each geometric partition is refined using TM. When TM is chosen, a template is constructed using left, above or left and above neighboring samples according to partition angle, as shown in Table 1. The motion is then refined by minimizing the difference between the current template and the template in the reference picture using the same search pattern of merge mode with half-pel interpolation filter disabled.Table 1. Template for the 1st and 2nd geometric partitions, where A represents using above samples, L represents using left samples, and L+A represents using both left and above samples.
[0139] A GPM candidate list is constructed as follows:1. Interleaved List-0 MV candidates and List-1 MV candidates are derived directly from the regular merge candidate list, where List-0 MV candidates are higher priority than List-1 MV candidates. A pruning method with an adaptive threshold based on the current CU size is applied to remove redundant MV candidates,2. Interleaved List-1 MV candidates and List-0 MV candidates are further derived directly from the regular merge candidate list, where List-1 MV candidates are higher priority than List-0 MV candidates. The same pruning method with the adaptive threshold is also applied to remove redundant MV candidates.3. Zero MV candidates are padded until the GPM candidate list is full.
[0140] The GPM-MMVD and GPM-TM are exclusively enabled to one GPM CU. This is done by firstly signaling the GPM-MMVD syntax. When both two GPM-MMVD control flags are equal to false (i.e., the GPM-MMVD are disabled for two GPM partitions), the GPM-TM flag is signaled to indicate whether the template matching is applied to the two GPM partitions. Otherwise (at least one GPM-MMVD flag is equal to true), the value of the GPM-TM flag is inferred to be false.2.6.6 GPM with inter and intra prediction
[0141] In GPM with inter and intra prediction, the final prediction samples are generated by weighting inter predicted samples and intra predicted samples for each GPM-separated region. The inter predicted samples are derived by inter GPM whereas the intra predicted samples are derived by an intra prediction mode (IPM) candidate list and an index signaled from the encoder. The 1PM candidate list size is predefined as 3, Fig. 23A to Fig. 23D illustrate the GPM w th inter and intra prediction, respectivelyy. The available IPM candidates are the parallel angular mode against the GPM block boundary (Parallel mode), the perpendicular angular mode against the GPM block boundary’ (Perpendicular mode), and the Planar mode as shown Fig. 23A to Fig. 23C, respectivelyy. Furthermore, GPM with intra and intra prediction as shown Fig. 23D is restricted to reduce the signalling overhead for IPMs and avoid an increase in the size of the intra prediction circuit on the hardware decoder. In addition, a direct motion vector and IPM storageon the GPM-blending area is introduced to further improve the coding performance.
[0142] In DIMD and neighboring mode based IPM derivation Parallel mode is registered first. Therefore, max two IPM candidates derived from the decoder-side intra mode derivation (DIMD) method and / or the neighboring blocks can be registered if there is not the same IPM candidate in the list. As for the neighboring mode derivation, there are five positions for available neighboring blocks at most, but they are restricted by the angle of GPM block boundary as shown in Table 2, which are already used for GPM with template matching (GPM-TM).Table 2. The position of available neighboring blocks for IPM candidate derivation based on the angle of GPM block boundary. A and L denotes the above and left side of the prediction block.
[0143] GPM-intra can be combined with GPM with merge with motion vector difference (GPM-MMVD). TIMD is used for on IPM candidates of GPM-intra to further improve the coding performance. The Parallel mode can be registered first, then IPM candidates of TIMD, DIMD, and neighboring blocks, 2,6.7 Template matching based reordering for GPM split modes
[0144] In template matching based reordering for GPM split modes, given the motion information of the current GPM block, the respective TM cost values of GPM split modes are computed. Then, all GPM split modes are reordered in ascending ordering based on the TM cost values. Instead of sending GPM split mode, an index using Golomb-Rice code to indicate where the exact GPM split mode located in the reordering list is signaled.
[0145] The reordering method for GPM split modes is a two-step process performed after the respective reference templates of the two GPM partitions in a coding unit are generated, as follows:• extending GPM partition edge into the reference templates of the two GPM partitions, resulting in 64 reference templates and computing the respective TM cost for each of the 64 reference templates;« reordering GPM split modes based on their TM cost values in ascending order and marking the best 32 split modes as available split modes.[0146 JFig. 24 illustrates the edge on templates. The edge on the template is extended from that of the current CU, as Fig. 24 illustrates, but GPM blending process is not used in the template area across the edge.
[0147] After ascending reordering using TM cost, an index is signaled.2.6.8 Motion field storage for geometric partitioning mode
[0148] Mvl from the first part of the geometric partition, Mv2 from the second part of the geometric partition and a combined Mv of Mvl and Mv2 are stored in the motion filed of a geometric partitioning mode coded CU.
[0149] The stored motion vector type for each individual position in the motion filed are determined as: sType = abs (motion! dx) < 32? 2; (motionldx < 0?( 1 — parti dx'): par ldx) (2-43) where motionldx is equal to d(4x + 2, 4y + 2), which is recalculated from equation (2-36). The partldx depends on the angle index i.
[0150] If sType is equal to 0 or 1, MvO or Mvl are stored in the corresponding motion field, otherwise if sType is equal to 2, a combined Mv from MvO and Mv2 are stored. The combined Mv are generated using the following process:1) If Mvl and Mv2 are from different reference picture lists (one from LO and the other from LI), then Mvl and Mv2 are simply combined to form the bi-prediction motion vectors.2) Otherwise, if Mvl and Mv2 are from the same list, only uni-prediction motion Mv2 is stored.2.7 Multi-hypothesis prediction (MHP)
[0151] In the multi-hypothesis inter prediction mode, one or more additional motion -compensated prediction signals are signaled, in addition to the conventional bi -prediction signal. The resulting overall prediction signal is obtained by sample-wise weighted superposition. With the bi-prediction signal pbiand the first additional inter prediction signal / hypothesis h3, the resulting prediction signal p3is obtained as follows:p3= (1 - a pbi+ ah3
[0152] The weighting factor a is specified by the new syntax element add hyp weight idx, according to the following mapping:
[0153] Analogously to above, more than one additional prediction signal can be used. The resulting overall prediction signal is accumulated iteratively with each additional prediction signal.Pn+1 (1 n + 'l )Pn T ^-n+l^-n l
[0154] The resulting overall prediction signal is obtained as the last prt(i.e., the pnhaving the largest index n). Within this EE, up to two additional prediction signals can be used (i.e., n is limited to 2).
[0155] The motion parameters of each additional prediction hypothesis can be signaled either explicitly by specifying the reference index, the motion vector predictor index, and the motion vector difference, or implicitly by specifying a merge index. A separate multi -hypothesis erge flag distinguishes between these two signalling modes.
[0156] For inter AMVP mode, MHP is only applied if non -equal weight in BCW is selected in biprediction mode.
[0157] Combination of MHP and BDOF is possible, however the BDOF is only applied to the bi-prediction signal part of the prediction signal (i.e., the ordinary first two hypotheses).2.8 Affine motion compensation in geometry prediction mode[0158 Jit is proposed that sub-block-based motion compensation may be used in the GPM mode.a) In one example, the sub-block -based motion compensation may be affine motion compensation. b) In one example, the sub-block-based motion compensation may be sbTMVP motion compensation.c) In one example, the prediction of at least one geometry partition may be generated with sub-blockbased motion compensation such as affine motion compensation.d) In one example, the final prediction may be generated by a weighted sum of two predictions, where at least one of them is generated with sub-block-based motion compensation such as affine motion compensation.i, In one example, the weighted sum is performed with the weighting values defined by GPM. e) In one example, the two predictions used in GPM mode may be type A and type B, wherein type A and type B may be (type A and type B may be the same type):i. Non-affine inter-prediction;ii. Affine inter-prediction;iii. Intra-prediction;iv. Intra block copy (IBC) prediction;v. sb-TMVP inter-prediction;vi. Any? combined or generated prediction.AbbreviationsACT adaptive colour transformALF adaptive loop filterAMVR adaptive motion vector resolutionAPS adaptation parameter setAU access unitAUD access unit delimiterA VC advanced video coding (Rec, ITU-T H.264 | ISO / IEC 14496-10)B bi-predictiveBCW bi-prediction with CU-Ievel weightsBDOF bi-directional optical flowBDPCM block-based delta pulse code modulationBP buffering periodCABAC context-based adaptive binary arithmetic codingCB coding blockCBR constant bit rateCCALF cross-component adaptive loop filterCPB coded picture bufferCRA clean random accessCRC cyclic redundancy checkCTB coding tree blockCTU coding tree unitCU coding unitCVS coded video sequenceDPB decoded picture bufferDC! decoding capability informationDRAP dependent random access pointDU decoding unitDUI decoding unit informationEG exponential-GolombEGk k-th order exponential-GolombEOB end of bitstreamEOS end of sequenceFD filler dataFIFO first-in, first-outFL fixed-lengthGBR green, blue, and redGCI general constraints informationGDR gradual decoding refreshGPM geometric partitioning modeHEVC high efficiency video coding (Rec. ITU-T H.265 | ISO / IEC 23008-2) HRD hypothetical reference decoderHSS hypothetical stream schedulerI intraIBC intra block copyIDR instantaneous decoding refreshILRP inter-layer reference pictureIRAP intra random access pointLFNST low frequency non-separable transformLIC Local Illumination CompensationLPS least probable symbolLSB least significant bitLTRP long-term reference pictureLMCS luma mapping with chroma scalingMIP matri -based intra predictionMPS most probable symbolMSB most significant bitMTS multiple transform selectionMVP motion vector predictionNAL network abstraction layerOBMC overlapped block motion compensationOLS output layer setOP operation pointOPI operating point informationP predictivePH picture headerPOC picture order countPPS picture parameter setPROF prediction refinement with optical flowPT picture timingPU picture unitQP quantization parameterRADL random access decodable leading (picture)RASL random access skipped leading (picture)RBSP raw byte sequence payloadRGB red, green, and blueRPL reference picture listSAO sample adaptive offsetSAR sample aspect ratioSEI supplemental enhancement informationSH slice headerSLI subpicture level informationSODB string of data bitsSPS sequence parameter setSTRP short-term reference pictureSTSA step-wise temporal sublayer accessTR truncated riceVBR variable bit rateVC i. video coding layerVPS video parameter setVSEI versatile supplemental enhancement information (Rec. ITU-T H.274 | ISO / IEC 23002-7) VUI video usability informationVVC versatile video coding (Rec. ITU-T H.266 | ISO / IEC 23090-3)SE syntax element3 Problems1) In VVC and ECM, a SE in residual coding may be coded with limited contexts or even without a context, where the entropy coding may be inefficient.4 Detailed solutions
[0159] ln this contribution, we disclose several methods of residual coding.
[0160] The detailed embodiments below should be considered as examples to explain general concepts. These embodiments should not be interpreted in a narrow way. Furthermore, these embodiments can be combined in any m aimer,
[0161] The terms ‘video unit' or ‘coding unit' or ‘block’ may represent a coding tree block (CTB), acoding tree unit (CTU), a coding block (CB), a CU, a PU, a TU, a PB, a TB.
[0162] The terms ‘Affine block’ may represent a block coded with Affine merge, Affine AMVP or any other Affine variant mode (i.e., Affine MMVD etc), which may be described by motion information of two control point (4-parameter) or three control point motion vectors (6-parameter). The terms ‘CPMV’ may represent the motion information of a Affine block at top -left, top-right and / or bottom-left corners.
[0163] The term ‘template’ may represent a reconstructed region that can be used to refine the CPMV, which may represent either ‘separate template’ or ‘unified template". Here a ‘separate template’ may represent a reconstructed region that can be used to refine individual CPMV, i.e., specific one(s) of topleft, top-right and / or bottom-left corners, while a ‘unified template’ may represent a reconstructed region that can be used to refine all or arbitrary CPMV(s) for a block. The term ‘template matching cost’ or ‘ TM cost’ may represent either matching cost of a separate template or a unified template.
[0164] In the present disclosure, regarding “a block coded with mode N”, here “mode N” may be a prediction mode (e.g., MODE INTRA, MODE INTER, MODE PLT, MODE IBC, and etc.), or a coding technique (e.g., DIMD, TIMD, PDPC, CCLM, CCCM, GLM, intraTMP, AMVP, SMVD, Merge, BDOF, PROF, DMVR, AMVR, TM, Affine, CUP, GPM, spatial GPM, SGPM, GPM inter-inter, GPM intra-intra, GPM inter-intra, MHP, GEO, TPM, MMVD, BCW, HMVP, SbTMVP, LIC, OBMC, ALF, deblocking, SAO, bilateral filter, LMCS, and the corresponding variants, and etc.).
[0165] It is noted that the terminologies mentioned below are not limited to the specific ones defined in existing standards. Any variance of the coding tool is also applicable.
[0166] In the following discussion, The SE may be binarized as a fixed length code, an EG(x) code, a unary code, a truncated unary code, a truncated binary code, etc. It may be signed or unsigned.
[0167] In the follow ing discussion, the term “context” may refer to a context model used to code / parse a SE in arithmetic coding, such as in context adaptive binarized arithmetic coding (CABAC). Two different context models for one SE may be initialized wnth different values.In the disclosure, a “significant coefficient” refers to a non-zero coefficient.In the disclosure, a “residual coding SE” may refer to any SE that is used to encode / decode the residual information, including but not limited to:A SE indicates the position of the last significant coefficient, such as last_sig_coeff_x_prefix, last sig coeff x suffix, last_sig_coeff_y_prefix, last__sig__coeff_y_suffix in VVC,A SE indicates whether there is at least one significant coefficient in a coding group (CG, also known as a subblock of a residual block, which may be 2x2 or 4x4), such as sb coded flag in WC,A SE indicates whether there is at least one significant coefficient in a coding group (CG, also known as a subblock of a residual block, which may be 2x2 or 4x4), such as sb coded flag in WC.A SE indicates whether a coefficient is zero or non-zero, such as sig coeff flag in WC.A SE indicates whether a coefficient or the absolute value of a coefficient is greater than a specific value, such as abs_level_gtx_flag in VVC.A SE indicates the parity of a coefficient or the absolute value of a coefficient, such as parjevel flag in VVC. A SE indicates the value of a coefficient or the absolute value of a coefficient, such as abs remainder and dec abs level in VVC,A SE indicates the sign of a coefficient, such as coeff sign flag in W C.1. It is proposed that at least one binarized bin of a residual coding SE may be coded with a context depends on coding information including but not limited to:a) Coding mode, such as whether it is intra-coded, inter-coded, IBC-coded or template-intra coded. b) QP.c) Inter-prediction direction, such as bi-prediction or uni -prediction.d) Merge inter-mode or AMVP inter-mode.e) Intra-prediction mode.f) CCP mode or non-CCP mode.g) Residual block width and / or height.h) Transform types.i) Whether it is CUP mode.j) Whether it is GPM mode.k) Whether it is SGPM mode.l) Whether it is MIP mode.m) Whether it is EIP mode.n) Whether it is affine coded.o) The position of the SE in the residual block.p) At least one previously encoded / decoded residual SE inside the residual block.q) At least one previously encoded / decoded residual SE of at least one neighbouring block.r) At least one previously encoded / decoded residual SE of a different component.s) At least one SE which is not a residual SE,t) Color component and / or color format.i. For example, all color components may share the same context or context set.ii. For example, Cb and Cr may share the same context or context set.iii. ¥ and Cb / Cr may apply two sets of contexts.2. It is proposed that at least one binarized bin of a residual coding SE may be coded with a context determined by multiple factors. For example, the context index C may be derive as C = ContextTablefidx l]... [idx n], wherein idx__l... idx_n may represent N indices determined by N factors individually, to retrieve the context.3. It is proposed that at least one binarized bin of a residual coding SE may be coded with a context determined by the position of the SE in the residual block.a) For example, die SE may be sb coded flag [ xS ][ yS ], wherein (xS, yS) represents the subblock coordination of the subblock corresponding to the SE.i. In one example, a first context or a first context set may be applied if (xS, xY) satisfies a condition or several conditions, and a second context or a second context set may be applied otherwise, 1 ) The condition may be xS > Tx ji yS > Ty.2) The condition may be xS > Tx && y S > Ty.3) The condition may be xS < Tx ji yS < Ty.4) The condition may be xS < Tx && yS < Ty.5) The condition may be xS * yS > T,6) The condition may be xS * yS < T.7) The threshold Tx, Ty and T may depend on width and / or height of the residual block. a) For example, Tx = (wS+off)»shift, where wS is the width of the residual block in the number of subblocks. For example, wS = W / w’, where W is the width of the residual block and w’ is the width of a subblock. E.g, off =1, shift = 1, or off = 2, shift = 2. b) For example, Ty = (hS+off)»shift, where hS is the height of the residual block in the number of subblocks. For example, hS = 11 h'. where H is the height of the residual block andr’ is the height of a subblock. E.g. off =1, shift = 1, or off = 2, shift = 2. c) For example,d) For example,8) In one example, Tx, Ty and T may depend on color format and color components.ii. In one example, a context set may comprise multiple contexts and one of them may be selected based on previously decoded sb coded flag.1) For example, a first context may be selected if sb coded flag [ xS - 1][ yS 1 == 1 || sb coded Hagl xS][ yS - 1]::::::1, otherwise, a second context may be selected.4. It is proposed that at least one binarized bin of a residual coding SE may be coded with a context determined by width (denoted as W) and / or height (denoted as H) of the residual block.a) For example, the SE may be coeff sign flag.b) In one example, a first context or a first context set may be applied if W and / or H satisfies a condition or several conditions, and a second context or a second context set may be applied otherwise.i. The condition may be W > n*H. For example, n = 2.ii. The condition may be W < n*H. For example, n = 2.iii. The condition may be II > n*W. For example, n = 2.iv. The condition may be H < n*W. For example, n = 2.v. The condition may be W > Tx |i H > Ty.vi. The condition may be W > Tx && H > Ty.vii. The condition may be W < Tx | i H < Ty.viii. The condition may be W < Tx && H < Ty.ix. The condition may be W * H > T.x. The condition may be W * II < T.xi. Tx, Ty and T tire integers. For example, Tx=Ty=8. T ~ 64.I) In one example, Tx, Ty and T may depend on color format and color components.5. It is proposed that at least one binarized bin of a residual coding SE of a first component may be coded with a context determined by at least one corresponding block of a second component.a) For example, the first component may be Cb and / or Cr, and the second component may be Y, b) In one example, the corresponding block of the second component be derived from the current block of the first component, depending on the color format.i. In one example, the corresponding block must cover at least one position (X’, Y’) of the second component, corresponding to a position (X, Y) of the first component.1) (X’, Y’) may be derived from (X, Y), wherein the derivation may depend on color format.E.g. X' = n*X and Y’=m*Y.a) With the color format YUV 4:2:0, n - m - 2;b) With the color format YUV 4:2:2, n = 2, m =1, or n = 1, m = 2;c) With the color format YU V 4:4: 4, n = m =1.ii. Suppose the top-left position of the current residual block is (X0, Y0), the width and height of it are W and H, respectivelyy, then the position (X, Y) may be set equal to:1) (X0, Y)2) (X0 + W-l, Y0)3) (X0, Y0+H-1)4) (X0+W-1, Y0+H-1)5) (XO+W / 2 + offX, Y0+H / 2+offY), wherein offX and offY may be -1, 0, or 1.c) The context may be determined by the corresponding block of a second component, which is denoted as CorrB:i. The availability of CorrB.ii. The coding mode of CorrB.iii. The CBF of CorrB.iv. The width and / or height of CorrB.v. The number of non-zero coefficients of CorrB.vi. The last position of non-zero coefficient in CorrB.vii. The sum of absolute values of non-zero coefficients of CorrB.d) In one example, a first context or a first context set may be applied if the corresponding residual block satisfies a condition or several conditions, and a second context or a second context set may be applied otherwise.i. For example, if the corresponding residual block is coded with a specific mode, the first context or a first context set may be applied.1) The specific mode may be palette coding,2) The specific mode may be transform skip.3) The specific mode may be BDPCM.ii. For example, if the corresponding residual block is coded with all coefficients equal to zero (CBF=0), the first context or a first context set may be applied.iii. For example, if the position of the last non-zero coefficient (denoted as (lastX, lastY)) of the corresponding residual block satisfies a condition, the first context or a first context set may be applied; and the second context or a second context set may be applied otherwise, 1) The condition may be lastX > Tx || lastY > Ty.2) The condition may be lastX > Tx && lastY > Ty.3) The condition may be lastX < Tx || lastY < Ty.4) The condition may be lastX < Tx && lastY < Ty.5) The threshold Tx and Ty may depend on width (We) and / or height (He) of the corresponding residual block.a) For example, Tx = (Wc+off)»shift. E.g. off =1, shift = 1, or off = 2, shift = 2. b) For example, Ty = (Hc+off)»shift. E.g. off -1, shift = 1, or off - 2, shift - 2. c) For example, Tx = max(M, (Wc+off)»shift). E.g. M = 1,d) For example, Ty = max(M, (Hc+off)»shift), E.g. M =1.It is proposed that at least one binarized bin of a residual coding SE may be coded with a context determined by at least one neighbouring block.a) The SE may indicate the position of the last significant coefficient, such as last_sig_coeff_x_prefix, last_sig_coeff_x_suffix, last_sig_coeffjy_prefix, last_sig_coeff_y_suffix in VVC.b) In one example, f(Nei) may be derived for a neighbouring block, denoted as Nei, where f is a function.i. For example, f(Nei, Q) may be derived for the Q-coordinate of the last position of the non zero coefficient, wherein Q = X or Y. In the following discussion, f(Nei) may refer to f(Nei, X) or f(Nei, Y).ii. f(Nei) may depend on1) The availability of Nei.2) The coding mode of Nei.3) The CBF ofNei.4) The width and / or height of Nei.5) The number of non-zero coefficients of Nei.6) The last position of non-zero coefficient in Nei.7) The sum of absolute values of non-zero coefficients of Nei.iii. For example, f(Nei) = F0 when at least one condition (or several of them) below is (are) satisfied.1) Nei is not available.2) Nei is in a region inaccessible.3) Nei is coded with a specific mode.a) Nei is coded with palette mode,b) Nei is coded with IBC mode.c) Nei is coded with transform skip mode.d) Nei is coded with inter mode.e) Nei is coded with intra mode.f) Nei is coded with BDPCM mode.4) Nei is not coded with a specific mode determined by the coding mode of the current block.a) For example, the current block is intra-coded but Nei is not intra-coded, b) For example, the current block is not intra-coded but Nei is intra-coded.5) Nei is coded with coded bit flag (CBF) = 0.6) The width and / or height of Nei is larger than or smaller than a threshold.7) The size of Nei is larger than or smaller than a threshold.iv. For example, f(Nei) = Fl if the last position of Nei satisfies one condition (or several of them).1) For example, the condition is N lastQ >= Tl and N lastQ < T2, wherein Q is X or Y, (N_IastX, N_lastY) stands for the position of the last significant coefficient of the neighouring block Nei.2) For example, the condition is M Jasi. Q > Tl and N lastQ <= T2, wherein Q is X or Y, (NJastX, N lastY) stands for the position of the last significant coefficient of the neighouring block Nei.3) For example, the condition is N lastQ >= Tl, wherein Q is X or Y, (N lastX, N lastY) stands for the position of the last significant coefficient of the neighouring block Nei. 4) For example, the condition is N lastQ > T 1, wherein Q is X or Y, (NJastX, NJastY) stands for the position of the last significant coefficient of the neighouring block Nei.5) For example, the condition is N_lastQ <= T2, wherein Q is X or Y, (N_lastX, NJastY) stands for the position of the last significant coefficient of the neighouring block Nei. 6) For example, the condition is N lastQ < T2, wherein Q is X or Y, (N_lastX, N lastY) stands for the position of the last significant coefficient of the neighouring block Nei.7) For example, Q is X if the current SE represents the X-dimension coordinate of the last position of the non-zero coefficient, such as last sig coeff xjprefix and last sig co- eff_x_suffix.8) For example, Q is Y if the current SE represents the Y-dimension coordinate of the last position of the non-zero coefficient, such as last _sig_coeff_y_i>reftx and last sig co- eff_y__suffix.9) The threshold Tl and T2 may depend on the width (Wn) and / or height (Hn) of Nei.a) For example, Tl and T2 may depend on width if Q = X.b) For example, T 1 and T2 may depend on height if Q = Y.c) For example, Tl or T2 = (Wn+off)»shift. E.g. off =1, shift = 1, or off 2, shift = 2. d) For example, Tl or T2 = (Hn+off)»shift. E.g. off =4, shift = 1, or off = 2, shift = 2. e) For example, Tl or T2 = max(M, (Wn+off)»shift). E.g. M 1.f) For example, Tl or T2 = max(M, (Hn+off)»shift). E.g. M =1.v. For example, f(Nei) = F 1 if1) N lastQ >= max(l, Wn»2) && N lastQ < max(2, Wn»l ) for Q = X.2) N lastQ >= max(l, Hn»2) && N lastQ < max(2, Hn»l) for Q = Y.vi. For example, f(Nei)= F2 if f(Nei) is not equal to either F0 or Fl.vii. For example, F0 = 0, Fl = 1 and Fl = 2.c) In one example, at least two neighbouring blocks, denoted as NeiA and NeiB, may be used to derive the context.i. For example, the context index C may be derived as1) C=f(NeiA) + f(NeiB).2) C=f(NeiA) | f(NeiB).3) C=f(NeiA) & f(NeiB).ii. Alternatively, only one neighbouring block may be used to derive the context.1) For example, the context index C may be derived asa) C=f(NeiA).b) O f(NeiB).2) For example, NeiA and NeiB may be checked in order.a) If a first neighbouring block, denoted as Net, satisfies one condition or several conditions, the second neighbouring block may be checked followingly. Otherwise, the context may be derived based on the first neighbouring block. The condition(s) may be i. Nei is not available.ii. Nei is in a region inaccessible.iii. Nei is coded with a specific mode.a) Nei is coded with palete mode.b) Nei is coded with IBC mode,c) Nei is coded with transform skip mode,d) Nei is coded with inter mode.e) Nei is coded with intra mode.f) Nei is coded with BDPCM mode.iv. Nei is coded with coded bit flag (CBF) = 0.b) For example, NeiA may be checked before NeiB if the current SE represents the X- dimension coordinate of the last position of the non-zero coefficient, such as last sig coeff x prefix and last sig coeff x suffix.i. Alternatively, NeiB may be checked before NeiA if the current SE represents the X-dimension coordinate of the last position of the non-zero coefficient, such as last sig coeff xjprefix and last sig coeff x suffix.c) For example, NeiB may be checked before NeiA if the current SE represents the Y- dimension coordinate of the last position of the non-zero coefficient, such as last sig coeff ‘_y_prefix and last_sig_coeff_y_suffix.i. Alternatively, NeiA may be checked before NeiB if the current SE represents the Y-dimension coordinate of the last position of the non-zero coefficient, such as last sig coeff y prefix and last sig coeff y suffix.iii. For example, NeiA is a top neighbouring block and neiB is a neighbouring block.1) A position in NeiA may be above the current block, such as in AO, Al, A2, A3, A4, A5 as shown in Fig. 25.2) A position in NeiB may be left to the current block, such as in AO, Bl, B2, B3, B4, B5 as shown in Fig, 25.d) In one example, the neighbouring block may be color component dependent.It is proposed that at least one binarized bin of a SE may be coded with a context determined by the bin index.a) For example, at least one bin, such as the first bin may be coded with a context.b) For example, each bin may be coded with a context.c) For example, two bins may be coded with two different contexts.d) For example, two bins may share the same context.It is proposed that at least one binarized bin of a residual coding SE may be coded with a context determined by the coding mode.Whether to and / or how to apply a proposed context derivation method may depend on coding information. a) E.g., a proposed context derivation method may only be applied to one or several specific color components such as luma and chroma.b) E.g., a proposed context derivation method may be applied only if a specific coding mode is used or not used.i. For example, it may be applied only if ISP is or is not used.ii. For example, it may be applied only if BDPCM is or is not used,iii. For example, it may be applied only if IBC is or is not used.iv. For example, it may be applied only if GPM is or is not used.v. For example, it may be applied only if SGPM is or is not used.vi. For example, it may be applied only if CCLM or CCCM is or is not used.vii. For example, it may be applied only if Affine is or is not used.c) E.g., a proposed context derivation method may be applied only if the width and / or height of the current block satisfies one or some conditions.It is proposed that the binarization and / or interpretation of a residual SE may be determined by at least one neighbouring block.a) The SE may indicate the position of the last significant coefficient, such as last sig coeff x prefix, last sig coeff x suffix, last_sig_coeff_y_prefix, kist sig cocn’ y sulfix in VVC.b) In one example, f(Nei) may be derived for a neighbouring block, denoted as Nei, where f is a function.i. For example, f(Nei, Q) may be derived for the Q-coordinate of the last position of the non zero coefficient, wherein Q = X or Y. In the following discussion, f(Nei) may refer to f(Nei, X) or f(Nei, Y).ii. f(Nei) may depend on1) The availability’ of Nei.2) The coding mode of Nei.3) The CBF of Nei.4) The width and / or height of Nei.5) The number of non-zero coefficients of Nei.6) The last position of non-zero coefficient in Nei,7) The sum of absolute values of non-zero coefficients of Nei.iii. For example, f(Nei) = F0 when at least one condition (or several of them) below is (are) satisfied.1) Nei is not available.2) Nei is in a region inaccessible.3) Nei is coded with a specific mode.a) Nei is coded with palette mode.b) Nei is coded with IBC mode.c) Nei is coded with transform skip mode.d) Nei is coded with inter mode.e) Nei is coded with intra ode,f) Nei is coded with BDPCM mode.4) Nei is not coded with a specific mode determined by the coding mode of the current block.a) For example, the current block is intra-coded but Nei is not intra-coded. b) For example, the current block is not intra-coded but Nei is intra-coded.5) Nei is coded with coded bit flag (CBF) = 0.6) The width and / or height of Nei is larger than or smaller than a threshold.7) The width of Nei is not equal to the current block,a) In the case of Q=X,8) The height of Nei is not equal to the current block.a) In the case of Q=Y.9) The size of Nei is larger than or smaller than a threshold.iv. For example, f(Nei) F0 if the last position of Nei satisfies one condition (or several of them).1) For example, the condition is N lastQ >= T1 and N lastQ < T2, wherein Q is X or Y, (NJastX, N lastY) stands for the position of the last significant coefficient of the neighouring block Nei.2) For example, the condition is N lastQ > T1 and N lastQ <= T2, wherein Q is X or Y, (NJastX, N lastY) stands for the position of the last significant coefficient of the neighouring block Nei.3) For example, the condition is N lastQ >= Tl, wherein Q is X or Y, (NJastX, N lastY) stands for the position of the last significant coefficient of the neighouring block Nei. 4) For example, the condition is N lastQ > T 1, wherein Q is X or Y, (NJastX, N JastY) stands for the position of the last significant coefficient of the neighouring block Nei.5) For example, the condition is N lastQ <= T2, wherein Q is X or Y, (NJastX, N lastY) stands for the position of the last significant coefficient of the neighouring block Nei. 6) For example, the condition is N lastQ < T2, wherein Q is X or Y, (NJastX, NJastY) stands for the position of the last significant coefficient of the neighouring block Nei.7) For example, Q is X if the current SE represents the X-dimension coordinate of the last position of the non-zero coefficient, such as last_sig_coeff_x_prefix and last_sig_co- eff x suffix.8) For example, Q is Y if the current SE represents the Y -dimension coordinate of the last position of the non-zero coefficient, such as last sig coeff y prefix and last sig co- eff y suffix.9) The threshold T 1 and T2 may depend on the width (Wn) and / or height (Hn) of Nei. a) For example, T 1 and T2 may depend on width if Q = X,b) For example, T1 and T2 may depend on height if Q Y.c) For example, T1 or T2 = (W +off)»shift. E.g. off =1, shift = 1, or off = 2, shift = 2. d) For example, T1 or T2 = (Hn+off)»shift. E.g. off =1, shift = 1, or off = 2, shift = 2. e) For example, T1 or T2 = max(M, (Wn+off)»shift). E.g. M = 1.f) For example, T1 or T2 = max(M, (Hn+off)»shift). E.g. M =1.g) For example, T1 or T2 =Wn -( (Wn+off)»shift). E.g. off =0, shift = 3, or off = 0, shift = 2.h) For example, T1 or T2 = Hn - ((Hn+off)»shift). E.g. off =0, shift ~ 3, or off ~ 0, shift - 2.i) For example, T1 or T2 = Wn -max(M, (Wn+ofl)»shift). E.g. MW 1. j) For example, T1 or T2 Hn - (max(M, (Hn+off)»shift)). E.g. M W. k) For example, T1 or T2 = K*((Wn+off)»shift). E.g. off =0, shift = 3, or off = 0, shift = 2.l) For example, T1 or T2 =K*( (Hn+off)»shift). E.g. off =0, shift = 3, or off = 0, shift = 3.m) For example, n) For example,v. For example, f(Nei) = F0 if1 ) N lastQ < Wn - (Wn»3) for Q = X,2) N lastQ < Hn - (Hn»3) for Q = Y.vi. For example, f(Nei)= Fl if f(Nei) is not equal F0.vii. For example, F0 = 0, Fl = 1.c) In one example, at least two neighbouring blocks, denoted as NeiA and NeiB, may be used in the binarization and / or interpretation.i. For example, NeiA and NeiB may be checked in order.1) If a first neighbouring block, denoted as Nei, satisfies one condition or several conditions, the second neighbouring block may be checked followingly. Otherwise, the context may be derived based on the first neighbouring block. The condition(s) may bea) Nei is not available.b) Nei is in a region inaccessible.c) Nei is coded with a specific mode.i. Nei is coded with palette mode.ii. Nei is coded with IBC mode.iii. Nei is coded with transform skip mode.iv. Nei is coded with inter ode.v. Nei is coded with intra mode.vi. Nei is coded with BDPCM mode.d) Nei is coded with coded bit flag (CBF) = 0.e) Nei is not coded with a specific mode determined by the coding mode of the current block.i. For example, the current block is intra-coded but Nei is not intra-coded.ii. For example, the current block is not intra-coded but Nei is intra-coded.2) For example, NeiA may be checked before NeiB if the current SE represents the X-dimen- sion coordinate of the last position of the non-zero coefficient, such as last_sig_coeff_x_pre- fix and last sig coeff x suffix.a) Alternatively, NeiB may be checked before NeiA if the current SE represents the X- dimension coordinate of the last position of the non-zero coefficient, such as last sig coeff x prefix and last sig coeff x suffix.3) For example, NeiB may be checked before NeiA if the current SE represents the Y-dimen- sion coordinate of the last position of the non-zero coefficient, such as last_sig_coeff_y prefix and last_sig_coeff_y_suffix.a) Alternatively, NeiA may be checked before NeiB if the current SE represents the Y- dimension coordinate of the last position of the non-zero coefficient, such as last_sig_coeff_y_prefix and last_sig_coeff_y suffix.ii. Alternatively, one of NeiA and NeiB may be selected.1) For example, NeiA may be selected if the current SE represents the X-dimension coordinate of the last position of the non-zero coefficient, such as last_sig_coeff_x_prefix and last sig coeff x suffix.a) Alternatively, NeiB may be selected if the current SE represents the X-dimension coordinate of the last position of the non-zero coefficient, such as last sig coeff x prefix and last sig coeff x suffix.2) For example, NeiB may be selected if the current SE represents the Y -dimension coordinate of the last position of the non-zero coefficient, such as last_sig_coeff_y_prefix and last_sig_coeff_y_suffix.a) Alternatively, NeiA may be selected if the current SE represents the Y-dimension coordinate of the last position of the non-zero coefficient, such as last_sig_coeff_y_prefix and last sig coeff y suffix.iii. For example, NeiA is a top neighbouring block and neiB is a neighbouring block.1) A position in NeiA may be above the current block, such as in AO, Al, A2, A3, A4, A5 as shown in Fig.1.2) A position in NeiB may be above the current block, such as in AO, Bl, A2, A3, A4, A5 as shown in Fig.1.d) The SE may be interpreted in different ways depending on f(Nei).i. For example, the decoded position of the last non zero coefficient (denoted as (last_pos_x’, last pos y’) may be interpreted as (last pos x, last pos y) in different ways depending on f(Nei).1) For example, last pos x = last pos x’ if f(Nei, X) = F0. E.g. F0 = 0.2) For example, last pos y = last pos v’ if f(Nei, Y) = F0. E.g. F0 = 0.3) For example, last pos x = Mflast pos x’ if f(Nei, X) = Fl. E.g. Fl = 1.4) For example, last_pos_y = M[last_pos_y’] if f(Nei, Y) = Fl. E.g. Fl = 1.5) In the disclosure above, the mapping table M[k’] may map a decoded value to a interpreted value which may be used in the following procedure.a) The mapping table may depend on the neighbouring residual block Nei, such as the position of the last non zero coefficient of Nei, denoted as (Lx, Ly).b) For example, for last pos q, M may be constructed as M[0] = Lq, M
[0001] = Lq -1. M[2] = Lq+1, M[3] = Lq-2, M[4]=Lq+2,.... wherein q = x or y. Suppose Size q is equal to the width of current block if q == x and height of the current block if q == y, the construction procedure may be:i. Step #1: M[0] = Lq.ii. Step #2 A variable Abs is set equal to 1, and a variable Idx is set equal to 1. iii. Step #3: If Lq-abs >= 0, M[Idx++J = Lq-abs;iv. Step #4: If Lq+abs < Size__q, M[Idx++] = Lq+abs;v. Step #5: Abs++;i. Step #6: If Idx >= Size__q, terminate the procedure. Otherwise, go to Step #3. e) In one example, the neighbouring block may be color component dependent.I) In one example, whether to and / or how to apply the proposed method may depend on color format / color component.i. For example, the proposed method may be applied to a first component, such as Y, but not be applied to a second component such as Cb and Cr.11. It is proposed that a residual SE denoted as S may coded in a predictive way.a) For example, S-S' may be coded, wherein S’ is a residual SE in a previously residual block.i. For example, S-f(S’) may be coded, wherein S’ is a residual SE in a previously residual block, and f is a function. For example, f(S ’)= a*S’+b.b) For example, a set of residual SEs may be copied from a set of residual SEs in a previously residual block.j. For example, an index may be coded to indicate the set of residual SEs in a previously residual block.ii. Alternatively, a set of residual SEs may be predicted by a set of residual SEs in a previously residual block.1) Difference between the set of residual SEs and the prediction may be signalled.iii. It may be signalled to indicate whether the copy or prediction is applied.General aspects12. Additional operations may be applied to or with the proposed method.a) A syntax element disclosed above may be binarized as a flag, a fixed length code, an EG(x) code, a unary code, a truncated unary code, a truncated binary code, etc. It can be signed or unsigned.b) A syntax element representing a coding tool or a coding method may not be signalled and implicitly determined to be unused, if the coding tool or the coding method is regarded as not applicable or cannot be used.c) A syntax element disclosed above may be coded with at least one context model. Or it may be bypass coded.d) A syntax element disclosed above may be signaled in a conditional way.a. The SE is signaled only if the corresponding function is applicable.b. The SE is signaled only if the dimensions (width and / or height) of the block satisfy a condition. e) A syntax element disclosed above may be signaled at block level / sequence level / group of pictures level / picture level / slice level / tile group level, such as in coding structures of CTU / CU / TU / PU / CTB / CB / TB / PB, or sequence header / picture header / SPS / VPS / DPS / DCT / PPS / APS / slice header / tile group header.I) Whether to and / or how to apply the disclosed methods above may be signalled at block level / sequence level / group of pictures level / picture level / slice level / tile group level, such as in coding structures of CTU / CU / TU / PU / CTB / CB / TB / PB, or sequence header / picture header / SPS / VPS / DPS / DCI / PPS / APS / slice header / tile group header.g) Whether to and / or how to apply the disclosed methods above may be dependent on coded information, such as block size, colour format, single / dual tree partitioning, colour component, slice / picture type. h) The proposed methods disclosed in this document may be used in other coding tools which require chroma fusion.
[0168] Fig. 26 illustrates a flowchart of a method 2600 for video processing in accordance with embodiments of the present disclosure. The method 2600 is implemented during a conversion between a video unit of a video and a bitstream of the video,
[0169] At block 2610, for a conversion between a block of a video and a bitstream of the video, it is determined that at least one binarized bin of a syntax element (SE) for residual coding associated with the block is coded wdth a context. The context is determined based on at least one of: coding information, a plurality of factors, a position of the SE in a residual block, a size of the residual block, at least one corresponding block of a second component, at least one neighbouring block, or a bin index.
[0170] At block 2620, the conversion is performed based on the at least one binarized bin of the SE. In some embodiments, the conversion may include encoding the block into the bitstream. Alternatively, the conversion may include decoding the block from the bitstream.[0171 Jin some embodiments, the coding information comprises at least one of: a coding mode, a quantization parameter (QP), an inter -prediction direction, a Merge inter-mode, an advanced motion vector prediction (AMVP)-inter mode, an Intra-prediction mode, a cross-component prediction (CCP) mode, a non-CCP mode, a residual block width, a residual block height, a transform types, whether a combination of intra and inter predication (CUP) mode is applied, whether a geometric partitioning mode (GPM) mode is applied, whether a spatial geometric partitioning mode ( SGPM) mode is applied, whether a matrix weighted intra prediction (MIP) mode is applied, whether an extrapolation filter-based intraprediction (EIP) is applied, whether an affine mode is applied, at least one previously encoded / decoded residual SE inside the residual block, at least one previously encoded / decoded residual SE of at least one neighbouring block, at least one previously encoded / decoded residual SE of a different component, at least one SE which is not a residual SE, a color component, a color format.
[0172] In some embodiments, all color components share a same context or a same context set. Alternatively, components Cb and Cr share the same context and the same context set. In some other example embodiments, component Y and component Cb or Cr apply two sets of contexts.
[0173] In some embodiments, the context is determined by a plurality of factors. In some embodiments, an index of the context is derived as: C = ContextTable[idx_l]...[idx_n], and where C represents the index of the context, idx 1... idx n represent N indices determined by N factors individually, to retrieve the context.
[0174] In some embodiments, the context is determined based on the position of the SE in the residual block. In some embodiments, the SE is sb __coded__flag[ xS ][ yS ], where (xS, yS) represents a subblock coordination of a subblock corresponding to the SE.
[0175] In some embodiments, a first context or a first context set is applied if (xS, xY) satisfies a condition or a set of conditions. In some embodiments, a second context or a second context set is applied if (xS, xY) does not satisfy the condition or the set of conditions. In some embodiments, the condition or the set of conditions comprises at least one of xS > Tx || yS > Ty, xS > Tx && yS > Ty, xS < Tx || yS < Ty, xS < Tx && y S < Ty, xS * y S > T, or xS * yS < T, and where Tx represents a first threshold, Ty represents a second threshold, and T represents a third threshold. In some embodiments, Tx, Ty and T depend on at least one of width or height of the residual block.
[0176] In some embodiments, Tx = (wS+off)»shift, where wS represents a width of the residual block in the number of subblocks, and where w S = W / w’, where W represents the width of the residual block and w’ represents a width of a subblock. In some embodiments, Ty = (hS+off)»shift, where hS represents a height of the residual block in the number of subblocks, and where hS = H / h’, where H represents a height of the residual block and w’ represents a height of a subblock. In some embodiments, off =1, shift = 1, or off = 2, shift = 2.
[0177] In some embodiments, Tx = max(M, (wS+off)»shift). Alternatively, or in addition, Ty = max(M, (hS+off)»shift). In this case, wS represents a width of the residual block in the number of subblocks, hS represents a height of the residual block in the number of subblocks, off represents an offset, and shift is a number. In some embodiments, M = 1. In some embodiments, Tx, Ty and T depend on color format and color components.
[0178] In some embodiments, a context set comprises a plurality of contexts and one of the plurality of contexts is selected based on a previously decoded sb coded flag. In some embodiments, a first context is selected if sb_coded_flag[ xS - 1][ yS J == 1 |i sb_coded_Ilag[ xS][ yS - 1] == 1, otherwise, a second context is selected. In some embodiments, the context is determined based on at least one of width orheight of the residual block. In some embodiments, the SE is coeff sign flag.
[0179] In some embodiments, a first context or a first context set is applied if at least one of the width or the height of the residual block satisfies a condition or a set of conditions, and a second context or a second context set is applied if the if at least one of the width or the height of the residual block does not satisfy the condition or the set of conditions. In some embodiments, the condition or the set of conditions comprises at least one of: W > n*H, W < n*H, H > n*W, H < n*W, W > Tx |i H > Ty, W > Tx && H > Ty, W < Tx || H < Ty, W < Tx && H < Ty, W * H > T, or W * H < T. In this case, W represents the width of the residual block, H represents the height of the residual block, Tx, Ty and T represents thresholds, and n is an integer.
[0180] In some embodiments, Tx, Ty and T are integers. Alternatively, Tx, Ty and T depend on color format and color components. In some embodiments, Tx=Ty=8 and T = 64.[0181 Jin some embodiments, the SE of a first component is coded with the context, and the context is determined based on at least one corresponding block of a second component. In some embodiments, the first component is Cb and / or Cr, and the second component is Y. In some embodiments, a corresponding block of the second component is derived from a current block of the first component based on a color format.
[0182] In some embodiments, the corresponding block covers at least one position (X', Y') of the second component which is corresponding to a position (X, Y) of the first component. In some embodiments, the at least one position (X’, Y’) of the second component is derived from the position (X, Y) of the first component, and wherein the derivation of the at least one position (X’, Y’) of the second component depends on color format. In some embodiments, X’ n*X and Y’^m*Y.
[0183] In some embodiments, the color format is color format YUV 4:2:0, n = m = 2. Alternatively, the color format is color format YUV 4:2:2, n = 2, m =1, or n = 1, m = 2. In some other examples, the color format is color format YUV 4:4:4, n = m =1.
[0184] In some embodiments, a top-left position of a current residual block is (X0, Y0), a width and height of the current residual block are W and H, respectively. For example, the position (X, Y) is set equal to one of: (X0, Y), (X0 + W -1, Y0), (X0, Y0+H-1), (X0+W-1, Y0+H-1), or (XO+W / 2 + offX, Y0+H / 2+offY), and wherein offX and offY represent offsets, respectivelyy.
[0185] In some embodiments, offX is -1 or 0 or 1. Alternatively, offY is -1 or 0 or 1.
[0186] In some embodiments, the context is determined based on the corresponding block of the second component. In this case, the corresponding block of the second component is denoted as CorrB. In some embodiments, the context is determined based on at least one of: an availability of CorrB, a coding mode of CorrB, a coded bit flag (CBF) of CorrB, a width of CorrB, a height of CorrB, the number of non -zero coefficients of CorrB, a last position of non-zero coefficient in CorrB, or a sum of absolute values of non-zero coefficients of CorrB.
[0187] In some embodiments, a first context or a first context set is applied if the corresponding residual block satisfies one or more conditions. In some embodiments, a second context or a second context set is applied if the corresponding residual block does not satisfy the one or more conditions.
[0188] In some embodiments, if the corresponding residual block is coded with a coding mode, the first context or a first context set is applied. In some embodiments, the coding mode is one of: a palette coding, a transform skip, or block-based delta pulse code modulation (BDPCM).
[0189] In some embodiments, if the corresponding residual block is coded with all coefficients equal to zero, the first context or a first context set is applied. In some embodiments, if a position of the last nonzero coefficient of the corresponding residual block satisfies a condition, the first context or the first context set is applied. In this case, the position of the last non-zero coefficient of the corresponding residual block is represented as (lastX, lastY). In some embodiments, if a position of the last non-zero coefficient of the corresponding residual block does not satisfy the condition, the second context or the second context set is applied.
[0190] In some embodiments, the condition comprises at least one of: lastX > Tx || lastY > Ty, lastX > Tx && lastY > Ty, lastX < Tx |i lastY < Ty, or lastX < Tx && lastY < Ty. In this case, Tx and Ty may represent thresholds, respectivelyy.
[0191] In some embodiments, Tx depends on at least one of width or height of the corresponding residual block. Alternatively, or in addition, Ty depends on at least one of width or height of the corresponding residual block.
[0192] In some embodiments, Tx = (Wc+off)»shift. Alternatively, Ty = (Hc+off)»shift. In this case, Wc represents the width of the corresponding residual block, He represents the height of the corresponding residual block, offset is an integer and shift is an integer. In some embodiments, off =1, shift = 1, or off = 2, shift = 2.
[0193] In some embodiments, Tx ~ max(M, (Wc+off)»shift). Alternatively, Ty = max(M, (Hc+off)»shift). In this case, Wc represents the width of the corresponding residual block, He represents the height of the corresponding residual block, M is an integer, off represents an offset and shift is an integer. In some embodiments, M =1.
[0194] In some embodiments, the context is determined based on the at least one neighbouring block, the Si. indicates a position of a last significant coefficient. In some embodiments, the SE is one of: last sig coeff x prefix, last sig coeff x suffix, last sig coeff y prefix, or last sig coeff y suffix.
[0195] In some embodiments, a first parameter f(Nei) is derived for a neighbouring block. In this case, Nei represents the neighbouring block and f represents a function.
[0196] In some embodiments, f(Nei, Q) is derived for the Q-coordinate of the last position of the non zero coefficient. For example, Q = X or Y, f(Nei) refers to f(Nei, X) or f(Nei, Y).
[0197] In some embodiments, the first parameters depends on at least one of: an availability of theneighbouring block, a coding mode of the neighbouring block, a CBF of the neighbouring block, a width of the neighbouring block, a height of the neighbouring block, the number of non -zero coefficients of the neighbouring block, the last position of non-zero coefficient in neighbouring block, or a sum of absolute values of non-zero coefficients of neighbouring block. In some embodiments, f(Nei) FO, if at least one condition of is satisfied: the neighbouring block is not available, the neighbouring block is in a region inaccessible, the neighbouring block is coded with a first mode, the neighbouring block is not coded with a second mode determined by a coding mode of the current block, the neighbouring block is coded with coded bit flag being equal to 0, a width of the neighbouring block is larger than a fourth threshold, the width of the neighbouring block is smaller than a fifth threshold, a height of the neighbouring block is larger than a sixth threshold, the height of the neighbouring block is smaller than a seventh threshold, a size of the neighbouring block is larger than an eighth threshold, or the size of the neighbouring block is smaller than a ninth threshold.
[0198] In some embodiments, the first mode is at least one of: a palette mode, an intra block copy (IBC) mode, a transform skip mode, an inter mode, an intra mode, or a BDPCM mode. In some embodiments, the block is intra-coded but the neighbouring block is not intra-coded, and / or wherein the block is not intra-coded but the neighbouring block is intra-coded.
[0199] In some embodiments, f(Nei) = Fl if the last position of the neighbouring block satisfies one or more conditions. In some embodiments, the one or more conditions comprise at least one of: N lastQ >= Tl and NJastQ < T2, NJastQ > Tl and NJastQ <= T2, NJastQ >= TI, NJastQ > Tl, NJastQ <= T2, or is NJastQ < T2, and w'here Q is X or Y, (N lastX, N lastY) represents the position of the last significant coefficient of the neighouring block, and Tl and T2 represent thresholds, respectivelyy.
[0200] In some embodiments, Q is X if the SE represents an X -dimension coordinate of the last position of the non-zero coefficient. In some embodiments, the SE is one of Iast_sig_coeff_x_prefix or last sig coeff x suffix. In some embodiments, Q is Y if the SE represents a Y-dimension coordinate of the last position of the non-zero coefficient. In some embodiments, the SE is one of last sig coeff y prefix or last sig coeff y suffix.
[0201] In some embodiments, Tl and T2 depend on at least one of width or height of the neighbouring block. In some embodiments, Tl and T2 depend on the width of the neighbouring block if Q = X, or wherein Tl and T2 depend on the height if of the neighbouring block if Q = Y, or wherein Tl or T2 = (Wn+off)»shift, or wherein Tl or T2 = (Hn+off)»shift, or wherein Tl or T2 = max(M, (Wn+off)»shift), or wherein Tl or T2 = max(M, (Hn+off)»shift), and wherein Wn represents the width of the neighbouring block, Hn represents the height of the neighbouring block, off represents an offset, and shift is an integer. In some embodiments, off =1, shift = 1, or wherein off = 2, shift = 2, or M = 1.[0202 Jin some embodiments, f(Nei) = Fl, if N lastQ >= max(l, Wn»2) && N lastQ < max(2, Wn»l) for Q = X, or N__lastQ >= max(l, Hn»2) && N__lastQ < max(2, Hn»l ) for Q = Y, In this case, (N lastQ, N lastQ) represents the position of the last significant coefficient of the neighouring block, Wn represents the width of the neighbouring block, and Hn represents the height of the neighbouring block.
[0203] In some embodiments, f(Nei)= F2, if f(Nei) is not equal to either F0 or Fl. In some embodiments, F0 = 0, Fl = I and Fl = 2.
[0204] In some embodiments, at least two neighbouring blocks are used to derive the context. Alternatively, one neighbouring block is used to derive the context.
[0205] In some embodiments, an index of the context is derived as: Of(NeiA) + f(NeiB), or C=f(NeiA) | f(NeiB), or C^f(NeiA) & f(NeiB). In this caes, C represents the index of the context, Nei represents one of the at least two neighbouring blocks, NeiB represents another one of the at least two neighbouring blocks, f represents a function. In some embodiments, an index of the context if derived as: C=f(NeiA), or C=f(NeiB). In this case, C represents the index of the context, Nei represents one of the at least two neighbouring blocks, NeiB represents another one of the at least two neighbouring blocks, f represents a function.
[0206] In some embodiments, the at least two neighbouring blocks are checked in order. In some embodiments, if a first neighbouring block satisfies one or more conditions, the second neighbouring block is checked followingly. Alternatively, if the first neighbouring block does not satisfy one or more conditions, the context may be derived based on the first neighbouring block.
[0207] In some embodiments, the one or more conditions comprise at least one of: the neighbouring block is not available, the neighbouring block is in a region inaccessible, the neighbouring block is coded with a mode, or the neighbouring block is coded with coded bit flag being equal to 0. In some embodiments, the mode comprises at least one of: a palette mode, an IBC mode, a transform skip mode, an inter mode, an intra mode, or a BDPCM mode.
[0208] In some embodiments, a first neighbouring block of the at least two neighbouring blocks is checked before a second neighbouring block of the at least two neighbouring blocks, if the SE represents an X-diniension coordinate of the last position of the non -zero coefficient. Alternatively, a second neighbouring block of the at least two neighbouring blocks is checked before the first neighbouring block of the at least two neighbouring blocks, if the SE represents the X-dimension coordinate of the last position of the non-zero coefficient. In some embodiments, the SE is last_sig_coeff_x__prefix or 1 as t_s i g„co eff x suffix,
[0209] In some embodiments, a second neighbouring block of the at least two neighbouring blocks is checked before a first neighbouring block of the at least two neighbouring blocks, if the SE represents a Y-dimension coordinate of the last position of the non-zero coefficient. Alternatively, the first neighbouring block of the at least two neighbouring blocks is checked before the second neighbouring block of the at least two neighbouring blocks, if the SE represents the Y-dimension coordinate of the last position of the non-zero coefficient. In some embodiments, the SE is last_sig_coeff_y _prefix or 1 as t_sig_co eff_y_suffix.
[0210] In some embodiments, a first neighbouring block of the at least two neighbouring blocks is a top neighbouring block, and a second neighbouring block of the at least two neighbouring blocks is aneighbouring block. In some embodiments, a position in the first neighbouring block is above the block. For example, as shown in FIG. 25, a position in NeiA may be above the current block, such as in AO, Al, A2, A3, A4, A5. Alternatively, or in addition, a position in the second neighbouring block is left to the block. For exampel, as shown in FIG. 25, a position in NeiB may be above the current block, such as in AO, Bl, B2, B3, B4, B5. In some embodiments, the neighbouring block is color component dependent.
[0211] In some embodiments, the context is determined based on at least one bin, and the at least one bin is coded with the context. In some embodiments, the at least one bin is a first bin. In some other embodiments, each bin is coded with the context.
[0212] In some embodiments, two bins are coded with two different contexts. In some other embodiments, two bins share a same context. In some embodiments, the at least one binarized bin of the SE for residual coding is coded with the context that is determined by the coding mode.
[0213] In some embodiments, whether to and / or how to apply a derivation of the context depends on the coding information. In some embodiments, the derivation of the context is applied to one or more color components.
[0214] In some embodiments, the derivation of the context is applied if a target coding mode is used. Alternatively, the derivation of the context is applied if the target coding mode is not used. In some embodiments, the target coding mode comprises one of: an intra sub-partition (ISP) mode, a block-based delta pulse code modulation (BDPCM), an intra block copy (IBC) mode, a geometric partitioning mode (GPM), a spatial geometric partitioning mode (SGPM), a cross -component linear model (CCLM), a convolutional cross-component model (CCCM), or an affine mode. In some embodiments, the derivation of the context is applied if at least one of a width or height of the block satisfies one or more conditions.
[0215] In some embodiments, a binarization and / or interpretation of the SE for residual coding is determined based on the at least one neighbouring block. In some embodiments, the SE indicates a position of a last significant coefficient. In some embodiments, the SE is one of: last_sig_coeff_x_prefix, last sig coeff x suffix, 1 ast_sig_coe ff_y_pre fi x, last_sig_coeff_y_s uffix.
[0216] In some embodiments, a parameter is derived for the at least one neighbouring block. In some embodiments, f(Nei, Q) is derived for the Q-coordinate of the last position of the non -zero coefficient. In this case, Q = X or Y, f represents a function, Nei represents the at least one neighbouring block, and f(Nei) refers to f(Nei, X) or f(Nei, Y). In some embodiments, the parameter depends on at least one of: an availability of the at least one neighbouring block, a coding mode of the at least one neighbouring block, a CBF of the at least one neighbouring block, a width and / or height of the at leas t one neighbouring block, the number of non-zero coefficients of the at least one neighbouring block, the last position of non-zero coefficient in the at least one neighbouring block, or a sum of absolute values of non-zero coefficients of the at least one neighbouring block.
[0217] In some embodiments, f(Nei) - F0, if at least one of the following conditions is satisfied: the at least one neighbouring block is not available, the at least one neighbouring block is in a regioninaccessible, the at least one neighbouring block is coded with a third mode, the at least one neighbouring block is not coded with a fourth mode determined by the coding mode of the block, the at least one neighbouring block is coded with coded bit flag being equal to 0, a width of the at least one neighbouring block, a width of the at least one neighbouring block is larger than a tenth threshold, the width of the at least one neighbouring block is smaller than an eleventh threshold, a height of the at least one neighbouring block is larger than a twelfth threshold, the height of the at least one neighbouring block is smaller than a thirteenth threshold, the width of the at least one neighbouring block is not equal to the block, the height of the at least one neighbouring block is not equal to the block, or a size of the at least one neighbouring block is larger than a fourteenth threshold, or the size of the at least one neighbouring block is smaller than a fifteenth threshold. In this case, f represents a function, and Nei represents the at least one neighbouring block.
[0218] In some embodiments, the third mode comprises at least one of: a palette mode, an IBC mode, a transform skip mode, an inter mode, an intra mode, or a BDPCM mode. Alternatively, or in addition, the block is intra-coded but the at least one neighbouring block is not intra-coded, or wherein the block is not intra-coded but the at least one neighbouring block is intra-coded. Alterntaively, or in addition, if Q=X, the width of the at least one neighbouring block is not equal to the block, and / or wherein if Q=Y, the height of the at least one neighbouring block is not equal to the block.
[0219] In some embodiments, f(Nei) = F0, if the last position of the at least one neighbouring block satisfies one or more conditions. In some embodiments, the one or more conditions comprise at least one of: N lastQ >= Tl and N lastQ < T2, N lastQ > Tl and N lastQT2, N__IastQ >= T I, N_lastQ > T I, N lastQ T2, or is N_lastQ < T2. In this case, Q is X or Y, (N_IastX, N_lastY) represents the position of the last significant coefficient of the at least one neighouring block, and Tl and T2 represent thresholds, respectivelyy.
[0220] In some embodiments, Q is X if the SE represents an X -dimension coordinate of the last position of the non-zero coefficient. In some embodiments, the SE is one of last _sig_coeff_x_prefix or last sig coeff x suffix.
[0221] In some embodiments, Q is Y if the SE represents a Y-dimension coordinate of the last position of the non-zero coefficient. In some embodiments, the SE is one of last sig coeff y. prefix or last_sig_coeff_y suffix.
[0222] In some embodiments, Tl and T2 depend on at least one of width or height of the at least one neighbouring block. In some embodiments, Tl and T2 depend on the width of the at least one neighbouring block if Q = X. Alternatively, Tl and T2 depend on the height if of the at least one neighbouring block if Q = Y. Alternatively, Tl or T2 = (Wn+off)»shift. Alternatively, Tl or T2 = (Hn+off)»shift. Alternatively, Tl or T2 = max(M, (Wn+off)»shift), Alternatively, Tl or T2 = max(M, (Hn+off)»shift). Alternatively, Tl or T2 =Wn -( (Wn+off)»shift). Alternatively, Tl or T2 = Hn -((Hn+off)»shift). Alternatively, Tl or T2 = Wn -max(M, (Wn+off)»shift), wherein Tl or T2 = Hn -(max(M, (Hn+off)»shift)). Alternatively, Tl or T2 ~ K*((Wn+off)»shift). Alternatively, Tl or T2=K*( (Hn+off)»shift). Alternatively, T1 or T2 = max(M, K*((Wn+off)»shift)). Alternatively, T1 or T2 = max(M, K*((Hn+off)»shift)). In this case, Wn represents the width of the at least one neighbouring block, Hn represents the height of the at least one neighbouring block, off represents an offset, and shift is an integer.
[0223] In some embodiments, off -1, shift - 1. Alternatively, off - 2, shift - 2. Alternatively, off -0, shift = 3. Alternatively, off = 0, shift - 2. Alternatively, M = 1. Alternatively, K is an integer.
[0224] In some embodiments, f(Nei) = Fl, if N lastQ < Wn - (Wn»3) for Q = X or N_lastQ < Hn -(Hn»3) for Q = Y, In this case, (N lastQ, N lastQ) represents the position of the last significant coefficient of the at least one neighouring block, Wn represents the width of the at least one neighbouring block, and Hn represents the height of the at least one neighbouring block.
[0225] In some embodiments, f(Nei)= Fl, if f(Nei) is not equal to F0. In some embodiments, F0 = 0, and Fl = 1.
[0226] In some embodiments, at least two neighbouring blocks are used in at least one binarization or interpretation. Alternatively, one neighbouring block is used in at least one binarization or interpretation.
[0227] In some embodiments, the at least two neighbouring blocks are checked in order. In some embodiments, if a first neighbouring block satisfies one or more conditions, the second neighbouring block is checked followingly. Alternatively, if the first neighbouring block does not satisfy one or more conditions, the context may be derived based on the first neighbouring block. In some embodiments, the one or more conditions comprise at least one of: the neighbouring block is not available, the neighbouring block is in a region inaccessible, the neighbouring block is coded with a mode, the neighbouring block is coded with coded bit flag being equal to 0, or the neighbouring block is not coded with another mode determined based on a coding mode of the block. In some embodiments, the mode comprises at least one of: a palette mode, an IBC mode, a transform skip mode, an inter mode, an intra mode, or a BDPCM mode, or wherein the block is intra-coded but the neighbouring block in not intra -coded, or wherein the block is not intra-coded but the neighbouring block is intra-coded.
[0228] In some embodiments, a first neighbouring block of the at least two neighbouring blocks is checked before a second neighbouring block of the at least two neighbouring blocks, if the SE represents an X-dimension coordinate of the last position of the non-zero coefficient. Alternatively, a second neighbouring block of the at least two neighbouring blocks is checked before the first neighbouring block of the at least two neighbouring blocks, if the SE represents the X-dimension coordinate of the last position of the non-zero coefficient. In some embodiments, the SE is last __sig__coeff_x_prefix or 1 as t_sig_co eff x suffix.
[0229] In some embodiments, a second neighbouring block of the at least two neighbouring blocks is checked before a first neighbouring block of the at least two neighbouring blocks, if the SE represents a Y-dimension coordinate of the last position of the non-zero coefficient. Alternatively, the first neighbouring block of the at least two neighbouring blocks is checked before the second neighbouringblock of the at least two neighbouring blocks, if the SE represents the Y -dimension coordinate of the last position of the non-zero coefficient. In some embodiments, the SE is last sig coeff y prefix or last_sig_coeff_y suffix.
[0230] In some embodiments, a first neighbouring block of the at least two neighbouring blocks is selected, if the SE represents an X-dimension coordinate of the last position of the non-zero coefficient. Alternatively, a second neighbouring block of the at least two neighbouring blocks is selected, if the SE represents an X-dimension coordinate of the last position of the non-zero coefficient. In some embodiments, the SE is last_sig_coeff_x_prefix or last sig coeff x suffix.[0231 Jin some embodiments, a second neighbouring block of the at least two neighbouring blocks is selected, if the SE represents a Y-dimension coordinate of the last position of the non-zero coefficient. Alternatively, a first neighbouring block of the at least two neighbouring blocks is selected, if the SE represents a Y-dimension coordinate of the last position of the non-zero coefficient. In some embodiments, the SE is last_sig_coeff_y_prefix or last _sig_coeff_y suffix.
[0232] In some embodiments, a first neighbouring block of the at least two neighbouring blocks is a top neighbouring block. In some embodimetns, a second neighbouring block of the at least two neighbouring blocks is a neighbouring block.
[0233] In some embodiments, a position in the first neighbouring block is above the block. For example, as shown in FIG, 25, a position in NeiA may be above the current block, such as in AO, Al, A2, A3, A4, A5. Alternatively, or in addition, a position in the second neighbouring block is left to the block. For exampel, as shown in FIG. 25, a position in NeiB may be above the current block, such as in AO, Bl, B2, B3, B4, B5.[0234JI11 some embodiments, the SE is interpreted in different ways depending on f(Nei). In this case, Nei represents the neighbouring block, and f represents a function.
[0235] In some embodiments, a decoded position of a last non-zero coefficient (last_pos_x’, last pos y ’) is interpreted as ( last jpos_ _x, last_pos_y) in different ways depending on f(Nei). In this caes, (last_pos_x, last_pos_y) represents the last non-zero coefficient, and (last _pos_ _x’, last_pos_y’) represents the decoded position of the last non-zero coefficient.
[0236] In some embodiments, last_pos__x = Iasi po x'. if f(Nei, X) = F0. Alternatively, last _pos_ _y = last_pos_y’ if f(Nei, Y) = F0. Alternatively, last_pos_x = M[Iast_pos_x’] if f(Nei, X) = Fl. Alternatively, last pos y = M[last pos _y’] if f(Nei, Y) = FI. In some embodiments, F0 =0 and / or F1=I.
[0237] In some embodiments, a mapping table M[k‘] maps a decoded value to an interpreted value which is used in a following procedure. In some embodiments, the mapping table depends on a neighbouring residual block.
[0238] In some embodiments, for lastjos q, M is constructed as M[0] = Lq, M[l] = Lq -1, M[2] Lq-f l, M[3] = Lq-2, M[4]=LqI-2,...., where q = x or y. In some embodiments, suppose size q is equal to awidth of the block, if q == x and a height of the block if q == y, the construction procedure comprises: setting M[0] = Lq; setting a variable Abs equal to I and a variable Idx equal to 1; if Lq-abs >= 0, setting M[Idx H] = Lq-abs; if Lq+abs < Sizc q. setting M[Idx++] = Lq+abs; Abs-H-; and if Idx >= Size_q, terminating the procedure, otherwise, go to setting M[Idx++] = Lq-abs if Lq-abs >= 0.
[0239] In some embodiments, the neighbouring block is color component dependent. In some embodiments, whether to and / or how to apply the determination of the binarization and / or interpretation of the Si. for residual coding based on the at least one neighbouring block depend on color format / color component,
[0240] In some embodiments, the determination of the binarization and / or interpretation of the SE for residual coding based on the at least one neighbouring block is applied to a first component but not be applied to a second component.
[0241] In some embodiments, a residual SE is coded in a predictive way. In some embodiments, S-S' is coded, where S represents the residual SE, and S’ represents a residual SE in a previously residual block.
[0242] In some embodiments, S-f(S’) is coded, wdiere S represents the residual SE, S’ represents a residual SE in a previously residual block, and f represents a function. For example, f(S’)^ a*S’+b, where a and b are parameters.
[0243] In some embodiments, a set of residual SEs is copied from a set of residual SEs in a previously residual block. In some embodiments, an index is coded to indicate the set of residual SEs in a previously residual block. In some embodiments, a set of residual SEs is predicted by a set of residual SEs in a previously residual block.
[0244] In some embodiments, difference between the set of residual SEs and the prediction of the set of residual SEs is signalled. In some embodiments, whether a set of residual SEs is copied from or predicted by a set of residual SEs in a previously residual block is signaled.
[0245] In some embodiments, the SE is binarized as one of: a flag, a fixed length code, an exponential -Golomb (EG(x)) code, a unary code, a truncated unary code, or a truncated binary code. In some embodiments, the binarized SE is signed or unsigned.
[0246] In some embodiments, the SE representing a coding tool or a coding approach is determined to be unused without being signalled, if the coding tool or the coding approach is not applicable or not capable of being used. In some embodiments, the SE is coded with at least one context model. Alternatively, the SE is bypass coded.
[0247] In some embodiments, the SE is signaled. In some embodiments, the SE is signaled if a corresponding function is applicable. In some embodiments, the SE is signaled if a dimension of the block satisfies a condition.
[0248] In some embodiments, the SE is signaled at one of the followdngs: a block level, a sequence level, a group of pictures level, a picture level, a slice level, or a tile group level. In some embodiments, the SEis signaled in a coding structure of one of the followings: a coding tree unit (CTU), a coding unit (CU), a transform unit (TU), a prediction unit (PU), a coding tree block (CTB), a coding block (CB), a prediction block (PB), or a transform block (TB). In some embodiments, the SE is signaled in one of the followings: a sequence header, a picture header, a sequence parameter set (SPS), a video parameter set (VPS), a decoding parameter set (DPS), decoding capability information (DCI), a picture parameter set (PPS), an adaptation parameter set (APS), a slice header, or a tile group header,[0249 Jin some embodiments, whether to and / or how to determine the least one binarized bin of the SE is signaled at one of the following: a block level, a sequence level, a group of pictures level, a picture level, a slice level, or a tile group level. In some embodiments, whether to and / or how to determine the least one binarized bin of the SE is signaled in one of the following: a coding tree unit (CTU), a coding unit (CU), a transform unit (TU), a prediction unit (PU), a coding tree block (CTB), a coding block (CB), a prediction block (PB), or a transform block (TB). In some embodiments, whether to and / or how to determine the least one binarized bin of the SE is signaled in one of the followings: a sequence header, a picture header, a sequence parameter set (SPS), a video parameter set (VPS), a decoding parameter set (DPS), decoding capability information (DCI), a picture parameter set (PPS), an adaptation parameter set (APS), a slice header, or a tile group header.
[0250] In some embodiments, the method 2600 further comprises: determining, based on coded information of the block of the video, whether to and / or how to determine the least one binarized bin of the SE, the coded information comprising at least one of: a block size, a colour format, a single and / or dual tree partitioning, a colour component, a slice type, or a picture type.[0251 Jin some embodiments, the determination of the least one binarized bin of the SE is applied in a coding tool which requires a chroma fusion. In some embodiments, the context comprises a context model for coding or parsing the SE in an arithmetic coding.
[0252] In some embodiments, the conversion includes encoding the block into the bitstream. In some embodiments, the conversion includes decoding the block from the bitstream,
[0253] According to further embodiments of the present disclosure, a non -transitory computer-readable recording medium is provided. The non -transitory computer-readable recording medium stores a bitstream of a video which is generated by a method performed by an apparatus for video processing. The method comprises: determining that at least one binarized bin of a syntax element (SE) for residual coding associated with a block of the video is coded with a context, wherein the context is determined based on at least one of: coding information, a plurality of factors, a position of the SE in a residual block, a size of the residual block, at least one corresponding block of a second component, at least one neighbouring block, or a bin index: and generating the bitstream based on the at least one binarized bin of the SE.
[0254] According to still further embodiments of the present disclosure, a method for storing bitstream of a video is provided. The method comprises: determining that at least one binarized bin of a syntax element (SE) for residual coding associated with a block of the video is coded with a context, whereinthe context is determined based on at least one of: coding information, a plurality’ of factors, a position of the SE in a residual block, a size of the residual block, at least one corresponding block of a second component, at least one neighbouring block, or a bin index; generating the bitstream based on the at least one binarized bin of the SE; and storing the bitstream in a non -transitory computer-readable recording medium.
[0255] Implementations of the present disclosure can be described in view of the following clauses, the features of which can be combined in any reasonable manner.
[0256] Clause 1, A method for video processing, comprising: determining, for a conversion between a block of a video and a bitstream of the video, that at least one binarized bin of a syntax element (SE) for residual coding associated with the block is coded with a context, wherein the context is determined based on at least one of: coding information, a plurality of factors, a position of the SE in a residual block, a size of the residual block, at least one corresponding block of a second component, at least one neighbouring block, or a bin index; and performing the conversion based on the at least one binarized bin of the SE.
[0257] Clause 2. The method of clause 1, wherein the coding information comprises at least one of: a coding mode, a quantization parameter (QP), an inter -prediction direction, a Merge inter-mode, an advanced motion vector prediction (AMVP)-inter mode, an Intra-prediction mode, a cross-component prediction (CCP) mode, a non-CCP mode, a residual block width, a residual block height, a transform types, whether a combination of intra and inter predication (CUP) mode is applied, whether a geometric partitioning mode (GPM) mode is applied, whether a spatial geometric partitioning mode (SGPM) mode is applied, whether a matrix weighted intra prediction (MIP) mode is applied, whether an extrapolation filter-based intra prediction (EIP) is applied, whether an affine mode is applied, at least one previously encoded / decoded residual SE inside the residual block, at least one previously encoded / decoded residual STS of at least one neighbouring block, at least one previously encoded / decoded residual SE of a different component, at least one SE which is not a residual SE, a color component, a color format.
[0258] Clause 3. The method of clause 2, wherein all color components share a same context or a same context set, or wherein components Cb and Cr share the same context and the same context set, or -wherein component Y and component Cb or Cr apply two sets of contexts.
[0259] Clause 4. The method of clause 1, wherein the context is determined by a plurality of factors.
[0260] Clause 5. The method of clause 4, wherein an index of the context is derived as: C ContextTable[idx_l]... [idx n], and wherein C represents the index of the context, idx l... idx n represent N indices determined by N factors individually, to retrieve the context.
[0261] Clause 6. The method of clause I, wherein the context is determined based on the position of the SE in the residual block.
[0262] Clause 7. The method of clause 6, wherein the SE is sb_coded_flag[ xS J[ y S ], wherein (xS, yS) represents a subblock coordination of a subblock corresponding to the SE,
[0263] Clause 8. The method of clause 7, wherein a first context or a first context set is applied in accordance with that (xS, xY) satisfies a condition or a set of conditions, and a second context or a second context set is applied in accordance with that (xS, xY) does not satisfy the condition or the set of conditions.
[0264] Clause 9. The method of clause 8, wherein the condition or the set of conditions comprises at least one of xS > Tx || yS > Ty, xS > Tx && yS > Ty, xS < Tx || yS < Ty, xS < Tx && yS < Ty, xS * yS > T, or xS * yS < T, and wherein Tx represents a first threshold, Ty represents a second threshold, and T represents a third threshold,
[0265] Clause 10. The method of clause 9, wherein Tx, Ty and T depend on at least one of width or height of the residual block.
[0266] Clause 11. The method of clause 10, wherein Tx = (wS+off)»shift, wherein w S represents a width of the residual block in the number of subblocks, and wherein wS = W / w’, wherein W represents the width of the residual block and w’ represents a width of a subblock.
[0267] Clause 12. The method of clause 10, wherein Ty = (hS+off)»shift, wherein hS represents a height of the residual block in the number of subblocks, and wherein hS H / h’, wherein II represents a height of the residual block and w’ represents a height of a subblock.
[0268] Clause 13. The method of clause 11 or 12, wherein off -1, shift - 1, or off = 2, shift - 2.
[0269] Clause 14. The method of clause 10, wherein Tx = max(M, (wS+off)»shift), and / or wherein Ty = max(M, (hS+off)»shift), and wherein wS represents a width of the residual block in the number of subblocks, hS represents a height of the residual block in the number of subblocks, off represents an offset, and shift is a number.
[0270] Clause 15. The method of clause 14, wherein M = 1.
[0271] Clause 16. The method of clause 9, wherein Tx, Ty and T depend on color format and color components.
[0272] Clause 17. The method of clause 7, wherein a context set comprises a plurality of contexts and one of the plurality of contexts is selected based on a previously decoded sb coded flag.
[0273] Clause 18. The method of clause 17, wherein a first context is selected if sb_coded_flag[ xS -1][ yS - 1] == 1 || sb_coded_flag[ xS][ yS - 1] == 1, otherwise, a second context is selected.
[0274] Clause 19. The method of clause 1, wherein the context is determined based on at least one of width or height of the residual block.
[0275] Clause 20. The method of clause 19, wherein the SE is coeff sign flag.
[0276] Clause 21. The method of clause 19, wherein a first context or a first context set is applied if at least one of the width or the height of the residual block satisfies a condition or a set of conditions, and a second context or a second context set is applied if the if at least one of the width or the height of theresidual block does not satisfy the condition or the set of conditions.
[0277] Clause 22. The method of clause 21, wherein the condition or the set of conditions comprises at least one of: W > n*H, W < n*H, H > n*W, H < n*W, W > Tx || H > Ty, W > Tx && H > Ty, W < Tx || H < Ty, W < Tx && H < Ty, W * H > T, or W * H < T, and wherein W represents the width of the residual block, H represents the height of the residual block, Tx, Ty and T represents thresholds, and n is an integer.
[0278] Clause 23. The method of clause 22, wherein Tx, Ty and T are integers, and / or wherein Tx, Ty and T depend on color format and color components.
[0279] Clause 24. The method of clause 23, wherein Tx=Ty=8 and T = 64.
[0280] Clause 25, The method of clause 1, wherein the SE of a first component is coded with the context, and the context is determined based on at least one corresponding block of a second component.
[0281] Clause 26. The method of clause 25, wherein the first component is Cb and / or Cr, and the second component is Y.
[0282] Clause 27. The method of clause 25, wherein a corresponding block of the second component is derived from a current block of the first component based on a color format.
[0283] Clause 28. The method of clause 27, wherein the corresponding block covers at least one position (X’, Y’) of the second component which is corresponding to a position (X, Y) of the first component.
[0284] Clause 29. The method of clause 28, wherein the at least one position (X’, Y’) of the second component is derived from the position (X, Y) of the first component, and wherein the derivation of the at least one position (X‘, Y’) of the second component depends on color format.
[0285] Clause 30. The method of clause 29, wherein X’ = n*X and Y’=m*Y.
[0286] Clause 31. The method of clause 29 or 30, wherein the color format is color format YUV 4:2:0, n = m = 2, or wherein the color format is color format YUV 4:2:2, n = 2, m =1, or n = 1, m = 2, or wherein the color format is color format YUV 4:4:4, n = m =1.
[0287] Clause 32, The method of clause 27, wherein a top-left position of a current residual block is (X0, Y0), a width and height of the current residual block are W and H, respectivelyy, and wherein the position (X, Y) is set equal to one of: (X0, Y), (X0 + W -I, Y0), (X0, Y0+H-1), (XO+W-I, Y0+H-1), or (XO+W / 2 + offX, Y0+H / 2+offY), and wherein offX and offY represent offsets, respectivelyy.
[0288] Clause 33. The method of clause 32, wherein offX is -1 or 0 or 1, and / or wherein offY is -1 or 0 or 1.
[0289] Clause 34. The method of clause 25, wherein the context is determined based on the corresponding block of the second component, and wherein the corresponding block of the second component is denoted as CorrB.
[0290] Clause 35. The method of clause 34, wherein the context is determined based on at least one of: an availability of CorrB, a coding mode of CorrB, a coded bit flag (CBF) of CorrB, a width of CorrB, a height of CorrB, the number of non-zero coefficients of CorrB, a last position of non-zero coefficient in CorrB, or a sum of absolute values of non-zero coefficients of CorrB.
[0291] Clause 36. The method of clause 25, wherein a first context or a first context set is applied if the corresponding residual block satisfies one or more conditions, and a second context or a second context set is applied if the corresponding residual block does not satisfy the one or more conditions.
[0292] Clause 37. The method of clause 36, wherein in accordance with that the corresponding residual block is coded with a coding mode, the first context or a first context set is applied.
[0293] Clause 38, The method of clause 37, wherein the coding mode is one of: a palette coding, a transform skip, or block-based delta pulse code modulation (BDPCM).
[0294] Clause 39. The method of clause 36, wherein in accordance with that the corresponding residual block is coded with all coefficients equal to zero, the first context or a first context set is applied.
[0295] Clause 40. The method of clause 36, wherein in accordance with that a position of the last nonzero coefficient of the corresponding residual block satisfies a condition, the first context or the first context set is applied, wherein the position of the last non-zero coefficient of the corresponding residual block is represented as (lastX, lastY); and wherein in accordance with that a position of the last non-zero coefficient of the corresponding residual block does not satisfy the condition, the second context or the second context set is applied.
[0296] Clause 41. The method of clause 40, wherein the condition comprises at least one of: lastX > Tx || lastY > Ty, lastX > Tx && lastY > Ty, lastX < Tx || lastY < Ty, or lastX < Tx && lastY < Ty, and wherein Tx and Ty represent thresholds, respectivelyy.
[0297] Clause 42. The method of clause 41, wherein Tx depends on at least one of width or height of the corresponding residual block, and / or wherein Ty depends on at least one of width or height of the corresponding residual block.
[0298] Clause 43. The method of clause 42, wherein Tx = (Wc+off)»shift, or wherein Ty = (Hc+off)»shift, and wherein Wc represents the width of the corresponding residual block, He represents the height of the corresponding residual block, offset is an integer and shift is an integer.
[0299] Clause 44. The method of clause 43, wherein off -1, shift - 1, or off = 2, shift - 2.
[0300] Clause 45. The method of clause 42, wherein Tx = max(M, (Wc+off)»shift), or wherein Ty = max(M, (Hc+off)»shift), and wherein Wc represents the wudth of the corresponding residual block, He represents the height of the corresponding residual block, M is an integer, off represents an offset and shift is an integer.
[0301] Clause 46. The method of clause 45, wherein M =1
[0302] Clause 47. The method of clause 1, wherein the context is determined based on the at least one neighbouring block, the SE indicates a position of a last significant coefficient.
[0303] Clause 48. The method of clause 47, wherein the SE is one of: last_sig_coeff_x_prefix, last_sig_coeff_x_suffix, last_sig_coeff_y_prefix, or last_sig_coeff_y_suffix.
[0304] Clause 49. The method of clause 47, wherein a first parameter f(Nei) is derived for a neighbouring block, wherein Nei represents the neighbouring block and f represents a function.
[0305] Clause 50. The method of clause 49, wherein f(Nei, Q) is derived for the Q-coordinate of the last position of the non zero coefficient, wherein Q = X or Y, f(Nei) refers to f(Nei, X) or f(Nei, Y).
[0306] Clause 51. The method of clause 49, wherein the first parameters depends on at least one of: an availability of the neighbouring block, a coding mode of the neighbouring block, a CBF of the neighbouring block, a width of the neighbouring block, a height of the neighbouring block, the number of non-zero coefficients of the neighbouring block, the last position of non-zero coefficient in neighbouring block, or a sum of absolute values of non-zero coefficients of neighbouring block.
[0307] Clause 52. The method of clause 49, wherein f(Nei) = F0, in accordance with that at least one condition of is satisfied: the neighbouring block is not available, the neighbouring block is in a region inaccessible, the neighbouring block is coded with a first mode, the neighbouring block is not coded with a second mode determined by a coding mode of the current block, the neighbouring block is coded with coded bit flag being equal to 0, a width of the neighbouring block is larger than a fourth threshold, the width of the neighbouring block is smaller than a fifth threshold, a height of the neighbouring block is larger than a sixth threshold, the height of the neighbouring block is smaller than a seventh threshold, a size of the neighbouring block is larger than an eighth threshold, or the size of the neighbouring block is smaller than a ninth threshold.
[0308] Clause 53. The method of clause 52, wherein the first mode is at least one of: a palette mode, an intra block copy (IBC) mode, a transform skip mode, an inter mode, an intra mode, or a BDPCM mode.
[0309] Clause 54. The method of clause 52, wherein the block is intra -coded but the neighbouring block is not intra-coded, and / or wherein the block is not intra-coded but the neighbouring block is intra-coded.
[0310] Clause 55. The method of clause 49, wherein f(Nei) = F1 if the last position of the neighbouring block satisfies one or more conditions.
[0311] Clause 56. The method of clause 55, wherein the one or more conditions comprise at least one of: N lastQ >= Tl and N lastQ < T2, N lastQ > Tl and N__lastQ <= T2, N lastQ >= Tl, N lastQ > Tl, N lastQ <= T2, or is N lastQ < T2, and wherein Q is X or Y, (NJastX, N lastY) represents the position of the last significant coefficient of the neighounng block, and Tl and T2 represent thresholds, respectivelyy.
[0312] Clause 57. The method of clause 56, wherein Q is X if the SE represents an X-dimension coordinate of the last position of the non-zero coefficient.
[0313] Clause 58. The method of clause 57, wherein the SE is one of last sig coeff x prefix or last sig coeff x suffix.
[0314] Clause 59. The method of clause 56, wherein Q is Y if the SE represents a Y -dimension coordinate of the last position of the non-zero coefficient.
[0315] Clause 60. The method of clause 59, wherein the SE is one of last_sig_coeff_y_prefix or last_sig_coeff_y suffix.
[0316] Clause 61. The method of clause 56, wherein T1 and T2 depend on at least one of width or height of the neighbouring block.
[0317] Clause 62. The method of clause 61, wherein T1 and T2 depend on the width of the neighbouring block in accordance with Q = X, or wherein T1 and T2 depend on the height if of the neighbouring block in accordance with Q = Y, or wherein T1 or T2 = (Wn+off)»shift, or wherein T1 or T2 = (Hn+off)»shift, or wherein T1 or T2 = max(M, (Wn+off)»shift), or wherein T1 or T2 = max(M, (Hn+off)»shift), and wherein Wn represents the width of the neighbouring block, Hn represents the height of the neighbouring block, off represents an offset, and shift is an integer.
[0318] Clause 63. The method of clause 62, wherein off =1, shift = 1, or wherein off = 2, shift = 2, or wherein M = 1.
[0319] Clause 64. The method of clause 49, wherein f(Nei) = F1, in accordance with N_lastQ >= max(1,lastQ < max(2, Hn»1) for Q = Y, wherein (N_lastX, N_lastY) represents the position of the last significant coefficient of the neighbouring block, Wn represents the width of the neighbouring block, and Hn represents the height of the neighbouring block.
[0320] Clause 65. The method of clause 49, wherein f(Nei)= F2, if f(Nei) is not equal to either F0 or Fl.
[0321] Clause 66. The method of any of clauses 55-65, wherein F0 = 0, F1 = 1 and F2 = 2.
[0322] Clause 67. The method of clause 47, wherein at least two neighbouring blocks are used to derive the context, or wherein one neighbouring block is used to derive the context.
[0323] Clause 68. The method of clause 67, wherein an index of the context is derived as: C=f(NeiA) + f(NeiB), or C=f(NeiA) | f(NeiB), or C=f(NeiA) & f(NeiB), and wherein C represents the index of the context, Nei represents one of the at least two neighbouring blocks, NeiB represents another one of the at least two neighbouring blocks, f represents a function.
[0324] Clause 69. The method of clause 67, wherein an index of the context is derived as: C=f(NeiA), or C=f(NeiB), and wherein C represents the index of the context, Nei represents one of the at least two neighbouring blocks, NeiB represents another one of the at least two neighbouring blocks, f represents a function.
[0325] Clause 70. The method of clause 67, wherein the at least two neighbouring blocks are checked inorder.
[0326] Clause 71. The method of clause 70, wherein in accordance with that a first neighbouring block satisfies one or more conditions, the second neighbouring block is checked followingly, or wherein in accordance with that the first neighbouring block does not satisfy one or more conditions, the context may be derived based on the first neighbouring block.
[0327] Clause 72. The method of clause 71, wherein the one or more conditions comprise at least one of: the neighbouring block is not available, the neighbouring block is in a region inaccessible, the neighbouring block is coded with a mode, or the neighbouring block is coded with coded bit flag being equal to 0,
[0328] Clause 73. The method of clause 72, wherein the mode comprises at least one of: a palette mode, an IBC mode, a transform skip mode, an inter mode, an intra mode, or a BDPCM mode.
[0329] Clause 74. The method of clause 70, wherein a first neighbouring block of the at least two neighbouring blocks is checked before a second neighbouring block of the at least two neighbouring blocks, in accordance with that the SE represents an X-dimension coordinate of the last position of the non-zero coefficient, or wherein a second neighbouring block of the at least two neighbouring blocks is checked before the first neighbouring block of the at least two neighbouring blocks, in accordance with that the SE represents the X-dimension coordinate of the last position of the non-zero coefficient.
[0330] Clause 75, The method of clause 74, wherein the SE is last sig __coeff __x_p refix or last sig coeff x suffix.[0331 JClause 76. The method of clause 70, wherein a second neighbouring block of the at least two neighbouring blocks is checked before a first neighbouring block of the at least two neighbouring blocks, in accordance with that the SE represents a Y-dimension coordinate of the last position of the non-zero coefficient, or wherein the first neighbouring block of the at least two neighbouring blocks is checked before the second neighbouring block of the at least two neighbouring blocks, in accordance with that the SE represents the Y-dimension coordinate of the last position of the non-zero coefficient.
[0332] Clause 77. The method of clause 76, wherein the SE is last_sig_coeff_y_prefix or last_sig_coeff_y_suffix.
[0333] Clause 78. The method of clause 67, wherein a first neighbouring block of the at least two neighbouring blocks is a top neighbouring block, and a second neighbouring block of the at least two neighbouring blocks is a neighbouring block.
[0334] Clause 79. The method of clause 78, wherein a position in the first neighbouring block is above the block, and / or wherein a position in the second neighbouring block is left to the block.
[0335] Clause 80. The method of clause 67, wherein the neighbouring block is color component dependent.
[0336] Clause 81. The method of clause 1, wherein the context is determined based on at least one bin, and the at least one bin is coded with the context.
[0337] Clause 82. The method of clause 81, wherein the at least one bin is a first bin.
[0338] Clause 83. The method of clause 81, wherein each bin is coded with the context.
[0339] Clause 84. The method of clause 81, wherein two bins are coded with two different contexts.
[0340] Clause 85. The method of clause 81, wherein two bins share a same context.
[0341] Clause 86. The method of clause 1, wherein the at least one binarized bin of the SE for residual coding is coded with the context that is determined by the coding mode.
[0342] Clause 87. The method of clause 1, wherein whether to and / or how to apply a derivation of the context depends on the coding information.
[0343] Clause 88. The method of clause 87, wherein the derivation of the context is applied to one or more color components.
[0344] Clause 89. The method of clause 87, wherein the derivation of the context is applied in accordance with that a target coding mode is used, or wherein the derivation of the context is applied in accordance with that the target coding mode is not used.
[0345] Clause 90. The method of clause 89, wherein the target coding mode comprises one of: an intra sub-partition (ISP) mode, a block -based delta pulse code modulation (BDPCM), an intra block copy (1BC) mode, a geometric partitioning mode (GPM), a spatial geometric partitioning mode (SGPM), a cross -component linear model (CCLM), a convolutional cross -component model (CCCM), or an affine mode.
[0346] Clause 91. The method of clause 87, wherein the derivation of the context is applied in accordance with that at least one of a width or height of the block satisfies one or more conditions.
[0347] Clause 92. The method of clause 1, wherein a binarization and / or interpretation of the SE for residual coding is determined based on the at least one neighbouring block.
[0348] Clause 93. The method of clause 92, wherein the SE indicates a position of a last significant coefficient.
[0349] Clause 94. The method of clause 93, wherein the SE is one of: last_sig_coeff_x_prefix, last sig coeff x suffix, 1 ast_sig_coeff_ _prefi, last _sig_coeff_y_suffix.
[0350] Clause 95. The method of clause 92, wherein a parameter is derived for the at least one neighbouring block,[0351 JClause 96, The method of clause 95, wherein f(Nei, Q) is derived for the Q-coordinate of the last position of the non-zero coefficient, wherein Q = X or Y, f represents a function, Nei represents the at least one neighbouring block, and f(Nei) refers to f(Nei, X) or f(Nei, Y).
[0352] Clause 97. The method of clause 95, wherein the parameter depends on at least one of: an availability of the at least one neighbouring block, a coding mode of the at least one neighbouring block, a CBF of the at least one neighbouring block, a width and / or height of the at least one neighbouring block,the number of non-zero coefficients of the at least one neighbouring block, the last position of non -zero coefficient in the at least one neighbouring block, or a sum of absolute values of non -zero coefficients of the at least one neighbouring block.
[0353] Clause 98. The method of clause 95, wherein f(Nei) = F0, in accordance with at least one of the following conditions is satisfied: the at least one neighbouring block is not available, the at least one neighbouring block is in a region inaccessible, the at least one neighbouring block is coded with a third mode, the at least one neighbouring block is not coded with a fourth mode determined by the coding mode of the block, the at least one neighbouring block is coded with coded bit flag being equal to 0, a width of the at least one neighbouring block, a width of the at least one neighbouring block is larger than a tenth threshold, the width of the at least one neighbouring block is smaller than an eleventh threshold, a height of the at least one neighbouring block is larger than a twelfth threshold, the height of the at least one neighbouring block is smaller than a thirteenth threshold, the width of the at least one neighbouring block is not equal to the block, the height of the at least one neighbouring block is not equal to the block, or a size of the at least one neighbouring block is larger than a fourteenth threshold, or the size of the at least one neighbouring block is smaller than a fifteenth threshold, and wherein f represents a function, and Nei represents the at least one neighbouring block.
[0354] Clause 99. The method of clause 98, wherein the third mode comprises at least one of: a palette mode, an IBC mode, a transform skip mode, an inter mode, an intra mode, or a BDPCM mode, and / or wherein the block is intra-coded but the at least one neighbouring block is not intra-coded, or wherein the block is not intra-coded but the at least one neighbouring block is intra-coded, and / or wherein in accordance with Q=X, the width of the at least one neighbouring block is not equal to the block, and / or wherein in accordance with Q=Y, the height of the at least one neighbouring block is not equal to the block.
[0355] Clause 100, The method of clause 95, wherein f(Nei) = FO, in accordance with the last position of the at least one neighbouring block satisfies one or more conditions,
[0356] Clause 101. The method of clause 100, wherein the one or more conditions comprise at least one of: N lastQ >= Tl and N lastQ < T2, N lastQ > Tl and N lastQ <= T2, N lastQ >= Tl, N lastQ > Tl, N lastQ <= T2, or is N lastQ < T2, and wherein Q is X or Y, (N lastX, N lastY) represents the position of the last significant coefficient of the at least one neighouring block, and T 1 and T2 represent thresholds, respectivelyy.
[0357] Clause 102. The method of clause 101, wherein Q is X if the SE represents an X-dimension coordinate of the last position of the non-zero coefficient.
[0358] Clause 103. The method of clause 102, wherein the SE is one of last_sig_coeff_x_prefix or last_sig_coeff_x_suffix.
[0359] Clause 104. The method of clause 101, wherein Q is Y if the SE represents a Y-dimension coordinate of the last position of the non-zero coefficient.
[0360] Clause 105. The method of clause 104, wherein the SE is one of last sig coeff y prefix or last sig coeff y suffix.
[0361] Clause 106. The method of clause 101, wherein T1 and T2 depend on at least one of width or height of the at least one neighbouring block.
[0362] Clause 107. The method of clause 106, wherein T1 and T2 depend on the width of the at least one neighbouring block in accordance with Q = X, or wherein T1 and T2 depend on the height if of the at least one neighbouring block in accordance with Q = Y, or wherein T1 or T2 = (Wn+off)»shift, or wherein T1 or T2 = (Hn+off)»shift, or wherein T1 or T2 = max(M, (Wn+off)»shift), or wherein T1 or T2 = max(M, (Hn+off)»shift), or wherein T1 or T2 =Wn -( (Wn+off)»shift), or wherein T1 or T2 = Hn - ((Hn+off)»shift), or wherein T1 or T2 = Wn -max(M, (Wn+off)»shift), wherein T1 or T2 = Hn - (max(M, (Hn+off)»shift)), or wherein T1 or T2 = K*((Wn+off)»shift), or wherein T1 or T2 =K*( (Hn+off)»shift), or wherein T1 or T2 = max(M, K*((Wn+off)»shift)), or wherein T1 or T2 = max(M, K*((Hn+off)»shift)), and wherein Wn represents the width of the at least one neighbouring block, Hn represents the height of the at least one neighbouring block, off represents an offset, and shift is an integer.
[0363] Clause 108. The method of clause 107, wherein off =1, shift = 1, or wherein off = 2, shift = 2, or wherein off =0, shift = 3, or wherein off = 0, shift = 2, or wherein M = 1, or wherein K is an integer.
[0364] Clause 109, The method of clause 95, wherein f(Nei) = Fl, in accordance with N lastQ < Wn -(Wn»3) for Q = X or N lastQ < Hn - (Hn»3) for Q = Y, wherein (N lastQ, N lastQ) represents the position of the last significant coefficient of the at least one neighounng block, Wn represents the width of the at least one neighbouring block, and Hn represents the height of the at least one neighbouring block.
[0365] Clause 110. The method of clause 95, wherein f(Nei) = F1, if f(Nei) is not equal to F0.
[0366] Clause 111. The method of any of clauses 95-110, wherein F0 = 0, and F1 = 1.
[0367] Clause 112. The method of clause 92, wherein at least two neighbouring blocks are used in at least one binarization or interpretation, or wherein one neighbouring block is used in at least one binarization or interpretation.
[0368] Clause 113. The method of clause 112, wherein the at least two neighbouring blocks are checked in order.
[0369] Clause 114, The method of clause 113, wherein in accordance with that a first neighbouring block satisfies one or more conditions, the second neighbouring block is checked followingly, or wherein in accordance with that the first neighbouring block does not satisfy one or more conditions, the context may be derived based on the first neighbouring block.
[0370] Clause 115. The method of clause 114, wherein the one or more conditions comprise at least one of: the neighbouring block is not available, the neighbouring block is in a region inaccessible, theneighbouring block is coded with a mode, the neighbouring block is coded with coded bit flag being equal to 0, or the neighbouring block is not coded with another mode determined based on a coding mode of the block.
[0371] Clause 116. The method of clause 115, wherein the mode comprises at least one of: a palette mode, an IBC mode, a transform skip mode, an inter mode, an intra mode, or a BDPCM mode, or wherein the block is intra-coded but the neighbouring block is not intra-coded, or wherein the block is not intra -coded but the neighbouring block is intra-coded,
[0372] Clause 117, The method of clause 112, wherein a first neighbouring block of the at least two neighbouring blocks is checked before a second neighbouring block of the at least two neighbouring blocks, in accordance with that the SE represents an X-dimension coordinate of the last position of the non-zero coefficient, or wherein a second neighbouring block of the at least two neighbouring blocks is checked before the first neighbouring block of the at least two neighbouring blocks, in accordance with that the SE represents the X-dimension coordinate of the last position of the non-zero coefficient.
[0373] Clause 118. The method of clause 117, wherein the SE is last_sig_coeff_x_prefix or last_sig_coeff_x_suffix.
[0374] Clause 119. The method of clause 112, wherein a second neighbouring block of the at least two neighbouring blocks is checked before a first neighbouring block of the at least two neighbouring blocks, in accordance with that the SE represents a Y-dimension coordinate of the last position of the non-zero coefficient, or wherein the first neighbouring block of the at least two neighbouring blocks is checked before the second neighbouring block of the at least two neighbouring blocks, in accordance with that the SE represents the Y-dimension coordinate of the last position of the non-zero coefficient.
[0375] Clause 120. The method of clause 119, wherein the SE is last_sig_coeff_y_prefix or last_sig_coeff_y_suffix.
[0376] Clause 121. The method of clause 112, wherein a first neighbouring block of the at least two neighbouring blocks is selected, in accordance with that the SE represents an X -dimension coordinate of the last position of the non-zero coefficient, or wherein a second neighbouring block of the at least two neighbouring blocks is selected, in accordance with that the SE represents an X-dimension coordinate of the last position of the non-zero coefficient.
[0377] Clause 122. The method of clause 121, wherein the SE is last_sig_coeff_x_prefix or last_sig_coeff_x_suffix.
[0378] Clause 123. The method of clause 112, wherein a second neighbouring block of the at least two neighbouring blocks is selected, in accordance with that the SE represents a Y -dimension coordinate of the last position of the non-zero coefficient, or wherein a first neighbouring block of the at least two neighbouring blocks is selected, in accordance with that the SE represents a Y -dimension coordinate of the last position of the non-zero coefficient.
[0379] Clause 124. The method of clause 123, wherein the SE is last sig coeff y... prefix or last sig coeff y suffix.
[0380] Clause 125. The method of clause 112, wherein a first neighbouring block of the at least two neighbouring blocks is a top neighbouring block, and a second neighbouring block of the at least two neighbouring blocks is a neighbouring block.
[0381] Clause 126. The method of clause 125, wherein a position in the first neighbouring block is above the block, and / or wherein a position in the second neighbouring block is lef to the block.
[0382] Clause 127. The method of clause 92, wherein the SE is interpreted in different ways depending on f(Nei), wherein Nei represents the neighbouring block, and f represents a function.
[0383] Clause 128. The method of clause 127, wherein a decoded position of a last non-zero coefficient (last _pos _x’, last_pos_y’) is interpreted as (last__pos__x, last_pos_y) in different ways depending on f(Nei), wherein (last pos x, last pos y) represents the last non-zero coefficient, and (last pos x’, last pos y’) represents the decoded position of the last non-zero coefficient.
[0384] Clause 129. The method of clause 128, wherein last pos x = last pos x’, in accordance w ith f(Nei, X) = FO, or wherein last_pos_y = lastjpos_y’ in accordance with f(Nei, Y) = FO, or wherein last__pos__x = M[last_pos_x’] in accordance with f(Nei, X) = Fl, or wherein last jpos_ _y = M[last_pos_y’J in accordance with f(Nei, Y) Fl.
[0385] Clause 130. The method of clause 129, wherein FO =^0 and / or F 1^1.
[0386] Clause 131. The method of any of clauses 127-130, wherein a mapping table M[k'J maps a decoded value to an interpreted value which is used in a following procedure.
[0387] Clause 132. The method of clause 131, wherein the mapping table depends on a neighbouring residual block.
[0388] Clause 133. The method of clause 132, wherein for lastjos q, M is constructed as M[0] = Lq, M[l] = Lq -1, M[2] = Lq+1, M[3] = Lq-2, M[4]=Lq+2,.... wherein q = x or y.
[0389] Clause 134. The method of clause 133, wherein suppose size q is equal to a width of the block, if q == x and a height of the block if q == y, the construction procedure comprises: setting M[0] = Lq; setting a variable Abs equal to 1 and a variable Idx equal to 1; if Lq-abs >= 0, setting M[Idx-H ] = Lq-abs; if Lq+abs < Size_q, setting M[Idx++] = Lq+abs; Abs++; and if Idx >= Size q, terminating the procedure, otherwise, go to setting M[Idx++] = Lq-abs if Lq-abs >^- 0.
[0390] Clause 135. The method of clause 92, wherein the neighbouring block is color component dependent.
[0391] Clause 136. The method of any of clauses 92-135, wherein whether to and / or how to apply the determination of the binarization and / or interpretation of the SE for residual coding based on the at least one neighbouring block depend on color format / color component.
[0392] Clause 137, The method of clause 136, wherein the determination of the binarization and / or interpretation of the SE for residual coding based on the at least one neighbouring block is applied to a first component but not be applied to a second component.
[0393] Clause 138. The method of clause 1, wherein a residual SE is coded in a predictive way.
[0394] Clause 139. The method of clause 138, wherein S-S’ is coded, wherein S represents the residual SE, and S' represents a residual SE in a previously residual block.
[0395] Clause 140. The method of clause 138, wherein S-f(S’) is coded, wherein S represents the residual SE, S’ represents a residual SE in a previously residual block, and {‘represents a function.
[0396] Clause 141. The method of clause 140, wherein ft S'? a*S’+b, wherein a and b are parameters.
[0397] Clause 142. The method of clause 138, wherein a set of residual SEs is copied from a set of residual SEs in a previously residual block.
[0398] Clause 143. The method of clause! 42, wherein an index is coded to indicate the set of residual SEs in a previously residual block.
[0399] Clause 144, The method of clause 138, wherein a set of residual SEs is predicted by a set of residual SEs in a previously residual block.
[0400] Clause 145, The method of clause 144, wherein difference between the set of residual SEs and the prediction of the set of residual SEs is signalled.
[0401] Clause 146. The method of clause 138, wherein whether a set of residual SEs is copied from or predicted by a set of residual SEs in a previously residual block is signaled.
[0402] Clause 147. The method of any of clauses 1-146, wherein the SE is binarized as one of: a flag, a fixed length code, an exponential-Golomb (EG(x)) code, a unary code, a truncated unary code, or a truncated binary code.
[0403] Clause 148. The method of clause 147, wherein the binarized SE is signed or unsigned.
[0404] Clause 149. The method of any of clauses 1-146, wherein the SE representing a coding tool or a coding approach is determined to be unused without being signalled, if the coding tool or the coding approach is not applicable or not capable of being used.
[0405] Clause 150. The method of any of clauses 1-146, wherein the SE is coded with at least one context model, or wherein the SE is bypass coded.
[0406] Clause 151, The method of any of clauses 1-146, wherein the SE is signaled.
[0407] Clause 152. The method of clause 151, wherein the SE is signaled if a corresponding function is applicable.
[0408] Clause 153, The method of clause 151, wherein the SE is signaled if a dimension of the blocksatisfies a condition.
[0409] Clause 154. The method of any of clauses 1-146, wherein the SE is signaled at one of the followings: a block level, a sequence level, a group of pictures level, a picture level, a slice level, or a tile group level.
[0410] Clause 155. The method of clause 154, wherein the SE is signaled in a coding structure of one of the followings: a coding tree unit (CTU), a coding unit (CU), a transform unit (TU), a prediction unit (PU), a coding tree block (CTB), a coding block (CB), a prediction block (PB), or a transform block (TB).
[0411] Clause 156. The method of clause 154, wherein the SE is signaled in one of the followings: a sequence header, a picture header, a sequence parameter set (SPS), a video parameter set (VPS), a decoding parameter set (DPS), decoding capability information (DCI), a picture parameter set (PPS), an adaptation parameter set (APS), a slice header, or a tile group header,
[0412] Clause 157, The method of any of clauses 1-146, wherein whether to and / or how to determine the least one binarized bin of the SE is signaled at one of the following: a block level, a sequence level, a group of pictures level, a picture level, a slice level, or a tile group level.
[0413] Clause 158. The method of clause 157, wherein whether to and / or how to determine the least one binarized bin of the SE is signaled in one of the following: a coding tree unit (CTU), a coding unit (CU), a transform unit (TU), a prediction unit (PU), a coding tree block (CTB), a coding block (CB), a prediction block (PB), or a transform block (TB),
[0414] Clause 159. The method of clause 157, wherein whether to and / or how to determine the least one binarized bin of the SE is signaled in one of the followings: a sequence header, a picture header, a sequence parameter set (SPS), a video parameter set (VPS), a decoding parameter set (DPS), decoding capability information (DCI), a picture parameter set (PPS), an adaptation parameter set (APS), a slice header, or a tile group header.
[0415] Clause 160. The method of any of clauses 1-146, further comprising: determining, based on coded information of the block of the video, whether to and / or how to determine the least one binarized bin of the SE, the coded information comprising at least one of: a block size, a colour format, a single and / or dual tree partitioning, a colour component, a slice type, or a picture type.
[0416] Clause 161. The method of any of clauses 1-146, wherein the determination of the least one binarized bin of the SE is applied in a coding tool which requires a chroma fusion,
[0417] Clause 162. The method of any of clauses 1-146, wherein the context comprises a context model for coding or parsing the SE in an arithmetic coding.
[0418] Clause 163. The method of any of clauses 1-161, wherein the conversion includes encoding the block into the bitstream.
[0419] Clause 164. The method of any of clauses 1-161, wherein the conversion includes decoding the block from the bitstream.
[0420] Clause 165. An apparatus for video processing comprising a processor and a non -transitory’ memory’ with instructions thereon, wherein the instructions upon execution by the processor, cause the processor to perform a method in accordance with any of clauses 1-164.
[0421] Clause 166. A non-transitory computer-readable storage medium storing instructions that cause a processor to perform a method in accordance with any of clauses 1-164.
[0422] Clause 167. A non-transitory computer-readable recording medium storing a bitstream of a video which is generated by a method performed by an apparatus for video processing, wherein the method comprises: determining that at least one binarized bin of a syntax element (SE) for residual coding associated with a block of the video is coded with a context, wherein the context is determined based on at least one of: coding information, a plurality of factors, a position of the SE in a residual block, a size of the residual block, at least one corresponding block of a second component, at least one neighbouring block, or a bin index; and generating the bitstream based on the at least one binarized bin of the SE.
[0423] Clause 168. A method for storing a bitstream of a video, comprising: determining that at least one binarized bin of a syntax element (SE) for residual coding associated with a block of the video is coded with a context, wherein the context is determined based on at least one of: coding information, a plurality of factors, a position of the SE in a residual block, a size of the residual block, at least one corresponding block of a second component, at least one neighbouring block, or a bin index; generating the bitstream based on the at least one binarized bin of the SE; and storing the bitstream in a non-transitory computer-readable recording medium.Example Device
[0424] Fig. 27 illustrates a block diagram of a computing device 2700 in which various embodiments of the present disclosure can be implemented. The computing device 2700 may be implemented as or included in the source device 110 (or the video encoder 114 or 200) or the destination device 120 (or the video decoder 124 or 300).
[0425] It would be appreciated that the computing device 2700 shown in Fig. 27 is merely for purpose of illustration, without suggesting any limitation to the functions and scopes of the embodiments of the present disclosure in any manner.
[0426] As shown in Fig. 27, the computing device 2700 includes a general-purpose computing device 2700, The computing device 2700 may at least comprise one or more processors or processing units 2710, a memory 2720, a storage unit 2730, one or more communication units 2740, one or more input devices 2750, and one or more output devices 2760.
[0427] In some embodiments, the computing device 2700 may be implemented as any user terminal or server terminal having the computing capability’. The server terminal may be a server, a large-scale computing device or the like that is provided by a service provider. The user terminal may for example be any type of mobile terminal, fixed terminal, or portable terminal, including a mobile phone, station,unit, device, multimedia computer, multimedia tablet, Internet node, communicator, desktop computer, laptop computer, notebook computer, netbook computer, tablet computer, personal communication system (PCS) device, personal navigation device, personal digital assistant (PDA), audio / video player, digital camera / video camera, positioning device, television receiver, radio broadcast receiver, E-book device, gaming device, or any combination thereof, including the accessories and peripherals of these devices, or any combination thereof. It would be contemplated that the computing device 2700 can support any type of interface to a user (such as “wearable’" circuitry and the like).
[0428] The processing unit 2710 may be a physical or virtual processor and can implement various processes based on programs stored in the memory 2720. In a multi-processor system, multiple processing units execute computer executable instructions m parallel so as to improve the parallel processing capability of the computing device 2700. The processing unit 2710 may also be referred to as a central processing unit (CPU), a microprocessor, a controller or a microcontroller.
[0429] The computing device 2700 typically includes various computer storage medium. Such medium can be any medium accessible by the computing device 2700, including, but not limited to, volatile and non-volatile medium, or detachable and non -detachable medium. The memory 2720 can be a volatile memory (for example, a register, cache, Random Access Memory (RAM)), a non-volatile memory (such as a Read-Only Memory (ROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), or a flash memory), or any combination thereof. The storage unit 2730 may be any detachable or non-detachable medium and may include a machine-readable medium such as a memory, flash memory drive, magnetic disk or another other media, which can be used for storing information and / or data and can be accessed in the computing device 2700.
[0430] The computing device 2700 may further include additional detachable / non -detachable, volatile / non-volatile memory medium. Although not shown in Fig. 27, it is possible to provide a magnetic disk drive for reading from and / or writing into a detachable and non-volatile magnetic disk and an optical disk drive for reading from and / or writing into a detachable non-volatile optical disk. In such cases, each drive may be connected to a bus (not shown) via one or more data medium interfaces.
[0431] The communication unit 2740 communicates with a further computing device via the communication medium. In addition, the functions of the components in the computing device 2700 can be implemented by a single computing cluster or multiple computing machines that can communicate via communication connections. Therefore, the computing device 2700 can operate in a networked environment using a logical connection with one or more other servers, networked personal computers (PCs) or further general network nodes.
[0432] The input device 2750 may be one or more of a variety of input devices, such as a mouse, keyboard, tracking ball, voice-input device, and the like. The output device 2760 may be one or more of a variety of output devices, such as a display, loudspeaker, printer, and the like. By means of the communication unit 2740, the computing device 2700 can further communicate with one or more external devices (not shown) such as the storage devices and display device, with one or more devices enabling the user tointeract with the computing device 2700, or any devices (such as a network card, a modem and the like) enabling the computing device 2700 to communicate with one or more other computing devices, if required. Such communication can be performed via input / output (I / O) interfaces (not shown).
[0433] In some embodiments, instead of being integrated in a single device, some or all components of the computing device 2700 may also be arranged in cloud computing architecture. In the cloud computing architecture, the components may be provided remotely and work together to implement the functionalities described in the present disclosure. In some embodiments, cloud computing provides computing, software, data access and storage service, which will not require end users to be aware of the physical locations or configurations of the systems or hardware providing these services. In various embodiments, the cloud computing provides the sendees via a wide area network (such as Internet) using suitable protocols. For example, a cloud computing provider provides applications over the wide area network, which can be accessed through a web browser or any other computing components. The software or components of the cloud computing architecture and corresponding data may be stored on a server at a remote position. The computing resources in the cloud computing environment may be merged or distributed at locations in a remote data center. Cloud computing infrastructures may provide the services through a shared data center, though they behave as a single access point for the users. Therefore, the cloud computing architectures may be used to provide the components and functionalities described herein from a service provider at a remote location. Alternatively, they may be provided from a conventional server or installed directly or otherwise on a client device.
[0434] The computing device 2700 may be used to implement video encoding / decoding in embodiments of the present disclosure. The memory 2720 may include one or more video coding modules 2725 having one or more program instructions. These modules are accessible and executable by the processing unit 2710 to perform the functionalities of the various embodiments described herein,
[0435] In the example embodiments of performing video encoding, the input device 2750 may receive video data as an input 2770 to be encoded. The video data may be processed, for example, by the video coding module 2725, to generate an encoded bitstream. The encoded bitstream may be provided via the output device 2760 as an output 2780.
[0436] In the example embodiments of performing video decoding, the input device 2750 may receive an encoded bitstream as the input 2770. The encoded bitstream may be processed, for example, by the video coding module 2725, to generate decoded video data. The decoded video data may be provided via the output device 2760 as the output 2780.
[0437] While this disclosure has been particularly shown and described with references to example embodiments thereof, it will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the present application as defined by the appended claims. Such variations are intended to be covered by the scope of this present application. As such, the foregoing description of embodiments of the present application is not intended to be limiting.
Claims
1. I / We Claim:
1. A method for video processing, comprising:3.determining, for a conversion between a block of a video and a bitstream of the video, that at least one binarized bin of a syntax element (SE) for residual coding associated with the block is coded with a context, wherein the context is determined based on at least one of: coding information, a plurality of factors, a position of the SE in a residual block, a size of the residual block, at least one corresponding block of a second component, at least one neighbouring block, or a bin index; and4.performing the conversion based on the at least one binarized bin of the SE.
2. The method of claim 1, wherein the coding information comprises at least one of:6.a coding mode,7.a quantization parameter (QP),8.an inter-prediction direction,9.a Merge inter-mode,10.an advanced motion vector prediction (AMVP)-inter mode,11.an Intra-prediction mode,12.a cross-component prediction (CCP) mode,13.a non-CCP mode,14.a residual block width,15.a residual block height,16.a transform types,17.whether a combination of intra and inter predication (CIIP) mode is applied,18.whether a geometric partitioning mode (GPM) mode is applied,19.whether a spatial geometric partitioning mode (SGPM) mode is applied,20.whether a matrix weighted intra prediction (MIP) mode is applied,21.whether an extrapolation filter-based intra prediction (EIP) is applied,22.whether an affine mode is applied,23.at least one previously encoded / decoded residual SE inside the residual block,24.at least one previously encoded / decoded residual SE of at least one neighbouring block,25.at least one previously encoded / decoded residual SE of a different component,26.at least one SE which is not a residual SE,27.a color component,28.a color format,3. The method of claim 2, wherein all color components share a same context or a same context set, or wherein components Cb and Cr share the same context and the same context set, or30.wherein component Y and component Cb or Cr apply two sets of contexts.
4. The method of claim 1, wherein the context is determined by a plurality of factors.
5. The method of claim 4, wherein an index of the context is derived as:32.C = ContextTable[idx_lJ... [idx n], and33.wherein C represents the index of the context, idx__l... idx_n represent N indices determined by N factors individually, to retrieve the context,6. The method of claim 1, wherein the context is determined based on the position of the SE in the residual block.
7. The method of claim 6, wherein the SE is sb_coded_flag[ xS ][ yS ], wherein (xS, yS) represents a subblock coordination of a subblock corresponding to the SE.
8. The method of claim 7, wherein a first context or a first context set is applied in accordance with that (xS, xY) satisfies a condition or a set of conditions, and37.a second context or a second context set is applied in accordance with that (xS, xY) does not satisfy the condition or the set of conditions.
9. The method of claim 8, wherein the condition or the set of conditions comprises at least one of xS > Tx yS > Ty,43. 45.xS * yS < T, find46.wherein Tx represents a first threshold, Ty represents a second threshold, and T represents a third threshold.
10. The method of claim 9, wherein Tx, Ty and T depend on at least one of width or height of the residual block.
11. The method of claim 10, wherein Tx = (wS+off)»shift, wherein wS represents a width of the residual block in the number of subblocks, and49.wherein wS = W / w’, wherein W represents the width of the residual block and w' represents a width of a subblock,12. The method of claim 10, wherein Ty = (hS+off)»shift, wherein hS represents a height of the residual block in the number of subblocks, andwherein hS = H / h’, wherein H represents a height of the residual block and w’ represents a height of a subblock.
13. The method of claim 11 or 12, wherein off =1, shift - 1, or off - 2, shift - 2.
14. The method of claim 10, wherein Tx = max(M, (wS+off)»shift), and / or53.wherein Ty = max(M, (hS+off)»shift), and54.wherein wS represents a width of the residual block in the number of subblocks, hS represents a height of the residual block in the number of subblocks, off represents an offset, and shift is a number.
15. The method of claim 14, wherein M = 1.
16. The method of claim 9, wherein Tx, Ty and T depend on color format and color components.
17. The method of claim 7, wherein a context set comprises a plurality of contexts and one of the plurality of contexts is selected based on a previously decoded sb coded flag.
18. The method of claim 17, wherein a first context is selected if sb coded flagf xS - 1][ yS ] == 1 || sb_coded_flag[ xS][yS - 1] == 1, otherwise, a second context is selected.
19. The method of claim 1, wherein the context is determ ined based on at least one of width or height of the residual block.
20. The method of claim 19, wherein the SE is coeff sign flag.
21. The method of claim 19, wherein a first context or a first context set is applied if at least one of the width or the height of the residual block satisfies a condition or a set of conditions, and a second context or a second context set is applied if the if at least one of the width or the height of the residual block does not satisfy the condition or the set of conditions.
22. The method of claim 21, wherein the condition or the set of conditions comprises at least one of: W > n*H,63.W < n*H,64.H >n*W,65.H < n*W,66.W > Tx H H > Ty,67.W > Tx && H > Ty,68.W < Tx ii H < Ty,69.W < Tx && H < Ty, W * H > T, or70.W * H < T, and71.wherein W represents the width of the residual block, II represents the height of the residual block. Tx, Ty and T represents thresholds, and n is an integer.
23. The method of claim 22, wherein Tx, Ty and T are integers, and / or73.wherein Tx, Ty and T depend on color format and color components,24. The method of claim 23, wherein Tx=Ty=8 and T = 64.
25. The method of claim 1, wherein the SE of a first component is coded with the context, and the context is determined based on at least one corresponding block of a second component.
26. The method of claim 25, wherein the first component is Cb and / or Cr, and the second component is Y.
27. The method of claim 25, wherein a corresponding block of the second component is derived from a current block of the first component based on a color format.
28. The method of claim 27, wherein the corresponding block covers at least one position (X\ Y’) of the second component which is corresponding to a position (X, Y) of the first component,29. The method of claim 28, wherein the at least one position (X’, Y’’) of the second component is derived from the position (X, Y) of the first component, and80.wherein the derivation of the at least one position (X’, Y’) of the second component depends on color format.
30. The method of claim 29, wherein X’ = n*X and Y’-m*Y.
31. The method of claim 29 or 30, wherein the color format is color format YUV 4:2:0, n = m = 2, or wherein the color format is color format YUV 4:2:2, n = 2, m =1, or n = 1, m = 2, or83.wherein the color format is color format YUV 4:4:4, n m.
32. The method of claim 27, wherein a top-left position of a current residual block is (X0, Y0), a width and height of the current residual block are W and H, respectivelyy, and85.wherein the position (X, Y) is set equal to one of:86.(X0, Y),87.(X0 + W -1, Y0),88.(X0, Y0+H-1), (XO+W-1, YO+H-1), or89.(XO+W / 2 + offX, Y0+H / 2+offY), and90.wherein offX and offY represent offsets, respectivelyy.
33. The method of claim 32, wherein offX is -1 or 0 or 1, and / or92.wherein offY is -1 or 0 or 1.
34. The method of claim 25, wherein the context is determined based on the corresponding block of the second component, and wherein the corresponding block of the second component is denoted as CorrB.
35. The method of claim 34, wherein the context is determined based on at least one of:95.an availability of CorrB,96.a coding mode of CorrB,97.a coded bit flag (CBF) of CorrB,98.a width of CorrB,99.a height of CorrB,100.the number of non-zero coefficients of CorrB,101.a last position of non-zero coefficient in CorrB, or102.a sum of absolute values of non-zero coefficients of CorrB.
36. The method of claim 25, wherein a first context or a first context set is applied if the corresponding residual block satisfies one or more conditions, and a second context or a second context set is applied if the corresponding residual block does not satisfy the one or more conditions.
37. The method of claim 36, wherein in accordance with that the corresponding residual block is coded with a coding mode, the first context or a first context set is applied.
38. The method of claim 37, wherein the coding mode is one of: a palette coding, a transform skip, or block -based delta pulse code modulation (BDPCM).
39. The method of claim 36, wherein in accordance with that the corresponding residual block is coded with all coefficients equal to zero, the first context or a first context set is applied.
40. The method of claim 36, wherein in accordance with that a position of the last non-zero coefficient of the corresponding residual block satisfies a condition, the first context or the first context set is applied, wherein the position of the last non-zero coefficient of the corresponding residual block is represented as (lastX, lastY); and108.wherein in accordance with that a position of the last non-zero coefficient of the corresponding residual block does not satisfy the condition, the second context or the second context set is applied.
41. The method of claim 40, wherein the condition comprises at least one of:109.lastX > Tx || lastY > Ty,110.lastX > Tx && lastY > Ty,111.lastX < Tx || lastY < Ty, or112.lastX < Tx && lastY < Ty, and113.wherein Tx and Ty represent thresholds, respectivelyy.
42. The method of claim 41, wherein Tx depends on at least one of width or height of the corresponding residual block, and / or115.wherein Ty depends on at least one of width or height of the corresponding residual block.
43. The method of claim 42, wherein Tx = (Wc+off)»shift, or117.wherein Ty = (Hc+off)»shift, and118.wherein Wc represents the width of the corresponding residual block, He represents the height of the corresponding residual block, offset is an integer and shift is an integer.
44. The method of claim 43, wherein off ~1, shift = 1, or off ~ 2, shift ~ 2.
45. The method of claim 42, wherein Tx = max(M, (Wc+off)»shift), or121.wherein Ty = max(M, (Hc+off)»shift), and122.wherein Wc represents the width of the corresponding residual block, He represents the height of the corresponding residual block, M is an integer, off represents an offset and shift is an integer.
46. The method of claim 45, wherein M =1.
47. The method of claim 1, wherein the context is determined based on the at least one neighbouring block, the SE indicates a position of a last significant coefficient.
48. The method of claim 47, wherein the SE is one of: last sig coeff x prefix, last sig coeff x suffix, last sig coeff y prefix, or last sig coeff _y suffi.
49. The method of claim 47, wherein a first parameter f(Nei) is derived for a neighbouring block, wherein Nei represents the neighbouring block and f represents a function.
50. The method of claim 49, wherein f(Nei, Q) is derived for the Q-coordinate of the last position of the non zero coefficient, wherein Q = X or Y, f(Nei) refers to f(Nei, X) or f(Nei, Y).
51. The method of claim 49, wherein the first parameters depends on at least one of:an availability’ of the neighbouring block,129.a coding mode of the neighbouring block,130.a CBF of the neighbouring block,131.a width of the neighbouring block,132.a height of the neighbouring block,133.the number of non-zero coefficients of the neighbouring block,134.the last position of non-zero coefficient in neighbouring block, or135.a sum of absolute values of non-zero coefficients of neighbouring block.
52. The method of claim 49, wherein f(Nei) = FO, in accordance with that at least one condition of is satisfied:137.the neighbouring block is not available,138.the neighbouring block is in a region inaccessible,139.the neighbouring block is coded with a first mode,140.the neighbouring block is not coded with a second mode determined by a coding mode of the current block,141.the neighbouring block is coded with coded bit flag being equal to 0,142.a width of the neighbouring block is larger than a fourth threshold,143.the width of the neighbouring block is smaller than a fifth threshold,144.a height of the neighbouring block is larger than a sixth threshold,145.the height of the neighbouring block is smaller than a seventh threshold,146.a size of the neighbouring block is larger than an eighth threshold, or147.the size of the neighbouring block is smaller than a ninth threshold.
53. The method of claim 52, wherein the first mode is at least one of:149.a palette mode,150.an intra block copy (1BC) mode,151.a transform skip mode,152.an inter mode,153.an intra mode, or154.a BDPCM mode.
54. The method of claim 52, wherein the block is intra-coded but the neighbouring block is not intracoded, and / or156.wherein the block is not intra-coded but the neighbouring block is intra-coded.
55. The method of claim 49, wherein f(Nei) = F1 if the last position of the neighbouring block satisfies one or more conditions.
56. The method of claim 55, wherein the one or more conditions comprise at least one of: NJastQ >= Tl and NJastQ < T2,158.NJastQ > T1 and NJastQ <= T2,159.NJastQ >= Tl,160.NJastQ > Tl,161.N JastQ <= T2, or162.is NJastQ < T2, and163.wherein Q is X or Y, (N lastX, N lastY) represents the position of the last significant coefficient of the neighouring block, and Tl and T2 represent thresholds, respectivelyy,7. The method of claim 56, wherein Q is X if the SE represents an X-dimension coordinate of the last position of the non-zero coefficient.
58. The method of claim 57, wherein the SE is one of last_sig_coeff_x_prefix or last sig coeff x suffix.
59. The method of claim 56, wherein Q is Y if the SE represents a Y-dimension coordinate of the last position of the non-zero coefficient.
60. The method of claim 59, wherein the SE is one of last_sig_coeff_y_prefix or last_sig_coeff_y_suffix.
61. The method of claim 56, wherein Tl and T2 depend on at least one of width or height of the neighbouring block.
62. The method of claim 61, wherein Tl and T2 depend on the width of the neighbouring block in accordance with Q = X, or170.wherein Tl and T2 depend on the height if of the neighbouring block in accordance with Q = Y, or wherein Tl or T2 = (Wn+off)»shift, or171.wherein Tl or T2 - (Hn+off)»shift, or172.wherein Tl or T2 = max(M, (Wn+off)»shift), or173.wherein Tl or T2 = max(M, (Hn+off)»shift), and174.wherein Wn represents the width of the neighbouring block, Hn represents the height of the neighbouring block, off represents an offset, and shift is an integer.
63. The method of claim 62, wherein off -1, shift = 1, or176.wherein off - 2, shift - 2, or177.wherein M = 1.
64. The method of claim 49, wherein f(Nei) = Fl, in accordance with N JastQ >= max( 1, Wn»2) && NJastQ < max(2, Wn»l) for Q = X, or NJastQ >= max(l, Hn»2) && NJastQ < max(2, Hn»l) for Q = Y,wherein (N lastQ, NJastQ) represents the position of the last significant coefficient of the neighouring block, Wn represents the width of the neighbouring block, and Hn represents the height of the neighbouring block.
65. The method of claim 49, wherein f(Nei)- F2, if f(Nei) is not equal to either FO or Fl.
66. The method of any of claims 55-65, wherein FO = 0, Fl = 1 and Fl = 2.
67. The method of claim 47, wherein at least two neighbouring blocks are used to derive the context, or wherein one neighbouring block is used to derive the context.
68. The method of claim 67, wherein an index of the context is derived as:183.C=f(NeiA) + f(NeiB), or184.C=f(NeiA) | f(NeiB), or185.C=f(NeiA) & f(NeiB), and186.wherein C represents the index of the context, Nei represents one of the at least two neighbouring blocks, NeiB represents another one of the at least two neighbouring blocks, f represents a function.
69. The method of claim 67, wherein an index of the context if derived as:188.C=f(NeiA), or189.C=f(NeiB), and190.wherein C represents the index of the context, Nei represents one of the at least two neighbouring blocks, NeiB represents another one of the at least two neighbouring blocks, f represents a function.
70. The method of claim 67, wherein the at least two neighbouring blocks are checked in order.
71. The method of claim 70, wherein in accordance with that a first neighbouring block satisfies one or more conditions, the second neighbouring block is checked followingly, or193.wherein in accordance with that the first neighbouring block does not satisfy one or more conditions, the context may be derived based on the first neighbouring block.
72. The method of claim 71, wherein the one or more conditions comprise at least one of:195.the neighbouring block is not available,196.the neighbouring block is in a region inaccessible,197.the neighbouring block is coded with a mode, or198.the neighbouring block is coded with coded bit flag being equal to 0.
73. The method of claim 72, wherein the mode comprises at least one of:200.a palette mode. an IBC mode,201.a transform skip mode,202.an inter mode,203.an intra mode, or204.a BDPCM mode.
74. The method of claim 70, wherein a first neighbouring block of the at least two neighbouring blocks is checked before a second neighbouring block of the at least two neighbouring blocks, in accordance with that the SE represents an X-dimension coordinate of the last position of the non-zero coefficient, or206.wherein a second neighbouring block of the at least two neighbouring blocks is checked before the first neighbouring block of the at least two neighbouring blocks, in accordance with that the SE represents the X-dimension coordinate of the last position of the non-zero coefficient.
75. The method of claim 74, wherein the SE is last_sig_coeff_x_prefix or last sig coeff x suffix.
76. The method of claim 70, wherein a second neighbouring block of the at least two neighbouring blocks is checked before a first neighbouring block of the at least two neighbouring blocks, in accordance with that the SE represents a Y-dimension coordinate of the last position of the non-zero coefficient, or209.wherein the first neighbouring block of the at least two neighbouring blocks is checked before the second neighbouring block of the at least two neighbouring blocks, in accordance with that the SE represents the Y-dimension coordinate of the last position of the non-zero coefficient.
77. The method of claim 76, wherein the SE is last sig coeff y prefix or last sig coeff y. suffix.
78. The method of claim 67, wherein a first neighbouring block of the at least two neighbouring blocks is a top neighbouring block, and a second neighbouring block of the at least two neighbouring blocks is a neighbouring block.
79. The method of claim 78, wherein a position in the first neighbouring block is above a block, and / or wherein a position in the second neighbouring block is left to the block.
80. The method of claim 67, wherein the neighbouring block is color component dependent.
81. The method of claim 1, wherein the context is determined based on at least one bin, and the at least one bin is coded with the context.
82. The method of claim 81, wherein the at least one bin is a first bin.
83. The method of claim 81, wherein each bin is coded with the context.
84. The method of claim 81, wherein two bins are coded with two different contexts.
85. The method of claim 81, wherein two bins share a same context.
86. The method of claim 1, wherein the at least one binarized bin of the SE for residual coding is coded with the context that is determined by the coding mode.
87. The method of claim 1, wherein whether to and / or how to apply a derivation of the context depends on the coding information.
88. The method of claim 87, wherein the derivation of the context is applied to one or more color components.
89. The method of claim 87, wherein the derivation of the context is applied in accordance with that a target coding mode is used, or222.wherein the derivation of the context is applied in accordance with that the target coding mode is not used.
90. The method of claim 89, wherein the target coding mode comprises one of: an intra sub-partition (ISP) mode, a block-based delta pulse code modulation (BDPCM), an intra block copy (IBC) mode, a geometric partitioning mode (GPM), a spatial geometric partitioning mode (SGPM), a cross-component linear model (CCLM), a convolutional cross-component model (CCCM), or an affine mode.
91. The method of claim 87, wherein the derivation of the context is applied in accordance with that at least one of a width or height of the block satisfies one or more conditions.
92. The method of claim 1, wherein a binarization and / or interpretation of the SE for residual coding is determined based on the at least one neighbouring block,93. The method of claim 92, wherein the SE indicates a position of a last significant coefficient.
94. The method of claim 93, wherein the SE is one of: last_sig_coeff_x_prefix, last sig coeff x suffix, last_sig_coeff_y_prefix, last_sig_coeff_y_suffix.228.95, The method of claim 92, wherein a parameter is derived for the at least one neighbouring block.
96. The method of claim 95, wherein f(Nei, Q) is derived for the Q-coordinate of the last position of the non-zero coefficient, wherein Q = X or Y, f represents a function, Nei represents the at least one neighbouring block, and f(Nei) refers to f(Nei, X) or f(Nei, Y).
97. The method of claim 95, wherein the parameter depends on at least one of:230.an availability of the at least one neighbouring block,231.a coding mode of the at least one neighbouring block,232.a CBF of the at least one neighbouring block,233.a width and / or height of the at least one neighbouring block,234.the number of non-zero coefficients of the at least one neighbouring block,235.the last position of non-zero coefficient in the at least one neighbouring block, or236.a sum of absolute values of non-zero coefficients of the at least one neighbouring block.
98. The method of claim 95, wherein f(Nei) = FO, in accordance with at least one of the following conditions is satisfied:238.the at least one neighbouring block is not available,239.the at least one neighbouring block is in a region inaccessible,240.the at least one neighbouring block is coded with a third mode,241.the at least one neighbouring block is not coded with a fourth mode determined by the coding mode of the block,242.the at least one neighbouring block is coded with coded bit flag being equal to 0,243.a width of the at least one neighbouring block,244.a width of the at least one neighbouring block is larger than a tenth threshold,245.the width of the at least one neighbouring block is smaller than an eleventh threshold,246.a height of the at least one neighbouring block is larger than a twelfth threshold,247.the height of the at least one neighbouring block is smaller than a thirteenth threshold,248.the width of the at least one neighbouring block is not equal to the block,249.the height of the at least one neighbouring block is not equal to the block, or250.a size of the at least one neighbouring block is larger than a fourteenth threshold, or251.the size of the at least one neighbouring block is smaller than a fifteenth threshold, and252.wherein f represents a function, and Nei represents the at least one neighbouring block.
99. The method of claim 98, wherein the third mode comprises at least one of: a palette mode, an IBC mode, a transform skip mode, an inter mode, an intra mode, or a BDPCM mode, and / or254.wherein the block is intra-coded but the at least one neighbouring block is not intra-coded, or wherein the block is not intra-coded but the at least one neighbouring block is intra-coded, and / or wherein in accordance with Q=X, the width of the at least one neighbouring block is not equal to the block, and / or wherein in accordance with Q=Y, the height of the at least one neighbouring block is not equal to the block.
100. The method of claim 95, wherein f(Nei) = F0, in accordance with the last position of the at least one neighbouring block satisfies one or more conditions.
101. The method of claim 100, wherein the one or more conditions comprise at least one of:257.NJastQ >= T1 and NJastQ < T2,258.NJastQ > Tl and NJastQ <= T2,259.NJastQ >- Tl,260.NJastQ > Tl,261.NJastQ<;;;T2, or262.is NJastQ < T2, and263.wherein Q is X or Y, (N JastX, N JastY) represents the position of the last significant coefficient of the at least one neighouring block, and Tl and T2 represent thresholds, respectivelyy.
102. The method of claim 101, wherein Q is X if the SE represents an X-dimension coordinate of the last position of the non-zero coefficient.
103. The method of claim 102, wherein the SE is one of last_sig_coeff_x_prefix or last sig coeff x suffix.
104. The method of claim 101, wherein Q is Y if the SE represents a Y-dimension coordinate of the last position of the non-zero coefficient.
105. The method of claim 104, wherein the SE is one of last_sig_coeff_y_prefix or last_sig_coeff_y_suffix.268.106, The method of claim 101, wherein Tl and T2 depend on at least one of width or height of the at least one neighbouring block.
107. The method of claim 106, wherein Tl and T2 depend on the width of the at least one neighbouring block in accordance with Q = X, or270.wherein Tl and T2 depend on the height if of the at least one neighbouring block in accordance with Q = Y, or271.wherein Tl or T2 = (Wn+off)»shift, or272.wherein Tl or T2 = (Hn+off)»shift, or273.wherein Tl or T2 = max(M, (Wn+off)»shift), or274.wherein Tl or T2 = max(M, (Hn+off)»shift), or wherein Tl or T2 =Wn -( (Wn+off)»shift), or275.wherein Tl or T2 = Hn - ((Hn+off)»shift), or276.wherein Tl or T2 = Wn - max(M, (Wn+off)»shift), or277.wherein Tl or T2 = Hn - (max(M, (Hn+off)»shift)), or278.wherein Tl or T2 = K*((Wn+off)»shift), or279.wherein Tl or T2 =K*( (Hn+off)»shift), or280.wherein Tl or T2 = max(M, K*((Wn+off)»shift)), or281.wherein Tl or T2 = max(M, K*((Hn+off)»shift)), and282.wherein Wn represents the width of the at least one neighbouring block, Hn represents the height of the at least one neighbouring block, off represents an offset, and shift is an integer.
108. The method of claim 107, wherein off =1, shift = 1, or284.wherein off = 2, shift = 2, or285.wherein off =0, shift = 3, or286.wherein off = 0, shift = 2, or287.wherein M = 1, or288.wherein K is an integer.
109. The method of claim 95, wherein f(Nei) = Fl, in accordance with N_lastQ < Wn - (Wn»3) for Q = X or N lastQ < Hn - (Hn»3) for Q = Y,290.wherein (N lastQ, N lastQ) represents the position of the last significant coefficient of the at least one neighouring block, Wn represents the width of the at least one neighbouring block, and Hn represents the height of the at least one neighbouring block.
110. The method of claim 95, wherein f(Nei) = Fl, if f(Nei) is not equal to F0.
111. The method of any of claims 95-110, wherein F0 = 0, and F 1 = 1.
112. The method of claim 92, wherein at least two neighbouring blocks are used in at least one binarization or interpretation, or294.wherein one neighbouring block is used in at least one binarization or interpretation.
113. The method of claim 112, wherein the at least two neighbouring blocks are checked in order.
114. The method of claim 113, wherein in accordance with that a first neighbouring block satisfies one or more conditions, the second neighbouring block is checked followingly, or297.wherein in accordance with that the first neighbouring block does not satisfy one or more conditions, the context may be derived based on the first neighbouring block.
115. The method of claim 114, wherein the one or more conditions comprise at least one of:298.the neighbouring block is not available,299.the neighbouring block is in a region inaccessible,300.the neighbouring block is coded with a mode,301.the neighbouring block is coded with coded bit flag being equal to 0, or302.the neighbouring block is not coded with another mode determined based on a coding mode of the block.
116. The method of claim 115, wherein the mode comprises at least one of: a palette mode, an IBC mode, a transform skip mode, an inter mode, an intra mode, or a BDPCM mode, or304.wherein the block is intra-coded but the neighbouring block is not intra-coded, or305.wherein the block is not intra-coded but the neighbouring block is intra-coded.
117. The method of claim 112, wherein a first neighbouring block of the at least two neighbouring blocks is checked before a second neighbouring block of the at least two neighbouring blocks, in accordance with that the SE represents an X-dimension coordinate of the last position of the non-zero coefficient, or307.wherein a second neighbouring block of the at least two neighbouring blocks is checked before the first neighbouring block of the at least two neighbouring blocks, in accordance with that the SE represents the X-dimension coordinate of the last position of the non-zero coefficient.
118. The method of claim 117, wherein the SE is last_sig_coeff_x_prefix or last sig coeff x suffix.
119. The method of claim 112, wherein a second neighbouring block of the at least two neighbouring blocks is checked before a first neighbouring block of the at least two neighbouring blocks, in accordance with that the SE represents a Y-dimension coordinate of the last position of the non-zero coefficient, or wherein the first neighbouring block of the at least two neighbouring blocks is checked before the second neighbouring block of the at least two neighbouring blocks, in accordance with that the SE represents the Y -dimension coordinate of the last position of the non-zero coefficient.
120. ’The method of claim 119, wherein the SE is last sig __coeff_y_prefix or last_sig_coeff_y_suffix.
121. The method of claim 112, wherein a first neighbouring block of the at least two neighbouring blocks is selected, in accordance with that the SE represents an X-dimension coordinate of the last position of the non-zero coefficient, or wherein a second neighbouring block of the at least two neighbouring blocks is selected, in accordance with that the SE represents an X-dimension coordinate of the last position of the non-zero coefficient.
122. The method of claim 121, wherein the SE is last_sig_coeff_x_prefix or last_sig_coeff_x_suffix.
123. The method of claim 112, wherein a second neighbouring block of the at least two neighbouring blocks is selected, in accordance with that the SE represents a Y-dimension coordinate of the last position of the non-zero coefficient, or313.wherein a first neighbouring block of the at least two neighbouring blocks is selected, in accordance with that the SE represents a Y -dimension coordinate of the last position of the non-zero coefficient.
124. The method of claim 123, wherein the SE is last_sig_coeff_y_prefix or last_sig_coeff_y_suffix.
125. The method of claim 112, wherein a first neighbouring block of the at least two neighbouring blocks is a top neighbouring block, and a second neighbouring block of the at least two neighbouring blocks is a neighbouring block.
126. The method of claim 125, wherein a position in the first neighbouring block is above the block, and / or317.wherein a position in the second neighbouring block is left to the block.
127. The method of claim 92, wherein the SE is interpreted in different ways depending on f(Nei), wherein Nei represents the neighbouring block, and f represents a function.
128. The method of claim 127, wherein a decoded position of a last non-zero coefficient (last_pos_x\ last_pos_y’) is interpreted as (iasi pos x. last_pos_y) in different ways depending on f(Nei), wherein (last_pos__x, last_pos_y) represents the last non-zero coefficient, and (last_pos_x’, last_pos_y’) represents the decoded position of the last non-zero coefficient.
129. The method of claim 128, wherein last_pos_x = kist pos x’. in accordance with f(Nei, X) = FO, or wherein lastjpos_y last__pos_y’ in accordance with f(Nei, Y) FO, or321.wherein last_pos_x = M[last_pos_x’J in accordance with f(Nei, X) = Fl, or322.wherein last_pos_y = M[last_pos_y’] in accordance with f(Nei, Y) = Fl.
130. The method of claim 129, wherein F0 =0 and / or F1 =1.
131. The method of any of claims 127-130, wherein a mapping table M[k’] maps a decoded value to an interpreted value which is used in a following procedure.
132. The method of claim 131, wherein the mapping table depends on a neighbouring residual block.
133. The method of claim 132, wherein for last_pos_q, M is constructed as M[0] = Lq, M[1] = Lq -1, M[2] = Lq+1, M[3] = Lq-2, M[4]=Lq+2,.... wherein q = x or y.
134. The method of claim 133, wherein suppose size q is equal to a width of the block, if q == x and a height of the block if q == y, the construction procedure comprises:327.setting M[0] = Lq;328.setting a variable Abs equal to 1 and a variable Idx equal to 1;329.if Lq-abs >= 0, seting M[Idx++] = Lq-abs;330.if Lq+abs < Sizc q. setting M[ldx++] = Lq+abs;331.Abs++; and332.if Idx >= Size_q, terminating the procedure, otherwise, go to setting M[Idx++] = Lq-abs if Lq-abs >= 0.
135. The method of claim 92, wherein the neighbouring block is color component dependent.
136. The method of any of claims 92-135, wherein whether to and / or how to apply the determination of the binarization and / or interpretation of the SE for residual coding based on the at least one neighbouring block depend on color format / color component.
137. The method of claim 136, wherein the determination of the binarization and / or interpretation of the SE for residual coding based on the at least one neighbouring block is applied to a first component but not be applied to a second component.
138. The method of claim 1, wherein a residual SE is coded in a predictive way.
139. The method of claim 138, wherein S-S’ is coded, wherein S represents the residual SE, and S' represents a residual SE in a previously residual block.
140. The method of claim 138, wherein S-f(S’) is coded, wherein S represents the residual SE, S’ represents a residual SE in a previously residual block, and f represents a function.
141. The method of claim 140, wherein f(S’)= a*S’+b, wherein a and b are parameters.
142. The method of claim 138, wherein a set of residual SEs is copied from a set of residual SEs in a previously residual block.
143. The method of claim 142, wherein an index is coded to indicate the set of residual SEs in a previously residual block.
144. The method of claim 138, wherein a set of residual SEs is predicted by a set of residual SEs in a previously residual block.
145. The method of claim 144, wherein difference between the set of residual SEs and the prediction of the set of residual SEs is signalled.
146. The method of claim 138, wherein whether a set of residual SEs is copied from or predicted by a set of residual SEs in a previously residual block is signaled.
147. The method of any of claims 1-146, wherein the SE: is binarized as one of: a flag, a fixed length code, an exponential-Golomb (EG(x)) code, a unary code, a truncated unary code, or a truncated binary’ code.
148. The method of claim 147, wherein the binarized SE is signed or unsigned.
149. The method of any of claims 1-146, wherein the SE representing a coding tool or a coding approach is determined to be unused without being signalled, if the coding tool or the coding approach is not applicable or not capable of being used,150. The method of any of claims 1-146, wherein the SE is coded with at least one context model, or wherein the SE is bypass coded.
151. The method of any of claims 1-146, wherein the SE is signaled.
152. The method of claim 151, wherein the SE is signaled if a corresponding function is applicable.
153. The method of claim 151, wherein the SE is signaled if a dimension of the block satisfies a condition.
154. The method of any of claims 1-146, wherein the SE is signaled at one of the followings:352.a block level,353.a sequence level,354.a group of pictures level,355.a picture level,356.a slice level, or357.a tile group level.
155. The method of claim 154, wherein the SE is signaled in a coding structure of one of the followings: a coding tree unit (CTU),359.a coding unit (CU),360.a transform unit (TU),361.a prediction unit (PU),362.a coding tree block (CTB),363.a coding block (CB), a prediction block (PB), or364.a transform block (TB).
156. The method of claim 154, wherein the SE is signaled in one of the followings:366.a sequence header,367.a picture header,368.a sequence parameter set (SPS),369.a video parameter set (VPS),370.a decoding parameter set (DPS),371.decoding capability information (DCI),372.a picture parameter set (PPS),373.an adaptation parameter set (APS),374.a slice header, or375.a tile group header.
157. The method of any of claims 1-146, wherein whether to and / or how to determine the least one binarized bin of the SE is signaled at one of the following:377.a block level,378.a sequence level,379.a group of pictures level,380.a picture level,381.a slice level, or382.a tile group level.
158. The method of claim 157, wherein whether to and / or how to determine the least one binarized bin of the SE is signaled in one of the following:384.a coding tree unit (CTU),385.a coding unit (CU),386.a transform unit (TU),387.a prediction unit (PU),388.a coding tree block (CTB),389.a coding block (CB),390.a prediction block (PB), or391.a transform block (TB).
159. The method of claim 157, wherein whether to and / or how to determine the least one binarized bin of the SE is signaled in one of the followings:393.a sequence header,394.a picture header, a sequence parameter set (SPS),395.a video parameter set (VPS),396.a decoding parameter set (DPS),397.decoding capability information (DCI), a picture parameter set (PPS), an adaptation parameter set (APS), a slice header, or398.a tile group header.
160. The method of any of claims 1-146, further comprising:400.determining, based on coded information of the block of the video, whether to and / or how to determine the least one binarized bin of the SE, the coded information comprising at least one of401.a block size,402.a colour format,403.a single and / or dual tree partitioning,404.a colour component,405.a slice type, or406.a picture type.
161. The method of any of claims 1-146, wherein the determination of the least one binarized bin of the SE is applied in a coding tool which requires a chroma fusion.
162. The method of any of claims 1-146, wherein the context comprises a context model for coding or parsing the SE in an arithmetic coding.
163. The method of any of claims 1-161, wherein the conversion includes encoding the block into the bitstream.
164. The method of any of claims 1-161, wherein the conversion includes decoding the block from the bitstream.
165. An apparatus for video processing comprising a processor and a non-transitory memory with instructions thereon, wherein the instructions upon execution by the processor, cause the processor to perform a method in accordance with any of claims 1-164.
166. A non-transitory computer-readable storage medium storing instructions that cause a processor to perform a method in accordance with any of claims 1-164.
167. A non -transitory computer-readable recording medium storing a bitstream of a video which is generated by a method performed by an apparatus for video processing, wherein the method comprises:413.determining that at least one binarized bin of a syntax element (SE) for residual coding associated with a block of the video is coded with a context, wherein the context is determined based on at least one of: coding information, a plurality of factors, a position of the SE in a residual block, a size of the residual block, at least one corresponding block of a second component, at least one neighbouring block, or a bin index; and generating the bitstream based on the at least one binarized bin of the SE.
168. A method for storing a bitstream of a video, comprising:415.determining that at least one binarized bin of a syntax element (SE) for residual coding associated with a block of the video is coded with a context, wherein the context is determined based on at least one of: coding information, a plurality of factors, a position of the SE in a residual block, a size of the residual block, at least one corresponding block of a second component, at least one neighbouring block, or a bin index;416.generating the bitstream based on the at least one binarized bin of the SE; and417.storing the bitstream in a non-transitory computer-readable recording medium.