Resolution-based vector difference coding context selection

Through the resolution-based vector difference coding method, combined with intra-frame and inter-frame prediction and transform quantization technology, the problem of low efficiency in removing redundant information in video coding is solved, and more efficient storage and transmission efficiency is achieved.

CN120752912APending Publication Date: 2025-10-03OFINNO LLC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202380093660.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2023-04-06
Filing Date
2023-12-11
Publication Date
2025-10-03

AI Technical Summary

Technical Problem

Existing video coding technologies have the problem of low efficiency in removing redundant information when processing video sequences, resulting in low storage and transmission efficiency.

Method used

A resolution-based vector difference coding method is adopted. By performing intra-frame and inter-frame prediction on the video sequence, combined with transformation and quantization techniques, entropy coding is used to reduce redundant information, and quadtree + multi-type tree partitioning is used to improve coding efficiency.

Benefits of technology

It improves the storage and transmission efficiency of video encoding, reduces the data volume of the bit stream, and maintains the video quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120752912A_ABST
    Figure CN120752912A_ABST
Patent Text Reader

Abstract

The decoder receives, in a bitstream, a first indication of a resolution of a vector difference for a current block. The decoder selects a probability model from a plurality of probability models based on the first indication and a position of an amplitude symbol of the vector difference to be decoded. The decoder arithmetically decodes, based on the probability model, a second indication of whether the amplitude symbol of the vector difference is equal to a corresponding amplitude symbol of a vector difference predictor. The decoder determines a value of the magnitude symbol of the vector difference based on the second indication and a value of the corresponding magnitude symbol of the vector difference predictor. The decoder decodes the current block based on the determined value of the magnitude symbol of the vector difference.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS

[0002] This application claims the benefit of U.S. Provisional Application No. 63 / 431,619, filed December 9, 2022, U.S. Provisional Application No. 63 / 453,698, filed March 21, 2023, and U.S. Provisional Application No. 63 / 457,693, filed April 6, 2023, all of which are hereby incorporated by reference in their entirety. BRIEF DESCRIPTION OF THE DRAWINGS

[0003] Examples of several of the various embodiments of the present disclosure are described herein with reference to the accompanying drawings.

[0004] Figure 1 An exemplary video encoding / decoding system is shown in which embodiments of the present disclosure may be implemented.

[0005] Figure 2 An exemplary encoder is shown in which embodiments of the present disclosure may be implemented.

[0006] Figure 3 An exemplary decoder is shown in which embodiments of the present disclosure may be implemented.

[0007] Figure 4 An example quadtree partitioning of a coding tree block (CTB) according to an embodiment of the present disclosure is shown.

[0008] Figure 5 The embodiment according to the present disclosure is shown Figure 4 The corresponding quadtree of the example quadtree partitioning of the CTB in .

[0009] Figure 6 Example binary and ternary tree partitioning according to embodiments of the present disclosure are shown.

[0010] Figure 7 An example quadtree+multi-type tree partitioning of a CTB according to an embodiment of the present disclosure is shown.

[0011] Figure 8 The embodiment according to the present disclosure is shown Figure 7 The corresponding quadtree + multi-type tree of the example quadtree + multi-type tree partition of the CTB in.

[0012] Figure 9 An example set of reference samples determined for intra prediction of a current block being encoded or decoded according to an embodiment of the present disclosure is shown.

[0013] Figure 10A 35 intra prediction modes supported by HEVC according to an embodiment of the present disclosure are shown.

[0014] Figure 10B 67 intra prediction modes supported by HEVC according to an embodiment of the present disclosure are shown.

[0015] Figure 11 shows a two-dimensional x, y plane from an embodiment of the present disclosure Figure 9 The current block and reference samples.

[0016] Figure 12 The embodiment of the present disclosure is shown Figure 9 Example angular mode prediction for the current block.

[0017] Figure 13A An example of inter-frame prediction performed on a current block being encoded in a current picture according to an embodiment of the present disclosure is shown.

[0018] Figure 13B Example horizontal and vertical components of a motion vector according to an embodiment of the present disclosure are shown.

[0019] Figure 14 An example of bidirectional prediction performed on a current block according to an embodiment of the present disclosure is shown.

[0020] Figure 15A Shown are example positions of five spatial candidate neighboring blocks relative to the current block being encoded according to an embodiment of the present disclosure.

[0021] Figure 15B Shown are example positions of two temporally co-located blocks relative to a current block being encoded, according to an embodiment of the present disclosure.

[0022] Figure 16 An example of IBC applied to screen content according to an embodiment of the present disclosure is shown.

[0023] Figure 17 An example implementation of a Context-Based Adaptive Binary Arithmetic Coding (CABAC) encoder according to an embodiment of the present disclosure is shown.

[0024] Figure 18A An example of an IBC according to an embodiment of the present disclosure is shown.

[0025] Figure 18B Example BVD candidates for entropy encoding the magnitude sign of the BVD according to an embodiment of the present disclosure are shown.

[0026] Figure 18C An example of entropy encoding an indication of whether a value of a magnitude sign of a BVD matches a value of a magnitude sign of a BVD candidate used as a predictor of the BVD according to an embodiment of the present disclosure is shown.

[0027] Figure 18D An example of entropy decoding an indication of whether the value of the magnitude sign of the BVD matches the value of the magnitude sign of the BVD candidate used as a predictor of the BVD and using the indication to determine the magnitude sign of the BVD according to an embodiment of the present disclosure is shown.

[0028] Figure 19 An example IBC encoding according to an embodiment of the present disclosure is shown.

[0029] Figure 20 An example of a signaling BVD component according to an embodiment of the present disclosure is shown.

[0030] Figure 21 An example coding order of binary numbers and corresponding syntax elements for signaling BVD or MVD according to an embodiment of the present disclosure is shown.

[0031] Figure 22 An example of signaling a binary number and a corresponding syntax element of BVD or MVD according to an embodiment of the present disclosure is shown.

[0032] Figure 23 An example of signaling a binary number and a corresponding syntax element of BVD or MVD based on an IMV flag value according to an embodiment of the present disclosure is shown.

[0033] Figure 24 An example of deriving a context / probability model based on a threshold and a position value according to an embodiment of the present disclosure is shown.

[0034] Figure 25 A flow chart of a method for selecting a probability model based on a first indication of a resolution of a block vector difference (BVD) and a position of a magnitude sign of a BVD to be decoded according to an embodiment of the present disclosure is shown.

[0035] Figure 26 A flowchart of a method for selecting a probability model based on a first indication of a resolution of a block vector difference (BVD) and a position of a magnitude sign of the BVD to be encoded according to an embodiment of the present disclosure is shown.

[0036] Figure 27 A flowchart of a method for selecting a probability model for entropy encoding symbols of a vector difference based on an indication that the resolution of the vector difference is absent (eg, not explicitly signaled) according to an embodiment of the present disclosure is shown.

[0037] Figure 28 A block diagram is shown of an example computer system in which embodiments of the present disclosure may be implemented. DETAILED DESCRIPTION

[0038] In the following description, numerous specific details are set forth to provide a comprehensive understanding of the present disclosure. However, it will be apparent to those skilled in the art that the present disclosure, including structures, systems, and methods, can be practiced without these specific details. The descriptions and representations herein are a common means for those skilled in the art to most effectively convey the substance of their work to others skilled in the art. In other instances, well-known methods, procedures, components, and circuits are not described in detail to avoid unnecessarily obscuring aspects of the present disclosure.

[0039] References in this specification to "one embodiment," "an embodiment," "an example embodiment," etc., indicate that the described embodiment may include a particular feature, structure, or characteristic, but not every embodiment must include that particular feature, structure, or characteristic. Furthermore, these phrases do not necessarily refer to the same embodiment. Furthermore, when a particular feature, structure, or characteristic is described in conjunction with an embodiment, it is considered within the knowledge of those skilled in the art to be able to affect such feature, structure, or characteristic in conjunction with other embodiments, whether or not explicitly described.

[0040] Also note that various embodiments may be described as processes depicted as flowcharts, flow diagrams, data flow diagrams, structure diagrams, or block diagrams. Although a flowchart may describe operations as a sequential process, many of these operations may be performed in parallel or simultaneously. Furthermore, the order of the operations may be rearranged. When the operations of a process are completed, the process is terminated, but there may be additional steps not included in the diagram. A process may correspond to a method, function, procedure, subroutine, subprogram, etc. When a process corresponds to a function, the termination of the process may correspond to the function returning to the calling function or main function.

[0041] The term "computer-readable medium" includes, but is not limited to, portable or non-portable storage devices, optical storage devices, and various other media capable of storing, containing, or carrying instructions and / or data. Computer-readable media may include non-transient media in which data can be stored and does not include carrier waves and / or transient electronic signals transmitted via wireless or wired connections. Examples of non-transient media may include, but are not limited to, disks or tapes, optical storage media such as compact discs (CDs) or digital versatile discs (DVDs), flash memory, memory, or memory devices. Computer-readable media may store code and / or machine-executable instructions thereon, which may represent any combination of procedures, functions, subroutines, programs, routines, subroutines, modules, software packages, classes, or instructions, data structures, or program statements. A code segment may be coupled to another code segment or hardware circuit by passing and / or receiving information, data, independent variables, parameters, or memory contents. Information, independent variables, parameters, data, etc. may be passed, forwarded, or transmitted via any suitable means (including memory sharing, message passing, token passing, network transmission, etc.).

[0042] Furthermore, embodiments may be implemented by hardware, software, firmware, middleware, microcode, hardware description languages, or any combination thereof. When implemented in software, firmware, middleware, or microcode, program code or code segments (e.g., computer program products) that perform the necessary tasks may be stored in a computer-readable or machine-readable medium. A processor may perform the necessary tasks.

[0043] Representing a video sequence in digital form may require a large number of bits. In many applications, the data size of the video sequence in digital form may be too large for storage and / or transmission. Video encoding can be used to compress the size of the video sequence to provide more efficient storage and / or transmission. Video decoding can be used to decompress the compressed video sequence for display and / or other forms of consumption.

[0044] Figure 1 An exemplary video encoding / decoding system 100 is shown in which embodiments of the present disclosure may be implemented. Video encoding / decoding system 100 includes a source device 102, a transmission medium 104, and a target device 106. Source device 102 encodes a video sequence 108 into a bitstream 110 for more efficient storage and / or transmission. Source device 102 may store bitstream 110 and / or transmit bitstream 110 to target device 106 via transmission medium 104. Target device 106 decodes bitstream 110 to display video sequence 108. Target device 106 may receive bitstream 110 from source device 102 via transmission medium 104. Source device 102 and target device 106 may be any of a variety of different devices, including desktop computers, laptop computers, tablet computers, smartphones, wearable devices, televisions, cameras, video game consoles, set-top boxes, or video streaming devices.

[0045] To encode the video sequence 108 into a bitstream 110, the source device 102 may include a video source 112, an encoder 114, and an output interface 116. The video source 112 may provide or generate the video sequence 108 based on the capture of natural scenes and / or synthetically generated scenes. A synthetically generated scene may be a scene that includes computer-generated graphics or screen content. The video source 112 may include a video capture device (e.g., a camera), a video archive that includes previously captured natural scenes and / or synthetically generated scenes, a video feed interface for receiving the captured natural scenes and / or synthetically generated scenes from a video content provider, and / or a processor for generating a synthetic scene.

[0046] like Figure 1As shown, a video sequence such as video sequence 108 may include a series of pictures (also referred to as frames). When the pictures of a video sequence are presented consecutively using a constant or variable time interval, the video sequence can achieve the impression of motion. A picture may include one or more sample arrays of intensity values. Intensity values ​​may be acquired at a series of regularly spaced locations within the picture. A color picture typically includes a luma sample array and two chroma sample arrays. The luma sample array may include intensity values ​​representing the luma (or luma component Y) of the picture. The chroma sample array may include intensity values ​​representing the blue and red components (or chroma components Cb and Cr), respectively, of the picture, separated from the luma. Other color picture sample arrays are also possible based on different color schemes (e.g., the RGB color scheme). For a color picture, a pixel may refer to all three intensity values ​​for a given position in the three sample arrays used to represent the color picture. A monochrome picture includes a single luma sample array. For a monochrome picture, a pixel may refer to the intensity value at a given position in the single luma sample array used to represent the monochrome picture.

[0047] The encoder 114 may encode the video sequence 108 into a bitstream 110. To encode the video sequence 108, the encoder 114 may apply one or more prediction techniques to reduce redundant information in the video sequence 108. Redundant information is information that can be predicted at the decoder and, therefore, may not need to be transmitted to the decoder to accurately decode the video sequence. For example, the encoder 114 may apply spatial prediction (e.g., intra-frame prediction or intra prediction), temporal prediction (e.g., inter-frame prediction or inter prediction), inter-layer prediction, and / or other prediction techniques to reduce redundant information in the video sequence 108. Before applying one or more prediction techniques, the encoder 114 may divide the pictures of the video sequence 108 into rectangular regions called blocks. The encoder 114 may then encode the blocks using one or more of the prediction techniques.

[0048] For temporal prediction, the encoder 114 may search for a block similar to the block being encoded in another picture of the video sequence 108 (also referred to as a reference picture). The block determined during the search (also referred to as a prediction block) may then be used to predict the block being encoded. For spatial prediction, the encoder 114 may form a prediction block based on data from reconstructed neighboring samples of the block to be encoded within the same picture of the video sequence 108. Reconstructed samples refer to samples that are encoded and then decoded. The encoder 114 may determine a prediction error (also referred to as a residual) based on the difference between the block being encoded and the prediction block. The prediction error may represent non-redundant information that may be transmitted to a decoder for accurate decoding of the video sequence.

[0049] The encoder 114 may apply a transform (e.g., a discrete cosine transform (DCT)) to the prediction error to generate transform coefficients. The encoder 114 may form a bitstream 110 based on the transform coefficients and other information used to determine the prediction block (e.g., prediction type, motion vector, and prediction mode). In some examples, the encoder 114 may perform one or more of quantization and entropy encoding on the transform coefficients and / or other information used to determine the prediction block before forming the bitstream 110 to further reduce the number of bits required to store and / or transmit the video sequence 108.

[0050] The output interface 116 may be configured to write and / or store the bitstream 110 onto the transmission medium 104 for transmission to the target device 106. Additionally or alternatively, the output interface 116 may be configured to transmit, upload, and / or stream the bitstream 110 to the target device 106 via the transmission medium 104. The output interface 116 may include a wired and / or wireless transmitter configured to transmit, upload, and / or stream the bitstream 110 according to one or more proprietary and / or standardized communication protocols, such as the Digital Video Broadcasting (DVB) standard, the Advanced Television Systems Committee (ATSC) standard, the Integrated Services Digital Broadcasting (ISDB) standard, the Data over Cable Service Interface Specification (DOCSIS) standard, the Third Generation Partnership Project (3GPP) standard, the Institute of Electrical and Electronics Engineers (IEEE) standard, the Internet Protocol (IP) standard, and the Wireless Application Protocol (WAP) standard.

[0051] The transmission medium 104 may include wireless, wired, and / or computer-readable media. For example, the transmission medium 104 may include one or more wires, cables, air interfaces, optical disks, flash memory, and / or magnetic storage. Additionally or alternatively, the transmission medium 104 may include one or more networks (e.g., the Internet) or file servers configured to store and / or transmit the encoded video data.

[0052] To decode the bitstream 110 into the video sequence 108 for display, the target device 106 may include an input interface 118, a decoder 120, and a video display 122. The input interface 118 may be configured to read the bitstream 110 stored on the transmission medium 104 by the source device 102. Additionally or alternatively, the input interface 118 may be configured to receive, download, and / or stream the bitstream 110 from the source device 102 via the transmission medium 104. The input interface 118 may include a wired and / or wireless receiver configured to receive, download, and / or stream the bitstream 110 according to one or more proprietary and / or standardized communication protocols, such as those mentioned above.

[0053] The decoder 120 can decode the video sequence 108 from the encoded bitstream 110. To decode the video sequence 108, the decoder 120 can generate prediction blocks for pictures of the video sequence 108 in a manner similar to that of the encoder 114 and determine prediction errors for these blocks. The decoder 120 can generate the prediction blocks using the prediction type, prediction mode, and / or motion vectors received in the bitstream 110 and determine the prediction errors using the transform coefficients also received in the bitstream 110. The decoder 120 can determine the prediction errors by weighting the transform basis functions using the transform coefficients. The decoder 120 can combine the prediction blocks and the prediction errors to decode the video sequence 108. In some examples, the decoder 120 can decode a video sequence that approximates the video sequence 108 due to, for example, lossy compression of the video sequence 108 by the encoder 114 and / or errors introduced into the encoded bitstream 110 during transmission to the target device 106.

[0054] Video display 122 may display video sequence 108 to a user. Video display 122 may include a cathode ray tube (CRT) display, a liquid crystal display (LCD), a plasma display, a light emitting diode (LED) display, or any other display device suitable for displaying video sequence 108.

[0055] It should be noted that the video encoding / decoding system 100 is presented by way of example and not limitation. Figure 1 In other examples, video encoding / decoding system 100 may have other components and / or arrangements. For example, video source 112 may be external to source device 102. Similarly, video display 122 may be external to target device 106, or omitted entirely if the video sequence is intended to be consumed by a machine and / or storage device. In another example, source device 102 may further include a video decoder, and target device 106 may include a video encoder. In such an example, source device 102 may be configured to further receive an encoded bitstream from target device 106 to support bidirectional video transmission between the devices.

[0056] exist Figure 1In an example, the encoder 114 and the decoder 120 may operate according to any of a number of proprietary or industry video coding standards. For example, the encoder 114 and the decoder 120 may operate according to one or more of: International Telecommunication Union Telecommunication Standardization Sector (ITU-T) H.263, ITU-T H.264 and Moving Picture Experts Group (MPEG)-4 Visual (also known as Advanced Video Coding (AVC)), ITU-T H.265 and MPEG-H Part 2 (also known as High Efficiency Video Coding (HEVC), ITU-T H.265 and MPEG-I Part 3 (also known as Versatile Video Coding (VVC)), WebM VP8 and VP9 codecs, and AOMedia Video 1 (AV1).

[0057] Figure 2 2 shows an exemplary encoder 200 in which embodiments of the present disclosure may be implemented. The encoder 200 encodes a video sequence 202 into a bitstream 204 for more efficient storage and / or transmission. The encoder 200 may be Figure 1 The encoder 200 may be implemented in the video encoding / decoding system 100 in FIG. 1 , or in any of a variety of different devices, including a desktop computer, a laptop computer, a tablet computer, a smartphone, a wearable device, a television, a camera, a video game console, a set-top box, or a video streaming device. The encoder 200 includes an inter-frame prediction unit 206, an intra-frame prediction unit 208, combiners 210 and 212, a transform and quantization unit (TR+Q) unit 214, an inverse transform and quantization unit (iTR+iQ) 216, an entropy coding unit 218, one or more filters 220, and a buffer 222.

[0058] Encoder 200 may divide the pictures of video sequence 202 into blocks and encode video sequence 202 on a block-by-block basis. Encoder 200 may use an inter-frame prediction unit 206 or an intra-frame prediction unit 208 to perform prediction techniques on the block being encoded. Inter-frame prediction unit 206 may perform inter-frame prediction by searching for blocks similar to the block being encoded in another reconstructed picture (also known as a reference picture) of video sequence 202. A reconstructed picture is a picture that has been encoded and then decoded. The blocks determined during the search (also known as prediction blocks) may then be used to predict the block being encoded to remove redundant information. Inter-frame prediction unit 206 may exploit temporal redundancy or similarity in scene content from picture to picture in video sequence 202 to determine the prediction block. For example, scene content between pictures in video sequence 202 may be similar, except for differences due to motion or affine transformations of screen content over time.

[0059] The intra-frame prediction unit 208 can perform intra-frame prediction by forming a prediction block based on data from reconstructed neighboring samples of a block to be encoded within the same picture of the video sequence 202. Reconstructed samples refer to samples that have been encoded and then decoded. The intra-frame prediction unit 208 can exploit spatial redundancy or similarity in scene content within a picture of the video sequence 202 to determine the prediction block. For example, the texture of a region of scene content in a picture may be similar to the texture in the immediately surrounding area of ​​the region of scene content in the same picture.

[0060] After prediction, combiner 210 may determine a prediction error (also referred to as a residual) based on the difference between the block being coded and the predicted block. The prediction error may represent non-redundant information that may be transmitted to a decoder to accurately decode the video sequence.

[0061] The transform and quantization unit 214 may transform and quantize the prediction error. The transform and quantization unit 214 may transform the prediction error into transform coefficients by applying, for example, a DCT to reduce the relevant information in the prediction error. The transform and quantization unit 214 may quantize the coefficients by mapping the data of the transform coefficients to a set of predefined representative values. The transform and quantization unit 214 may quantize the coefficients to reduce irrelevant information in the bitstream 204. Irrelevant information is information that can be removed from the coefficients without producing visible and / or perceptible distortion in the video sequence 202 after decoding.

[0062] The entropy coding unit 218 may apply one or more entropy coding methods to the quantized transform coefficients to further reduce the bit rate. For example, the entropy coding unit 218 may apply context-adaptive variable length coding (CAVLC), context-adaptive binary arithmetic coding (CABAC), and syntax-based context-based binary arithmetic coding (SBAC). The entropy-coded coefficients are packed to form the bitstream 204.

[0063] The inverse transform and quantization unit 216 may inverse quantize and inverse transform the quantized transform coefficients to determine a reconstructed prediction error. The combiner 212 may combine the reconstructed prediction error with the prediction block to form a reconstructed block. The filter 220 may filter the reconstructed block using, for example, a deblocking filter and / or a sample adaptive offset (SAO) filter. The buffer 222 may store the reconstructed block for use in predicting one or more other blocks in the same and / or different pictures of the video sequence 202.

[0064] Although Figure 2 The encoder 200 further includes an encoder control unit configured to control Figure 2. The encoder control unit may control one or more units of the encoder 200 so that the bitstream 204 is generated in accordance with the requirements of any of a plurality of proprietary or industry video coding standards. For example, the encoder control unit may control one or more units of the encoder 200 so that the bitstream 204 is generated in accordance with one or more of the ITU-T H.263, AVC, HEVC, VVC, VP8, VP9, ​​and AV1 video coding standards.

[0065] Within the constraints of a proprietary or industry video coding standard, the encoder control unit can attempt to minimize or reduce the bit rate of the bitstream 204 and maximize or improve the reconstructed video quality. For example, the encoder control unit can attempt to minimize or reduce the bit rate of the bitstream 204 (given a level below which the reconstructed video quality cannot fall), or attempt to maximize or improve the reconstructed video quality (given a level above which the bit rate of the bitstream 204 cannot exceed). The encoder control unit can determine / control one or more of the following: the partitioning of pictures of the video sequence 202 into blocks, whether a block is inter-predicted by the inter-prediction unit 206 or intra-predicted by the intra-prediction unit 208, the motion vector used for inter-prediction of the block, the intra-prediction mode from a plurality of intra-prediction modes used for intra-prediction of the block, the filtering performed by the filter 220, and one or more transform types and / or quantization parameters applied by the transform and quantization unit 214. The encoder control unit can determine / control the above based on determining / controlling how to affect the rate-distortion metric for the block or picture being encoded. The encoder control unit may determine / control the above to reduce the rate-distortion metric for the block or picture being encoded.

[0066] After being determined, the prediction type (intra-frame or inter-frame prediction) used to encode the block, the prediction information of the block (intra-frame prediction mode (if intra-frame prediction), motion vector, etc.), and the transform and quantization parameters can be sent to the entropy coding unit 218 for further compression to reduce the bit rate. The prediction type, prediction information, and transform and quantization parameters can be packaged together with the prediction error to form the bitstream 204.

[0067] It should be noted that the encoder 200 is presented by way of example and not limitation. In other examples, the encoder 200 may have other components and / or arrangements. For example, Figure 2 One or more of the components shown in may optionally be included in the encoder 200 (such as the entropy coding unit 218 and the filter 220).

[0068] Figure 3An exemplary decoder 300 is shown in which embodiments of the present disclosure may be implemented. The decoder 300 decodes a bitstream 302 into a decoded video sequence 304 for display and / or some other form of consumption. The decoder 300 may be used in Figure 1 The decoder 300 may be implemented in the video encoding / decoding system 100 in FIG. 1 , or in any of a variety of different devices, including a desktop computer, a laptop computer, a tablet computer, a smartphone, a wearable device, a television, a camera, a video game console, a set-top box, or a video streaming device. The decoder 300 includes an entropy decoding unit 306, an inverse transform and quantization (iTR+iQ) unit 308, a combiner 310, one or more filters 312, a buffer 314, an inter-frame prediction unit 316, and an intra-frame prediction unit 318.

[0069] Although Figure 3 Not shown in FIG, but the decoder 300 further includes a decoder control unit configured to control Figure 3 . The decoder control unit may control one or more units of the decoder 300 so that the bitstream 302 is decoded in accordance with the requirements of any of a plurality of proprietary or industry video coding standards. For example, the decoder control unit may control one or more units of the decoder 300 so that the bitstream 302 is decoded in accordance with one or more of the ITU-T H.263, AVC, HEVC, VVC, VP8, VP9, ​​and AV1 video coding standards.

[0070] The decoder control unit may determine / control one or more of: whether the block is inter-predicted by the inter-prediction unit 316 or intra-predicted by the intra-prediction unit 318, a motion vector used for inter-prediction of the block, an intra-prediction mode from a plurality of intra-prediction modes used for intra-prediction of the block, filtering performed by the filter 312, and one or more inverse transform types and / or inverse quantization parameters to be applied by the inverse transform and quantization unit 308. One or more of the control parameters used by the decoder control unit may be packaged in the bitstream 302.

[0071] The entropy decoding unit 306 may entropy decode the bitstream 302. The inverse transform and quantization unit 308 may inverse quantize and inverse transform the quantized transform coefficients to determine a decoded prediction error. The combiner 310 may combine the decoded prediction error with the prediction block to form a decoded block. The prediction block may be generated by the intra-frame prediction unit 318 or the inter-frame prediction unit 316, as described above with respect to Figure 2302. The decoded blocks may be filtered using, for example, a deblocking filter and / or a sample adaptive offset (SAO) filter. The buffer 314 may store the decoded blocks for use in predicting one or more other blocks in the same and / or different pictures of the video sequence in the bitstream 302. The decoded video sequence 304 may be output from the filter 312, as shown in FIG. Figure 3 shown.

[0072] It should be noted that decoder 300 is presented by way of example and not limitation. In other examples, decoder 300 may have other components and / or arrangements. For example, Figure 3 One or more of the components shown in may optionally be included in the decoder 300 (such as the entropy decoding unit 306 and the filter 312).

[0073] It should also be noted that although Figure 2 and Figure 3 Although not shown, in addition to the inter prediction unit and the intra prediction unit, each of the encoder 200 and the decoder 300 may also include an intra block copy unit. The intra block copy unit may perform similarly to the inter prediction unit, but predicts blocks within the same picture. For example, the intra block copy unit may exploit repeating patterns that appear in screen content. Screen content may include, for example, computer-generated text, graphics, and animation.

[0074] As mentioned above, video encoding and decoding can be performed on a block-by-block basis. The process of dividing a picture into blocks can be adaptive based on the content of the picture. For example, larger block partitions can be used in picture areas with a higher level of homogeneity to improve coding efficiency.

[0075] In HEVC, a picture can be divided into non-overlapping square blocks of samples in a sample array, called coding tree blocks (CTBs). The CTB can have a size of 2nx2n samples, where n can be specified by parameters of the coding system. For example, n can be 4, 5, or 6. The CTB can be further divided into coding blocks (CBs) of half vertical and half horizontal size by recursive quadtree partitioning. The CTB forms the root of the quadtree. CBs that are not further split as part of the recursive quadtree partitioning can be called leaf CBs of the quadtree, otherwise they are called non-leaf CBs of the quadtree. The CB can have a minimum size specified by parameters of the coding system. For example, the minimum size of a CB can be 4x4, 8x8, 16x16, 32x32, or 64x64 samples. For inter-frame prediction and intra-frame prediction, the CB can be further divided into one or more prediction blocks (PBs) for performing inter-frame prediction and intra-frame prediction. A PB can be a rectangular block of samples to which the same prediction type / mode can be applied. For transform, the CB can be divided into one or more transform blocks (TBs). A TB may be a rectangular block of samples that may determine the size of the applied transform.

[0076] Figure 4 An example quadtree partitioning of CTB 400 is shown. Figure 5 Shown Figure 4 The corresponding quadtree 500 of the example quadtree partitioning of the CTB 400 in FIG. Figure 4 and Figure 5 As shown, the CTB 400 is first divided into four CBs of half vertical and half horizontal size. Three of the CBs obtained by the first level division of the CTB 400 are leaf CBs. Figure 4 and Figure 5 7, 8 and 9 respectively. The non-leaf CB of the first-level partition of CTB 400 is partitioned into four sub-CBs of half vertical and half horizontal size. Three of the sub-CBs obtained by the second-level partition of CTB 400 are leaf CBs. The three leaf CBs of the second-level partition of CTB 400 are in Figure 4 and Figure 5 Finally, the non-leaf CBs of the second level partition of CTB 400 are divided into four leaf CBs of half vertical and half horizontal size. Figure 4 and Figure 5 They are marked as 1, 2, 3 and 4 respectively.

[0077] In summary, CTB 400 is divided into 10 leaf CBs, respectively labeled 0 - 9. The resulting quadtree partitioning of CTB 400 can be scanned using a z-scan (from left to right, top to bottom) to form a sequential order for encoding / decoding the CB leaf nodes. Figure 4 and Figure 5The numerical label of each CB leaf node in may correspond to the sequential order of encoding / decoding, where CB leaf node 0 is encoded / decoded first and CB leaf node 9 is encoded / decoded last. Figure 4 and Figure 5 Not shown, but it should be noted that each CB leaf node may include one or more PBs and TBs.

[0078] In VVC, pictures can be partitioned in a similar manner to HEVC. Pictures can first be divided into non-overlapping square CTBs. Then, the CTBs can be divided into CBs of half vertical and half horizontal size through recursive quadtree partitioning. In VVC, quadtree leaf nodes can be further divided into CBs of unequal sizes through binary or ternary tree partitioning. Figure 6 Example binary and ternary tree partitioning are shown. Binary tree partitioning can split a parent block into two halves in either the vertical direction 602 or the horizontal direction 604. The resulting partition can be half the size of the parent block. Ternary tree partitioning can split a parent block into three parts in either the vertical direction 606 or the horizontal direction 608. In ternary tree partitioning, the middle partition can be twice as large as the other two end partitions.

[0079] Due to the addition of binary tree and ternary tree partitioning, in VVC, the block partitioning strategy can be called quadtree + multi-type tree partitioning. Figure 7 An example quadtree+multi-type tree partitioning of CTB 700 is shown. Figure 8 Shown Figure 7 The corresponding quadtree + multi-type tree 800 of the example quadtree + multi-type tree partition of the CTB 700 in FIG. Figure 7 and Figure 8 In FIG, quadtree partitioning is shown in solid lines and multi-type tree partitioning is shown in dashed lines. For ease of explanation, CTB 700 is shown with Figure 4 Therefore, the description of the quadtree partitioning of CTB 700 is omitted. The description of the additional multi-type tree partitioning of CTB 700 is relative to Figure 4 The three leaf CBs shown in , which have been further partitioned using one or more binary and ternary tree partitions. Figure 4 In Figure 7 The three leaf CBs shown as being further divided are leaf CBs 5, 8 and 9.

[0080] from Figure 4 The leaf CB 5 starts, Figure 7 It shows that the leaf CB is divided into two CBs based on vertical binary tree partitioning. The two resulting CBs are Figure 7 and Figure 8 The leaves CB are marked as 5 and 6 respectively. Figure 4 The leaf CB 8, Figure 7 It is shown that the leaf CB is divided into three CBs based on vertical ternary tree partitioning. Two of the three resulting CBs are in Figure 7 and Figure 8 The remaining non-leaf CBs are first divided into two CBs based on horizontal binary tree partitioning, one of the two CBs is a leaf CB marked as 10, and the other of the two CBs is further divided into three CBs based on vertical ternary tree partitioning. The resulting three CBs are in Figure 7 and Figure 8 The leaf CBs are marked as 11, 12 and 13 respectively. Figure 4 The leaf CB 9, Figure 7 It is shown that the leaf CB is divided into three CBs based on the horizontal ternary tree partition. Two of the three CBs are in Figure 7 and Figure 8 The remaining non-leaf CBs are divided into three CBs based on another horizontal ternary tree partition. The three CBs obtained are all in Figure 7 and Figure 8 The leaf CBs are labeled 16, 17, and 18, respectively.

[0081] In summary, CTB 700 is partitioned into 20 leaf CBs, respectively labeled 0 - 19. The resulting quadtree + multi-type tree partitioning of CTB 700 can be scanned using a z-scan (left to right, top to bottom) to form a sequential order for encoding / decoding CB leaf nodes. Figure 7 and Figure 8 The numerical label of each CB leaf node in may correspond to the sequential order for encoding / decoding, where CB leaf node 0 is encoded / decoded first and CB leaf node 19 is encoded / decoded last. Figure 7 and Figure 8 Not shown, but it should be noted that each CB leaf node may include one or more PBs and TBs.

[0082] In addition to specifying various blocks (e.g., CTB, CB, PB, TB), HEVC and VVC also define various units. While a block may include a rectangular sample area in a sample array, a unit may include collocated sample blocks from different sample arrays (e.g., luminance and chrominance sample arrays) that form a picture, as well as syntax elements and prediction data for the block. A coding tree unit (CTU) may include collocated CTBs of different sample arrays and may form a complete entity in the coded bitstream. A coding unit (CU) may include collocated CBs of different sample arrays and a syntax structure for encoding samples of the CB. A prediction unit (PU) may include collocated PBs of different sample arrays and syntax elements for predicting the PBs. A transform unit (TU) may include TBs of different sample arrays and syntax elements for transforming the TBs.

[0083] It should be noted that the term "block" can be used in the context of HEVC and VVC to refer to any of a CTB, CB, PB, TB, CTU, CU, PU, ​​or TU. It should also be noted that the term "block" can be used in the context of other video coding standards to refer to similar data structures. For example, the term "block" can refer to a macroblock in AVC, a macroblock or subblock in VP8, a superblock or subblock in VP9, ​​or a superblock or subblock in AV1.

[0084] In intra prediction, the samples of a block to be encoded (also called the current block) can be predicted based on the samples of the column immediately adjacent to the leftmost column of the current block and the samples of the row immediately adjacent to the topmost row of the current block. The samples from the immediately adjacent columns and rows can be collectively referred to as reference samples. Each sample of the current block can be predicted by projecting the position of the sample in the current block to a point along the reference samples in a given direction (also called the intra prediction mode). If the projection does not fall directly on a reference sample, the sample can be predicted by interpolating between the two closest reference samples to the projected point. The prediction error (also called residual) for the current block can be determined based on the difference between the predicted sample values ​​and the original sample values ​​of the current block.

[0085] At the encoder, the process of predicting samples and determining a prediction error based on the difference between the predicted samples and the original samples can be performed for multiple different intra-frame prediction modes, including a non-directional intra-frame prediction mode. The encoder can select one of the multiple intra-frame prediction modes and its corresponding prediction error to encode the current block. The encoder can send an indication of the selected prediction mode and its corresponding prediction error to the decoder to decode the current block. The decoder can decode the current block by predicting samples of the current block using the intra-frame prediction mode indicated by the encoder and combining the predicted samples with the prediction error.

[0086] Figure 9An example set of reference samples 902 determined for intra prediction of a current block 904 being encoded or decoded is shown. Figure 9 , the current block 904 corresponds to Figure 7 As described above, the numerical labels 0-19 of the blocks of the partitioned CTB 700 may correspond to the sequential order in which the blocks are encoded / decoded, and Figure 9 This is used in the example.

[0087] Given that the size of the current block 904 is w×h samples, the reference sample 902 may extend over 2w samples of the row immediately adjacent to the top row of the current block 904, 2h samples of the column immediately adjacent to the leftmost column of the current block 904, and to the upper left corner sample of the current block 904. Figure 9 In the example of , the current block 904 is square, so w = h = s. To construct the set of reference samples 902, available samples from neighboring blocks of the current block 904 may be used. For example, if the sample would be outside the picture of the current block, the sample is part of a different slice from the current block (where the concept of slices is used), and / or the sample belongs to a block that has been inter-coded and constrained intra prediction is indicated, then the sample may not be available for constructing the set of reference samples 902. When constrained intra prediction is indicated, intra prediction may not rely on inter-prediction blocks.

[0088] In addition to the above, samples that may not be available for constructing the set of reference samples 902 include samples in blocks that have not yet been encoded and reconstructed at the encoder or decoded at the decoder based on the sequence order of encoding / decoding. This restriction can allow the same prediction results to be determined at the encoder and decoder. Figure 9 , samples from neighboring blocks 0, 1, and 2 can be used to construct reference samples 902, assuming that these blocks are encoded and reconstructed at the encoder and decoded at the decoder before encoding the current block 904. This assumes that no other issues (such as those described above) prevent the availability of samples from neighboring blocks 0, 1, and 2. However, due to the sequential order of encoding / decoding, parts of reference samples 902 from neighboring block 6 may not be available.

[0089] Unavailable reference samples in the reference samples 902 may be filled with available reference samples in the reference samples 902. For example, the unavailable reference samples may be filled with the nearest available reference sample determined by moving clockwise from the position of the unavailable reference through the reference samples 902. If no reference samples are available, the reference samples 902 may be filled with values ​​in the middle of the dynamic range of the picture being encoded.

[0090] It should be noted that the reference samples 902 may be filtered based on the size of the current block 904 being encoded and the intra prediction mode applied. It should also be noted that Figure 9 Only one exemplary determination of reference samples for intra prediction of a block is shown. In some proprietary and industry video coding standards, reference samples may be determined in a different manner than described above. For example, multiple reference lines may be used in other instances, such as in VVC.

[0091] After determining the reference sample 902 and optionally filtering it, the sample of the current block 904 can be intra-predicted based on the reference sample 902. Most encoders / decoders support multiple intra-frame prediction modes according to one or more video coding standards. For example, HEVC supports 35 intra-frame prediction modes, including planar mode, DC mode, and 33 angular modes. VVC supports 67 intra-frame prediction modes, including planar mode, DC mode, and 65 angular modes. Planar mode and DC mode can be used to predict smooth areas and gradually changing areas of the picture. Angular mode can be used to predict directional structures in areas of the picture.

[0092] Figure 10A The 35 intra-frame prediction modes supported by HEVC are shown. The 35 intra-frame prediction modes are identified by indices 0 to 34. Prediction mode 0 corresponds to planar mode. Prediction mode 1 corresponds to DC mode. Prediction modes 2-34 correspond to angular modes. Prediction modes 2-18 can be referred to as horizontal prediction modes because the primary source of prediction is in the horizontal direction. Prediction modes 19-34 can be referred to as vertical prediction modes because the primary source of prediction is in the vertical direction.

[0093] Figure 10B The 67 intra prediction modes supported by VVC are shown. The 67 intra prediction modes are identified by indices 0 to 66. Prediction mode 0 corresponds to planar mode. Prediction mode 1 corresponds to DC mode. Prediction modes 2-66 correspond to angular modes. Prediction modes 2-34 can be called horizontal prediction modes because the main source of prediction is in the horizontal direction. Prediction modes 35-66 can be called vertical prediction modes because the main source of prediction is in the vertical direction. Because blocks in VVC can be non-square, Figure 10B Some of the intra prediction modes shown in may be adaptively replaced in the wide-angle direction.

[0094] To further describe the application of intra prediction mode to determine the prediction for the current block, refer to Figure 11 and Figure 12 .exist Figure 11 In, from Figure 9The current block 904 and reference samples 902 are shown in a two-dimensional x, y plane, where samples may be referred to as p[x][y]. To simplify the prediction process, the reference samples 902 may be placed in two one-dimensional arrays. The reference samples 902 above the current block 904 may be placed in a one-dimensional array ref1[x]:

[0095] ref1[x]=p[-1+x][-1],(x≥0) (1)

[0096] The reference samples 902 to the left of the current block 904 can be placed in a one-dimensional array ref2[x]:

[0097] ref2[y]=p[-1][-1+y],(y≥0) (2)

[0098] For planar mode, the sample at position [x][y] in the current block 904 can be predicted by calculating the average of two interpolated values. The first of the two interpolated values ​​can be based on the horizontal linear interpolation at position [x][y] in the current block 904. The second of the two interpolated values ​​can be based on the vertical linear interpolation at position [x][y] in the current block 904. The predicted sample p[x][y] in the current block 904 can be calculated as

[0099]

[0100] in

[0101] h[x][y]=(sx-1)·ref2[y]+(x+1)·ref1[s] (4)

[0102] can be a horizontal linear interpolation at position [x][y] in the current block 904, and

[0103] v[x][y]=(sy-1)·ref1[x]+(y+1)·ref2[s] (5)

[0104] It can be a vertical linear interpolation at position [x][y] in the current block 904.

[0105] For DC mode, the sample at position [x][y] in the current block 904 can be predicted by the average value of the reference samples 902. The predicted value sample p[x][y] in the current block 904 can be calculated as

[0106]

[0107] For an angular mode, a sample at position [x][y] in the current block 904 may be predicted by projecting the position [x][y] to a point on a horizontal or vertical line of samples that includes the reference sample 902 in the direction specified by the given angular mode. If the projection does not fall directly on a reference sample, the sample at position [x][y] may be predicted by interpolating between the two closest reference samples to the projected point. The direction specified by the angular mode may be an angle defined by the y-axis relative to a vertical prediction mode (e.g., modes 19-34 in HEVC and modes 35-66 in VVC) and the x-axis relative to a horizontal prediction mode (e.g., modes 2-18 in HEVC and modes 2-34 in VVC). given.

[0108] Figure 12 Shows the angles The prediction of the sample at position [x][y] in the current block 904 is given by the vertical prediction mode 906. For the vertical prediction mode, the position [x][y] in the current block 904 is projected to a point on the horizontal line of the reference sample ref1[x] (referred to herein as the "projection point"). For ease of explanation, the reference sample 902 is at Figure 12 Only part of it is shown in Figure 12 In the example of , the projection point falls at a fractional sample position between the two reference samples, so the predicted sample p[x][y] in the current block 904 can be calculated by linearly interpolating between the two reference samples as follows

[0109] p[x][y]=(1-i f )·ref1[x+i i +1]+i f ·ref1[x+i i +2] (7)

[0110] where i i is the integer part of the horizontal displacement of the projection point relative to the position [x][y] and can be used as the angle of the vertical prediction mode 906 The tangent function is calculated as follows

[0111]

[0112] And i f is the fractional part of the horizontal displacement of the projected point relative to position [x][y] and can be calculated as

[0113]

[0114] in It is rounded down (integerfloor).

[0115] For horizontal prediction mode, the position [x][y] of the sample in the current block 904 can be projected onto the vertical line of the reference sample ref2[y]. The sample prediction for the horizontal prediction mode is given by:

[0116] p[x][y]=(1-i f )·ref2[y+i i +1]+i f ·ref2[y+i i +2] (10)

[0117] where i i It is the integer part of the vertical displacement of the projection point relative to the position [x][y] and can be used as the angle of the horizontal prediction mode. The tangent function is calculated as follows

[0118]

[0119] And i f is the fractional part of the vertical displacement of the projected point relative to position [x][y] and can be calculated as

[0120]

[0121] in is rounded down.

[0122] The interpolation functions of (7) and (10) can be provided by an encoder or a decoder (such as Figure 2 Encoder 200 or Figure 3 The decoder 300 in FIG. 3 is implemented as a set of two-tap finite impulse response (FIR) filters. The coefficients of the two-tap FIR filters can be represented by (1-i f ) and i f In the above angular intra prediction example, the prediction samples p[x][y] can be calculated with a predefined level of sample accuracy (such as 1 / 32 sample accuracy). For 1 / 32 sample accuracy, the set of two-tap FIR interpolation filters can include up to 32 different two-tap FIR interpolation filters - which are used to project the displacement i f Each of the 32 possible values ​​for the fractional part of . In other examples, different levels of sample accuracy can be used.

[0123] In an embodiment, a two-tap interpolation FIR filter may be used to predict chroma samples. For luma samples, a different interpolation technique may be used. For example, for luma samples, a four-tap FIR filter may be used to determine the predicted value of the luma sample. For example, similar to a two-tap FIR filter, a four-tap FIR filter may have an i-basedf For 1 / 32 sample accuracy, the set of 32 different four-tap FIR filters may include up to 32 different four-tap FIR filters for projecting the displacement i f Each of the 32 possible values ​​of the fractional part of . In other examples, different levels of sample accuracy can be used. The set of four-tap FIR filters can be stored in a lookup table (LUT) and based on i f For reference. For vertical prediction mode, the value of the prediction sample p[x][y] can be determined based on a four-tap FIR filter as follows:

[0124]

[0125] Where ft[i], i=0...3, is the filter coefficient. For the horizontal prediction mode, the value of the prediction sample p[x][y] can be determined based on a four-tap FIR filter as follows:

[0126]

[0127] It should be noted that supplementary reference samples can be constructed for the case where the position [x][y] of the sample to be predicted in the current block 904 is projected to a negative x coordinate, which is the case at negative vertical prediction angles This can be solved by using a negative vertical prediction angle The reference sample in ref2[y] in the vertical line of the reference sample 902 is projected to the horizontal line of the reference sample 902 to construct the supplementary reference sample. The supplementary reference sample can be similarly used in the case where the position [x][y] of the sample to be predicted in the current block 904 is projected to a negative y coordinate, which is the case at negative horizontal prediction angles. This can be solved by using a negative horizontal prediction angle The reference samples in ref1[x] on the horizontal line of the reference samples 902 are projected to the vertical line of the reference samples 902 to construct the supplementary reference samples.

[0128] The encoder may predict samples of a current block being encoded (such as current block 904) for a plurality of intra-prediction modes as described above. For example, the encoder may predict samples of the current block for each of the 35 intra-prediction modes in HEVC or the 67 intra-prediction modes in VVC. For each intra-prediction mode applied, the encoder may determine a prediction error for the current block based on the difference (e.g., sum of squared differences (SSD), sum of absolute differences (SAD), or sum of absolute transform differences (SATD)) between the predicted samples determined for the intra-prediction mode and the original samples of the current block. The encoder may select one of the intra-prediction modes to encode the current block based on the determined prediction error. For example, the encoder may select the intra-prediction mode that produces the minimum prediction error for the current block. In another example, the encoder may select an intra-prediction mode to encode the current block based on a rate-distortion metric (e.g., Lagrangian rate-distortion cost) determined using the prediction error. The encoder may send an indication of the selected intra-prediction mode and its corresponding prediction error to the decoder to decode the current block.

[0129] Similar to the encoder, the decoder can predict samples of the current block being decoded (e.g., current block 904) for the intra prediction mode as described above. For example, the decoder can receive an indication of the angular intra prediction mode from the encoder of the block. The decoder can construct a set of reference samples and perform intra prediction based on the angular intra prediction mode indicated by the encoder of the block in a manner similar to that discussed above for the encoder. The decoder adds the predicted values ​​of the samples of the block to the residual of the block to reconstruct the block. In another embodiment, the decoder may not receive an indication of the angular intra prediction mode from the encoder of the block. Instead, the decoder can determine the intra prediction mode by other decoder-side means.

[0130] Although the above description is mainly about the intra-frame prediction mode in HEVC and VVC, it should be understood that the technology of the present disclosure described above and further described below can be applied to other intra-frame prediction modes, including intra-frame prediction modes of other video coding standards such as VP8, VP9, ​​AV1, etc.

[0131] As described above, intra-frame prediction can exploit the correlation between spatially adjacent samples in the same picture of a video sequence to perform video compression. Inter-frame prediction is another coding tool that can be used to exploit the temporal correlation between sample blocks in different pictures of a video sequence to perform video compression. Generally speaking, an object can be seen across multiple pictures in a video sequence. The object can move across the pictures (e.g., via some translation and / or affine motion) or remain stationary. Therefore, the current sample block in the current picture being encoded may have a corresponding sample block in a previously decoded picture that accurately predicts the current sample block. Due to the movement of the objects represented in the two blocks across the corresponding pictures of these blocks, the corresponding sample block may be displaced from the current sample block. The previously decoded picture may be referred to as a reference picture, and the corresponding sample block in the reference picture may be referred to as a reference block or motion-compensated prediction. The encoder may use block matching techniques to estimate the displacement (or motion) and determine the reference block in the reference picture.

[0132] Similar to intra-frame prediction, once a prediction for the current block is determined and / or generated using inter-frame prediction, the encoder can determine the difference between the current block and the prediction. The difference can be called a prediction error or residual. The encoder can then store and / or signal the prediction error and other related prediction information in the bitstream for decoding or other forms of consumption. The decoder can decode the current block by using the prediction information to predict samples of the current block and combining the predicted samples with the prediction error.

[0133] Figure 13A An example of inter-frame prediction is shown for a current block 1300 in a current picture 1302 being encoded. Figure 2 The encoder 200 in FIG. 1 may perform inter-frame prediction to determine and / or generate a reference block 1304 in a reference picture 1306 to predict the current block 1300. A reference picture, such as reference picture 1306, is a previously decoded picture available at the encoder and decoder. The availability of the previously decoded picture may depend on whether the previously decoded picture is available in a decoded picture buffer when the current block 1300 is encoded or decoded. The encoder may search, for example, one or more reference pictures for a reference block similar to the current block 1300. The encoder may determine the "best matching" reference block from the blocks tested during the search process as the reference block 1304. The encoder may determine that the reference block 1304 is the best matching reference block based on one or more cost criteria, such as a rate-distortion criterion (e.g., Lagrangian rate-distortion cost). The one or more cost criteria may be based on, for example, the difference (e.g., sum of squared differences (SSD), sum of absolute differences (SAD), or sum of absolute transformed differences (SATD)) between the predicted samples of the reference block 1304 and the original samples of the current block 1300.

[0134] The encoder may search for reference block 1304 within a search range 1308. Search range 1308 may be located around a collocated position (or block) 1310 of current block 1300 in reference picture 1306. In some instances, search range 1308 may extend at least partially outside reference picture 1306. When extending outside reference picture 1306, a constant boundary extension may be used such that the values ​​of samples in rows or columns of reference picture 1306 immediately adjacent to the portion of search range 1308 extending outside reference picture 1306 are used for "sample" positions outside reference picture 1306. All potential positions or a subset of potential positions within search range 1308 may be searched for reference block 1304. The encoder may utilize any of a variety of different search implementations to determine and / or generate reference block 1304. For example, the encoder may determine a set of candidate search positions based on motion information of neighboring blocks of current block 1300.

[0135] The encoder can search one or more reference pictures during inter-frame prediction to determine and / or generate the best matching reference block. The reference pictures searched by the encoder can be included in one or more reference picture lists. For example, in HEVC and VVC, two reference picture lists can be used, namely reference picture list 0 and reference picture list 1. A reference picture list can include one or more pictures. The reference picture 1306 of the reference block 1304 can be indicated by a reference index pointing to the reference picture list including the reference picture 1306.

[0136] The displacement between the reference block 1304 and the current block 1300 may be interpreted as an estimation of the motion between the reference block 1304 and the current block 1300 on their respective pictures. The displacement may be represented by a motion vector 1312. For example, the motion vector 1312 may be indicated by a horizontal component (MVx) and a vertical component (Mvy) relative to the position of the current block 1300. Figure 13B The horizontal and vertical components of motion vector 1312 are shown. Motion vectors, such as motion vector 1312, can have fractional or integer resolution. A motion vector with fractional resolution can point between two samples in a reference picture to provide a better estimate of the motion of current block 1300. For example, a motion vector can have a fractional sample resolution of 1 / 2, 1 / 4, 1 / 8, 1 / 16, or 1 / 32. When a motion vector points to a non-integer sample value in a reference picture, interpolation between samples at integer positions can be used to generate a reference block and its corresponding samples at fractional positions. Interpolation can be performed by a filter with two or more taps.

[0137] Once a reference block 1304 for the current block 1300 has been determined and / or generated using inter-frame prediction, the encoder can determine the difference (e.g., the corresponding sample-by-sample difference) between the reference block 1304 and the current block 1300. The difference can be referred to as a prediction error or residual. The encoder can then store and / or signal the prediction error and related motion information in the bitstream for decoding or other forms of consumption. The motion information can include a motion vector 1312 and a reference index to a reference picture list that includes the reference picture 1306. In other examples, the motion information can include an indication of the motion vector 1312 and an indication of a reference index to a reference picture list that includes the reference picture 1306. The decoder can decode the current block 1300 by determining and / or generating a reference block 1304 that forms a prediction of the current block 1300, using the motion information, and combining the prediction with the prediction error.

[0138] exist Figure 13A , inter prediction is performed using one reference picture 1306 as a prediction source for the current block 1300. Because the prediction for the current block 1300 comes from a single picture, this type of inter prediction is called unidirectional prediction. Figure 14 Another type of inter-frame prediction, called bidirectional prediction, is shown being performed for the current block 1400. In bidirectional prediction, the prediction sources for the current block 1400 come from two pictures. For example, bidirectional prediction may be useful in situations where a video sequence includes fast motion, camera pans or zooms, or scene changes. Bidirectional prediction may also be used to capture a fade-out of a scene or a fade-out from one scene to another, where two pictures are effectively displayed simultaneously at different intensity levels.

[0139] Whether unidirectional prediction or both unidirectional and bidirectional prediction can be used to perform inter-frame prediction may depend on the slice type of the current block 1400. For P slices, only unidirectional prediction can be used to perform inter-frame prediction. For B slices, unidirectional prediction or bidirectional prediction can be used. When performing unidirectional prediction, the encoder may determine and / or generate a reference block for predicting the current block 1400 from reference picture list 0. When performing bidirectional prediction, the encoder may determine and / or generate a first reference block for predicting the current block 1400 from reference picture list 0, and determine and / or generate a second reference block for predicting the current block 1400 from reference picture list 1.

[0140] exist Figure 14 In FIG, inter-frame prediction is performed using bidirectional prediction, where two reference blocks 1402 and 1404 are used to predict the current block 1400. Reference block 1402 may be in a reference picture of one of reference picture lists 0 or 1, and reference block 1404 may be in a reference picture of the other of reference picture lists 0 or 1. Figure 14As shown, reference block 1402 is located in a picture that precedes the current picture of current block 1400 in terms of picture order count (POC), and reference block 1402 is located in a picture that follows the current picture of current block 1400 in terms of the POC. In other examples, the reference picture may be before or after the current picture in terms of the POC. The POC is the order in which pictures are output from, for example, a decoded picture buffer, and is the order in which pictures are generally intended to be displayed. However, it should be noted that the output pictures are not necessarily displayed but may undergo different processing or consumption, such as transcoding. In other examples, the two reference blocks determined and / or generated using bidirectional prediction may be from the same reference picture. In such instances, the reference pictures may be included in reference picture list 0 and reference picture list 1.

[0141] Configurable weight and offset values ​​can be applied to one or more inter-prediction reference blocks. The encoder can use flags in the picture parameter set (PPS) to enable the use of weighted prediction and signal the weight and offset parameters in the slice segment header for the current block. Different weight and offset parameters can be signaled for luma and chroma components.

[0142] Once reference blocks 1402 and 1404 for current block 1400 have been determined and / or generated using inter-frame prediction, the encoder can determine the differences between current block 1400 and each of reference blocks 1402 and 1404. These differences can be referred to as prediction errors or residuals. The encoder can then store and / or signal the prediction errors and their corresponding associated motion information in the bitstream for decoding or other forms of consumption. The motion information for reference block 1402 may include a motion vector 1406 and a reference index to a reference picture list that includes the reference block 1402. In other cases, the motion information for reference block 1402 may include an indication of the motion vector 1406 and an indication of a reference picture list, specifically, an indication of a reference index to a reference picture that includes reference block 1402. The motion information for reference block 1404 may include a motion vector 1408 and a reference index to a reference picture list that includes the reference block 1404. In other cases, the motion information for the reference block 1404 may include an indication of a motion vector 1408 and an indication of a reference index pointing to a reference picture list, specifically, to a reference picture that includes the reference block 14042. The decoder may decode the current block 1400 by determining and / or generating reference blocks 1402 and 1404 that together form a prediction of the current block 1400, using their respective motion information, and combining the prediction with the prediction error.

[0143] In HEVC, VVC, and other video compression schemes, motion information may be predictively coded before being stored or signaled in the bitstream. The motion information of a current block may be predictively coded based on the motion information of its neighboring blocks. In general, the motion information of neighboring blocks is often correlated with the motion information of the current block because the motion of objects represented in the current block is often the same or similar to the motion of objects in neighboring blocks. Two of the motion information prediction techniques in HEVC and VVC include Advanced Motion Vector Prediction (AMVP) and inter-prediction block merging.

[0144] Encoders (such as Figure 2 The encoder 200 in the example code may use the AMVP tool to encode a motion vector as the difference between the motion vector of the current block being encoded and a motion vector predictor (MVP). The encoder may select an MVP from a list of candidate MVPs. The candidate MVPs may be previously decoded motion vectors of neighboring blocks in the current picture of the current block, or previously decoded motion vectors of blocks at or near the collocated position of the current block in other reference pictures. Both the encoder and the decoder may generate or determine a list of candidate MVPs.

[0145] After the encoder selects an MVP from the list of candidate MVPs, the encoder can signal an indication of the selected MVP and a motion vector difference (MVD) in the bitstream. The encoder can indicate the selected MVP in the bitstream by an index to the list of candidate MVPs. The MVD can be calculated based on the difference between the motion vector of the current block and the selected MVP. For example, for a motion vector represented by a horizontal component (MVx) and a vertical displacement (Mvy) relative to the position of the current block being encoded, the MVD can be represented by two components calculated as follows:

[0146] MVD x =MV x -MVP x (15)

[0147] MVD y =MV y -MVP y (16)

[0148] MVD x and MVD y Represent the horizontal and vertical components of MVD respectively, and MVP x and MVP y Represents the horizontal and vertical components of MVP respectively. Decoder (such as Figure 3The decoder 300 in FIG. 3 can decode the motion vector by adding the MVD to the MVP indicated in the bitstream. The decoder can then decode the current block by determining and / or generating a reference block that forms a prediction of the current block, using the decoded motion vector and combining the prediction with the prediction error.

[0149] In HEVC and VVC, the list of candidate MVPs for AMVP may include two candidates, referred to as Candidate A and Candidate B. Candidate A and Candidate B may include up to two spatial candidate MVPs derived from the five spatial neighboring blocks of the current block being coded, one temporal candidate MVP derived from two temporally co-located blocks when both spatial candidate MVPs are unavailable or identical, or a zero motion vector when neither spatial, temporal, or both candidates are available. Figure 15A The positions of five spatial candidate neighboring blocks are shown relative to the current block being encoded 1500. The five spatial candidate neighboring blocks are denoted as A0, A1, B0, B1 and B2 respectively. Figure 15B The positions of the two temporally co-located blocks relative to the current block 1500 being encoded are shown. The two temporally co-located blocks are denoted as C0 and C1 and are included in a reference picture that is different from the current picture of the current block 1500.

[0150] Encoders (such as Figure 2 The encoder 200 in FIG. 2 may encode motion vectors using an inter-prediction block merging tool (also known as merge mode). Using merge mode, the encoder may reuse the same motion information of adjacent blocks for inter prediction of the current block. Because the same motion information of the adjacent blocks is used, there is no need to signal MVD, and the size of the signaling overhead for signaling the motion information of the current block may be small. Similar to AMVP, both the encoder and the decoder may generate a candidate list of motion information based on the adjacent blocks of the current block. The encoder may then determine to use (or inherit) the motion information of one of the adjacent blocks in the candidate list to predict the motion information of the current block being encoded. The encoder may signal an indication of the determined motion information from the candidate list in the bitstream. For example, the encoder may signal an index to a list of candidate motion information to indicate the determined motion information.

[0151] In HEVC and VVC, the list of candidate motion information for merge mode may include Figure 15A Up to four spatial merging candidates are derived from the five spatial neighboring blocks used in the AMVP shown in FIG. Figure 15B One temporal merge candidate derived from two temporally co-located blocks used in AMVP is shown, along with additional merge candidates including a bi-prediction candidate and a zero motion vector candidate.

[0152] It should be noted that inter-frame prediction can be performed in other ways and variations besides the above. For example, motion information prediction techniques other than AMVP and merge mode are possible. In addition, although the above description is mainly about the inter-frame prediction mode in HEVC and VVC, it should be understood that the technology of the present disclosure described above and further described below can be applied to other inter-frame prediction modes, including inter-frame prediction modes of other video coding standards such as VP8, VP9, ​​AV1, etc. In addition, history-based motion vector prediction (HMVP), combined intra / inter prediction mode (CIIP) and merge mode with motion vector difference (MMVD) as described in VVC can also be performed, and these are all within the scope of the present disclosure.

[0153] In inter-frame prediction, block matching techniques can be applied to determine a reference block that is in a different picture than the current block being encoded. Block matching techniques have also been applied to determine a reference block that is in the same picture as the current block being encoded. However, it has been determined that for video captured by a camera, a reference block in the same picture as the current block determined using block matching is generally not able to accurately predict the current block. This is generally not the case for screen content video. Screen content video may include, for example, computer-generated text, graphics, and animation. In screen content, there are often repeating patterns (e.g., repeating patterns of text and graphics) within the same picture. Therefore, block matching techniques applied to determine a reference block in the same picture as the current block being encoded can provide efficient compression of screen content video.

[0154] Both HEVC and VVC include prediction techniques that exploit correlations between sample blocks within the same picture of the screen content video. This technique is called intra block copying (IBC) or current picture referencing (CPR). Similar to inter-frame prediction, the encoder can apply block matching techniques to determine a displacement vector (called a block vector (BV)) that indicates the relative displacement from the current block to the reference block that "best matches" the current block (or intra-frame block compensated prediction). The encoder can determine the best matching reference block from blocks tested during a search process similar to inter-frame prediction. The encoder can determine that the reference block is the best matching reference block based on one or more cost criteria, such as a rate-distortion criterion (e.g., Lagrangian rate-distortion cost). The one or more cost criteria can be based on, for example, the difference between the predicted samples of the reference block and the original samples of the current block (e.g., sum of squared differences (SSD), sum of absolute differences (SAD), sum of absolute transformed differences (SATD), or differences determined based on a hash function). The reference block can correspond to a previously decoded sample block of the current picture. The reference block may include a block of decoded samples of the current picture before being processed by an in-loop filtering operation such as deblocking or SAO filtering. Figure 16An example of IBC applied to screen content is shown. The rectangular portion with an arrow from its boundary is the current block being encoded, and the rectangular portion to which the arrow points is the reference block used to predict the current block.

[0155] Once a reference block for a current block is determined and / or generated using IBC, the encoder can determine the difference between the reference block and the current block (e.g., the corresponding sample-by-sample difference). The difference can be referred to as a prediction error or residual. The encoder can then store and / or signal the prediction error and related prediction information in the bitstream for use in decoding or other forms of consumption. The prediction information can include a BV. In other instances, the prediction information can include an indication of the BV. A decoder (such as Figure 3 The decoder 300 in FIG. 3 may decode the current block by determining and / or generating a reference block that forms a prediction of the current block, using the prediction information, and combining the prediction with the prediction error.

[0156] In HEVC, VVC, and other video compression schemes, the BV may be predictively encoded before being stored or signaled in the bitstream. The BV of a current block may be predictively encoded based on the BVs of its neighboring blocks. For example, the encoder may predictively encode the BV using a merge mode as explained above for inter-frame prediction or a technique similar to AMVP as also explained above for inter-frame prediction. Techniques similar to AMVP may be referred to as BV prediction and difference coding.

[0157] For BV prediction and difference coding, an encoder such as Figure 2 The encoder 200 in FIG. 2 may encode the BV as the difference between the BV of the current block being encoded and a BV predictor (BVP). The encoder may select a BVP from a list of candidate BVPs. The candidate BVPs may be from previously decoded BVs of neighboring blocks of the current block in the current picture. Both the encoder and the decoder may generate or determine a list of candidate BVPs.

[0158] After the encoder selects a BVP from the list of candidate BVPs, the encoder can signal an indication of the selected BVP and a BV difference (BVD) in the bitstream. The encoder can indicate the selected BVP in the bitstream by an index into the list of candidate BVPs. The BVD can be calculated based on the difference between the BV of the current block and the selected BVP. For example, for a horizontal component (BVD) of a block that is located relative to the position of the current block being encoded, the BVD can be calculated based on the difference between the BV of the current block and the selected BVP. x ) and the vertical component (BV y ), BV, BVD can be represented by two components calculated as follows:

[0159] BVD x =BV x -BVP x (17)

[0160] BVD y =BV y -BVP y (18)

[0161] Among them BVD x and BVD y represent the horizontal and vertical components of BVD, respectively, and BVP x and BVP y Represents the horizontal and vertical components of BVP respectively. Decoder (such as Figure 3 The decoder 300 in FIG. 300 can decode the BV by adding the BVD to the BVP indicated in the bitstream. The decoder can then decode the current block by determining and / or generating a reference block that forms a prediction of the current block, using the decoded BV and combining the prediction with the prediction error.

[0162] In HEVC and VVC, the list of candidate BVPs may include two candidates, referred to as Candidate A and Candidate B. Candidate A and Candidate B may include up to two spatial candidate BVPs derived from the five spatial neighboring blocks of the current block being coded, or when spatial neighboring candidates are not available (e.g., because they are coded in intra or inter mode), one or more of the last two coded BVs. The positions of the five spatial candidate neighboring blocks relative to the current block coded using IBC are the same as Figure 15A The positions shown are the same as those used for inter prediction. The five spatial candidate neighboring blocks are denoted as A0, A1, B0, B1, and B2, respectively. In other embodiments, the list of candidate BVPs may contain more than two candidate BVPs.

[0163] As mentioned above Figure 2 and 3 As explained in [1], entropy coding can be performed at the end of the video encoding process and the beginning of the video decoding process. Entropy coding is a technique that compresses a sequence of symbols by using fewer bits to represent symbols with higher probabilities than symbols with lower probabilities. When the compressed symbol sequence is represented by the bits {0, 1}, Shannon's information theory dictates that the optimal average code length for a symbol with probability p is -log2p.

[0164] Arithmetic coding is a method of entropy coding. Arithmetic coding is based on recursive interval subdivision. In order to arithmetically code a symbol taking values ​​from an m-ary source alphabet, the initial coding interval can be divided into m non-adjacent subintervals. Each of the m non-adjacent subintervals can have a width that is proportional to the probability that the symbol has a different value from the value in the m-ary source alphabet. The probability that a symbol has different values ​​from the m-ary source alphabet can be called a probability model of the symbol. The symbol is arithmetically coded by selecting the subinterval corresponding to the actual value of the symbol as the new coding interval. By recursively applying this interval subdivision scheme to a given sequence s = {s1, s2, ..., s N ) for each symbol s i , the encoder can determine the values ​​within the final coding interval after the Nth interval subdivision as the arithmetic codeword for sequence s. Each consecutive symbol in the coded sequence s reduces the size of the coding interval according to the probability model of the symbol. According to the general principles of entropy coding, more likely symbol values ​​reduce the size of the coding interval less than less likely symbol values, and therefore fewer bits are added to the arithmetic codeword for sequence s.

[0165] Arithmetic decoding is based on the same recursive interval subdivision. In order to arithmetically decode symbols taking values ​​from an m-ary source alphabet, the initial coding interval may be divided into m non-adjacent subintervals. Each of the m non-adjacent subintervals may have a width that is proportional to the probability that the symbol has a different value from the value in the m-ary source alphabet. The probability that a symbol has a different value from the m-ary source alphabet may be referred to as a probability model of the symbol, as mentioned above. A symbol may be arithmetically decoded from an arithmetic codeword by determining the symbol value corresponding to the subinterval into which the arithmetic codeword falls. This subinterval then becomes the new coding interval. The decoder may sequentially decode the sequence s = {s1, s2, ..., s} by recursively applying this interval subdivision scheme N times and determining in which subinterval the arithmetic codeword falls during each iteration. N ) for each symbol s i .

[0166] For each arithmetically coded symbol, a different probability model can be used to subdivide the coding interval. For example, the probability model of a symbol can be determined by a fixed selection (e.g., based on the position of the symbol in the symbol sequence) or by adaptively selecting from two or more probability models (e.g., based on information related to the symbol). Two or more symbols in a symbol sequence may also use a joint probability model. The selection of the probability model of a symbol is called context modeling. Arithmetic coding using context modeling can be more specifically referred to as context-based arithmetic coding. In addition to the probability model selection of a symbol, the selected probability model can also be updated based on the actual coded value of the symbol. For example, the probability of the actual coded value of the symbol can be increased in the probability model, while the probability of all other values ​​can be reduced. Arithmetic coding using both context modeling and probability model adaptation can be more specifically referred to as context-based adaptive arithmetic coding.

[0167] The above description only provides an example of arithmetic coding. As will be appreciated by those skilled in the art, other variations of arithmetic coding are also possible. For example, during arithmetic coding, a renormalization operation can be performed to ensure that the precision required for the scope and lower limit of the subinterval does not exceed the finite precision of the registers used to store these values. In addition, the encoding process can be simplified to reduce complexity, speed, and / or reduce the power requirements of the embodiment of the encoding process in hardware, software, or a certain combination of the two. For example, in this type of embodiment, the probability of a symbol and the lower limit and the scope of the subinterval can be approximated or quantized.

[0168] Figure 17 An example implementation of a context-based adaptive binary arithmetic coding (CABAC) encoder 1700 according to an embodiment of the present disclosure is shown. The CABAC encoder 1700 may be used in, for example, Figure 2 The video encoder 200 is implemented in the video encoder for entropy coding the syntax elements of the video sequence. Figure 17 As shown, the CABAC encoder 1700 includes a binarizer 1702 , an arithmetic encoder 1704 , and a context modeler 1706 .

[0169] The CABAC encoder 1700 may receive syntax elements 1708 for arithmetic coding. Syntax elements such as syntax element 1708 may be generated at a video encoder and may describe how a video signal may be reconstructed at a video decoder. For a coding unit (CU), the syntax elements may include intra prediction modes for intra prediction based on the CU, motion data (e.g., MVD and MVP related data) for inter prediction based on the CU, or displacement data (e.g., BVD and BVP related data) for IBC prediction based on the CU.

[0170] The binarizer 1702 may first map the value of the syntax element 1708 to a sequence of binary symbols (also known as a binary number). The binarizer 1702 may define a unique mapping of the value of the syntax element 1708 to the sequence of binary symbols. Binarization of the syntax element may help improve the probabilistic modeling and implementation of arithmetic coding. The binarizer 1702 may implement one or more binarization processes, such as unary, truncated unary, k-order truncated Rice, k-order exponential Golomb (EGk), fixed length, or some combination of two or more of these binarization processes. The binarizer 1702 may select a binarization process based on the type of the syntax element 1708 and / or one or more syntax elements processed by the CABAC encoder 1700 prior to the syntax element 1708. The binarizer 1702 may not process the syntax element 1708 because the syntax element 1708 is already represented by a sequence of one or more binary symbols. In another example, the binarizer 1702 may not be used, and the syntax element 1708 represented by a sequence of one or more non-binary symbols may be encoded directly by the CABAC encoder 1700 .

[0171] After the binarizer 1702 optionally maps the value of the syntax element 1708 to a sequence of binary symbols, one or more of the binary symbols may be processed by an arithmetic encoder 1704. The arithmetic encoder 1704 may process each of the one or more binary symbols in one of at least two modes: a normal arithmetic coding mode or a bypass arithmetic coding mode.

[0172] The arithmetic encoder 1704 can process binary symbols that do not have a uniform (or approximately uniform) probability distribution in the conventional arithmetic coding mode (e.g., a binary symbol that does not have a probability distribution of 0.5 for each of its two possible values). In the conventional arithmetic coding mode, the arithmetic encoder 1704 can perform arithmetic coding as described above. For example, the arithmetic encoder 1704 can subdivide the current coding interval into m non-adjacent subintervals. Each of the m non-adjacent subintervals can have a width proportional to the probability of the binary symbol having a different value from the m-ary source alphabet. In the case of binary symbols, m is equal to two, and the current coding interval can be subdivided into two non-adjacent intervals, each having a width proportional to the probability of a different value from the two possible values ​​{0, 1} of the binary symbol being encoded. The probabilities of the two possible values ​​of the binary symbol can be indicated by the probability model 1710 of the binary symbol. The arithmetic encoder 1704 can then encode the binary symbol by selecting the subinterval corresponding to the actual value of the binary symbol as the new coding interval for the next binary symbol to be encoded.

[0173] The arithmetic coder 1704 may receive a probability model 1710 from a context modeler 1706. The context modeler 1706 may determine the probability model 1710 for a binary symbol by a fixed selection (e.g., based on the position of the binary symbol in a sequence of binary symbols representing a syntax element 1708) or by adaptively selecting from two or more probability models (e.g., based on information associated with the binary symbol). Figure 17 As shown, the probability model 1710 may include two parameters: the probability P of the lowest probability symbol (LPS) LPS and the value v of the most probable symbol (MPS) MPS In other examples, the probability model 1710 may include the probability P of the MPS MPS , as the probability P of LPS LPS Similarly, in other examples, the probability model 1710 may include the value v of the LPS LPS , as the MPS value v MPS After the arithmetic encoder 1704 encodes the binary symbol, the arithmetic encoder 1704 may provide one or more probability model update parameters 1712 to the context modeler 1706. The context modeler 1706 may adapt the probability model 1710 based on the one or more probability model update parameters 1712. For example, the one or more probability model update parameters 1712 may include the actual encoded value of the binary symbol. The context modeler 1706 may adjust the probability model 1710 if the actual encoded value of the binary symbol is not equal to v MPS By increasing P LPS To update the probability model 1710, otherwise by reducing P LPS to update the probability model.

[0174] The arithmetic encoder 1704 can process binary symbols with (or assumed to have) a uniform (or approximately uniform) probability distribution in the bypass arithmetic coding mode. Because the binary symbols processed by the arithmetic encoder 1704 in the bypass arithmetic coding mode have (or are assumed to have) a uniform (or approximately uniform) probability distribution, the arithmetic encoder 1704 can bypass the probability model determination and adaptation performed in the conventional arithmetic coding mode when encoding these binary symbols to speed up the encoding process. In addition, given the uniform (or assumed uniform) probability distribution, the subdivision of the current coding interval can be simplified. For example, the current coding interval can be partitioned into two non-adjacent subintervals of equal width, which can be implemented using a simple implementation that can further speed up the encoding process. The arithmetic encoder 1704 encodes the binary symbol by selecting the subinterval corresponding to the value of the binary symbol as the new coding interval for the next binary symbol to be encoded. The resulting increase in the encoding speed of the binary symbols encoded by the arithmetic encoder 1704 in the bypass arithmetic coding mode is generally important because CABAC encoding can have throughput limitations.

[0175] After processing the plurality of binary symbols (e.g., corresponding to one or more syntax elements), the arithmetic encoder 1704 may determine a value in a final coding interval range as an arithmetic codeword 1714 for the binary symbols. The arithmetic encoder 1704 may then output the arithmetic codeword 1714. For example, the arithmetic encoder 1704 may output the arithmetic codeword 1714 to a bitstream that may be received and processed by a video decoder.

[0176] As explained above, two syntax elements that can be encoded in the bypass arithmetic coding mode are the magnitude of the motion vector difference (MVD) and the magnitude of the block vector difference (BVD). These syntax elements can be determined as part of the Advanced Motion Vector Prediction (AMVP) for inter-frame prediction and the AMVP for intra-frame block copy (IBC), respectively, as explained above. Although the bypass arithmetic coding mode can be used to speed up the arithmetic coding process, the compression of the symbols of these syntax elements encoded in the bypass arithmetic coding mode is limited because their probability distribution is uniformly distributed (or at least assumed to be uniformly distributed). According to information theory, a symbol cannot be compressed at a rate less than its entropy without losing information, and symbols with a uniform probability distribution have the maximum entropy. Therefore, compared to symbols encoded in the conventional arithmetic coding mode, symbols encoded using the bypass arithmetic coding mode generally require more bits to encode.

[0177] In some embodiments, to further improve the compression efficiency of one or more magnitude symbols of the BVD, instead of entropy encoding the magnitude symbols of the BVD, an indication of whether the value of the magnitude symbol of the BVD matches (or is equal to) the value of the magnitude symbol of a BVD candidate used as a predictor for the BVD may be entropy encoded. The BVD predictor may be selected from a plurality of BVD candidates based on their costs. The cost of each of the plurality of BVD candidates may be calculated based on the difference between a template of the current block and a template of a candidate reference block. The candidate reference block may be shifted relative to the current block by the sum of the BVD candidate and a block vector predictor (BVP). The indication of whether the value of the magnitude symbol of the BVD matches the value of the magnitude symbol of the BVD predictor may have a non-uniform probability distribution and, therefore, provide improved compression efficiency compared to encoding the magnitude symbol of the BVD based on a uniform probability distribution.

[0178] The compression efficiency of one or more magnitude signs of an MVD can be improved similarly to that of a BVD. Instead of entropy encoding the magnitude sign of the MVD, an indication of whether the value of the magnitude sign of the MVD matches (or is equal to) the value of the magnitude sign of an MVD candidate used as a predictor for the MVD can be entropy encoded. The MVD predictor can be selected from a plurality of MVD candidates based on their costs. The cost of each BVD candidate in the plurality of MVD candidates can be calculated based on a difference between a template of a current block and a template of a candidate reference block. The candidate reference block can be co-located in a reference frame relative to the current block by the sum of the MVD candidate and a motion vector predictor (MVP). The indication of whether the value of the magnitude sign of the MVD matches the value of the magnitude sign of the MVD predictor can have a non-uniform probability distribution and, therefore, provide improved compression efficiency compared to encoding the magnitude sign of the MVD based on a uniform probability distribution.

[0179] As explained above, both HEVC and VVC include prediction techniques that exploit the correlation between blocks of samples within the same picture. This technique is called intra-block copying (IBC). IBC is included in the Enhanced Compression Model (ECM) software algorithm as a potential enhancement to VVC's capabilities. The ECM software algorithm is currently being explored in a coordinated manner by the ITU-T Video Coding Experts Group (VCEG) and the Joint Video Exploration Team (JVET) of ISO / IEC MPEG.

[0180] Figure 18AAn example of IBC according to an embodiment of the present disclosure is shown. During IBC, the encoder may determine a block vector (BV) 1802 indicating a displacement from a current block 1804 to a reference block (or intra-block compensated prediction) 1806. The encoder may determine the reference block 1806 from one or more reference blocks tested during a search process. For example, for each of the one or more reference blocks measured during the search process, the encoder may determine the difference (e.g., sum of squared differences (SSD), sum of absolute differences (SAD), sum of absolute transformed differences (SATD), or a difference determined based on a hash function) between samples of the reference block and samples of the current block 1804. The encoder may determine the reference block 1806 from the one or more reference blocks based on the reference block 1806 having the smallest difference with the current block 1804 among the one or more reference blocks, or based on some other criteria. The reference block 1806 and the one or more other reference blocks tested during the search process may include decoded (or reconstructed) samples. The decoded (or reconstructed) samples may not have been processed by an in-loop filtering operation (such as deblocking or SAO filtering).

[0181] Once the reference block 1806 is determined for the current block 1804, the encoder can use the reference block 1806 to predict the current block 1804. For example, the encoder can determine or use the difference (e.g., the corresponding sample-by-sample difference) between the reference block 1806 and the current block 1804. The difference can be called a prediction error or residual. The encoder can then signal the prediction error and related prediction information in the bitstream. The prediction information can include BV 1802. In other cases, the prediction information can include an indication of BV 1802. The decoder, for example Figure 3 The decoder 300 in , may receive a bitstream and decode the current block 1804 by using the prediction information to determine a reference block 1806 that forms a prediction of the current block 1804 and combining the prediction with a prediction error.

[0182] Before being signaled in the bitstream, the BV 1802 may be predictively encoded. The BV 1802 may be predictively encoded based on the BVs of neighboring blocks or other blocks of the current block 1804. For example, the encoder may predictively encode the BV 1802 using merge mode or AMVP, as explained above. For AMVP, the encoder may encode the BV 1802 as the difference between the BV 1802 and a BV predictor (BVP) 1808, as Figure 18A The encoder can select a BVP 1808 from a list of candidate BVPs. The candidate BVPs can come from previously decoded BVPs of neighboring blocks of the current block 1804 or other sources. Both the encoder and the decoder can generate or determine a list of candidate BVPs.

[0183] After the encoder selects a BVP 1808 from the list of candidate BVPs, the encoder may signal an indication of the BVP 1808 and a BV difference (BVD) 1810 in the bitstream. The encoder may indicate the BVP 1808 in the bitstream via an index to the list of candidate BVPs or via one or more flags. The BVD 1810 may be calculated based on the difference between the BV 1802 and the BVP 1808. The BVD 1810 may include a horizontal component (BVDx) 1812 and a vertical component (BVDy) 1814, which may be determined according to (17) and (18) above, respectively. The two components BVDx 1812 and BVDy 1814 each include a magnitude and a sign. As Figure 18A As shown, BVDx1812 has a fixed-length binary magnitude of 10011 (or decimal 19) and a negative sign (in Figure 18A In the example above, the positive horizontal direction is to the right). Figure 18A As further shown in FIG. 1 , BVDy 1814 has a fixed length binary magnitude of 01011 (or decimal 11) and a positive sign (in Figure 18A The positive vertical direction points downward in the example shown). The encoder may indicate BVD 1810 in the bitstream via its two components BVDx 1812 and BVDy 1814.

[0184] The decoder can decode the BV 1802 by adding the BVD 1810 to the BVP 1808. The decoder can then decode the current block 1804 by using the BV 1802 to determine a reference block 1806 that forms a prediction of the current block 1804 and combining the prediction with the prediction error. The decoder can determine the reference block 1806 by adding the BV 1802 to the position of the current block 1804, which can give the position of the reference block 1806.

[0185] As explained above, the magnitude of the BVD 1810 can be encoded in bypass arithmetic coding mode. Although bypass arithmetic coding mode can be used to speed up the arithmetic coding process, compression of the magnitude symbols of the BVD 1810 encoded in bypass arithmetic coding mode is limited because their probability distribution is uniformly distributed (or at least assumed to be uniformly distributed). According to information theory, a symbol cannot be compressed at a rate less than its entropy without losing information, and symbols with a uniform probability distribution have the maximum entropy. Therefore, symbols encoded using bypass arithmetic coding mode generally require more bits to encode than symbols encoded using conventional arithmetic coding mode.

[0186] Example embodiments described herein can improve compression efficiency for one or more magnitude symbols of a BVD 1810. For example, instead of directly entropy encoding the magnitude symbols of the BVD 1810, the encoder can entropy encode an indication of whether the value of the magnitude symbol of the BVD 1810 matches the value of the same magnitude symbol of a BVD candidate used as a predictor for the BVD 1810. The indication of whether the value of the magnitude symbol of the BVD 1810 matches the value of the magnitude symbol of the BVD predictor can have a non-uniform probability distribution, thereby achieving improved compression efficiency. The encoder can select a BVD predictor from a plurality of BVD candidates based on their costs. The BVD candidates can include a BVD candidate for each possible value of the magnitude symbol of the BVD 1810. For example, the magnitude symbol of the BVD 1810, represented in binary form, has only two possible values. Thus, the BVD candidates may include two BVD candidates for this representation (e.g., one for each possible value of the magnitude sign of the encoded BVD 1810): a first BVD candidate that is equal to the BVD 1810 itself, and a second BVD candidate that is equal to the BVD 1810 but has an opposite (or another) value for the magnitude sign of the BVD 1810. The cost of each of the multiple BVD candidates may be calculated based on the difference between the template of the current block 1804 and the template of the candidate reference block. The candidate reference block may be shifted relative to the current block by the sum of the BVD candidates and the BVP 1808.

[0187] To provide a more concrete example, Figure 18A An example magnitude symbol 1816 indicating the BVD 1810 to be entropy coded. The magnitude symbol 1816 of the BVD 1810 is the horizontal component BVD of the BVD 1810. x 1812 and has a binary value of "0". As explained above, instead of directly entropy encoding the magnitude sign 1816 of the BVD 1810, the encoder may entropy encode an indication of whether the value of the magnitude sign 1816 of the BVD 1810 matches the value of the same magnitude sign of a BVD candidate used as a predictor for the BVD 1810. The encoder may select a BVD predictor from a plurality of BVD candidates based on their costs. The BVD candidates may include a BVD candidate for each of two possible values ​​{0, 1} of the magnitude sign 1816 of the BVD 1810: a first BVD candidate 1818 that is equal to the BVD 1810 itself, and a second BVD candidate 1820 that is equal to the BVD 1810 but has an opposite (or another) value for the magnitude sign 1816 of the BVD 1810.

[0188] Figure 18BAn example BVD candidate for entropy encoding the magnitude sign of the BVD according to an embodiment of the present disclosure is shown. Figure 18B In the example shown, two BVD candidates are used to entropy encode the magnitude symbol 1816 of the BVD 1810. More specifically, Figure 18B 1810 itself and a BVD candidate 1820 that is equal to the BVD 1810 but has an opposite (or another) value for the magnitude sign 1816 of the BVD 1810. In the case of the opposite (or another) value for the magnitude sign 1816 of the BVD candidate 1818, the BVD candidate 1820 has a horizontal component BVD x 1822, which has a fixed-length binary magnitude of 11011 (or 27 in decimal) and a negative sign. The vertical component BVD of the BVD candidate 1820 y 1824 and the vertical component BVD of BVD candidate 1818 (or BVD 1810) y 1814 has the same fixed-length binary magnitude 01011 (or decimal 11) and positive sign.

[0189] The cost of each of the plurality of BVD candidates may be calculated based on a difference between a template of the current block 1804 and a template of a candidate reference block shifted relative to the current block 1804 by the sum of the BVD candidate and the BVP 1808. For example, the encoder may determine the cost of the BVD candidate 1818 based on a difference between a template 1826 of the current block 1804 and a template 1828 of a candidate reference block 1830 shifted relative to the current block 1804 by the sum of the BVD candidate 1818 and the BVP 1808. The encoder may determine the difference between the template 1826 and the template 1828 based on a difference (e.g., sum of squared differences (SSD), sum of absolute differences (SAD), sum of absolute transformed differences (SATD), mean-removed SAD, or mean-removed SSD) between samples of the template 1826 and the samples of the template 1828. The encoder can similarly determine the cost of the BVD candidate 1820 based on the difference between the template 1826 of the current block 1804 and the template 1832 of the candidate reference block 1834 shifted relative to the current block 1804 by the sum of the BVD candidate 1820 and the BVP 1808. The encoder can determine the difference between the template 1826 and the template 1832 based on the difference (e.g., SSD, SAD, SATD, mean-removed SAD, or mean-removed SSD) between the samples of the template 1826 and the samples of the template 1828. The templates 1826, 1828, and 1832 can include one or more samples to the left and / or above their respective blocks. For example, the templates 1826, 1828, and 1832 can include samples from one or more columns to the left of their respective blocks and / or from one or more rows above their respective blocks. Figure 18BOne example position and shape of templates 1826, 1828, and 1832 is shown (eg, an L-shape rotated 90 degrees clockwise).

[0190] After determining the cost of each of the multiple BVD candidates, the encoder may select one of the multiple BVD candidates as a BVD predictor. For example, the encoder may select the BVD candidate with the smallest cost among the multiple BVD candidates as the BVD predictor.

[0191] Figure 18C An example of entropy encoding an indication of whether a value of a magnitude sign of a BVD matches a value of a magnitude sign of a BVD candidate used as a predictor of the BVD according to an embodiment of the present disclosure is shown. Figure 18C A table is further shown with the components (horizontal and vertical) and costs for each BVD candidate 1818 and 1820 in the corresponding row. In this example, it is assumed that BVD candidates 1818 and 1820 are the only BVD candidates. In other examples, more BVD candidates can be used. The rows in the table are sorted by the cost of BVD candidates 1818 and 1820, where the top BVD candidate has the lowest cost. In this example, BVD candidate 1818 has the lowest cost among BVD candidates 1818 and 1820. Therefore, the encoder can select BVD candidate 1818 as the BVD predictor 1836 for BVD 1810.

[0192] After selecting BVD candidate 1818 as BVD predictor 1836, the encoder may entropy encode an indication 1838 of whether the value of magnitude sign 1816 of BVD 1810 matches the value of magnitude sign 1816 in BVD predictor 1836. Magnitude sign 1816 of BVD predictor 1836 has a value of "0," which matches the value of magnitude sign 1816 of BVD 1810. In this example, indication 1838 would indicate that the value of magnitude sign 1816 of BVD 1810 matches the value of magnitude sign 1816 of BVD predictor 1836. In one example, indication 1838 can be a single bit having the following values: "0" when the value of magnitude sign 1816 of BVD 1810 matches the value of magnitude sign 1816 of BVD predictor 1836, and "1" when the value of magnitude sign 1816 of BVD 1810 does not match the value of magnitude sign 1816 of BVD predictor 1836. Logic 1840 can be used to determine indication 1838. In one example, logic 1840 can implement a logical exclusive OR (XOR) function. Note that in other examples where magnitude sign 1816 is non-binary, indication 1838 can indicate the first candidate among a plurality of candidates (e.g., as ranked based on their respective costs) having a value of magnitude sign 1816 that matches the value of magnitude sign 1816 in BVD 1810.

[0193] exist Figure 18C In the example of , the encoder may entropy encode indication 1838 using arithmetic encoder 1842. Based on the method for determining indication 1838 as described above, indication 1838 may have a non-uniform probability distribution. Therefore, arithmetic encoder 1842 may process indication 1838 in a conventional arithmetic coding mode, as described above. For example, arithmetic encoder 1842 may subdivide the current coding interval into m non-adjacent subintervals. Each of the m non-adjacent subintervals may have a width proportional to the probability that the encoded symbol has a different value from the value in the m-ary source alphabet. In the case of a binary indication 1838, m is equal to two, and the current coding interval may be subdivided into two non-adjacent intervals, each having a width proportional to the probability of a different value from the two possible values ​​{0, 1} of the encoded indication 1838. The probabilities of the two possible values ​​of indication 1838 may be indicated by probability model 1844 for indication 1838. The arithmetic encoder 1842 may then encode the indication 1838 by selecting the subinterval corresponding to the actual value of the indication 1838 as the new encoding interval for the next binary symbol to be encoded.

[0194] The arithmetic coder 1842 may receive a probability model 1844 from a context modeler 1846. The context modeler 1846 may determine the probability model 1844 of the indication 1838 by making a fixed selection or an adaptive selection from two or more probability models. For example, the context modeler 1846 may determine the probability model 1844 of the indication 1838 by making a fixed selection or an adaptive selection from two or more probability models. x The position of the magnitude symbol 1816 in 1812 or the BVD of BVD 1810 x The index of the position of the magnitude symbol 1816 in 1812 (eg, the value indicating the position) is fixedly selected or adaptively selected from two or more probability models to determine the probability model 1844. The BVD of the BVD 1810 x The position (or index of the position) of the magnitude symbol 1816 in 1812 provides the distance 1864 between the two candidate BVDs ( Figure 18B ). The likelihood that the value of the magnitude sign 1816 of the BVD predictor 1836 matches the value of the magnitude sign 1816 of the BVD 1810 may be related to the distance 1864. More specifically, the greater the value of the distance 1864 between the candidate BVDs, the greater the degree of difference between the corresponding candidate templates of the candidate BVDs may be. In turn, the greater the difference between the corresponding candidate templates of the BVD candidates, the more likely the cost of the BVD candidate is to accurately reflect a BVD candidate having a value of the magnitude sign 1816 that matches the value of the magnitude sign 1816 of the BVD 1810. Therefore, the BVD of the BVD 1810 x The position (or index of the position) of the magnitude symbol 1816 in 1812 may help select the probability model 1844 indicating 1838 .

[0195] To adaptively select from two or more probability models, the context modeler 1846 can convert the BVD of the BVD 1810 into x 1812 (also referred to herein as the significance of the magnitude symbol 1816) is compared to one or more thresholds. For example, the context modeler 1846 may compare the BVD of the BVD 1810 to the BVD of the BVD 1810. x The position (and index of the position) of the magnitude symbol 1816 in 1812 is compared with the first threshold. x If the position (or index of the position) of the magnitude symbol 1816 in 1812 is less than a threshold, the context modeler 1846 may select the first probability model indicated by 1838. x1812 is greater than a threshold value, the context modeler 1846 may select the second probability model indicated by 1838. In another example, based on the BVD of the BVD 1810 x If the position (or index of the position) of the magnitude symbol 1816 in 1812 is greater than a threshold, the context modeler 1846 may change the BVD of the BVD 1810 to x The position (or index of the position) of the magnitude symbol 1816 in 1812 is compared with the second threshold value. x If the position (or index of the position) of the magnitude symbol 1816 in 1812 is less than the second threshold, the context modeler 1846 may select the second probability model indicated by 1838. x The position (or index of the position) of the magnitude symbol 1816 in 1812 is greater than the second threshold, and the context modeler 1846 may select the third probability model indicating 1838 .

[0196] In another example, the context modeler 1846 may model the BVD 1810 (or the BVD of the BVD 1810) based on an incremental change in the value of the magnitude sign 1816 of the BVD 1810 (also further referred to herein as the significance of the magnitude sign 1816). x 1812) is determined by making a fixed selection or adaptive selection from two or more probability models to determine a probability model 1844. The BVD 1810 (or the BVD of the BVD 1810) is determined for an incremental change in the value of the magnitude symbol 1816 of the BVD 1810. x 1812) can be determined as a value change of 2 (n-1) , where n is the BVD of BVD 1810 x The bit position of the magnitude symbol 1816 in 1812. Figure 18A In the example of -D, n=4 and thus the BVD 1810 (or the BVD of the BVD 1810) for an incremental change in the value of the magnitude sign 1816 of the BVD 1810 x 1812) can be determined as a value change of 2 (4-1) or 8. The BVD 1810 (or the BVD of the BVD 1810) for the incremental change in the value of the magnitude symbol 1816 of the BVD 1810 x 1812) provides the distance 1864 between the two candidate BVDs ( Figure 18B1816 of the BVD predictor 1836 may be correlated with the distance 1864. More specifically, the greater the value of the distance 1864 between the candidate BVDs, the greater the degree of difference between the corresponding candidate templates of the candidate BVDs. In turn, the greater the difference between the corresponding candidate templates of the BVD candidates, the more likely the cost of the BVD candidate will accurately reflect a BVD candidate having a value of the magnitude sign 1816 that matches the value of the magnitude sign 1816 of the BVD 1810. Thus, the BVD 1810 (or the BVD of the BVD 1810) for an incremental change in the value of the magnitude sign 1816 of the BVD 1810 may be correlated with the distance 1864. x 1812) can help select the probability model 1844 indicating 1838.

[0197] To adaptively select from two or more probability models, the context modeler 1846 may select the BVD 1810 (or the BVD of the BVD 1810) for incremental changes in the value of the magnitude sign 1816 of the BVD 1810. x 1812) to one or more thresholds. For example, the context modeler 1846 may compare the BVD 1810 (or the BVD of the BVD 1810) to an incremental change in the value of the magnitude sign 1816 of the BVD 1810. x The value of the magnitude sign 1816 of the BVD 1810 is compared with the first threshold value. x 1812) is less than a threshold value, the context modeler 1846 may select the first probability model of indication 1838. Based on the incremental change in the value of the magnitude symbol 1816 for the BVD 1810 (or the BVD of the BVD 1810), the context modeler 1846 may select the first probability model of indication 1838. x 1812) is greater than a threshold, the context modeler 1846 may select the second probability model of indication 1838. In another example, based on the incremental change in the value of the magnitude sign 1816 for the BVD 1810 (or the BVD of the BVD 1810), the context modeler 1846 may select the second probability model of indication 1838. x 1812) is greater than a threshold value, the context modeler 1846 may change the BVD 1810 (or the BVD of the BVD 1810) by an incremental change in the value of the magnitude sign 1816 of the BVD 1810. x The value of the magnitude sign 1816 of the BVD 1810 is compared to a second threshold value. x1812) is less than a second threshold, the context modeler 1846 may select the second probability model of indication 1838. Based on the incremental change in the value of the magnitude symbol 1816 for the BVD 1810 (or the BVD of the BVD 1810), the context modeler 1846 may select the second probability model of indication 1838. x 1812) is greater than the second threshold, the context modeler 1846 may select a third probability model indicating 1838.

[0198] like Figure 18C As shown in FIG, the probability model 1844 may include two parameters: the probability P for indicating the lowest probability symbol (LPS) of 1838; LPS and the value v for indicating the highest probability symbol (MPS) of 1838 MPS In other examples, in addition to or in lieu of the probability P for indicating the LPS of 1838 LPS , the probability model 1844 may include a probability P for indicating the MPS of 1838 MPS Similarly, in other examples, in addition to or in place of the value v used to indicate the MPS of 1838 MPS , the probability model 1844 may include a value v for indicating the LPS of 1838 LPS After arithmetic encoder 1842 encodes indication 1838, arithmetic encoder 1842 may provide one or more probability model update parameters 1850 to context modeler 1846. Context modeler 1846 may adapt probability model 1844 based on one or more probability model update parameters 1850. For example, one or more probability model update parameters 1850 may include the actual encoded value of indication 1838. Context modeler 1846 may adjust probability model 1844 if the actual encoded value of indication 1838 is not equal to v MPS In the case of increasing the P of 1838 LPS to update the probability model 1844, otherwise by reducing the P of the indicator 1838 LPS to update the probability model.

[0199] After processing the plurality of binary symbols (e.g., corresponding to one or more syntax elements), the arithmetic encoder 1842 may determine a value in a final coding interval range as an arithmetic codeword 1852 for the binary symbols. The arithmetic encoder 1842 may then output the arithmetic codeword 1852. For example, the arithmetic encoder 1842 may output the arithmetic codeword 1852 to a bitstream that may be received and processed by a video decoder.

[0200] Figure 18DAn example of entropy decoding an indication of whether the value of the magnitude sign of the BVD matches the value of the magnitude sign of the BVD candidate used as a predictor of the BVD and determining the magnitude sign of the BVD using the indication according to an embodiment of the present disclosure is shown. Figure 18D In the example shown, according to an embodiment of the present disclosure, a decoder (eg, Figure 3 The decoder 300 in can receive the arithmetic codeword 1852, arithmetically decode the indication 1838 from the arithmetic codeword 1852 and use the indication 1838 to determine the magnitude sign 1816 of the BVD 1810.

[0201] The decoder may receive arithmetic codeword 1852 in a bitstream. The decoder may provide arithmetic codeword 1852 to an arithmetic decoder 1854. Based on the method for determining indication 1838 as described above, indication 1838 may have a non-uniform probability distribution. Therefore, arithmetic decoder 1854 may process indication 1838 in a conventional arithmetic decoding mode. For example, arithmetic decoder 1854 may perform recursive interval subdivision as explained herein to decode symbols encoded by arithmetic codeword 1852. For example, arithmetic decoder 1854 may arithmetically decode symbols taken from an m-ary source alphabet by dividing the initial coding interval into m non-adjacent subintervals. Each of the m non-adjacent subintervals may have a width proportional to the probability that the symbol has a different value from the value in the m-ary source alphabet. In the case of a binary symbol such as indication 1838, m is equal to two and the initial coding interval may be subdivided into two non-adjacent intervals, each having a width proportional to the probability of a different value from the two possible values ​​{0, 1}. The probability that a symbol has different values ​​in the m-ary source alphabet can be called a probability model of the symbol, as mentioned above. The symbol is arithmetically decoded from the arithmetic codeword 1852 by determining the symbol value corresponding to the subinterval in which the arithmetic codeword falls. The decoder can sequentially decode the sequence s = {s1, s2, ..., s} encoded by the arithmetic codeword 1852 by recursively applying this interval subdivision scheme N times and determining in which subinterval the arithmetic codeword 1852 falls at each iteration. N ) for each symbol s i .

[0202] When decoding a symbol corresponding to indication 1838, arithmetic decoder 1854 may receive a probability model 1844 for indication 1838 from context modeler 1856. Context modeler 1856 may be selected by a fixed or by using the same Figure 18C The probability model 1844 for the indication 1838 is determined by adaptively selecting from two or more probability models in the same manner as described for the context modeler 1846 in .

[0203] like Figure 18DAs shown in FIG, after arithmetic decoder 1854 decodes indication 1838, arithmetic decoder 1854 may provide one or more probability model update parameters 1850 to context modeler 1856. Context modeler 1856 may adapt probability model 1844 based on one or more probability model update parameters 1850. For example, one or more probability model update parameters 1850 may include an actual decoded value of indication 1838. Context modeler 1856 may adjust probability model 1844 if the actual decoded value of indication 1838 is not equal to v MPS In the case of increasing the P of 1838 LPS to update the probability model 1844, otherwise by reducing the P of the indicator 1838 LPS to update the probability model.

[0204] After entropy decoding the indication 1838, the decoder may determine the value of the magnitude sign 1816 of the BVD 1810 based on the value of the magnitude sign 1816 of the BVD predictor 1836 and the value of the indication 1838. For example, the decoder may determine the value of the magnitude sign 1816 of the BVD 1810 to be equal to the magnitude sign of the BVD predictor 1836 based on the indication 1838 indicating that the value of the magnitude sign 1816 of the BVD 1810 matches the value of the magnitude sign 1816 of the BVD predictor 1836. Conversely, the decoder may determine the value of the magnitude sign 1816 of the BVD 1810 to be unequal to (or equal to the opposite of) the magnitude sign 1816 of the BVD predictor 1836 based on the indication 1838 indicating that the value of the magnitude sign 1816 of the BVD 1810 does not match the value of the magnitude sign 1816 of the BVD predictor 1836. Magnitude sign 1816 of BVD predictor 1836 has a value of "0," which matches the value of magnitude sign 1816 of BVD 1810. In this example, indication 1838 indicates that the value of magnitude sign 1816 of BVD 1810 matches the value of magnitude sign 1816 of BVD predictor 1836. In one example, indication 1838 may be a single bit having the following values: "0" when the value of magnitude sign 1816 of BVD 1810 matches the value of magnitude sign 1816 of BVD predictor 1836, and "1" when the value of magnitude sign 1816 of BVD 1810 does not match the value of magnitude sign 1816 of BVD predictor 1836. Logic 1858 may be used to determine magnitude sign 1816 of BVD 1810. In one example, logic 1858 may implement a logical XOR function. It should be noted that in other examples where the magnitude symbol 1816 is non-binary, indication 1838 may indicate a first candidate among multiple candidates (e.g., as sorted based on their respective costs) having a value of the magnitude symbol 1816 that matches the value of the magnitude symbol 1816 in BVD 1810.

[0205] The decoder can determine the value of the magnitude sign 1816 of the BVD predictor 1836 in the same manner as the encoder described above. More specifically, the decoder can select the BVD predictor 1836 from the plurality of BVD candidates based on their costs. The BVD candidates can include a BVD candidate for each possible value of the magnitude sign of the BVD 1810. For example, the magnitude sign of the BVD 1810 represented in binary form has only two possible values. Therefore, the BVD candidates can include at least two BVD candidates for this representation (e.g., one for each possible value of the magnitude sign of the BVD 1810 being encoded): a first BVD candidate that is equal to the BVD 1810 itself, and a second BVD candidate that is equal to the BVD 1810, but has an opposite (or another) value for the magnitude sign of the BVD 1810. The cost of each of the multiple BVD candidates can be calculated as described above with respect to the encoder based on the difference between the template of the current block 1804 and the template of the candidate reference block. The candidate reference block can be shifted relative to the current block by the sum of the BVD candidate and the BVP 1808. The decoder can select the BVD candidate with the lowest cost as the BVD predictor 1836.

[0206] It should be further noted that in addition to or instead of applying BVD x The method for entropy encoding an indication of whether the value of the magnitude symbol of the BVD matches the value of the magnitude symbol of the BVD candidate used as a predictor of the BVD discussed above with respect to FIG. 18 can be applied to the BVD y One or more magnitude symbols of 1814.

[0207] It should be further noted that, in addition to or in lieu of being applied to one or more magnitude signs of the BVD used in IBC, the method discussed above with respect to FIG. 18 can be further applied to one or more magnitude signs of the MVD used in inter-frame prediction. For inter-frame prediction, the terms BV, BVP, BVD, and BVD candidate used in FIG. 18 can be replaced by the terms MV, MVP, MVD, and MVD candidate, as will be appreciated by one of ordinary skill in the art based on this disclosure.

[0208] It should be further noted that the method discussed above with respect to Figure 18 is applied to IBC and inter prediction based on a translational motion model of the prediction block.In other examples, the method discussed above with respect to Figure 18 can be applied to IBC and inter prediction based on an affine motion model of the prediction block.

[0209] It should be further noted that the method discussed above with respect to FIG. 18 for entropy encoding an indication of whether the value of the magnitude symbol of the BVD matches the value of the magnitude symbol of the BVD candidate used as a predictor of the BVD can be applied to multiple magnitude symbols of the BVD. For example, the above method can be further applied to the BVD x One or more magnitude symbols other than magnitude symbol 1816 of 1812 and / or applied to BVD y One or more magnitude signs of 1814. For a BVD applying the method discussed above with respect to FIG. x 1812 and / or BVD y For each additional magnitude symbol of 1814, an additional candidate BVD may be determined. For example, applying the method discussed above with respect to FIG. 18 to the BVD x 1812 and / or BVD y 1814 N amplitude symbols (where N is an integer value), it is possible to determine 2 N Different BVD candidates - targeting BVD x 1812 and / or BVD y Each possible combination of values ​​of the N magnitude symbols of 1814 has one. A cost value may be further determined for each of the BVD candidates to determine the cost for the BVD x 1812 and / or BVD y Each of the N magnitude symbols 1814 encodes a BVD predictor.

[0210] Furthermore, it should be further noted that although the component BVD 1810 y 1814 and BVD x 1816 and the components of the BVD candidate are described above as using fixed-length binary representation, but the components of BVD 1810 BVD y 1814 and BVD x 1816 and other binarizations of the components of the BVD candidate are also possible. For example, the component BVD of the BVD 1810 y 1814 and BVD x 1816 can be represented by one of a wide range of codes consisting of two parts: a prefix and a suffix.

[0211] There are a wide range of codes that include a first portion indicating a range of values ​​and a second portion indicating an exact value within the range of values, such as Rice codes, Golomb codes (e.g., Golomb-Rice codes or exponential Golomb codes), and fixed-length codes. For example, referring back to FIG. 18 , the horizontal component BVD 1810 may be converted to BVD using a Golomb-Rice code. xThe amplitude of 1812 is binarized. The Golomb-Rice code has the structure discussed above, comprising a first portion called a "prefix" portion and a second portion called a "suffix" portion. The prefix indicates a value range, and the suffix indicates an exact value within the value range. A Golomb-Rice code Cgrk(v) of order k may include a unary coded prefix and k suffix bits (e.g., a suffix of bit length k). The k suffix bits are an integer 0≤i<2 k The Golomb code further uses a tunable parameter M to divide the input value v into a prefix part and a suffix part, specifically, the prefix value q as the result of dividing by M and the suffix value v as the remainder s The Columbus-Rice code is an exponential code where the parameter M is 2 (e.g., 2 k ). For an input value v where v is a non-negative integer, the prefix part (q) and the suffix part (v s ) can be determined by the following formula:

[0212]

[0213] v s =vq(2 k ). (20)

[0214] An example of a Columbus-Rice code with k=4 is given in Table 1 below. In the table and the following description, x0, x1, ..., x n represents the bits of the codeword, where x n ∈{0,1}.

[0215] Table 1

[0216]

[0217] The number of prefix bits is determined by n p Indicates that the number of suffix bits is represented by n s For Columbus-Rice codes, the number of suffix bits is n s = k. When encoding a value v, the number of prefix bits is determined by:

[0218]

[0219] in is the integer part of x. The suffix is ​​the following n s Bit representation:

[0220] v s =v-2 k (n p -1). (22)

[0221] The Golomb-Rice code discussed above uses a fixed-length suffix. The length of the suffix can also be determined by the length of the prefix. The Exponential Golomb code (Exp-Golomb) uses this method and can be further used to calculate the horizontal component BVD of BVD1810. x The amplitude of 1812 is binarized. K-order exponential Columbus code C egk (v) Contains a unary prefix code and a variable length suffix. Suffix n s The number of bits in is determined by the value n p Determined as follows:

[0222] n s =k+n p -1. (23)

[0223] C egk The prefix of (v) is n p The number of is determined from the value v by:

[0224]

[0225] Then, the suffix is ​​the following n s Bit representation:

[0226]

[0227] An example of an Exponential Golomb code with k=1 is given in Table 2 below.

[0228] Table 2

[0229]

[0230]

[0231] In the example of FIG. 18 , the horizontal component BVD 1810 x The magnitude of 1812 has a decimal value of 19, which can be represented by either a Golomb-Rice code or an Exponential Golomb code. For example, BVD x The magnitude of 1812 can be represented by an exponential Golomb code of order k=4 with a prefix of "0001" and a suffix of "0101". The prefix "0001" indicates BVD x The magnitude of 1812 falls within the range of values ​​14 to 29, and the suffix "0101" indicates BVD x The magnitude of 1812 has a value of exactly 19 within the range of values ​​14 to 29. In the example of FIG. 18 , the vertical component BVD of BVD 1810 is y The magnitude of 1814 has a decimal value of 11, which can be represented by either a Golomb-Rice code or an Exponential Golomb code. For example, BVD yThe magnitude of 1814 can be represented by an exponential Golomb code of order k=4 with a prefix of "001" and a suffix of "101". The prefix "001" indicates BVD y The magnitude of 1814 falls within the range of values ​​6 to 13, and the suffix "101" indicates BVD y The magnitude of 1814 has a value of exactly 11 within the range of values ​​6 to 13.

[0232] It should be further noted that, in addition to or in lieu of being applied to one or more magnitude signs of the BVD used in IBC, the method discussed above with respect to FIG. 18 may be further applied to one or more magnitude signs of the MVD used in inter-frame prediction. For inter-frame prediction, the terms BV, BVP, BVD, and BVD candidate used in FIG. 18 may be replaced by the terms MV, MVP, MVD, and MVD candidate, as will be understood by one of ordinary skill in the art based on this disclosure. It should be further noted that the method discussed above with respect to FIG. 18 may be applied to IBC and inter-frame prediction based on a translational motion model of the prediction block. In other examples, the method discussed above with respect to FIG. 18 may be applied to IBC and inter-frame prediction based on an affine motion model of the prediction block. As used herein, the term "binary number" may refer to a bit or binary symbol used to encode and decode a sign of a BVD or MVD.

[0233] Figure 19 An example IBC encoding according to an embodiment of the present disclosure is shown. Figure 19 In the encoder (for example, Figure 2 The encoder 200 in FIG. 1 uses IBC mode to decode a current block 1900 in a current picture (or portion of a current picture) 1902. The current block 1900 may be a coded block within a coding tree unit (CTU) 1904. Unlike inter prediction, which searches for reference blocks in previously decoded pictures that are different from the picture of the current block being encoded, IBC searches for reference blocks in the same current picture as the current block. Therefore, only a portion of the current picture may be used to search for reference blocks in IBC. For example, only a portion of the current picture may have been decoded before encoding the current block. This ensures that the encoding and decoding systems can produce the same results, but also limits the IBC reference area.

[0234] In HEVC, VVC and other video compression standards, z-scanning can be used to scan blocks from left to right and from top to bottom to form a sequential order for encoding / decoding. Based on z-scanning, the CTUs to the left and above the current CTU 1904 (represented by the 1900 blocks) can be encoded / decoded before the current CTU 1904 and the current block 1900. Figure 19 Therefore, the samples of these CTUs ( Figure 191900) may form an exemplary IBC reference region 1906 for determining a reference block to predict the current block 1900. In other video encoders and decoders, different sequence orders for encoding / decoding may be used, which may affect the IBC reference region 1906 accordingly.

[0235] In addition to the encoding / decoding sequence order, one or more additional reference region constraints may be placed on the IBC reference region 1906. For example, the IBC reference region 1906 may be constrained based on limited memory for storing reference samples, or constrained to CTUs based on a parallel processing approach such as tiles or wavefront parallel processing (WPP). Tiles may be used as part of a picture partitioning process to flexibly subdivide a picture into rectangular regions of CTUs such that coding dependencies between CTUs of different tiles are not allowed. WPP may similarly be used as part of a picture partitioning process to partition a picture into CTU rows such that dependencies between CTUs of different partitions are not allowed. Each of these tools may enable parallel processing of picture partitions.

[0236] It should be noted that throughout this disclosure, references to the position of a block refer to the position of the top left sample of the block. However, in other examples, the position of a block can be determined by the position of another sample in the block. The position of a sample in a picture is indicated by the sample number in the horizontal direction (given by the variable x) and the sample number in the vertical direction (given by the variable y) relative to the origin of the picture coordinate system in the top left corner of the picture ((x, y) = (0, 0)) or relative to the top left sample of the block (e.g., CTU) where the sample is positioned. In the horizontal x direction, the positive direction is to the right. Therefore, as x increases, the sample position moves further to the right in the positive horizontal direction. In the vertical y direction, the positive direction is downward. Therefore, as y increases, the sample position moves further downward in the positive vertical direction.

[0237] The encoder may apply block matching techniques to determine a block vector (BV) 1908, which indicates the relative displacement from current block 1900 to a reference block within IBC reference region 1906, shown as block 1910 (or intra-block compensated prediction), that "best matches" current block 1900. For example, block 1910 may have been determined as the reference block within IBC reference region 1906 because it is a better match than other blocks within IBC reference region 1906 (e.g., blocks 1918 and 1920). In this example, IBC reference region 1906 is a constraint placed on BV 1908. BV 1908 is constrained by IBC reference region 1906 to indicate the displacement from current block 1900 to a reference block within IBC reference region 1906 (shown as block 1910). The encoder may determine the best matching reference block as block 1910 from among the tested blocks within IBC reference region 1906 (e.g., blocks 1918 and 1920) during the search process. The encoder may determine that the reference block is the best matching reference block based on one or more cost criteria, such as a rate-distortion criterion (e.g., Lagrangian rate-distortion cost). The one or more cost criteria may be based on, for example, the difference between the predicted samples of the reference block and the original samples of the current block (e.g., sum of squared differences (SSD), sum of absolute differences (SAD), sum of absolute transformed differences (SATD), or a difference determined based on a hash function). The reference block 1910 may include decoded (or reconstructed) samples of the current picture 1902 before being processed by an in-loop filtering operation (e.g., deblocking or SAO filtering).

[0238] Once the reference block 1910 is determined and / or generated for the current block 1900 using IBC, the encoder can determine or use the difference (e.g., the corresponding sample-by-sample difference) between the current block 1900 and the reference block 1910. The difference can be referred to as a prediction error or residual. The encoder can then store and / or signal the prediction error and related prediction information in the bitstream for decoding.

[0239] The prediction information may include a BV 1908. In other cases, the prediction information may include an indication of the BV 1908. For example, in HEVC, VVC, and other video compression schemes, the BV 1908 may be predictively encoded before being stored or signaled in the bitstream as previously explained. The BV 1908 of the current block 1900 may be predictively encoded using a technique similar to AMVP for inter-frame prediction. This technique may be referred to as BV prediction and difference coding. For the BV prediction and difference coding technique, the encoder may encode the BV 1908 as the difference between the BV 1908 and a BVP predictor (BVP) 1912. The encoder may select the BVP 1912 from a list of candidate BVPs. In the example, the BVP 1912 points to a location 1916 within the IBV reference area 1906. The candidate BVP may come from a previously decoded BV of a neighboring block of the current block 1900 or from other sources. In one example, if BVs of neighboring blocks of the current block 1900 are not available, an empty BVP candidate (eg, where the x and y components have zero magnitude) may be added to the list of candidate BVPs. Both the encoder and the decoder may generate or determine the list of candidate BVPs.

[0240] After the encoder selects BVP 1912 from the candidate BVP list, the encoder may determine a BV difference (BVD) 1914. BVD 1914 may be calculated based on the difference between BV 1908 and BVP 1912. For example, BVD 1914 may be calculated based on the above description of BVD. x and BVD y The two directional components of equations (17) and (18) are expressed as follows:

[0241] BVD x =BVx-BVP x (17)

[0242] BVD y =BVy-BVP y (18)

[0243] Among them BVD x and BVD y represent the horizontal and vertical components of BVD 1914, respectively. x and BV y Represents the horizontal and vertical components of BV1908, and BVP x and BVP y Denote the horizontal component and the vertical component of the BVP 1912, respectively. For reference purposes, the horizontal x-axis and the vertical y-axis are indicated in the lower right corner of the current picture 1902. Figure 19 In the example, the x-axis increases from left to right, and the y-axis increases from top to bottom.

[0244] The encoder may signal in the bitstream the prediction error, an indication of the selected BVP 1912 (e.g., via an index into a candidate BVP list), and the individual components of the BVD 1914 given by equations (17) and (18). The decoder (e.g., Figure 3 The decoder 300 in FIG. 1 may decode the BV 1908 by adding the corresponding components of the BVD 1914 to the corresponding components of the BVP 1912. The decoder may then decode the current block 1900 by determining and / or generating a reference block 1910 that forms a prediction of the current block 1900 using the decoded BV and combining the prediction with a prediction error received in the bitstream.

[0245] When encoding a suffix value, for example, for a component of a block vector difference (BVD), the context (and number) of the suffix binary digits can be determined based on the significance of the binary digits. As used herein, the term "binary digit" may refer to a bit or binary symbol used to encode and decode the symbol of a BVD or MVD. The significance of a binary digit may be determined based on its effect on the length (or magnitude) of the BVD component. However, the effect on the length of the BVD component may be further defined based on the block vector (BV) resolution indicated in the bitstream. For example, the integer motion vector (IMV) flag may affect how the BVD component is derived from the BVD symbol (binary digit). For example, when the IMV flag is equal to 0, a 1-pixel resolution may be selected for the BVD, such that an increment of 1 in the BVD symbol corresponds to an increase of 1 sample in the BVD component length. Furthermore, for example, when the IMV flag is equal to 1, a 4-pixel resolution may be selected for the BVD, such that an increment of 1 in the BVD symbol corresponds to an increase of 4 samples in the BVD component length. The IMV flag is further referred to herein as "imv_flag()". In an example, the resolution may indicate an integer resolution of a fractional resolution of the BVD. In another example, the resolution of the BVD may also correspond to the precision of the BVD.

[0246] Figure 20 An example of signaling a BVD component according to an embodiment of the present disclosure is shown. The signaling of the BVD component may include several levels. The first level may include an indication of whether the horizontal and / or vertical components of the BVD are non-zero (see Figure 20 The second level may contain the remainder indicating the absolute value of the horizontal and vertical components of the BVD. The remainder value may be defined as the value V indicated in the first level minus the value V indicated in the first level. init For BVD signaling, each component can indicate at most one flag and V init= 1. For motion vector difference (MVD) or transform coefficient signaling, V init The value of may be equal to 2, and more flags per MVD component may be specified at the first level.

[0247] In H.266 (Versatile Video Coding VVC), the same syntax can be used for both MVD and BVD. Table 3 below shows the order of syntax elements for both MVD and BVD coding in H.266.

[0248] Table 3

[0249]

[0250]

[0251] The syntax elements shown in Table 3 have the following semantics. abs_mvd_greater0_flag[compIdx] specifies whether the absolute value of the motion vector component difference is greater than 0. abs_mvd_greater1_flag[compIdx] specifies whether the absolute value of the motion vector component difference is greater than 1. When abs_mvd_greater1_flag[compId x] is not present, it is inferred to be equal to 0. The syntax element abs_mvd_minus2[compIdx] specifies the absolute value of the motion vector component difference. When abs_mvd_minus2[compIdx] is not present, it is inferred to be equal to -1.

[0252] In addition, mvd_sign_flag[compIdx] specifies the sign of the motion vector component difference as follows. If mvd_sign_flag[compIdx] is equal to 0, the corresponding motion vector component difference has a positive value. Otherwise, if mvd_sign_flag[compIdx] is equal to 1, the corresponding motion vector component difference has a negative value. When mvd_sign_flag[compIdx] is not present, it is inferred to be equal to 0. For a motion vector difference lMvd[compIdx] with compIdx=0..1, it can be derived as follows: lMvd[compIdx]=abs_mvd_greater0_flag[compIdx]*(abs_mvd_minus2[compIdx]+2)*(1-2*mvd_sign_flag[compIdx]). The value of lMvd[[compIdx] is in the range of -217 to 217-1, inclusive.

[0253] Furthermore, depending on the value of MotionModelIdc[x0][y0], the motion vector difference (MVD) can be derived as follows. If MotionModelIdc[x0][y0] is equal to 0, then the variable MvdLX[x0][y0][compIdx] specifies the difference between the list X vector component to be used and its prediction, where X is 0 or 1. Furthermore, the array indices x0, y0 specify the position (x0, y0) of the top left luma sample of the considered coding block relative to the top left luma sample of the picture.

[0254] Furthermore, the array index compIdx specifies the horizontal or vertical component motion vector difference that can be derived as follows. If refList is equal to 0, then MvdL0[x0][y0][compIdx] is set equal to lMvd[compIdx] for compIdx=0..1. Furthermore, when refList is equal to 1, MvdL1[x0][y0][compIdx] is set equal to lMvd[compIdx] for compIdx=0..1. Otherwise (MotionModelIdc[x0][y0] is not equal to 0), the variable MvdCpLX[x0][y0][cpIdx][compIdx] specifies the difference between the List X vector component to be used and its prediction, where X is 0 or 1. Furthermore, the array indices x0, y0 specify the position (x0, y0) of the top left luma sample of the coding block under consideration relative to the top left luma sample of the picture.

[0255] Furthermore, the array index cpIdx specifies a control point index. Furthermore, the array index compIdx specifies a horizontal or vertical component motion vector difference that can be derived as follows. If refList is equal to 0, then MvdCpL0[x0][y0][cpIdx][compIdx] is set equal to lMvd[[compIdx] for compIdx = 0..1. Otherwise, when refList is equal to 1, MvdCpL1[x0][y0][cpIdx][compIdx] is set equal to lMvd[[compIdx] for compIdx = 0..1. Furthermore, when sym_mvd_flag[x0][y0] is equal to 1, the value of MvdL1[x0][y0][compIdx] is in the range of -217 to 217-1, inclusive.

[0256] Another example of motion vector difference (MVD) encoding is shown in Table 4 below.

[0257] Table 4

[0258]

[0259] In the example of Table 4 above, abs_mvd_minus1[compIdx] specifies the absolute value of the motion vector component difference. In addition, for example, when abs_mvd_minus1[compIdx] does not exist, it is inferred to be equal to -1.

[0260] Another example of motion vector difference (MVD) coding is shown in the following Table 5. Table 5 shows an example of signaling an mvd_coding() syntax element that may be performed when indicating that a PU is to use IBC mode prediction.

[0261] Table 5

[0262]

[0263] In the example of Table 5 above, the syntax element "imv_flag()" may be present when at least one of the components of the encoded MVD is non-zero.

[0264] Figure 21 FIG. 1 shows an example coding order of binary numbers and corresponding syntax elements for signaling BVD or MVD according to an embodiment of the present disclosure. As shown in the figure, Figure 21 1 shows an example of a syntax element for encoding a component of a BVD or MVD (e.g., a horizontal component or a vertical component). For ease of explanation, as used in this disclosure, references to the value of an MVD may refer to the value of a component of the MVD. For example, in Figure 21 In the embodiment of the present invention, the mvd_coding syntax element may be signaled before the resolution indication of, for example, the imv_flag syntax element. For example, the BVD or MVD coding syntax element may include an indication of whether the value of "abs_greater0_flag" is greater than 0. This indication may be the syntax element "abs_bvd_greater0_flag" for BVD or the syntax element "abs_mvd_greater0_flag" for MVD. For ease of explanation, the following description may be provided with reference to MVD, but it should be understood that they are similarly applicable to BVD unless specific differences are specified. Figure 21As shown, the syntax element "abs_mvd_minus1" can be indicated as an Exponential Golomb code and represented as an "Exp-Golomb code" because if the syntax element abs_mvd_greater0_flag indicates that the MVD is greater than 0, then the MVD is at least 1 and the value represented as the Exp-Golomb code is equal to the true MVD value minus 1. In some examples, to encode the MVD, if abs_mvd_greater0_flag is set to 1, an additional indication of whether the MVD value is greater than 1 (e.g., abs_mvd_greater1_flag) can be indicated. In these examples, the Exp-Golomb code can correspond to the value of the MVD minus 2 because if both abs_mvd_greater0_flag and abs_mvd_greater1_flag are true, then the MVD value is at least 2. In other words, the value of the MVD value can be determined to be the value represented by the Exp-Golomb code plus 2.

[0265] As described above, the magnitude symbol of the Exp-Golomb code (or other Golomb code) includes a prefix and a suffix. In some examples, the magnitude symbol in the prefix can be context-coded (or coded in a conventional mode of an entropy encoder such as CABAC), as described above in Figure 17 In general, the magnitude sign of the suffix can be bypass coded. In some examples, such as Figure 21 As shown by the dotted line in Figure 18A -D, instead of encoding the magnitude symbol itself, one or more of the magnitude symbols of the suffix (e.g., a plurality of the most significant magnitude symbols of the suffix) may be context-encoded as an indication of whether the predicted value is equal to the corresponding value of the magnitude symbol of the BVD or MVD. After encoding (or parsing and decoding at a decoder) a code corresponding to the magnitude of the MVD (e.g., an Exp-Golomb code or an "abs_mvd_minus1" syntax element), the sign binary number (or binary symbol) may be encoded in an equal probability (EP) bypass mode (e.g., in CABAC). In some examples, the sign symbol may be similarly context-encoded as an indication of whether the value of the sign symbol of the BVD or MVD is equal to (or matches) the value of the corresponding sign symbol of the BVP (in the case of BVD) or the MVP (in the case of MVD). In some examples, the indication of the resolution may be signaled after all BVDs or MVDs are signaled (e.g., an IMV flag syntax element for BVD).

[0266] In some embodiments, one or more indications of the resolution of the BVD or MVD may be signaled by the encoder (and parsed and decoded by the decoder). For example, the one or more indications may include syntax elements and may further include amr_precision_index. As shown in Table 6 below, the combination of these indications may specify the resolution for intra block copy (IBC) mode (applicable to encoding BVD) and affine and translation models / modes (applicable to encoding MVD):

[0267] Table 6

[0268]

[0269] The above table shows the shift value applied to the vector difference (e.g., BVD in IBC or MVD in the affine and translation models) to achieve the resolution indicated in the brackets. It should be noted that with respect to Table 6, the default resolution of the vector difference can be 1 / 16. For example, since the default resolution of the MVD value is 1 / 16, to achieve the 4-sample resolution indicated in the translation model (e.g., amvr_flag is set to 1 and amvr_precision index is set to 2), the MVD value can be left-shifted by 6 (i.e., 1 / 16 resolution << 6) to obtain a resolution of 4 samples. In some embodiments, since there are two possible resolutions for the BVD encoded in IBC mode (1 sample or 4 samples), a single indication (e.g., the IMV flag) is used instead of the amvr_flag and amvr_precision_index flags. The indication can correspond to the amvr_precision_index flag used to encode the resolution of the MVD. For example, in IBC mode, amvr_flag is not signaled and may be set (or inferred) to 1 by the encoder and decoder.

[0270] In some examples, if amvr_flag is 0, no further indication (i.e., amvr_precision_index) is signaled to encode the resolution of the MVD. As shown above, the resolution (sometimes referred to as precision) of the MVD can indicate 1 / 16 samples, 1 / 4 samples, 1 / 2 samples, 1 sample, or 4 samples, depending on the combination of the indication and the specific mode. The specific mode can also be indicated in a separate syntax element.

[0271] In existing techniques for video coding, an indication of resolution (e.g., the resolution of an MVD or BVD indicated by an IMV flag) can be decoded / parsed after the syntax elements that signal the components of the BVD or MVD are signaled. For example, the indication of the resolution of the BVD can be an IMV flag. For example, the indication of the resolution of the MVD can be one or more flags that together correspond to the resolution of the MVD value (e.g., an AMVR flag and, depending on the value of the AMVR flag, an AMVR precision index flag). Because the indication of resolution is signaled at the encoder and parsed at the decoder after the BVD or MVD syntax elements, the indication of resolution may not be available when parsing the BVD or MVD components. In existing methods, this ordering can be used because when all BVD components of a block are non-zero, no resolution data needs to be signaled. Furthermore, this resolution indication can be performed for a set of blocks. For example, in existing methods, a set of blocks can be referred to as a coding unit (CU), which can contain several prediction units (PUs), each of which is referred to as a "block" or "PU" in the context of this disclosure. A problem with this approach is that the resolution information that can be utilized in conjunction with the binary numbers predicting the BVD or MVD is not available due to the order of parsing.

[0272] Embodiments of the present disclosure relate to apparatus and methods for selecting a context / probability model based on a first indication of the resolution of a block vector difference (BVD) or motion vector difference (MVD) and the position of a magnitude symbol of the BVD or MVD to be decoded / encoded. For example, the first indication of the resolution may be an IMV flag for encoding one or more symbols of the BVD, or may be one or more indications for encoding one or more symbols of the MVD, such as an AMVR_flag or AMVR_precision_index syntax element. In an example embodiment, the method for selecting a probability model based on the first indication of the resolution of the BVD or MVD and the position of the magnitude symbol of the BVD or MVD to be decoded may be implemented by a decoder. For example, the decoder receives a first indication of the resolution of the BVD or MVD in a bitstream. The decoder further selects a probability model from a plurality of probability models based on the first indication and the position of the magnitude symbol of the BVD or MVD to be decoded. The decoder further arithmetically decodes, based on the probability model, a second indication of whether the magnitude symbol of the BVD or MVD is equal to the corresponding magnitude symbol of a BVD or MVD predictor. Furthermore, the decoder further determines the value of the magnitude sign of the BVD or MVD based on the second indication and the value of the corresponding magnitude sign of the BVD or MVD predictor. In another example embodiment, the method for selecting a probability model based on a first indication of the resolution of the BVD or MVD and the position of the magnitude sign of the BVD or MVD to be encoded can be implemented by an encoder. For example, the encoder determines the value of the magnitude sign of the BVD or MVD to be encoded. The encoder further encodes the first indication of the resolution of the BVD or MVD in the bitstream. The encoder further selects a probability model from a plurality of probability models based on the first indication and the position of the magnitude sign of the BVD or MVD. Furthermore, the encoder further arithmetically encodes in the bitstream, based on the probability model, whether the magnitude sign of the BVD or MVD is equal to the corresponding magnitude sign of the BVD or MVD predictor.

[0273] In some embodiments, in certain modes, an indication of resolution may not be present and not signaled for BVD or MVD. For example, in multiple hypothesis prediction (MHP) mode, an indication (e.g., a flag or syntax element) is signaled by the encoder and parsed at the decoder, indicating merge mode. For example, the indication may be a flag set to 1 (e.g., general_merge_flag) indicating that inter prediction parameters for the current coding unit are to be inferred from neighboring inter-predicted partitions. In this merge mode, the inter prediction parameters may include an indication of resolution that is to be inferred and therefore not signaled. However, in MHP mode, the MVD is sometimes still signaled. However, the resolution cannot be determined at parsing time because it is not explicitly signaled. To address this issue, a probability model (which is different from the probability model used when the indication of resolution is present) is selected from multiple probability models to encode (e.g., encode or decode) one or more magnitude symbols of the BVD or MVD.

[0274] These and other features of the disclosure are further described below.

[0275] According to the example embodiments described herein, syntax elements may be coded in a different order so that the resolution, precision, magnitude, and / or IMV flag value of the BVD or MVD may be used to select a context / probability model for predicting one or more bins / symbols of the BVD or MVD. An example of motion vector difference (MVD) coding is shown in Table 7 below. Table 4 shows an example of signaling the mvd_coding() syntax element that may be performed when indicating that the PU will use IBC mode prediction.

[0276] Table 7

[0277]

[0278] In the example shown in Table 7, the syntax element mvd_coding() may include a syntax element that specifies whether the absolute value of the motion vector component difference is greater than 0. If the abs_mvd_greater0_flag[0] or abs_mvd_greater0_flag[1] syntax element is non-zero, then imv_flag() will be signaled in the bitstream.

[0279] Another example of MVD coding is shown in the following Table 8. Table 8 shows an example syntax of an element of mvd_coding(x0, y0, 0, 0) containing abs_mvd_greater0_flag[0] and abs_mvd_greater0_flag[1].

[0280] Table 8

[0281] mvd_coding(x0,y0,refList,cpIdx){ Descriptor abs_mvd_greater0_flag[0] ae(v) abs_mvd_greater0_flag[1] ae(v)

[0282] Another example of MVD coding is shown in the following Table 9. Table 9 shows an example syntax of an element of mvd_coding_remainder(x0, y0, 0, 0), which contains abs_mvd_greater0_flag[0] and abs_mvd_greater0_flag[1].

[0283] Table 9

[0284]

[0285] In the example shown in Table 9, when deriving the context element of the binary number of abs_mvd_minus1[0] and abs_mvd_minus1[1], the value of the IMV flag can be considered because it is indicated before the indication of mvd_coding_remainder(x0, y0, 0, 0). Herein, the terms "abs_mvd_minus1[1]" and "abs_bvd_ver_remainder" can be used interchangeably. In addition, in this document, the terms "abs_mvd_minus1[0]" and "abs_bvd_hor_remainder" can be used interchangeably.

[0286] Figure 22 An example of signaling a binary number and corresponding syntax element for a BVD or MVD according to an embodiment of the present disclosure is shown. In some examples, to achieve improved selection of context (or probability model) for symbols for context coding, one or more indications of the resolution of the BVD or MVD are considered and thus parsed before encoding the magnitude sign and the sign of the BVD or MVD. For example, Figure 22 As shown, the coding order of the binary numbers is specified for the signaling of the bvd_coding() syntax element and the imv_flag() syntax element. The syntax element "imv_flag" can be signaled after the "abs_bvd_greater0_flag" syntax element, and the "abs_bvd_minus1" syntax element (denoted as "Exp-Golomb code") can be signaled after the "imv_flag" syntax element. In an example, the value of imv_flag can be taken into account during the parsing of the remainder of the BVD (see also Figure 23 , "Parsing remainder (imv)"). Furthermore, the value of imv_flag may be taken into account, for example, during parsing of the suffix of a BVD (see also Figure 23Similarly, to parse an MVD, instead of imv_flag, one or more indications of resolution (e.g., amvr_flag and / or amvr_precision_index flags) may be parsed to determine the resolution of the MVD, as described above.

[0287] In this document, context encoding refers to entropy encoding an indication of whether the value of the magnitude symbol of the BVD or MVD matches (or is equal to) the value of the magnitude symbol of the BVD or MVD candidate used as a predictor of the BVD or MVD, as described above in Figure 18A -D. This context coding can further be applied to multiple magnitude symbols of BVD or MVD in prefix or suffix binary numbers, plus or minus symbols, or other related symbols as further described herein. Context coding can also be referred to herein as prediction based on the binary number performing the hypothesis check.

[0288] Figure 23 An example of a binary number and corresponding syntax element for signaling a BVD or MVD based on resolution (e.g., an IMV flag value for BVD) according to an embodiment of the present disclosure is shown. For ease of illustration, the following example is described with respect to a BVD, in which case the indication of resolution may be an IMV flag syntax element. However, it will be appreciated that similar operations may be performed for encoding symbols for an MVD, in which case the one or more indications of resolution may be, for example, amvr_flag and / or amvr_precision_index. Figure 23 As shown in , the context of the suffix binary number can be derived using the IMV flag value. More specifically, for the binary number position at Bpos, the following conditions can be checked according to the following equation (26) to determine the context / probability model:

[0289] 2 Bpos <(T / F) (26)

[0290] For example, when the IMV flag has a value of 0, F is equal to 1; and when the IMV flag has a value of 1, F is equal to 4. In the example, F equal to 1 corresponds to a 1-sample accuracy or resolution of BVD or MVD, and F equal to 4 corresponds to a 4-sample accuracy or resolution of BVD or MVD. Figure 23 In, T prefixis defined as a predetermined threshold for the maximum value of the prefix. In addition, referring to equation (21), T is a predetermined threshold to determine the context of the predicted suffix binary number based on the position of the predicted suffix binary number within the suffix. In the first example, T=16. In other examples, T can be equal to 4, 8, 32, 64, or other powers of 2. Returning to equation (21), when the condition is true, a first context Ctx1 can be specified for the suffix binary number encoding. Otherwise, when the condition is false, a second context Ctx2 can be specified for the suffix binary number encoding. In addition, in Figure 23 In [ 15 ], the step of "obtaining the significance S of the binary number based on imv" corresponds to determining the value of F in equation (21) above. In addition, it should be noted that instead of the suffix binary number, a predicted match of this binary number can be signaled. This predicted match indicates whether the derived binary value is correct or whether the derived suffix binary value should be rejected.

[0291] Figure 24 An example of deriving a context / probability model based on a threshold and a position value according to an embodiment of the present disclosure is shown. Figure 24 As shown in Example A, the equation of (21) can be used to determine the context / probability model (e.g., in Ctx1 and Ctx2) based on the example values ​​of T and F for each example B, as specified in more detail in Example C. In Example C, the threshold T is adjusted by dividing by F, which is based on the binary number position of Bpos (corresponding to 2 Bpos The binary position of Bpos is compared to the value of T (corresponding to 2) in version A / Equation (21). In another example, the equation of version B can be used to determine the context / probability model (e.g., in Ctx1 and Ctx2) based on the values ​​of T and F, as specified in more detail in Example D. In Example D, the binary position of Bpos is adjusted by multiplying by F (corresponding to 2 Bpos ), the binary position is compared with the threshold T corresponding to the version B of the equation. In addition, in Example C, a right bitwise / binary shift operation can be used instead of division. In addition, in Example D, a left bitwise / binary shift operation can be used instead of multiplication. For example, a first Ctx1 can be selected for a relatively low amplitude / binary position of the BVD or MVD, and a second Ctx2 can be selected for a relatively high amplitude / binary position of the BVD or MVD, which can reflect that the probability of accurate prediction is higher for a relatively high amplitude / binary position of the BVD or MVD. In another example, the equation according to version C can be used instead of version A or version B. Other example values ​​of these variables can be the same as those described above with respect to Figure 24The description above applies similarly. For example, as described above, for MVD, instead of imv_flag, one or more indications, such as amvr_flag and / or amvr_precision index, may be signaled to indicate the resolution of the MVD value. In an example, this indicated resolution may be applied to the position of the symbol being encoded and similarly compared to a threshold to select a context (or probability model) for entropy encoding the symbol. In another example, this indicated resolution may be applied to a threshold to determine an adjusted threshold, and the position of the symbol being encoded may be compared to the adjusted threshold to select a context (or probability model) for entropy encoding the symbol.

[0292] In some embodiments, to encode or decode the video content, the syntax elements of the video sequence are entropy encoded or decoded, respectively, as described above with respect to Figure 17 and Figure 18A -D. These syntax elements can be generated at the video encoder and can describe how the video signal can be reconstructed at the video decoder. For a coding unit (CU), the syntax elements can include intra prediction mode for intra prediction based on the CU, motion data (e.g., MVD and MVP related data) for inter prediction based on the CU, or displacement data (e.g., BVD and BVP related data) for IBC prediction based on the CU.

[0293] In some embodiments, to encode a syntax element, an encoder (e.g., entropy coding unit 218) may include a binarizer that first maps the value of the syntax element to a sequence of binary symbols (also known as a binary number). The binarizer may define a unique mapping of the value of the syntax element to the sequence of binary symbols. In other words, the binarizer may generate a binary representation of a non-binary valued syntax element. Binarization of the syntax element may help improve probabilistic modeling and implementation of arithmetic coding. For example, the binarizer may implement one or more binarization processes, such as unary, truncated unary, k-order truncated Rice, k-order exponential Golomb (EGk), fixed length, or some combination of two or more of these binarization processes. As is well known to those skilled in the art, the bits of the binary string to which the value of the syntax element has been binarized are sometimes referred to as a binary number, and a binary number may refer to one of the bits of the binary string.

[0294] After the binarizer maps the value of the syntax element to a sequence of binary symbols, one or more of the binary symbols can be processed by an arithmetic encoder, which can process each of the one or more binary symbols in one of at least two modes: a normal arithmetic coding mode or a bypass arithmetic coding mode to further increase compression.

[0295] In some embodiments, to decode binarized syntax elements, the decoder (e.g., entropy decoding unit 306) may include a debinarizer that reverses the operation of the binarizer and can map a sequence of binary symbols in a bitstream (including a video sequence) to the value of the syntax element. Similarly, the decoder may include an arithmetic decoder to reverse (i.e., decode) the arithmetic coding of the encoded syntax elements in the bitstream before the debinarizer determines the value of the syntax element from the sequence of binary symbols.

[0296] In some embodiments, the BVD can be encoded (e.g., in IBC mode) by binarizing the amplitude of the BVD (e.g., horizontal and / or vertical component amplitudes) using a binarization scheme, wherein the binarization scheme includes a first portion indicating a value range within which the amplitude of the BVD falls and a second portion indicating an exact value within the value range of the amplitude of the BVD. For example, the BVD includes a horizontal component and a vertical component, each of which can be binarized separately using a binarization scheme or code. For ease of explanation, whenever the BVD is described as being encoded, it should be understood that, according to some embodiments, each component of the BVD (e.g., horizontal / x and vertical / y) can be entropy encoded separately.

[0297] In some embodiments, in addition to encoding MVD in inter-frame prediction modes such as affine mode and translation mode, MVD can also be encoded in multiple hypothesis prediction (MHP) mode (i.e., another example of inter-frame prediction mode). In this mode, in addition to the conventional bi-prediction signal in affine and translation mode, one or more additional motion compensated prediction signals (indicating candidate reference blocks) are signaled. The resulting overall prediction signal of MHP can be obtained by sample-by-sample weighted superposition. With bi-directional prediction signal p bi and the first additional inter prediction signal / hypothesis h3, the resulting prediction signal p3 is obtained as follows:

[0298] p3=(1-α)p bi +αh3

[0299] The weighting factor α is specified by a new syntax element add_hyp_weight_idx according to the following mapping:

[0300] add_hyp_weight_idx α 0 1 / 4 1 -1 / 8

[0301] In some examples, more than one prediction signal may be used (eg, 2 or 3), for example, a first prediction signal may be determined as the resulting overall prediction signal iteratively accumulated with each additional prediction signal.

[0302] p n+1 =(1-α n+1 )p n +αn+1 h n+1

[0303] The resulting overall prediction signal is obtained as the final p n (i.e., p n has the largest index n).

[0304] The motion parameters for each additional prediction hypothesis can be signaled explicitly by specifying a reference index, a motion vector predictor (MVP) index, and a motion vector difference (MVD), or implicitly by specifying a merge index. A separate multi-hypothesis merge flag can indicate one of these two signaling modes for each prediction hypothesis of the MHP mode. In merge mode, similar to the merge mode described above for IBC, instead of signaling an MVD, an index can be signaled to infer or derive the MV based on the MVs of neighboring blocks of the current block that have been previously decoded.

[0305] In some embodiments, an indication of merge mode (e.g., general_merge_flag[x0][y0]) may be signaled for the current block to indicate whether inter prediction parameters for the current coding unit (e.g., containing the current block) are inferred or determined from neighboring inter-predicted partitions. The array indices x0, y0 specify the position (x0, y0) of the top-left luma sample of the coding block under consideration relative to the top-left luma sample of the picture. For MHP mode, the indication of merge mode is set to 1, indicating that inter prediction parameters are to be inferred. Furthermore, in MHP mode, although an indication for merge mode may be set in some examples, a separate indication (e.g., mh_merge_idx[i]) may be signaled for each prediction hypothesis that encodes the parameters for a particular hypothesis with index i. This separate indication enables the flexibility of encoding the prediction hypothesis in MHP mode as a merge index or as an MVD with an MVP index. Thus, in some examples, in MHP mode, even when merge mode is indicated (e.g., general_merge_flag syntax element), the MVD and MVP index may be signaled (similar to the indication of BVP for encoding BVD). In these examples, because merge mode is indicated or enabled, the resolution information of the MVD will not be signaled.

[0306] As described above, when an indication of the resolution of the vector differences (e.g., BVD or MVD) is not available before the magnitude and sign of the vector differences are parsed and entropy encoded, the above-described embodiments for selecting a context for entropy encoding the magnitude and sign of the vector differences cannot be performed. For example, when encoding the MVD in MHP mode, an indication of merge mode is signaled indicating that no resolution information of the MVD is explicitly signaled. Therefore, in some examples, when there is no indication of the resolution of the vector differences, a separate context (also referred to as a probability model) is selected to entropy encode one or more signs of the vector differences (e.g., Figure 21 and Figure 22 In some examples, this separate context is distinct from possible contexts that can be selected based on an indication of resolution (when available), such that when no indication of resolution is available, the context based on the indication of resolution is not erroneously updated when encoding the sign of the vector difference.

[0307] It should be further noted that in addition to or in place of one or more magnitude signs of BVD used in IBC, the above Figures 17 to 24 And below about Figures 25 to 27 The methods discussed above can be further applied to one or more magnitude signs of the MVD used in inter prediction (e.g., affine model / mode, translation model / mode, or MHP mode). For inter prediction, the terms BV, BVP, BVD, and BVD candidate can be replaced by the terms MV, MVP, MVD, and MVD candidate, as will be understood by one of ordinary skill in the art based on this disclosure. It should be further noted that the methods discussed above can be applied to IBC and inter prediction based on a translation motion model of the prediction block. In other examples, the methods discussed above can be applied to IBC and inter prediction based on an affine motion model of the prediction block. In this document, the term "binary number" can refer to a bit or binary symbol used to encode and decode the sign of a BVD or MVD.

[0308] In this document, context encoding of a sign or magnitude symbol of a suffix may refer to entropy encoding an indication of whether the value of a sign (e.g., a magnitude symbol or a sign symbol) of a BVD or MVD is equal to (i.e., matches) the value of a corresponding symbol of a BVD or MVD candidate used as a predictor of the BVD or MVD. This context encoding may further be applied to multiple magnitude symbols, sign symbols, or other related symbols of the BVD or MVD in a prefix or suffix binary number, as further described herein. Context encoding may also be referred to herein as prediction based on a binary number on which a hypothesis check is performed.

[0309] It should be further noted that the coding order of the sign binary number, the prefix binary number, and the suffix binary number may be different from the predicted order of the binary number when performing the hypothesis check. The prediction of the binary number can be performed in the order from the highest significance to the lowest significance of the binary number, wherein the sign binary number can be considered to have a higher significance than the most significant predicted binary number of the suffix. On the encoder side, the binary string of the predicted binary number can be signaled in a different order, i.e., from the less significant binary number to the more significant binary number. Accordingly, on the decoder side, the binary string is restored during the parsing process in the same order as encoded on the encoder side. In addition, the context selection for the encoding or decoding of the binary number can utilize the previously encoded binary number. Therefore, the coding order for the predicted binary number signaling determines whether the context originates from the binary number with less significance or the binary number with more significance.

[0310] Figure 25 Flowchart 2500 is shown of a method for selecting a probability model based on a first indication of a resolution of a block vector difference (BVD) and a position of a magnitude symbol of the BVD to be decoded according to an embodiment of the present disclosure. The method of flowchart 2500 may be implemented by a decoder (e.g., Figure 3 The decoder 300 in is implemented.

[0311] The method of flowchart 2500 begins at 2502. At 2502, a decoder receives a first indication of a resolution of a block vector difference (BVD) in a bitstream. In an example, the first indication of the resolution of the BVD may indicate an integer resolution or a fractional resolution of the BVD. In an example, the first indication of the resolution of the BVD may be based on an integer motion vector (IMV) value, a syntax element, or a flag.

[0312] At 2504, the decoder selects a probability model from a plurality of probability models based on the first indication and the position of the magnitude symbol of the BVD to be decoded. In an example, the position may be the position of the magnitude symbol in the suffix portion of the codeword corresponding to the BVD. At 2506, the decoder arithmetically decodes, based on the probability model, whether the magnitude symbol of the BVD is equal to the corresponding magnitude symbol of the BVD predictor. Furthermore, at 2508, the decoder determines the value of the magnitude symbol of the BVD based on the second indication and the value of the corresponding magnitude symbol of the BVD predictor.

[0313] In an example, the decoder may further determine BVD candidates based on one or more magnitude signs of the BVD to be predicted. In an example, the decoder may further determine template matching costs for the BVD candidates, wherein each template matching cost is between a current template of a current block (CB) and a reference template of a reference block (RB) candidate indicated by a corresponding BVD candidate in the BVD candidates. In an example, the decoder may further select one of the BVD candidates as a BVD predictor based on the template matching cost.

[0314] In an example, the decoder may further determine a value of the resolution based on a first indication of the resolution of the BVD, wherein the probability model is selected based on the value of the resolution and the position. In an example, selecting the probability model may further include adjusting the position based on the value of the resolution indicated by the first indication, and comparing the adjusted position to a threshold. In an example, the value of the resolution may include a shift value. In an example, adjusting the position may include shifting the value of the position in the same direction as the shift of the shift value. In an example, the value of the position may be a power of two of the position. In another example, the value of the resolution may include a shift value, and adjusting the position may include adjusting the position in the same direction as the shift of the shift value. In another example, the value of the position may indicate a second position of a second amplitude symbol of the BVD.

[0315] In an example, the decoder may further select the first probability model based on the adjusted position being less than a threshold. In another example, the decoder may further select the second probability model based on the adjusted position being greater than or equal to the threshold. In an example, the first probability model may include a first probability indicating that the sign of the magnitude of the BVD is equal to the sign of the corresponding magnitude of the BVD predictor. In another example, the second probability model may include a second probability indicating that the sign of the magnitude of the BVD is equal to the sign of the corresponding magnitude of the BVD predictor, wherein the second probability is greater than the first probability.

[0316] In another example, selecting the probability model may further include adjusting a threshold based on a value of resolution indicated by the first indication, and comparing the adjusted threshold to a value of position. In an example, the value of resolution may include a shift value. In an example, adjusting the threshold may include shifting the value of the threshold in a direction opposite to the shift of the shift value. In an example, the value of the threshold may be based on a predetermined value. In an example, the predetermined value may be one of 1, 2, 4, 8, 16, 32, 64, 128, or 256. In an example, the value of position may be a power of two of position. In another example, the value of resolution may include a shift value, and the value of the threshold may indicate a second position of a second magnitude symbol of the BVD. In another example, adjusting the threshold may include adjusting the second position in a direction opposite to the shift of the shift value.

[0317] In an example, the decoder may further select the first probability model based on the adjusted threshold being greater than or equal to the value of the position. In another example, the decoder may further select the second probability model based on the adjusted threshold being less than the value of the position. In an example, the first probability model may include a first probability indicating that the sign of the magnitude of the BVD is equal to the sign of the corresponding magnitude of the BVD predictor. In another example, the second probability model may include a second probability indicating that the sign of the magnitude of the BVD is equal to the sign of the corresponding magnitude of the BVD predictor, wherein the second probability is greater than the first probability.

[0318] In an example, the decoder may further receive a third indication in the bitstream of whether a component of the BVD is greater than zero. In an example, the decoder may further parse the first indication from the bitstream based on receiving the third indication. In an example, the decoder may further determine the BVD based on a difference between a block vector (BV) and a block vector predictor (BVP). In an example, the resolution of the BVD may further be based on a resolution of the BV. In an example, the decoder may further determine a value of the IMV flag based on a maximum absolute value of the components of the BVD and an indication of the resolution of the BV. In an example, a first value of the IMV flag may correspond to a 1-sample increment of the magnitude of the components of the BVD, and a second value of the IMV flag may correspond to a 4-sample increment of the magnitude of the components of the BVD.

[0319] As explained previously, Figure 25 The operations described in

[0014] can also be applied to MVD, in which case BVD can be replaced by MVD and BVP can be replaced by MVP. For example, a decoder can receive a first indication of the resolution of a motion vector difference (MVD) in a bitstream. Based on the first indication and the position of the magnitude sign of the MVD to be decoded (e.g., the MVD component of the MVD), the decoder selects a probability model from a plurality of probability models. Based on the probability model, the decoder arithmetically decodes a second indication of whether the magnitude sign of the MVD is equal to the corresponding magnitude sign of the MVD predictor. The decoder determines the value of the magnitude sign of the MVD based on the second indication and the value of the corresponding magnitude sign of the MVD predictor.

[0320] Figure 26 2600 is a flowchart illustrating a method for selecting a probability model based on a first indication of a resolution of a block vector difference (BVD) and a position of a magnitude sign of the BVD to be encoded according to an embodiment of the present disclosure. The method of flowchart 2600 may be implemented by an encoder (e.g., Figure 2 The encoder 200 in is implemented.

[0321] The method of flowchart 2600 begins at 2602. At 2602, the encoder determines a value for a magnitude sign of a block vector difference (BVD) to be encoded. At 2604, the encoder encodes a first indication of a resolution of the BVD in the bitstream. In an example, the first indication of the resolution of the BVD may indicate an integer resolution or a fractional resolution of the BVD. In an example, the first indication of the resolution of the BVD may be based on an integer motion vector (IMV) value, a syntax element, or a flag.

[0322] At 2606, the encoder selects a probability model from a plurality of probability models based on the first indication and the position of the magnitude symbol of the BVD. In an example, the position may be the position of the magnitude symbol in the suffix portion of the codeword corresponding to the BVD. Furthermore, at 2608, the encoder arithmetically encodes in the bitstream a second indication of whether the magnitude symbol of the BVD is equal to the corresponding magnitude symbol of the BVD predictor based on the probability model.

[0323] In an example, the encoder may further determine BVD candidates based on one or more magnitude signs of the BVD to be predicted. In an example, the encoder may further determine template matching costs for the BVD candidates, wherein each template matching cost is between a current template of a current block (CB) and a reference template of a reference block (RB) candidate indicated by a corresponding BVD candidate in the BVD candidates. In an example, the encoder may further select one of the BVD candidates as a BVD predictor based on the template matching cost.

[0324] In an example, the encoder may further determine a value of the resolution based on a first indication of a resolution of the BVD, wherein the probability model is selected based on the value of the resolution and the position. In an example, selecting the probability model may further include adjusting the position based on the value of the resolution indicated by the first indication, and comparing the adjusted position to a threshold. In an example, the value of the resolution may include a shift value. In an example, adjusting the position may include shifting the value of the position in the same direction as the shift of the shift value. In an example, the value of the position may be a power of two of the position. In another example, the value of the resolution may include a shift value, and adjusting the position may include adjusting the position in the same direction as the shift of the shift value. In another example, the value of the position may indicate a second position of a second amplitude symbol of the BVD.

[0325] In an example, the encoder may further select the first probability model based on the adjusted position being less than a threshold. In another example, the encoder may further select the second probability model based on the adjusted position being greater than or equal to the threshold. In an example, the first probability model may include a first probability indicating that the sign of the magnitude of the BVD is equal to the sign of the corresponding magnitude of the BVD predictor. In another example, the second probability model may include a second probability indicating that the sign of the magnitude of the BVD is equal to the sign of the corresponding magnitude of the BVD predictor, wherein the second probability is greater than the first probability.

[0326] In another example, selecting the probability model may further include adjusting a threshold based on a value of resolution indicated by the first indication, and comparing the adjusted threshold to a value of position. In an example, the value of resolution may include a shift value. In an example, adjusting the threshold may include shifting the value of the threshold in a direction opposite to the shift of the shift value. In an example, the value of the threshold may be based on a predetermined value. In an example, the predetermined value may be one of 1, 2, 4, 8, 16, 32, 64, 128, or 256. In an example, the value of position may be a power of two of position. In another example, the value of resolution may include a shift value, and the value of the threshold may indicate a second position of a second magnitude symbol of the BVD. In another example, adjusting the threshold may include adjusting the second position in a direction opposite to the shift of the shift value.

[0327] In an example, the encoder may further select the first probability model based on the adjusted threshold being greater than or equal to the value of the position. In another example, the encoder may further select the second probability model based on the adjusted threshold being less than the value of the position. In an example, the first probability model may include a first probability indicating that the sign of the magnitude of the BVD is equal to the sign of the corresponding magnitude of the BVD predictor. In another example, the second probability model may include a second probability indicating that the sign of the magnitude of the BVD is equal to the sign of the corresponding magnitude of the BVD predictor, wherein the second probability is greater than the first probability.

[0328] In an example, the encoder may further encode in the bitstream a third indication of whether the components of the BVD are greater than zero. In an example, the encoder may further encode in the bitstream the first indication based on encoding the third indication. In an example, the encoder may further determine the BVD based on a difference between a block vector (BV) and a block vector predictor (BVP). In an example, the resolution of the BVD may be further based on a resolution of the BV. In an example, the encoder may further determine the value of the IMV flag based on a maximum absolute value of the components of the BVD and an indication of the resolution of the BV. In an example, the first value of the IMV flag may correspond to a 1-sample increment of the magnitude of the components of the BVD, and the second value of the IMV flag may correspond to a 4-sample increment of the magnitude of the components of the BVD.

[0329] As explained previously, Figure 26 The operations described in

[0014] can also be applied to MVD, in which case the BVD can be replaced by the MVD and the BVP can be replaced by the MVP. For example, the encoder can determine the value of the magnitude sign of the block vector difference (BVD) to be encoded. The encoder encodes a first indication of the resolution of the BVD in the bitstream. The encoder selects a probability model from a plurality of probability models based on the first indication and the position of the magnitude sign of the BVD. The encoder arithmetically encodes a second indication of whether the magnitude sign of the BVD is equal to the corresponding magnitude sign of the BVD predictor in the bitstream based on the probability model.

[0330] Figure 27 A flowchart of a method for selecting a probability model for entropy encoding symbols of a vector difference based on an indication that the resolution of the vector difference is absent (eg, not explicitly signaled) according to an embodiment of the present disclosure is shown. Figure 27 The operation can be performed by the encoder (for example, Figure 2 200 in the encoder) and the decoder (e.g., Figure 3 The decoder 300 in is implemented reciprocally.

[0331] At 2702, a first indication associated with whether a resolution of a vector difference is not present (e.g., not explicitly signaled) is entropy encoded. In some examples, the first indication may indicate whether the resolution is not explicitly signaled. For example, the first indication may be a merge flag.

[0332] For example, the vector difference may be a BVD in IBC mode, or a MVD in an inter prediction mode such as an affine mode, a translation mode, or an MHP mode, as described above. In some examples, when explicitly signaling for BVD, the resolution may be indicated by an IMV flag. In some examples, when explicitly signaling for MVD, the resolution may be indicated by one or more indications including the amvr_flag and / or amvr_precision_index flags. In some embodiments, if the first indication indicates that the resolution of the vector difference is signaled, the above description of how to use the decoder and encoder, respectively, may apply. Figure 25 and 26 Describes the method used for context selection.

[0333] At 2704, based on the first indication indicating that resolution is not present (or not explicitly signaled), a probability model is selected from a plurality of probability models. In some examples, this probability model (also referred to as a context) is different from possible probability models that may be selected for encoding a symbol (e.g., a sign symbol or a magnitude symbol), as described above with respect to Figures 24 to 26 described.

[0334] At 2706, based on the selected probability model, a second indication of whether the sign of the vector difference is equal to the corresponding sign of the vector difference predictor is entropy encoded (e.g., arithmetically encoded using an encoder such as CABAC). Figure 17 and 18A -D describes an example of how to entropy encode this second indication.

[0335] For example, when performed by an encoder, the encoder may determine a vector difference (e.g., an MVD or a BVD) and signal (e.g., arithmetically encode) a first indication. For example, the first indication may be a merge flag for an MVD in an MHP mode, where no resolution indication (e.g., amvr_flag and / or amvr_precision_index) is explicitly signaled for the MVD. Based on this first indication, the encoder may select a probability model associated with no resolution indication from a plurality of probability models. Then, when arithmetically encoding the sign of the vector difference for which the context is encoded as a "hypothesis check" indication (e.g., the sign of the suffix or the magnitude sign of the MVD), the selected probability model may be used to arithmetically encode a second indication of whether the sign of the vector difference is equal to the corresponding sign of a vector difference predictor (e.g., the BVD predictor for a BVD or the MVD predictor for an MBVD), as described above with respect to Figure 18A -D described.

[0336] For example, when performed by a decoder, the decoder may parse and arithmetically decode the first indication. For example, the first indication may be a merge flag for an MVD in an MHP mode, where no resolution indication (e.g., amvr_flag and / or amvr_precision_index) is explicitly signaled for the MVD. Based on this first indication, the decoder may select a probability model associated with no resolution indication from a plurality of probability models. Then, when arithmetically decoding the sign of a vector difference (e.g., a sign or magnitude sign of a suffix of an MVD) for a context decoded as a "hypothesis check" indication, the selected probability model may be used to arithmetically decode a second indication of whether the sign of the vector difference is equal to the corresponding sign of a vector difference predictor (e.g., a BVD predictor for a BVD or an MVD predictor for an MBVD), as described above with respect to Figure 18A -D. To determine the value of the symbol, the decoded second indication can be compared with the value of the corresponding symbol of the determined vector difference predictor. For example, if the second indication indicates that the symbol is equal to the symbol of the predictor, the decoder determines that the value of the symbol is the same as the value of the symbol of the predictor. Relatedly, if the second indication indicates that the symbol is not equal to the symbol of the predictor, the decoder determines that the value of the symbol is the opposite of the value of the symbol of the predictor.

[0337] The embodiments of the present disclosure may be implemented in hardware using analog and / or digital circuits, in software, by executing instructions by one or more general-purpose or special-purpose processors, or as a combination of hardware and software. Thus, the embodiments of the present disclosure may be implemented in the context of a computer system or other processing system. This example computer system 2800 is Figure 28 The blocks depicted in the above figures (e.g., Figure 1 、 2 3) can be executed on one or more computer systems 2800. In addition, each of the steps of the flowcharts depicted in the present disclosure can be implemented on one or more computer systems 2800.

[0338] Computer system 2800 includes one or more processors, such as processor 2804. Processor 2804 can be, for example, a special-purpose processor, a general-purpose processor, a microprocessor, or a digital signal processor. Processor 2804 can be connected to a communication infrastructure 2802 (e.g., a bus or a network). Computer system 2800 can also include a main memory 2806, such as random access memory (RAM), and can also include a secondary memory 2808.

[0339] Secondary storage 2808 may include, for example, a hard drive 2810 and / or a removable storage drive 2812, representing a tape drive, an optical disk drive, or the like. Removable storage drive 2812 may read from and / or write to a removable storage unit 2816 in a well-known manner. Removable storage unit 2816 may represent a tape, an optical disk, or the like that is read from and written to by removable storage drive 2812. As will be appreciated by those skilled in the relevant art, removable storage unit 2816 contains a computer-usable storage medium having stored therein computer software and / or data.

[0340] In alternative embodiments, secondary storage 2808 may include other similar components for allowing computer programs or other instructions to be loaded into computer system 2800. Such components may include, for example, a removable storage unit 2818 and an interface 2814. Examples of such components may include a program cartridge and cartridge interface (such as that found in video game devices) that allows software and data to be transferred from removable storage unit 2818 to computer system 2800, a removable memory chip (such as an EPROM or PROM) and associated socket, a pen drive, and a USB port, as well as other removable storage units 2818 and interfaces 2814.

[0341] The computer system 2800 may also include a communication interface 2820. The communication interface 2820 allows software and data to be transferred between the computer system 2800 and external devices. Examples of the communication interface 2820 may include a modem, a network interface (e.g., an Ethernet card), a communication port, etc. The software and data transferred via the communication interface 2820 may be in the form of signals, which may be electronic, electromagnetic, optical, or other signals capable of being received by the communication interface 2820. These signals are provided to the communication interface 2820 via a communication path 2822. The communication path 2822 carries the signals and may be implemented using wire or cable, optical fiber, a telephone line, a cellular phone link, an RF link, and other communication channels.

[0342] As used herein, the terms "computer program medium" and "computer-readable medium" are used to refer to tangible storage media, such as removable storage units 2816 and 2818 or a hard disk installed in hard drive 2810. These computer program products are means for providing software to computer system 2800. Computer programs (also known as computer control logic) can be stored in main memory 2806 and / or secondary memory 2808. The computer programs can also be received via communication interface 2820. Such computer programs, when executed, can enable computer system 2800 to implement the present disclosure as discussed herein. Specifically, the computer programs, when executed, enable processor 2804 to implement the processes of the present disclosure, such as any of the methods described herein. Thus, such computer programs represent controllers of computer system 2800.

[0343] In another embodiment, features of the present disclosure may be implemented in hardware using, for example, hardware components such as application specific integrated circuits (ASICs) and gate arrays. It will also be apparent to those skilled in the art to implement a hardware state machine to perform the functions described herein.

Claims

1. A method comprising: receiving, in a bitstream, a first indication of a resolution of a vector difference for a current block; determining a value of the resolution based on the first indication; Select a probability model from among multiple probability models based on: the position of the sign of the magnitude of the vector difference to be decoded; and Based on the value of the resolution, do one of the following: adjusting the position and comparing the adjusted position to a threshold; or adjusting the threshold and comparing the adjusted threshold with the value of the position; arithmetically decoding a second indication of whether the sign of the magnitude of the vector difference is equal to a corresponding sign of the magnitude of a vector difference predictor based on the probability model; determining a value of the sign of the magnitude of the vector difference based on the second indication and the value of the corresponding sign of the magnitude of the vector difference predictor; as well as The current block is decoded based on the determined value of the magnitude sign of the vector difference, wherein the vector difference is a block vector difference (BVD) or a motion vector difference (MVD).

2. A method comprising: receiving, in a bitstream, a first indication of a resolution of a vector difference for a current block; selecting a probability model from a plurality of probability models based on the first indication and a position of a magnitude sign of the vector difference to be decoded; arithmetically decoding a second indication of whether the sign of the magnitude of the vector difference is equal to a corresponding sign of the magnitude of a vector difference predictor based on the probability model; determining a value of the sign of the magnitude of the vector difference based on the second indication and the value of the corresponding sign of the magnitude of the vector difference predictor; as well as The current block is decoded based on the determined value of the magnitude sign of the vector difference.

3. The method according to claim 2, wherein: The vector difference is a block vector difference (BVD) and the vector difference predictor is a BVD predictor; or The vector difference is a motion vector difference MVD and the vector difference predictor is a MVD predictor.

4. The method according to any one of claims 2 to 3, further comprising: determining a value of the resolution based on the first indication of the resolution of the vector difference; and Wherein the probability model is selected based on the value of the resolution and the location.

5. The method according to any one of claims 2 to 4, wherein said selecting said probability model further comprises: adjusting the position based on a value of the resolution indicated by the first indication; as well as The adjusted position is compared to a threshold.

6. The method according to claim 5, wherein: said value of said resolution comprising a shift value; said adjusting said position comprises shifting the value of said position in the same direction as the shifting of said shift value; and The value of the position is a power of two of the position.

7. The method according to claim 5, wherein: said value of said resolution comprising a shift value; said adjusting said position comprises adjusting said position in the same direction as the shift of said shift value; and The value of the position indicates a second position of a second magnitude sign of the vector difference.

8. The method according to any one of claims 5 to 7, further comprising: selecting a first probability model based on the adjusted position being less than the threshold; as well as Based on the adjusted position being greater than or equal to the threshold, a second probability model is selected.

9. The method according to any one of claims 2 to 4, wherein said selecting said probability model further comprises: adjusting a threshold based on a value of the resolution indicated by the first indication; as well as The adjusted threshold is compared to the value at the location.

10. The method according to claim 9, wherein: said value of said resolution comprising a shift value; said adjusting said threshold value comprises shifting the value of said threshold value in a direction opposite to the shifting of said shift value; The value of the threshold is based on a predetermined value: The predetermined value is one of 1, 2, 4, 8, 16, 32, 64, 128, or 256; and The value of the position is a power of two of the position.

11. The method according to claim 9, wherein: said value of said resolution comprising a shift value; The value of the threshold indicates a second position of a second magnitude sign of the vector difference; and The adjusting the threshold value includes adjusting the second position in a direction opposite to the shifting of the shift value.

12. The method according to any one of claims 9 to 11, wherein: selecting a first probability model based on the adjusted threshold being greater than or equal to the value for the location; and Based on the adjusted threshold being less than the value for the location, a second probability model is selected.

13. The method according to any one of claims 8 or 12, wherein: the first probability model comprising a first probability indicating the second indication that the sign of the magnitude of the vector difference is equal to the sign of the corresponding magnitude of the vector difference predictor; the second probability model comprising a second probability indicating the second indication that the sign of the magnitude of the vector difference is equal to the sign of the corresponding magnitude of the vector difference predictor; and The second probability is greater than the first probability.

14. The method according to any one of claims 2 to 13, wherein said determining said value of said magnitude sign further comprises: determining that the value of the sign of the magnitude of the vector difference is equal to the value of the corresponding sign of the magnitude of the vector difference predictor based on the second indication indicating that the sign of the magnitude of the vector difference is equal to the sign of the corresponding magnitude of the vector difference predictor; as well as The value of the magnitude sign of the vector difference is determined to be opposite to the value of the corresponding magnitude sign of the vector difference predictor based on the second indication indicating that the magnitude sign of the vector difference is not equal to the corresponding magnitude sign of the vector difference predictor.

15. The method according to any one of claims 2 to 14, further comprising: determining a vector difference candidate based on one or more magnitude signs of the vector difference to be predicted; determining template matching costs for the vector difference candidates, wherein each template matching cost is between a current template of the current block CB and a reference template of a reference block RB candidate indicated by a corresponding vector difference candidate among the vector difference candidates; as well as One of the vector difference candidates is selected as the vector difference predictor based on the template matching cost.

16. The method of any one of claims 2 to 15, wherein the first indication of the resolution of the vector difference indicates an integer resolution or a fractional resolution of the vector difference.

17. The method according to any one of claims 2 to 16, wherein the first indication of the resolution of the vector difference is based on an integer motion vector (IMV) value, a syntax element or a flag.

18. The method according to any one of claims 2 to 17, wherein the position is the position where the magnitude symbol is located in a suffix portion of a codeword corresponding to the vector difference.

19. The method of any one of claims 2 to 18, further comprising receiving in the bitstream a third indication of whether a component of the vector difference is greater than zero.

20. The method of claim 19, further comprising parsing the first indication from the bitstream based on the receiving the third indication.

21. The method of any one of claims 2 to 20, further comprising determining the vector difference based on a difference between a vector and a vector predictor.

22. The method of claim 21, wherein the resolution of the vector difference is further based on a resolution of the vector.

23. The method of claim 22, further comprising determining a value of the IMV flag based on: the maximum absolute value of the components of the vector difference; and an indication of the resolution of the vector.

24. The method of claim 23, wherein: A first value of the IMV flag corresponds to a 1-sample increment of the magnitude of the component of the vector difference; and The second value of the IMV flag corresponds to a 4-sample increment of the magnitude of the component of the vector difference.

25. The method of any one of claims 2 to 24, wherein the probability model is different from a second probability selected based on the absence of the first indication received in the bitstream.

26. The method of claim 25, further comprising receiving a third indication enabling the first indication for the vector difference. The method of claim 26 , wherein the third indication indicates a merge mode.

28. The method according to any one of claims 2 to 27, wherein the vector difference has a multi-hypothesis prediction (MHP) mode.

29. The method of any one of claims 2 to 28, wherein the first indication comprises a flag for merge mode.

30. A method according to any one of claims 2 to 29, wherein the probability model is associated with the first indication.

31. A method comprising: determining a value of a magnitude sign of a vector difference of a current block to be encoded; encoding in a bitstream a first indication of a resolution of the vector difference; determining a value of the resolution based on the first indication; Select a probability model from among multiple probability models based on: the position of the sign of the magnitude of the vector difference; and Based on the value of the resolution, do one of the following: adjusting the position and comparing the adjusted position to a threshold; or adjusting the threshold and comparing the adjusted threshold with the value of the position; as well as A second indication of whether the sign of the magnitude of the vector difference is equal to a corresponding sign of the magnitude of a vector difference predictor is arithmetically encoded in the bitstream based on the probability model, wherein the vector difference is a block vector difference (BVD) or a motion vector difference (MVD).

32. A method comprising: determining a value of a magnitude sign of a vector difference of a current block to be encoded; encoding in a bitstream a first indication of a resolution of the vector difference; selecting a probability model from a plurality of probability models based on the first indication and the position of the sign of the magnitude of the vector difference; as well as A second indication of whether the sign of the magnitude of the vector difference is equal to a corresponding sign of the magnitude of a vector difference predictor is arithmetically encoded in the bitstream based on the probability model.

33. The method of claim 32, wherein: The vector difference is a block vector difference (BVD) and the vector difference predictor is a BVD predictor; or The vector difference is a motion vector difference MVD and the vector difference predictor is a MVD predictor.

34. The method according to any one of claims 32 to 33, further comprising: determining a value of the resolution based on the first indication of the resolution of the vector difference; and Wherein the probability model is selected based on the value of the resolution and the location.

35. The method of any one of claims 32 to 34, wherein said selecting said probability model further comprises: adjusting the position based on a value of the resolution indicated by the first indication; as well as The adjusted position is compared to a threshold.

36. The method of claim 35, wherein: said value of said resolution comprising a shift value; said adjusting said position comprises shifting the value of said position in the same direction as the shifting of said shift value; and The value of the position is a power of two of the position.

37. The method of claim 35, wherein: said value of said resolution comprising a shift value; said adjusting said position comprises adjusting said position in the same direction as the shift of said shift value; and The value of the position indicates a second position of a second magnitude sign of the vector difference.

38. The method according to any one of claims 35 to 37, further comprising: selecting a first probability model based on the adjusted position being less than the threshold; as well as Based on the adjusted position being greater than or equal to the threshold, a second probability model is selected.

39. The method of any one of claims 32 to 34, wherein said selecting said probability model further comprises: adjusting a threshold based on a value of the resolution indicated by the first indication; as well as The adjusted threshold is compared to the value at the location.

40. The method of claim 39, wherein: said value of said resolution comprising a shift value; said adjusting said threshold value comprises shifting the value of said threshold value in a direction opposite to the shifting of said shift value; The value of the threshold is based on a predetermined value: The predetermined value is one of 1, 2, 4, 8, 16, 32, 64, 128, or 256; and The value of the position is a power of two of the position.

41. The method of claim 39, wherein: said value of said resolution comprising a shift value; The value of the threshold indicates a second position of a second magnitude sign of the vector difference; and The adjusting the threshold value includes adjusting the second position in a direction opposite to the shifting of the shift value.

42. A method according to any one of claims 39 to 41, wherein: selecting a first probability model based on the adjusted threshold being greater than or equal to the value for the location; and Based on the adjusted threshold being less than the value for the location, a second probability model is selected.

43. The method according to any one of claims 38 or 42, wherein: the first probability model comprising a first probability indicating the second indication that the sign of the magnitude of the vector difference is equal to the sign of the corresponding magnitude of the vector difference predictor; the second probability model comprising a second probability indicating the second indication that the sign of the magnitude of the vector difference is equal to the sign of the corresponding magnitude of the vector difference predictor; and The second probability is greater than the first probability.

44. An apparatus comprising: one or more processors; as well as A memory storing instructions that, when executed by the one or more processors, cause the apparatus to perform a method according to any one of claims 1 to 43.

45. A non-transitory computer-readable medium comprising instructions that, when executed by one or more processors of a device, cause the device to perform the method of any one of claims 1 to 43.